From 18314b4fa9119a85f23a3090f7fe74227b5d6c69 Mon Sep 17 00:00:00 2001 From: Antoine SEIN <142824551+asein-sinch@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:04:29 +0100 Subject: [PATCH] DEVEXP-308: Fax API (#30) * DEVEXP-315: Add support for Services (#31) * DEVEXP-316: Add support for Faxes (#32) * DEVEXP-317: Add support for Callbacks (#33) * DEVEXP-320: Add support for Emails (#34) --- examples/simple-examples/.env.template | 5 + examples/simple-examples/.gitignore | 1 + examples/simple-examples/README.md | 27 + examples/simple-examples/package.json | 17 + examples/simple-examples/src/config.ts | 16 + .../simple-examples/src/fax/emails/add.ts | 37 + .../simple-examples/src/fax/emails/delete.ts | 19 + .../simple-examples/src/fax/emails/list.ts | 67 + .../src/fax/emails/listNumbers.ts | 74 ++ .../simple-examples/src/fax/emails/update.ts | 38 + .../src/fax/faxes/deleteContent.ts | 19 + .../src/fax/faxes/downloadContent.ts | 25 + examples/simple-examples/src/fax/faxes/get.ts | 28 + .../simple-examples/src/fax/faxes/list.ts | 67 + .../simple-examples/src/fax/faxes/send.ts | 39 + .../src/fax/services/create.ts | 37 + .../src/fax/services/delete.ts | 19 + .../simple-examples/src/fax/services/get.ts | 25 + .../simple-examples/src/fax/services/list.ts | 67 + .../src/fax/services/listEmailsForNumber.ts | 65 + .../src/fax/services/listNumbers.ts | 70 ++ .../src/fax/services/update.ts | 45 + examples/webhooks/.gitignore | 2 + examples/webhooks/package.json | 1 + examples/webhooks/src/app.module.ts | 7 +- .../webhooks/src/controller/app.controller.ts | 24 +- examples/webhooks/src/main.ts | 4 +- examples/webhooks/src/services/fax.service.ts | 44 + examples/webhooks/tsconfig.json | 3 +- jest.config.ts | 5 + packages/fax/CHANGELOG.md | 3 + packages/fax/README.md | 120 ++ packages/fax/package.json | 37 + packages/fax/src/index.ts | 3 + packages/fax/src/models/index.ts | 1 + .../fax/src/models/v3/bar-code/bar-code.ts | 13 + packages/fax/src/models/v3/bar-code/index.ts | 1 + packages/fax/src/models/v3/email/email.ts | 13 + packages/fax/src/models/v3/email/index.ts | 1 + packages/fax/src/models/v3/enums.ts | 36 + .../v3/fax-base64-file/fax-base64-file.ts | 9 + .../src/models/v3/fax-base64-file/index.ts | 1 + .../v3/fax-content-url/fax-content-url.ts | 5 + .../src/models/v3/fax-content-url/index.ts | 1 + .../fax/src/models/v3/fax-money/fax-money.ts | 11 + packages/fax/src/models/v3/fax-money/index.ts | 1 + .../src/models/v3/fax-request/fax-request.ts | 44 + .../fax/src/models/v3/fax-request/index.ts | 1 + packages/fax/src/models/v3/fax/fax.ts | 62 + packages/fax/src/models/v3/fax/index.ts | 1 + packages/fax/src/models/v3/index.ts | 30 + .../base-fax-event/base-fax-event.ts | 18 + .../v3/mod-events/base-fax-event/index.ts | 1 + .../fax-completed-event.ts | 16 + .../mod-events/fax-completed-event/index.ts | 1 + .../incoming-fax-event/incoming-fax-event.ts | 18 + .../v3/mod-events/incoming-fax-event/index.ts | 1 + .../fax/src/models/v3/mod-events/index.ts | 2 + .../models/v3/service-email-settings/index.ts | 1 + .../service-email-settings.ts | 8 + .../models/v3/service-phone-number/index.ts | 1 + .../service-phone-number.ts | 10 + packages/fax/src/models/v3/service/index.ts | 1 + packages/fax/src/models/v3/service/service.ts | 38 + .../models/v3/update-email-request/index.ts | 1 + .../update-email-request.ts | 6 + packages/fax/src/rest/index.ts | 1 + .../rest/v3/callbacks/callbacks-webhook.ts | 66 + packages/fax/src/rest/v3/callbacks/index.ts | 1 + .../rest/v3/emails/emails-api.jest.fixture.ts | 35 + packages/fax/src/rest/v3/emails/emails-api.ts | 224 ++++ packages/fax/src/rest/v3/emails/index.ts | 2 + packages/fax/src/rest/v3/enums.ts | 2 + packages/fax/src/rest/v3/fax-domain-api.ts | 81 ++ packages/fax/src/rest/v3/fax-service.ts | 27 + .../rest/v3/faxes/faxes-api.jest.fixture.ts | 28 + packages/fax/src/rest/v3/faxes/faxes-api.ts | 273 ++++ packages/fax/src/rest/v3/faxes/index.ts | 2 + packages/fax/src/rest/v3/index.ts | 6 + packages/fax/src/rest/v3/services/index.ts | 2 + .../v3/services/services-api.jest.fixture.ts | 46 + .../fax/src/rest/v3/services/services-api.ts | 313 +++++ .../tests/rest/v3/emails/emails-api.test.ts | 172 +++ .../fax/tests/rest/v3/faxes/faxes-api.test.ts | 195 +++ .../rest/v3/services/services-api.test.ts | 274 ++++ packages/fax/tsconfig.build.json | 17 + packages/fax/tsconfig.json | 11 + packages/fax/tsconfig.tests.json | 17 + packages/sdk-client/src/api/api-client.ts | 30 +- packages/sdk-client/src/api/api-interface.ts | 7 + .../src/client/api-client-helpers.ts | 6 +- .../client/api-client-pagination-helper.ts | 11 +- .../sdk-client/src/client/api-fetch-client.ts | 77 +- .../tests/client/api-client-helpers.test.ts | 10 +- packages/sdk-core/package.json | 1 + packages/sdk-core/src/index.ts | 1 + packages/sdk-core/src/sinch-client.ts | 5 + yarn.lock | 1109 +++++++---------- 98 files changed, 3807 insertions(+), 659 deletions(-) create mode 100644 examples/simple-examples/src/fax/emails/add.ts create mode 100644 examples/simple-examples/src/fax/emails/delete.ts create mode 100644 examples/simple-examples/src/fax/emails/list.ts create mode 100644 examples/simple-examples/src/fax/emails/listNumbers.ts create mode 100644 examples/simple-examples/src/fax/emails/update.ts create mode 100644 examples/simple-examples/src/fax/faxes/deleteContent.ts create mode 100644 examples/simple-examples/src/fax/faxes/downloadContent.ts create mode 100644 examples/simple-examples/src/fax/faxes/get.ts create mode 100644 examples/simple-examples/src/fax/faxes/list.ts create mode 100644 examples/simple-examples/src/fax/faxes/send.ts create mode 100644 examples/simple-examples/src/fax/services/create.ts create mode 100644 examples/simple-examples/src/fax/services/delete.ts create mode 100644 examples/simple-examples/src/fax/services/get.ts create mode 100644 examples/simple-examples/src/fax/services/list.ts create mode 100644 examples/simple-examples/src/fax/services/listEmailsForNumber.ts create mode 100644 examples/simple-examples/src/fax/services/listNumbers.ts create mode 100644 examples/simple-examples/src/fax/services/update.ts create mode 100644 examples/webhooks/src/services/fax.service.ts create mode 100644 packages/fax/CHANGELOG.md create mode 100644 packages/fax/README.md create mode 100644 packages/fax/package.json create mode 100644 packages/fax/src/index.ts create mode 100644 packages/fax/src/models/index.ts create mode 100644 packages/fax/src/models/v3/bar-code/bar-code.ts create mode 100644 packages/fax/src/models/v3/bar-code/index.ts create mode 100644 packages/fax/src/models/v3/email/email.ts create mode 100644 packages/fax/src/models/v3/email/index.ts create mode 100644 packages/fax/src/models/v3/enums.ts create mode 100644 packages/fax/src/models/v3/fax-base64-file/fax-base64-file.ts create mode 100644 packages/fax/src/models/v3/fax-base64-file/index.ts create mode 100644 packages/fax/src/models/v3/fax-content-url/fax-content-url.ts create mode 100644 packages/fax/src/models/v3/fax-content-url/index.ts create mode 100644 packages/fax/src/models/v3/fax-money/fax-money.ts create mode 100644 packages/fax/src/models/v3/fax-money/index.ts create mode 100644 packages/fax/src/models/v3/fax-request/fax-request.ts create mode 100644 packages/fax/src/models/v3/fax-request/index.ts create mode 100644 packages/fax/src/models/v3/fax/fax.ts create mode 100644 packages/fax/src/models/v3/fax/index.ts create mode 100644 packages/fax/src/models/v3/index.ts create mode 100644 packages/fax/src/models/v3/mod-events/base-fax-event/base-fax-event.ts create mode 100644 packages/fax/src/models/v3/mod-events/base-fax-event/index.ts create mode 100644 packages/fax/src/models/v3/mod-events/fax-completed-event/fax-completed-event.ts create mode 100644 packages/fax/src/models/v3/mod-events/fax-completed-event/index.ts create mode 100644 packages/fax/src/models/v3/mod-events/incoming-fax-event/incoming-fax-event.ts create mode 100644 packages/fax/src/models/v3/mod-events/incoming-fax-event/index.ts create mode 100644 packages/fax/src/models/v3/mod-events/index.ts create mode 100644 packages/fax/src/models/v3/service-email-settings/index.ts create mode 100644 packages/fax/src/models/v3/service-email-settings/service-email-settings.ts create mode 100644 packages/fax/src/models/v3/service-phone-number/index.ts create mode 100644 packages/fax/src/models/v3/service-phone-number/service-phone-number.ts create mode 100644 packages/fax/src/models/v3/service/index.ts create mode 100644 packages/fax/src/models/v3/service/service.ts create mode 100644 packages/fax/src/models/v3/update-email-request/index.ts create mode 100644 packages/fax/src/models/v3/update-email-request/update-email-request.ts create mode 100644 packages/fax/src/rest/index.ts create mode 100644 packages/fax/src/rest/v3/callbacks/callbacks-webhook.ts create mode 100644 packages/fax/src/rest/v3/callbacks/index.ts create mode 100644 packages/fax/src/rest/v3/emails/emails-api.jest.fixture.ts create mode 100644 packages/fax/src/rest/v3/emails/emails-api.ts create mode 100644 packages/fax/src/rest/v3/emails/index.ts create mode 100644 packages/fax/src/rest/v3/enums.ts create mode 100644 packages/fax/src/rest/v3/fax-domain-api.ts create mode 100644 packages/fax/src/rest/v3/fax-service.ts create mode 100644 packages/fax/src/rest/v3/faxes/faxes-api.jest.fixture.ts create mode 100644 packages/fax/src/rest/v3/faxes/faxes-api.ts create mode 100644 packages/fax/src/rest/v3/faxes/index.ts create mode 100644 packages/fax/src/rest/v3/index.ts create mode 100644 packages/fax/src/rest/v3/services/index.ts create mode 100644 packages/fax/src/rest/v3/services/services-api.jest.fixture.ts create mode 100644 packages/fax/src/rest/v3/services/services-api.ts create mode 100644 packages/fax/tests/rest/v3/emails/emails-api.test.ts create mode 100644 packages/fax/tests/rest/v3/faxes/faxes-api.test.ts create mode 100644 packages/fax/tests/rest/v3/services/services-api.test.ts create mode 100644 packages/fax/tsconfig.build.json create mode 100644 packages/fax/tsconfig.json create mode 100644 packages/fax/tsconfig.tests.json diff --git a/examples/simple-examples/.env.template b/examples/simple-examples/.env.template index 284ca213..58dd00ff 100644 --- a/examples/simple-examples/.env.template +++ b/examples/simple-examples/.env.template @@ -39,3 +39,8 @@ MESSAGE_ID=message_id to fill with one of the messages sent or injected with the TEMPLATE_ID=template_id to fill with one of the templates created with the Templates API (v1 or v2) WEBHOOK_ID=webhook_id to fill with one of the webhooks created with the Conversation API or the Dashboard WEBHOOK_TARGET=target URL where the events should be sent to +## Fax API +FAX_SERVICE_ID=serviceId to fill with one the fax services created with the Fax API +FAX_ID=id from a sendFax response +FAX_CALLBACK_URL=callback url to override the one defined in the default service or specified service +FAX_EMAIL=email to associate with a phone number to use the fax-to-email functionality diff --git a/examples/simple-examples/.gitignore b/examples/simple-examples/.gitignore index 2ff5437a..2ccc0a30 100644 --- a/examples/simple-examples/.gitignore +++ b/examples/simple-examples/.gitignore @@ -6,3 +6,4 @@ .DS_Store .env +fax-pdf/ diff --git a/examples/simple-examples/README.md b/examples/simple-examples/README.md index 975aa2c9..68ca9ad5 100644 --- a/examples/simple-examples/README.md +++ b/examples/simple-examples/README.md @@ -70,6 +70,11 @@ MESSAGE_ID=message_id to fill with one of the messages sent or injected with the TEMPLATE_ID=template_id to fill with one of the templates created with the Templates API (v1 or v2) WEBHOOK_ID=webhook_id to fill with one of the webhooks created with the Conversation API or the Dashboard WEBHOOK_TARGET=target URL where the events should be sent to +## Fax API +FAX_SERVICE_ID=serviceId to fill with one the fax services created with the Fax API +FAX_ID=id from a sendFax response +FAX_CALLBACK_URL=callback url to override the one defined in the default service or specified service +FAX_EMAIL=email to associate with a phone number to use the fax-to-email functionality ``` **Note**: If you prefer using environment variables, the sample app is also supporting them: they take precedence over the value from the `.env` file. @@ -225,3 +230,25 @@ yarn run numbers:regions:list | | [./src/conversation/webhooks/list.ts](./src/conversation/webhooks/list.ts) | `CONVERSATION_APP_ID` | | | [./src/conversation/webhooks/update.ts](./src/conversation/webhooks/update.ts) | `CONVERSATION_APP_ID` + `WEBHOOK_ID` | +### Fax + +| Service | Sample application name and location | Required parameters | +|----------|----------------------------------------------------------------------------------------|-----------------------------------| +| Services | [./src/fax/services/create.ts](./src/fax/services/create.ts) | `PHONE_NUMBER` | +| | [./src/fax/services/get.ts](./src/fax/services/get.ts) | `FAX_SERVICE_ID` | +| | [./src/fax/services/list.ts](./src/fax/services/list.ts) | | +| | [./src/fax/services/listNumbers.ts](./src/fax/services/listNumbers.ts) | `FAX_SERVICE_ID` | +| | [./src/fax/services/listEmailsForNumber.ts](./src/fax/services/listEmailsForNumber.ts) | `PHONE_NUMBER` + `FAX_SERVICE_ID` | +| | [./src/fax/services/update.ts](./src/fax/services/update.ts) | `FAX_SERVICE_ID` | +| | [./src/fax/services/delete.ts](./src/fax/services/delete.ts) | `FAX_SERVICE_ID` | +| Faxes | [./src/fax/faxes/send.ts](./src/fax/faxes/send.ts) | `PHONE_NUMBER` | +| | [./src/fax/faxes/get.ts](./src/fax/faxes/get.ts) | `FAX_ID` | +| | [./src/fax/faxes/list.ts](./src/fax/faxes/list.ts) | | +| | [./src/fax/faxes/downloadContent.ts](./src/fax/faxes/downloadContent.ts) | `FAX_ID` | +| | [./src/fax/faxes/deleteContent.ts](./src/fax/faxes/deleteContent.ts) | `FAX_ID` | +| Emails | [./src/fax/emails/add.ts](./src/fax/emails/add.ts) | `FAX_EMAIL` + `PHONE_NUMBER` | +| | [./src/fax/emails/list.ts](./src/fax/emails/list.ts) | | +| | [./src/fax/emails/listNumbers.ts](./src/fax/emails/listNumbers.ts) | `FAX_EMAIL` | +| | [./src/fax/emails/update.ts](./src/fax/emails/update.ts) | `FAX_EMAIL` + `PHONE_NUMBER` | +| | [./src/fax/emails/delete.ts](./src/fax/emails/delete.ts) | `FAX_EMAIL` | + diff --git a/examples/simple-examples/package.json b/examples/simple-examples/package.json index a57a2a6a..87ad7405 100644 --- a/examples/simple-examples/package.json +++ b/examples/simple-examples/package.json @@ -56,6 +56,23 @@ "conversation:templatev2:listTranslations": "ts-node src/conversation/templates-v2/list-translations.ts pretty", "conversation:templatev2:update": "ts-node src/conversation/templates-v2/update.ts", "conversation:templatev2:delete": "ts-node src/conversation/templates-v2/delete.ts", + "fax:services:create": "ts-node src/fax/services/create.ts", + "fax:services:get": "ts-node src/fax/services/get.ts", + "fax:services:list": "ts-node src/fax/services/list.ts", + "fax:services:listNumbers": "ts-node src/fax/services/listNumbers.ts", + "fax:services:listEmailsForNumber": "ts-node src/fax/services/listEmailsForNumber.ts", + "fax:services:update": "ts-node src/fax/services/update.ts", + "fax:services:delete": "ts-node src/fax/services/delete.ts", + "fax:faxes:send": "ts-node src/fax/faxes/send.ts", + "fax:faxes:get": "ts-node src/fax/faxes/get.ts", + "fax:faxes:list": "ts-node src/fax/faxes/list.ts", + "fax:faxes:download": "ts-node src/fax/faxes/downloadContent.ts", + "fax:faxes:delete": "ts-node src/fax/faxes/deleteContent.ts", + "fax:emails:add": "ts-node src/fax/emails/add.ts", + "fax:emails:list": "ts-node src/fax/emails/list.ts", + "fax:emails:listNumbers": "ts-node src/fax/emails/listNumbers.ts", + "fax:emails:update": "ts-node src/fax/emails/update.ts", + "fax:emails:delete": "ts-node src/fax/emails/delete.ts", "numbers:regions:list": "ts-node src/numbers/regions/list.ts", "numbers:available:list": "ts-node src/numbers/available/list.ts", "numbers:available:checkAvailability": "ts-node src/numbers/available/checkAvailability.ts", diff --git a/examples/simple-examples/src/config.ts b/examples/simple-examples/src/config.ts index 6925e777..db4052fe 100644 --- a/examples/simple-examples/src/config.ts +++ b/examples/simple-examples/src/config.ts @@ -145,6 +145,22 @@ export const getEventIdFromConfig = () => { return readVariable('EVENT_ID'); }; +export const getFaxServiceIdFromConfig = () => { + return readVariable('FAX_SERVICE_ID'); +}; + +export const getFaxIdFromConfig = () => { + return readVariable('FAX_ID'); +}; + +export const getFaxCallbackUrlFromConfig = () => { + return readVariable('FAX_CALLBACK_URL'); +}; + +export const getFaxEmailFromConfig = () => { + return readVariable('FAX_EMAIL'); +}; + const readVariable = ( name: string): string => { const value = process.env[name]; if (!value) { diff --git a/examples/simple-examples/src/fax/emails/add.ts b/examples/simple-examples/src/fax/emails/add.ts new file mode 100644 index 00000000..0b738e6c --- /dev/null +++ b/examples/simple-examples/src/fax/emails/add.ts @@ -0,0 +1,37 @@ +import { AddEmailToNumbersRequestData } from '@sinch/sdk-core'; +import { + getFaxEmailFromConfig, + getPhoneNumberFromConfig, + getPrintFormat, + initClient, + printFullResponse, +} from '../../config'; + +(async () => { + console.log('*************************'); + console.log('* createEmailForProject *'); + console.log('*************************'); + + const phoneNumber = getPhoneNumberFromConfig(); + const email = getFaxEmailFromConfig(); + + const requestData: AddEmailToNumbersRequestData = { + emailRequestBody: { + email, + phoneNumbers: [ + phoneNumber, + ], + }, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.emails.addToNumbers(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`Email successfully added to numbers '${response.phoneNumbers?.join(', ')}'`); + } else { + printFullResponse(response); + } +})(); diff --git a/examples/simple-examples/src/fax/emails/delete.ts b/examples/simple-examples/src/fax/emails/delete.ts new file mode 100644 index 00000000..157b955b --- /dev/null +++ b/examples/simple-examples/src/fax/emails/delete.ts @@ -0,0 +1,19 @@ +import { DeleteEmailRequestData } from '@sinch/sdk-core'; +import { getFaxEmailFromConfig, initClient } from '../../config'; + +(async () => { + console.log('***************'); + console.log('* deleteEmail *'); + console.log('***************'); + + const email = getFaxEmailFromConfig(); + + const requestData: DeleteEmailRequestData = { + email, + }; + + const sinchClient = initClient(); + await sinchClient.fax.emails.delete(requestData); + + console.log(`The email '${requestData.email}' has been successfully removed`); +})(); diff --git a/examples/simple-examples/src/fax/emails/list.ts b/examples/simple-examples/src/fax/emails/list.ts new file mode 100644 index 00000000..6f599f73 --- /dev/null +++ b/examples/simple-examples/src/fax/emails/list.ts @@ -0,0 +1,67 @@ +import { Email, ListEmailsForProjectRequestData, PageResult } from '@sinch/sdk-core'; +import { getPrintFormat, initClient, printFullResponse } from '../../config'; + +const populateEmailsList = ( + emailsPage: PageResult, + fullEmailsList: Email[], + emailsList: string[], +) => { + fullEmailsList.push(...emailsPage.data); + emailsPage.data.map((email) => { + emailsList.push(`Email '${email.email}' - Phone numbers: '${email.phoneNumbers?.join(', ')}'`); + }); +}; + +(async () => { + console.log('***********************'); + console.log('* getEmailsForProject *'); + console.log('***********************'); + + const requestData: ListEmailsForProjectRequestData = { + pageSize: 2, + }; + + const sinchClient = initClient(); + + // ---------------------------------------------- + // Method 1: Fetch the data page by page manually + // ---------------------------------------------- + let response = await sinchClient.fax.emails.list(requestData); + + // Init data structure to hold the response content + const fullEmailsList: Email[] = []; + // Init data structure to hold the response content for pretty print + const emailsList: string[] = []; + + // Loop on all the pages to get all the emails + let reachedEndOfPages = false; + while (!reachedEndOfPages) { + populateEmailsList(response, fullEmailsList, emailsList); + if (response.hasNextPage) { + response = await response.nextPage(); + } else { + reachedEndOfPages = true; + } + } + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(emailsList.length > 0 + ? `List of emails:\n${emailsList.join('\n')}` + : 'Sorry, no emails were found'); + } else { + printFullResponse(fullEmailsList); + } + + // --------------------------------------------------------------------- + // Method 2: Use the iterator and fetch data on more pages automatically + // --------------------------------------------------------------------- + for await (const email of sinchClient.fax.emails.list(requestData)) { + if (printFormat === 'pretty') { + console.log(`Email '${email.email}' - Phone numbers: '${email.phoneNumbers?.join(', ')}'`); + } else { + console.log(email); + } + } +})(); diff --git a/examples/simple-examples/src/fax/emails/listNumbers.ts b/examples/simple-examples/src/fax/emails/listNumbers.ts new file mode 100644 index 00000000..5bd77638 --- /dev/null +++ b/examples/simple-examples/src/fax/emails/listNumbers.ts @@ -0,0 +1,74 @@ +import { + ListNumbersByEmailRequestData, + PageResult, + ServicePhoneNumber, +} from '@sinch/sdk-core'; +import { getFaxEmailFromConfig, getPrintFormat, initClient, printFullResponse } from '../../config'; + +const populateServiceNumbersList = ( + serviceNumbersPage: PageResult, + fullServiceNumbersList: ServicePhoneNumber[], + serviceNumbersList: string[], +) => { + fullServiceNumbersList.push(...serviceNumbersPage.data); + serviceNumbersPage.data.map((number) => { + serviceNumbersList.push(`Phone numbers: '${number.phoneNumber}'`); + }); +}; + +(async () => { + console.log('*********************'); + console.log('* getNumbersByEmail *'); + console.log('*********************'); + + const email = getFaxEmailFromConfig(); + + const requestData: ListNumbersByEmailRequestData = { + email, + pageSize: 2, + }; + + const sinchClient = initClient(); + + // ---------------------------------------------- + // Method 1: Fetch the data page by page manually + // ---------------------------------------------- + let response = await sinchClient.fax.emails.listNumbers(requestData); + + // Init data structure to hold the response content + const fullServiceNumbersList: ServicePhoneNumber[] = []; + // Init data structure to hold the response content for pretty print + const serviceNumbersList: string[] = []; + + // Loop on all the pages to get all the numbers + let reachedEndOfPages = false; + while (!reachedEndOfPages) { + populateServiceNumbersList(response, fullServiceNumbersList, serviceNumbersList); + if (response.hasNextPage) { + response = await response.nextPage(); + } else { + reachedEndOfPages = true; + } + } + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(serviceNumbersList.length > 0 + ? `List of configured numbers for the email '${requestData.email}':\n${serviceNumbersList.join('\n')}` + : 'Sorry, no numbers were found'); + } else { + printFullResponse(fullServiceNumbersList); + } + + // --------------------------------------------------------------------- + // Method 2: Use the iterator and fetch data on more pages automatically + // --------------------------------------------------------------------- + for await (const number of sinchClient.fax.emails.listNumbers(requestData)) { + if (printFormat === 'pretty') { + console.log(`Phone numbers: '${number.phoneNumber}'`); + } else { + console.log(number); + } + } +})(); diff --git a/examples/simple-examples/src/fax/emails/update.ts b/examples/simple-examples/src/fax/emails/update.ts new file mode 100644 index 00000000..2d3c7520 --- /dev/null +++ b/examples/simple-examples/src/fax/emails/update.ts @@ -0,0 +1,38 @@ +import { UpdateEmailRequestData } from '@sinch/sdk-core'; +import { + getFaxEmailFromConfig, + getPhoneNumberFromConfig, + getPrintFormat, + initClient, + printFullResponse, +} from '../../config'; + +(async () => { + console.log('*************************'); + console.log('* createEmailForProject *'); + console.log('*************************'); + + const phoneNumber = getPhoneNumberFromConfig(); + const email = getFaxEmailFromConfig(); + + const requestData: UpdateEmailRequestData = { + email, + updateEmailRequestBody: { + phoneNumbers: [ + phoneNumber, + '+14155552222', + ], + }, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.emails.update(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`Email successfully updated with numbers '${response.phoneNumbers?.join(', ')}'`); + } else { + printFullResponse(response); + } +})(); diff --git a/examples/simple-examples/src/fax/faxes/deleteContent.ts b/examples/simple-examples/src/fax/faxes/deleteContent.ts new file mode 100644 index 00000000..875c7668 --- /dev/null +++ b/examples/simple-examples/src/fax/faxes/deleteContent.ts @@ -0,0 +1,19 @@ +import { DeleteFaxContentRequestData } from '@sinch/sdk-core'; +import { getFaxIdFromConfig, initClient } from '../../config'; + +(async () => { + console.log('************************'); + console.log('* deleteFaxContentById *'); + console.log('************************'); + + const faxId = getFaxIdFromConfig(); + + const requestData: DeleteFaxContentRequestData = { + id: faxId, + }; + + const sinchClient = initClient(); + await sinchClient.fax.faxes.deleteContent(requestData); + + console.log(`The content of the fax with the id '${requestData.id}' has been successfully removed from storage`); +})(); diff --git a/examples/simple-examples/src/fax/faxes/downloadContent.ts b/examples/simple-examples/src/fax/faxes/downloadContent.ts new file mode 100644 index 00000000..b54610eb --- /dev/null +++ b/examples/simple-examples/src/fax/faxes/downloadContent.ts @@ -0,0 +1,25 @@ +import { DownloadFaxContentRequestData } from '@sinch/sdk-core'; +import { getFaxIdFromConfig, initClient } from '../../config'; +import * as fs from 'fs'; +import * as path from 'path'; + +(async () => { + console.log('******************'); + console.log('* getFaxFileById *'); + console.log('******************'); + + const faxId = getFaxIdFromConfig(); + + const requestData: DownloadFaxContentRequestData = { + id: faxId, + fileFormat: 'pdf', + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.faxes.downloadContent(requestData); + + const filePath = path.join('./fax-pdf', response.fileName); + fs.writeFileSync(filePath, response.buffer); + + console.log('File successfully downloaded'); +})(); diff --git a/examples/simple-examples/src/fax/faxes/get.ts b/examples/simple-examples/src/fax/faxes/get.ts new file mode 100644 index 00000000..303b867e --- /dev/null +++ b/examples/simple-examples/src/fax/faxes/get.ts @@ -0,0 +1,28 @@ +import { GetFaxRequestData } from '@sinch/sdk-core'; +import { getFaxIdFromConfig, getPrintFormat, initClient, printFullResponse } from '../../config'; + +(async () => { + console.log('*******************'); + console.log('* getFaxInfoPerId *'); + console.log('*******************'); + + const faxId = getFaxIdFromConfig(); + + const requestData: GetFaxRequestData = { + id: faxId, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.faxes.get(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`Fax found: it has been created at '${response.createTime}' and the status is '${response.status}'`); + if (response.status === 'FAILURE') { + console.log(`Error type: ${response.errorType} (${response.errorId}): ${response.errorCode}`); + } + } else { + printFullResponse(response); + } +})(); diff --git a/examples/simple-examples/src/fax/faxes/list.ts b/examples/simple-examples/src/fax/faxes/list.ts new file mode 100644 index 00000000..949cb946 --- /dev/null +++ b/examples/simple-examples/src/fax/faxes/list.ts @@ -0,0 +1,67 @@ +import { Fax, ListFaxesRequestData, PageResult } from '@sinch/sdk-core'; +import { getPrintFormat, initClient, printFullResponse } from '../../config'; + +const populateFaxesList = ( + faxPage: PageResult, + fullFaxesList: Fax[], + faxesList: string[], +) => { + fullFaxesList.push(...faxPage.data); + faxPage.data.map((fax) => { + faxesList.push(`Fax ID: '${fax.id}' - Created at: '${fax.createTime}' - Status: '${fax.status}'`); + }); +}; + +(async () => { + console.log('************'); + console.log('* getFaxes *'); + console.log('************'); + + const requestData: ListFaxesRequestData = { + pageSize: 2, + }; + + const sinchClient = initClient(); + + // ---------------------------------------------- + // Method 1: Fetch the data page by page manually + // ---------------------------------------------- + let response = await sinchClient.fax.faxes.list(requestData); + + // Init data structure to hold the response content + const fullFaxesList: Fax[] = []; + // Init data structure to hold the response content for pretty print + const faxesList: string[] = []; + + // Loop on all the pages to get all the faxes + let reachedEndOfPages = false; + while (!reachedEndOfPages) { + populateFaxesList(response, fullFaxesList, faxesList); + if (response.hasNextPage) { + response = await response.nextPage(); + } else { + reachedEndOfPages = true; + } + } + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(faxesList.length > 0 + ? `List of faxes:\n${faxesList.join('\n')}` + : 'Sorry, no faxes were found'); + } else { + printFullResponse(fullFaxesList); + } + + // --------------------------------------------------------------------- + // Method 2: Use the iterator and fetch data on more pages automatically + // --------------------------------------------------------------------- + for await (const fax of sinchClient.fax.faxes.list(requestData)) { + if (printFormat === 'pretty') { + console.log(`Fax ID: '${fax.id}' - Created at: '${fax.createTime}' - Status: '${fax.status}'`); + } else { + console.log(fax); + } + } +})(); diff --git a/examples/simple-examples/src/fax/faxes/send.ts b/examples/simple-examples/src/fax/faxes/send.ts new file mode 100644 index 00000000..93da7602 --- /dev/null +++ b/examples/simple-examples/src/fax/faxes/send.ts @@ -0,0 +1,39 @@ +import { SendFaxRequestData } from '@sinch/sdk-core'; +import { + getFaxCallbackUrlFromConfig, + getPhoneNumberFromConfig, + getPrintFormat, + initClient, + printFullResponse, +} from '../../config'; + +(async () => { + console.log('***********'); + console.log('* sendFax *'); + console.log('***********'); + + const originPhoneNumber = getPhoneNumberFromConfig(); + const destinationPhoneNumber = getPhoneNumberFromConfig(); + const faxCallbackUrl = getFaxCallbackUrlFromConfig(); + + const requestData: SendFaxRequestData = { + sendFaxRequestBody: { + to: destinationPhoneNumber, + from: originPhoneNumber, + contentUrl: 'https://developers.sinch.com/fax/fax.pdf', + callbackUrl: faxCallbackUrl, + callbackContentType: 'application/json', + }, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.faxes.send(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`Fax successfully created at '${response.createTime?.toISOString()}'. Status = '${response.status}'`); + } else { + printFullResponse(response); + } +})(); diff --git a/examples/simple-examples/src/fax/services/create.ts b/examples/simple-examples/src/fax/services/create.ts new file mode 100644 index 00000000..2c88a9b4 --- /dev/null +++ b/examples/simple-examples/src/fax/services/create.ts @@ -0,0 +1,37 @@ +import { CreateServiceRequestData } from '@sinch/sdk-core'; +import { getPhoneNumberFromConfig, getPrintFormat, initClient, printFullResponse } from '../../config'; + +(async () => { + console.log('*****************'); + console.log('* createService *'); + console.log('*****************'); + + const phoneNumber = getPhoneNumberFromConfig(); + + const requestData: CreateServiceRequestData = { + createServiceRequestBody: { + name: 'New service with the Node.js SDK', + incomingWebhookUrl: 'https://yourserver/incomingFax', + webhookContentType: 'multipart/form-data', + defaultForProject: false, + defaultFrom: phoneNumber, + numberOfRetries: 3, + retryDelaySeconds: 60, + imageConversionMethod: 'HALFTONE', + saveOutboundFaxDocuments: true, + saveInboundFaxDocuments: true, + }, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.services.create(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`New service created with the id '${response.id}' - Name: ${response.name}`); + } else { + printFullResponse(response); + } + console.log(`You may want to update your .env file with the following value: FAX_SERVICE_ID=${response.id}`); +})(); diff --git a/examples/simple-examples/src/fax/services/delete.ts b/examples/simple-examples/src/fax/services/delete.ts new file mode 100644 index 00000000..40f0c83e --- /dev/null +++ b/examples/simple-examples/src/fax/services/delete.ts @@ -0,0 +1,19 @@ +import { DeleteServiceRequestData } from '@sinch/sdk-core'; +import { getFaxServiceIdFromConfig, initClient } from '../../config'; + +(async () => { + console.log('*****************'); + console.log('* removeService *'); + console.log('*****************'); + + const serviceId = getFaxServiceIdFromConfig(); + + const requestData: DeleteServiceRequestData = { + serviceId, + }; + + const sinchClient = initClient(); + await sinchClient.fax.services.delete(requestData); + + console.log(`The service with the id '${requestData.serviceId}' has been successfully removed`); +})(); diff --git a/examples/simple-examples/src/fax/services/get.ts b/examples/simple-examples/src/fax/services/get.ts new file mode 100644 index 00000000..38c78979 --- /dev/null +++ b/examples/simple-examples/src/fax/services/get.ts @@ -0,0 +1,25 @@ +import { GetServiceRequestData } from '@sinch/sdk-core'; +import { getFaxServiceIdFromConfig, getPrintFormat, initClient, printFullResponse } from '../../config'; + +(async () => { + console.log('**************'); + console.log('* getService *'); + console.log('**************'); + + const serviceId = getFaxServiceIdFromConfig(); + + const requestData: GetServiceRequestData = { + serviceId, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.services.get(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`Service found: name = '${response.name}'`); + } else { + printFullResponse(response); + } +})(); diff --git a/examples/simple-examples/src/fax/services/list.ts b/examples/simple-examples/src/fax/services/list.ts new file mode 100644 index 00000000..baff2dc4 --- /dev/null +++ b/examples/simple-examples/src/fax/services/list.ts @@ -0,0 +1,67 @@ +import { ListServicesRequestData, PageResult, ServiceResponse } from '@sinch/sdk-core'; +import { getPrintFormat, initClient, printFullResponse } from '../../config'; + +const populateServicesList = ( + servicesPage: PageResult, + fullServicesList: ServiceResponse[], + servicesList: string[], +) => { + fullServicesList.push(...servicesPage.data); + servicesPage.data.map((service) => { + servicesList.push(`Service ID: '${service.id} - Service name: '${service.name}'`); + }); +}; + +(async () => { + console.log('****************'); + console.log('* listServices *'); + console.log('****************'); + + const requestData: ListServicesRequestData = { + pageSize: 2, + }; + + const sinchClient = initClient(); + + // ---------------------------------------------- + // Method 1: Fetch the data page by page manually + // ---------------------------------------------- + let response = await sinchClient.fax.services.list(requestData); + + // Init data structure to hold the response content + const fullServicesList: ServiceResponse[] = []; + // Init data structure to hold the response content for pretty print + const servicesList: string[] = []; + + // Loop on all the pages to get all the services + let reachedEndOfPages = false; + while (!reachedEndOfPages) { + populateServicesList(response, fullServicesList, servicesList); + if (response.hasNextPage) { + response = await response.nextPage(); + } else { + reachedEndOfPages = true; + } + } + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(servicesList.length > 0 + ? `List of services:\n${servicesList.join('\n')}` + : 'Sorry, no services were found'); + } else { + printFullResponse(fullServicesList); + } + + // --------------------------------------------------------------------- + // Method 2: Use the iterator and fetch data on more pages automatically + // --------------------------------------------------------------------- + for await (const service of sinchClient.fax.services.list(requestData)) { + if (printFormat === 'pretty') { + console.log(`Service ID: '${service.id} - Service name: '${service.name}'`); + } else { + console.log(service); + } + } +})(); diff --git a/examples/simple-examples/src/fax/services/listEmailsForNumber.ts b/examples/simple-examples/src/fax/services/listEmailsForNumber.ts new file mode 100644 index 00000000..cbc02c5e --- /dev/null +++ b/examples/simple-examples/src/fax/services/listEmailsForNumber.ts @@ -0,0 +1,65 @@ +import { ListEmailsForNumberRequestData } from '@sinch/sdk-core'; +import { + getFaxServiceIdFromConfig, + getPhoneNumberFromConfig, + getPrintFormat, + initClient, + printFullResponse, +} from '../../config'; + +(async () => { + console.log('**********************'); + console.log('* getEmailsForNumber *'); + console.log('**********************'); + + const phoneNumber = getPhoneNumberFromConfig(); + const serviceId = getFaxServiceIdFromConfig(); + + const requestData: ListEmailsForNumberRequestData = { + phoneNumber, + serviceId, + pageSize: 2, + }; + + const sinchClient = initClient(); + + // ---------------------------------------------- + // Method 1: Fetch the data page by page manually + // ---------------------------------------------- + let response = await sinchClient.fax.services.listEmailsForNumber(requestData); + + // Init data structure to hold the response content + const emailsList: string[] = []; + + // Loop on all the pages to get all the numbers + let reachedEndOfPages = false; + while (!reachedEndOfPages) { + emailsList.push(...response.data); + if (response.hasNextPage) { + response = await response.nextPage(); + } else { + reachedEndOfPages = true; + } + } + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(emailsList.length > 0 + ? `List of emails:\n${emailsList.join('\n')}` + : 'Sorry, no emails were found'); + } else { + printFullResponse(response); + } + + // --------------------------------------------------------------------- + // Method 2: Use the iterator and fetch data on more pages automatically + // --------------------------------------------------------------------- + for await (const email of sinchClient.fax.services.listEmailsForNumber(requestData)) { + if (printFormat === 'pretty') { + console.log(`Email: '${email}'`); + } else { + console.log(email); + } + } +})(); diff --git a/examples/simple-examples/src/fax/services/listNumbers.ts b/examples/simple-examples/src/fax/services/listNumbers.ts new file mode 100644 index 00000000..08d1c4a3 --- /dev/null +++ b/examples/simple-examples/src/fax/services/listNumbers.ts @@ -0,0 +1,70 @@ +import { ListNumbersForServiceRequestData, PageResult, ServicePhoneNumber } from '@sinch/sdk-core'; +import { getFaxServiceIdFromConfig, getPrintFormat, initClient, printFullResponse } from '../../config'; + +const populateNumbersList = ( + numbersPage: PageResult, + fullNumbersList: ServicePhoneNumber[], + numbersList: string[], +) => { + fullNumbersList.push(...numbersPage.data); + numbersPage.data.map((servicePhoneNumber) => { + numbersList.push(`Phone number: '${servicePhoneNumber.phoneNumber} - Service ID: '${servicePhoneNumber.serviceId}'`); + }); +}; + +(async () => { + console.log('*************************'); + console.log('* listNumbersForService *'); + console.log('*************************'); + + const serviceId = getFaxServiceIdFromConfig(); + + const requestData: ListNumbersForServiceRequestData = { + serviceId, + pageSize: 2, + }; + + const sinchClient = initClient(); + + // ---------------------------------------------- + // Method 1: Fetch the data page by page manually + // ---------------------------------------------- + let response = await sinchClient.fax.services.listNumbers(requestData); + + // Init data structure to hold the response content + const fullNumbersList: ServicePhoneNumber[] = []; + // Init data structure to hold the response content for pretty print + const numbersList: string[] = []; + + // Loop on all the pages to get all the numbers + let reachedEndOfPages = false; + while (!reachedEndOfPages) { + populateNumbersList(response, fullNumbersList, numbersList); + if (response.hasNextPage) { + response = await response.nextPage(); + } else { + reachedEndOfPages = true; + } + } + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(numbersList.length > 0 + ? `List of numbers:\n${numbersList.join('\n')}` + : 'Sorry, no numbers were found'); + } else { + printFullResponse(fullNumbersList); + } + + // --------------------------------------------------------------------- + // Method 2: Use the iterator and fetch data on more pages automatically + // --------------------------------------------------------------------- + for await (const servicePhoneNumber of sinchClient.fax.services.listNumbers(requestData)) { + if (printFormat === 'pretty') { + console.log(`Phone number: '${servicePhoneNumber.phoneNumber} - Service ID: '${servicePhoneNumber.serviceId}'`); + } else { + console.log(servicePhoneNumber); + } + } +})(); diff --git a/examples/simple-examples/src/fax/services/update.ts b/examples/simple-examples/src/fax/services/update.ts new file mode 100644 index 00000000..e1a61106 --- /dev/null +++ b/examples/simple-examples/src/fax/services/update.ts @@ -0,0 +1,45 @@ +import { UpdateServiceRequestData } from '@sinch/sdk-core'; +import { + getFaxCallbackUrlFromConfig, + getFaxServiceIdFromConfig, + getPrintFormat, + initClient, + printFullResponse, +} from '../../config'; + +(async () => { + console.log('*****************'); + console.log('* updateService *'); + console.log('*****************'); + + const serviceId = getFaxServiceIdFromConfig(); + const webhookUrl = getFaxCallbackUrlFromConfig(); + + const requestData: UpdateServiceRequestData = { + serviceId, + updateServiceRequestBody: { + name: 'Updated name with the Node.js SDK', + incomingWebhookUrl: webhookUrl, + webhookContentType: 'application/json', + defaultForProject: true, + imageConversionMethod: 'MONOCHROME', + saveOutboundFaxDocuments: true, + saveInboundFaxDocuments: true, + emailSettings: { + pdfPassword: 'pwd', + useBodyAsCoverPage: true, + }, + }, + }; + + const sinchClient = initClient(); + const response = await sinchClient.fax.services.update(requestData); + + const printFormat = getPrintFormat(process.argv); + + if (printFormat === 'pretty') { + console.log(`The service with the id '${response.id}' has been updated - New name: ${response.name}`); + } else { + printFullResponse(response); + } +})(); diff --git a/examples/webhooks/.gitignore b/examples/webhooks/.gitignore index 2ff5437a..fe1ed8d9 100644 --- a/examples/webhooks/.gitignore +++ b/examples/webhooks/.gitignore @@ -6,3 +6,5 @@ .DS_Store .env + +fax-upload/ diff --git a/examples/webhooks/package.json b/examples/webhooks/package.json index 19159d36..6c0b57f4 100644 --- a/examples/webhooks/package.json +++ b/examples/webhooks/package.json @@ -25,6 +25,7 @@ "@nestjs/cli": "^10.0.0", "@nestjs/schematics": "^10.0.0", "@types/express": "^4.17.17", + "@types/multer": "^1.4.11", "@types/node": "^20.8.7", "@typescript-eslint/eslint-plugin": "^6.0.0", "@typescript-eslint/parser": "^6.0.0", diff --git a/examples/webhooks/src/app.module.ts b/examples/webhooks/src/app.module.ts index 5d6a66e4..69fe2d33 100644 --- a/examples/webhooks/src/app.module.ts +++ b/examples/webhooks/src/app.module.ts @@ -1,16 +1,21 @@ import { Module } from '@nestjs/common'; +import { MulterModule } from '@nestjs/platform-express'; import { AppController } from './controller/app.controller'; import { NumbersService } from './services/numbers.service'; import { SmsService } from './services/sms.service'; import { VerificationService } from './services/verification.service'; import { VoiceService } from './services/voice.service'; import { ConversationService } from './services/conversation.service'; +import { FaxService } from './services/fax.service'; @Module({ - imports: [], + imports: [ + MulterModule.register({}), + ], controllers: [AppController], providers: [ ConversationService, + FaxService, NumbersService, SmsService, VerificationService, diff --git a/examples/webhooks/src/controller/app.controller.ts b/examples/webhooks/src/controller/app.controller.ts index 585b3ae5..15731471 100644 --- a/examples/webhooks/src/controller/app.controller.ts +++ b/examples/webhooks/src/controller/app.controller.ts @@ -1,7 +1,9 @@ -import { Body, Controller, Post, Req, Res } from '@nestjs/common'; +import { Body, Controller, Post, Req, Res, UploadedFile, UseInterceptors } from '@nestjs/common'; +import { FileInterceptor } from '@nestjs/platform-express'; import { Request, Response } from 'express'; import { ConversationCallbackWebhooks, + FaxCallbackWebhooks, NumbersCallbackWebhooks, SmsCallbackWebhooks, VerificationCallbackWebhooks, @@ -12,6 +14,7 @@ import { SmsService } from '../services/sms.service'; import { VerificationService } from '../services/verification.service'; import { VoiceService } from '../services/voice.service'; import { ConversationService } from '../services/conversation.service'; +import { FaxService } from '../services/fax.service'; require('dotenv').config(); // Const for Conversation API @@ -29,6 +32,7 @@ export class AppController { constructor( private readonly conversationService: ConversationService, + private readonly faxService: FaxService, private readonly numbersService: NumbersService, private readonly smsService: SmsService, private readonly verificationService: VerificationService, @@ -56,6 +60,24 @@ export class AppController { } } + @Post('/fax') + @UseInterceptors(FileInterceptor('file')) + public fax(@UploadedFile() file: Express.Multer.File, @Req() request: Request, @Res() res: Response) { + // Initialize the class that will be used to validate the request and parse it + const faxCallbackWebhook = new FaxCallbackWebhooks(); + try { + // There is no request validation for the SMS API, so we can parse it and revive its content directly + const event = faxCallbackWebhook.parseEvent(request.body); + // Once the request has been revived, delegate the event management to the SMS service + const contentType = request.headers['content-type']; + this.faxService.handleEvent(event, contentType, file); + res.status(200).send(); + } catch (error) { + console.error(error); + res.status(500).send(); + } + } + @Post('/numbers') public numbers(@Req() request: Request, @Res() res: Response) { // Initialize the class that will be used to validate the request and parse it diff --git a/examples/webhooks/src/main.ts b/examples/webhooks/src/main.ts index 9ae939d0..28cbfa78 100644 --- a/examples/webhooks/src/main.ts +++ b/examples/webhooks/src/main.ts @@ -11,8 +11,8 @@ async function bootstrap() { req.rawBody = buf.toString(encoding || 'utf8'); } }; - app.use(bodyParser.urlencoded({verify: rawBodyBuffer, extended: true })); - app.use(bodyParser.json({ verify: rawBodyBuffer })); + app.use(bodyParser.urlencoded({verify: rawBodyBuffer, extended: true, limit: '10mb' })); + app.use(bodyParser.json({ verify: rawBodyBuffer, limit: '10mb' })); await app.listen(3000); } diff --git a/examples/webhooks/src/services/fax.service.ts b/examples/webhooks/src/services/fax.service.ts new file mode 100644 index 00000000..cedff508 --- /dev/null +++ b/examples/webhooks/src/services/fax.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@nestjs/common'; +import { + FaxBase64File, + FaxCompletedEventJson, + FaxWebhookEventParsed, + IncomingFaxEventJson, +} from '@sinch/sdk-core'; +import * as path from 'path'; +import * as fs from 'fs'; + +@Injectable() +export class FaxService { + + handleEvent(event: FaxWebhookEventParsed, contentType?: string, file?: Express.Multer.File): void { + if (contentType === 'application/json') { + console.log(`** application/json\n${event.event}: ${event.fax!.id} - ${event.eventTime}`); + if (event.event === 'INCOMING_FAX') { + const incomingFaxEvent = event as IncomingFaxEventJson; + this.saveBase64File(incomingFaxEvent, event.fax!.id!); + } + if (event.event === 'FAX_COMPLETED') { + const faxCompletedEvent = event as FaxCompletedEventJson; + for (const fileBase64 of faxCompletedEvent.files!) { + this.saveBase64File(fileBase64, event.fax!.id!); + } + } + } else if (contentType?.includes('multipart/form-data')) { + console.log(`** multipart/form-data\n${event.event}: ${event.fax!.id} - ${event.eventTime}`); + console.log('Saving file...'); + const filePath = path.join('./fax-upload', file!.originalname); + fs.writeFileSync(filePath, file!.buffer); + console.log('File saved! ' + filePath); + } + } + + private saveBase64File(fileBase64: FaxBase64File, faxId: string) { + console.log('Saving file...'); + const filePath = path.join('./fax-upload', faxId + '.' + fileBase64.fileType!.toLowerCase()); + const buffer = Buffer.from(fileBase64.file!, 'base64'); + fs.writeFileSync(filePath, buffer); + console.log('File saved! ' + filePath); + } + +} diff --git a/examples/webhooks/tsconfig.json b/examples/webhooks/tsconfig.json index 95f5641c..e43d996c 100644 --- a/examples/webhooks/tsconfig.json +++ b/examples/webhooks/tsconfig.json @@ -16,6 +16,7 @@ "noImplicitAny": false, "strictBindCallApply": false, "forceConsistentCasingInFileNames": false, - "noFallthroughCasesInSwitch": false + "noFallthroughCasesInSwitch": false, + "resolveJsonModule": true, } } diff --git a/jest.config.ts b/jest.config.ts index 865fface..75e554cd 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -14,6 +14,11 @@ const config: Config.InitialOptions = { testMatch: ['/packages/conversation/tests/**/*.test.ts'], coveragePathIgnorePatterns: ['node_modules', 'tests'], }, + { + displayName: 'Fax', + testMatch: ['/packages/fax/tests/**/*.test.ts'], + coveragePathIgnorePatterns: ['node_modules', 'tests'], + }, { displayName: 'Numbers', testMatch: ['/packages/numbers/tests/**/*.test.ts'], diff --git a/packages/fax/CHANGELOG.md b/packages/fax/CHANGELOG.md new file mode 100644 index 00000000..995e76b4 --- /dev/null +++ b/packages/fax/CHANGELOG.md @@ -0,0 +1,3 @@ +## Version 0.0.3 + +- Initial version diff --git a/packages/fax/README.md b/packages/fax/README.md new file mode 100644 index 00000000..5e200b18 --- /dev/null +++ b/packages/fax/README.md @@ -0,0 +1,120 @@ +# Sinch Fax SDK for Node.js + +This package contains the Sinch Fax SDK for Node.js for use with [Sinch APIs](https://developers.sinch.com/). To use it, you will need a Sinch account. Please [sign up](https://dashboard.sinch.com/signup) or [log in](https://dashboard.sinch.com/login) if you already have one. + +Warning: +**This SDK is currently available for preview purposes only. It should not be used in production environments.** + +## Installation + +We recommend to use this SDK as part of the [`@sinch/sdk-core`](../../packages/sdk-core) package in order to make the most out of all the Sinch products. + +However, it's still possible to use this SDK standalone is you need to access the Fax API only. + +### With NPM + +```bash +npm install @sinch/fax +``` + +### With Yarn + +```bash +yarn add @sinch/fax +``` + +## Usage + +### Credentials + +The `Fax` API uses the Sinch unified authentication with OAuth2. You will need to provide the following credentials: + - projectId: can be found in the [Account Dashboard](https://dashboard.sinch.com/settings/access-keys) + - keyId:: can be found in your Access key list in the [Account Dashboard](https://dashboard.sinch.com/settings/access-keys) + - keySecret: can be found **ONLY** when generating a new access key: keep it safe! + +### As part of the Sinch SDK + +If you are using this SDK as part of the Sinch SDK (`@sinch/sdk-core`) you can access it as the `fax` property of the client that you would have instantiated. + +```typescript +import { + SendFaxRequestData, + SinchClient, + UnifiedCredentials, +} from '@sinch/sdk-core'; + +const credentials: UnifiedCredentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', +}; + +const sinch = new SinchClient(credentials); + +const requestData: SendFaxRequestData = { + sendFaxRequestBody: { + to: '+12015555555', + contentUrl: 'https://developers.sinch.com/fax/fax.pdf', + callbackUrl: 'https://yourserver/incomingFax', + }, +}; + +// Access the 'fax' domain registered on the Sinch Client +const response = await sinchClient.fax.faxes.send(requestData); +``` + +### Standalone + +The SDK can be used standalone if you need to use only the Fax APIs. + +```typescript +import { + UnifiedCredentials, +} from '@sinch/sdk-client'; +import { + SendFaxRequestData, +} from '@sinch/fax'; + +const credentials: UnifiedCredentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', +}; + +// Declare the 'fax' controller in a standalone way +const faxService = new FaxService(credentials); + +const requestData: SendFaxRequestData = { + sendFaxRequestBody: { + to: '+12015555555', + contentUrl: 'https://developers.sinch.com/fax/fax.pdf', + callbackUrl: 'https://yourserver/incomingFax', + }, +}; + +// Use the standalone declaration of the 'fax' service +const response = await faxService.faxes.send(requestData); +``` + +## Promises + +All the methods that interact with the Sinch APIs use Promises. You can use `await` in an `async` method to wait for the response, or you can resolve them yourself with `then()` / `catch()`. + +```typescript +// Method 1: Wait for the Promise to complete (you need to be in an 'async' method) +let sendFaxResult: Fax; +try { + sendFaxResult = await sinch.fax.faxes.send(requestData); + console.log(`Fax successfully created at '${sendFaxResult.createTime}'. Status = '${sendFaxResult.status}`); +} catch (error: any) { + console.error(`ERROR ${error.statusCode}: Impossible to crete the fax sent to ${requestdata.to}.`); +} + +// Method 2: Resolve the promise +sinch.fax.faxes.send(requestData) + .then(response => console.log(`Fax successfully created at '${sendFaxResult.createTime}'. Status = '${sendFaxResult.status}`)) + .catch(error => console.error(`ERROR ${error.statusCode}: Impossible to crete the fax sent to ${requestdata.to}.`)); +``` + +## Contact +Developer Experience team: [devexp@sinch.com](mailto:devexp@sinch.com) diff --git a/packages/fax/package.json b/packages/fax/package.json new file mode 100644 index 00000000..a6cf09e9 --- /dev/null +++ b/packages/fax/package.json @@ -0,0 +1,37 @@ +{ + "name": "@sinch/fax", + "version": "0.0.2", + "description": "Sinch Fax API", + "homepage": "", + "repository": { + "type": "git", + "url": "" + }, + "license": "Apache-2.0", + "author": "Sinch", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "exports": { + ".": { + "import": "./dist/index.js", + "require": "./dist/index.js" + } + }, + "directories": { + "src": "dist", + "test": "tests" + }, + "files": ["/dist"], + "scripts": { + "build": "yarn run clean && yarn run compile", + "clean": "rimraf dist tsconfig.tsbuildinfo", + "compile": "tsc -p tsconfig.build.json && tsc -p tsconfig.tests.json && rimraf dist/tests && rimraf tsconfig.build.tsbuildinfo" + }, + "dependencies": { + "@sinch/sdk-client": "^0.0.2" + }, + "devDependencies": {}, + "publishConfig": { + "directory": "dist" + } +} diff --git a/packages/fax/src/index.ts b/packages/fax/src/index.ts new file mode 100644 index 00000000..20936a85 --- /dev/null +++ b/packages/fax/src/index.ts @@ -0,0 +1,3 @@ +export * from './models'; +export * from './rest'; +export * from '@sinch/sdk-client'; diff --git a/packages/fax/src/models/index.ts b/packages/fax/src/models/index.ts new file mode 100644 index 00000000..daae7fa6 --- /dev/null +++ b/packages/fax/src/models/index.ts @@ -0,0 +1 @@ +export * from './v3'; diff --git a/packages/fax/src/models/v3/bar-code/bar-code.ts b/packages/fax/src/models/v3/bar-code/bar-code.ts new file mode 100644 index 00000000..97bf148e --- /dev/null +++ b/packages/fax/src/models/v3/bar-code/bar-code.ts @@ -0,0 +1,13 @@ + +/** + * Sinch will scan all pages of all incoming faxes for Code-128 and DataMatrix bar codes and include this information in webhook requests and via the API. + */ +export interface BarCode { + + /** The type of barcode found. */ + type?: 'CODE_128' | 'DATA_MATRIX'; + /** The page number on which the barcode was found. */ + page?: number; + /** The information of the barcode. */ + value?: string; +} diff --git a/packages/fax/src/models/v3/bar-code/index.ts b/packages/fax/src/models/v3/bar-code/index.ts new file mode 100644 index 00000000..109fc47f --- /dev/null +++ b/packages/fax/src/models/v3/bar-code/index.ts @@ -0,0 +1 @@ +export type { BarCode } from './bar-code'; diff --git a/packages/fax/src/models/v3/email/email.ts b/packages/fax/src/models/v3/email/email.ts new file mode 100644 index 00000000..8d33c415 --- /dev/null +++ b/packages/fax/src/models/v3/email/email.ts @@ -0,0 +1,13 @@ +interface EmailBase { + + email?: string; + /** Numbers you want to associate with this email. */ + phoneNumbers?: string[]; +} + +export interface EmailRequest extends EmailBase {} + +export interface Email extends EmailBase { + /** The `Id` of the project associated with the call. */ + projectId?: string; +} diff --git a/packages/fax/src/models/v3/email/index.ts b/packages/fax/src/models/v3/email/index.ts new file mode 100644 index 00000000..6b6a3f17 --- /dev/null +++ b/packages/fax/src/models/v3/email/index.ts @@ -0,0 +1 @@ +export type { Email, EmailRequest } from './email'; diff --git a/packages/fax/src/models/v3/enums.ts b/packages/fax/src/models/v3/enums.ts new file mode 100644 index 00000000..7ce8b33a --- /dev/null +++ b/packages/fax/src/models/v3/enums.ts @@ -0,0 +1,36 @@ +// export type { TypeEnum as BarCodeTypeEnum } from './bar-code/bar-code'; +// export type { TypeEnum as CallErrorTypeEnum, ErrorCodeEnum as CallErrorErrorCodeEnum } from './call-error/call-error'; +// export type { TypeEnum as DocumentConversionErrorTypeEnum, ErrorCodeEnum as DocumentConversionErrorErrorCodeEnum } from './document-conversion-error/document-conversion-error'; +// export type { CallbackContentTypeEnum as FaxCallbackContentTypeEnum, ImageConversionMethodEnum as FaxImageConversionMethodEnum } from './fax/fax'; +// export type { FileTypeEnum as FaxBase64FileFileTypeEnum } from './fax-base64-file/fax-base64-file'; +// export type { TypeEnum as FaxErrorTypeEnum } from './fax-error/fax-error'; +// export type { CallbackContentTypeEnum as SendFaxRequest1CallbackContentTypeEnum, ImageConversionMethodEnum as SendFaxRequest1ImageConversionMethodEnum } from './send-fax-request1/send-fax-request1'; + +export type ImageConversionMethod = 'HALFTONE' | 'MONOCHROME'; + +export type WebhookContentType = 'multipart/form-data' | 'application/json'; + +/** + * The direction of the fax. + */ +export type FaxDirection = 'OUTBOUND' | 'INBOUND'; + +/** + * The status of the fax + */ +export type FaxStatus = 'QUEUED' | 'IN_PROGRESS' | 'COMPLETED' | 'FAILURE'; + +/** + * Error type + */ +export type ErrorType = + 'DOCUMENT_CONVERSION_ERROR' + | 'CALL_ERROR' + | 'FAX_ERROR' + | 'FATAL_ERROR' + | 'GENERAL_ERROR' + | 'LINE_ERROR'; + +export type FaxBase64FileType = 'DOC' | 'DOCX' | 'PDF' | 'TIF' | 'JPG' | 'ODT' | 'TXT' | 'HTML' | 'PNG'; + +export type FaxWebhookEvent = 'INCOMING_FAX' | 'FAX_COMPLETED'; diff --git a/packages/fax/src/models/v3/fax-base64-file/fax-base64-file.ts b/packages/fax/src/models/v3/fax-base64-file/fax-base64-file.ts new file mode 100644 index 00000000..1a7d79ab --- /dev/null +++ b/packages/fax/src/models/v3/fax-base64-file/fax-base64-file.ts @@ -0,0 +1,9 @@ +import { FaxBase64FileType } from '../enums'; + +export interface FaxBase64File { + + /** When application/json Base64 encoded file content, this is only present when using application/json for request/response. */ + file?: string; + /** When request/response is application json and file is part of payload. This is the file type of the file. */ + fileType?: FaxBase64FileType; +} diff --git a/packages/fax/src/models/v3/fax-base64-file/index.ts b/packages/fax/src/models/v3/fax-base64-file/index.ts new file mode 100644 index 00000000..897efcac --- /dev/null +++ b/packages/fax/src/models/v3/fax-base64-file/index.ts @@ -0,0 +1 @@ +export type { FaxBase64File } from './fax-base64-file'; diff --git a/packages/fax/src/models/v3/fax-content-url/fax-content-url.ts b/packages/fax/src/models/v3/fax-content-url/fax-content-url.ts new file mode 100644 index 00000000..6e6c5dba --- /dev/null +++ b/packages/fax/src/models/v3/fax-content-url/fax-content-url.ts @@ -0,0 +1,5 @@ + +/** + * Give us any URL on the Internet (including ones with basic authentication) At least one file or contentUrl parameter is required. Please note: If you are passing fax a secure URL (starting with https://), make sure that your SSL certificate (including your intermediate cert, if you have one) is installed properly, valid, and up-to-date. If the file parameter is specified as well, content from URLs will be rendered before content from files. You can add multiple URLs by adding them as an array them with a comma when posting as multipart/form-data For example: \"https://developers.sinch.com/fax/fax.pdf, https://developers.sinch.com/\" or if posting JSON `\"contentUrl\": [\"https://developers.sinch.com/fax/fax.pdf\", \"https://developers.sinch.com/\"]` + */ +export type FaxContentUrl = string | string[]; diff --git a/packages/fax/src/models/v3/fax-content-url/index.ts b/packages/fax/src/models/v3/fax-content-url/index.ts new file mode 100644 index 00000000..e81b1973 --- /dev/null +++ b/packages/fax/src/models/v3/fax-content-url/index.ts @@ -0,0 +1 @@ +export type { FaxContentUrl } from './fax-content-url'; diff --git a/packages/fax/src/models/v3/fax-money/fax-money.ts b/packages/fax/src/models/v3/fax-money/fax-money.ts new file mode 100644 index 00000000..412d5225 --- /dev/null +++ b/packages/fax/src/models/v3/fax-money/fax-money.ts @@ -0,0 +1,11 @@ + +/** + * This is where we need description to be overridden by `$ref:` description + */ +export interface FaxMoney { + + /** The 3-letter currency code defined in ISO 4217. */ + currencyCode?: string; + /** The amount with 4 decimals and decimal delimiter `.`. */ + amount?: string; +} diff --git a/packages/fax/src/models/v3/fax-money/index.ts b/packages/fax/src/models/v3/fax-money/index.ts new file mode 100644 index 00000000..48e147d9 --- /dev/null +++ b/packages/fax/src/models/v3/fax-money/index.ts @@ -0,0 +1 @@ +export type { FaxMoney } from './fax-money'; diff --git a/packages/fax/src/models/v3/fax-request/fax-request.ts b/packages/fax/src/models/v3/fax-request/fax-request.ts new file mode 100644 index 00000000..9330d560 --- /dev/null +++ b/packages/fax/src/models/v3/fax-request/fax-request.ts @@ -0,0 +1,44 @@ +import { ImageConversionMethod, WebhookContentType } from '../enums'; +import { FaxContentUrl } from '../fax-content-url'; +import { FaxBase64File } from '../fax-base64-file'; + +export type FaxRequest = FaxRequestJson | FaxRequestFormData; + +interface FaxRequestBase { + /** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \\\'+\\\'. */ + to: string; + /** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \\\'+\\\'. */ + from?: string; + /** */ + contentUrl?: FaxContentUrl; + /** Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is \\\"-\\\". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. */ + headerText?: string; + /** If true, page numbers will be displayed in the header. Default is true. */ + headerPageNumbers?: boolean; + /** A [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) string specifying the timezone for the header timestamp. */ + headerTimeZone?: string; + /** The number of seconds to wait between retries if the fax is not yet completed. */ + retryDelaySeconds?: number; + /** You can use this to attach labels to your call that you can use in your applications. It is a key value store. */ + labels?: { [key: string]: string; }; + /** The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the `callbackUrl` parameter, if provided, otherwise it will be sent to the URL specified in the `callbackUrl` field of the Fax Service object. */ + callbackUrl?: string; + /** The content type of the callback. */ + callbackContentType?: WebhookContentType; + /** Determines how documents are converted to black and white. Defaults to value selected on Fax Service object. */ + imageConversionMethod?: ImageConversionMethod; + /** ID of the fax service used. */ + serviceId?: string; + /** | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. */ + maxRetries?: number; +} + +export type FaxRequestJson = FaxRequestBase & { + /** An array of base64 encoded files */ + files: FaxBase64File[]; +} + +export interface FaxRequestFormData extends FaxRequestBase { + /** The file(s) you want to send as a fax as body attachment. */ + file?: any; +} diff --git a/packages/fax/src/models/v3/fax-request/index.ts b/packages/fax/src/models/v3/fax-request/index.ts new file mode 100644 index 00000000..ef1da073 --- /dev/null +++ b/packages/fax/src/models/v3/fax-request/index.ts @@ -0,0 +1 @@ +export type { FaxRequest, FaxRequestJson, FaxRequestFormData } from './fax-request'; diff --git a/packages/fax/src/models/v3/fax/fax.ts b/packages/fax/src/models/v3/fax/fax.ts new file mode 100644 index 00000000..89b78d6e --- /dev/null +++ b/packages/fax/src/models/v3/fax/fax.ts @@ -0,0 +1,62 @@ +import { BarCode } from '../bar-code'; +import { FaxContentUrl } from '../fax-content-url'; +import { FaxMoney } from '../fax-money'; +import { ErrorType, FaxDirection, FaxStatus, ImageConversionMethod, WebhookContentType } from '../enums'; + +export interface Fax { + + /** The id of a fax */ + id?: string; + /** @see FaxDirection */ + direction?: FaxDirection; + /** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \'+\'. */ + from?: string; + /** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \'+\'. */ + to?: string; + /** @see FaxContentUrl */ + contentUrl?: FaxContentUrl; + /** The number of pages in the fax. */ + numberOfPages?: number; + /** @see FaxStatus */ + status?: FaxStatus; + /** The total price for this fax. This field is populated after the final fax price is calculated. */ + price?: FaxMoney; + /** The bar codes found in the fax. This field is populated when sinch detects bar codes on incoming faxes. */ + barCodes?: BarCode[]; + /** A timestamp representing the time when the initial API call was made. */ + createTime?: Date; + /** If the job is complete, this is a timestamp representing the time the job was completed. */ + completedTime?: Date; + /** Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is \"-\". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. */ + headerText?: string; + /** If true, page numbers will be displayed in the header. Default is true. */ + headerPageNumbers?: boolean; + /** A [TZ database name](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) string specifying the timezone for the header timestamp. */ + headerTimeZone?: string; + /** The number of seconds to wait between retries if the fax is not yet completed. */ + retryDelaySeconds?: number; + /** You can use this to attach labels to your call that you can use in your applications. It is a key value store. */ + labels?: { [key: string]: string; }; + /** The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the `callbackUrl` parameter, if provided, otherwise it will be sent to the URL specified in the `callbackUrl` field of the Fax Service object. */ + callbackUrl?: string; + /** The content type of the callback. */ + callbackContentType?: WebhookContentType; + /** Determines how documents are converted to black and white. Defaults to value selected on Fax Service object. */ + imageConversionMethod?: ImageConversionMethod; + /** @see ErrorType */ + errorType?: ErrorType; + /** One of the error numbers listed in the [Fax Error Messages section](#FaxErrors). */ + errorId?: number; + /** One of the error codes listed in the [Fax Error Messages section](#FaxErrors). */ + errorCode?: string; + /** The `Id` of the project associated with the call. */ + projectId?: string; + /** ID of the fax service used. */ + serviceId?: string; + /** | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. */ + maxRetries?: number; + /** The number of times the fax has been retried. */ + retryCount?: number; + /** Only shown on the fax result. This indicates if the content of the fax is stored with Sinch. (true or false) */ + hasFile?: string; +} diff --git a/packages/fax/src/models/v3/fax/index.ts b/packages/fax/src/models/v3/fax/index.ts new file mode 100644 index 00000000..531deb48 --- /dev/null +++ b/packages/fax/src/models/v3/fax/index.ts @@ -0,0 +1 @@ +export type { Fax } from './fax'; diff --git a/packages/fax/src/models/v3/index.ts b/packages/fax/src/models/v3/index.ts new file mode 100644 index 00000000..59421719 --- /dev/null +++ b/packages/fax/src/models/v3/index.ts @@ -0,0 +1,30 @@ +// export * from './bad-request-detail'; +export * from './bar-code'; +// export * from './call-error'; +// export * from './document-conversion-error'; +export * from './email'; +// export * from './error'; +// export * from './error-detail'; +// export * from './error-info'; +// export * from './error-type'; +export * from './fax'; +export * from './fax-base64-file'; +export * from './fax-content-url'; +// export * from './fax-error'; +// export * from './fax-errors'; +// export * from './fax-status'; +// export * from './field-violation'; +// export * from './generic-event'; +export * from './fax-money'; +export * from './fax-request'; +export * from './mod-events'; +// export * from './pagination'; +// export * from './quota-failure'; +// export * from './quota-failure-detail'; +// export * from './request-info-detail'; +// export * from './send-fax-request1'; +export * from './service'; +export * from './service-email-settings'; +export * from './service-phone-number'; +export * from './update-email-request'; +export * from './enums'; diff --git a/packages/fax/src/models/v3/mod-events/base-fax-event/base-fax-event.ts b/packages/fax/src/models/v3/mod-events/base-fax-event/base-fax-event.ts new file mode 100644 index 00000000..52901028 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/base-fax-event/base-fax-event.ts @@ -0,0 +1,18 @@ +import { Fax } from '../../fax'; +import { FaxWebhookEvent } from '../../enums'; + +export interface BaseFaxEvent { + /** The different events that can trigger a webhook */ + event?: FaxWebhookEvent; + /** Time of the event. */ + eventTime?: Date; + /** @see Fax */ + fax?: Fax; +} + +export interface FaxEventJson extends BaseFaxEvent {} + +export interface FaxEventFormData extends BaseFaxEvent { + /** The fax content as a PDF attachment to the body. */ + file?: string; +} diff --git a/packages/fax/src/models/v3/mod-events/base-fax-event/index.ts b/packages/fax/src/models/v3/mod-events/base-fax-event/index.ts new file mode 100644 index 00000000..8c7c93c7 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/base-fax-event/index.ts @@ -0,0 +1 @@ +export type { FaxEventJson, FaxEventFormData } from './base-fax-event'; diff --git a/packages/fax/src/models/v3/mod-events/fax-completed-event/fax-completed-event.ts b/packages/fax/src/models/v3/mod-events/fax-completed-event/fax-completed-event.ts new file mode 100644 index 00000000..3952ebc4 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/fax-completed-event/fax-completed-event.ts @@ -0,0 +1,16 @@ +import { FaxBase64File } from '../../fax-base64-file'; +import { FaxEventFormData, FaxEventJson } from '../base-fax-event'; + +export type FaxCompletedEvent = FaxCompletedEventJson | FaxCompletedEventFormData; + +export interface FaxCompletedEventJson extends FaxEventJson { + /** Always FAX_COMPLETED for this event. */ + event?: 'FAX_COMPLETED'; + /** */ + files?: FaxBase64File[]; +} + +export interface FaxCompletedEventFormData extends FaxEventFormData { + /** Always FAX_COMPLETED for this event. */ + event?: 'FAX_COMPLETED'; +} diff --git a/packages/fax/src/models/v3/mod-events/fax-completed-event/index.ts b/packages/fax/src/models/v3/mod-events/fax-completed-event/index.ts new file mode 100644 index 00000000..f6e30334 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/fax-completed-event/index.ts @@ -0,0 +1 @@ +export type { FaxCompletedEvent, FaxCompletedEventJson, FaxCompletedEventFormData } from './fax-completed-event'; diff --git a/packages/fax/src/models/v3/mod-events/incoming-fax-event/incoming-fax-event.ts b/packages/fax/src/models/v3/mod-events/incoming-fax-event/incoming-fax-event.ts new file mode 100644 index 00000000..b3550db6 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/incoming-fax-event/incoming-fax-event.ts @@ -0,0 +1,18 @@ +import { FaxEventFormData, FaxEventJson } from '../base-fax-event'; +import { FaxBase64FileType } from '../../enums'; + +export type IncomingFaxEvent = IncomingFaxEventJson | IncomingFaxEventFormData; + +export interface IncomingFaxEventJson extends FaxEventJson { + /** Always INCOMING_FAX for this event. */ + event?: 'INCOMING_FAX'; + /** The base64 encoded file. */ + file?: string; + /** The file type of the attached file. */ + fileType?: FaxBase64FileType; +} + +export interface IncomingFaxEventFormData extends FaxEventFormData { + /** Always INCOMING_FAX for this event. */ + event?: 'INCOMING_FAX'; +} diff --git a/packages/fax/src/models/v3/mod-events/incoming-fax-event/index.ts b/packages/fax/src/models/v3/mod-events/incoming-fax-event/index.ts new file mode 100644 index 00000000..46005f61 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/incoming-fax-event/index.ts @@ -0,0 +1 @@ +export type { IncomingFaxEvent, IncomingFaxEventJson, IncomingFaxEventFormData } from './incoming-fax-event'; diff --git a/packages/fax/src/models/v3/mod-events/index.ts b/packages/fax/src/models/v3/mod-events/index.ts new file mode 100644 index 00000000..39332884 --- /dev/null +++ b/packages/fax/src/models/v3/mod-events/index.ts @@ -0,0 +1,2 @@ +export * from './fax-completed-event'; +export * from './incoming-fax-event'; diff --git a/packages/fax/src/models/v3/service-email-settings/index.ts b/packages/fax/src/models/v3/service-email-settings/index.ts new file mode 100644 index 00000000..2ec63f57 --- /dev/null +++ b/packages/fax/src/models/v3/service-email-settings/index.ts @@ -0,0 +1 @@ +export type { ServiceEmailSettings } from './service-email-settings'; diff --git a/packages/fax/src/models/v3/service-email-settings/service-email-settings.ts b/packages/fax/src/models/v3/service-email-settings/service-email-settings.ts new file mode 100644 index 00000000..fdee163f --- /dev/null +++ b/packages/fax/src/models/v3/service-email-settings/service-email-settings.ts @@ -0,0 +1,8 @@ + +export interface ServiceEmailSettings { + + /** The password to encrypt the PDF file */ + pdfPassword?: string; + /** Use the body of the email as the cover page */ + useBodyAsCoverPage?: boolean; +} diff --git a/packages/fax/src/models/v3/service-phone-number/index.ts b/packages/fax/src/models/v3/service-phone-number/index.ts new file mode 100644 index 00000000..18278be4 --- /dev/null +++ b/packages/fax/src/models/v3/service-phone-number/index.ts @@ -0,0 +1 @@ +export type { ServicePhoneNumber } from './service-phone-number'; diff --git a/packages/fax/src/models/v3/service-phone-number/service-phone-number.ts b/packages/fax/src/models/v3/service-phone-number/service-phone-number.ts new file mode 100644 index 00000000..131778b5 --- /dev/null +++ b/packages/fax/src/models/v3/service-phone-number/service-phone-number.ts @@ -0,0 +1,10 @@ + +export interface ServicePhoneNumber { + + /** A phone number in [E.164](https://community.sinch.com/t5/Glossary/E-164/ta-p/7537) format, including the leading \'+\'. */ + phoneNumber?: string; + /** The `Id` of the project associated with the call. */ + projectId?: string; + /** ID of the fax service used. */ + serviceId?: string; +} diff --git a/packages/fax/src/models/v3/service/index.ts b/packages/fax/src/models/v3/service/index.ts new file mode 100644 index 00000000..ddb75485 --- /dev/null +++ b/packages/fax/src/models/v3/service/index.ts @@ -0,0 +1 @@ +export type { ServiceRequest, ServiceResponse } from './service'; diff --git a/packages/fax/src/models/v3/service/service.ts b/packages/fax/src/models/v3/service/service.ts new file mode 100644 index 00000000..eb78237f --- /dev/null +++ b/packages/fax/src/models/v3/service/service.ts @@ -0,0 +1,38 @@ +import { ImageConversionMethod, WebhookContentType } from '../enums'; +import { ServiceEmailSettings } from '../service-email-settings'; + +/** + * You can use the default created service, or create multiple services within the same project to have different default behavior for all your different faxing use cases. + */ +export interface ServiceRequest { + + /** A friendly name for the service. Maximum is 60 characters. */ + name?: string; + /** The URL to which Sinch will post when someone sends a fax to your Sinch number. To accept incoming faxes this must be set and your Sinch phone number must be configured to receive faxes. */ + incomingWebhookUrl?: string; + /** The content type of the webhook. */ + webhookContentType?: WebhookContentType; + /** If set to true this is the service used to create faxes when no serviceId is specified in the API endpoints. */ + defaultForProject?: boolean; + /** One of your sinch numbers connected to this service or any of your verified numbers */ + defaultFrom?: string; + /** The number of times to retry sending a fax if it fails. Default is 3. Maximum is 5. */ + numberOfRetries?: number; + /** The number of seconds to wait between retries if the fax is not yet completed. */ + retryDelaySeconds?: number; + /** Determines how documents are converted to black and white. Value should be halftone or monochrome. Defaults to value selected on Fax Settings page */ + imageConversionMethod?: ImageConversionMethod; + /** Save fax documents with sinch when you send faxes */ + saveOutboundFaxDocuments?: boolean; + /** Save fax documents with sinch when you receive faxes */ + saveInboundFaxDocuments?: boolean; + /** @see ServiceEmailSettings */ + emailSettings?: ServiceEmailSettings; +} + +export interface ServiceResponse extends ServiceRequest { + /** ID of the fax service used. */ + id?: string; + /** The `Id` of the project associated with the call. */ + projectId?: string; +} diff --git a/packages/fax/src/models/v3/update-email-request/index.ts b/packages/fax/src/models/v3/update-email-request/index.ts new file mode 100644 index 00000000..dd4a0560 --- /dev/null +++ b/packages/fax/src/models/v3/update-email-request/index.ts @@ -0,0 +1 @@ +export type { UpdateEmailRequest } from './update-email-request'; diff --git a/packages/fax/src/models/v3/update-email-request/update-email-request.ts b/packages/fax/src/models/v3/update-email-request/update-email-request.ts new file mode 100644 index 00000000..6a67056f --- /dev/null +++ b/packages/fax/src/models/v3/update-email-request/update-email-request.ts @@ -0,0 +1,6 @@ + +export interface UpdateEmailRequest { + + /** List of numbers */ + phoneNumbers: string[]; +} diff --git a/packages/fax/src/rest/index.ts b/packages/fax/src/rest/index.ts new file mode 100644 index 00000000..daae7fa6 --- /dev/null +++ b/packages/fax/src/rest/index.ts @@ -0,0 +1 @@ +export * from './v3'; diff --git a/packages/fax/src/rest/v3/callbacks/callbacks-webhook.ts b/packages/fax/src/rest/v3/callbacks/callbacks-webhook.ts new file mode 100644 index 00000000..2b13e896 --- /dev/null +++ b/packages/fax/src/rest/v3/callbacks/callbacks-webhook.ts @@ -0,0 +1,66 @@ +import { CallbackProcessor } from '@sinch/sdk-client'; +import { IncomingHttpHeaders } from 'http'; +import { Fax, FaxCompletedEvent, IncomingFaxEvent } from '../../../models'; + +export type FaxWebhookEventParsed = IncomingFaxEvent | FaxCompletedEvent; + +export class FaxCallbackWebhooks implements CallbackProcessor { + + /** + * Reviver for a Fax Event + * This method ensures the object can be treated as a Fax Event and should be called before any action is taken to manipulate the object. + * @param {any} eventBody - the event body or form containing the Fax event notification. + * @return {FaxWebhookEventParsed} - The parsed Fax event object + */ + public parseEvent(eventBody: any): FaxWebhookEventParsed { + let incomingFaxEvent: IncomingFaxEvent | null = null; + let faxCompletedEvent: FaxCompletedEvent | null = null; + if (eventBody.event) { + switch (eventBody.event) { + case 'INCOMING_FAX': + incomingFaxEvent = eventBody as IncomingFaxEvent; + if (eventBody.eventTime) { + incomingFaxEvent.eventTime = new Date(eventBody.eventTime); + } + // In case of multipart/form-data, the server may not have parsed the 'fax' property as a JSON object, so we do it here + if (typeof eventBody.fax === 'string') { + incomingFaxEvent.fax = this.reviveFax(eventBody.fax); + } + return incomingFaxEvent; + case 'FAX_COMPLETED': + faxCompletedEvent = eventBody as FaxCompletedEvent; + if (faxCompletedEvent.eventTime) { + faxCompletedEvent.eventTime = new Date(faxCompletedEvent.eventTime); + } + // In case of multipart/form-data, the server may not have parsed the 'fax' property as a JSON object, so we do it here + if (typeof eventBody.fax === 'string') { + faxCompletedEvent.fax = this.reviveFax(eventBody.fax); + } + return faxCompletedEvent; + default: + throw new Error(`Unknown Fax event: ${eventBody.event}`); + } + } + console.log(eventBody); + throw new Error('Unknown Fax event'); + } + + private reviveFax(faxAsString: string): Fax { + const fax: Fax = JSON.parse(faxAsString); + if (fax.createTime) { + fax.createTime = new Date(fax.createTime); + } + if (fax.completedTime) { + fax.completedTime = new Date(fax.completedTime); + } + return fax; + } + + public validateAuthenticationHeader( + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _headers: IncomingHttpHeaders, _body: any, _path: string, _method: string): boolean { + // No header validation is implemented for Fax API + return true; + } + +} diff --git a/packages/fax/src/rest/v3/callbacks/index.ts b/packages/fax/src/rest/v3/callbacks/index.ts new file mode 100644 index 00000000..f04a2490 --- /dev/null +++ b/packages/fax/src/rest/v3/callbacks/index.ts @@ -0,0 +1 @@ +export * from './callbacks-webhook'; diff --git a/packages/fax/src/rest/v3/emails/emails-api.jest.fixture.ts b/packages/fax/src/rest/v3/emails/emails-api.jest.fixture.ts new file mode 100644 index 00000000..b5c32349 --- /dev/null +++ b/packages/fax/src/rest/v3/emails/emails-api.jest.fixture.ts @@ -0,0 +1,35 @@ +import { Email, ServicePhoneNumber } from '../../../models'; +import { + EmailsApi, + DeleteEmailRequestData, + ListEmailsForProjectRequestData, + ListNumbersByEmailRequestData, + UpdateEmailRequestData, + AddEmailToNumbersRequestData, +} from './emails-api'; +import { ApiListPromise } from '@sinch/sdk-client'; + +export class EmailsApiFixture implements Partial> { + + /** + * Fixture associated to function addToNumbers + */ + public addToNumbers: jest.Mock, [AddEmailToNumbersRequestData]> = jest.fn(); + /** + * Fixture associated to function deleteEmail + */ + public delete: jest.Mock, [DeleteEmailRequestData]> = jest.fn(); + /** + * Fixture associated to function getEmailsForProject + */ + public list: jest.Mock, [ListEmailsForProjectRequestData]> = jest.fn(); + /** + * Fixture associated to function getNumbersByEmail + */ + public listNumbers: jest.Mock, [ListNumbersByEmailRequestData]> = jest.fn(); + /** + * Fixture associated to function updateEmail + */ + public update: jest.Mock, [UpdateEmailRequestData]> = jest.fn(); +} + diff --git a/packages/fax/src/rest/v3/emails/emails-api.ts b/packages/fax/src/rest/v3/emails/emails-api.ts new file mode 100644 index 00000000..1135753a --- /dev/null +++ b/packages/fax/src/rest/v3/emails/emails-api.ts @@ -0,0 +1,224 @@ +import { Email, EmailRequest, ServicePhoneNumber, UpdateEmailRequest } from '../../../models'; +import { + ApiListPromise, + buildPageResultPromise, + createIteratorMethodsForPagination, + PaginatedApiProperties, + PaginationEnum, + RequestBody, + SinchClientParameters, +} from '@sinch/sdk-client'; +import { FaxDomainApi } from '../fax-domain-api'; + +export interface AddEmailToNumbersRequestData { + /** */ + 'emailRequestBody': EmailRequest; +} +export interface DeleteEmailRequestData { + /** The email you want to delete. */ + 'email': string; +} +export interface ListEmailsForProjectRequestData { + /** Number of items to return on each page. */ + 'pageSize'?: number; + /** Optional. The page to fetch. If not specified, the first page will be returned. */ + 'page'?: string; +} +export interface ListNumbersByEmailRequestData { + /** The email you want to get numbers for. */ + 'email': string; + /** Number of items to return on each page. */ + 'pageSize'?: number; + /** Optional. The page to fetch. If not specified, the first page will be returned. */ + 'page'?: string; +} +export interface UpdateEmailRequestData { + /** The email you want to work with. */ + 'email': string; + /** */ + 'updateEmailRequestBody'?: UpdateEmailRequest; +} + +export class EmailsApi extends FaxDomainApi { + + /** + * Initialize your interface + * + * @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client. + */ + constructor(sinchClientParameters: SinchClientParameters) { + super(sinchClientParameters, 'EmailsApi'); + } + + /** + * Add an email + * Add an email to be used for sending and receiving faxes. + * @param { AddEmailToNumbersRequestData } data - The data to provide to the API call. + */ + public async addToNumbers(data: AddEmailToNumbersRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = data['emailRequestBody'] ? JSON.stringify(data['emailRequestBody']) : '{}'; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/emails`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'CreateEmailForProject', + }); + } + + /** + * Remove email + * Delete an email and associated numbers to that email to disable that email from sending and receiving faxes. + * @param { DeleteEmailRequestData } data - The data to provide to the API call. + */ + public async delete(data: DeleteEmailRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = data['email'] ? JSON.stringify(data['email']) : '{}'; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/emails/${data['email']}`; + + const requestOptions + = await this.client.prepareOptions(basePathUrl, 'DELETE', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'DeleteEmail', + }); + } + + /** + * List emails + * List emails for the project. + * @param { ListEmailsForProjectRequestData } data - The data to provide to the API call. + * @return {ApiListPromise} - The list of emails for the project + */ + public list(data: ListEmailsForProjectRequestData): ApiListPromise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, ['pageSize', 'page']); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/emails`; + + const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + + const operationProperties: PaginatedApiProperties = { + pagination: PaginationEnum.PAGE3, + apiName: this.apiName, + operationId: 'GetEmailsForProject', + dataKey: 'emails', + }; + + // Create the promise containing the response wrapped as a PageResult + const listPromise = buildPageResultPromise( + this.client, + requestOptionsPromise, + operationProperties); + + // Add properties to the Promise to offer the possibility to use it as an iterator + Object.assign( + listPromise, + createIteratorMethodsForPagination( + this.client, requestOptionsPromise, listPromise, operationProperties), + ); + + return listPromise as ApiListPromise; + } + + /** + * Get numbers for email + * Get configured numbers for an email + * @param { ListNumbersByEmailRequestData } data - The data to provide to the API call. + * @return {ApiListPromise} + */ + public listNumbers(data: ListNumbersByEmailRequestData): ApiListPromise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [ + 'email', + 'pageSize', + 'page']); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/emails/${data['email']}/numbers`; + + const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + + const operationProperties: PaginatedApiProperties = { + pagination: PaginationEnum.PAGE3, + apiName: this.apiName, + operationId: 'GetNumbersByEmail', + dataKey: 'phoneNumbers', + }; + + // Create the promise containing the response wrapped as a PageResult + const listPromise = buildPageResultPromise( + this.client, + requestOptionsPromise, + operationProperties); + + // Add properties to the Promise to offer the possibility to use it as an iterator + Object.assign( + listPromise, + createIteratorMethodsForPagination( + this.client, requestOptionsPromise, listPromise, operationProperties), + ); + + return listPromise as ApiListPromise; + } + + /** + * Update numbers for email + * Set the numbers for an email. + * @param { UpdateEmailRequestData } data - The data to provide to the API call. + */ + public async update(data: UpdateEmailRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = data['updateEmailRequestBody'] + ? JSON.stringify(data['updateEmailRequestBody']) + : '{}'; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/emails/${data['email']}`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'PUT', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'UpdateEmail', + }); + } + +} diff --git a/packages/fax/src/rest/v3/emails/index.ts b/packages/fax/src/rest/v3/emails/index.ts new file mode 100644 index 00000000..19072ef6 --- /dev/null +++ b/packages/fax/src/rest/v3/emails/index.ts @@ -0,0 +1,2 @@ +export * from './emails-api'; +export * from './emails-api.jest.fixture'; diff --git a/packages/fax/src/rest/v3/enums.ts b/packages/fax/src/rest/v3/enums.ts new file mode 100644 index 00000000..28ebfa1d --- /dev/null +++ b/packages/fax/src/rest/v3/enums.ts @@ -0,0 +1,2 @@ +// export type { GetFaxFileByIdFileFormatEnum, SendFaxCallbackContentTypeEnum, SendFaxImageConversionMethodEnum } from './faxes'; +export {}; diff --git a/packages/fax/src/rest/v3/fax-domain-api.ts b/packages/fax/src/rest/v3/fax-domain-api.ts new file mode 100644 index 00000000..9071386b --- /dev/null +++ b/packages/fax/src/rest/v3/fax-domain-api.ts @@ -0,0 +1,81 @@ +import { + Api, + ApiClient, + ApiClientOptions, + ApiFetchClient, + SinchClientParameters, + Oauth2TokenRequest, + UnifiedCredentials, +} from '@sinch/sdk-client'; + +export class FaxDomainApi implements Api { + public readonly apiName: string; + public client?: ApiClient; + private sinchClientParameters: SinchClientParameters; + + constructor(sinchClientParameters: SinchClientParameters, apiName: string) { + this.sinchClientParameters = sinchClientParameters; + this.apiName = apiName; + } + + /** + * Update the default basePath for the API + * @param {string} basePath - The new base path to use for the APIs. + */ + public setBasePath(basePath: string) { + this.client = this.getSinchClient(); + this.client.apiClientOptions.basePath = basePath; + } + + /** + * Updates the credentials used to authenticate API requests + * @param {UnifiedCredentials} credentials + */ + public setCredentials(credentials: UnifiedCredentials) { + const parametersBackup = { ...this.sinchClientParameters }; + this.sinchClientParameters = { + ...parametersBackup, + ...credentials, + }; + this.resetApiClient(); + try { + this.getSinchClient(); + } catch (error) { + console.error('Impossible to assign the new credentials to the Fax API'); + this.sinchClientParameters = parametersBackup; + throw error; + } + } + + private resetApiClient() { + this.client = undefined; + } + + /** + * Checks the configuration parameters are ok and initialize the API client. Once initialized, the same instance will + * be returned for the subsequent API calls (singleton pattern) + * @return {ApiClient} the API Client or throws an error in case the configuration parameters are not ok + * @private + */ + public getSinchClient(): ApiClient { + if (!this.client) { + const apiClientOptions = this.buildApiClientOptions(this.sinchClientParameters); + this.client = new ApiFetchClient(apiClientOptions); + this.client.apiClientOptions.basePath = 'https://fax.api.sinch.com'; + } + return this.client; + } + + private buildApiClientOptions(params: SinchClientParameters): ApiClientOptions { + if (!params.projectId || !params.keyId || !params.keySecret) { + throw new Error('Invalid configuration for the Fax API: ' + + '"projectId", "keyId" and "keySecret" values must be provided'); + } + return { + projectId: params.projectId, + requestPlugins: [new Oauth2TokenRequest( params.keyId, params.keySecret)], + useServicePlanId: false, + }; + } + +} diff --git a/packages/fax/src/rest/v3/fax-service.ts b/packages/fax/src/rest/v3/fax-service.ts new file mode 100644 index 00000000..c8c0436c --- /dev/null +++ b/packages/fax/src/rest/v3/fax-service.ts @@ -0,0 +1,27 @@ +import { SinchClientParameters } from '@sinch/sdk-client'; +import { EmailsApi } from './emails'; +import { FaxesApi } from './faxes'; +import { ServicesApi } from './services'; + +export class FaxService { + public readonly emails: EmailsApi; + public readonly faxes: FaxesApi; + public readonly services: ServicesApi; + + constructor(params: SinchClientParameters) { + this.emails = new EmailsApi(params); + this.faxes = new FaxesApi(params); + this.services = new ServicesApi(params); + } + + /** + * Update the default basePath for each API + * + * @param {string} basePath - The new base path to use for all the APIs. + */ + public setBasePath(basePath: string) { + this.emails.setBasePath(basePath); + this.faxes.setBasePath(basePath); + this.services.setBasePath(basePath); + } +} diff --git a/packages/fax/src/rest/v3/faxes/faxes-api.jest.fixture.ts b/packages/fax/src/rest/v3/faxes/faxes-api.jest.fixture.ts new file mode 100644 index 00000000..1de9ba86 --- /dev/null +++ b/packages/fax/src/rest/v3/faxes/faxes-api.jest.fixture.ts @@ -0,0 +1,28 @@ +import { Fax } from '../../../models'; +import { FaxesApi, DeleteFaxContentRequestData, DownloadFaxContentRequestData, GetFaxRequestData, ListFaxesRequestData, SendFaxRequestData } from './faxes-api'; +import { ApiListPromise, FileBuffer } from '@sinch/sdk-client'; + +export class FaxesApiFixture implements Partial> { + + /** + * Fixture associated to function deleteFaxContentById + */ + public deleteContent: jest.Mock, [DeleteFaxContentRequestData]> = jest.fn(); + /** + * Fixture associated to function getFaxFileById + */ + public downloadContent: jest.Mock, [DownloadFaxContentRequestData]> = jest.fn(); + /** + * Fixture associated to function getFaxInfoPerId + */ + public get: jest.Mock, [GetFaxRequestData]> = jest.fn(); + /** + * Fixture associated to function getFaxes + */ + public list: jest.Mock, [ListFaxesRequestData]> = jest.fn(); + /** + * Fixture associated to function sendFax + */ + public send: jest.Mock, [SendFaxRequestData]> = jest.fn(); +} + diff --git a/packages/fax/src/rest/v3/faxes/faxes-api.ts b/packages/fax/src/rest/v3/faxes/faxes-api.ts new file mode 100644 index 00000000..73978363 --- /dev/null +++ b/packages/fax/src/rest/v3/faxes/faxes-api.ts @@ -0,0 +1,273 @@ +import { + ApiListPromise, + buildPageResultPromise, + createIteratorMethodsForPagination, + FileBuffer, + PaginatedApiProperties, + PaginationEnum, + RequestBody, + SinchClientParameters, +} from '@sinch/sdk-client'; +import { FaxDomainApi } from '../fax-domain-api'; +import { + Fax, + FaxDirection, + FaxStatus, + FaxRequest, + FaxRequestJson, + FaxRequestFormData, +} from '../../../models'; + +export interface DeleteFaxContentRequestData { + /** The ID of the fax. */ + 'id': string; +} +export interface DownloadFaxContentRequestData { + /** The ID of the fax. */ + 'id': string; + /** The file format to download. Currently only PDF is supported. */ + 'fileFormat'?: 'pdf'; +} +export interface GetFaxRequestData { + /** The ID of the fax. */ + 'id': string; +} +export interface ListFaxesRequestData { + /** Filter calls based on `createTime`. If you make the query more precise, fewer results will be returned. For example, `2021-02-01` will return all calls from the first of February 2021, and `2021-02-01T14:00:00Z` will return all calls after 14:00 on the first of February. This field also supports `<=` and `>=` to search for calls in a range `?createTime>=2021-10-01&startTime<=2021-10-30` to get a list of calls for all of October 2021. It is also possible to submit partial dates. For example, `createTime=2021-02` will return all calls for February 2021. If not value is submitted, the default value is the prior week. */ + 'createTime'?: string; + /** Limits results to faxes with the specified direction. */ + 'direction'?: FaxDirection; + /** Limits results to faxes with the specified status. */ + 'status'?: FaxStatus; + /** A phone number that you want to use to filter results. The parameter search with startsWith, so you can pass a partial number to get all faxes sent to numbers that start with the number you passed. */ + 'to'?: string; + /** A phone number that you want to use to filter results. The parameter search with startsWith, so you can pass a partial number to get all faxes sent to numbers that start with the number you passed. */ + 'from'?: string; + /** The maximum number of items to return per request. The default is 100 and the maximum is 1000. If you need to export larger amounts and pagination is not suitable for you can use the Export function in the dashboard. */ + 'pageSize'?: number; + /** The page you want to retrieve returned from a previous List request, if any */ + 'page'?: string; +} +export interface SendFaxRequestData { + 'sendFaxRequestBody': FaxRequest; +} + +export class FaxesApi extends FaxDomainApi { + + /** + * Initialize your interface + * + * @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client. + */ + constructor(sinchClientParameters: SinchClientParameters) { + super(sinchClientParameters, 'FaxesApi'); + } + + /** + * Delete fax content + * Delete the fax content for a fax using the ID number of the fax. Please note that this only deletes the content of the fax from storage. + * @param { DeleteFaxContentRequestData } data - The data to provide to the API call. + */ + public async deleteContent(data: DeleteFaxContentRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/faxes/${data['id']}/file`; + + const requestOptions + = await this.client.prepareOptions(basePathUrl, 'DELETE', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'DeleteFaxContentById', + }); + } + + /** + * Download fax content + * Download the fax content. + * @param { DownloadFaxContentRequestData } data - The data to provide to the API call. + */ + public async downloadContent(data: DownloadFaxContentRequestData): Promise { + this.client = this.getSinchClient(); + data['fileFormat'] = data['fileFormat'] !== undefined ? data['fileFormat'] : 'pdf'; + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/pdf', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/faxes/${data['id']}/file.${data['fileFormat']}`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processFileCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'GetFaxFileById', + }); + } + + /** + * Get fax + * Get fax information using the ID number of the fax. + * @param { GetFaxRequestData } data - The data to provide to the API call. + */ + public async get(data: GetFaxRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/faxes/${data['id']}`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'GetFaxInfoPerId', + }); + } + + /** + * List faxes + * List faxes sent (OUTBOUND) or received (INBOUND), set parameters to filter the list. Example: Return calls made between 1st of January 2021 and 10th of January 2021. ``` created>=2021-01-01&startTime<=2021-01-10 ``` + * @param { ListFaxesRequestData } data - The data to provide to the API call. + * @return {ApiListPromise} + */ + public list(data: ListFaxesRequestData): ApiListPromise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [ + 'createTime', + 'direction', + 'status', + 'to', + 'from', + 'pageSize', + 'page']); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/faxes`; + + const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + + const operationProperties: PaginatedApiProperties = { + pagination: PaginationEnum.PAGE3, + apiName: this.apiName, + operationId: 'GetFaxes', + dataKey: 'faxes', + }; + + // Create the promise containing the response wrapped as a PageResult + const listPromise = buildPageResultPromise( + this.client, + requestOptionsPromise, + operationProperties); + + // Add properties to the Promise to offer the possibility to use it as an iterator + Object.assign( + listPromise, + createIteratorMethodsForPagination( + this.client, requestOptionsPromise, listPromise, operationProperties), + ); + + return listPromise as ApiListPromise; + } + + /** + * Send a fax + * Create and send a fax. Fax content may be supplied via one or more files or URLs of supported filetypes. + * This endpoint supports the following content types for the fax payload: + * - Multipart/form-data + * - Application/json + * We will however always return a fax object in the response in application json. + * If you supply a callbackUrl the callback will be sent as multipart/form-data with the content of the fax as an attachment to the body, *unless* you specify callbackContentType as application/json. + * #### file(s) + * Files may be included in the POST request as multipart/form-data parts. + * #### contentUrl + * Any URL on the Internet (including ones with basic authentication), and we'll pull it down and make it a fax. This might be useful to you if you're using a web framework for templates and creating fax files. + * Please note: If you are passing fax a secure URL (starting with 'https://'), make sure that your SSL certificate (including your intermediate cert, if you have one) is installed properly, valid, and up-to-date. + * @param { SendFaxRequestData } data - The data to provide to the API call. + */ + public async send(data: SendFaxRequestData): Promise { + this.client = this.getSinchClient(); + const requestBody = data.sendFaxRequestBody; + requestBody['headerText'] = requestBody['headerText'] !== undefined + ? requestBody['headerText'] : ''; + requestBody['headerPageNumbers'] = requestBody['headerPageNumbers'] !== undefined + ? requestBody['headerPageNumbers'] : true; + requestBody['headerTimeZone'] = requestBody['headerTimeZone'] !== undefined + ? requestBody['headerTimeZone'] : 'America/New_York'; + requestBody['retryDelaySeconds'] = requestBody['retryDelaySeconds'] !== undefined + ? requestBody['retryDelaySeconds'] : 60; + requestBody['callbackContentType'] = requestBody['callbackContentType'] !== undefined + ? requestBody['callbackContentType'] : 'multipart/form-data'; + requestBody['imageConversionMethod'] = requestBody['imageConversionMethod'] !== undefined + ? requestBody['imageConversionMethod'] : 'HALFTONE'; + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Accept': 'application/json', + }; + + let body: RequestBody; + // Except if the request body contains a non-empty property 'files' (where the message will be sent as application/json) + // the request will be sent as multipart/formdata + const isUsingJson = (data['sendFaxRequestBody'] as FaxRequestJson).files !== undefined; + if (isUsingJson) { + headers['Content-Type'] = 'application/json'; + body = JSON.stringify(data['sendFaxRequestBody']); + } else { + const formParams:any = {}; + const requestData = data.sendFaxRequestBody as FaxRequestFormData; + if( requestData.to ) { formParams['to'] = requestData.to; } + if( requestData.file ) { formParams['file'] = requestData.file; } + if( requestData.from ) { formParams['from'] = requestData.from; } + if( requestData.contentUrl ) { formParams['contentUrl'] = requestData.contentUrl; } + if( requestData.headerText ) { formParams['headerText'] = requestData.headerText; } + if( requestData.headerPageNumbers ) { formParams['headerPageNumbers'] = requestData.headerPageNumbers; } + if( requestData.headerTimeZone ) { formParams['headerTimeZone'] = requestData.headerTimeZone; } + if( requestData.retryDelaySeconds ) { formParams['retryDelaySeconds'] = requestData.retryDelaySeconds; } + if( requestData.labels ) { formParams['labels'] = requestData.labels; } + if( requestData.callbackUrl ) { formParams['callbackUrl'] = requestData.callbackUrl; } + if( requestData.callbackContentType ) { formParams['callbackContentType'] = requestData.callbackContentType; } + if( requestData.imageConversionMethod ) {formParams['imageConversionMethod'] = requestData.imageConversionMethod;} + if( requestData.serviceId ) { formParams['serviceId'] = requestData.serviceId; } + if( requestData.maxRetries ) { formParams['maxRetries'] = requestData.maxRetries; } + body = this.client.processFormData(formParams, 'multipart/form-data'); + } + + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/faxes`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'SendFax', + }); + } + +} diff --git a/packages/fax/src/rest/v3/faxes/index.ts b/packages/fax/src/rest/v3/faxes/index.ts new file mode 100644 index 00000000..1b6230b9 --- /dev/null +++ b/packages/fax/src/rest/v3/faxes/index.ts @@ -0,0 +1,2 @@ +export * from './faxes-api'; +export * from './faxes-api.jest.fixture'; diff --git a/packages/fax/src/rest/v3/index.ts b/packages/fax/src/rest/v3/index.ts new file mode 100644 index 00000000..110257fa --- /dev/null +++ b/packages/fax/src/rest/v3/index.ts @@ -0,0 +1,6 @@ +export * from './callbacks'; +export * from './emails'; +export * from './faxes'; +export * from './services'; +export * from './enums'; +export * from './fax-service'; diff --git a/packages/fax/src/rest/v3/services/index.ts b/packages/fax/src/rest/v3/services/index.ts new file mode 100644 index 00000000..5ebde6b2 --- /dev/null +++ b/packages/fax/src/rest/v3/services/index.ts @@ -0,0 +1,2 @@ +export * from './services-api'; +export * from './services-api.jest.fixture'; diff --git a/packages/fax/src/rest/v3/services/services-api.jest.fixture.ts b/packages/fax/src/rest/v3/services/services-api.jest.fixture.ts new file mode 100644 index 00000000..4123c67f --- /dev/null +++ b/packages/fax/src/rest/v3/services/services-api.jest.fixture.ts @@ -0,0 +1,46 @@ +import { ServicePhoneNumber, ServiceResponse } from '../../../models'; +import { + ServicesApi, + CreateServiceRequestData, + GetServiceRequestData, + ListNumbersForServiceRequestData, + ListServicesRequestData, + DeleteServiceRequestData, + UpdateServiceRequestData, + ListEmailsForNumberRequestData, +} from './services-api'; +import { ApiListPromise } from '@sinch/sdk-client'; + +export class ServicesApiFixture implements Partial> { + + /** + * Fixture associated to function create + */ + public create: jest.Mock, [CreateServiceRequestData]> = jest.fn(); + /** + * Fixture associated to function get + */ + public get: jest.Mock, [GetServiceRequestData]> = jest.fn(); + /** + * Fixture associated to function listEmailsForNumber + */ + public listEmailsForNumber: jest.Mock, [ListEmailsForNumberRequestData]> = jest.fn(); + /** + * Fixture associated to function listNumbers + */ + public listNumbers: + jest.Mock, [ListNumbersForServiceRequestData]> = jest.fn(); + /** + * Fixture associated to function list + */ + public list: jest.Mock, [ListServicesRequestData]> = jest.fn(); + /** + * Fixture associated to function delete + */ + public delete: jest.Mock, [DeleteServiceRequestData]> = jest.fn(); + /** + * Fixture associated to function update + */ + public update: jest.Mock, [UpdateServiceRequestData]> = jest.fn(); +} + diff --git a/packages/fax/src/rest/v3/services/services-api.ts b/packages/fax/src/rest/v3/services/services-api.ts new file mode 100644 index 00000000..642aaf26 --- /dev/null +++ b/packages/fax/src/rest/v3/services/services-api.ts @@ -0,0 +1,313 @@ +import { + ServicePhoneNumber, + ServiceRequest, + ServiceResponse, +} from '../../../models'; +import { + ApiListPromise, + buildPageResultPromise, + createIteratorMethodsForPagination, + PaginatedApiProperties, + PaginationEnum, + RequestBody, + SinchClientParameters, +} from '@sinch/sdk-client'; +import { FaxDomainApi } from '../fax-domain-api'; + +export interface CreateServiceRequestData { + /** */ + 'createServiceRequestBody'?: ServiceRequest; +} +export interface GetServiceRequestData { + /** The service ID you want to update. */ + 'serviceId': string; +} +export interface ListEmailsForNumberRequestData { + /** The phone number you want to get emails for. */ + 'phoneNumber': string; + /** The serviceId containing the numbers you want to list. */ + 'serviceId': string; + /** Number of items to return on each page. */ + 'pageSize'?: number; + /** Optional. The page to fetch. If not specified, the first page will be returned. */ + 'page'?: string; +} +export interface ListNumbersForServiceRequestData { + /** The serviceId containing the numbers you want to list. */ + 'serviceId': string; + /** Number of items to return on each page. */ + 'pageSize'?: number; + /** Optional. The page to fetch. If not specified, the first page will be returned. */ + 'page'?: string; +} +export interface ListServicesRequestData { + /** Number of services to return on each request. */ + 'pageSize'?: number; + /** Optional. The page to fetch. If not specified, the first page will be returned. */ + 'page'?: string; +} +export interface DeleteServiceRequestData { + /** The serviceId you want to remove from your project. */ + 'serviceId': string; +} +export interface UpdateServiceRequestData { + /** The service ID you want to update. */ + 'serviceId': string; + /** */ + 'updateServiceRequestBody'?: ServiceRequest; +} + +export class ServicesApi extends FaxDomainApi { + + /** + * Initialize your interface + * + * @param {SinchClientParameters} sinchClientParameters - The parameters used to initialize the API Client. + */ + constructor(sinchClientParameters: SinchClientParameters) { + super(sinchClientParameters, 'ServicesApi'); + } + + /** + * Create a service + * Creates a new service that you can use to set default configuration values. + * @param { CreateServiceRequestData } data - The data to provide to the API call. + */ + public async create(data: CreateServiceRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = data['createServiceRequestBody'] + ? JSON.stringify(data['createServiceRequestBody']) + : '{}'; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'POST', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'CreateService', + }); + } + + /** + * Get a service + * Get a service resource. + * @param { GetServiceRequestData } data - The data to provide to the API call. + */ + public async get(data: GetServiceRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services/${data['serviceId']}`; + + const requestOptions = await this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'GetService', + }); + } + + /** + * List emails for a number + * List any emails for a number. + * @param { ListEmailsForNumberRequestData } data - The data to provide to the API call. + * @return {ApiListPromise} - The list of emails for a given number + */ + public listEmailsForNumber(data: ListEmailsForNumberRequestData): ApiListPromise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, ['pageSize', 'page']); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services/${data['serviceId']}/numbers/${data['phoneNumber']}/emails`; + + const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + + const operationProperties: PaginatedApiProperties = { + pagination: PaginationEnum.PAGE3, + apiName: this.apiName, + operationId: 'GetEmailsForNumber', + dataKey: 'emails', + }; + + // Create the promise containing the response wrapped as a PageResult + const listPromise = buildPageResultPromise( + this.client, + requestOptionsPromise, + operationProperties); + + // Add properties to the Promise to offer the possibility to use it as an iterator + Object.assign( + listPromise, + createIteratorMethodsForPagination( + this.client, requestOptionsPromise, listPromise, operationProperties), + ); + + return listPromise as ApiListPromise; + } + + /** + * List numbers for service + * List numbers for a service. + * @param { ListNumbersForServiceRequestData } data - The data to provide to the API call. + * @return {ApiListPromise} + */ + public listNumbers(data: ListNumbersForServiceRequestData): ApiListPromise { + this.client = this.getSinchClient(); + data['pageSize'] = data['pageSize'] !== undefined ? data['pageSize'] : 20; + const getParams = this.client.extractQueryParams(data, ['pageSize', 'page']); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services/${data['serviceId']}/numbers`; + + const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + + const operationProperties: PaginatedApiProperties = { + pagination: PaginationEnum.PAGE3, + apiName: this.apiName, + operationId: 'ListNumbersForService', + dataKey: 'numbers', + }; + + // Create the promise containing the response wrapped as a PageResult + const listPromise = buildPageResultPromise( + this.client, + requestOptionsPromise, + operationProperties); + + // Add properties to the Promise to offer the possibility to use it as an iterator + Object.assign( + listPromise, + createIteratorMethodsForPagination( + this.client, requestOptionsPromise, listPromise, operationProperties), + ); + + return listPromise as ApiListPromise; + } + + /** + * List services + * Get a list of services for a project. + * @param { ListServicesRequestData } data - The data to provide to the API call. + * @return {ApiListPromise} + */ + public list(data: ListServicesRequestData): ApiListPromise { + this.client = this.getSinchClient(); + data['pageSize'] = data['pageSize'] !== undefined ? data['pageSize'] : 20; + const getParams = this.client.extractQueryParams(data, ['pageSize', 'page']); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services`; + + const requestOptionsPromise = this.client.prepareOptions(basePathUrl, 'GET', getParams, headers, body || undefined); + + const operationProperties: PaginatedApiProperties = { + pagination: PaginationEnum.PAGE3, + apiName: this.apiName, + operationId: 'ListServices', + dataKey: 'services', + }; + + // Create the promise containing the response wrapped as a PageResult + const listPromise = buildPageResultPromise( + this.client, + requestOptionsPromise, + operationProperties); + + // Add properties to the Promise to offer the possibility to use it as an iterator + Object.assign( + listPromise, + createIteratorMethodsForPagination( + this.client, requestOptionsPromise, listPromise, operationProperties), + ); + + return listPromise as ApiListPromise; + } + + /** + * Remove a service + * Removes a service from your project. + * @param { DeleteServiceRequestData } data - The data to provide to the API call. + */ + public async delete(data: DeleteServiceRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = ''; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services/${data['serviceId']}`; + + const requestOptions + = await this.client.prepareOptions(basePathUrl, 'DELETE', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'RemoveService', + }); + } + + /** + * Update a Service + * Update settings on the service. + * @param { UpdateServiceRequestData } data - The data to provide to the API call. + */ + public async update(data: UpdateServiceRequestData): Promise { + this.client = this.getSinchClient(); + const getParams = this.client.extractQueryParams(data, [] as never[]); + const headers: { [key: string]: string | undefined } = { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + }; + + const body: RequestBody = data['updateServiceRequestBody'] + ? JSON.stringify(data['updateServiceRequestBody']) + : '{}'; + const basePathUrl = `${this.client.apiClientOptions.basePath}/v3/projects/${this.client.apiClientOptions.projectId}/services/${data['serviceId']}`; + + const requestOptions + = await this.client.prepareOptions(basePathUrl, 'PATCH', getParams, headers, body || undefined); + const url = this.client.prepareUrl(requestOptions.basePath, requestOptions.queryParams); + + return this.client.processCall({ + url, + requestOptions, + apiName: this.apiName, + operationId: 'UpdateService', + }); + } + +} diff --git a/packages/fax/tests/rest/v3/emails/emails-api.test.ts b/packages/fax/tests/rest/v3/emails/emails-api.test.ts new file mode 100644 index 00000000..f5e26a3d --- /dev/null +++ b/packages/fax/tests/rest/v3/emails/emails-api.test.ts @@ -0,0 +1,172 @@ +import { SinchClientParameters } from '@sinch/sdk-client'; +import { + AddEmailToNumbersRequestData, + DeleteEmailRequestData, + Email, + ListEmailsForProjectRequestData, ListNumbersByEmailRequestData, ServicePhoneNumber, UpdateEmailRequestData, +} from '../../../../src'; +import { EmailsApi, EmailsApiFixture } from '../../../../src'; + +describe('EmailsApi', () => { + let emailsApi: EmailsApi; + let fixture: EmailsApiFixture; + let credentials: SinchClientParameters; + + beforeEach(() => { + fixture = new EmailsApiFixture(); + credentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', + }; + emailsApi = new EmailsApi(credentials); + }); + + + describe ('createEmailForProject', () => { + it('should make a POST request to add an email to be used for sending and receiving faxes', async () => { + // Given + const requestData: AddEmailToNumbersRequestData = { + emailRequestBody: { + email: 'user@domain.com', + phoneNumbers: [ + '+14155552222', + ], + }, + }; + const expectedResponse: Email = { + email: 'user@domain.com', + phoneNumbers: [ + '+14155552222', + ], + projectId: 'projectId', + }; + + // When + fixture.addToNumbers.mockResolvedValue(expectedResponse); + emailsApi.addToNumbers = fixture.addToNumbers; + const response = await emailsApi.addToNumbers(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.addToNumbers).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('deleteEmail', () => { + it('should make a DELETE request to delete an email and its numbers association', async () => { + // Given + const requestData: DeleteEmailRequestData = { + email: 'user@domain.com', + }; + const expectedResponse = undefined; + + // When + fixture.delete.mockResolvedValue(expectedResponse); + emailsApi.delete = fixture.delete; + const response = await emailsApi.delete(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.delete).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('getEmailsForProject', () => { + it('should make a GET request to list emails for the project', async () => { + // Given + const requestData: ListEmailsForProjectRequestData = { + pageSize: 2, + }; + const mockData: Email[] = [ + { + email: 'user@domain.com', + phoneNumbers: [ + '+14155552222', + ], + projectId: 'projectId', + }, + ]; + const expectedResponse = { + data: mockData, + hasNextPage: false, + nextPageValue: '', + nextPage: jest.fn(), + }; + + // When + fixture.list.mockResolvedValue(expectedResponse); + emailsApi.list = fixture.list; + const response = await emailsApi.list(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.list).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('getNumbersByEmail', () => { + it('should make a GET request to list the configured numbers for an email', async () => { + // Given + const requestData: ListNumbersByEmailRequestData = { + email: 'user@domain.com', + pageSize: 2, + }; + const mockData: ServicePhoneNumber[] = [ + { + phoneNumber: '+14155552222', + serviceId: 'serviceId', + projectId: 'projectId', + }, + ]; + const expectedResponse = { + data: mockData, + hasNextPage: false, + nextPageValue: '', + nextPage: jest.fn(), + }; + + // When + fixture.listNumbers.mockResolvedValue(expectedResponse); + emailsApi.listNumbers = fixture.listNumbers; + const response = await emailsApi.listNumbers(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(response.data).toBeDefined(); + expect(fixture.listNumbers).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('updateEmail', () => { + it('should make a PUT request to set the numbers for an email', async () => { + // Given + const requestData: UpdateEmailRequestData = { + email: 'user@domain.com', + updateEmailRequestBody: { + phoneNumbers: [ + '+14155552222', + '+14155553333', + ], + }, + }; + const expectedResponse: Email = { + email: 'user@domain.com', + phoneNumbers: [ + '+14155552222', + '+14155553333', + ], + projectId: 'projectId', + }; + + // When + fixture.update.mockResolvedValue(expectedResponse); + emailsApi.update = fixture.update; + const response = await emailsApi.update(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.update).toHaveBeenCalledWith(requestData); + }); + }); +}); diff --git a/packages/fax/tests/rest/v3/faxes/faxes-api.test.ts b/packages/fax/tests/rest/v3/faxes/faxes-api.test.ts new file mode 100644 index 00000000..18147263 --- /dev/null +++ b/packages/fax/tests/rest/v3/faxes/faxes-api.test.ts @@ -0,0 +1,195 @@ +import { FileBuffer, SinchClientParameters } from '@sinch/sdk-client'; +import { + DeleteFaxContentRequestData, Fax, + FaxesApi, + FaxesApiFixture, ListFaxesRequestData, + DownloadFaxContentRequestData, + GetFaxRequestData, SendFaxRequestData, +} from '../../../../src'; + +describe('FaxesApi', () => { + let faxesApi: FaxesApi; + let fixture: FaxesApiFixture; + let credentials: SinchClientParameters; + + beforeEach(() => { + fixture = new FaxesApiFixture(); + credentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', + }; + faxesApi = new FaxesApi(credentials); + }); + + + describe ('deleteFaxContentById', () => { + it('should make a DELETE request to delete the content of a fax from storage', async () => { + // Given + const requestData: DeleteFaxContentRequestData = { + id: 'fax_id', + }; + const expectedResponse: void = undefined; + + // When + fixture.deleteContent.mockResolvedValue(expectedResponse); + faxesApi.deleteContent = fixture.deleteContent; + const response = await faxesApi.deleteContent(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.deleteContent).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('getFaxFileById', () => { + it('should make a GET request to download a fax content', async () => { + // Given + const requestData: DownloadFaxContentRequestData = { + id: 'fax_id', + }; + const expectedResponse: FileBuffer = { + fileName: 'default-name.pdf', + buffer: Buffer.from('PDF file content goes here', 'utf-8'), + }; + + // When + fixture.downloadContent.mockResolvedValue(expectedResponse); + faxesApi.downloadContent = fixture.downloadContent; + const response = await faxesApi.downloadContent(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.downloadContent).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('getFaxInfoPerId', () => { + it('should make a GET request to retrieve some fax information', async () => { + // Given + const requestData: GetFaxRequestData = { + id: 'fax_id', + }; + const expectedResponse: Fax = { + id: 'fax_id', + direction: 'OUTBOUND', + to: '+12015555555', + status: 'FAILURE', + headerTimeZone: 'America/New_York', + retryDelaySeconds: 60, + callbackContentType: 'multipart/form-data', + errorType: 'LINE_ERROR', + errorId: 89, + errorCode: 'The call dropped prematurely', + projectId: 'projectId', + serviceId: 'serviceId', + maxRetries: 3, + createTime: new Date('2024-02-27T12:28:09.000Z'), + headerPageNumbers: true, + retryCount: 3, + contentUrl: [ + 'https://developers.sinch.com/fax/fax.pdf', + ], + imageConversionMethod: 'HALFTONE', + hasFile: 'true', + }; + + // When + fixture.get.mockResolvedValue(expectedResponse); + faxesApi.get = fixture.get; + const response = await faxesApi.get(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.get).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('getFaxes', () => { + it('should make a GET request to list faxes sent or received', async () => { + // Given + const requestData: ListFaxesRequestData = { + direction: 'OUTBOUND', + }; + const mockData: Fax[] = [ + { + id: 'fax_id', + direction: 'OUTBOUND', + to: '+12015555555', + status: 'FAILURE', + headerTimeZone: 'America/New_York', + retryDelaySeconds: 60, + callbackContentType: 'multipart/form-data', + errorType: 'LINE_ERROR', + errorId: 89, + errorCode: 'The call dropped prematurely', + projectId: 'projectId', + serviceId: 'serviceId', + maxRetries: 3, + createTime: new Date('2024-02-27T12:28:09.000Z'), + headerPageNumbers: true, + retryCount: 3, + contentUrl: [ + 'https://developers.sinch.com/fax/fax.pdf', + ], + imageConversionMethod: 'HALFTONE', + hasFile: 'true', + }, + ]; + const expectedResponse = { + data: mockData, + hasNextPage: false, + nextPageValue: '', + nextPage: jest.fn(), + }; + + // When + fixture.list.mockResolvedValue(expectedResponse); + faxesApi.list = fixture.list; + const response = await faxesApi.list(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(response.data).toBeDefined(); + expect(fixture.list).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('sendFax', () => { + it('should make a POST request to create and send a fax', async () => { + // Given + const requestData: SendFaxRequestData = { + sendFaxRequestBody: { + to: '+12015555555', + }, + }; + const expectedResponse: Fax = { + id: 'fax_id', + direction: 'OUTBOUND', + to: '+12015555555', + status: 'IN_PROGRESS', + headerTimeZone: 'America/New_York', + retryDelaySeconds: 60, + callbackContentType: 'multipart/form-data', + projectId: 'projectId', + serviceId: 'serviceId', + maxRetries: 3, + createTime: new Date('2024-02-27T12:28:09Z'), + headerPageNumbers: true, + contentUrl: [ + 'https://developers.sinch.com/fax/fax.pdf', + ], + imageConversionMethod: 'HALFTONE', + }; + + // When + fixture.send.mockResolvedValue(expectedResponse); + faxesApi.send = fixture.send; + const response = await faxesApi.send(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.send).toHaveBeenCalledWith(requestData); + }); + }); +}); diff --git a/packages/fax/tests/rest/v3/services/services-api.test.ts b/packages/fax/tests/rest/v3/services/services-api.test.ts new file mode 100644 index 00000000..f50cc75c --- /dev/null +++ b/packages/fax/tests/rest/v3/services/services-api.test.ts @@ -0,0 +1,274 @@ +import { SinchClientParameters } from '@sinch/sdk-client'; +import { + CreateServiceRequestData, + GetServiceRequestData, + ListNumbersForServiceRequestData, + ListServicesRequestData, + DeleteServiceRequestData, + ServicePhoneNumber, + ServiceResponse, + ServicesApi, + ServicesApiFixture, + UpdateServiceRequestData, + ListEmailsForNumberRequestData, +} from '../../../../src'; + +describe('ServicesApi', () => { + let servicesApi: ServicesApi; + let fixture: ServicesApiFixture; + let credentials: SinchClientParameters; + + beforeEach(() => { + fixture = new ServicesApiFixture(); + credentials = { + projectId: 'PROJECT_ID', + keyId: 'KEY_ID', + keySecret: 'KEY_SECRET', + }; + servicesApi = new ServicesApi(credentials); + }); + + + describe ('createService', () => { + it('should make a POST request to create a new service', async () => { + // Given + const requestData: CreateServiceRequestData = { + createServiceRequestBody: { + name: 'New service', + incomingWebhookUrl: 'https://yourserver/incomingFax', + webhookContentType: 'multipart/form-data', + defaultForProject: false, + defaultFrom: '+15551235656', + numberOfRetries: 3, + retryDelaySeconds: 60, + imageConversionMethod: 'HALFTONE', + saveOutboundFaxDocuments: true, + saveInboundFaxDocuments: true, + }, + }; + const expectedResponse: ServiceResponse = { + id: 'serviceId', + name: 'New service', + incomingWebhookUrl: 'https://yourserver/incomingFax', + webhookContentType: 'multipart/form-data', + defaultForProject: false, + defaultFrom: '+15551235656', + numberOfRetries: 3, + retryDelaySeconds: 60, + imageConversionMethod: 'HALFTONE', + saveOutboundFaxDocuments: true, + saveInboundFaxDocuments: true, + projectId: 'projectId', + }; + + // When + fixture.create.mockResolvedValue(expectedResponse); + servicesApi.create = fixture.create; + const response = await servicesApi.create(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.create).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('getService', () => { + it('should make a GET request to retrieve a service resource', async () => { + // Given + const requestData: GetServiceRequestData = { + serviceId: 'serviceId', + }; + const expectedResponse: ServiceResponse = { + id: 'serviceId', + name: 'New service', + incomingWebhookUrl: 'https://yourserver/incomingFax', + webhookContentType: 'multipart/form-data', + defaultForProject: false, + defaultFrom: '+15551235656', + numberOfRetries: 3, + retryDelaySeconds: 60, + imageConversionMethod: 'HALFTONE', + saveOutboundFaxDocuments: true, + saveInboundFaxDocuments: true, + projectId: 'projectId', + }; + + // When + fixture.get.mockResolvedValue(expectedResponse); + servicesApi.get = fixture.get; + const response = await servicesApi.get(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.get).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('listEmailsForNumber', () => { + it('should make a GET request to list any emails for a number', async () => { + // Given + const requestData: ListEmailsForNumberRequestData = { + serviceId: 'serviceId', + phoneNumber: '+15551235656', + }; + const mockData: string[] = [ + 'user@example.com', + ]; + const expectedResponse = { + data: mockData, + hasNextPage: false, + nextPageValue: '', + nextPage: jest.fn(), + }; + + // When + fixture.listEmailsForNumber.mockResolvedValue(expectedResponse); + servicesApi.listEmailsForNumber = fixture.listEmailsForNumber; + const response = await servicesApi.listEmailsForNumber(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(response.data).toBeDefined(); + expect(fixture.listEmailsForNumber).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('listNumbersForService', () => { + it('should make a GET request to list the numbers associated with a service', async () => { + // Given + const requestData: ListNumbersForServiceRequestData = { + serviceId: 'serviceId', + pageSize: 10, + page: '0', + }; + const mockData: ServicePhoneNumber[] = [ + { + serviceId: 'serviceId', + projectId: 'projectId', + phoneNumber: '+15551235656', + }, + ]; + const expectedResponse = { + data: mockData, + hasNextPage: false, + nextPageValue: '', + nextPage: jest.fn(), + }; + + // When + fixture.listNumbers.mockResolvedValue(expectedResponse); + servicesApi.listNumbers = fixture.listNumbers; + const response = await servicesApi.listNumbers(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(response.data).toBeDefined(); + expect(fixture.listNumbers).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('listServices', () => { + it('should make a GET request to list the services for a project', async () => { + // Given + const requestData: ListServicesRequestData = { + pageSize: 10, + page: '0', + }; + const mockData: ServiceResponse[] = [ + { + id: 'serviceId', + name: 'New service', + incomingWebhookUrl: 'https://yourserver/incomingFax', + webhookContentType: 'multipart/form-data', + defaultForProject: false, + defaultFrom: '+15551235656', + numberOfRetries: 3, + retryDelaySeconds: 60, + imageConversionMethod: 'HALFTONE', + saveOutboundFaxDocuments: true, + saveInboundFaxDocuments: true, + projectId: 'projectId', + }, + ]; + const expectedResponse = { + data: mockData, + hasNextPage: false, + nextPageValue: '', + nextPage: jest.fn(), + }; + + // When + fixture.list.mockResolvedValue(expectedResponse); + servicesApi.list = fixture.list; + const response = await servicesApi.list(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(response.data).toBeDefined(); + expect(fixture.list).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('removeService', () => { + it('should make a DELETE request to remove a service from a project', async () => { + // Given + const requestData: DeleteServiceRequestData = { + serviceId: 'serviceId', + }; + const expectedResponse: void = undefined; + + // When + fixture.delete.mockResolvedValue(expectedResponse); + servicesApi.delete = fixture.delete; + const response = await servicesApi.delete(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.delete).toHaveBeenCalledWith(requestData); + }); + }); + + describe ('updateService', () => { + it('should make a PATCH request to update settings on a service', async () => { + // Given + const requestData: UpdateServiceRequestData = { + serviceId: 'serviceId', + updateServiceRequestBody: { + name: 'Updated service', + incomingWebhookUrl: 'https://your-new-server/incomingFax', + webhookContentType: 'application/json', + defaultForProject: true, + defaultFrom: '+15551234567', + numberOfRetries: 5, + retryDelaySeconds: 30, + imageConversionMethod: 'MONOCHROME', + saveOutboundFaxDocuments: false, + saveInboundFaxDocuments: false, + }, + }; + const expectedResponse: ServiceResponse = { + id: 'serviceId', + name: 'Updated service', + incomingWebhookUrl: 'https://your-new-server/incomingFax', + webhookContentType: 'application/json', + defaultForProject: true, + defaultFrom: '+15551234567', + numberOfRetries: 5, + retryDelaySeconds: 30, + imageConversionMethod: 'MONOCHROME', + saveOutboundFaxDocuments: false, + saveInboundFaxDocuments: false, + projectId: 'projectId', + }; + + // When + fixture.update.mockResolvedValue(expectedResponse); + servicesApi.update = fixture.update; + const response = await servicesApi.update(requestData); + + // Then + expect(response).toEqual(expectedResponse); + expect(fixture.update).toHaveBeenCalledWith(requestData); + }); + }); +}); diff --git a/packages/fax/tsconfig.build.json b/packages/fax/tsconfig.build.json new file mode 100644 index 00000000..73f1cf60 --- /dev/null +++ b/packages/fax/tsconfig.build.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "rootDir": "src", + "outDir": "dist" + }, + + "include": ["src/**/*.ts"], + "exclude": ["node_modules", "dist"], + + "references": [{ "path": "../sdk-client" }], + + "ts-node": { + "esm": true + } +} diff --git a/packages/fax/tsconfig.json b/packages/fax/tsconfig.json new file mode 100644 index 00000000..2684d3e0 --- /dev/null +++ b/packages/fax/tsconfig.json @@ -0,0 +1,11 @@ +{ + "extends": "../../tsconfig.json", + "references": [ + { + "path": "tsconfig.build.json" + }, + { + "path": "tsconfig.tests.json" + } + ] +} diff --git a/packages/fax/tsconfig.tests.json b/packages/fax/tsconfig.tests.json new file mode 100644 index 00000000..2e454981 --- /dev/null +++ b/packages/fax/tsconfig.tests.json @@ -0,0 +1,17 @@ +{ + "extends": "../../tsconfig.json", + + "compilerOptions": { + "rootDir": ".", + "outDir": "dist/tests" + }, + + "include": ["src/**/*.ts", "tests/**/*.ts"], + "exclude": ["node_modules", "dist"], + + "references": [{ "path": "../sdk-client" }], + + "ts-node": { + "esm": true + } +} diff --git a/packages/sdk-client/src/api/api-client.ts b/packages/sdk-client/src/api/api-client.ts index cef60263..5a34a176 100644 --- a/packages/sdk-client/src/api/api-client.ts +++ b/packages/sdk-client/src/api/api-client.ts @@ -1,11 +1,14 @@ import { RequestBody, RequestOptions } from '../plugins/core/request-plugin'; import { ApiClientOptions } from './api-client-options'; import { Headers } from 'node-fetch'; +import FormData = require('form-data'); +import { FileBuffer } from './api-interface'; export enum PaginationEnum { NONE, TOKEN, - PAGE + PAGE, + PAGE3 } export interface ApiListPromise extends Promise>, AsyncIterableIterator { } @@ -182,7 +185,7 @@ export class ApiClient { } /** - * Process HTTP call + * Process HTTP call with Pagination * @abstract * @template T * @param {ApiCallParametersWithPagination} _httpCallParameters - Parameters for the HTTP call. @@ -193,6 +196,29 @@ export class ApiClient { throw new Error('Abstract method must be implemented'); } + /** + * Process HTTP call to download a PDF file + * @abstract + * @template T + * @param {ApiCallParameters} _httpCallParameters - Parameters for the HTTP call. + * @return {Promise} A promise that resolves to the result of the HTTP call. + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + processFileCall(_httpCallParameters: ApiCallParameters): Promise { + throw new Error('Abstract method must be implemented'); + } + + /** + * Receives an object containing key/value pairs + * Encodes this object to match application/x-www-urlencoded or multipart/form-data + * @abstract + * @param {any} _data + * @param {string} _type + */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + processFormData(_data: any, _type: string): FormData | string { + throw new Error('Abstract method must be implemented'); + } } diff --git a/packages/sdk-client/src/api/api-interface.ts b/packages/sdk-client/src/api/api-interface.ts index 51d4370a..16968b99 100644 --- a/packages/sdk-client/src/api/api-interface.ts +++ b/packages/sdk-client/src/api/api-interface.ts @@ -7,3 +7,10 @@ export interface Api { /** API Client used to process the calls to the API */ client?: ApiClient; } + +export interface FileBuffer { + /** Name of the file extracted from the 'content-disposition' header */ + fileName: string; + /** File content as Buffer */ + buffer: Buffer; +} diff --git a/packages/sdk-client/src/client/api-client-helpers.ts b/packages/sdk-client/src/client/api-client-helpers.ts index a7adcdf7..5a11d2e5 100644 --- a/packages/sdk-client/src/client/api-client-helpers.ts +++ b/packages/sdk-client/src/client/api-client-helpers.ts @@ -91,5 +91,9 @@ export const reviveDates = (input: any): any => { }; const isDateString = (value: any): boolean => { - return typeof value === 'string' && !isNaN(Date.parse(value)); + if (typeof value === 'string' && value.length >= 10) { + const date = new Date(value); + return !isNaN(date.getTime()) && date.toISOString().slice(0, 10) === value.slice(0,10); + } + return false; }; diff --git a/packages/sdk-client/src/client/api-client-pagination-helper.ts b/packages/sdk-client/src/client/api-client-pagination-helper.ts index c61a296b..7e6d976f 100644 --- a/packages/sdk-client/src/client/api-client-pagination-helper.ts +++ b/packages/sdk-client/src/client/api-client-pagination-helper.ts @@ -1,5 +1,6 @@ import { - ApiCallParametersWithPagination, ApiClient, + ApiCallParametersWithPagination, + ApiClient, ApiListPromise, AutoPaginationMethods, PageResult, @@ -166,6 +167,9 @@ export function hasMore( const pageSize: number = requestedPageSize ? parseInt(requestedPageSize) : response.page_size; return checkIfThereAreMorePages(response, pageSize); } + if (context.pagination === PaginationEnum.PAGE3) { + return response.pageNumber < response.totalPages; + } throw new Error(`The operation ${context.operationId} is not meant to be paginated.`); } @@ -181,6 +185,11 @@ export function calculateNextPage( const nextPage = currentPage + 1; return nextPage.toString(); } + if (context.pagination === PaginationEnum.PAGE3) { + const currentPage: number = response.pageNumber || 1; + const nextPage = currentPage + 1; + return nextPage.toString(); + } throw new Error(`The operation ${context.operationId} is not meant to be paginated.`); } diff --git a/packages/sdk-client/src/client/api-fetch-client.ts b/packages/sdk-client/src/client/api-fetch-client.ts index af344cab..20f86787 100644 --- a/packages/sdk-client/src/client/api-fetch-client.ts +++ b/packages/sdk-client/src/client/api-fetch-client.ts @@ -9,9 +9,13 @@ import { ErrorContext, GenericError, ApiCallParameters, - ResponseJSONParseError, ApiCallParametersWithPagination, PageResult, + ResponseJSONParseError, + ApiCallParametersWithPagination, + PageResult, + FileBuffer, } from '../api'; import fetch, { Response, Headers } from 'node-fetch'; +import FormData = require('form-data'); import { buildErrorContext, manageExpiredToken, reviveDates } from './api-client-helpers'; import { buildPaginationContext, @@ -227,4 +231,75 @@ export class ApiFetchClient extends ApiClient { ) : []; } + + /** @inheritdoc */ + public async processFileCall( + props: ApiCallParameters, + ): Promise { + // Read the "Origin" header if existing, for logging purposes + const origin = (props.requestOptions.headers as Headers).get('Origin'); + const errorContext: ErrorContext = buildErrorContext(props, origin); + + // Declare variables + let response: Response | undefined; + let body: Buffer | undefined; + let fileName: string | undefined; + + // Execute call + try { + // Send the request with the refresh token mechanism + response = await this.sinchFetch(props, errorContext); + body = await response.buffer(); + fileName = this.extractFileName(response.headers); + } catch (error: any) { + this.buildFetchError(error, errorContext); + } + + if (!body || !fileName) { + throw new Error('An error occurred while downloading the file'); + } + + return { + fileName, + buffer: body, + }; + } + + private extractFileName(headers: Headers) { + const contentDisposition = headers.get('content-disposition'); + let fileName = 'default-name.pdf'; + if (contentDisposition) { + const match = contentDisposition.match(/filename="([^"]+)"/); + if (match && match[1]) { + fileName = match[1]; + } + } + return fileName; + } + + /** @inheritDoc */ + public processFormData(data: any, type: string): FormData | string { + + let encodedData: FormData | string; + + if (type === 'multipart/form-data') { + const formData: FormData = new FormData(); + for (const i in data) { + if (Object.prototype.hasOwnProperty.call(data, i)) { + formData.append(i, data[i]); + } + } + encodedData = formData; + } else { + const formData: string[] = []; + for (const i in data) { + if (Object.prototype.hasOwnProperty.call(data, i)) { + formData.push(`${i}=${encodeURIComponent(data[i])}`); + } + } + encodedData = formData.join('&'); + } + + return encodedData; + } } diff --git a/packages/sdk-client/tests/client/api-client-helpers.test.ts b/packages/sdk-client/tests/client/api-client-helpers.test.ts index 5c0e3dfe..4aac59a0 100644 --- a/packages/sdk-client/tests/client/api-client-helpers.test.ts +++ b/packages/sdk-client/tests/client/api-client-helpers.test.ts @@ -16,8 +16,11 @@ describe('API client helpers', () => { date3: '2024-02-04T20:22:00.123Z', }, ], - otherProp: 'otherValue', + unsupportedDate: '-0000', + otherProp: 'otherValueWithMoreThan10Characters', otherNumber: 0, + otherDecimalString: '0.07', + otherLongDecimalString: '1234567890', otherBoolean: true, otherUndefined: undefined, otherNull: null, @@ -35,8 +38,11 @@ describe('API client helpers', () => { date3: new Date('2024-02-04T20:22:00.123Z'), }, ], - otherProp: 'otherValue', + unsupportedDate: '-0000', + otherProp: 'otherValueWithMoreThan10Characters', otherNumber: 0, + otherDecimalString: '0.07', + otherLongDecimalString: '1234567890', otherBoolean: true, otherUndefined: undefined, otherNull: null, diff --git a/packages/sdk-core/package.json b/packages/sdk-core/package.json index 2527951f..fa748760 100644 --- a/packages/sdk-core/package.json +++ b/packages/sdk-core/package.json @@ -30,6 +30,7 @@ }, "dependencies": { "@sinch/conversation": "^0.0.2", + "@sinch/fax": "^0.0.2", "@sinch/numbers": "^0.0.2", "@sinch/sms": "^0.0.2", "@sinch/verification": "^0.0.2", diff --git a/packages/sdk-core/src/index.ts b/packages/sdk-core/src/index.ts index 3f6bd3a3..d40dd410 100644 --- a/packages/sdk-core/src/index.ts +++ b/packages/sdk-core/src/index.ts @@ -1,5 +1,6 @@ export * from './sinch-client'; export * from '@sinch/conversation'; +export * from '@sinch/fax'; export * from '@sinch/numbers'; export * from '@sinch/sms'; export * from '@sinch/verification'; diff --git a/packages/sdk-core/src/sinch-client.ts b/packages/sdk-core/src/sinch-client.ts index 97c23c5d..78aa50b2 100644 --- a/packages/sdk-core/src/sinch-client.ts +++ b/packages/sdk-core/src/sinch-client.ts @@ -1,4 +1,5 @@ import { ConversationService } from '@sinch/conversation'; +import { FaxService } from '@sinch/fax'; import { NumbersService } from '@sinch/numbers'; import { SmsService } from '@sinch/sms'; import { VerificationService } from '@sinch/verification'; @@ -9,6 +10,7 @@ import { SinchClientParameters } from '@sinch/sdk-client'; export class SinchClient { public readonly conversation: ConversationService; + public readonly fax: FaxService; public readonly numbers: NumbersService; public readonly sms: SmsService; public readonly verification: VerificationService; @@ -23,6 +25,9 @@ export class SinchClient { // Initialize the "Conversation" API this.conversation = new ConversationService(params); + // Initialize the "Fax" API + this.fax = new FaxService(params); + // Initialize the "Numbers" API this.numbers = new NumbersService(params); diff --git a/yarn.lock b/yarn.lock index 753d1769..59d4f424 100644 --- a/yarn.lock +++ b/yarn.lock @@ -63,7 +63,7 @@ resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.23.5.tgz" integrity sha512-uU27kfDRlhfKl+w1U6vp16IuvSLtjAxdArVXPa9BvLkrr7CYIsxH5adpHObeAGY/41+syctUWOZ140a2Rvkgjw== -"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.0.0-0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.11.6", "@babel/core@^7.12.0", "@babel/core@^7.12.3", "@babel/core@^7.13.0", "@babel/core@^7.23.3", "@babel/core@^7.4.0 || ^8.0.0-0 <8.0.0", "@babel/core@^7.8.0": +"@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.3": version "7.23.6" resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.6.tgz" integrity sha512-FxpRyGjrMJXh7X3wGLGhNDCRiwpWEF74sKjTLDJSG5Kyvow3QZaG0Adbqzi9ZrVjTWpsX+2cxWXD71NMg93kdw== @@ -1360,6 +1360,14 @@ resolved "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz" integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== +"@jridgewell/trace-mapping@0.3.9": + version "0.3.9" + resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" + integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== + dependencies: + "@jridgewell/resolve-uri" "^3.0.3" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9": version "0.3.20" resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz" @@ -1376,14 +1384,6 @@ "@jridgewell/resolve-uri" "^3.1.0" "@jridgewell/sourcemap-codec" "^1.4.14" -"@jridgewell/trace-mapping@0.3.9": - version "0.3.9" - resolved "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz" - integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" - "@lerna/child-process@7.4.2": version "7.4.2" resolved "https://registry.npmjs.org/@lerna/child-process/-/child-process-7.4.2.tgz" @@ -1504,28 +1504,28 @@ webpack "5.89.0" webpack-node-externals "3.0.0" -"@nestjs/common@^10.0.0", "@nestjs/common@^10.3.0": +"@nestjs/common@^10.3.0": version "10.3.0" resolved "https://registry.npmjs.org/@nestjs/common/-/common-10.3.0.tgz" integrity sha512-DGv34UHsZBxCM3H5QGE2XE/+oLJzz5+714JQjBhjD9VccFlQs3LRxo/epso4l7nJIiNlZkPyIUC8WzfU/5RTsQ== dependencies: + uid "2.0.2" iterare "1.2.1" tslib "2.6.2" - uid "2.0.2" -"@nestjs/core@^10.0.0", "@nestjs/core@^10.3.0": +"@nestjs/core@^10.3.0": version "10.3.0" resolved "https://registry.npmjs.org/@nestjs/core/-/core-10.3.0.tgz" integrity sha512-N06P5ncknW/Pm8bj964WvLIZn2gNhHliCBoAO1LeBvNImYkecqKcrmLbY49Fa1rmMfEM3MuBHeDys3edeuYAOA== dependencies: + uid "2.0.2" "@nuxtjs/opencollective" "0.3.2" fast-safe-stringify "2.1.1" iterare "1.2.1" path-to-regexp "3.2.0" tslib "2.6.2" - uid "2.0.2" -"@nestjs/platform-express@^10.0.0", "@nestjs/platform-express@^10.3.0": +"@nestjs/platform-express@^10.3.0": version "10.3.0" resolved "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.3.0.tgz" integrity sha512-E4hUW48bYv8OHbP9XQg6deefmXb0pDSSuE38SdhA0mJ37zGY7C5EqqBUdlQk4ttfD+OdnbIgJ1zOokT6dd2d7A== @@ -1555,7 +1555,7 @@ "@nodelib/fs.stat" "2.0.5" run-parallel "^1.1.9" -"@nodelib/fs.stat@^2.0.2", "@nodelib/fs.stat@2.0.5": +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": version "2.0.5" resolved "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz" integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== @@ -1625,7 +1625,7 @@ dependencies: which "^3.0.0" -"@npmcli/run-script@^6.0.0", "@npmcli/run-script@6.0.2": +"@npmcli/run-script@6.0.2", "@npmcli/run-script@^6.0.0": version "6.0.2" resolved "https://registry.npmjs.org/@npmcli/run-script/-/run-script-6.0.2.tgz" integrity sha512-NCcr1uQo1k5U+SYlnIrbAh3cxy+OQT1VtqiAbxdymSlptbzBb62AjH2xXgjNCoP073hoa1CfCAcwoZ8k96C4nA== @@ -1660,7 +1660,7 @@ consola "^2.15.0" node-fetch "^2.6.1" -"@nx/devkit@>=16.5.1 < 17", "@nx/devkit@16.10.0": +"@nx/devkit@16.10.0", "@nx/devkit@>=16.5.1 < 17": version "16.10.0" resolved "https://registry.npmjs.org/@nx/devkit/-/devkit-16.10.0.tgz" integrity sha512-IvKQqRJFDDiaj33SPfGd3ckNHhHi6ceEoqCbAP4UuMXOPPVOX6H0KVk+9tknkPb48B7jWIw6/AgOeWkBxPRO5w== @@ -1678,12 +1678,57 @@ resolved "https://registry.npmjs.org/@nx/nx-darwin-arm64/-/nx-darwin-arm64-16.10.0.tgz" integrity sha512-YF+MIpeuwFkyvM5OwgY/rTNRpgVAI/YiR0yTYCZR+X3AAvP775IVlusNgQ3oedTBRUzyRnI4Tknj1WniENFsvQ== +"@nx/nx-darwin-x64@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-darwin-x64/-/nx-darwin-x64-16.10.0.tgz#2ccf270418d552fd0a8e0d6089aee4944315adaa" + integrity sha512-ypi6YxwXgb0kg2ixKXE3pwf5myVNUgWf1CsV5OzVccCM8NzheMO51KDXTDmEpXdzUsfT0AkO1sk5GZeCjhVONg== + +"@nx/nx-freebsd-x64@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-freebsd-x64/-/nx-freebsd-x64-16.10.0.tgz#c3ee6914256e69493fed9355b0d6661d0e86da44" + integrity sha512-UeEYFDmdbbDkTQamqvtU8ibgu5jQLgFF1ruNb/U4Ywvwutw2d4ruOMl2e0u9hiNja9NFFAnDbvzrDcMo7jYqYw== + +"@nx/nx-linux-arm-gnueabihf@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm-gnueabihf/-/nx-linux-arm-gnueabihf-16.10.0.tgz#a961eccbb38acb2da7fc125b29d1fead0b39152f" + integrity sha512-WV3XUC2DB6/+bz1sx+d1Ai9q2Cdr+kTZRN50SOkfmZUQyEBaF6DRYpx/a4ahhxH3ktpNfyY8Maa9OEYxGCBkQA== + +"@nx/nx-linux-arm64-gnu@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-gnu/-/nx-linux-arm64-gnu-16.10.0.tgz#795f20072549d03822b5c4639ef438e473dbb541" + integrity sha512-aWIkOUw995V3ItfpAi5FuxQ+1e9EWLS1cjWM1jmeuo+5WtaKToJn5itgQOkvSlPz+HSLgM3VfXMvOFALNk125g== + +"@nx/nx-linux-arm64-musl@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-arm64-musl/-/nx-linux-arm64-musl-16.10.0.tgz#f2428ee6dbe2b2c326e8973f76c97666def33607" + integrity sha512-uO6Gg+irqpVcCKMcEPIQcTFZ+tDI02AZkqkP7koQAjniLEappd8DnUBSQdcn53T086pHpdc264X/ZEpXFfrKWQ== + +"@nx/nx-linux-x64-gnu@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-gnu/-/nx-linux-x64-gnu-16.10.0.tgz#d36c2bcf94d49eaa24e3880ddaf6f1f617de539b" + integrity sha512-134PW/u/arNFAQKpqMJniC7irbChMPz+W+qtyKPAUXE0XFKPa7c1GtlI/wK2dvP9qJDZ6bKf0KtA0U/m2HMUOA== + +"@nx/nx-linux-x64-musl@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-linux-x64-musl/-/nx-linux-x64-musl-16.10.0.tgz#78bd2ab97a583b3d4ea3387b67fd7b136907493c" + integrity sha512-q8sINYLdIJxK/iUx9vRk5jWAWb/2O0PAbOJFwv4qkxBv4rLoN7y+otgCZ5v0xfx/zztFgk/oNY4lg5xYjIso2Q== + +"@nx/nx-win32-arm64-msvc@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-win32-arm64-msvc/-/nx-win32-arm64-msvc-16.10.0.tgz#ef20ec8d0c83d66e73e20df12d2c788b8f866396" + integrity sha512-moJkL9kcqxUdJSRpG7dET3UeLIciwrfP08mzBQ12ewo8K8FzxU8ZUsTIVVdNrwt01CXOdXoweGfdQLjJ4qTURA== + +"@nx/nx-win32-x64-msvc@16.10.0": + version "16.10.0" + resolved "https://registry.yarnpkg.com/@nx/nx-win32-x64-msvc/-/nx-win32-x64-msvc-16.10.0.tgz#7410a51d0f8be631eec9552f01b2e5946285927c" + integrity sha512-5iV2NKZnzxJwZZ4DM5JVbRG/nkhAbzEskKaLBB82PmYGKzaDHuMHP1lcPoD/rtYMlowZgNA/RQndfKvPBPwmXA== + "@octokit/auth-token@^3.0.0": version "3.0.4" resolved "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-3.0.4.tgz" integrity sha512-TWFX7cZF2LXoCvdmJWY7XVPi74aSY0+FfBZNSXEXFkMpjcqsQwDSYVv5FhRFaI0V1ECnwbz4j59T/G+rXNWaIQ== -"@octokit/core@^4.2.1", "@octokit/core@>=3", "@octokit/core@>=4": +"@octokit/core@^4.2.1": version "4.2.4" resolved "https://registry.npmjs.org/@octokit/core/-/core-4.2.4.tgz" integrity sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ== @@ -1853,82 +1898,6 @@ "@sigstore/protobuf-specs" "^0.2.0" tuf-js "^1.1.7" -"@sinch/conversation@^0.0.1", "@sinch/conversation@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/conversation": - version "0.0.1" - resolved "file:packages/conversation" - dependencies: - "@sinch/sdk-client" "^0.0.1" - -"@sinch/integrated-flows-examples@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/examples/integrated-flows-examples": - version "0.0.0" - resolved "file:examples/integrated-flows-examples" - dependencies: - "@sinch/sdk-core" "^0.0.1" - "@types/node" "^20.8.7" - dotenv "^16.3.1" - inquirer "^9.2.14" - typescript "^5.2.2" - -"@sinch/numbers@^0.0.1", "@sinch/numbers@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/numbers": - version "0.0.1" - resolved "file:packages/numbers" - dependencies: - "@sinch/sdk-client" "^0.0.1" - -"@sinch/sdk-client@^0.0.1", "@sinch/sdk-client@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/sdk-client": - version "0.0.1" - resolved "file:packages/sdk-client" - dependencies: - node-fetch "2.7.0" - -"@sinch/sdk-core@^0.0.1", "@sinch/sdk-core@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/sdk-core": - version "0.0.1" - resolved "file:packages/sdk-core" - dependencies: - "@sinch/conversation" "^0.0.1" - "@sinch/numbers" "^0.0.1" - "@sinch/sms" "^0.0.1" - "@sinch/verification" "^0.0.1" - "@sinch/voice" "^0.0.1" - -"@sinch/simple-examples@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/examples/simple-examples": - version "0.0.0" - resolved "file:examples/simple-examples" - dependencies: - "@sinch/sdk-core" "^0.0.1" - dotenv "^16.3.1" - -"@sinch/sms@^0.0.1", "@sinch/sms@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/sms": - version "0.0.1" - resolved "file:packages/sms" - dependencies: - "@sinch/sdk-client" "^0.0.1" - -"@sinch/verification@^0.0.1", "@sinch/verification@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/verification": - version "0.0.1" - resolved "file:packages/verification" - dependencies: - "@sinch/sdk-client" "^0.0.1" - -"@sinch/voice@^0.0.1", "@sinch/voice@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/packages/voice": - version "0.0.1" - resolved "file:packages/voice" - dependencies: - "@sinch/sdk-client" "^0.0.1" - -"@sinch/webhooks-examples@file:/Users/antoinesein/sinch/code/temp3/sinch-sdk-node/examples/webhooks": - version "0.0.0" - resolved "file:examples/webhooks" - dependencies: - "@nestjs/common" "^10.3.0" - "@nestjs/core" "^10.3.0" - "@nestjs/platform-express" "^10.3.0" - "@sinch/sdk-core" "^0.0.1" - dotenv "^16.3.1" - raw-body "^2.5.2" - reflect-metadata "^0.1.13" - rxjs "^7.8.1" - "@sinclair/typebox@^0.27.8": version "0.27.8" resolved "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz" @@ -2042,7 +2011,7 @@ "@types/eslint" "*" "@types/estree" "*" -"@types/eslint@*", "@types/eslint@>=8.0.0": +"@types/eslint@*": version "8.56.2" resolved "https://registry.npmjs.org/@types/eslint/-/eslint-8.56.2.tgz" integrity sha512-uQDwm1wFHmbBbCZCqAlq6Do9LYwByNZHWzXppSnay9SuwJ+VRbjkbLABer54kcPnMSlG6Fdiy2yaFXm/z9Z5gw== @@ -2065,7 +2034,7 @@ "@types/range-parser" "*" "@types/send" "*" -"@types/express@^4.17.17": +"@types/express@*", "@types/express@^4.17.17": version "4.17.21" resolved "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz" integrity sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ== @@ -2147,6 +2116,13 @@ resolved "https://registry.npmjs.org/@types/minimist/-/minimist-1.2.5.tgz" integrity sha512-hov8bUuiLiyFPGyFPE1lwWhmzYbirOXQNNo40+y3zow8aFVTeyn3VWL0VFFfdNddA8S4Vf0Tc062rzyNr7Paag== +"@types/multer@^1.4.11": + version "1.4.11" + resolved "https://registry.yarnpkg.com/@types/multer/-/multer-1.4.11.tgz#c70792670513b4af1159a2b60bf48cc932af55c5" + integrity sha512-svK240gr6LVWvv3YGyhLlA+6LRRWA4mnGIU7RcNmgjBYFl6665wcXrRfxGp5tEPVHUNm5FMcmq7too9bxCwX/w== + dependencies: + "@types/express" "*" + "@types/node-fetch@^2.6.6": version "2.6.9" resolved "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.9.tgz" @@ -2223,23 +2199,6 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.0.0 || ^6.0.0", "@typescript-eslint/eslint-plugin@^6.9.0": - version "6.15.0" - resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.15.0.tgz" - integrity sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg== - dependencies: - "@eslint-community/regexpp" "^4.5.1" - "@typescript-eslint/scope-manager" "6.15.0" - "@typescript-eslint/type-utils" "6.15.0" - "@typescript-eslint/utils" "6.15.0" - "@typescript-eslint/visitor-keys" "6.15.0" - debug "^4.3.4" - graphemer "^1.4.0" - ignore "^5.2.4" - natural-compare "^1.4.0" - semver "^7.5.4" - ts-api-utils "^1.0.1" - "@typescript-eslint/eslint-plugin@^6.0.0": version "6.21.0" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.21.0.tgz" @@ -2257,16 +2216,22 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/parser@^6.0.0 || ^6.0.0-alpha", "@typescript-eslint/parser@^6.9.0": +"@typescript-eslint/eslint-plugin@^6.9.0": version "6.15.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.15.0.tgz" - integrity sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA== + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.15.0.tgz" + integrity sha512-j5qoikQqPccq9QoBAupOP+CBu8BaJ8BLjaXSioDISeTZkVO3ig7oSIKh3H+rEpee7xCXtWwSB4KIL5l6hWZzpg== dependencies: + "@eslint-community/regexpp" "^4.5.1" "@typescript-eslint/scope-manager" "6.15.0" - "@typescript-eslint/types" "6.15.0" - "@typescript-eslint/typescript-estree" "6.15.0" + "@typescript-eslint/type-utils" "6.15.0" + "@typescript-eslint/utils" "6.15.0" "@typescript-eslint/visitor-keys" "6.15.0" debug "^4.3.4" + graphemer "^1.4.0" + ignore "^5.2.4" + natural-compare "^1.4.0" + semver "^7.5.4" + ts-api-utils "^1.0.1" "@typescript-eslint/parser@^6.0.0": version "6.21.0" @@ -2279,6 +2244,17 @@ "@typescript-eslint/visitor-keys" "6.21.0" debug "^4.3.4" +"@typescript-eslint/parser@^6.9.0": + version "6.15.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.15.0.tgz" + integrity sha512-MkgKNnsjC6QwcMdlNAel24jjkEO/0hQaMDLqP4S9zq5HBAUJNQB6y+3DwLjX7b3l2b37eNAxMPLwb3/kh8VKdA== + dependencies: + "@typescript-eslint/scope-manager" "6.15.0" + "@typescript-eslint/types" "6.15.0" + "@typescript-eslint/typescript-estree" "6.15.0" + "@typescript-eslint/visitor-keys" "6.15.0" + debug "^4.3.4" + "@typescript-eslint/scope-manager@5.62.0": version "5.62.0" resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.62.0.tgz" @@ -2378,21 +2354,7 @@ semver "^7.5.4" ts-api-utils "^1.0.1" -"@typescript-eslint/utils@^5.10.0": - version "5.62.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz" - integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== - dependencies: - "@eslint-community/eslint-utils" "^4.2.0" - "@types/json-schema" "^7.0.9" - "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.62.0" - "@typescript-eslint/types" "5.62.0" - "@typescript-eslint/typescript-estree" "5.62.0" - eslint-scope "^5.1.1" - semver "^7.3.7" - -"@typescript-eslint/utils@^6.0.0", "@typescript-eslint/utils@6.15.0": +"@typescript-eslint/utils@6.15.0", "@typescript-eslint/utils@^6.0.0": version "6.15.0" resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.15.0.tgz" integrity sha512-eF82p0Wrrlt8fQSRL0bGXzK5nWPRV2dYQZdajcfzOD9+cQz9O7ugifrJxclB+xVOvWvagXfqS4Es7vpLP4augw== @@ -2418,6 +2380,20 @@ "@typescript-eslint/typescript-estree" "6.21.0" semver "^7.5.4" +"@typescript-eslint/utils@^5.10.0": + version "5.62.0" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.62.0.tgz" + integrity sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.62.0" + "@typescript-eslint/types" "5.62.0" + "@typescript-eslint/typescript-estree" "5.62.0" + eslint-scope "^5.1.1" + semver "^7.3.7" + "@typescript-eslint/visitor-keys@5.62.0": version "5.62.0" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.62.0.tgz" @@ -2447,7 +2423,7 @@ resolved "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@webassemblyjs/ast@^1.11.5", "@webassemblyjs/ast@1.11.6": +"@webassemblyjs/ast@1.11.6", "@webassemblyjs/ast@^1.11.5": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz" integrity sha512-IN1xI7PwOvLPgjcf180gC1bqn3q/QaOCwYUahIOhbYUu8KA/3tw2RT/T0Gidi1l7Hhj5D/INhJxiICObqpMu4Q== @@ -2548,7 +2524,7 @@ "@webassemblyjs/wasm-gen" "1.11.6" "@webassemblyjs/wasm-parser" "1.11.6" -"@webassemblyjs/wasm-parser@^1.11.5", "@webassemblyjs/wasm-parser@1.11.6": +"@webassemblyjs/wasm-parser@1.11.6", "@webassemblyjs/wasm-parser@^1.11.5": version "1.11.6" resolved "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.6.tgz" integrity sha512-6ZwPeGzMJM3Dqp3hCsLgESxBGtT/OeCvCZ4TA1JUPYgmhAx38tTPR9JaKy0S5H3evQpO/h2uWs2j6Yc/fjkpTQ== @@ -2598,6 +2574,14 @@ dependencies: argparse "^2.0.1" +JSONStream@^1.3.5: + version "1.3.5" + resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" + integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== + dependencies: + jsonparse "^1.2.0" + through ">=2.2.7 <3" + abbrev@^1.0.0: version "1.1.1" resolved "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz" @@ -2626,17 +2610,12 @@ acorn-walk@^8.1.1: resolved "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.1.tgz" integrity sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw== -"acorn@^6.0.0 || ^7.0.0 || ^8.0.0", acorn@^8.4.1, acorn@^8.9.0: +acorn@^8.4.1, acorn@^8.9.0: version "8.11.2" resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.2.tgz" integrity sha512-nc0Axzp/0FILLEVsm4fNwLCwMttvhEI263QtVPQcbpfZZ3ts0hLsZGOpE6czNlid7CJ9MlyH8reXkpsf3YUY4w== -acorn@^8, acorn@^8.7.1: - version "8.11.3" - resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" - integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== - -acorn@^8.8.2: +acorn@^8.7.1, acorn@^8.8.2: version "8.11.3" resolved "https://registry.npmjs.org/acorn/-/acorn-8.11.3.tgz" integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg== @@ -2646,7 +2625,7 @@ add-stream@^1.0.0: resolved "https://registry.npmjs.org/add-stream/-/add-stream-1.0.0.tgz" integrity sha512-qQLMr+8o0WC4FZGQTcJiKBVC59JylcPSrTtk6usvmIDFUOCKegapy1VHQwRbFMOFyb/inzUVqHs+eMYKDM1YeQ== -agent-base@^6.0.2, agent-base@6: +agent-base@6, agent-base@^6.0.2: version "6.0.2" resolved "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz" integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== @@ -2680,17 +2659,7 @@ ajv-keywords@^3.5.2: resolved "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz" integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== -ajv@^6.12.4, ajv@^6.12.5, ajv@^6.9.1: - version "6.12.6" - resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" - integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== - dependencies: - fast-deep-equal "^3.1.1" - fast-json-stable-stringify "^2.0.0" - json-schema-traverse "^0.4.1" - uri-js "^4.2.2" - -ajv@^8.0.0, ajv@8.12.0: +ajv@8.12.0, ajv@^8.0.0: version "8.12.0" resolved "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz" integrity sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA== @@ -2700,7 +2669,17 @@ ajv@^8.0.0, ajv@8.12.0: require-from-string "^2.0.2" uri-js "^4.2.2" -ansi-colors@^4.1.1, ansi-colors@4.1.3: +ajv@^6.12.4, ajv@^6.12.5: + version "6.12.6" + resolved "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-colors@4.1.3, ansi-colors@^4.1.1: version "4.1.3" resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz" integrity sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw== @@ -3026,7 +3005,7 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.14.5, browserslist@^4.22.2, "browserslist@>= 4.21.0": +browserslist@^4.14.5, browserslist@^4.22.2: version "4.22.2" resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.22.2.tgz" integrity sha512-0UgcrvQmBDvZHFGdYUehrCNIazki7/lUP3kkoi/r3YB2amZbFM9J43ZRkJTXBUZK4gmx56+Sqk9+Vs9mwZx9+A== @@ -3172,16 +3151,15 @@ caniuse-lite@^1.0.30001565: resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001570.tgz" integrity sha512-+3e0ASu4sw1SWaoCtvPeyXp+5PsjigkSt8OXZbF9StH5pQWbxEjLAZE3n8Aup5udop1uRiKA7a4utUk/uoSpUw== -chalk@^2.4.2: - version "2.4.2" - resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" - integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== +chalk@4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz" + integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== dependencies: - ansi-styles "^3.2.1" - escape-string-regexp "^1.0.5" - supports-color "^5.3.0" + ansi-styles "^4.1.0" + supports-color "^7.1.0" -chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2, chalk@4.1.2: +chalk@4.1.2, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -3189,19 +3167,20 @@ chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2, chalk@4.1. ansi-styles "^4.1.0" supports-color "^7.1.0" +chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + chalk@^5.3.0: version "5.3.0" resolved "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz" integrity sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w== -chalk@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz" - integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - char-regex@^1.0.2: version "1.0.2" resolved "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz" @@ -3212,7 +3191,7 @@ chardet@^0.7.0: resolved "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -chokidar@^3.5.2, chokidar@^3.5.3, chokidar@3.5.3: +chokidar@3.5.3, chokidar@^3.5.3: version "3.5.3" resolved "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz" integrity sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw== @@ -3252,23 +3231,23 @@ clean-stack@^2.0.0: resolved "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-cursor@^3.1.0, cli-cursor@3.1.0: +cli-cursor@3.1.0, cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz" integrity sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw== dependencies: restore-cursor "^3.1.0" -cli-spinners@^2.5.0: - version "2.9.2" - resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz" - integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== - cli-spinners@2.6.1: version "2.6.1" resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz" integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== +cli-spinners@^2.5.0: + version "2.9.2" + resolved "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.9.2.tgz" + integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== + cli-table3@0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.3.tgz" @@ -3349,16 +3328,16 @@ color-convert@^2.0.1: dependencies: color-name "~1.1.4" -color-name@~1.1.4: - version "1.1.4" - resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" - integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== - color-name@1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + color-support@^1.1.3: version "1.1.3" resolved "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz" @@ -3379,16 +3358,16 @@ combined-stream@^1.0.8: dependencies: delayed-stream "~1.0.0" -commander@^2.20.0: - version "2.20.3" - resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" - integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== - commander@4.1.1: version "4.1.1" resolved "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz" integrity sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA== +commander@^2.20.0: + version "2.20.3" + resolved "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz" + integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== + comment-json@4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/comment-json/-/comment-json-4.2.3.tgz" @@ -3510,8 +3489,8 @@ conventional-commits-parser@^4.0.0: resolved "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-4.0.0.tgz" integrity sha512-WRv5j1FsVM5FISJkoYMR6tPk07fkKT0UodruX4je86V4owk451yjXAKzKAPOs9l7y59E2viHUS9eQ+dfUA9NSg== dependencies: - is-text-path "^1.0.1" JSONStream "^1.3.5" + is-text-path "^1.0.1" meow "^8.1.2" split2 "^3.2.2" @@ -3610,13 +3589,6 @@ dateformat@^3.0.3: resolved "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -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: - version "4.3.4" - resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" - integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== - dependencies: - ms "2.1.2" - debug@2.6.9: version "2.6.9" resolved "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz" @@ -3624,6 +3596,13 @@ debug@2.6.9: dependencies: ms "2.0.0" +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: + version "4.3.4" + resolved "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + decamelize-keys@^1.1.0: version "1.1.1" resolved "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.1.tgz" @@ -3637,16 +3616,16 @@ decamelize@^1.1.0: resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== -dedent@^1.0.0: - version "1.5.1" - resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz" - integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== - dedent@0.7.0: version "0.7.0" resolved "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== +dedent@^1.0.0: + version "1.5.1" + resolved "https://registry.npmjs.org/dedent/-/dedent-1.5.1.tgz" + integrity sha512-+LxW+KLWxu3HW3M2w2ympwtqPrqYRzU8fqi6Fhd18fBALe15blJPI/I4+UHveMVG6lJqB4JNd4UG0S5cnVHwIg== + deep-is@^0.1.3: version "0.1.4" resolved "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz" @@ -3824,7 +3803,7 @@ encodeurl@~1.0.2: resolved "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz" integrity sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w== -encoding@^0.1.0, encoding@^0.1.13: +encoding@^0.1.13: version "0.1.13" resolved "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -3915,7 +3894,7 @@ eslint-config-google@^0.14.0: resolved "https://registry.npmjs.org/eslint-config-google/-/eslint-config-google-0.14.0.tgz" integrity sha512-WsbX4WbjuMvTdeVL6+J3rK1RGhCTqjsFjX7UMSMgZiyxxaNLkoJENbrGExzERFeoTpGw3F3FypTiWAP9ZXzkEw== -eslint-config-prettier@*, eslint-config-prettier@^9.0.0: +eslint-config-prettier@^9.0.0: version "9.1.0" resolved "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz" integrity sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw== @@ -3964,7 +3943,7 @@ eslint-plugin-prettier@^5.0.1: prettier-linter-helpers "^1.0.0" synckit "^0.8.5" -eslint-scope@^5.1.1, eslint-scope@5.1.1: +eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" resolved "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz" integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== @@ -3985,7 +3964,7 @@ eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1, eslint-visitor-keys@^3.4 resolved "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz" integrity sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag== -"eslint@^6.0.0 || ^7.0.0 || ^8.0.0", "eslint@^6.0.0 || ^7.0.0 || >=8.0.0", "eslint@^7.0.0 || ^8.0.0", eslint@>=0.8.0, eslint@>=5.16.0, eslint@>=7.0.0, eslint@>=8.0.0, eslint@8.52.0: +eslint@8.52.0: version "8.52.0" resolved "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz" integrity sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg== @@ -4131,12 +4110,27 @@ events@^3.2.0: resolved "https://registry.npmjs.org/events/-/events-3.3.0.tgz" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -execa@^5.0.0: - version "5.1.1" - resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" - integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== - dependencies: - cross-spawn "^7.0.3" +execa@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz" + integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== + dependencies: + cross-spawn "^7.0.3" + get-stream "^6.0.0" + human-signals "^2.1.0" + is-stream "^2.0.0" + merge-stream "^2.0.0" + npm-run-path "^4.0.1" + onetime "^5.1.2" + signal-exit "^3.0.3" + strip-final-newline "^2.0.0" + +execa@^5.0.0: + version "5.1.1" + resolved "https://registry.npmjs.org/execa/-/execa-5.1.1.tgz" + integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== + dependencies: + cross-spawn "^7.0.3" get-stream "^6.0.0" human-signals "^2.1.0" is-stream "^2.0.0" @@ -4161,21 +4155,6 @@ execa@^7.1.1: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -execa@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/execa/-/execa-5.0.0.tgz" - integrity sha512-ov6w/2LCiuyO4RLYGdpFGjkcs0wMTgGE8PrkTHikeUy5iJekXyPIKUjifk5CsE0pt7sMCrMZ3YNqoCj6idQOnQ== - dependencies: - cross-spawn "^7.0.3" - get-stream "^6.0.0" - human-signals "^2.1.0" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.1" - onetime "^5.1.2" - signal-exit "^3.0.3" - strip-final-newline "^2.0.0" - exit@^0.1.2: version "0.1.2" resolved "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz" @@ -4293,7 +4272,7 @@ fb-watchman@^2.0.0: dependencies: bser "2.1.1" -figures@^3.0.0, figures@^3.2.0, figures@3.2.0: +figures@3.2.0, figures@^3.0.0, figures@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -4545,16 +4524,16 @@ get-port@5.1.1: resolved "https://registry.npmjs.org/get-port/-/get-port-5.1.1.tgz" integrity sha512-g/Q1aTSDOxFpchXC4i8ZWvxA1lnPqx/JHqcpIw0/LX9T8x/GBbi6YnlN5nhaKIFkT8oFsscUKgDJYxfwfS6QsQ== -get-stream@^6.0.0, get-stream@^6.0.1: - version "6.0.1" - resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" - integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== - get-stream@6.0.0: version "6.0.0" resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.0.tgz" integrity sha512-A1B3Bh1UmL0bidM/YX2NsCOTnGJePL9rO/M+Mw3m9f2gUpfokS0hi5Eah0WSUEWZdZhIZtMjkIYS7mDfOqNHbg== +get-stream@^6.0.0, get-stream@^6.0.1: + version "6.0.1" + resolved "https://registry.npmjs.org/get-stream/-/get-stream-6.0.1.tgz" + integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== + git-raw-commits@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-3.0.0.tgz" @@ -4602,7 +4581,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -glob-parent@^5.1.2, glob-parent@~5.1.2, glob-parent@5.1.2: +glob-parent@5.1.2, glob-parent@^5.1.2, glob-parent@~5.1.2: version "5.1.2" resolved "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz" integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== @@ -4621,7 +4600,7 @@ glob-to-regexp@^0.4.1: resolved "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@^10.2.2: +glob@10.3.10, glob@^10.2.2, glob@^10.3.7: version "10.3.10" resolved "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz" integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== @@ -4632,16 +4611,17 @@ glob@^10.2.2: minipass "^5.0.0 || ^6.0.2 || ^7.0.0" path-scurry "^1.10.1" -glob@^10.3.7: - version "10.3.10" - resolved "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz" - integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== +glob@7.1.4: + version "7.1.4" + resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz" + integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== dependencies: - foreground-child "^3.1.0" - jackspeak "^2.3.5" - minimatch "^9.0.1" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - path-scurry "^1.10.1" + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" glob@^7.0.0, glob@^7.1.3, glob@^7.1.4: version "7.2.3" @@ -4676,29 +4656,6 @@ glob@^9.2.0: minipass "^4.2.4" path-scurry "^1.6.1" -glob@10.3.10: - version "10.3.10" - resolved "https://registry.npmjs.org/glob/-/glob-10.3.10.tgz" - integrity sha512-fa46+tv1Ak0UPK1TOy/pZrIybNNt4HCv7SDzwyfiOZkvZLEbjsZkJBPtDHVshZjbecAoAGSC20MjLDG/qr679g== - dependencies: - foreground-child "^3.1.0" - jackspeak "^2.3.5" - minimatch "^9.0.1" - minipass "^5.0.0 || ^6.0.2 || ^7.0.0" - path-scurry "^1.10.1" - -glob@7.1.4: - version "7.1.4" - resolved "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz" - integrity sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A== - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - globals@^11.1.0: version "11.12.0" resolved "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz" @@ -4711,7 +4668,7 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" -globby@^11.1.0, globby@11.1.0: +globby@11.1.0, globby@^11.1.0: version "11.1.0" resolved "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz" integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== @@ -4730,7 +4687,7 @@ gopd@^1.0.1: dependencies: get-intrinsic "^1.1.3" -graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9, graceful-fs@4.2.11: +graceful-fs@4.2.11, graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.4, graceful-fs@^4.2.6, graceful-fs@^4.2.9: version "4.2.11" resolved "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz" integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== @@ -4789,7 +4746,7 @@ has-symbols@^1.0.3: resolved "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz" integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== -has-unicode@^2.0.1, has-unicode@2.0.1: +has-unicode@2.0.1, has-unicode@^2.0.1: version "2.0.1" resolved "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== @@ -4882,7 +4839,7 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -iconv-lite@^0.4.24, iconv-lite@0.4.24: +iconv-lite@0.4.24, iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== @@ -4928,7 +4885,7 @@ import-fresh@^3.2.1, import-fresh@^3.3.0: parent-module "^1.0.0" resolve-from "^4.0.0" -import-local@^3.0.2, import-local@3.1.0: +import-local@3.1.0, import-local@^3.0.2: version "3.1.0" resolved "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz" integrity sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg== @@ -4959,7 +4916,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3, inherits@2, inherits@2.0.4: +inherits@2, inherits@2.0.4, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3: version "2.0.4" resolved "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -4982,7 +4939,7 @@ init-package-json@5.0.0: validate-npm-package-license "^3.0.4" validate-npm-package-name "^5.0.0" -inquirer@^8.2.4, inquirer@8.2.6: +inquirer@8.2.6, inquirer@^8.2.4: version "8.2.6" resolved "https://registry.npmjs.org/inquirer/-/inquirer-8.2.6.tgz" integrity sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg== @@ -5003,18 +4960,18 @@ inquirer@^8.2.4, inquirer@8.2.6: through "^2.3.6" wrap-ansi "^6.0.1" -inquirer@^9.2.14: - version "9.2.14" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-9.2.14.tgz" - integrity sha512-4ByIMt677Iz5AvjyKrDpzaepIyMewNvDcvwpVVRZNmy9dLakVoVgdCHZXbK1SlVJra1db0JZ6XkJyHsanpdrdQ== +inquirer@9.2.11: + version "9.2.11" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-9.2.11.tgz" + integrity sha512-B2LafrnnhbRzCWfAdOXisUzL89Kg8cVJlYmhqoi3flSiV/TveO+nsXwgKr9h9PIo+J1hz7nBSk6gegRIMBBf7g== dependencies: - "@ljharb/through" "^2.3.12" + "@ljharb/through" "^2.3.9" ansi-escapes "^4.3.2" chalk "^5.3.0" cli-cursor "^3.1.0" cli-width "^4.1.0" external-editor "^3.1.0" - figures "^3.2.0" + figures "^5.0.0" lodash "^4.17.21" mute-stream "1.0.0" ora "^5.4.1" @@ -5024,18 +4981,18 @@ inquirer@^9.2.14: strip-ansi "^6.0.1" wrap-ansi "^6.2.0" -inquirer@9.2.11: - version "9.2.11" - resolved "https://registry.npmjs.org/inquirer/-/inquirer-9.2.11.tgz" - integrity sha512-B2LafrnnhbRzCWfAdOXisUzL89Kg8cVJlYmhqoi3flSiV/TveO+nsXwgKr9h9PIo+J1hz7nBSk6gegRIMBBf7g== +inquirer@^9.2.14: + version "9.2.14" + resolved "https://registry.npmjs.org/inquirer/-/inquirer-9.2.14.tgz" + integrity sha512-4ByIMt677Iz5AvjyKrDpzaepIyMewNvDcvwpVVRZNmy9dLakVoVgdCHZXbK1SlVJra1db0JZ6XkJyHsanpdrdQ== dependencies: - "@ljharb/through" "^2.3.9" + "@ljharb/through" "^2.3.12" ansi-escapes "^4.3.2" chalk "^5.3.0" cli-cursor "^3.1.0" cli-width "^4.1.0" external-editor "^3.1.0" - figures "^5.0.0" + figures "^3.2.0" lodash "^4.17.21" mute-stream "1.0.0" ora "^5.4.1" @@ -5174,6 +5131,11 @@ is-ssh@^1.4.0: dependencies: protocols "^2.0.1" +is-stream@2.0.0: + version "2.0.0" + resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz" + integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== + is-stream@^2.0.0: version "2.0.1" resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz" @@ -5184,11 +5146,6 @@ is-stream@^3.0.0: resolved "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz" integrity sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA== -is-stream@2.0.0: - version "2.0.0" - resolved "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz" - integrity sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw== - is-text-path@^1.0.1: version "1.0.1" resolved "https://registry.npmjs.org/is-text-path/-/is-text-path-1.0.1.tgz" @@ -5385,7 +5342,7 @@ jest-config@^29.7.0: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@^29.4.1, jest-diff@^29.7.0, "jest-diff@>=29.4.3 < 30": +"jest-diff@>=29.4.3 < 30", jest-diff@^29.4.1, jest-diff@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-diff/-/jest-diff-29.7.0.tgz" integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== @@ -5509,7 +5466,7 @@ jest-resolve-dependencies@^29.7.0: jest-regex-util "^29.6.3" jest-snapshot "^29.7.0" -jest-resolve@*, jest-resolve@^29.7.0: +jest-resolve@^29.7.0: version "29.7.0" resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz" integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA== @@ -5662,7 +5619,7 @@ jest-worker@^29.7.0: merge-stream "^2.0.0" supports-color "^8.0.0" -jest@*, jest@^29.5.0: +jest@^29.5.0: version "29.7.0" resolved "https://registry.npmjs.org/jest/-/jest-29.7.0.tgz" integrity sha512-NIy3oAFp9shda19hy4HK0HRTWKtPJmGdnvywu01nOqNC2vZg+Z+fvJDxpMQA88eb2I9EcafcdjYgsDthnYTvGw== @@ -5677,15 +5634,14 @@ js-tokens@^4.0.0: resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.10.0: - version "3.14.1" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== +js-yaml@4.1.0, js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: - argparse "^1.0.7" - esprima "^4.0.0" + argparse "^2.0.1" -js-yaml@^3.13.1: +js-yaml@^3.10.0, js-yaml@^3.13.1: version "3.14.1" resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz" integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== @@ -5693,13 +5649,6 @@ js-yaml@^3.13.1: argparse "^1.0.7" esprima "^4.0.0" -js-yaml@^4.1.0, js-yaml@4.1.0: - version "4.1.0" - resolved "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz" - integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== - dependencies: - argparse "^2.0.1" - jsesc@^2.5.1: version "2.5.2" resolved "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz" @@ -5774,14 +5723,6 @@ jsonparse@^1.2.0, jsonparse@^1.3.1: resolved "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz" integrity sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg== -JSONStream@^1.3.5: - version "1.3.5" - resolved "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz" - integrity sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ== - dependencies: - jsonparse "^1.2.0" - through ">=2.2.7 <3" - keyv@^4.5.3: version "4.5.4" resolved "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz" @@ -5925,16 +5866,6 @@ lines-and-columns@~2.0.3: resolved "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz" integrity sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A== -load-json-file@^4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz" - integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== - dependencies: - graceful-fs "^4.1.2" - parse-json "^4.0.0" - pify "^3.0.0" - strip-bom "^3.0.0" - load-json-file@6.2.0: version "6.2.0" resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-6.2.0.tgz" @@ -5945,6 +5876,16 @@ load-json-file@6.2.0: strip-bom "^4.0.0" type-fest "^0.6.0" +load-json-file@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz" + integrity sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw== + dependencies: + graceful-fs "^4.1.2" + parse-json "^4.0.0" + pify "^3.0.0" + strip-bom "^3.0.0" + loader-runner@^4.2.0: version "4.3.0" resolved "https://registry.npmjs.org/loader-runner/-/loader-runner-4.3.0.tgz" @@ -6031,6 +5972,13 @@ magic-string@0.30.5: dependencies: "@jridgewell/sourcemap-codec" "^1.4.15" +make-dir@4.0.0, make-dir@^4.0.0: + version "4.0.0" + resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" + integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== + dependencies: + semver "^7.5.3" + make-dir@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz" @@ -6039,13 +5987,6 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" -make-dir@^4.0.0, make-dir@4.0.0: - version "4.0.0" - resolved "https://registry.npmjs.org/make-dir/-/make-dir-4.0.0.tgz" - integrity sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw== - dependencies: - semver "^7.5.3" - make-error@^1.1.1: version "1.3.6" resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz" @@ -6200,6 +6141,20 @@ min-indent@^1.0.0: resolved "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz" integrity sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg== +minimatch@3.0.5: + version "3.0.5" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz" + integrity sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@9.0.3, minimatch@^9.0.0, minimatch@^9.0.1: + version "9.0.3" + resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz" + integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== + dependencies: + brace-expansion "^2.0.1" + minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz" @@ -6221,34 +6176,6 @@ minimatch@^8.0.2: dependencies: brace-expansion "^2.0.1" -minimatch@^9.0.0: - version "9.0.3" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -minimatch@^9.0.1: - version "9.0.3" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - -minimatch@3.0.5: - version "3.0.5" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz" - integrity sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw== - dependencies: - brace-expansion "^1.1.7" - -minimatch@9.0.3: - version "9.0.3" - resolved "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz" - integrity sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg== - dependencies: - brace-expansion "^2.0.1" - minimist-options@4.1.0: version "4.1.0" resolved "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz" @@ -6333,17 +6260,12 @@ minipass@^4.2.4: resolved "https://registry.npmjs.org/minipass/-/minipass-4.2.8.tgz" integrity sha512-fNzuVyifolSLFL4NzpF+wEF4qrgqaaKX0haXPQEdQ7NKAN+WecoKMHV09YcuL/DHxrUsYQOK3MiuDf7Ip2OXfQ== -"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.3: - version "7.0.4" - resolved "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz" - integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== - minipass@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz" integrity sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ== -minipass@^7.0.3: +"minipass@^5.0.0 || ^6.0.2 || ^7.0.0", minipass@^7.0.3: version "7.0.4" resolved "https://registry.npmjs.org/minipass/-/minipass-7.0.4.tgz" integrity sha512-jYofLM5Dam9279rdkWzqHozUo4ybjdZmCsDHePy5V/PbBcVMiSZR97gmAy45aqi8CK1lG2ECd356FU86avfwUQ== @@ -6373,11 +6295,6 @@ modify-values@^1.0.1: resolved "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz" integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw== -ms@^2.0.0, ms@2.1.3: - version "2.1.3" - resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" - integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== - ms@2.0.0: version "2.0.0" resolved "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz" @@ -6388,6 +6305,11 @@ ms@2.1.2: resolved "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== +ms@2.1.3, ms@^2.0.0: + version "2.1.3" + resolved "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz" + integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== + multer@1.4.4-lts.1: version "1.4.4-lts.1" resolved "https://registry.npmjs.org/multer/-/multer-1.4.4-lts.1.tgz" @@ -6412,22 +6334,22 @@ multimatch@5.0.0: arrify "^2.0.1" minimatch "^3.0.4" -mute-stream@~1.0.0, mute-stream@1.0.0: - version "1.0.0" - resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz" - integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== - mute-stream@0.0.8: version "0.0.8" resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mute-stream@1.0.0, mute-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.npmjs.org/mute-stream/-/mute-stream-1.0.0.tgz" + integrity sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz" integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== -negotiator@^0.6.3, negotiator@0.6.3: +negotiator@0.6.3, negotiator@^0.6.3: version "0.6.3" resolved "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== @@ -6454,13 +6376,6 @@ node-emoji@1.11.0: dependencies: lodash "^4.17.21" -node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@2.7.0: - version "2.7.0" - resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz" - integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== - dependencies: - whatwg-url "^5.0.0" - node-fetch@2.6.7: version "2.6.7" resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz" @@ -6468,6 +6383,13 @@ node-fetch@2.6.7: dependencies: whatwg-url "^5.0.0" +node-fetch@2.7.0, node-fetch@^2.6.1, node-fetch@^2.6.7: + version "2.7.0" + resolved "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz" + integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== + dependencies: + whatwg-url "^5.0.0" + node-gyp-build@^4.3.0: version "4.7.1" resolved "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.7.1.tgz" @@ -6512,17 +6434,7 @@ nopt@^6.0.0: dependencies: abbrev "^1.0.0" -normalize-package-data@^2.3.2: - version "2.5.0" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" - integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== - dependencies: - hosted-git-info "^2.1.4" - resolve "^1.10.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^2.5.0: +normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: version "2.5.0" resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz" integrity sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA== @@ -6532,17 +6444,7 @@ normalize-package-data@^2.5.0: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-package-data@^3.0.0: - version "3.0.3" - resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" - integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== - dependencies: - hosted-git-info "^4.0.1" - is-core-module "^2.5.0" - semver "^7.3.4" - validate-npm-package-license "^3.0.1" - -normalize-package-data@^3.0.3: +normalize-package-data@^3.0.0, normalize-package-data@^3.0.3: version "3.0.3" resolved "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-3.0.3.tgz" integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== @@ -6598,16 +6500,6 @@ npm-normalize-package-bin@^3.0.0: resolved "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-3.0.1.tgz" integrity sha512-dMxCf+zZ+3zeQZXKxmyuCKlIDPGuv8EF940xbkC4kQVDTtqoh6rJFO+JTKSA6/Rwi0getWmtuy4Itup0AMcaDQ== -npm-package-arg@^10.0.0, npm-package-arg@^10.1.0: - version "10.1.0" - resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz" - integrity sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA== - dependencies: - hosted-git-info "^6.0.0" - proc-log "^3.0.0" - semver "^7.3.5" - validate-npm-package-name "^5.0.0" - npm-package-arg@8.1.1: version "8.1.1" resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-8.1.1.tgz" @@ -6617,12 +6509,15 @@ npm-package-arg@8.1.1: semver "^7.0.0" validate-npm-package-name "^3.0.0" -npm-packlist@^7.0.0: - version "7.0.4" - resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz" - integrity sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q== +npm-package-arg@^10.0.0, npm-package-arg@^10.1.0: + version "10.1.0" + resolved "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz" + integrity sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA== dependencies: - ignore-walk "^6.0.0" + hosted-git-info "^6.0.0" + proc-log "^3.0.0" + semver "^7.3.5" + validate-npm-package-name "^5.0.0" npm-packlist@5.1.1: version "5.1.1" @@ -6634,6 +6529,13 @@ npm-packlist@5.1.1: npm-bundled "^1.1.2" npm-normalize-package-bin "^1.0.1" +npm-packlist@^7.0.0: + version "7.0.4" + resolved "https://registry.npmjs.org/npm-packlist/-/npm-packlist-7.0.4.tgz" + integrity sha512-d6RGEuRrNS5/N84iglPivjaJPxhDbZmlbTwTDX2IbcRHG5bZCdtysYMhwiPvcF4GisXHGn7xsxv+GQ7T/02M5Q== + dependencies: + ignore-walk "^6.0.0" + npm-pick-manifest@^8.0.0: version "8.0.2" resolved "https://registry.npmjs.org/npm-pick-manifest/-/npm-pick-manifest-8.0.2.tgz" @@ -6681,7 +6583,7 @@ npmlog@^6.0.0, npmlog@^6.0.2: gauge "^4.0.3" set-blocking "^2.0.0" -"nx@>= 15 <= 17", "nx@>=16.5.1 < 17", nx@16.10.0: +nx@16.10.0, "nx@>=16.5.1 < 17": version "16.10.0" resolved "https://registry.npmjs.org/nx/-/nx-16.10.0.tgz" integrity sha512-gZl4iCC0Hx0Qe1VWmO4Bkeul2nttuXdPpfnlcDKSACGu3ZIo+uySqwOF8yBAxSTIf8xe2JRhgzJN1aFkuezEBg== @@ -6803,7 +6705,7 @@ optionator@^0.9.3: prelude-ls "^1.2.1" type-check "^0.4.0" -ora@^5.4.1, ora@5.4.1: +ora@5.4.1, ora@^5.4.1: version "5.4.1" resolved "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz" integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== @@ -6875,7 +6777,7 @@ p-map-series@2.1.0: resolved "https://registry.npmjs.org/p-map-series/-/p-map-series-2.1.0.tgz" integrity sha512-RpYIIK1zXSNEOdwxcfe7FdvGcs7+y5n8rifMhMNWvaxRNMPINJHF5GDeuVxWqnfrcHPSCnp7Oo5yNXHId9Av2Q== -p-map@^4.0.0, p-map@4.0.0: +p-map@4.0.0, p-map@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz" integrity sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ== @@ -6895,7 +6797,7 @@ p-queue@6.6.2: eventemitter3 "^4.0.4" p-timeout "^3.2.0" -p-reduce@^2.0.0, p-reduce@^2.1.0, p-reduce@2.1.0: +p-reduce@2.1.0, p-reduce@^2.0.0, p-reduce@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/p-reduce/-/p-reduce-2.1.0.tgz" integrity sha512-2USApvnsutq8uoxZBGbbWM0JIYLiEMJ9RlaN7fAzVNb9OZN0SHjjTTfIcb667XynS5Y1VhwDJVDa72TnPzAYWw== @@ -7057,15 +6959,20 @@ picocolors@^1.0.0: resolved "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picomatch@3.0.1: + version "3.0.1" + resolved "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz" + integrity sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag== + picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz" integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== -picomatch@3.0.1: - version "3.0.1" - resolved "https://registry.npmjs.org/picomatch/-/picomatch-3.0.1.tgz" - integrity sha512-I3EurrIQMlRc9IaAZnqRR044Phh2DXY+55o7uJ0V+hYZAcQYSuFWsc9q5PvyDHUSCe1Qxn/iBz+78s86zWnGag== +pify@5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz" + integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== pify@^2.3.0: version "2.3.0" @@ -7082,11 +6989,6 @@ pify@^4.0.1: resolved "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz" integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== -pify@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/pify/-/pify-5.0.0.tgz" - integrity sha512-eW/gHNMlxdSP6dmG6uJip6FXN0EQBwm2clYYd8Wul42Cwu/DK8HEftzsapcNdYe2MfLiIwZqsDk2RDEsTE79hA== - pirates@^4.0.4: version "4.0.6" resolved "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz" @@ -7116,7 +7018,7 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@^3.0.0, prettier@>=3.0.0: +prettier@^3.0.0: version "3.2.4" resolved "https://registry.npmjs.org/prettier/-/prettier-3.2.4.tgz" integrity sha512-FWu1oLHKCrtpO1ypU6J0SbK2d9Ckwysq6bHj/uaCP26DxrPpppCLQRGVuqAxSTvhF00AcvDRyYrLNW7ocBhFFQ== @@ -7225,20 +7127,20 @@ range-parser@~1.2.1: resolved "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@^2.5.2, raw-body@2.5.2: - version "2.5.2" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz" - integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== +raw-body@2.5.1: + version "2.5.1" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz" + integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== dependencies: bytes "3.1.2" http-errors "2.0.0" iconv-lite "0.4.24" unpipe "1.0.0" -raw-body@2.5.1: - version "2.5.1" - resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.1.tgz" - integrity sha512-qqJBtEyVgS0ZmPGdCFPWJ3FreoqvG4MVQln/kCgF7Olq95IbOp0/BWyMwbdtn4VTvkM8Y7khCQ2Xgk/tcrCXig== +raw-body@2.5.2, raw-body@^2.5.2: + version "2.5.2" + resolved "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz" + integrity sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA== dependencies: bytes "3.1.2" http-errors "2.0.0" @@ -7263,7 +7165,7 @@ read-package-json-fast@^3.0.0: json-parse-even-better-errors "^3.0.0" npm-normalize-package-bin "^3.0.0" -read-package-json@^6.0.0, read-package-json@6.0.4: +read-package-json@6.0.4, read-package-json@^6.0.0: version "6.0.4" resolved "https://registry.npmjs.org/read-package-json/-/read-package-json-6.0.4.tgz" integrity sha512-AEtWXYfopBj2z5N5PbkAOeNHRPUg5q+Nen7QLxV8M2zJq1ym6/lCz3fYNTCXe19puu2d06jfHhrP7v/S2PtMMw== @@ -7316,7 +7218,7 @@ read@^2.0.0: dependencies: mute-stream "~1.0.0" -readable-stream@^2.2.2: +readable-stream@^2.2.2, readable-stream@~2.3.6: version "2.3.8" resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== @@ -7338,19 +7240,6 @@ readable-stream@^3.0.0, readable-stream@^3.0.2, readable-stream@^3.1.1, readable string_decoder "^1.1.1" util-deprecate "^1.0.1" -readable-stream@~2.3.6: - version "2.3.8" - resolved "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz" - integrity sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA== - dependencies: - core-util-is "~1.0.0" - inherits "~2.0.3" - isarray "~1.0.0" - process-nextick-args "~2.0.0" - safe-buffer "~5.1.1" - string_decoder "~1.1.1" - util-deprecate "~1.0.1" - readdirp@~3.6.0: version "3.6.0" resolved "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz" @@ -7373,7 +7262,7 @@ redent@^3.0.0: indent-string "^4.0.0" strip-indent "^3.0.0" -reflect-metadata@^0.1.12, reflect-metadata@^0.1.13: +reflect-metadata@^0.1.13: version "0.1.14" resolved "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.14.tgz" integrity sha512-ZhYeb6nRaXCfhnndflDK8qI6ZQ/YcWZCISRAWICW9XYqMUwjZM9Z0DveWX/ABN01oxSHwVxKQmxeYZSsm0jh5A== @@ -7443,16 +7332,16 @@ resolve-cwd@^3.0.0: dependencies: resolve-from "^5.0.0" +resolve-from@5.0.0, resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz" integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== -resolve-from@^5.0.0, resolve-from@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz" - integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== - resolve.exports@^2.0.0: version "2.0.2" resolved "https://registry.npmjs.org/resolve.exports/-/resolve.exports-2.0.2.tgz" @@ -7485,6 +7374,13 @@ reusify@^1.0.4: resolved "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== +rimraf@4.4.1, rimraf@^4.4.1: + version "4.4.1" + resolved "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz" + integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== + dependencies: + glob "^9.2.0" + rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz" @@ -7492,13 +7388,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rimraf@^4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz" - integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== - dependencies: - glob "^9.2.0" - rimraf@^5.0.5: version "5.0.5" resolved "https://registry.npmjs.org/rimraf/-/rimraf-5.0.5.tgz" @@ -7506,13 +7395,6 @@ rimraf@^5.0.5: dependencies: glob "^10.3.7" -rimraf@4.4.1: - version "4.4.1" - resolved "https://registry.npmjs.org/rimraf/-/rimraf-4.4.1.tgz" - integrity sha512-Gk8NlF062+T9CqNGn6h4tls3k6T1+/nXdOcSZVikNVtlRdYpA7wRJJMoXmuvOnLW844rPjdQ7JgXCYM6PPC/og== - dependencies: - glob "^9.2.0" - run-applescript@^5.0.0: version "5.0.0" resolved "https://registry.npmjs.org/run-applescript/-/run-applescript-5.0.0.tgz" @@ -7537,14 +7419,14 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs@^7.1.0, rxjs@^7.2.0, rxjs@^7.5.5, rxjs@^7.8.1, rxjs@7.8.1: +rxjs@7.8.1, rxjs@^7.2.0, rxjs@^7.5.5, rxjs@^7.8.1: version "7.8.1" resolved "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz" integrity sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg== dependencies: tslib "^2.1.0" -safe-buffer@^5.1.0, safe-buffer@~5.2.0, safe-buffer@5.2.1: +safe-buffer@5.2.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -7568,17 +7450,19 @@ schema-utils@^3.1.1, schema-utils@^3.2.0: ajv "^6.12.5" ajv-keywords "^3.5.2" -semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.6.0: version "5.7.2" resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== -semver@^6.3.0: - version "6.3.1" - resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" - integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== +semver@7.5.3: + version "7.5.3" + resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz" + integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== + dependencies: + lru-cache "^6.0.0" -semver@^6.3.1: +semver@^6.3.0, semver@^6.3.1: version "6.3.1" resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz" integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== @@ -7590,18 +7474,6 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semve dependencies: lru-cache "^6.0.0" -"semver@2 || 3 || 4 || 5": - version "5.7.2" - resolved "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz" - integrity sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g== - -semver@7.5.3: - version "7.5.3" - resolved "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz" - integrity sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ== - dependencies: - lru-cache "^6.0.0" - send@0.18.0: version "0.18.0" resolved "https://registry.npmjs.org/send/-/send-0.18.0.tgz" @@ -7695,7 +7567,7 @@ side-channel@^1.0.4: get-intrinsic "^1.0.2" object-inspect "^1.9.0" -signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7, signal-exit@3.0.7: +signal-exit@3.0.7, signal-exit@^3.0.2, signal-exit@^3.0.3, signal-exit@^3.0.7: version "3.0.7" resolved "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz" integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== @@ -7721,7 +7593,7 @@ sisteransi@^1.0.5: resolved "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz" integrity sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg== -slash@^3.0.0, slash@3.0.0: +slash@3.0.0, slash@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== @@ -7755,14 +7627,6 @@ sort-keys@^2.0.0: dependencies: is-plain-obj "^1.0.0" -source-map-support@~0.5.20, source-map-support@0.5.21: - version "0.5.21" - resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" - integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== - dependencies: - buffer-from "^1.0.0" - source-map "^0.6.0" - source-map-support@0.5.13: version "0.5.13" resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz" @@ -7771,16 +7635,24 @@ source-map-support@0.5.13: buffer-from "^1.0.0" source-map "^0.6.0" -source-map@^0.6.0, source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== +source-map-support@0.5.21, source-map-support@~0.5.20: + version "0.5.21" + resolved "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz" + integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w== + dependencies: + buffer-from "^1.0.0" + source-map "^0.6.0" source-map@0.7.4: version "0.7.4" resolved "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz" integrity sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA== +source-map@^0.6.0, source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== + spdx-correct@^3.0.0: version "3.2.0" resolved "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz" @@ -7807,13 +7679,6 @@ spdx-license-ids@^3.0.0: resolved "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.16.tgz" integrity sha512-eWN+LnM3GR6gPu35WxNgbGl8rmY1AEmoMDvL/QD6zYmPWgywxWqJWNdLGT+ke8dKNWrcYgYjPpG5gbTfghP8rw== -split@^1.0.1: - version "1.0.1" - resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" - integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== - dependencies: - through "2" - split2@^3.2.2: version "3.2.2" resolved "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz" @@ -7821,6 +7686,13 @@ split2@^3.2.2: dependencies: readable-stream "^3.0.0" +split@^1.0.1: + version "1.0.1" + resolved "https://registry.npmjs.org/split/-/split-1.0.1.tgz" + integrity sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg== + dependencies: + through "2" + sprintf-js@~1.0.2: version "1.0.3" resolved "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz" @@ -7833,14 +7705,7 @@ ssri@^10.0.0, ssri@^10.0.1: dependencies: minipass "^7.0.3" -ssri@^9.0.0: - version "9.0.1" - resolved "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz" - integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== - dependencies: - minipass "^3.1.1" - -ssri@^9.0.1: +ssri@^9.0.0, ssri@^9.0.1: version "9.0.1" resolved "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz" integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== @@ -7864,20 +7729,6 @@ streamsearch@^1.1.0: resolved "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz" integrity sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg== -string_decoder@^1.1.1: - version "1.3.0" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" - integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== - dependencies: - safe-buffer "~5.2.0" - -string_decoder@~1.1.1: - version "1.1.1" - resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" - integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== - dependencies: - safe-buffer "~5.1.0" - string-length@^4.0.1: version "4.0.2" resolved "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz" @@ -7886,16 +7737,7 @@ string-length@^4.0.1: char-regex "^1.0.2" strip-ansi "^6.0.0" -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -7913,14 +7755,21 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== +string_decoder@^1.1.1: + version "1.3.0" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz" + integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA== dependencies: - ansi-regex "^5.0.1" + safe-buffer "~5.2.0" + +string_decoder@~1.1.1: + version "1.1.1" + resolved "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz" + integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg== + dependencies: + safe-buffer "~5.1.0" -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -7966,7 +7815,7 @@ strip-json-comments@^3.1.1: resolved "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz" integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== -strong-log-transformer@^2.1.0, strong-log-transformer@2.1.0: +strong-log-transformer@2.1.0, strong-log-transformer@^2.1.0: version "2.1.0" resolved "https://registry.npmjs.org/strong-log-transformer/-/strong-log-transformer-2.1.0.tgz" integrity sha512-B3Hgul+z0L9a236FAUC9iZsL+nVHgoCJnqCbN588DjYxvGXaXaaFbfmQ/JhvKjZwsOukuR72XbHv71Qkug0HxA== @@ -8038,26 +7887,26 @@ tar-stream@~2.2.0: inherits "^2.0.3" readable-stream "^3.1.1" -tar@^6.1.11, tar@^6.1.2: - version "6.2.0" - resolved "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz" - integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ== +tar@6.1.11: + version "6.1.11" + resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" + integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^5.0.0" + minipass "^3.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" -tar@6.1.11: - version "6.1.11" - resolved "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz" - integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== +tar@^6.1.11, tar@^6.1.2: + version "6.2.0" + resolved "https://registry.npmjs.org/tar/-/tar-6.2.0.tgz" + integrity sha512-/Wo7DcT0u5HUV486xg675HtjNd3BXZ6xDbzsCUZPt5iw8bTQ63bP0Raut3mvro9u+CUyq7YQd8Cx55fsZXxqLQ== dependencies: chownr "^2.0.0" fs-minipass "^2.0.0" - minipass "^3.0.0" + minipass "^5.0.0" minizlib "^2.1.1" mkdirp "^1.0.3" yallist "^4.0.0" @@ -8107,11 +7956,6 @@ text-table@^0.2.0: resolved "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz" integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== -through@^2.3.4, through@^2.3.6, "through@>=2.2.7 <3", through@2: - version "2.3.8" - resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" - integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== - through2@^2.0.0: version "2.0.5" resolved "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz" @@ -8120,6 +7964,11 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" +through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: + version "2.3.8" + resolved "https://registry.npmjs.org/through/-/through-2.3.8.tgz" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + titleize@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/titleize/-/titleize-3.0.0.tgz" @@ -8181,7 +8030,7 @@ ts-api-utils@^1.0.1: resolved "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-1.0.3.tgz" integrity sha512-wNMeqtMz5NtwpT/UZGY5alT+VoKdSsOOP/kqHFcUW1P/VRhH2wJ48+DN2WwUliNbQ976ETwDL0Ifd2VVvgonvg== -ts-node@^10.9.1, ts-node@>=9.0.0: +ts-node@^10.9.1: version "10.9.2" resolved "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz" integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ== @@ -8209,7 +8058,7 @@ tsconfig-paths-webpack-plugin@4.1.0: enhanced-resolve "^5.7.0" tsconfig-paths "^4.1.2" -tsconfig-paths@^4.1.2, tsconfig-paths@4.2.0: +tsconfig-paths@4.2.0, tsconfig-paths@^4.1.2: version "4.2.0" resolved "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-4.2.0.tgz" integrity sha512-NoZ4roiN7LnbKn9QqE1amc9DJfzvZXxF4xDavcOWt1BPkdx+m+0gJuPM+S0vCe7zTJMYUP0R8pO2XMr+Y8oLIg== @@ -8218,16 +8067,16 @@ tsconfig-paths@^4.1.2, tsconfig-paths@4.2.0: minimist "^1.2.6" strip-bom "^3.0.0" +tslib@2.6.2, tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.6.0, tslib@^2.6.2: + version "2.6.2" + resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" + integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== + tslib@^1.8.1: version "1.14.1" resolved "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.1.0, tslib@^2.3.0, tslib@^2.3.1, tslib@^2.4.0, tslib@^2.6.0, tslib@^2.6.2, tslib@2.6.2: - version "2.6.2" - resolved "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz" - integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q== - tsutils@^3.21.0: version "3.21.0" resolved "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz" @@ -8299,7 +8148,7 @@ typedarray@^0.0.6: resolved "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz" integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA== -"typescript@^4.2.4 || ^5.0.0", typescript@^5.2.2, typescript@>=2.7, "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta", "typescript@>=3 < 6", typescript@>=4.2.0, typescript@>=4.8.2, typescript@>=4.9.5, typescript@>3.6.0, typescript@5.3.3: +typescript@5.3.3, "typescript@>=3 < 6", typescript@^5.2.2: version "5.3.3" resolved "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz" integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw== @@ -8382,7 +8231,7 @@ universalify@^2.0.0: resolved "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz" integrity sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw== -unpipe@~1.0.0, unpipe@1.0.0: +unpipe@1.0.0, unpipe@~1.0.0: version "1.0.0" resolved "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz" integrity sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ== @@ -8446,7 +8295,7 @@ v8-to-istanbul@^9.0.1: "@types/istanbul-lib-coverage" "^2.0.1" convert-source-map "^2.0.0" -validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4, validate-npm-package-license@3.0.4: +validate-npm-package-license@3.0.4, validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4: version "3.0.4" resolved "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz" integrity sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew== @@ -8454,6 +8303,13 @@ validate-npm-package-license@^3.0.1, validate-npm-package-license@^3.0.4, valida spdx-correct "^3.0.0" spdx-expression-parse "^3.0.0" +validate-npm-package-name@5.0.0, validate-npm-package-name@^5.0.0: + version "5.0.0" + resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz" + integrity sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ== + dependencies: + builtins "^5.0.0" + validate-npm-package-name@^3.0.0: version "3.0.0" resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-3.0.0.tgz" @@ -8461,13 +8317,6 @@ validate-npm-package-name@^3.0.0: dependencies: builtins "^1.0.3" -validate-npm-package-name@^5.0.0, validate-npm-package-name@5.0.0: - version "5.0.0" - resolved "https://registry.npmjs.org/validate-npm-package-name/-/validate-npm-package-name-5.0.0.tgz" - integrity sha512-YuKoXDAhBYxY7SfOKxHBDoSyENFeW5VvIIQp2TGQuit8gpK6MnWaQelBKxso72DoxTZfZdcP3W90LqpSkgPzLQ== - dependencies: - builtins "^5.0.0" - vary@^1, vary@~1.1.2: version "1.1.2" resolved "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz" @@ -8510,7 +8359,7 @@ webpack-sources@^3.2.3: resolved "https://registry.npmjs.org/webpack-sources/-/webpack-sources-3.2.3.tgz" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.1.0, webpack@^5.11.0, webpack@5.89.0: +webpack@5.89.0: version "5.89.0" resolved "https://registry.npmjs.org/webpack/-/webpack-5.89.0.tgz" integrity sha512-qyfIC10pOr70V+jkmud8tMfajraGCZMBWJtrmuBymQKCrLTRejBI8STDp1MCyZu/QTdZSeacCQYpYNQVOzX5kw== @@ -8548,14 +8397,7 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -which@^2.0.1: - version "2.0.2" - resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" - integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== - dependencies: - isexe "^2.0.0" - -which@^2.0.2: +which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.npmjs.org/which/-/which-2.0.2.tgz" integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== @@ -8581,7 +8423,7 @@ wordwrap@^1.0.0: resolved "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz" integrity sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== @@ -8599,15 +8441,6 @@ wrap-ansi@^6.0.1, wrap-ansi@^6.2.0: string-width "^4.1.0" strip-ansi "^6.0.0" -wrap-ansi@^7.0.0: - version "7.0.0" - resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - wrap-ansi@^8.1.0: version "8.1.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz" @@ -8622,6 +8455,14 @@ wrappy@1: resolved "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz" integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== +write-file-atomic@5.0.1: + version "5.0.1" + resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz" + integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^4.0.1" + write-file-atomic@^2.4.2: version "2.4.3" resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz" @@ -8639,14 +8480,6 @@ write-file-atomic@^4.0.2: imurmurhash "^0.1.4" signal-exit "^3.0.7" -write-file-atomic@5.0.1: - version "5.0.1" - resolved "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-5.0.1.tgz" - integrity sha512-+QU2zd6OTD8XWIJCbffaiQeH9U73qIqafo1x6V1snCWYGJf6cVE0cDR4D8xRzcEnfI21IFrUPzPGtcPf8AC+Rw== - dependencies: - imurmurhash "^0.1.4" - signal-exit "^4.0.1" - write-json-file@^3.2.0: version "3.2.0" resolved "https://registry.npmjs.org/write-json-file/-/write-json-file-3.2.0.tgz" @@ -8688,27 +8521,22 @@ yallist@^4.0.0: resolved "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== -yargs-parser@^20.2.2: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== - -yargs-parser@^20.2.3: - version "20.2.9" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" - integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== +yargs-parser@20.2.4: + version "20.2.4" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" + integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@^21.1.1, yargs-parser@21.1.1: +yargs-parser@21.1.1, yargs-parser@^21.1.1: version "21.1.1" resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz" integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== -yargs-parser@20.2.4: - version "20.2.4" - resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz" - integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== +yargs-parser@^20.2.2, yargs-parser@^20.2.3: + version "20.2.9" + resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz" + integrity sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w== -yargs@^16.2.0, yargs@16.2.0: +yargs@16.2.0, yargs@^16.2.0: version "16.2.0" resolved "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz" integrity sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw== @@ -8721,20 +8549,7 @@ yargs@^16.2.0, yargs@16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.3.1: - version "17.7.2" - resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== - dependencies: - cliui "^8.0.1" - escalade "^3.1.1" - get-caller-file "^2.0.5" - require-directory "^2.1.1" - string-width "^4.2.3" - y18n "^5.0.5" - yargs-parser "^21.1.1" - -yargs@^17.6.2: +yargs@^17.3.1, yargs@^17.6.2: version "17.7.2" resolved "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz" integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==