@verdaccio/hooks 6.0.0-6-next.40 → 6.0.0-6-next.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/build/notify-request.js.map +1 -1
- package/build/notify.js.map +1 -1
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @verdaccio/hooks
|
|
2
2
|
|
|
3
|
+
## 6.0.0-6-next.42
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- @verdaccio/core@6.0.0-6-next.72
|
|
8
|
+
- @verdaccio/logger@6.0.0-6-next.40
|
|
9
|
+
|
|
10
|
+
## 6.0.0-6-next.41
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- @verdaccio/logger@6.0.0-6-next.39
|
|
15
|
+
- @verdaccio/core@6.0.0-6-next.71
|
|
16
|
+
|
|
3
17
|
## 6.0.0-6-next.40
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify-request.js","names":["_debug","_interopRequireDefault","require","_undici","_core","_logger","obj","__esModule","default","debug","buildDebug","notifyRequest","url","options","response","fetch","body","JSON","stringify","method","headers","status","json","HTTP_STATUS","BAD_REQUEST","Error","logger","info","content","err","error","errorMessage","message"],"sources":["../src/notify-request.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { fetch } from 'undici';\n\nimport { HTTP_STATUS } from '@verdaccio/core';\nimport { logger } from '@verdaccio/logger';\n\nconst debug = buildDebug('verdaccio:hooks:request');\n\nexport type FetchOptions = {\n body: string;\n headers?: {};\n method?: string;\n};\n\nexport async function notifyRequest(url: string, options: FetchOptions): Promise<boolean> {\n let response;\n try {\n debug('uri %o', url);\n response = await fetch(url, {\n body: JSON.stringify(options.body),\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n });\n debug('response.status %o', response.status);\n const body = await response.json();\n if (response.status >= HTTP_STATUS.BAD_REQUEST) {\n throw new Error(body);\n }\n\n logger.info(\n { content: options.body },\n 'The notification @{content} has been successfully dispatched'\n );\n return true;\n } catch (err: any) {\n debug('request error %o', err);\n logger.error(\n { errorMessage: err?.message },\n 'notify service has thrown an error: @{errorMessage}'\n );\n return false;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA2C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,yBAAyB,CAAC;AAQ5C,eAAeC,aAAaA,CAACC,GAAW,EAAEC,OAAqB,EAAoB;EACxF,IAAIC,QAAQ;EACZ,IAAI;IACFL,KAAK,CAAC,QAAQ,EAAEG,GAAG,CAAC;IACpBE,QAAQ,GAAG,MAAM,IAAAC,aAAK,EAACH,GAAG,EAAE;MAC1BI,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACL,OAAO,CAACG,IAAI,CAAC;MAClCG,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QAAE,cAAc,EAAE;MAAmB;IAChD,CAAC,CAAC;IACFX,KAAK,CAAC,qBAAqB,EAAEK,QAAQ,CAACO,MAAM,CAAC;IAC7C,MAAML,IAAI,GAAG,MAAMF,QAAQ,CAACQ,IAAI,
|
|
1
|
+
{"version":3,"file":"notify-request.js","names":["_debug","_interopRequireDefault","require","_undici","_core","_logger","obj","__esModule","default","debug","buildDebug","notifyRequest","url","options","response","fetch","body","JSON","stringify","method","headers","status","json","HTTP_STATUS","BAD_REQUEST","Error","logger","info","content","err","error","errorMessage","message"],"sources":["../src/notify-request.ts"],"sourcesContent":["import buildDebug from 'debug';\nimport { fetch } from 'undici';\n\nimport { HTTP_STATUS } from '@verdaccio/core';\nimport { logger } from '@verdaccio/logger';\n\nconst debug = buildDebug('verdaccio:hooks:request');\n\nexport type FetchOptions = {\n body: string;\n headers?: {};\n method?: string;\n};\n\nexport async function notifyRequest(url: string, options: FetchOptions): Promise<boolean> {\n let response;\n try {\n debug('uri %o', url);\n response = await fetch(url, {\n body: JSON.stringify(options.body),\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n });\n debug('response.status %o', response.status);\n const body = await response.json();\n if (response.status >= HTTP_STATUS.BAD_REQUEST) {\n throw new Error(body);\n }\n\n logger.info(\n { content: options.body },\n 'The notification @{content} has been successfully dispatched'\n );\n return true;\n } catch (err: any) {\n debug('request error %o', err);\n logger.error(\n { errorMessage: err?.message },\n 'notify service has thrown an error: @{errorMessage}'\n );\n return false;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AAA2C,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAE3C,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,yBAAyB,CAAC;AAQ5C,eAAeC,aAAaA,CAACC,GAAW,EAAEC,OAAqB,EAAoB;EACxF,IAAIC,QAAQ;EACZ,IAAI;IACFL,KAAK,CAAC,QAAQ,EAAEG,GAAG,CAAC;IACpBE,QAAQ,GAAG,MAAM,IAAAC,aAAK,EAACH,GAAG,EAAE;MAC1BI,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACL,OAAO,CAACG,IAAI,CAAC;MAClCG,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QAAE,cAAc,EAAE;MAAmB;IAChD,CAAC,CAAC;IACFX,KAAK,CAAC,qBAAqB,EAAEK,QAAQ,CAACO,MAAM,CAAC;IAC7C,MAAML,IAAI,GAAG,MAAMF,QAAQ,CAACQ,IAAI,CAAC,CAAC;IAClC,IAAIR,QAAQ,CAACO,MAAM,IAAIE,iBAAW,CAACC,WAAW,EAAE;MAC9C,MAAM,IAAIC,KAAK,CAACT,IAAI,CAAC;IACvB;IAEAU,cAAM,CAACC,IAAI,CACT;MAAEC,OAAO,EAAEf,OAAO,CAACG;IAAK,CAAC,EACzB,8DACF,CAAC;IACD,OAAO,IAAI;EACb,CAAC,CAAC,OAAOa,GAAQ,EAAE;IACjBpB,KAAK,CAAC,kBAAkB,EAAEoB,GAAG,CAAC;IAC9BH,cAAM,CAACI,KAAK,CACV;MAAEC,YAAY,EAAEF,GAAG,aAAHA,GAAG,uBAAHA,GAAG,CAAEG;IAAQ,CAAC,EAC9B,qDACF,CAAC;IACD,OAAO,KAAK;EACd;AACF"}
|
package/build/notify.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notify.js","names":["_debug","_interopRequireDefault","require","_handlebars","_logger","_notifyRequest","obj","__esModule","default","debug","buildDebug","compileTemplate","content","metadata","Promise","resolve","reject","handler","template","Handlebars","compile","error","handleNotify","notifyEntry","remoteUser","publishedPackage","_metadata","_metadata2","regex","name","packagePattern","RegExp","packagePatternFlags","test","publisher","options","body","JSON","stringify","headers","Array","isArray","header","map","item","Object","is","key","hasOwnProperty","endpoint","Error","notifyRequest","method","sendNotification","notify","config","isSingle","keys","includes","response","results","allSettled","keyId","catch","logger","promiseValue","value"],"sources":["../src/notify.ts"],"sourcesContent":["/* eslint-disable no-undef */\nimport buildDebug from 'debug';\nimport Handlebars from 'handlebars';\n\nimport { logger } from '@verdaccio/logger';\nimport { Config, Notification, Package, RemoteUser } from '@verdaccio/types';\n\nimport { FetchOptions, notifyRequest } from './notify-request';\n\nconst debug = buildDebug('verdaccio:hooks');\n\nexport function compileTemplate(content, metadata) {\n // FUTURE: multiple handlers\n return new Promise((resolve, reject) => {\n let handler;\n try {\n if (!handler) {\n debug('compile default template handler %o', content);\n const template: HandlebarsTemplateDelegate = Handlebars.compile(content);\n return resolve(template(metadata));\n }\n } catch (error: any) {\n debug('error template handler %o', error);\n reject(error);\n }\n });\n}\n\nexport async function handleNotify(\n metadata: Partial<Package>,\n notifyEntry,\n remoteUser: Partial<RemoteUser>,\n publishedPackage: string\n): Promise<boolean> {\n let regex;\n if (metadata.name && notifyEntry.packagePattern) {\n regex = new RegExp(notifyEntry.packagePattern, notifyEntry.packagePatternFlags || '');\n if (!regex.test(metadata.name)) {\n return false;\n }\n }\n\n let content;\n // FIXME: publisher is not part of the expected types metadata\n // @ts-ignore\n if (typeof metadata?.publisher === 'undefined' || metadata?.publisher === null) {\n // @ts-ignore\n metadata = { ...metadata, publishedPackage, publisher: { name: remoteUser.name as string } };\n debug('template metadata %o', metadata);\n content = await compileTemplate(notifyEntry.content, metadata);\n }\n\n const options: FetchOptions = {\n body: JSON.stringify(content),\n };\n\n // provides fallback support, it's accept an Object {} and Array of {}\n if (notifyEntry.headers && Array.isArray(notifyEntry.headers)) {\n const header = {};\n // FIXME: we can simplify this\n notifyEntry.headers.map(function (item): void {\n if (Object.is(item, item)) {\n for (const key in item) {\n /* eslint no-prototype-builtins: 0 */\n if (item.hasOwnProperty(key)) {\n header[key] = item[key];\n }\n }\n }\n });\n options.headers = header;\n } else if (Object.is(notifyEntry.headers, notifyEntry.headers)) {\n options.headers = notifyEntry.headers;\n }\n\n if (!notifyEntry.endpoint) {\n debug('error due endpoint is missing');\n throw new Error('missing parameter');\n }\n\n return notifyRequest(notifyEntry.endpoint, {\n method: notifyEntry.method,\n ...options,\n });\n}\n\nexport function sendNotification(\n metadata: Partial<Package>,\n notify: Notification,\n remoteUser: Partial<RemoteUser>,\n publishedPackage: string\n): Promise<boolean> {\n return handleNotify(metadata, notify, remoteUser, publishedPackage) as Promise<any>;\n}\n\nexport async function notify(\n metadata: Partial<Package>,\n config: Partial<Config>,\n remoteUser: Partial<RemoteUser>,\n publishedPackage: string\n): Promise<boolean[]> {\n debug('init send notification');\n if (config.notify) {\n const isSingle = Object.keys(config.notify).includes('method');\n if (isSingle) {\n debug('send single notification');\n try {\n const response = await sendNotification(\n metadata,\n config.notify as Notification,\n remoteUser,\n publishedPackage\n );\n return [response];\n } catch {\n debug('error on sending single notification');\n return [false];\n }\n } else {\n debug('send multiples notification');\n const results = await Promise.allSettled(\n Object.keys(config.notify).map((keyId: string) => {\n // @ts-ignore\n const item = config.notify[keyId];\n debug('send item %o', item);\n return sendNotification(metadata, item, remoteUser, publishedPackage);\n })\n ).catch((error) => {\n logger.error({ error }, 'notify request has failed: @error');\n });\n\n // @ts-ignore\n return Object.keys(results).map((promiseValue) => results[promiseValue].value);\n }\n } else {\n debug('no notifications configuration detected');\n return [false];\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AAA+D,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAP/D;;AASA,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,iBAAiB,CAAC;AAEpC,SAASC,eAAeA,CAACC,OAAO,EAAEC,QAAQ,EAAE;EACjD;EACA,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,IAAIC,OAAO;IACX,IAAI;MACF,IAAI,CAACA,OAAO,EAAE;QACZR,KAAK,CAAC,qCAAqC,EAAEG,OAAO,CAAC;QACrD,MAAMM,QAAoC,GAAGC,mBAAU,CAACC,OAAO,CAACR,OAAO,CAAC;QACxE,OAAOG,OAAO,CAACG,QAAQ,CAACL,QAAQ,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E;IACjB,MAAME,QAAQ,GAAGX,MAAM,CAACY,IAAI,CAACF,MAAM,CAACD,MAAM,CAAC,CAACI,QAAQ,CAAC,QAAQ,CAAC;IAC9D,IAAIF,QAAQ,EAAE;MACZ/C,KAAK,CAAC,0BAA0B,CAAC;MACjC,IAAI;QACF,MAAMkD,QAAQ,GAAG,MAAMN,gBAAgB,CACrCxC,QAAQ,EACR0C,MAAM,CAACD,MAAM,EACb9B,UAAU,EACVC,
|
|
1
|
+
{"version":3,"file":"notify.js","names":["_debug","_interopRequireDefault","require","_handlebars","_logger","_notifyRequest","obj","__esModule","default","debug","buildDebug","compileTemplate","content","metadata","Promise","resolve","reject","handler","template","Handlebars","compile","error","handleNotify","notifyEntry","remoteUser","publishedPackage","_metadata","_metadata2","regex","name","packagePattern","RegExp","packagePatternFlags","test","publisher","options","body","JSON","stringify","headers","Array","isArray","header","map","item","Object","is","key","hasOwnProperty","endpoint","Error","notifyRequest","method","sendNotification","notify","config","isSingle","keys","includes","response","results","allSettled","keyId","catch","logger","promiseValue","value"],"sources":["../src/notify.ts"],"sourcesContent":["/* eslint-disable no-undef */\nimport buildDebug from 'debug';\nimport Handlebars from 'handlebars';\n\nimport { logger } from '@verdaccio/logger';\nimport { Config, Notification, Package, RemoteUser } from '@verdaccio/types';\n\nimport { FetchOptions, notifyRequest } from './notify-request';\n\nconst debug = buildDebug('verdaccio:hooks');\n\nexport function compileTemplate(content, metadata) {\n // FUTURE: multiple handlers\n return new Promise((resolve, reject) => {\n let handler;\n try {\n if (!handler) {\n debug('compile default template handler %o', content);\n const template: HandlebarsTemplateDelegate = Handlebars.compile(content);\n return resolve(template(metadata));\n }\n } catch (error: any) {\n debug('error template handler %o', error);\n reject(error);\n }\n });\n}\n\nexport async function handleNotify(\n metadata: Partial<Package>,\n notifyEntry,\n remoteUser: Partial<RemoteUser>,\n publishedPackage: string\n): Promise<boolean> {\n let regex;\n if (metadata.name && notifyEntry.packagePattern) {\n regex = new RegExp(notifyEntry.packagePattern, notifyEntry.packagePatternFlags || '');\n if (!regex.test(metadata.name)) {\n return false;\n }\n }\n\n let content;\n // FIXME: publisher is not part of the expected types metadata\n // @ts-ignore\n if (typeof metadata?.publisher === 'undefined' || metadata?.publisher === null) {\n // @ts-ignore\n metadata = { ...metadata, publishedPackage, publisher: { name: remoteUser.name as string } };\n debug('template metadata %o', metadata);\n content = await compileTemplate(notifyEntry.content, metadata);\n }\n\n const options: FetchOptions = {\n body: JSON.stringify(content),\n };\n\n // provides fallback support, it's accept an Object {} and Array of {}\n if (notifyEntry.headers && Array.isArray(notifyEntry.headers)) {\n const header = {};\n // FIXME: we can simplify this\n notifyEntry.headers.map(function (item): void {\n if (Object.is(item, item)) {\n for (const key in item) {\n /* eslint no-prototype-builtins: 0 */\n if (item.hasOwnProperty(key)) {\n header[key] = item[key];\n }\n }\n }\n });\n options.headers = header;\n } else if (Object.is(notifyEntry.headers, notifyEntry.headers)) {\n options.headers = notifyEntry.headers;\n }\n\n if (!notifyEntry.endpoint) {\n debug('error due endpoint is missing');\n throw new Error('missing parameter');\n }\n\n return notifyRequest(notifyEntry.endpoint, {\n method: notifyEntry.method,\n ...options,\n });\n}\n\nexport function sendNotification(\n metadata: Partial<Package>,\n notify: Notification,\n remoteUser: Partial<RemoteUser>,\n publishedPackage: string\n): Promise<boolean> {\n return handleNotify(metadata, notify, remoteUser, publishedPackage) as Promise<any>;\n}\n\nexport async function notify(\n metadata: Partial<Package>,\n config: Partial<Config>,\n remoteUser: Partial<RemoteUser>,\n publishedPackage: string\n): Promise<boolean[]> {\n debug('init send notification');\n if (config.notify) {\n const isSingle = Object.keys(config.notify).includes('method');\n if (isSingle) {\n debug('send single notification');\n try {\n const response = await sendNotification(\n metadata,\n config.notify as Notification,\n remoteUser,\n publishedPackage\n );\n return [response];\n } catch {\n debug('error on sending single notification');\n return [false];\n }\n } else {\n debug('send multiples notification');\n const results = await Promise.allSettled(\n Object.keys(config.notify).map((keyId: string) => {\n // @ts-ignore\n const item = config.notify[keyId];\n debug('send item %o', item);\n return sendNotification(metadata, item, remoteUser, publishedPackage);\n })\n ).catch((error) => {\n logger.error({ error }, 'notify request has failed: @error');\n });\n\n // @ts-ignore\n return Object.keys(results).map((promiseValue) => results[promiseValue].value);\n }\n } else {\n debug('no notifications configuration detected');\n return [false];\n }\n}\n"],"mappings":";;;;;;;;;AACA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAGA,IAAAG,cAAA,GAAAH,OAAA;AAA+D,SAAAD,uBAAAK,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAP/D;;AASA,MAAMG,KAAK,GAAG,IAAAC,cAAU,EAAC,iBAAiB,CAAC;AAEpC,SAASC,eAAeA,CAACC,OAAO,EAAEC,QAAQ,EAAE;EACjD;EACA,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACtC,IAAIC,OAAO;IACX,IAAI;MACF,IAAI,CAACA,OAAO,EAAE;QACZR,KAAK,CAAC,qCAAqC,EAAEG,OAAO,CAAC;QACrD,MAAMM,QAAoC,GAAGC,mBAAU,CAACC,OAAO,CAACR,OAAO,CAAC;QACxE,OAAOG,OAAO,CAACG,QAAQ,CAACL,QAAQ,CAAC,CAAC;MACpC;IACF,CAAC,CAAC,OAAOQ,KAAU,EAAE;MACnBZ,KAAK,CAAC,4BAA4B,EAAEY,KAAK,CAAC;MAC1CL,MAAM,CAACK,KAAK,CAAC;IACf;EACF,CAAC,CAAC;AACJ;AAEO,eAAeC,YAAYA,CAChCT,QAA0B,EAC1BU,WAAW,EACXC,UAA+B,EAC/BC,gBAAwB,EACN;EAAA,IAAAC,SAAA,EAAAC,UAAA;EAClB,IAAIC,KAAK;EACT,IAAIf,QAAQ,CAACgB,IAAI,IAAIN,WAAW,CAACO,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M;QACNlD,KAAK,CAAC,sCAAsC,CAAC;QAC7C,OAAO,CAAC,KAAK,CAAC;MAChB;IACF,CAAC,MAAM;MACLA,KAAK,CAAC,6BAA6B,CAAC;MACpC,MAAMmD,OAAO,GAAG,MAAM9C,OAAO,CAAC+C,UAAU,CACtChB,MAAM,CAACY,IAAI,CAACF,MAAM,CAACD,MAAM,CAAC,CAACX,GAAG,CAAEmB,KAAa,IAAK;QAChD;QACA,MAAMlB,IAAI,GAAGW,MAAM,CAACD,MAAM,CAACQ,KAAK,CAAC;QACjCrD,KAAK,CAAC,cAAc,EAAEmC,IAAI,CAAC;QAC3B,OAAOS,gBAAgB,CAACxC,QAAQ,EAAE+B,IAAI,EAAEpB,UAAU,EAAEC,gBAAgB,CAAC;MACvE,CAAC,CACH,CAAC,CAACsC,KAAK,CAAE1C,KAAK,IAAK;QACjB2C,cAAM,CAAC3C,KAAK,CAAC;UAAEA;QAAM,CAAC,EAAE,mCAAmC,CAAC;MAC9D,CAAC,CAAC;;MAEF;MACA,OAAOwB,MAAM,CAACY,IAAI,CAACG,OAAO,CAAC,CAACjB,GAAG,CAAEsB,YAAY,IAAKL,OAAO,CAACK,YAAY,CAAC,CAACC,KAAK,CAAC;IAChF;EACF,CAAC,MAAM;IACLzD,KAAK,CAAC,yCAAyC,CAAC;IAChD,OAAO,CAAC,KAAK,CAAC;EAChB;AACF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verdaccio/hooks",
|
|
3
|
-
"version": "6.0.0-6-next.
|
|
3
|
+
"version": "6.0.0-6-next.42",
|
|
4
4
|
"description": "loaders logic",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
"node": ">=16"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@verdaccio/core": "6.0.0-6-next.
|
|
33
|
-
"@verdaccio/logger": "6.0.0-6-next.
|
|
32
|
+
"@verdaccio/core": "6.0.0-6-next.72",
|
|
33
|
+
"@verdaccio/logger": "6.0.0-6-next.40",
|
|
34
34
|
"core-js": "3.30.2",
|
|
35
35
|
"debug": "4.3.4",
|
|
36
36
|
"handlebars": "4.7.7",
|
|
37
37
|
"undici": "4.16.0"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@types/node": "16.18.
|
|
41
|
-
"@verdaccio/auth": "6.0.0-6-next.
|
|
42
|
-
"@verdaccio/config": "6.0.0-6-next.
|
|
40
|
+
"@types/node": "16.18.35",
|
|
41
|
+
"@verdaccio/auth": "6.0.0-6-next.51",
|
|
42
|
+
"@verdaccio/config": "6.0.0-6-next.72",
|
|
43
43
|
"@verdaccio/types": "11.0.0-6-next.25"
|
|
44
44
|
},
|
|
45
45
|
"funding": {
|