From 1dac3214592f7275255578b6eb78379c8e07498d Mon Sep 17 00:00:00 2001 From: "@jotadeveloper" <@jotadeveloper> Date: Mon, 2 Jul 2018 08:18:03 +0200 Subject: [PATCH] fix: improvements config interface --- core/types/src/types.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/core/types/src/types.js b/core/types/src/types.js index ffe6b425..4d2a0745 100644 --- a/core/types/src/types.js +++ b/core/types/src/types.js @@ -159,10 +159,13 @@ declare type verdaccio$UpLinkConf = { } declare type verdaccio$PackageAccess = { - storage: string; - publish: string; - proxy: string; - access: string; + storage?: string; + publish?: Array; + proxy?: Array; + access?: Array; + allow_access?: Array; + allow_publish?: Array; + proxy_access?: Array; } declare type verdaccio$PackageList = { @@ -245,18 +248,18 @@ declare type verdaccio$ConfigFile = { notifications: verdaccio$Notifications; } -declare type verdaccio$Config = { +declare interface verdaccio$Config { user_agent: string; server_id: any; _debug?: boolean; - storage: string; + storage?: string | void; secret: string; self_path: string; packages: verdaccio$PackageList; uplinks: verdaccio$UpLinksConfList; - logs: Array; - web: verdaccio$WebConf; - auth: verdaccio$AuthConf; + logs?: Array; + web?: verdaccio$WebConf; + auth?: verdaccio$AuthConf; publish?: verdaccio$PublishOptions; url_prefix?: string; store?: any; @@ -266,11 +269,11 @@ declare type verdaccio$Config = { https_proxy?: string; no_proxy?: string; max_body_size?: string; - notifications: verdaccio$Notifications; + notifications?: verdaccio$Notifications; middlewares?: any; - checkSecretKey: (token: string) => string; - hasProxyTo(pkg: string, upLink: string): boolean; - getMatchedPackagesSpec?: (storage: string) => verdaccio$PackageAccess; + checkSecretKey(token: string): string; + getMatchedPackagesSpec(storage: string): verdaccio$PackageAccess | void; + [key: string]: any; } declare type verdaccio$SyncReturn = Error | void;