From aa4aa83e8a2f6a29ebe7c0b43ccc560a37fe2da9 Mon Sep 17 00:00:00 2001 From: "Jian-Chen Chen (jesse)" Date: Wed, 24 Jun 2020 15:27:29 +0800 Subject: [PATCH] feat: types for https config (#368) * types for https config * extend config --- core/types/index.d.ts | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/types/index.d.ts b/core/types/index.d.ts index 3dcdb175..03b56071 100644 --- a/core/types/index.d.ts +++ b/core/types/index.d.ts @@ -293,14 +293,19 @@ declare module '@verdaccio/types' { sort_packages?: string; } - interface HttpsConf { - key?: string; - cert?: string; + interface HttpsConfKeyCert { + key: string; + cert: string; ca?: string; - pfx?: string; + } + + interface HttpsConfPfx { + pfx: string; passphrase?: string; } + type HttpsConf = HttpsConfKeyCert | HttpsConfPfx; + interface JWTOptions { sign: JWTSignOptions; verify: JWTVerifyOptions; @@ -365,6 +370,10 @@ declare module '@verdaccio/types' { [key: string]: any; } + interface ConfigWithHttps extends Config { + https: HttpsConf; + } + interface ITokenActions { saveToken(token: Token): Promise; deleteToken(user: string, tokenKey: string): Promise;