diff --git a/.github/workflows/nodejs-sdk.workflow.yml b/.github/workflows/nodejs-sdk.workflow.yml index 6ed4bb6..512f4cf 100644 --- a/.github/workflows/nodejs-sdk.workflow.yml +++ b/.github/workflows/nodejs-sdk.workflow.yml @@ -35,7 +35,10 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ env.NODE_VERSION }} + # Set Github Packages Token + - name: Set Github Packages Token + run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ./apps/${{ inputs.app-path-name }}/.npmrc # Install dependencies - name: Install dependencies run: yarn --frozen-lockfile --pure-lockfile diff --git a/.npmrc b/.npmrc deleted file mode 100644 index c3492c8..0000000 --- a/.npmrc +++ /dev/null @@ -1 +0,0 @@ -//npm.pkg.github.com/:_authToken=GITHUB_TOKEN diff --git a/package.json b/package.json index 04f3bc0..cee0db6 100644 --- a/package.json +++ b/package.json @@ -8,8 +8,8 @@ "author": "Andres Olave", "license": "Apache 2.0", "scripts": { - "lint": "eslint . --ext .js,.ts,.tsx", - "lint:fix": "eslint --fix --ext .js,.ts,.tsx .", + "lint": "eslint . --ext .js,.ts,.tsx,.json", + "lint:fix": "eslint --fix --ext .js,.ts,.tsx,.json .", "test": "jest" }, "engines": { diff --git a/packages/sample-server/package.json b/packages/sample-server/package.json index 80fd60b..0f4dc74 100644 --- a/packages/sample-server/package.json +++ b/packages/sample-server/package.json @@ -3,23 +3,23 @@ "version": "0.0.1", "description": "VNF Wallet Sample Nodejs Server", "scripts": { - "lint": "eslint . --ext .js,.ts,.tsx", - "lint:fix": "eslint --fix --ext .js,.ts,.tsx .", + "lint": "eslint . --ext .js,.ts,.tsx,.json", + "lint:fix": "eslint --fix --ext .js,.ts,.tsx,.json .", "test": "jest", - "dev": "NODE_ENV=dev ts-node-dev --log-error --files ./src/server.ts", - "build": "tsc -p tsconfig.json", - "start": "NODE_ENV=production node dist/server.js" + "start": "NODE_ENV=dev ts-node --log-error --files ./src/server.ts", + "start:dev": "NODE_ENV=dev ts-node-dev --log-error --files ./src/server.ts" }, "author": "Andres Olave", "license": "Apache-2.0", "engines": { - "node": ">= 18.0.0" + "node": ">= 20.0.0" }, "dependencies": { "@fastify/autoload": "~5.7.1", + "axios": "^1.4.0", "env-var": "~7.3.0", - "fastify": "~4.15.0", - "@velocitycareerlabs/vnf-nodejs-wallet-sdk": "^0.9.10" + "fastify": "~4.28.0", + "fastify-plugin": "4.5.1" }, "devDependencies": { "@jest/globals": "~29.5.0", diff --git a/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts b/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts new file mode 100644 index 0000000..0d88d88 --- /dev/null +++ b/packages/sample-server/src/crypto-services/JwtSignServiceImpl.ts @@ -0,0 +1,37 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { + Nullish, + VCLJwt, + VCLJwtSignService, + VCLDidJwk, + VCLJwtDescriptor, + VCLToken +} from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; +import { generateSignedJwtFetcher } from "../fetchers"; + +export class JwtSignServiceImpl implements VCLJwtSignService { + async sign( + jwtDescriptor: VCLJwtDescriptor, + didJwk: VCLDidJwk, + nonce: Nullish, + // eslint-disable-next-line unused-imports/no-unused-vars,no-unused-vars + remoteCryptoServicesToken: Nullish + ): Promise { + try { + const jwtJson = await generateSignedJwtFetcher(jwtDescriptor, didJwk, nonce); + return new Promise((resolve) => { + resolve(VCLJwt.fromEncodedJwt(jwtJson['compactJwt'] as string)); + }); + } catch (e) { + return new Promise((resolve, reject) => { + reject(e); + }); + } + } +} diff --git a/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts b/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts new file mode 100644 index 0000000..b0fd4a3 --- /dev/null +++ b/packages/sample-server/src/crypto-services/JwtVerifyServiceImpl.ts @@ -0,0 +1,27 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { verifyJwtFetcher } from "../fetchers"; +import { VCLPublicJwk, Nullish, VCLJwtVerifyService, VCLJwt } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; + +export class JwtVerifyServiceImpl implements VCLJwtVerifyService { + async verify( + jwt: VCLJwt, + publicJwk: Nullish, + ): Promise { + try { + const verificationJson = await verifyJwtFetcher(jwt, publicJwk); + return new Promise((resolve) => { + resolve(verificationJson['verified'] as boolean || false); + }); + } catch (e) { + return new Promise((resolve, reject) => { + reject(e); + }); + } + } +} diff --git a/packages/sample-server/src/crypto-services/KeyServiceImpl.ts b/packages/sample-server/src/crypto-services/KeyServiceImpl.ts new file mode 100644 index 0000000..0f620d1 --- /dev/null +++ b/packages/sample-server/src/crypto-services/KeyServiceImpl.ts @@ -0,0 +1,27 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { VCLDidJwk, VCLDidJwkDescriptor, VCLKeyService } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; +import { generateDidJwkFetcher } from "../fetchers"; + +export class KeyServiceImpl implements VCLKeyService { + + async generateDidJwk(didJwkDescriptor: VCLDidJwkDescriptor): Promise { + try { + const didJwkJson = await generateDidJwkFetcher( + didJwkDescriptor, + ); + return new Promise((resolve) => { + resolve(VCLDidJwk.fromJSON(didJwkJson)); + }); + } catch (e) { + return new Promise((resolve, reject) => { + reject(e); + }); + } + } +} \ No newline at end of file diff --git a/packages/sample-server/src/crypto-services/index.ts b/packages/sample-server/src/crypto-services/index.ts new file mode 100644 index 0000000..2dad6c6 --- /dev/null +++ b/packages/sample-server/src/crypto-services/index.ts @@ -0,0 +1,16 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { KeyServiceImpl } from './KeyServiceImpl'; +import { JwtSignServiceImpl } from './JwtSignServiceImpl'; +import { JwtVerifyServiceImpl } from './JwtVerifyServiceImpl'; + +export { + KeyServiceImpl, + JwtSignServiceImpl, + JwtVerifyServiceImpl +} diff --git a/packages/sample-server/src/fetchers/fetcher.ts b/packages/sample-server/src/fetchers/fetcher.ts new file mode 100644 index 0000000..40a2658 --- /dev/null +++ b/packages/sample-server/src/fetchers/fetcher.ts @@ -0,0 +1,34 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; + +interface FetcherConfig extends AxiosRequestConfig { + data?: T; +} + +async function fetcher(config: FetcherConfig): Promise { + const axiosConfig: AxiosRequestConfig = { + ...config, + url: `${config.url}`, + }; + + try { + const response: AxiosResponse = await axios(axiosConfig); + return response.data; + } catch (error) { + if (axios.isAxiosError(error)) { + console.error('Axios error:', error.message); + throw error; + } else { + console.error('Unexpected error:', error); + throw new Error('An unexpected error occurred'); + } + } +} + +export default fetcher; \ No newline at end of file diff --git a/packages/sample-server/src/fetchers/generate-did-jwk-fetcher.ts b/packages/sample-server/src/fetchers/generate-did-jwk-fetcher.ts new file mode 100644 index 0000000..e79ac1a --- /dev/null +++ b/packages/sample-server/src/fetchers/generate-did-jwk-fetcher.ts @@ -0,0 +1,23 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { getCreateDidKeyServiceUrl } from "./urls"; +import { CurrentEnvironment } from "../global"; +import fetcher from "./fetcher"; +import { Dictionary, VCLDidJwkDescriptor } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; + +export async function generateDidJwkFetcher(didJwkDescriptor: VCLDidJwkDescriptor): Promise> { + const config = { + url: getCreateDidKeyServiceUrl(CurrentEnvironment), + method: 'POST', + data: { + crv: `${didJwkDescriptor.signatureAlgorithm}`, + didMethod: 'did:jwk', + } + }; + return fetcher(config); +} \ No newline at end of file diff --git a/packages/sample-server/src/fetchers/generate-signed-jwt-fetcher.ts b/packages/sample-server/src/fetchers/generate-signed-jwt-fetcher.ts new file mode 100644 index 0000000..cee2f38 --- /dev/null +++ b/packages/sample-server/src/fetchers/generate-signed-jwt-fetcher.ts @@ -0,0 +1,77 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { getJwtSignServiceUrl } from "./urls"; +import { CurrentEnvironment } from "../global"; +import fetcher from "./fetcher"; +import { + VCLJwt, + VCLDidJwk, + VCLJwtDescriptor, + Dictionary, + Nullish +} from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; + +export async function generateSignedJwtFetcher( + jwtDescriptor: VCLJwtDescriptor, + didJwk: VCLDidJwk, + nonce: Nullish, +): Promise> { + const config = { + url: getJwtSignServiceUrl(CurrentEnvironment), + method: 'POST', + data: generateJwtPayloadToSign( + jwtDescriptor, + nonce, + didJwk + ), + }; + return await fetcher(config); +} + +function generateJwtPayloadToSign( + jwtDescriptor: VCLJwtDescriptor, + nonce: Nullish, + didJwk: VCLDidJwk +): Dictionary { + const retVal: Dictionary = {}; + const header: Dictionary = {}; + const options: Dictionary = {}; + const payload: Dictionary = jwtDescriptor.payload ? { ...jwtDescriptor.payload } : {}; + + header[CodingKeys.KeyJwk] = didJwk.publicJwk.valueJson; + header[CodingKeys.KeyKid] = didJwk.kid; + + options[CodingKeys.KeyKeyId] = didJwk.keyId; + + payload[CodingKeys.KeyNonce] = nonce; + payload[CodingKeys.KeyAud] = jwtDescriptor.aud; + payload[CodingKeys.KeyJti] = jwtDescriptor.jti; + payload[CodingKeys.KeyIss] = jwtDescriptor.iss; + + retVal[CodingKeys.KeyHeader] = header; + retVal[CodingKeys.KeyOptions] = options; + retVal[CodingKeys.KeyPayload] = payload; + + return retVal; +} + +const CodingKeys = { + KeyKeyId: "keyId", + KeyKid: "kid", + KeyJwk: "jwk", + KeyIss: "iss", + KeyAud: "aud", + KeyJti: "jti", + KeyNonce: "nonce", + + KeyHeader: "header", + KeyOptions: "options", + KeyPayload: "payload", + + KeyCompactJwt: "compactJwt" +}; \ No newline at end of file diff --git a/packages/sample-server/src/fetchers/index.ts b/packages/sample-server/src/fetchers/index.ts new file mode 100644 index 0000000..dbb4c8c --- /dev/null +++ b/packages/sample-server/src/fetchers/index.ts @@ -0,0 +1,16 @@ +/** + * Created by Michael Avoyan on 26/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { verifyJwtFetcher } from './verify-jwt-fetcher'; +import { generateSignedJwtFetcher } from './generate-signed-jwt-fetcher'; +import { generateDidJwkFetcher } from './generate-did-jwk-fetcher'; + +export { + verifyJwtFetcher, + generateSignedJwtFetcher, + generateDidJwkFetcher +} diff --git a/packages/sample-server/src/fetchers/urls.ts b/packages/sample-server/src/fetchers/urls.ts new file mode 100644 index 0000000..878b8a7 --- /dev/null +++ b/packages/sample-server/src/fetchers/urls.ts @@ -0,0 +1,35 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ +import { VCLEnvironment } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; + + +const BaseUrl = "mockvendor.velocitycareerlabs.io"; + +function getServiceBaseUrl(environment: VCLEnvironment): string { + switch (environment) { + case VCLEnvironment.Dev: + return `https://${VCLEnvironment.Dev}.${BaseUrl}`; + case VCLEnvironment.Qa: + return `https://${VCLEnvironment.Qa}.${BaseUrl}`; + case VCLEnvironment.Staging: + return `https://${VCLEnvironment.Staging}.${BaseUrl}`; + default: + return `https://${BaseUrl}`; + } +} + +export function getJwtSignServiceUrl(environment: VCLEnvironment): string { + return `${getServiceBaseUrl(environment)}/api/jwt/sign`; +} + +export function getJwtVerifyServiceUrl(environment: VCLEnvironment): string { + return `${getServiceBaseUrl(environment)}/api/jwt/verify`; +} + +export function getCreateDidKeyServiceUrl(environment: VCLEnvironment): string { + return `${getServiceBaseUrl(environment)}/api/create_did_key`; +} \ No newline at end of file diff --git a/packages/sample-server/src/fetchers/verify-jwt-fetcher.ts b/packages/sample-server/src/fetchers/verify-jwt-fetcher.ts new file mode 100644 index 0000000..101c74d --- /dev/null +++ b/packages/sample-server/src/fetchers/verify-jwt-fetcher.ts @@ -0,0 +1,28 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import { getJwtVerifyServiceUrl } from "./urls"; +import { CurrentEnvironment } from "../global"; +import fetcher from "./fetcher"; +import { VCLPublicJwk, VCLJwt, Nullish, Dictionary } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; + +export async function verifyJwtFetcher(jwt: VCLJwt, publicJwk: Nullish): Promise> { + const config = { + url: getJwtVerifyServiceUrl(CurrentEnvironment), + method: 'POST', + data: generatePayloadToVerify(jwt, publicJwk), + }; + return fetcher(config); +} + +function generatePayloadToVerify(jwt: VCLJwt, publicJwk: Nullish): Record { + const retVal: Record = {}; + retVal['jwt'] = jwt.encodedJwt; + retVal['publicKey'] = publicJwk?.valueJson || {}; + return retVal; +} + diff --git a/packages/sample-server/src/global.ts b/packages/sample-server/src/global.ts index 94f74c5..6d6c395 100644 --- a/packages/sample-server/src/global.ts +++ b/packages/sample-server/src/global.ts @@ -1,4 +1,8 @@ // eslint-disable-next-line unused-imports/no-unused-vars,no-unused-vars +import { VCLEnvironment } from "@velocitycareerlabs/vnf-nodejs-wallet-sdk/src"; + +export const CurrentEnvironment = VCLEnvironment.Dev + interface String { getQueryParameters(): Map; appendQueryParams(queryParams: string): string; diff --git a/packages/sample-server/src/init-server.ts b/packages/sample-server/src/init-server.ts new file mode 100644 index 0000000..2d718c4 --- /dev/null +++ b/packages/sample-server/src/init-server.ts @@ -0,0 +1,31 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import vclSdkPlugin from './plugins/vcl-sdk-plugin'; + +export const initServer = (server) => { + server + .decorate( + 'globalCareerWalletFetch', + // eslint-disable-next-line no-console + server.baseCareerWalletFetch({ log: console }) + ) + .decorateRequest('careerWalletFetch', null) + .addHook('preValidation', async (req) => { + req.careerWalletFetch = server.baseCareerWalletFetch(req); + }) + .decorateRequest('linkedInFetch', null) + .addHook('preValidation', async (req) => { + req.linkedInFetch = server.baseLinkedInFetch(req); + }) + .register(vclSdkPlugin) + .addHook('preValidation', async (req) => { + req.vclSdk = server.vclSdk; + }); + + return server; +}; diff --git a/packages/sample-server/src/plugins/vcl-sdk-plugin.ts b/packages/sample-server/src/plugins/vcl-sdk-plugin.ts new file mode 100644 index 0000000..c428b78 --- /dev/null +++ b/packages/sample-server/src/plugins/vcl-sdk-plugin.ts @@ -0,0 +1,66 @@ +/** + * Created by Michael Avoyan on 24/06/2024. + * + * Copyright 2022 Velocity Career Labs inc. + * SPDX-License-Identifier: Apache-2.0 + */ + +import fastifyPlugin from 'fastify-plugin'; +import { + FastifyPluginAsync, + FastifyPluginCallback, +} from "fastify"; +import { + VCLProvider, + VCLInitializationDescriptor, + VCLCryptoServicesDescriptor, + VCLXVnfProtocolVersion, + VCLEnvironment, +} from '@velocitycareerlabs/vnf-nodejs-wallet-sdk/src'; +import { + KeyServiceImpl, + JwtSignServiceImpl, + JwtVerifyServiceImpl, +} from '../crypto-services'; + +const vclSdkPlugin: FastifyPluginAsync | FastifyPluginCallback = async ( + fastify, +) => { + const { log, sendError, config } = fastify; + + try { + const vclSdk = VCLProvider.getInstance(); + + const initializationDescriptor = new VCLInitializationDescriptor( + config.vclSdkEnvironment || VCLEnvironment.Prod, + config.vclSdkProtocolVersion || + VCLXVnfProtocolVersion.XVnfProtocolVersion2, + new VCLCryptoServicesDescriptor( + new KeyServiceImpl(), + new JwtSignServiceImpl(), + new JwtVerifyServiceImpl() + ) + ); + await vclSdk.initialize(initializationDescriptor); + + fastify + .decorate('vclSdk', vclSdk) + .decorateRequest('vclSdk', null) + .addHook('preValidation', async (req) => { + req.vclSdk = fastify.vclSdk; + }); + + } catch (error) { + log.error(error); + sendError(error); + + throw error; + } +}; + +export = { + vclSdkPlugin: fastifyPlugin(vclSdkPlugin, { + fastify: '>=4.0.0', + name: 'vcl-sdk-plugin', + }), +}; diff --git a/packages/sdk/package.json b/packages/sdk/package.json index b5be6b4..0c5ccce 100644 --- a/packages/sdk/package.json +++ b/packages/sdk/package.json @@ -18,7 +18,6 @@ "node": ">= 18.0.0" }, "dependencies": { - "axios": "^1.4.0", "jose": "~4.13.1", "canonicalize": "^2.0.0" }, diff --git a/yarn.lock b/yarn.lock index 9a0109a..839ad2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -358,14 +358,14 @@ resolved "https://registry.npmjs.org/@fastify/autoload/-/autoload-5.7.2.tgz#3abc211d460a6ad0966b0a28df251016ce41a1e0" integrity sha512-eSHuUHARbVocO3L7A1/q6YO+kkoWI2PsXJBpDsX+i3PcGTVncjn9771FaaM5BjOPx+44GxIjaszGOM/BZdfzaA== -"@fastify/error@^3.0.0", "@fastify/error@^3.3.0": +"@fastify/error@^3.3.0", "@fastify/error@^3.4.0": version "3.4.1" resolved "https://registry.npmjs.org/@fastify/error/-/error-3.4.1.tgz#b14bb4cac3dd4ec614becbc643d1511331a6425c" integrity sha512-wWSvph+29GR783IhmvdwWnN4bUxTD01Vm5Xad4i7i1VuAOItLvbPAb69sb0IQ2N57yprvhNIwAP5B6xfKTmjmQ== -"@fastify/fast-json-stringify-compiler@^4.2.0": +"@fastify/fast-json-stringify-compiler@^4.3.0": version "4.3.0" - resolved "https://registry.npmjs.org/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz#5df89fa4d1592cbb8780f78998355feb471646d5" + resolved "https://registry.yarnpkg.com/@fastify/fast-json-stringify-compiler/-/fast-json-stringify-compiler-4.3.0.tgz#5df89fa4d1592cbb8780f78998355feb471646d5" integrity sha512-aZAXGYo6m22Fk1zZzEUKBvut/CIIQe/BapEORnxiD5Qr0kPHqqI69NtEMCme74h+at72sPhbkb4ZrLd1W3KRLA== dependencies: fast-json-stringify "^5.7.0" @@ -1723,11 +1723,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: resolved "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - integrity sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw== - are-we-there-yet@^3.0.0: version "3.0.1" resolved "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz#679df222b278c64f2cdba1175cdc00b0d96164bd" @@ -1876,14 +1871,12 @@ available-typed-arrays@^1.0.7: dependencies: possible-typed-array-names "^1.0.0" -avvio@^8.2.0: - version "8.3.0" - resolved "https://registry.npmjs.org/avvio/-/avvio-8.3.0.tgz#1e019433d935730b814978a583eefac41a65082f" - integrity sha512-VBVH0jubFr9LdFASy/vNtm5giTrnbVquWBhT0fyizuNK2rQ7e7ONU2plZQWUNqtE1EmxFEb+kbSkFRkstiaS9Q== +avvio@^8.3.0: + version "8.3.2" + resolved "https://registry.yarnpkg.com/avvio/-/avvio-8.3.2.tgz#cb5844a612e8421d1f3aef8895ef7fa12f73563f" + integrity sha512-st8e519GWHa/azv8S87mcJvZs4WsgTBjOw/Ih1CP6u+8SZvcOeAYNG6JbsIrAUUJJ7JfmrnOkR8ipDS+u9SIRQ== dependencies: "@fastify/error" "^3.3.0" - archy "^1.0.0" - debug "^4.0.0" fastq "^1.17.1" axios@^1.0.0, axios@^1.4.0: @@ -2605,7 +2598,7 @@ dateformat@^4.6.3: resolved "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5" integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA== -debug@4, debug@^4.0.0, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1: +debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4, debug@~4.3.1: version "4.3.4" resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -3265,9 +3258,9 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -fast-content-type-parse@^1.0.0: +fast-content-type-parse@^1.1.0: version "1.1.0" - resolved "https://registry.npmjs.org/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz#4087162bf5af3294d4726ff29b334f72e3a1092c" + resolved "https://registry.yarnpkg.com/fast-content-type-parse/-/fast-content-type-parse-1.1.0.tgz#4087162bf5af3294d4726ff29b334f72e3a1092c" integrity sha512-fBHHqSTFLVnR61C+gltJuE5GkVQMV0S2nqUO8TJ+5Z3qAKG8vAx4FKai1s5jq/inV1+sREynIWSuQ6HgoSXpDQ== fast-copy@^3.0.0: @@ -3330,6 +3323,19 @@ fast-json-stringify@^5.7.0: json-schema-ref-resolver "^1.0.1" rfdc "^1.2.0" +fast-json-stringify@^5.8.0: + version "5.16.1" + resolved "https://registry.yarnpkg.com/fast-json-stringify/-/fast-json-stringify-5.16.1.tgz#a6d0c575231a3a08c376a00171d757372f2ca46e" + integrity sha512-KAdnLvy1yu/XrRtP+LJnxbBGrhN+xXu+gt3EUvZhYGKCr3lFHq/7UFJHHFgmJKoqlh6B40bZLEv7w46B0mqn1g== + dependencies: + "@fastify/merge-json-schemas" "^0.1.0" + ajv "^8.10.0" + ajv-formats "^3.0.1" + fast-deep-equal "^3.1.3" + fast-uri "^2.1.0" + json-schema-ref-resolver "^1.0.1" + rfdc "^1.2.0" + fast-levenshtein@^2.0.6: version "2.0.6" resolved "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" @@ -3357,26 +3363,32 @@ fast-uri@^2.0.0, fast-uri@^2.1.0: resolved "https://registry.npmjs.org/fast-uri/-/fast-uri-2.3.0.tgz#bdae493942483d299e7285dcb4627767d42e2793" integrity sha512-eel5UKGn369gGEWOqBShmFJWfq/xSJvsgDzgLYC845GneayWvXBf0lJCBn5qTABfewy1ZDPoaR5OZCP+kssfuw== -fastify@~4.15.0: - version "4.15.0" - resolved "https://registry.npmjs.org/fastify/-/fastify-4.15.0.tgz#4ebadaea706217467a332341f9cfa632072d51f2" - integrity sha512-m/CaRN8nf5uyYdrDe2qqq+0z3oGyE+A++qlKQoLJTI4WI0nWK9D6R3FxXQ3MVwt/md977GMR4F43pE9oqrS2zw== +fastify-plugin@4.5.1: + version "4.5.1" + resolved "https://registry.yarnpkg.com/fastify-plugin/-/fastify-plugin-4.5.1.tgz#44dc6a3cc2cce0988bc09e13f160120bbd91dbee" + integrity sha512-stRHYGeuqpEZTL1Ef0Ovr2ltazUT9g844X5z/zEBFLG8RYlpDiOCIG+ATvYEp+/zmc7sN29mcIMp8gvYplYPIQ== + +fastify@~4.28.0: + version "4.28.0" + resolved "https://registry.yarnpkg.com/fastify/-/fastify-4.28.0.tgz#322152722e2ed207cbef73ed177214bb3284058c" + integrity sha512-HhW7UHW07YlqH5qpS0af8d2Gl/o98DhJ8ZDQWHRNDnzeOhZvtreWsX8xanjGgXmkYerGbo8ax/n40Dpwqkot8Q== dependencies: "@fastify/ajv-compiler" "^3.5.0" - "@fastify/error" "^3.0.0" - "@fastify/fast-json-stringify-compiler" "^4.2.0" + "@fastify/error" "^3.4.0" + "@fastify/fast-json-stringify-compiler" "^4.3.0" abstract-logging "^2.0.1" - avvio "^8.2.0" - fast-content-type-parse "^1.0.0" - find-my-way "^7.6.0" - light-my-request "^5.6.1" - pino "^8.5.0" - process-warning "^2.0.0" + avvio "^8.3.0" + fast-content-type-parse "^1.1.0" + fast-json-stringify "^5.8.0" + find-my-way "^8.0.0" + light-my-request "^5.11.0" + pino "^9.0.0" + process-warning "^3.0.0" proxy-addr "^2.0.7" rfdc "^1.3.0" - secure-json-parse "^2.5.0" - semver "^7.3.7" - tiny-lru "^10.0.0" + secure-json-parse "^2.7.0" + semver "^7.5.4" + toad-cache "^3.3.0" fastq@^1.17.1, fastq@^1.6.0: version "1.17.1" @@ -3425,14 +3437,14 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" -find-my-way@^7.6.0: - version "7.7.0" - resolved "https://registry.npmjs.org/find-my-way/-/find-my-way-7.7.0.tgz#d7b51ca6046782bcddd5a8435e99ad057e5a8876" - integrity sha512-+SrHpvQ52Q6W9f3wJoJBbAQULJuNEEQwBvlvYwACDhBTLOTMiQ0HYWh4+vC3OivGP2ENcTI1oKlFA2OepJNjhQ== +find-my-way@^8.0.0: + version "8.2.0" + resolved "https://registry.yarnpkg.com/find-my-way/-/find-my-way-8.2.0.tgz#ef1b83d008114a300118c9c707d8dc65947d9960" + integrity sha512-HdWXgFYc6b1BJcOBDBwjqWuHJj1WYiqrxSh25qtU4DabpMFdj/gSunNBQb83t+8Zt67D7CXEzJWTkxaShMTMOA== dependencies: fast-deep-equal "^3.1.3" fast-querystring "^1.0.0" - safe-regex2 "^2.0.0" + safe-regex2 "^3.1.0" find-up@5.0.0, find-up@^5.0.0: version "5.0.0" @@ -5134,9 +5146,9 @@ libnpmpublish@7.1.4: sigstore "^1.4.0" ssri "^10.0.1" -light-my-request@^5.6.1: +light-my-request@^5.11.0: version "5.13.0" - resolved "https://registry.npmjs.org/light-my-request/-/light-my-request-5.13.0.tgz#b29905e55e8605b77fee2a946e17b219bca35113" + resolved "https://registry.yarnpkg.com/light-my-request/-/light-my-request-5.13.0.tgz#b29905e55e8605b77fee2a946e17b219bca35113" integrity sha512-9IjUN9ZyCS9pTG+KqTDEQo68Sui2lHsYBrfMyVUTTZ3XhH8PMZq7xO94Kr+eP9dhi/kcKsx4N41p2IXEBil1pQ== dependencies: cookie "^0.6.0" @@ -6337,27 +6349,27 @@ pino-pretty@~10.0.0: sonic-boom "^3.0.0" strip-json-comments "^3.1.1" -pino-std-serializers@^6.0.0: - version "6.2.2" - resolved "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz#d9a9b5f2b9a402486a5fc4db0a737570a860aab3" - integrity sha512-cHjPPsE+vhj/tnhCy/wiMh3M3z3h/j15zHQX+S9GkTBgqJuTuJzYJ4gUyACLhDaJ7kk9ba9iRDmbH2tJU03OiA== +pino-std-serializers@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/pino-std-serializers/-/pino-std-serializers-7.0.0.tgz#7c625038b13718dbbd84ab446bd673dc52259e3b" + integrity sha512-e906FRY0+tV27iq4juKzSYPbUj2do2X2JX4EzSca1631EB2QJQUqGbDuERal7LCtOpxl6x3+nvo9NPZcmjkiFA== -pino@^8.5.0: - version "8.21.0" - resolved "https://registry.npmjs.org/pino/-/pino-8.21.0.tgz#e1207f3675a2722940d62da79a7a55a98409f00d" - integrity sha512-ip4qdzjkAyDDZklUaZkcRFb2iA118H9SgRh8yzTkSQK8HilsOJF7rSY8HoW5+I0M46AZgX/pxbprf2vvzQCE0Q== +pino@^9.0.0: + version "9.2.0" + resolved "https://registry.yarnpkg.com/pino/-/pino-9.2.0.tgz#e77a9516f3a3e5550d9b76d9f65ac6118ef02bdd" + integrity sha512-g3/hpwfujK5a4oVbaefoJxezLzsDgLcNJeITvC6yrfwYeT9la+edCK42j5QpEQSQCZgTKapXvnQIdgZwvRaZug== dependencies: atomic-sleep "^1.0.0" fast-redact "^3.1.1" on-exit-leak-free "^2.1.0" pino-abstract-transport "^1.2.0" - pino-std-serializers "^6.0.0" + pino-std-serializers "^7.0.0" process-warning "^3.0.0" quick-format-unescaped "^4.0.3" real-require "^0.2.0" safe-stable-stringify "^2.3.1" - sonic-boom "^3.7.0" - thread-stream "^2.6.0" + sonic-boom "^4.0.1" + thread-stream "^3.0.0" pirates@^4.0.4: version "4.0.6" @@ -6429,11 +6441,6 @@ process-nextick-args@~2.0.0: resolved "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag== -process-warning@^2.0.0: - version "2.3.2" - resolved "https://registry.npmjs.org/process-warning/-/process-warning-2.3.2.tgz#70d8a3251aab0eafe3a595d8ae2c5d2277f096a5" - integrity sha512-n9wh8tvBe5sFmsqlg+XQhaQLumwpqoAUruLwjCopgTmUBjJ/fjtBsJzKleCaIGBOMXYEhp1YfKl4d7rJ5ZKJGA== - process-warning@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/process-warning/-/process-warning-3.0.0.tgz#96e5b88884187a1dce6f5c3166d611132058710b" @@ -6764,10 +6771,10 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" -ret@~0.2.0: - version "0.2.2" - resolved "https://registry.npmjs.org/ret/-/ret-0.2.2.tgz#b6861782a1f4762dce43402a71eb7a283f44573c" - integrity sha512-M0b3YWQs7R3Z917WRQy1HHA7Ba7D8hvZg6UE5mLykJxQVE2ju0IXbGlaHPPlkY+WN7wFP+wUMXmBFA0aV6vYGQ== +ret@~0.4.0: + version "0.4.3" + resolved "https://registry.yarnpkg.com/ret/-/ret-0.4.3.tgz#5243fa30e704a2e78a9b9b1e86079e15891aa85c" + integrity sha512-0f4Memo5QP7WQyUEAYUO3esD/XjOc3Zjjg5CPsAq1p8sIu0XPeMbHJemKA0BO7tV0X7+A0FoEpbmHXWxPyD3wQ== retry@^0.12.0: version "0.12.0" @@ -6860,12 +6867,12 @@ safe-regex-test@^1.0.3: es-errors "^1.3.0" is-regex "^1.1.4" -safe-regex2@^2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/safe-regex2/-/safe-regex2-2.0.0.tgz#b287524c397c7a2994470367e0185e1916b1f5b9" - integrity sha512-PaUSFsUaNNuKwkBijoAPHAK6/eM6VirvyPWlZ7BAQy4D+hCvh4B6lIG+nPdhbFfIbP+gTGBcrdsOaUs0F+ZBOQ== +safe-regex2@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/safe-regex2/-/safe-regex2-3.1.0.tgz#fd7ec23908e2c730e1ce7359a5b72883a87d2763" + integrity sha512-RAAZAGbap2kBfbVhvmnTFv73NWLMvDGOITFYTZBAaY8eR+Ir4ef7Up/e7amo+y1+AH+3PtLkrt9mvcTsG9LXug== dependencies: - ret "~0.2.0" + ret "~0.4.0" safe-stable-stringify@^2.3.1: version "2.4.3" @@ -6877,7 +6884,7 @@ safe-stable-stringify@^2.3.1: resolved "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -secure-json-parse@^2.4.0, secure-json-parse@^2.5.0: +secure-json-parse@^2.4.0, secure-json-parse@^2.7.0: version "2.7.0" resolved "https://registry.npmjs.org/secure-json-parse/-/secure-json-parse-2.7.0.tgz#5a5f9cd6ae47df23dba3151edd06855d47e09862" integrity sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw== @@ -7027,13 +7034,20 @@ socks@^2.6.2: ip-address "^9.0.5" smart-buffer "^4.2.0" -sonic-boom@^3.0.0, sonic-boom@^3.7.0: +sonic-boom@^3.0.0: version "3.8.1" resolved "https://registry.npmjs.org/sonic-boom/-/sonic-boom-3.8.1.tgz#d5ba8c4e26d6176c9a1d14d549d9ff579a163422" integrity sha512-y4Z8LCDBuum+PBP3lSV7RHrXscqksve/bi0as7mhwVnBW+/wUqKT/2Kb7um8yqcFy0duYbbPxzt89Zy2nOCaxg== dependencies: atomic-sleep "^1.0.0" +sonic-boom@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/sonic-boom/-/sonic-boom-4.0.1.tgz#515b7cef2c9290cb362c4536388ddeece07aed30" + integrity sha512-hTSD/6JMLyT4r9zeof6UtuBDpjJ9sO08/nmS5djaA9eozT9oOlNdpXSnzcgj4FTqpk3nkLrs61l4gip9r1HCrQ== + dependencies: + atomic-sleep "^1.0.0" + sort-keys@^2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/sort-keys/-/sort-keys-2.0.0.tgz#658535584861ec97d730d6cf41822e1f56684128" @@ -7383,10 +7397,10 @@ text-table@^0.2.0: resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -thread-stream@^2.6.0: - version "2.7.0" - resolved "https://registry.npmjs.org/thread-stream/-/thread-stream-2.7.0.tgz#d8a8e1b3fd538a6cca8ce69dbe5d3d097b601e11" - integrity sha512-qQiRWsU/wvNolI6tbbCKd9iKaTnCXsTwVxhhKM6nctPdujTyztjlbUkUTUymidWcMnZ5pWR0ej4a0tjsW021vw== +thread-stream@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/thread-stream/-/thread-stream-3.1.0.tgz#4b2ef252a7c215064507d4ef70c05a5e2d34c4f1" + integrity sha512-OqyPZ9u96VohAyMfJykzmivOrY2wfMSf3C5TtFJVgN+Hm6aj+voFhlK+kZEIv2FBh1X6Xp3DlnCOfEQ3B2J86A== dependencies: real-require "^0.2.0" @@ -7410,11 +7424,6 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== -tiny-lru@^10.0.0: - version "10.4.1" - resolved "https://registry.npmjs.org/tiny-lru/-/tiny-lru-10.4.1.tgz#dec67a62115a4cb31d2065b8116d010daac362fe" - integrity sha512-buLIzw7ppqymuO3pt10jHk/6QMeZLbidihMQU+N6sogF6EnBzG0qtDWIHuhw1x3dyNgVL/KTGIZsTK81+yCzLg== - tmp@^0.0.33: version "0.0.33" resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -7444,6 +7453,11 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" +toad-cache@^3.3.0: + version "3.7.0" + resolved "https://registry.yarnpkg.com/toad-cache/-/toad-cache-3.7.0.tgz#b9b63304ea7c45ec34d91f1d2fa513517025c441" + integrity sha512-/m8M+2BJUpoJdgAHoG+baCwBT+tf2VraSfkBgl0Y00qIWt41DJ8R5B8nsEw0I58YwF5IZH6z24/2TobDKnqSWw== + tr46@~0.0.3: version "0.0.3" resolved "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"