diff --git a/.fern/metadata.json b/.fern/metadata.json index fe4c29e50..6e98b21b2 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.38.0", + "cliVersion": "4.23.1", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.43.8", + "generatorVersion": "3.54.0", "generatorConfig": { "namespaceExport": "Square", "allowCustomFetcher": true, @@ -54,5 +54,6 @@ } } }, - "sdkVersion": "44.0.0" + "originGitCommit": "809bbe97ec8c4928c84c231c117042f8f36cc91d", + "sdkVersion": "44.0.1" } diff --git a/README.md b/README.md index ae4ec5b2a..a2c06fbec 100644 --- a/README.md +++ b/README.md @@ -18,6 +18,7 @@ The Square TypeScript library provides convenient access to the Square APIs from - [Pagination](#pagination) - [Webhook Signature Verification](#webhook-signature-verification) - [Advanced](#advanced) + - [Subpackage Exports](#subpackage-exports) - [Additional Headers](#additional-headers) - [Additional Query String Parameters](#additional-query-string-parameters) - [Retries](#retries) @@ -272,6 +273,16 @@ const isValid = WebhooksHelper.verifySignature({ ## Advanced +### Subpackage Exports + +This SDK supports direct imports of subpackage clients, which allows JavaScript bundlers to tree-shake and include only the imported subpackage code. This results in much smaller bundle sizes. + +```typescript +import { OAuthClient } from 'square/oAuth'; + +const client = new OAuthClient({...}); +``` + ### Additional Headers If you would like to send additional headers as part of the request, use the `headers` request option. @@ -459,4 +470,4 @@ otherwise they would be overwritten upon the next generated release. Feel free t a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us! -On the other hand, contributions to the README are always very welcome! \ No newline at end of file +On the other hand, contributions to the README are always very welcome! diff --git a/biome.json b/biome.json index a777468e4..5084b70a9 100644 --- a/biome.json +++ b/biome.json @@ -1,5 +1,5 @@ { - "$schema": "https://biomejs.dev/schemas/2.3.1/schema.json", + "$schema": "https://biomejs.dev/schemas/2.4.3/schema.json", "root": true, "vcs": { "enabled": false diff --git a/package.json b/package.json index e59eea0b9..0ea372fed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "square", - "version": "44.0.0", + "version": "44.0.1", "private": false, "repository": { "type": "git", @@ -44,13 +44,14 @@ "msw": "2.11.2", "@types/node": "^18.19.70", "typescript": "~5.7.2", - "@biomejs/biome": "2.3.1" + "@biomejs/biome": "2.4.3" }, "browser": { "fs": false, "os": false, "path": false, - "stream": false + "stream": false, + "crypto": false }, "packageManager": "yarn@1.22.22", "engines": { diff --git a/reference.md b/reference.md index 73556c03a..1c5ab7ca5 100644 --- a/reference.md +++ b/reference.md @@ -558,7 +558,7 @@ await client.applePay.registerDomain({ ## BankAccounts -
client.bankAccounts.list({ ...params }) -> core.Page +
client.bankAccounts.list({ ...params }) -> core.Page<Square.BankAccount, Square.ListBankAccountsResponse>
@@ -906,7 +906,7 @@ await client.bankAccounts.disableBankAccount({
## Bookings -
client.bookings.list({ ...params }) -> core.Page +
client.bookings.list({ ...params }) -> core.Page<Square.Booking, Square.ListBookingsResponse>
@@ -1615,7 +1615,7 @@ await client.bookings.cancel({
## Cards -
client.cards.list({ ...params }) -> core.Page +
client.cards.list({ ...params }) -> core.Page<Square.Card, Square.ListCardsResponse>
@@ -2211,7 +2211,7 @@ await client.catalog.info();
-
client.catalog.list({ ...params }) -> core.Page +
client.catalog.list({ ...params }) -> core.Page<Square.CatalogObject, Square.ListCatalogResponse>
@@ -2616,7 +2616,7 @@ await client.catalog.updateItemTaxes({
## Channels -
client.channels.list({ ...params }) -> core.Page +
client.channels.list({ ...params }) -> core.Page<Square.Channel, Square.ListChannelsResponse>
@@ -2834,7 +2834,7 @@ await client.channels.get({
## Customers -
client.customers.list({ ...params }) -> core.Page +
client.customers.list({ ...params }) -> core.Page<Square.Customer, Square.ListCustomersResponse>
@@ -3632,7 +3632,7 @@ await client.customers.delete({
## Devices -
client.devices.list({ ...params }) -> core.Page +
client.devices.list({ ...params }) -> core.Page<Square.Device, Square.ListDevicesResponse>
@@ -3784,7 +3784,7 @@ await client.devices.get({
## Disputes -
client.disputes.list({ ...params }) -> core.Page +
client.disputes.list({ ...params }) -> core.Page<Square.Dispute, Square.ListDisputesResponse>
@@ -4207,7 +4207,7 @@ await client.disputes.submitEvidence({
## Employees -
client.employees.list({ ...params }) -> core.Page +
client.employees.list({ ...params }) -> core.Page<Square.Employee, Square.ListEmployeesResponse>
@@ -4599,7 +4599,7 @@ await client.events.listEventTypes({
## GiftCards -
client.giftCards.list({ ...params }) -> core.Page +
client.giftCards.list({ ...params }) -> core.Page<Square.GiftCard, Square.ListGiftCardsResponse>
@@ -5520,7 +5520,7 @@ await client.inventory.batchCreateChanges({
-
client.inventory.batchGetChanges({ ...params }) -> core.Page +
client.inventory.batchGetChanges({ ...params }) -> core.Page<Square.InventoryChange, Square.BatchGetInventoryChangesResponse>
@@ -5616,7 +5616,7 @@ const response = page.response;
-
client.inventory.batchGetCounts({ ...params }) -> core.Page +
client.inventory.batchGetCounts({ ...params }) -> core.Page<Square.InventoryCount, Square.BatchGetInventoryCountsResponse>
@@ -5907,7 +5907,7 @@ await client.inventory.getTransfer({
-
client.inventory.get({ ...params }) -> core.Page +
client.inventory.get({ ...params }) -> core.Page<Square.InventoryCount, Square.GetInventoryCountResponse>
@@ -5993,7 +5993,7 @@ const response = page.response;
-
client.inventory.changes({ ...params }) -> core.Page +
client.inventory.changes({ ...params }) -> core.Page<Square.InventoryChange, Square.GetInventoryChangesResponse>
@@ -6089,7 +6089,7 @@ const response = page.response;
## Invoices -
client.invoices.list({ ...params }) -> core.Page +
client.invoices.list({ ...params }) -> core.Page<Square.Invoice, Square.ListInvoicesResponse>
@@ -8254,7 +8254,7 @@ await client.loyalty.searchEvents({
## Merchants -
client.merchants.list({ ...params }) -> core.Page +
client.merchants.list({ ...params }) -> core.Page<Square.Merchant, Square.ListMerchantsResponse>
@@ -9339,7 +9339,7 @@ await client.orders.pay({
## Payments -
client.payments.list({ ...params }) -> core.Page +
client.payments.list({ ...params }) -> core.Page<Square.Payment, Square.ListPaymentsResponse>
@@ -9890,7 +9890,7 @@ await client.payments.complete({
## Payouts -
client.payouts.list({ ...params }) -> core.Page +
client.payouts.list({ ...params }) -> core.Page<Square.Payout, Square.ListPayoutsResponse>
@@ -10049,7 +10049,7 @@ await client.payouts.get({
-
client.payouts.listEntries({ ...params }) -> core.Page +
client.payouts.listEntries({ ...params }) -> core.Page<Square.PayoutEntry, Square.ListPayoutEntriesResponse>
@@ -10136,7 +10136,7 @@ const response = page.response;
## Refunds -
client.refunds.list({ ...params }) -> core.Page +
client.refunds.list({ ...params }) -> core.Page<Square.PaymentRefund, Square.ListPaymentRefundsResponse>
@@ -11230,7 +11230,7 @@ await client.subscriptions.cancel({
-
client.subscriptions.listEvents({ ...params }) -> core.Page +
client.subscriptions.listEvents({ ...params }) -> core.Page<Square.SubscriptionEvent, Square.ListSubscriptionEventsResponse>
@@ -12619,7 +12619,7 @@ await client.transferOrders.create({
-
client.transferOrders.search({ ...params }) -> core.Page +
client.transferOrders.search({ ...params }) -> core.Page<Square.TransferOrder, Square.SearchTransferOrdersResponse>
@@ -13710,7 +13710,7 @@ await client.vendors.update({
## Bookings CustomAttributeDefinitions -
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page +
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition, Square.ListBookingCustomAttributeDefinitionsResponse>
@@ -14230,7 +14230,7 @@ await client.bookings.customAttributes.batchUpsert({
-
client.bookings.customAttributes.list({ ...params }) -> core.Page +
client.bookings.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListBookingCustomAttributesResponse>
@@ -14535,7 +14535,7 @@ await client.bookings.customAttributes.delete({
## Bookings LocationProfiles -
client.bookings.locationProfiles.list({ ...params }) -> core.Page +
client.bookings.locationProfiles.list({ ...params }) -> core.Page<Square.LocationBookingProfile, Square.ListLocationBookingProfilesResponse>
@@ -14617,7 +14617,7 @@ const response = page.response;
## Bookings TeamMemberProfiles -
client.bookings.teamMemberProfiles.list({ ...params }) -> core.Page +
client.bookings.teamMemberProfiles.list({ ...params }) -> core.Page<Square.TeamMemberBookingProfile, Square.ListTeamMemberBookingProfilesResponse>
@@ -14768,7 +14768,7 @@ await client.bookings.teamMemberProfiles.get({
## CashDrawers Shifts -
client.cashDrawers.shifts.list({ ...params }) -> core.Page +
client.cashDrawers.shifts.list({ ...params }) -> core.Page<Square.CashDrawerShiftSummary, Square.ListCashDrawerShiftsResponse>
@@ -14925,7 +14925,7 @@ await client.cashDrawers.shifts.get({
-
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page +
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page<Square.CashDrawerShiftEvent, Square.ListCashDrawerShiftEventsResponse>
@@ -15370,7 +15370,7 @@ await client.catalog.object.delete({
## Checkout PaymentLinks -
client.checkout.paymentLinks.list({ ...params }) -> core.Page +
client.checkout.paymentLinks.list({ ...params }) -> core.Page<Square.PaymentLink, Square.ListPaymentLinksResponse>
@@ -15728,7 +15728,7 @@ await client.checkout.paymentLinks.delete({
## Customers CustomAttributeDefinitions -
client.customers.customAttributeDefinitions.list({ ...params }) -> core.Page +
client.customers.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition, Square.ListCustomerCustomAttributeDefinitionsResponse>
@@ -16227,7 +16227,7 @@ await client.customers.customAttributeDefinitions.batchUpsert({
## Customers Groups -
client.customers.groups.list({ ...params }) -> core.Page +
client.customers.groups.list({ ...params }) -> core.Page<Square.CustomerGroup, Square.ListCustomerGroupsResponse>
@@ -16714,7 +16714,7 @@ await client.customers.groups.remove({
## Customers Segments -
client.customers.segments.list({ ...params }) -> core.Page +
client.customers.segments.list({ ...params }) -> core.Page<Square.CustomerSegment, Square.ListCustomerSegmentsResponse>
@@ -17007,7 +17007,7 @@ await client.customers.cards.delete({
## Customers CustomAttributes -
client.customers.customAttributes.list({ ...params }) -> core.Page +
client.customers.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListCustomerCustomAttributesResponse>
@@ -17322,7 +17322,7 @@ await client.customers.customAttributes.delete({
## Devices Codes -
client.devices.codes.list({ ...params }) -> core.Page +
client.devices.codes.list({ ...params }) -> core.Page<Square.DeviceCode, Square.ListDeviceCodesResponse>
@@ -17544,7 +17544,7 @@ await client.devices.codes.get({
## Disputes Evidence -
client.disputes.evidence.list({ ...params }) -> core.Page +
client.disputes.evidence.list({ ...params }) -> core.Page<Square.DisputeEvidence, Square.ListDisputeEvidenceResponse>
@@ -17761,7 +17761,7 @@ await client.disputes.evidence.delete({
## GiftCards Activities -
client.giftCards.activities.list({ ...params }) -> core.Page +
client.giftCards.activities.list({ ...params }) -> core.Page<Square.GiftCardActivity, Square.ListGiftCardActivitiesResponse>
@@ -17933,7 +17933,7 @@ await client.giftCards.activities.create({
## Labor BreakTypes -
client.labor.breakTypes.list({ ...params }) -> core.Page +
client.labor.breakTypes.list({ ...params }) -> core.Page<Square.BreakType, Square.ListBreakTypesResponse>
@@ -18305,7 +18305,7 @@ await client.labor.breakTypes.delete({
## Labor EmployeeWages -
client.labor.employeeWages.list({ ...params }) -> core.Page +
client.labor.employeeWages.list({ ...params }) -> core.Page<Square.EmployeeWage, Square.ListEmployeeWagesResponse>
@@ -18882,7 +18882,7 @@ await client.labor.shifts.delete({
## Labor TeamMemberWages -
client.labor.teamMemberWages.list({ ...params }) -> core.Page +
client.labor.teamMemberWages.list({ ...params }) -> core.Page<Square.TeamMemberWage, Square.ListTeamMemberWagesResponse>
@@ -19031,7 +19031,7 @@ await client.labor.teamMemberWages.get({
## Labor WorkweekConfigs -
client.labor.workweekConfigs.list({ ...params }) -> core.Page +
client.labor.workweekConfigs.list({ ...params }) -> core.Page<Square.WorkweekConfig, Square.ListWorkweekConfigsResponse>
@@ -19183,7 +19183,7 @@ await client.labor.workweekConfigs.get({
## Locations CustomAttributeDefinitions -
client.locations.customAttributeDefinitions.list({ ...params }) -> core.Page +
client.locations.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition, Square.ListLocationCustomAttributeDefinitionsResponse>
@@ -19730,7 +19730,7 @@ await client.locations.customAttributes.batchUpsert({
-
client.locations.customAttributes.list({ ...params }) -> core.Page +
client.locations.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListLocationCustomAttributesResponse>
@@ -21263,7 +21263,7 @@ await client.loyalty.rewards.redeem({
## Loyalty Programs Promotions -
client.loyalty.programs.promotions.list({ ...params }) -> core.Page +
client.loyalty.programs.promotions.list({ ...params }) -> core.Page<Square.LoyaltyPromotion, Square.ListLoyaltyPromotionsResponse>
@@ -21579,7 +21579,7 @@ await client.loyalty.programs.promotions.cancel({
## Merchants CustomAttributeDefinitions -
client.merchants.customAttributeDefinitions.list({ ...params }) -> core.Page +
client.merchants.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition, Square.ListMerchantCustomAttributeDefinitionsResponse>
@@ -22116,7 +22116,7 @@ await client.merchants.customAttributes.batchUpsert({
-
client.merchants.customAttributes.list({ ...params }) -> core.Page +
client.merchants.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListMerchantCustomAttributesResponse>
@@ -22423,7 +22423,7 @@ await client.merchants.customAttributes.delete({
## Orders CustomAttributeDefinitions -
client.orders.customAttributeDefinitions.list({ ...params }) -> core.Page +
client.orders.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition, Square.ListOrderCustomAttributeDefinitionsResponse>
@@ -22982,7 +22982,7 @@ await client.orders.customAttributes.batchUpsert({
-
client.orders.customAttributes.list({ ...params }) -> core.Page +
client.orders.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListOrderCustomAttributesResponse>
@@ -24362,7 +24362,7 @@ await client.webhooks.eventTypes.list({
## Webhooks Subscriptions -
client.webhooks.subscriptions.list({ ...params }) -> core.Page +
client.webhooks.subscriptions.list({ ...params }) -> core.Page<Square.WebhookSubscription, Square.ListWebhookSubscriptionsResponse>
@@ -24848,3 +24848,4 @@ await client.webhooks.subscriptions.test({
+ diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 7cff18383..99dd360c9 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -56,8 +56,8 @@ export function normalizeClientOptions; + bytes?(): Promise; }; export function getBinaryResponse(response: Response): BinaryResponse { diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 7c22d4f8f..0858d135d 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -218,7 +218,13 @@ async function getHeaders(args: Fetcher.Args): Promise { newHeaders.set( "Accept", - args.responseType === "json" ? "application/json" : args.responseType === "text" ? "text/plain" : "*/*", + args.responseType === "json" + ? "application/json" + : args.responseType === "text" + ? "text/plain" + : args.responseType === "sse" + ? "text/event-stream" + : "*/*", ); if (args.body !== undefined && args.contentType != null) { newHeaders.set("Content-Type", args.contentType); @@ -276,6 +282,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise Promise, url: string, @@ -10,6 +36,7 @@ export const makeRequest = async ( abortSignal?: AbortSignal, withCredentials?: boolean, duplex?: "half", + disableCache?: boolean, ): Promise => { const signals: AbortSignal[] = []; @@ -32,6 +59,7 @@ export const makeRequest = async ( credentials: withCredentials ? "include" : undefined, // @ts-ignore duplex, + ...(disableCache && isCacheNoStoreSupported() ? { cache: "no-store" as RequestCache } : {}), }); if (timeoutAbortId != null) { diff --git a/src/core/pagination/CustomPager.ts b/src/core/pagination/CustomPager.ts deleted file mode 100644 index 5476b0319..000000000 --- a/src/core/pagination/CustomPager.ts +++ /dev/null @@ -1,194 +0,0 @@ -import type { BaseRequestOptions, NormalizedClientOptions } from "../../BaseClient"; -import type { APIResponse } from "../fetcher/APIResponse"; -import type { Fetcher } from "../fetcher/Fetcher"; -import type { RawResponse } from "../fetcher/index"; - -/** - * - * @template TItem The type of the items in the page. - * @template TResponse The type of the API response. - */ -export class CustomPager implements AsyncIterable { - /** The items from the current page */ - public data: TItem[]; - /** The raw HTTP response */ - public rawResponse: RawResponse; - /** The parsed response object */ - public response: TResponse; - - private sendRequest: (request: Fetcher.Args) => Promise>; - private nextRequest?: Fetcher.Args; - private previousRequest?: Fetcher.Args; - private _hasNextPage: boolean; - private _hasPreviousPage: boolean; - - constructor(args: { - response: TResponse; - rawResponse: RawResponse; - items: TItem[]; - hasNextPage: boolean; - hasPreviousPage: boolean; - nextRequest?: Fetcher.Args; - previousRequest?: Fetcher.Args; - sendRequest: (request: Fetcher.Args) => Promise>; - }) { - this.response = args.response; - this.rawResponse = args.rawResponse; - this.data = args.items; - this._hasNextPage = args.hasNextPage; - this._hasPreviousPage = args.hasPreviousPage; - this.nextRequest = args.nextRequest; - this.previousRequest = args.previousRequest; - this.sendRequest = args.sendRequest; - } - - /** - * @returns whether there is a next page to load - */ - public hasNextPage(): boolean { - return this._hasNextPage; - } - - /** - * @returns whether there is a previous page to load - */ - public hasPreviousPage(): boolean { - return this._hasPreviousPage; - } - - /** - * Returns the current page data. - * This is an alias for the `data` property for consistency with other pagination APIs. - * - * @returns the items from the current page - */ - public getCurrentPage(): TItem[] { - return this.data; - } - - /** - * Retrieves the next page of results. - * @returns this pager with updated data - * @throws Error if there is no next page - */ - public async getNextPage(): Promise { - if (!this._hasNextPage || !this.nextRequest) { - throw new Error("No next page available"); - } - const response = await this.sendRequest(this.nextRequest); - if (!response.ok) { - const reason = - response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason; - throw new Error(`Failed to fetch next page: ${reason}`); - } - const data = response.body; - const rawResponse = response.rawResponse; - const parsed = await parse({ request: this.nextRequest, data, rawResponse }); - this.response = data; - this.rawResponse = rawResponse; - this.data = parsed.items; - this._hasNextPage = parsed.hasNextPage; - this._hasPreviousPage = parsed.hasPreviousPage; - this.nextRequest = parsed.nextRequest; - this.previousRequest = parsed.previousRequest; - return this; - } - - /** - * Retrieves the previous page of results. - * @returns this pager with updated data - * @throws Error if there is no previous page - */ - public async getPreviousPage(): Promise { - if (!this._hasPreviousPage || !this.previousRequest) { - throw new Error("No previous page available"); - } - const response = await this.sendRequest(this.previousRequest); - if (!response.ok) { - const reason = - response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason; - throw new Error(`Failed to fetch previous page: ${reason}`); - } - const data = response.body; - const rawResponse = response.rawResponse; - const parsed = await parse({ request: this.previousRequest, data, rawResponse }); - this.response = data; - this.rawResponse = rawResponse; - this.data = parsed.items; - this._hasNextPage = parsed.hasNextPage; - this._hasPreviousPage = parsed.hasPreviousPage; - this.nextRequest = parsed.nextRequest; - this.previousRequest = parsed.previousRequest; - return this; - } - - private async *iterMessages(): AsyncGenerator { - for (const item of this.data) { - yield item; - } - - while (this.hasNextPage()) { - await this.getNextPage(); - for (const item of this.data) { - yield item; - } - } - } - - async *[Symbol.asyncIterator](): AsyncIterator { - for await (const message of this.iterMessages()) { - yield message; - } - } -} - -export async function createCustomPager({ - sendRequest, - initialHttpRequest, - clientOptions, -}: { - sendRequest: (request: Fetcher.Args) => Promise>; - initialHttpRequest: Fetcher.Args; - clientOptions: NormalizedClientOptions; - requestOptions?: BaseRequestOptions; -}): Promise> { - const response = await sendRequest(initialHttpRequest); - if (!response.ok) { - const reason = - response.error.reason === "status-code" ? `HTTP ${response.error.statusCode}` : response.error.reason; - throw new Error(`Failed to fetch initial page: ${reason}`); - } - const data = response.body; - const rawResponse = response.rawResponse; - const parsed = await parse({ request: initialHttpRequest, data, rawResponse }); - return new CustomPager({ - response: data, - rawResponse, - items: parsed.items, - hasNextPage: parsed.hasNextPage, - hasPreviousPage: parsed.hasPreviousPage, - nextRequest: parsed.nextRequest, - previousRequest: parsed.previousRequest, - sendRequest: sendRequest, - }); -} - -async function parse(_args: { - request: Fetcher.Args; - data: TResponse; - rawResponse: RawResponse; -}): Promise<{ - nextRequest?: Fetcher.Args; - hasNextPage: boolean; - previousRequest?: Fetcher.Args; - hasPreviousPage: boolean; - items: TItem[]; -}> { - // Placeholder implementation. - // TODO: Replace this with actual parsing logic. - return { - items: [], - hasNextPage: false, - hasPreviousPage: false, - }; -} diff --git a/src/core/pagination/Page.ts b/src/core/pagination/Page.ts index 6e884eccb..a95471400 100644 --- a/src/core/pagination/Page.ts +++ b/src/core/pagination/Page.ts @@ -68,7 +68,7 @@ export class Page implements AsyncIterable { } } - async *[Symbol.asyncIterator](): AsyncIterator { + async *[Symbol.asyncIterator](): AsyncIterator { for await (const message of this.iterMessages()) { yield message; } diff --git a/src/core/pagination/index.ts b/src/core/pagination/index.ts index 489f59cf6..46cc304af 100644 --- a/src/core/pagination/index.ts +++ b/src/core/pagination/index.ts @@ -1,2 +1 @@ -export { CustomPager, createCustomPager } from "./CustomPager"; export { Page } from "./Page"; diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index 56ebbb87c..e6e66b2a7 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -113,18 +113,18 @@ function evaluateRuntime(): Runtime { /** * A constant that indicates whether the environment the code is running is Node.JS. + * + * We assign `process` to a local variable first to avoid being flagged by + * bundlers that perform static analysis on `process.versions` (e.g. Next.js + * Edge Runtime warns about Node.js APIs even when they are guarded). */ - const isNode = - typeof process !== "undefined" && - "version" in process && - !!process.version && - "versions" in process && - !!process.versions?.node; + const _process = typeof process !== "undefined" ? process : undefined; + const isNode = typeof _process !== "undefined" && typeof _process.versions?.node === "string"; if (isNode) { return { type: "node", - version: process.versions.node, - parsedVersion: Number(process.versions.node.split(".")[0]), + version: _process.versions.node, + parsedVersion: Number(_process.versions.node.split(".")[0]), }; } diff --git a/src/core/schemas/builders/list/list.ts b/src/core/schemas/builders/list/list.ts index 7c8fd6e87..191922f17 100644 --- a/src/core/schemas/builders/list/list.ts +++ b/src/core/schemas/builders/list/list.ts @@ -44,30 +44,20 @@ function validateAndTransformArray( }; } - const maybeValidItems = value.map((item, index) => transformItem(item, index)); + const result: Parsed[] = []; + const errors: ValidationError[] = []; - return maybeValidItems.reduce>( - (acc, item) => { - if (acc.ok && item.ok) { - return { - ok: true, - value: [...acc.value, item.value], - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } - if (!item.ok) { - errors.push(...item.errors); - } + for (let i = 0; i < value.length; i++) { + const item = transformItem(value[i], i); + if (item.ok) { + result.push(item.value); + } else { + errors.push(...item.errors); + } + } - return { - ok: false, - errors, - }; - }, - { ok: true, value: [] }, - ); + if (errors.length === 0) { + return { ok: true, value: result }; + } + return { ok: false, errors }; } diff --git a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts index ed96cf771..9f2777f6f 100644 --- a/src/core/schemas/builders/object-like/getObjectLikeUtils.ts +++ b/src/core/schemas/builders/object-like/getObjectLikeUtils.ts @@ -5,6 +5,9 @@ import { isPlainObject } from "../../utils/isPlainObject"; import { getSchemaUtils } from "../schema-utils/index"; import type { ObjectLikeSchema, ObjectLikeUtils } from "./types"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function getObjectLikeUtils(schema: BaseSchema): ObjectLikeUtils { return { withParsedProperties: (properties) => withParsedProperties(schema, properties), @@ -26,15 +29,14 @@ export function withParsedProperties>( - (processed, [key, value]) => { - return { - ...processed, - [key]: typeof value === "function" ? value(parsedObject.value) : value, - }; - }, - {}, - ); + const additionalProperties: Record = {}; + for (const key in properties) { + if (_hasOwn.call(properties, key)) { + const value = properties[key as keyof Properties]; + additionalProperties[key] = + typeof value === "function" ? (value as Function)(parsedObject.value) : value; + } + } return { ok: true, diff --git a/src/core/schemas/builders/object/object.ts b/src/core/schemas/builders/object/object.ts index bdad80767..eb48a1116 100644 --- a/src/core/schemas/builders/object/object.ts +++ b/src/core/schemas/builders/object/object.ts @@ -19,6 +19,9 @@ import type { PropertySchemas, } from "./types"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + interface ObjectPropertyWithRawKey { rawKey: string; parsedKey: string; @@ -28,79 +31,128 @@ interface ObjectPropertyWithRawKey { export function object>( schemas: T, ): inferObjectSchemaFromPropertySchemas { - const baseSchema: BaseObjectSchema< - inferRawObjectFromPropertySchemas, - inferParsedObjectFromPropertySchemas - > = { - _getRawProperties: () => - Object.entries(schemas).map(([parsedKey, propertySchema]) => - isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, - ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], - _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + // All property metadata is lazily computed on first use. + // This keeps schema construction free of iteration, which matters when + // many schemas are defined but only some are exercised at runtime. + // Required-key computation is also deferred because lazy() schemas may + // not be resolved at construction time. - parse: (raw, opts) => { - const rawKeyToProperty: Record = {}; - const requiredKeys: string[] = []; + let _rawKeyToProperty: Record | undefined; + function getRawKeyToProperty(): Record { + if (_rawKeyToProperty == null) { + _rawKeyToProperty = {}; for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const rawKey = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.rawKey : parsedKey; + const rawKey = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.rawKey + : (parsedKey as string); const valueSchema: Schema = isProperty(schemaOrObjectProperty) ? schemaOrObjectProperty.valueSchema : schemaOrObjectProperty; - const property: ObjectPropertyWithRawKey = { + _rawKeyToProperty[rawKey] = { rawKey, parsedKey: parsedKey as string, valueSchema, }; + } + } + return _rawKeyToProperty; + } - rawKeyToProperty[rawKey] = property; + let _parseRequiredKeys: string[] | undefined; + let _jsonRequiredKeys: string[] | undefined; + let _parseRequiredKeysSet: Set | undefined; + let _jsonRequiredKeysSet: Set | undefined; + function getParseRequiredKeys(): string[] { + if (_parseRequiredKeys == null) { + _parseRequiredKeys = []; + _jsonRequiredKeys = []; + for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { + const rawKey = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.rawKey + : (parsedKey as string); + const valueSchema: Schema = isProperty(schemaOrObjectProperty) + ? schemaOrObjectProperty.valueSchema + : schemaOrObjectProperty; if (isSchemaRequired(valueSchema)) { - requiredKeys.push(rawKey); + _parseRequiredKeys.push(rawKey); + _jsonRequiredKeys.push(parsedKey as string); } } + _parseRequiredKeysSet = new Set(_parseRequiredKeys); + _jsonRequiredKeysSet = new Set(_jsonRequiredKeys); + } + return _parseRequiredKeys; + } + function getJsonRequiredKeys(): string[] { + if (_jsonRequiredKeys == null) { + getParseRequiredKeys(); + } + return _jsonRequiredKeys!; + } + + function getParseRequiredKeysSet(): Set { + if (_parseRequiredKeysSet == null) { + getParseRequiredKeys(); + } + return _parseRequiredKeysSet!; + } + + function getJsonRequiredKeysSet(): Set { + if (_jsonRequiredKeysSet == null) { + getParseRequiredKeys(); + } + return _jsonRequiredKeysSet!; + } + + const baseSchema: BaseObjectSchema< + inferRawObjectFromPropertySchemas, + inferParsedObjectFromPropertySchemas + > = { + _getRawProperties: () => + Object.entries(schemas).map(([parsedKey, propertySchema]) => + isProperty(propertySchema) ? propertySchema.rawKey : parsedKey, + ) as unknown as (keyof inferRawObjectFromPropertySchemas)[], + _getParsedProperties: () => keys(schemas) as unknown as (keyof inferParsedObjectFromPropertySchemas)[], + + parse: (raw, opts) => { + const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? []; return validateAndTransformObject({ value: raw, - requiredKeys, + requiredKeys: getParseRequiredKeys(), + requiredKeysSet: getParseRequiredKeysSet(), getProperty: (rawKey) => { - const property = rawKeyToProperty[rawKey]; + const property = getRawKeyToProperty()[rawKey]; if (property == null) { return undefined; } return { transformedKey: property.parsedKey, - transform: (propertyValue) => - property.valueSchema.parse(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, rawKey]; + return property.valueSchema.parse(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), rawKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; }, unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, + breadcrumbsPrefix, omitUndefined: opts?.omitUndefined, }); }, json: (parsed, opts) => { - const requiredKeys: string[] = []; - - for (const [parsedKey, schemaOrObjectProperty] of entries(schemas)) { - const valueSchema: Schema = isProperty(schemaOrObjectProperty) - ? schemaOrObjectProperty.valueSchema - : schemaOrObjectProperty; - - if (isSchemaRequired(valueSchema)) { - requiredKeys.push(parsedKey as string); - } - } - + const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? []; return validateAndTransformObject({ value: parsed, - requiredKeys, + requiredKeys: getJsonRequiredKeys(), + requiredKeysSet: getJsonRequiredKeysSet(), getProperty: ( parsedKey, ): { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined => { @@ -114,26 +166,30 @@ export function object - property.valueSchema.json(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey]; + return property.valueSchema.json(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; } else { return { transformedKey: parsedKey, - transform: (propertyValue) => - property.json(propertyValue, { + transform: (propertyValue) => { + const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey]; + return property.json(propertyValue, { ...opts, - breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), parsedKey], - }), + breadcrumbsPrefix: childBreadcrumbs, + }); + }, }; } }, unrecognizedObjectKeys: opts?.unrecognizedObjectKeys, skipValidation: opts?.skipValidation, - breadcrumbsPrefix: opts?.breadcrumbsPrefix, + breadcrumbsPrefix, omitUndefined: opts?.omitUndefined, }); }, @@ -152,6 +208,7 @@ export function object({ value, requiredKeys, + requiredKeysSet, getProperty, unrecognizedObjectKeys = "fail", skipValidation = false, @@ -159,6 +216,7 @@ function validateAndTransformObject({ }: { value: unknown; requiredKeys: string[]; + requiredKeysSet: Set; getProperty: ( preTransformedKey: string, ) => { transformedKey: string; transform: (propertyValue: object) => MaybeValid } | undefined; @@ -179,15 +237,23 @@ function validateAndTransformObject({ }; } - const missingRequiredKeys = new Set(requiredKeys); + // Track which required keys have been seen. + // Use a counter instead of copying the Set to avoid per-call allocation. + let missingRequiredCount = requiredKeys.length; const errors: ValidationError[] = []; const transformed: Record = {}; - for (const [preTransformedKey, preTransformedItemValue] of Object.entries(value)) { + for (const preTransformedKey in value) { + if (!_hasOwn.call(value, preTransformedKey)) { + continue; + } + const preTransformedItemValue = value[preTransformedKey]; const property = getProperty(preTransformedKey); if (property != null) { - missingRequiredKeys.delete(preTransformedKey); + if (missingRequiredCount > 0 && requiredKeysSet.has(preTransformedKey)) { + missingRequiredCount--; + } const value = property.transform(preTransformedItemValue as object); if (value.ok) { @@ -213,14 +279,16 @@ function validateAndTransformObject({ } } - errors.push( - ...requiredKeys - .filter((key) => missingRequiredKeys.has(key)) - .map((key) => ({ - path: breadcrumbsPrefix, - message: `Missing required key "${key}"`, - })), - ); + if (missingRequiredCount > 0) { + for (const key of requiredKeys) { + if (!(key in (value as Record))) { + errors.push({ + path: breadcrumbsPrefix, + message: `Missing required key "${key}"`, + }); + } + } + } if (errors.length === 0 || skipValidation) { return { @@ -270,6 +338,8 @@ export function getObjectUtils(schema: BaseObjectSchema { + const knownRawKeys = new Set(schema._getRawProperties() as string[]); + const knownParsedKeys = new Set(schema._getParsedProperties() as string[]); const baseSchema: BaseObjectSchema = { _getParsedProperties: () => schema._getParsedProperties(), @@ -279,10 +349,18 @@ export function getObjectUtils(schema: BaseObjectSchema = {}; + if (typeof raw === "object" && raw != null) { + for (const [key, value] of Object.entries(raw)) { + if (!knownRawKeys.has(key)) { + extraProperties[key] = value; + } + } + } return { ok: true, value: { - ...(raw as any), + ...extraProperties, ...transformed.value, }, }; @@ -292,10 +370,18 @@ export function getObjectUtils(schema: BaseObjectSchema = {}; + if (typeof parsed === "object" && parsed != null) { + for (const [key, value] of Object.entries(parsed)) { + if (!knownParsedKeys.has(key)) { + extraProperties[key] = value; + } + } + } return { ok: true, value: { - ...(parsed as any), + ...extraProperties, ...transformed.value, }, }; diff --git a/src/core/schemas/builders/object/types.ts b/src/core/schemas/builders/object/types.ts index 57f874869..2ed5e473a 100644 --- a/src/core/schemas/builders/object/types.ts +++ b/src/core/schemas/builders/object/types.ts @@ -23,9 +23,8 @@ export interface ObjectUtils { export type inferRawObject> = O extends ObjectSchema ? Raw : never; -export type inferParsedObject> = O extends ObjectSchema - ? Parsed - : never; +export type inferParsedObject> = + O extends ObjectSchema ? Parsed : never; export type inferObjectSchemaFromPropertySchemas> = ObjectSchema< inferRawObjectFromPropertySchemas, @@ -47,25 +46,11 @@ export type PropertySchemas = Recor Property | Schema >; -export type inferRawPropertySchema

| Schema> = P extends Property< - any, - infer Raw, - any -> - ? Raw - : P extends Schema - ? inferRaw

- : never; +export type inferRawPropertySchema

| Schema> = + P extends Property ? Raw : P extends Schema ? inferRaw

: never; -export type inferParsedPropertySchema

| Schema> = P extends Property< - any, - any, - infer Parsed -> - ? Parsed - : P extends Schema - ? inferParsed

- : never; +export type inferParsedPropertySchema

| Schema> = + P extends Property ? Parsed : P extends Schema ? inferParsed

: never; export type inferRawKey< ParsedKey extends string | number | symbol, diff --git a/src/core/schemas/builders/record/index.ts b/src/core/schemas/builders/record/index.ts index 82e25c5c2..cbd9b7e6e 100644 --- a/src/core/schemas/builders/record/index.ts +++ b/src/core/schemas/builders/record/index.ts @@ -1,2 +1,2 @@ -export { record } from "./record"; -export type { BaseRecordSchema, RecordSchema } from "./types"; +export { partialRecord, record } from "./record"; +export type { BasePartialRecordSchema, BaseRecordSchema, PartialRecordSchema, RecordSchema } from "./types"; diff --git a/src/core/schemas/builders/record/record.ts b/src/core/schemas/builders/record/record.ts index ba5307a6a..446f690ba 100644 --- a/src/core/schemas/builders/record/record.ts +++ b/src/core/schemas/builders/record/record.ts @@ -1,10 +1,12 @@ import { type MaybeValid, type Schema, SchemaType, type ValidationError } from "../../Schema"; -import { entries } from "../../utils/entries"; import { getErrorMessageForIncorrectType } from "../../utils/getErrorMessageForIncorrectType"; import { isPlainObject } from "../../utils/isPlainObject"; import { maybeSkipValidation } from "../../utils/maybeSkipValidation"; import { getSchemaUtils } from "../schema-utils/index"; -import type { BaseRecordSchema, RecordSchema } from "./types"; +import type { BasePartialRecordSchema, BaseRecordSchema, PartialRecordSchema, RecordSchema } from "./types"; + +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; export function record( keySchema: Schema, @@ -54,6 +56,54 @@ export function record( + keySchema: Schema, + valueSchema: Schema, +): PartialRecordSchema { + const baseSchema: BasePartialRecordSchema = { + parse: (raw, opts) => { + return validateAndTransformRecord({ + value: raw, + isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, + transformKey: (key) => + keySchema.parse(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.parse(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + json: (parsed, opts) => { + return validateAndTransformRecord({ + value: parsed, + isKeyNumeric: keySchema.getType() === SchemaType.NUMBER, + transformKey: (key) => + keySchema.json(key, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key} (key)`], + }), + transformValue: (value, key) => + valueSchema.json(value, { + ...opts, + breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `${key}`], + }), + breadcrumbsPrefix: opts?.breadcrumbsPrefix, + }); + }, + getType: () => SchemaType.RECORD, + }; + + return { + ...maybeSkipValidation(baseSchema), + ...getSchemaUtils(baseSchema), + }; +} + function validateAndTransformRecord({ value, isKeyNumeric, @@ -79,51 +129,42 @@ function validateAndTransformRecord>>( - (accPromise, [stringKey, value]) => { - if (value === undefined) { - return accPromise; - } + const result = {} as Record; + const errors: ValidationError[] = []; - const acc = accPromise; + for (const stringKey in value) { + if (!_hasOwn.call(value, stringKey)) { + continue; + } + const entryValue = (value as Record)[stringKey]; + if (entryValue === undefined) { + continue; + } - let key: string | number = stringKey; - if (isKeyNumeric) { - const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; - if (!Number.isNaN(numberKey)) { - key = numberKey; - } + let key: string | number = stringKey; + if (isKeyNumeric) { + const numberKey = stringKey.length > 0 ? Number(stringKey) : NaN; + if (!Number.isNaN(numberKey)) { + key = numberKey; } - const transformedKey = transformKey(key); - - const transformedValue = transformValue(value, key); + } + const transformedKey = transformKey(key); + const transformedValue = transformValue(entryValue, key); - if (acc.ok && transformedKey.ok && transformedValue.ok) { - return { - ok: true, - value: { - ...acc.value, - [transformedKey.value]: transformedValue.value, - }, - }; - } - - const errors: ValidationError[] = []; - if (!acc.ok) { - errors.push(...acc.errors); - } + if (transformedKey.ok && transformedValue.ok) { + result[transformedKey.value] = transformedValue.value; + } else { if (!transformedKey.ok) { errors.push(...transformedKey.errors); } if (!transformedValue.ok) { errors.push(...transformedValue.errors); } + } + } - return { - ok: false, - errors, - }; - }, - { ok: true, value: {} as Record }, - ); + if (errors.length === 0) { + return { ok: true, value: result }; + } + return { ok: false, errors }; } diff --git a/src/core/schemas/builders/record/types.ts b/src/core/schemas/builders/record/types.ts index b99bb9d87..2216e2e67 100644 --- a/src/core/schemas/builders/record/types.ts +++ b/src/core/schemas/builders/record/types.ts @@ -15,3 +15,18 @@ export type BaseRecordSchema< ParsedKey extends string | number, ParsedValue, > = BaseSchema, Record>; + +export type PartialRecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue, +> = BasePartialRecordSchema & + SchemaUtils, Partial>>; + +export type BasePartialRecordSchema< + RawKey extends string | number, + RawValue, + ParsedKey extends string | number, + ParsedValue, +> = BaseSchema, Partial>>; diff --git a/src/core/schemas/builders/union/union.ts b/src/core/schemas/builders/union/union.ts index 7da4271a2..b324fa2de 100644 --- a/src/core/schemas/builders/union/union.ts +++ b/src/core/schemas/builders/union/union.ts @@ -16,6 +16,9 @@ import type { UnionSubtypes, } from "./types"; +// eslint-disable-next-line @typescript-eslint/unbound-method +const _hasOwn = Object.prototype.hasOwnProperty; + export function union, U extends UnionSubtypes>( discriminant: D, union: U, @@ -112,7 +115,13 @@ function transformAndValidateUnion< }; } - const { [discriminant]: discriminantValue, ...additionalProperties } = value; + const discriminantValue = value[discriminant]; + const additionalProperties: Record = {}; + for (const key in value) { + if (_hasOwn.call(value, key) && key !== discriminant) { + additionalProperties[key] = value[key]; + } + } if (discriminantValue == null) { return { diff --git a/src/core/schemas/utils/isPlainObject.ts b/src/core/schemas/utils/isPlainObject.ts index db82a722c..32a17e05f 100644 --- a/src/core/schemas/utils/isPlainObject.ts +++ b/src/core/schemas/utils/isPlainObject.ts @@ -4,14 +4,11 @@ export function isPlainObject(value: unknown): value is Record return false; } - if (Object.getPrototypeOf(value) === null) { + const proto = Object.getPrototypeOf(value); + if (proto === null) { return true; } - let proto = value; - while (Object.getPrototypeOf(proto) !== null) { - proto = Object.getPrototypeOf(proto); - } - - return Object.getPrototypeOf(value) === proto; + // Check that the prototype chain has exactly one level (i.e., proto is Object.prototype) + return Object.getPrototypeOf(proto) === null; } diff --git a/src/version.ts b/src/version.ts index c0898d1cc..df19fdee5 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "44.0.0"; +export const SDK_VERSION = "44.0.1"; diff --git a/tests/mock-server/mockEndpointBuilder.ts b/tests/mock-server/mockEndpointBuilder.ts index 78985e721..3e8540a3b 100644 --- a/tests/mock-server/mockEndpointBuilder.ts +++ b/tests/mock-server/mockEndpointBuilder.ts @@ -2,7 +2,7 @@ import { type DefaultBodyType, type HttpHandler, HttpResponse, type HttpResponse import { url } from "../../src/core"; import { toJson } from "../../src/core/json"; -import { withFormUrlEncoded } from "./withFormUrlEncoded"; +import { type WithFormUrlEncodedOptions, withFormUrlEncoded } from "./withFormUrlEncoded"; import { withHeaders } from "./withHeaders"; import { type WithJsonOptions, withJson } from "./withJson"; @@ -27,7 +27,7 @@ interface RequestHeadersStage extends RequestBodyStage, ResponseStage { interface RequestBodyStage extends ResponseStage { jsonBody(body: unknown, options?: WithJsonOptions): ResponseStage; - formUrlEncodedBody(body: unknown): ResponseStage; + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage; } interface ResponseStage { @@ -44,6 +44,7 @@ interface ResponseHeaderStage extends ResponseBodyStage, BuildStage { interface ResponseBodyStage { jsonBody(body: unknown): BuildStage; + sseBody(body: string): BuildStage; } interface BuildStage { @@ -137,13 +138,13 @@ class RequestBuilder implements MethodStage, RequestHeadersStage, RequestBodySta return this; } - formUrlEncodedBody(body: unknown): ResponseStage { + formUrlEncodedBody(body: unknown, options?: WithFormUrlEncodedOptions): ResponseStage { if (body === undefined) { throw new Error( "Undefined is not valid for form-urlencoded. Do not call formUrlEncodedBody if you want an empty body.", ); } - this.predicates.push((resolver) => withFormUrlEncoded(body, resolver)); + this.predicates.push((resolver) => withFormUrlEncoded(body, resolver, options)); return this; } @@ -201,6 +202,12 @@ class ResponseBuilder implements ResponseStatusStage, ResponseHeaderStage, Respo return this; } + public sseBody(body: string): BuildStage { + this.responseHeaders["Content-Type"] = "text/event-stream"; + this.responseBody = body; + return this; + } + public build(): HttpHandler { const responseResolver: HttpResponseResolver = () => { const response = new HttpResponse(this.responseBody, { diff --git a/tests/mock-server/withFormUrlEncoded.ts b/tests/mock-server/withFormUrlEncoded.ts index e250cb3c0..2b23448e3 100644 --- a/tests/mock-server/withFormUrlEncoded.ts +++ b/tests/mock-server/withFormUrlEncoded.ts @@ -2,12 +2,26 @@ import { type HttpResponseResolver, passthrough } from "msw"; import { toJson } from "../../src/core/json"; +export interface WithFormUrlEncodedOptions { + /** + * List of field names to ignore when comparing request bodies. + * This is useful for pagination cursor fields that change between requests. + */ + ignoredFields?: string[]; +} + /** * Creates a request matcher that validates if the request form-urlencoded body exactly matches the expected object * @param expectedBody - The exact body object to match against * @param resolver - Response resolver to execute if body matches + * @param options - Optional configuration including fields to ignore */ -export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponseResolver): HttpResponseResolver { +export function withFormUrlEncoded( + expectedBody: unknown, + resolver: HttpResponseResolver, + options?: WithFormUrlEncodedOptions, +): HttpResponseResolver { + const ignoredFields = options?.ignoredFields ?? []; return async (args) => { const { request } = args; @@ -41,7 +55,8 @@ export function withFormUrlEncoded(expectedBody: unknown, resolver: HttpResponse } const mismatches = findMismatches(actualBody, expectedBody); - if (Object.keys(mismatches).length > 0) { + const filteredMismatches = Object.keys(mismatches).filter((key) => !ignoredFields.includes(key)); + if (filteredMismatches.length > 0) { console.error("Form-urlencoded body mismatch:", toJson(mismatches, undefined, 2)); return passthrough(); } diff --git a/tests/tsconfig.json b/tests/tsconfig.json index fe83070d2..bc43b6c40 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -2,8 +2,7 @@ "extends": "../tsconfig.json", "compilerOptions": { "outDir": null, - "rootDir": "..", - "baseUrl": ".." + "rootDir": ".." }, "include": ["../src", "../tests"], "exclude": [] diff --git a/tests/unit/fetcher/makeRequest.test.ts b/tests/unit/fetcher/makeRequest.test.ts index 43ed9d11b..f6f039a29 100644 --- a/tests/unit/fetcher/makeRequest.test.ts +++ b/tests/unit/fetcher/makeRequest.test.ts @@ -1,4 +1,8 @@ -import { makeRequest } from "../../../src/core/fetcher/makeRequest"; +import { + isCacheNoStoreSupported, + makeRequest, + resetCacheNoStoreSupported, +} from "../../../src/core/fetcher/makeRequest"; describe("Test makeRequest", () => { const mockPostUrl = "https://httpbin.org/post"; @@ -11,6 +15,7 @@ describe("Test makeRequest", () => { beforeEach(() => { mockFetch = jest.fn(); mockFetch.mockResolvedValue(new Response(JSON.stringify({ test: "successful" }), { status: 200 })); + resetCacheNoStoreSupported(); }); it("should handle POST request correctly", async () => { @@ -50,4 +55,103 @@ describe("Test makeRequest", () => { expect(calledOptions.signal).toBeDefined(); expect(calledOptions.signal).toBeInstanceOf(AbortSignal); }); + + it("should not include cache option when disableCache is not set", async () => { + await makeRequest(mockFetch, mockGetUrl, "GET", mockHeaders, undefined); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should not include cache option when disableCache is false", async () => { + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + false, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + }); + + it("should include cache: no-store when disableCache is true and runtime supports it", async () => { + // In Node.js test environment, Request supports the cache option + expect(isCacheNoStoreSupported()).toBe(true); + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBe("no-store"); + }); + + it("should cache the result of isCacheNoStoreSupported", () => { + const first = isCacheNoStoreSupported(); + const second = isCacheNoStoreSupported(); + expect(first).toBe(second); + }); + + it("should reset cache detection state with resetCacheNoStoreSupported", () => { + // First call caches the result + const first = isCacheNoStoreSupported(); + expect(first).toBe(true); + + // Reset clears the cache + resetCacheNoStoreSupported(); + + // After reset, it should re-detect (and still return true in Node.js) + const second = isCacheNoStoreSupported(); + expect(second).toBe(true); + }); + + it("should not include cache option when runtime does not support it (e.g. Cloudflare Workers)", async () => { + // Mock Request constructor to throw when cache option is passed, + // simulating runtimes like Cloudflare Workers + const OriginalRequest = globalThis.Request; + globalThis.Request = class MockRequest { + constructor(_url: string, init?: RequestInit) { + if (init?.cache != null) { + throw new TypeError("The 'cache' field on 'RequestInitializerDict' is not implemented."); + } + } + } as unknown as typeof Request; + + try { + // Reset so the detection runs fresh with the mocked Request + resetCacheNoStoreSupported(); + expect(isCacheNoStoreSupported()).toBe(false); + + await makeRequest( + mockFetch, + mockGetUrl, + "GET", + mockHeaders, + undefined, + undefined, + undefined, + undefined, + undefined, + true, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.cache).toBeUndefined(); + } finally { + // Restore original Request + globalThis.Request = OriginalRequest; + resetCacheNoStoreSupported(); + } + }); }); diff --git a/tests/unit/file/file.test.ts b/tests/unit/file/file.test.ts index 51a8bc463..6acb74de1 100644 --- a/tests/unit/file/file.test.ts +++ b/tests/unit/file/file.test.ts @@ -5,6 +5,7 @@ import { toBinaryUploadRequest, type Uploadable } from "../../../src/core/file/i describe("toBinaryUploadRequest", () => { const TEST_FILE_PATH = join(__dirname, "..", "test-file.txt"); + const TEST_FILE_SIZE = fs.statSync(TEST_FILE_PATH).size.toString(); beforeEach(() => { jest.clearAllMocks(); @@ -377,7 +378,7 @@ describe("toBinaryUploadRequest", () => { expect(result.headers).toEqual({ "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path "Content-Type": "text/plain", - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + "Content-Length": TEST_FILE_SIZE, // Should determine from file system (OS-agnostic) }); }); @@ -391,7 +392,7 @@ describe("toBinaryUploadRequest", () => { expect(result.body).toBeInstanceOf(fs.ReadStream); expect(result.headers).toEqual({ "Content-Disposition": 'attachment; filename="test-file.txt"', // Should extract from path - "Content-Length": "21", // Should determine from file system (test file is 21 bytes) + "Content-Length": TEST_FILE_SIZE, // Should determine from file system (OS-agnostic) }); }); }); diff --git a/tests/unit/form-data-utils/formDataWrapper.test.ts b/tests/unit/form-data-utils/formDataWrapper.test.ts index 28c9f9bba..0822f91a5 100644 --- a/tests/unit/form-data-utils/formDataWrapper.test.ts +++ b/tests/unit/form-data-utils/formDataWrapper.test.ts @@ -92,7 +92,7 @@ describe("CrossPlatformFormData", () => { for await (const chunk of request.body) { data += decoder.decode(chunk); } - expect(data).toContain(`Content-Disposition: form-data; name=\"file\"; filename=\"${expectedFileName}\"`); + expect(data).toContain(`Content-Disposition: form-data; name="file"; filename="${expectedFileName}"`); }); }); diff --git a/tests/wire/applePay.test.ts b/tests/wire/applePay.test.ts index 6cdf02664..7b1cd86f9 100644 --- a/tests/wire/applePay.test.ts +++ b/tests/wire/applePay.test.ts @@ -12,6 +12,7 @@ describe("ApplePayClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], status: "VERIFIED", }; + server .mockEndpoint() .post("/v2/apple-pay/domains") diff --git a/tests/wire/bankAccounts.test.ts b/tests/wire/bankAccounts.test.ts index ce4e74617..78af1b550 100644 --- a/tests/wire/bankAccounts.test.ts +++ b/tests/wire/bankAccounts.test.ts @@ -54,6 +54,7 @@ describe("BankAccountsClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/bank-accounts") @@ -159,6 +160,7 @@ describe("BankAccountsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bank-accounts") @@ -232,6 +234,7 @@ describe("BankAccountsClient", () => { customer_id: "customer_id", }, }; + server .mockEndpoint() .get("/v2/bank-accounts/by-v1-id/v1_bank_account_id") @@ -302,6 +305,7 @@ describe("BankAccountsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bank-accounts/bank_account_id") @@ -372,6 +376,7 @@ describe("BankAccountsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bank-accounts/bank_account_id/disable") diff --git a/tests/wire/bookings.test.ts b/tests/wire/bookings.test.ts index ebabd5061..2032eb5d4 100644 --- a/tests/wire/bookings.test.ts +++ b/tests/wire/bookings.test.ts @@ -37,6 +37,7 @@ describe("BookingsClient", () => { ], errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server.mockEndpoint().get("/v2/bookings").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const expected = { @@ -140,6 +141,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings") @@ -434,6 +436,7 @@ describe("BookingsClient", () => { ], errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/availability/search") @@ -745,6 +748,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/bulk-retrieve") @@ -868,6 +872,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bookings/business-booking-profile") @@ -927,6 +932,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bookings/location-booking-profiles/location_id") @@ -983,6 +989,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/team-member-booking-profiles/bulk-retrieve") @@ -1096,6 +1103,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bookings/booking_id") @@ -1216,6 +1224,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/bookings/booking_id") @@ -1338,6 +1347,7 @@ describe("BookingsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/booking_id/cancel") diff --git a/tests/wire/bookings/customAttributeDefinitions.test.ts b/tests/wire/bookings/customAttributeDefinitions.test.ts index aab6e0aca..aefccb8e2 100644 --- a/tests/wire/bookings/customAttributeDefinitions.test.ts +++ b/tests/wire/bookings/customAttributeDefinitions.test.ts @@ -38,6 +38,7 @@ describe("CustomAttributeDefinitionsClient", () => { cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/bookings/custom-attribute-definitions") @@ -113,6 +114,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/custom-attribute-definitions") @@ -168,6 +170,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bookings/custom-attribute-definitions/key") @@ -223,6 +226,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/bookings/custom-attribute-definitions/key") @@ -267,6 +271,7 @@ describe("CustomAttributeDefinitionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/bookings/custom-attribute-definitions/key") diff --git a/tests/wire/bookings/customAttributes.test.ts b/tests/wire/bookings/customAttributes.test.ts index 1d17c090d..1847284f4 100644 --- a/tests/wire/bookings/customAttributes.test.ts +++ b/tests/wire/bookings/customAttributes.test.ts @@ -25,6 +25,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/custom-attributes/bulk-delete") @@ -152,6 +153,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/bookings/custom-attributes/bulk-upsert") @@ -294,6 +296,7 @@ describe("CustomAttributesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/bookings/booking_id/custom-attributes") @@ -369,6 +372,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bookings/booking_id/custom-attributes/key") @@ -440,6 +444,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/bookings/booking_id/custom-attributes/key") @@ -493,6 +498,7 @@ describe("CustomAttributesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/bookings/booking_id/custom-attributes/key") diff --git a/tests/wire/bookings/locationProfiles.test.ts b/tests/wire/bookings/locationProfiles.test.ts index 92ae16404..3edcbd1ab 100644 --- a/tests/wire/bookings/locationProfiles.test.ts +++ b/tests/wire/bookings/locationProfiles.test.ts @@ -20,6 +20,7 @@ describe("LocationProfilesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/bookings/location-booking-profiles") diff --git a/tests/wire/bookings/teamMemberProfiles.test.ts b/tests/wire/bookings/teamMemberProfiles.test.ts index e824ad876..7fe8f68b4 100644 --- a/tests/wire/bookings/teamMemberProfiles.test.ts +++ b/tests/wire/bookings/teamMemberProfiles.test.ts @@ -28,6 +28,7 @@ describe("TeamMemberProfilesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/bookings/team-member-booking-profiles") @@ -90,6 +91,7 @@ describe("TeamMemberProfilesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/bookings/team-member-booking-profiles/team_member_id") diff --git a/tests/wire/cards.test.ts b/tests/wire/cards.test.ts index b0718d4d1..581a4a2b3 100644 --- a/tests/wire/cards.test.ts +++ b/tests/wire/cards.test.ts @@ -45,6 +45,7 @@ describe("CardsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/cards") @@ -173,6 +174,7 @@ describe("CardsClient", () => { hsa_fsa: false, }, }; + server .mockEndpoint() .post("/v2/cards") @@ -296,6 +298,7 @@ describe("CardsClient", () => { hsa_fsa: false, }, }; + server.mockEndpoint().get("/v2/cards/card_id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.cards.get({ @@ -398,6 +401,7 @@ describe("CardsClient", () => { hsa_fsa: false, }, }; + server .mockEndpoint() .post("/v2/cards/card_id/disable") diff --git a/tests/wire/cashDrawers/shifts.test.ts b/tests/wire/cashDrawers/shifts.test.ts index c5cbbf20c..b461556b6 100644 --- a/tests/wire/cashDrawers/shifts.test.ts +++ b/tests/wire/cashDrawers/shifts.test.ts @@ -28,6 +28,7 @@ describe("ShiftsClient", () => { }, ], }; + server .mockEndpoint({ once: false }) .get("/v2/cash-drawers/shifts") @@ -117,6 +118,7 @@ describe("ShiftsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/cash-drawers/shifts/shift_id") @@ -246,6 +248,7 @@ describe("ShiftsClient", () => { }, ], }; + server .mockEndpoint({ once: false }) .get("/v2/cash-drawers/shifts/shift_id/events") diff --git a/tests/wire/catalog.test.ts b/tests/wire/catalog.test.ts index bb0c1c9ae..996aa7d3e 100644 --- a/tests/wire/catalog.test.ts +++ b/tests/wire/catalog.test.ts @@ -13,6 +13,7 @@ describe("CatalogClient", () => { deleted_object_ids: ["W62UWFY35CWMYGVWK6TWJDNI", "AA27W3M2GGTF3H6AVPNB77CK"], deleted_at: "2016-11-16T22:25:24.878Z", }; + server .mockEndpoint() .post("/v2/catalog/batch-delete") @@ -106,6 +107,7 @@ describe("CatalogClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/catalog/batch-retrieve") @@ -280,6 +282,7 @@ describe("CatalogClient", () => { { client_object_id: "#Coffee_Large", object_id: "JE6VHPSRQL6IWSN26C36CJ7W" }, ], }; + server .mockEndpoint() .post("/v2/catalog/batch-upsert") @@ -441,6 +444,7 @@ describe("CatalogClient", () => { }, standard_unit_description_group: { standard_unit_descriptions: [{}], language_code: "language_code" }, }; + server.mockEndpoint().get("/v2/catalog/info").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.catalog.info(); @@ -510,6 +514,7 @@ describe("CatalogClient", () => { }, ], }; + server .mockEndpoint({ once: false }) .get("/v2/catalog/list") @@ -630,6 +635,7 @@ describe("CatalogClient", () => { ], latest_time: "latest_time", }; + server .mockEndpoint() .post("/v2/catalog/search") @@ -750,6 +756,7 @@ describe("CatalogClient", () => { cursor: "cursor", matched_variation_ids: ["VBJNPHCOKDFECR6VU25WRJUD"], }; + server .mockEndpoint() .post("/v2/catalog/search-catalog-items") @@ -831,6 +838,7 @@ describe("CatalogClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], updated_at: "2016-11-16T22:25:24.878Z", }; + server .mockEndpoint() .post("/v2/catalog/update-item-modifier-lists") @@ -870,6 +878,7 @@ describe("CatalogClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], updated_at: "2016-11-16T22:25:24.878Z", }; + server .mockEndpoint() .post("/v2/catalog/update-item-taxes") diff --git a/tests/wire/catalog/object.test.ts b/tests/wire/catalog/object.test.ts index 4225ec38f..a0240adea 100644 --- a/tests/wire/catalog/object.test.ts +++ b/tests/wire/catalog/object.test.ts @@ -56,6 +56,7 @@ describe("ObjectClient", () => { { client_object_id: "#Large", object_id: "NS77DKEIQ3AEQTCP727DSA7U" }, ], }; + server .mockEndpoint() .post("/v2/catalog/object") @@ -214,6 +215,7 @@ describe("ObjectClient", () => { }, ], }; + server .mockEndpoint() .get("/v2/catalog/object/object_id") @@ -325,6 +327,7 @@ describe("ObjectClient", () => { deleted_object_ids: ["7SB3ZQYJ5GDMVFL7JK46JCHT", "KQLFFHA6K6J3YQAQAWDQAL57"], deleted_at: "2016-11-16T22:25:24.878Z", }; + server .mockEndpoint() .delete("/v2/catalog/object/object_id") diff --git a/tests/wire/channels.test.ts b/tests/wire/channels.test.ts index 17abe8c51..6ab7620f2 100644 --- a/tests/wire/channels.test.ts +++ b/tests/wire/channels.test.ts @@ -24,6 +24,7 @@ describe("ChannelsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/channels") @@ -108,6 +109,7 @@ describe("ChannelsClient", () => { NOT_EXISTING: { errors: [{ category: "API_ERROR", code: "NOT_FOUND" }] }, }, }; + server .mockEndpoint() .post("/v2/channels/bulk-retrieve") @@ -201,6 +203,7 @@ describe("ChannelsClient", () => { updated_at: "2022-10-25T16:48:00Z", }, }; + server .mockEndpoint() .get("/v2/channels/channel_id") diff --git a/tests/wire/checkout.test.ts b/tests/wire/checkout.test.ts index ed4cbf351..c6c90eb1d 100644 --- a/tests/wire/checkout.test.ts +++ b/tests/wire/checkout.test.ts @@ -25,6 +25,7 @@ describe("CheckoutClient", () => { updated_at: "2022-06-16T22:25:35Z", }, }; + server .mockEndpoint() .get("/v2/online-checkout/location-settings/location_id") @@ -102,6 +103,7 @@ describe("CheckoutClient", () => { updated_at: "2022-06-16T22:25:35Z", }, }; + server .mockEndpoint() .put("/v2/online-checkout/location-settings/location_id") @@ -183,6 +185,7 @@ describe("CheckoutClient", () => { updated_at: "2022-06-16T22:25:35Z", }, }; + server .mockEndpoint() .get("/v2/online-checkout/merchant-settings") @@ -263,6 +266,7 @@ describe("CheckoutClient", () => { updated_at: "2022-06-16T22:25:35Z", }, }; + server .mockEndpoint() .put("/v2/online-checkout/merchant-settings") diff --git a/tests/wire/checkout/paymentLinks.test.ts b/tests/wire/checkout/paymentLinks.test.ts index 89bc7d651..c0bd13f5f 100644 --- a/tests/wire/checkout/paymentLinks.test.ts +++ b/tests/wire/checkout/paymentLinks.test.ts @@ -37,6 +37,7 @@ describe("PaymentLinksClient", () => { ], cursor: "MTY1NQ==", }; + server .mockEndpoint({ once: false }) .get("/v2/online-checkout/payment-links") @@ -172,6 +173,7 @@ describe("PaymentLinksClient", () => { subscription_plans: [{ type: "ITEM", id: "id" }], }, }; + server .mockEndpoint() .post("/v2/online-checkout/payment-links") @@ -368,6 +370,7 @@ describe("PaymentLinksClient", () => { payment_note: "payment_note", }, }; + server .mockEndpoint() .get("/v2/online-checkout/payment-links/id") @@ -453,6 +456,7 @@ describe("PaymentLinksClient", () => { payment_note: "test", }, }; + server .mockEndpoint() .put("/v2/online-checkout/payment-links/id") @@ -524,6 +528,7 @@ describe("PaymentLinksClient", () => { id: "MQASNYL6QB6DFCJ3", cancelled_order_id: "asx8LgZ6MRzD0fObfkJ6obBmSh4F", }; + server .mockEndpoint() .delete("/v2/online-checkout/payment-links/id") diff --git a/tests/wire/customers.test.ts b/tests/wire/customers.test.ts index 5ed145dca..a0a4ca045 100644 --- a/tests/wire/customers.test.ts +++ b/tests/wire/customers.test.ts @@ -42,6 +42,7 @@ describe("CustomersClient", () => { cursor: "cursor", count: BigInt(1000000), }; + server .mockEndpoint({ once: false }) .get("/v2/customers") @@ -165,6 +166,7 @@ describe("CustomersClient", () => { tax_ids: { eu_vat: "eu_vat" }, }, }; + server .mockEndpoint() .post("/v2/customers") @@ -336,6 +338,7 @@ describe("CustomersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/bulk-create") @@ -481,6 +484,7 @@ describe("CustomersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/bulk-delete") @@ -581,6 +585,7 @@ describe("CustomersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/bulk-retrieve") @@ -706,6 +711,7 @@ describe("CustomersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/bulk-update") @@ -862,6 +868,7 @@ describe("CustomersClient", () => { cursor: "9dpS093Uy12AzeE", count: BigInt(1000000), }; + server .mockEndpoint() .post("/v2/customers/search") @@ -1013,6 +1020,7 @@ describe("CustomersClient", () => { tax_ids: { eu_vat: "eu_vat" }, }, }; + server .mockEndpoint() .get("/v2/customers/customer_id") @@ -1123,6 +1131,7 @@ describe("CustomersClient", () => { tax_ids: { eu_vat: "eu_vat" }, }, }; + server .mockEndpoint() .put("/v2/customers/customer_id") @@ -1197,6 +1206,7 @@ describe("CustomersClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/customers/customer_id") diff --git a/tests/wire/customers/cards.test.ts b/tests/wire/customers/cards.test.ts index cda7710b6..b8a446959 100644 --- a/tests/wire/customers/cards.test.ts +++ b/tests/wire/customers/cards.test.ts @@ -61,6 +61,7 @@ describe("CardsClient", () => { hsa_fsa: true, }, }; + server .mockEndpoint() .post("/v2/customers/customer_id/cards") @@ -141,6 +142,7 @@ describe("CardsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/customers/customer_id/cards/card_id") diff --git a/tests/wire/customers/customAttributeDefinitions.test.ts b/tests/wire/customers/customAttributeDefinitions.test.ts index fb4680123..f0d8d9859 100644 --- a/tests/wire/customers/customAttributeDefinitions.test.ts +++ b/tests/wire/customers/customAttributeDefinitions.test.ts @@ -38,6 +38,7 @@ describe("CustomAttributeDefinitionsClient", () => { cursor: "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/customers/custom-attribute-definitions") @@ -123,6 +124,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/custom-attribute-definitions") @@ -186,6 +188,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/customers/custom-attribute-definitions/key") @@ -246,6 +249,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/customers/custom-attribute-definitions/key") @@ -293,6 +297,7 @@ describe("CustomAttributeDefinitionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/customers/custom-attribute-definitions/key") @@ -411,6 +416,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/custom-attributes/bulk-upsert") diff --git a/tests/wire/customers/customAttributes.test.ts b/tests/wire/customers/customAttributes.test.ts index 29ac31498..3fc2ea52b 100644 --- a/tests/wire/customers/customAttributes.test.ts +++ b/tests/wire/customers/customAttributes.test.ts @@ -30,6 +30,7 @@ describe("CustomAttributesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/customers/customer_id/custom-attributes") @@ -105,6 +106,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/customers/customer_id/custom-attributes/key") @@ -176,6 +178,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/customers/customer_id/custom-attributes/key") @@ -231,6 +234,7 @@ describe("CustomAttributesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/customers/customer_id/custom-attributes/key") diff --git a/tests/wire/customers/groups.test.ts b/tests/wire/customers/groups.test.ts index 232b8ee80..20e0683f0 100644 --- a/tests/wire/customers/groups.test.ts +++ b/tests/wire/customers/groups.test.ts @@ -26,6 +26,7 @@ describe("GroupsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/customers/groups") @@ -83,6 +84,7 @@ describe("GroupsClient", () => { updated_at: "2020-04-13T21:54:58Z", }, }; + server .mockEndpoint() .post("/v2/customers/groups") @@ -128,6 +130,7 @@ describe("GroupsClient", () => { updated_at: "2020-04-13T21:54:58Z", }, }; + server .mockEndpoint() .get("/v2/customers/groups/group_id") @@ -170,6 +173,7 @@ describe("GroupsClient", () => { updated_at: "2020-04-13T21:54:58Z", }, }; + server .mockEndpoint() .put("/v2/customers/groups/group_id") @@ -210,6 +214,7 @@ describe("GroupsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/customers/groups/group_id") @@ -240,6 +245,7 @@ describe("GroupsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/customers/customer_id/groups/group_id") @@ -271,6 +277,7 @@ describe("GroupsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/customers/customer_id/groups/group_id") diff --git a/tests/wire/customers/segments.test.ts b/tests/wire/customers/segments.test.ts index fc67dc35a..5894c38c1 100644 --- a/tests/wire/customers/segments.test.ts +++ b/tests/wire/customers/segments.test.ts @@ -38,6 +38,7 @@ describe("SegmentsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/customers/segments") @@ -107,6 +108,7 @@ describe("SegmentsClient", () => { updated_at: "2020-04-13T23:01:13Z", }, }; + server .mockEndpoint() .get("/v2/customers/segments/segment_id") diff --git a/tests/wire/devices.test.ts b/tests/wire/devices.test.ts index 983dc0711..6c6f81b8c 100644 --- a/tests/wire/devices.test.ts +++ b/tests/wire/devices.test.ts @@ -94,6 +94,7 @@ describe("DevicesClient", () => { ], cursor: "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", }; + server .mockEndpoint({ once: false }) .get("/v2/devices") @@ -286,6 +287,7 @@ describe("DevicesClient", () => { status: { category: "AVAILABLE" }, }, }; + server .mockEndpoint() .get("/v2/devices/device_id") diff --git a/tests/wire/devices/codes.test.ts b/tests/wire/devices/codes.test.ts index a401ad505..75b0de664 100644 --- a/tests/wire/devices/codes.test.ts +++ b/tests/wire/devices/codes.test.ts @@ -40,6 +40,7 @@ describe("CodesClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/devices/codes") @@ -123,6 +124,7 @@ describe("CodesClient", () => { paired_at: "paired_at", }, }; + server .mockEndpoint() .post("/v2/devices/codes") @@ -185,6 +187,7 @@ describe("CodesClient", () => { paired_at: "paired_at", }, }; + server .mockEndpoint() .get("/v2/devices/codes/id") diff --git a/tests/wire/disputes.test.ts b/tests/wire/disputes.test.ts index 808c0af0a..ccdb85eb2 100644 --- a/tests/wire/disputes.test.ts +++ b/tests/wire/disputes.test.ts @@ -50,6 +50,7 @@ describe("DisputesClient", () => { ], cursor: "G1aSTRm48CLjJsg6Sg3hQN1b1OMaoVuG", }; + server .mockEndpoint({ once: false }) .get("/v2/disputes") @@ -154,6 +155,7 @@ describe("DisputesClient", () => { location_id: "L1HN3ZMQK64X9", }, }; + server .mockEndpoint() .get("/v2/disputes/dispute_id") @@ -225,6 +227,7 @@ describe("DisputesClient", () => { location_id: "L1HN3ZMQK64X9", }, }; + server .mockEndpoint() .post("/v2/disputes/dispute_id/accept") @@ -291,6 +294,7 @@ describe("DisputesClient", () => { evidence_type: "REBUTTAL_EXPLANATION", }, }; + server .mockEndpoint() .post("/v2/disputes/dispute_id/evidence-text") @@ -355,6 +359,7 @@ describe("DisputesClient", () => { location_id: "LSY8XKGSMMX94", }, }; + server .mockEndpoint() .post("/v2/disputes/dispute_id/submit-evidence") diff --git a/tests/wire/disputes/evidence.test.ts b/tests/wire/disputes/evidence.test.ts index 8147f78b6..120e68ea3 100644 --- a/tests/wire/disputes/evidence.test.ts +++ b/tests/wire/disputes/evidence.test.ts @@ -32,6 +32,7 @@ describe("EvidenceClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/disputes/dispute_id/evidence") @@ -104,6 +105,7 @@ describe("EvidenceClient", () => { evidence_type: "CARDHOLDER_COMMUNICATION", }, }; + server .mockEndpoint() .get("/v2/disputes/dispute_id/evidence/evidence_id") @@ -147,6 +149,7 @@ describe("EvidenceClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/disputes/dispute_id/evidence/evidence_id") diff --git a/tests/wire/employees.test.ts b/tests/wire/employees.test.ts index a11e297e6..b2cac47f3 100644 --- a/tests/wire/employees.test.ts +++ b/tests/wire/employees.test.ts @@ -26,6 +26,7 @@ describe("EmployeesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/employees") @@ -91,6 +92,7 @@ describe("EmployeesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server.mockEndpoint().get("/v2/employees/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.employees.get({ diff --git a/tests/wire/events.test.ts b/tests/wire/events.test.ts index e28083774..09343a2a6 100644 --- a/tests/wire/events.test.ts +++ b/tests/wire/events.test.ts @@ -43,6 +43,7 @@ describe("EventsClient", () => { metadata: [{ event_id: "73ecd468-0aba-424f-b862-583d44efe7c8", api_version: "2022-12-13" }], cursor: "6b571fc9773647f=", }; + server .mockEndpoint() .post("/v2/events") @@ -114,6 +115,7 @@ describe("EventsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server.mockEndpoint().put("/v2/events/disable").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.events.disableEvents(); @@ -136,6 +138,7 @@ describe("EventsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server.mockEndpoint().put("/v2/events/enable").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.events.enableEvents(); @@ -166,6 +169,7 @@ describe("EventsClient", () => { }, ], }; + server.mockEndpoint().get("/v2/events/types").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.events.listEventTypes({ diff --git a/tests/wire/giftCards.test.ts b/tests/wire/giftCards.test.ts index f877a33d2..7c5866532 100644 --- a/tests/wire/giftCards.test.ts +++ b/tests/wire/giftCards.test.ts @@ -34,6 +34,7 @@ describe("GiftCardsClient", () => { ], cursor: "JbFmyvUpaNKsfC1hoLSA4WlqkgkZXTWeKuStajR5BkP7OE0ETAbeWSi6U6u7sH", }; + server .mockEndpoint({ once: false }) .get("/v2/gift-cards") @@ -116,6 +117,7 @@ describe("GiftCardsClient", () => { customer_ids: ["customer_ids"], }, }; + server .mockEndpoint() .post("/v2/gift-cards") @@ -174,6 +176,7 @@ describe("GiftCardsClient", () => { customer_ids: ["customer_ids"], }, }; + server .mockEndpoint() .post("/v2/gift-cards/from-gan") @@ -228,6 +231,7 @@ describe("GiftCardsClient", () => { customer_ids: ["customer_ids"], }, }; + server .mockEndpoint() .post("/v2/gift-cards/from-nonce") @@ -282,6 +286,7 @@ describe("GiftCardsClient", () => { customer_ids: ["GKY0FZ3V717AH8Q2D821PNT2ZW"], }, }; + server .mockEndpoint() .post("/v2/gift-cards/gift_card_id/link-customer") @@ -337,6 +342,7 @@ describe("GiftCardsClient", () => { customer_ids: ["customer_ids"], }, }; + server .mockEndpoint() .post("/v2/gift-cards/gift_card_id/unlink-customer") @@ -392,6 +398,7 @@ describe("GiftCardsClient", () => { customer_ids: ["customer_ids"], }, }; + server.mockEndpoint().get("/v2/gift-cards/id").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.giftCards.get({ diff --git a/tests/wire/giftCards/activities.test.ts b/tests/wire/giftCards/activities.test.ts index 202f8f995..c3e4b3f9e 100644 --- a/tests/wire/giftCards/activities.test.ts +++ b/tests/wire/giftCards/activities.test.ts @@ -73,6 +73,7 @@ describe("ActivitiesClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/gift-cards/activities") @@ -298,6 +299,7 @@ describe("ActivitiesClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/gift-cards/activities") diff --git a/tests/wire/inventory.test.ts b/tests/wire/inventory.test.ts index 5129dd56b..36c996201 100644 --- a/tests/wire/inventory.test.ts +++ b/tests/wire/inventory.test.ts @@ -41,6 +41,7 @@ describe("InventoryClient", () => { }, }, }; + server .mockEndpoint() .get("/v2/inventory/adjustment/adjustment_id") @@ -134,6 +135,7 @@ describe("InventoryClient", () => { }, }, }; + server .mockEndpoint() .get("/v2/inventory/adjustments/adjustment_id") @@ -226,6 +228,7 @@ describe("InventoryClient", () => { ], changes: [{ type: "PHYSICAL_COUNT", measurement_unit_id: "measurement_unit_id" }], }; + server .mockEndpoint() .post("/v2/inventory/batch-change") @@ -320,6 +323,7 @@ describe("InventoryClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/inventory/batch-retrieve-changes") @@ -396,6 +400,7 @@ describe("InventoryClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/inventory/batch-retrieve-counts") @@ -470,6 +475,7 @@ describe("InventoryClient", () => { ], changes: [{ type: "PHYSICAL_COUNT", measurement_unit_id: "measurement_unit_id" }], }; + server .mockEndpoint() .post("/v2/inventory/changes/batch-create") @@ -564,6 +570,7 @@ describe("InventoryClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .post("/v2/inventory/changes/batch-retrieve") @@ -645,6 +652,7 @@ describe("InventoryClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .post("/v2/inventory/counts/batch-retrieve") @@ -713,6 +721,7 @@ describe("InventoryClient", () => { created_at: "2016-11-16T22:25:24.878Z", }, }; + server .mockEndpoint() .get("/v2/inventory/physical-count/physical_count_id") @@ -779,6 +788,7 @@ describe("InventoryClient", () => { created_at: "2016-11-16T22:25:24.878Z", }, }; + server .mockEndpoint() .get("/v2/inventory/physical-counts/physical_count_id") @@ -846,6 +856,7 @@ describe("InventoryClient", () => { team_member_id: "LRK57NSQ5X7PUD05", }, }; + server .mockEndpoint() .get("/v2/inventory/transfers/transfer_id") @@ -907,6 +918,7 @@ describe("InventoryClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/inventory/catalog_object_id") @@ -983,6 +995,7 @@ describe("InventoryClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/inventory/catalog_object_id/changes") diff --git a/tests/wire/invoices.test.ts b/tests/wire/invoices.test.ts index 139927a93..8cc1c9bbb 100644 --- a/tests/wire/invoices.test.ts +++ b/tests/wire/invoices.test.ts @@ -148,6 +148,7 @@ describe("InvoicesClient", () => { cursor: "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/invoices") @@ -442,6 +443,7 @@ describe("InvoicesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/invoices") @@ -731,6 +733,7 @@ describe("InvoicesClient", () => { cursor: "ChoIDhIWVm54ZVRhLXhySFBOejBBM2xJb2daUQoFCI4IGAE", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/invoices/search") @@ -985,6 +988,7 @@ describe("InvoicesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/invoices/invoice_id") @@ -1152,6 +1156,7 @@ describe("InvoicesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/invoices/invoice_id") @@ -1263,6 +1268,7 @@ describe("InvoicesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/invoices/invoice_id") @@ -1294,6 +1300,7 @@ describe("InvoicesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/invoices/invoice_id/attachments/attachment_id") @@ -1386,6 +1393,7 @@ describe("InvoicesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/invoices/invoice_id/cancel") @@ -1557,6 +1565,7 @@ describe("InvoicesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/invoices/invoice_id/publish") diff --git a/tests/wire/labor.test.ts b/tests/wire/labor.test.ts index 14c2c941c..55bde3b5c 100644 --- a/tests/wire/labor.test.ts +++ b/tests/wire/labor.test.ts @@ -50,6 +50,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/scheduled-shifts") @@ -159,6 +160,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/scheduled-shifts/bulk-publish") @@ -262,6 +264,7 @@ describe("LaborClient", () => { cursor: "xoxp-123-2123-123232", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/scheduled-shifts/search") @@ -348,6 +351,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/labor/scheduled-shifts/id") @@ -443,6 +447,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/labor/scheduled-shifts/id") @@ -542,6 +547,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/scheduled-shifts/id/publish") @@ -652,6 +658,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/timecards") @@ -830,6 +837,7 @@ describe("LaborClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/timecards/search") @@ -987,6 +995,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/labor/timecards/id") @@ -1109,6 +1118,7 @@ describe("LaborClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/labor/timecards/id") @@ -1207,6 +1217,7 @@ describe("LaborClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/labor/timecards/id") diff --git a/tests/wire/labor/breakTypes.test.ts b/tests/wire/labor/breakTypes.test.ts index 26d693d71..d2c2c1f0e 100644 --- a/tests/wire/labor/breakTypes.test.ts +++ b/tests/wire/labor/breakTypes.test.ts @@ -34,6 +34,7 @@ describe("BreakTypesClient", () => { cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/labor/break-types") @@ -112,6 +113,7 @@ describe("BreakTypesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/break-types") @@ -169,6 +171,7 @@ describe("BreakTypesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/labor/break-types/id") @@ -227,6 +230,7 @@ describe("BreakTypesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/labor/break-types/id") @@ -275,6 +279,7 @@ describe("BreakTypesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/labor/break-types/id") diff --git a/tests/wire/labor/employeeWages.test.ts b/tests/wire/labor/employeeWages.test.ts index 20b255e15..cf065b1c2 100644 --- a/tests/wire/labor/employeeWages.test.ts +++ b/tests/wire/labor/employeeWages.test.ts @@ -38,6 +38,7 @@ describe("EmployeeWagesClient", () => { cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/labor/employee-wages") @@ -120,6 +121,7 @@ describe("EmployeeWagesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/labor/employee-wages/id") diff --git a/tests/wire/labor/shifts.test.ts b/tests/wire/labor/shifts.test.ts index 56086aaa4..6e2cf23f9 100644 --- a/tests/wire/labor/shifts.test.ts +++ b/tests/wire/labor/shifts.test.ts @@ -62,6 +62,7 @@ describe("ShiftsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/shifts") @@ -243,6 +244,7 @@ describe("ShiftsClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/labor/shifts/search") @@ -403,6 +405,7 @@ describe("ShiftsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/labor/shifts/id") @@ -526,6 +529,7 @@ describe("ShiftsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/labor/shifts/id") @@ -624,6 +628,7 @@ describe("ShiftsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/labor/shifts/id") diff --git a/tests/wire/labor/teamMemberWages.test.ts b/tests/wire/labor/teamMemberWages.test.ts index f1b95d065..47bdbafde 100644 --- a/tests/wire/labor/teamMemberWages.test.ts +++ b/tests/wire/labor/teamMemberWages.test.ts @@ -46,6 +46,7 @@ describe("TeamMemberWagesClient", () => { cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/labor/team-member-wages") @@ -138,6 +139,7 @@ describe("TeamMemberWagesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/labor/team-member-wages/id") diff --git a/tests/wire/labor/workweekConfigs.test.ts b/tests/wire/labor/workweekConfigs.test.ts index 0b110a0c0..f9415ef6b 100644 --- a/tests/wire/labor/workweekConfigs.test.ts +++ b/tests/wire/labor/workweekConfigs.test.ts @@ -22,6 +22,7 @@ describe("WorkweekConfigsClient", () => { cursor: "2fofTniCgT0yIPAq26kmk0YyFQJZfbWkh73OOnlTHmTAx13NgED", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/labor/workweek-configs") @@ -79,6 +80,7 @@ describe("WorkweekConfigsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/labor/workweek-configs/id") diff --git a/tests/wire/locations.test.ts b/tests/wire/locations.test.ts index 7b0a51148..b6bbcfb35 100644 --- a/tests/wire/locations.test.ts +++ b/tests/wire/locations.test.ts @@ -77,6 +77,7 @@ describe("LocationsClient", () => { }, ], }; + server.mockEndpoint().get("/v2/locations").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.locations.list(); @@ -229,6 +230,7 @@ describe("LocationsClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/locations") @@ -374,6 +376,7 @@ describe("LocationsClient", () => { }, }, }; + server .mockEndpoint() .get("/v2/locations/location_id") @@ -526,6 +529,7 @@ describe("LocationsClient", () => { }, }, }; + server .mockEndpoint() .put("/v2/locations/location_id") @@ -823,6 +827,7 @@ describe("LocationsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/location_id/checkouts") diff --git a/tests/wire/locations/customAttributeDefinitions.test.ts b/tests/wire/locations/customAttributeDefinitions.test.ts index bc461d255..c0ffffa7c 100644 --- a/tests/wire/locations/customAttributeDefinitions.test.ts +++ b/tests/wire/locations/customAttributeDefinitions.test.ts @@ -38,6 +38,7 @@ describe("CustomAttributeDefinitionsClient", () => { cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/locations/custom-attribute-definitions") @@ -124,6 +125,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/custom-attribute-definitions") @@ -187,6 +189,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/locations/custom-attribute-definitions/key") @@ -247,6 +250,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/locations/custom-attribute-definitions/key") @@ -294,6 +298,7 @@ describe("CustomAttributeDefinitionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/locations/custom-attribute-definitions/key") diff --git a/tests/wire/locations/customAttributes.test.ts b/tests/wire/locations/customAttributes.test.ts index 4e9b19320..59cdee361 100644 --- a/tests/wire/locations/customAttributes.test.ts +++ b/tests/wire/locations/customAttributes.test.ts @@ -27,6 +27,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/custom-attributes/bulk-delete") @@ -141,6 +142,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/custom-attributes/bulk-upsert") @@ -266,6 +268,7 @@ describe("CustomAttributesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/locations/location_id/custom-attributes") @@ -342,6 +345,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/locations/location_id/custom-attributes/key") @@ -413,6 +417,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/location_id/custom-attributes/key") @@ -468,6 +473,7 @@ describe("CustomAttributesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/locations/location_id/custom-attributes/key") diff --git a/tests/wire/locations/transactions.test.ts b/tests/wire/locations/transactions.test.ts index c1a5e5bf9..a196aa4e4 100644 --- a/tests/wire/locations/transactions.test.ts +++ b/tests/wire/locations/transactions.test.ts @@ -67,6 +67,7 @@ describe("TransactionsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .get("/v2/locations/location_id/transactions") @@ -230,6 +231,7 @@ describe("TransactionsClient", () => { order_id: "order_id", }, }; + server .mockEndpoint() .get("/v2/locations/location_id/transactions/transaction_id") @@ -331,6 +333,7 @@ describe("TransactionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/location_id/transactions/transaction_id/capture") @@ -362,6 +365,7 @@ describe("TransactionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/locations/location_id/transactions/transaction_id/void") diff --git a/tests/wire/loyalty.test.ts b/tests/wire/loyalty.test.ts index ab052ec7a..123a6ec3d 100644 --- a/tests/wire/loyalty.test.ts +++ b/tests/wire/loyalty.test.ts @@ -65,6 +65,7 @@ describe("LoyaltyClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/loyalty/events/search") diff --git a/tests/wire/loyalty/accounts.test.ts b/tests/wire/loyalty/accounts.test.ts index a2fb805be..580c37342 100644 --- a/tests/wire/loyalty/accounts.test.ts +++ b/tests/wire/loyalty/accounts.test.ts @@ -33,6 +33,7 @@ describe("AccountsClient", () => { expiring_point_deadlines: [{ points: 1, expires_at: "expires_at" }], }, }; + server .mockEndpoint() .post("/v2/loyalty/accounts") @@ -110,6 +111,7 @@ describe("AccountsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/loyalty/accounts/search") @@ -188,6 +190,7 @@ describe("AccountsClient", () => { expiring_point_deadlines: [{ points: 1, expires_at: "expires_at" }], }, }; + server .mockEndpoint() .get("/v2/loyalty/accounts/account_id") @@ -286,6 +289,7 @@ describe("AccountsClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/loyalty/accounts/account_id/accumulate") @@ -425,6 +429,7 @@ describe("AccountsClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/loyalty/accounts/account_id/adjust") diff --git a/tests/wire/loyalty/programs.test.ts b/tests/wire/loyalty/programs.test.ts index 5d4c826c0..9effd96e0 100644 --- a/tests/wire/loyalty/programs.test.ts +++ b/tests/wire/loyalty/programs.test.ts @@ -46,6 +46,7 @@ describe("ProgramsClient", () => { }, ], }; + server .mockEndpoint() .get("/v2/loyalty/programs") @@ -150,6 +151,7 @@ describe("ProgramsClient", () => { ], }, }; + server .mockEndpoint() .get("/v2/loyalty/programs/program_id") @@ -226,6 +228,7 @@ describe("ProgramsClient", () => { points: 6, promotion_points: 12, }; + server .mockEndpoint() .post("/v2/loyalty/programs/program_id/calculate") diff --git a/tests/wire/loyalty/programs/promotions.test.ts b/tests/wire/loyalty/programs/promotions.test.ts index b69dac25c..9d08f92ee 100644 --- a/tests/wire/loyalty/programs/promotions.test.ts +++ b/tests/wire/loyalty/programs/promotions.test.ts @@ -64,6 +64,7 @@ describe("PromotionsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/loyalty/programs/program_id/promotions") @@ -209,6 +210,7 @@ describe("PromotionsClient", () => { qualifying_category_ids: ["XTQPYLR3IIU9C44VRCB3XD12"], }, }; + server .mockEndpoint() .post("/v2/loyalty/programs/program_id/promotions") @@ -325,6 +327,7 @@ describe("PromotionsClient", () => { qualifying_category_ids: ["qualifying_category_ids"], }, }; + server .mockEndpoint() .get("/v2/loyalty/programs/program_id/promotions/promotion_id") @@ -417,6 +420,7 @@ describe("PromotionsClient", () => { qualifying_category_ids: ["XTQPYLR3IIU9C44VRCB3XD12"], }, }; + server .mockEndpoint() .post("/v2/loyalty/programs/program_id/promotions/promotion_id/cancel") diff --git a/tests/wire/loyalty/rewards.test.ts b/tests/wire/loyalty/rewards.test.ts index a3aad78b5..377c64c45 100644 --- a/tests/wire/loyalty/rewards.test.ts +++ b/tests/wire/loyalty/rewards.test.ts @@ -29,6 +29,7 @@ describe("RewardsClient", () => { redeemed_at: "redeemed_at", }, }; + server .mockEndpoint() .post("/v2/loyalty/rewards") @@ -123,6 +124,7 @@ describe("RewardsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/loyalty/rewards/search") @@ -215,6 +217,7 @@ describe("RewardsClient", () => { redeemed_at: "2020-05-08T21:56:00Z", }, }; + server .mockEndpoint() .get("/v2/loyalty/rewards/reward_id") @@ -256,6 +259,7 @@ describe("RewardsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/loyalty/rewards/reward_id") @@ -314,6 +318,7 @@ describe("RewardsClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/loyalty/rewards/reward_id/redeem") diff --git a/tests/wire/merchants.test.ts b/tests/wire/merchants.test.ts index b73b6a118..0f3b89da9 100644 --- a/tests/wire/merchants.test.ts +++ b/tests/wire/merchants.test.ts @@ -24,6 +24,7 @@ describe("MerchantsClient", () => { ], cursor: 1, }; + server .mockEndpoint({ once: false }) .get("/v2/merchants") @@ -82,6 +83,7 @@ describe("MerchantsClient", () => { created_at: "2021-12-10T19:25:52.484Z", }, }; + server .mockEndpoint() .get("/v2/merchants/merchant_id") diff --git a/tests/wire/merchants/customAttributeDefinitions.test.ts b/tests/wire/merchants/customAttributeDefinitions.test.ts index 538d60d06..0a442e0eb 100644 --- a/tests/wire/merchants/customAttributeDefinitions.test.ts +++ b/tests/wire/merchants/customAttributeDefinitions.test.ts @@ -38,6 +38,7 @@ describe("CustomAttributeDefinitionsClient", () => { cursor: "ImfNzWVSiAYyiAR4gEcxDJ75KZAOSjX8H2BVHUTR0ofCtp4SdYvrUKbwYY2aCH2WqZ2FsfAuylEVUlTfaINg3ecIlFpP9Y5Ie66w9NSg9nqdI5fCJ6qdH2s0za5m2plFonsjIuFaoN89j78ROUwuSOzD6mFZPcJHhJ0CxEKc0SBH", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/merchants/custom-attribute-definitions") @@ -124,6 +125,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/merchants/custom-attribute-definitions") @@ -187,6 +189,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/merchants/custom-attribute-definitions/key") @@ -247,6 +250,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/merchants/custom-attribute-definitions/key") @@ -294,6 +298,7 @@ describe("CustomAttributeDefinitionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/merchants/custom-attribute-definitions/key") diff --git a/tests/wire/merchants/customAttributes.test.ts b/tests/wire/merchants/customAttributes.test.ts index b90cd452b..52e44f392 100644 --- a/tests/wire/merchants/customAttributes.test.ts +++ b/tests/wire/merchants/customAttributes.test.ts @@ -17,6 +17,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/merchants/custom-attributes/bulk-delete") @@ -107,6 +108,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/merchants/custom-attributes/bulk-upsert") @@ -208,6 +210,7 @@ describe("CustomAttributesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/merchants/merchant_id/custom-attributes") @@ -284,6 +287,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/merchants/merchant_id/custom-attributes/key") @@ -355,6 +359,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/merchants/merchant_id/custom-attributes/key") @@ -410,6 +415,7 @@ describe("CustomAttributesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/merchants/merchant_id/custom-attributes/key") diff --git a/tests/wire/oAuth.test.ts b/tests/wire/oAuth.test.ts index a515674c0..5f5af0d39 100644 --- a/tests/wire/oAuth.test.ts +++ b/tests/wire/oAuth.test.ts @@ -12,6 +12,7 @@ describe("OAuthClient", () => { success: true, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/oauth2/revoke") @@ -60,6 +61,7 @@ describe("OAuthClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], refresh_token_expires_at: "refresh_token_expires_at", }; + server .mockEndpoint() .post("/oauth2/token") @@ -108,6 +110,7 @@ describe("OAuthClient", () => { merchant_id: "MERCHANT_ID", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/oauth2/token/status") diff --git a/tests/wire/orders.test.ts b/tests/wire/orders.test.ts index ccb7231a9..21a8733ac 100644 --- a/tests/wire/orders.test.ts +++ b/tests/wire/orders.test.ts @@ -195,6 +195,7 @@ describe("OrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders") @@ -624,6 +625,7 @@ describe("OrdersClient", () => { ], errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders/batch-retrieve") @@ -824,6 +826,7 @@ describe("OrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders/calculate") @@ -1237,6 +1240,7 @@ describe("OrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders/clone") @@ -1610,6 +1614,7 @@ describe("OrdersClient", () => { cursor: "123", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders/search") @@ -1810,6 +1815,7 @@ describe("OrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/orders/order_id") @@ -2116,6 +2122,7 @@ describe("OrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/orders/order_id") @@ -2432,6 +2439,7 @@ describe("OrdersClient", () => { net_amount_due_money: { amount: BigInt(1000000), currency: "UNKNOWN_CURRENCY" }, }, }; + server .mockEndpoint() .post("/v2/orders/order_id/pay") diff --git a/tests/wire/orders/customAttributeDefinitions.test.ts b/tests/wire/orders/customAttributeDefinitions.test.ts index 4564532cd..fa0c13748 100644 --- a/tests/wire/orders/customAttributeDefinitions.test.ts +++ b/tests/wire/orders/customAttributeDefinitions.test.ts @@ -50,6 +50,7 @@ describe("CustomAttributeDefinitionsClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/orders/custom-attribute-definitions") @@ -149,6 +150,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders/custom-attribute-definitions") @@ -213,6 +215,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/orders/custom-attribute-definitions/key") @@ -271,6 +274,7 @@ describe("CustomAttributeDefinitionsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/orders/custom-attribute-definitions/key") @@ -320,6 +324,7 @@ describe("CustomAttributeDefinitionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/orders/custom-attribute-definitions/key") diff --git a/tests/wire/orders/customAttributes.test.ts b/tests/wire/orders/customAttributes.test.ts index e62d62380..f09270c16 100644 --- a/tests/wire/orders/customAttributes.test.ts +++ b/tests/wire/orders/customAttributes.test.ts @@ -20,6 +20,7 @@ describe("CustomAttributesClient", () => { "table-number": { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR" }] }, }, }; + server .mockEndpoint() .post("/v2/orders/custom-attributes/bulk-delete") @@ -111,6 +112,7 @@ describe("CustomAttributesClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/orders/custom-attributes/bulk-upsert") @@ -202,6 +204,7 @@ describe("CustomAttributesClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/orders/order_id/custom-attributes") @@ -270,6 +273,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/orders/order_id/custom-attributes/custom_attribute_key") @@ -341,6 +345,7 @@ describe("CustomAttributesClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/orders/order_id/custom-attributes/custom_attribute_key") @@ -398,6 +403,7 @@ describe("CustomAttributesClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/orders/order_id/custom-attributes/custom_attribute_key") diff --git a/tests/wire/payments.test.ts b/tests/wire/payments.test.ts index 0ef972646..0bef74988 100644 --- a/tests/wire/payments.test.ts +++ b/tests/wire/payments.test.ts @@ -78,6 +78,7 @@ describe("PaymentsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/payments") @@ -350,6 +351,7 @@ describe("PaymentsClient", () => { version_token: "TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o", }, }; + server .mockEndpoint() .post("/v2/payments") @@ -578,6 +580,7 @@ describe("PaymentsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/payments/cancel") @@ -744,6 +747,7 @@ describe("PaymentsClient", () => { version_token: "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o", }, }; + server .mockEndpoint() .get("/v2/payments/payment_id") @@ -1099,6 +1103,7 @@ describe("PaymentsClient", () => { version_token: "rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o", }, }; + server .mockEndpoint() .put("/v2/payments/payment_id") @@ -1453,6 +1458,7 @@ describe("PaymentsClient", () => { version_token: "N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o", }, }; + server .mockEndpoint() .post("/v2/payments/payment_id/cancel") @@ -1801,6 +1807,7 @@ describe("PaymentsClient", () => { version_token: "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o", }, }; + server .mockEndpoint() .post("/v2/payments/payment_id/complete") diff --git a/tests/wire/payouts.test.ts b/tests/wire/payouts.test.ts index 40fe8ebe0..070430966 100644 --- a/tests/wire/payouts.test.ts +++ b/tests/wire/payouts.test.ts @@ -48,6 +48,7 @@ describe("PayoutsClient", () => { cursor: "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/payouts") @@ -152,6 +153,7 @@ describe("PayoutsClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/payouts/payout_id") @@ -228,6 +230,7 @@ describe("PayoutsClient", () => { cursor: "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .get("/v2/payouts/payout_id/payout-entries") diff --git a/tests/wire/refunds.test.ts b/tests/wire/refunds.test.ts index fb7aa7f87..ce1958ad4 100644 --- a/tests/wire/refunds.test.ts +++ b/tests/wire/refunds.test.ts @@ -36,6 +36,7 @@ describe("RefundsClient", () => { ], cursor: "5evquW1YswHoT4EoyUhzMmTsCnsSXBU9U0WJ4FU4623nrMQcocH0RGU6Up1YkwfiMcF59ood58EBTEGgzMTGHQJpocic7ExOL0NtrTXCeWcv0UJIJNk8eXb", }; + server .mockEndpoint({ once: false }) .get("/v2/refunds") @@ -139,6 +140,7 @@ describe("RefundsClient", () => { terminal_refund_id: "terminal_refund_id", }, }; + server .mockEndpoint() .post("/v2/refunds") @@ -239,6 +241,7 @@ describe("RefundsClient", () => { terminal_refund_id: "terminal_refund_id", }, }; + server .mockEndpoint() .get("/v2/refunds/refund_id") diff --git a/tests/wire/sites.test.ts b/tests/wire/sites.test.ts index 17dd33d54..1c56ac87f 100644 --- a/tests/wire/sites.test.ts +++ b/tests/wire/sites.test.ts @@ -29,6 +29,7 @@ describe("SitesClient", () => { }, ], }; + server.mockEndpoint().get("/v2/sites").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.sites.list(); diff --git a/tests/wire/snippets.test.ts b/tests/wire/snippets.test.ts index 4f5e9dd40..1cb6d9719 100644 --- a/tests/wire/snippets.test.ts +++ b/tests/wire/snippets.test.ts @@ -18,6 +18,7 @@ describe("SnippetsClient", () => { updated_at: "2021-03-11T25:40:09.000000Z", }, }; + server .mockEndpoint() .get("/v2/sites/site_id/snippet") @@ -62,6 +63,7 @@ describe("SnippetsClient", () => { updated_at: "2021-03-11T25:40:09.000000Z", }, }; + server .mockEndpoint() .post("/v2/sites/site_id/snippet") @@ -103,6 +105,7 @@ describe("SnippetsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/sites/site_id/snippet") diff --git a/tests/wire/subscriptions.test.ts b/tests/wire/subscriptions.test.ts index a2d4ee64a..bf4c21e72 100644 --- a/tests/wire/subscriptions.test.ts +++ b/tests/wire/subscriptions.test.ts @@ -50,6 +50,7 @@ describe("SubscriptionsClient", () => { completed_date: "completed_date", }, }; + server .mockEndpoint() .post("/v2/subscriptions") @@ -135,6 +136,7 @@ describe("SubscriptionsClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], affected_subscriptions: 12, }; + server .mockEndpoint() .post("/v2/subscriptions/bulk-swap-plan") @@ -251,6 +253,7 @@ describe("SubscriptionsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/subscriptions/search") @@ -393,6 +396,7 @@ describe("SubscriptionsClient", () => { completed_date: "completed_date", }, }; + server .mockEndpoint() .get("/v2/subscriptions/subscription_id") @@ -473,6 +477,7 @@ describe("SubscriptionsClient", () => { completed_date: "completed_date", }, }; + server .mockEndpoint() .put("/v2/subscriptions/subscription_id") @@ -556,6 +561,7 @@ describe("SubscriptionsClient", () => { completed_date: "completed_date", }, }; + server .mockEndpoint() .delete("/v2/subscriptions/subscription_id/actions/action_id") @@ -653,6 +659,7 @@ describe("SubscriptionsClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/subscriptions/subscription_id/billing-anchor") @@ -761,6 +768,7 @@ describe("SubscriptionsClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/subscriptions/subscription_id/cancel") @@ -891,6 +899,7 @@ describe("SubscriptionsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/subscriptions/subscription_id/events") @@ -1030,6 +1039,7 @@ describe("SubscriptionsClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/subscriptions/subscription_id/pause") @@ -1144,6 +1154,7 @@ describe("SubscriptionsClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/subscriptions/subscription_id/resume") @@ -1261,6 +1272,7 @@ describe("SubscriptionsClient", () => { }, ], }; + server .mockEndpoint() .post("/v2/subscriptions/subscription_id/swap-plan") diff --git a/tests/wire/team.test.ts b/tests/wire/team.test.ts index b5e8959b4..d5789e18b 100644 --- a/tests/wire/team.test.ts +++ b/tests/wire/team.test.ts @@ -30,6 +30,7 @@ describe("TeamClient", () => { cursor: "cursor", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/team-members/jobs") @@ -90,6 +91,7 @@ describe("TeamClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/team-members/jobs") @@ -141,6 +143,7 @@ describe("TeamClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/team-members/jobs/job_id") @@ -187,6 +190,7 @@ describe("TeamClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/team-members/jobs/job_id") diff --git a/tests/wire/teamMembers.test.ts b/tests/wire/teamMembers.test.ts index ab00d9046..ddc7cf7b1 100644 --- a/tests/wire/teamMembers.test.ts +++ b/tests/wire/teamMembers.test.ts @@ -80,6 +80,7 @@ describe("TeamMembersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/team-members") @@ -252,6 +253,7 @@ describe("TeamMembersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/team-members/bulk-create") @@ -421,6 +423,7 @@ describe("TeamMembersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/team-members/bulk-update") @@ -747,6 +750,7 @@ describe("TeamMembersClient", () => { cursor: "N:9UglUjOXQ13-hMFypCft", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/team-members/search") @@ -1080,6 +1084,7 @@ describe("TeamMembersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/team-members/team_member_id") @@ -1226,6 +1231,7 @@ describe("TeamMembersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/team-members/team_member_id") diff --git a/tests/wire/teamMembers/wageSetting.test.ts b/tests/wire/teamMembers/wageSetting.test.ts index 6ef7b1a35..9f08f8339 100644 --- a/tests/wire/teamMembers/wageSetting.test.ts +++ b/tests/wire/teamMembers/wageSetting.test.ts @@ -27,6 +27,7 @@ describe("WageSettingClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/team-members/team_member_id/wage-setting") @@ -117,6 +118,7 @@ describe("WageSettingClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/team-members/team_member_id/wage-setting") diff --git a/tests/wire/terminal.test.ts b/tests/wire/terminal.test.ts index 43a025ccc..817f4302e 100644 --- a/tests/wire/terminal.test.ts +++ b/tests/wire/terminal.test.ts @@ -57,6 +57,7 @@ describe("TerminalClient", () => { await_next_action_duration: "PT5M", }, }; + server .mockEndpoint() .post("/v2/terminals/actions/action_id/dismiss") @@ -198,6 +199,7 @@ describe("TerminalClient", () => { tip_money: { amount: BigInt(1000000), currency: "UNKNOWN_CURRENCY" }, }, }; + server .mockEndpoint() .post("/v2/terminals/checkouts/checkout_id/dismiss") @@ -292,6 +294,7 @@ describe("TerminalClient", () => { location_id: "location_id", }, }; + server .mockEndpoint() .post("/v2/terminals/refunds/terminal_refund_id/dismiss") diff --git a/tests/wire/terminal/actions.test.ts b/tests/wire/terminal/actions.test.ts index 86aeedc30..2cd9be57b 100644 --- a/tests/wire/terminal/actions.test.ts +++ b/tests/wire/terminal/actions.test.ts @@ -64,6 +64,7 @@ describe("ActionsClient", () => { await_next_action_duration: "await_next_action_duration", }, }; + server .mockEndpoint() .post("/v2/terminals/actions") @@ -237,6 +238,7 @@ describe("ActionsClient", () => { ], cursor: "CURSOR", }; + server .mockEndpoint() .post("/v2/terminals/actions/search") @@ -427,6 +429,7 @@ describe("ActionsClient", () => { await_next_action_duration: "await_next_action_duration", }, }; + server .mockEndpoint() .get("/v2/terminals/actions/action_id") @@ -575,6 +578,7 @@ describe("ActionsClient", () => { await_next_action_duration: "await_next_action_duration", }, }; + server .mockEndpoint() .post("/v2/terminals/actions/action_id/cancel") diff --git a/tests/wire/terminal/checkouts.test.ts b/tests/wire/terminal/checkouts.test.ts index efadf6ed0..ab1218787 100644 --- a/tests/wire/terminal/checkouts.test.ts +++ b/tests/wire/terminal/checkouts.test.ts @@ -54,6 +54,7 @@ describe("CheckoutsClient", () => { tip_money: { amount: BigInt(1000000), currency: "UNKNOWN_CURRENCY" }, }, }; + server .mockEndpoint() .post("/v2/terminals/checkouts") @@ -193,6 +194,7 @@ describe("CheckoutsClient", () => { ], cursor: "RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH", }; + server .mockEndpoint() .post("/v2/terminals/checkouts/search") @@ -325,6 +327,7 @@ describe("CheckoutsClient", () => { tip_money: { amount: BigInt(1000000), currency: "UNKNOWN_CURRENCY" }, }, }; + server .mockEndpoint() .get("/v2/terminals/checkouts/checkout_id") @@ -436,6 +439,7 @@ describe("CheckoutsClient", () => { tip_money: { amount: BigInt(1000000), currency: "UNKNOWN_CURRENCY" }, }, }; + server .mockEndpoint() .post("/v2/terminals/checkouts/checkout_id/cancel") diff --git a/tests/wire/terminal/refunds.test.ts b/tests/wire/terminal/refunds.test.ts index 15e8556b6..60750e3c8 100644 --- a/tests/wire/terminal/refunds.test.ts +++ b/tests/wire/terminal/refunds.test.ts @@ -35,6 +35,7 @@ describe("RefundsClient", () => { location_id: "76C9W6K8CNNQ5", }, }; + server .mockEndpoint() .post("/v2/terminals/refunds") @@ -113,6 +114,7 @@ describe("RefundsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/terminals/refunds/search") @@ -187,6 +189,7 @@ describe("RefundsClient", () => { location_id: "76C9W6K8CNNQ5", }, }; + server .mockEndpoint() .get("/v2/terminals/refunds/terminal_refund_id") @@ -252,6 +255,7 @@ describe("RefundsClient", () => { location_id: "76C9W6K8CNNQ5", }, }; + server .mockEndpoint() .post("/v2/terminals/refunds/terminal_refund_id/cancel") diff --git a/tests/wire/transferOrders.test.ts b/tests/wire/transferOrders.test.ts index 3def5d6ba..4e3f1ab45 100644 --- a/tests/wire/transferOrders.test.ts +++ b/tests/wire/transferOrders.test.ts @@ -59,6 +59,7 @@ describe("TransferOrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/transfer-orders") @@ -206,6 +207,7 @@ describe("TransferOrdersClient", () => { cursor: "eyJsYXN0X3VwZGF0ZWRfYXQiOjE3NTMxMTU1NDBfMTIzfQ==", errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint({ once: false }) .post("/v2/transfer-orders/search") @@ -341,6 +343,7 @@ describe("TransferOrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .get("/v2/transfer-orders/transfer_order_id") @@ -454,6 +457,7 @@ describe("TransferOrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .put("/v2/transfer-orders/transfer_order_id") @@ -542,6 +546,7 @@ describe("TransferOrdersClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/transfer-orders/transfer_order_id") @@ -610,6 +615,7 @@ describe("TransferOrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/transfer-orders/transfer_order_id/cancel") @@ -725,6 +731,7 @@ describe("TransferOrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/transfer-orders/transfer_order_id/receive") @@ -841,6 +848,7 @@ describe("TransferOrdersClient", () => { }, errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/transfer-orders/transfer_order_id/start") diff --git a/tests/wire/v1Transactions.test.ts b/tests/wire/v1Transactions.test.ts index 462f78c8e..887779c8c 100644 --- a/tests/wire/v1Transactions.test.ts +++ b/tests/wire/v1Transactions.test.ts @@ -65,6 +65,7 @@ describe("V1TransactionsClient", () => { btc_price_satoshi: 1.1, }, ]; + server .mockEndpoint() .get("/v1/location_id/orders") @@ -221,6 +222,7 @@ describe("V1TransactionsClient", () => { btc_receive_address: "btc_receive_address", btc_price_satoshi: 1.1, }; + server .mockEndpoint() .get("/v1/location_id/orders/order_id") @@ -396,6 +398,7 @@ describe("V1TransactionsClient", () => { btc_receive_address: "btc_receive_address", btc_price_satoshi: 1.1, }; + server .mockEndpoint() .put("/v1/location_id/orders/order_id") diff --git a/tests/wire/vendors.test.ts b/tests/wire/vendors.test.ts index 438095418..07cfdaf65 100644 --- a/tests/wire/vendors.test.ts +++ b/tests/wire/vendors.test.ts @@ -67,6 +67,7 @@ describe("VendorsClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/vendors/bulk-create") @@ -189,6 +190,7 @@ describe("VendorsClient", () => { }, }, }; + server .mockEndpoint() .post("/v2/vendors/bulk-retrieve") @@ -318,6 +320,7 @@ describe("VendorsClient", () => { }, }, }; + server .mockEndpoint() .put("/v2/vendors/bulk-update") @@ -483,6 +486,7 @@ describe("VendorsClient", () => { status: "ACTIVE", }, }; + server .mockEndpoint() .post("/v2/vendors/create") @@ -600,6 +604,7 @@ describe("VendorsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint() .post("/v2/vendors/search") @@ -694,6 +699,7 @@ describe("VendorsClient", () => { status: "ACTIVE", }, }; + server .mockEndpoint() .get("/v2/vendors/vendor_id") @@ -802,6 +808,7 @@ describe("VendorsClient", () => { status: "ACTIVE", }, }; + server .mockEndpoint() .put("/v2/vendors/vendor_id") diff --git a/tests/wire/webhooks/eventTypes.test.ts b/tests/wire/webhooks/eventTypes.test.ts index bb8deaa8b..ffbbdae4e 100644 --- a/tests/wire/webhooks/eventTypes.test.ts +++ b/tests/wire/webhooks/eventTypes.test.ts @@ -19,6 +19,7 @@ describe("EventTypesClient", () => { }, ], }; + server .mockEndpoint() .get("/v2/webhooks/event-types") diff --git a/tests/wire/webhooks/subscriptions.test.ts b/tests/wire/webhooks/subscriptions.test.ts index ebf758bde..ef7f57712 100644 --- a/tests/wire/webhooks/subscriptions.test.ts +++ b/tests/wire/webhooks/subscriptions.test.ts @@ -25,6 +25,7 @@ describe("SubscriptionsClient", () => { ], cursor: "cursor", }; + server .mockEndpoint({ once: false }) .get("/v2/webhooks/subscriptions") @@ -96,6 +97,7 @@ describe("SubscriptionsClient", () => { updated_at: "2022-01-10 23:29:48 +0000 UTC", }, }; + server .mockEndpoint() .post("/v2/webhooks/subscriptions") @@ -155,6 +157,7 @@ describe("SubscriptionsClient", () => { updated_at: "2022-01-10 23:29:48 +0000 UTC", }, }; + server .mockEndpoint() .get("/v2/webhooks/subscriptions/subscription_id") @@ -207,6 +210,7 @@ describe("SubscriptionsClient", () => { updated_at: "2022-01-10 23:45:51 +0000 UTC", }, }; + server .mockEndpoint() .put("/v2/webhooks/subscriptions/subscription_id") @@ -253,6 +257,7 @@ describe("SubscriptionsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .delete("/v2/webhooks/subscriptions/subscription_id") @@ -284,6 +289,7 @@ describe("SubscriptionsClient", () => { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], signature_key: "1k9bIJKCeTmSQwyagtNRLg", }; + server .mockEndpoint() .post("/v2/webhooks/subscriptions/subscription_id/signature-key") @@ -330,6 +336,7 @@ describe("SubscriptionsClient", () => { passes_filter: true, payload: { key: "value" }, }; + server .mockEndpoint() .post("/v2/webhooks/subscriptions/subscription_id/test") diff --git a/yarn.lock b/yarn.lock index de57c750b..9fa812b5f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -111,34 +111,34 @@ dependencies: tslib "^2.8.1" -"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.28.6.tgz#72499312ec58b1e2245ba4a4f550c132be4982f7" - integrity sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q== +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.28.6", "@babel/code-frame@^7.29.0": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.29.0.tgz#7cd7a59f15b3cc0dcd803038f7792712a7d0b15c" + integrity sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw== dependencies: "@babel/helper-validator-identifier" "^7.28.5" js-tokens "^4.0.0" picocolors "^1.1.1" "@babel/compat-data@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.28.6.tgz#103f466803fa0f059e82ccac271475470570d74c" - integrity sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg== + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.29.0.tgz#00d03e8c0ac24dd9be942c5370990cbe1f17d88d" + integrity sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg== "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.23.9": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.28.6.tgz#531bf883a1126e53501ba46eb3bb414047af507f" - integrity sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw== + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.29.0.tgz#5286ad785df7f79d656e88ce86e650d16ca5f322" + integrity sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA== dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/generator" "^7.28.6" + "@babel/code-frame" "^7.29.0" + "@babel/generator" "^7.29.0" "@babel/helper-compilation-targets" "^7.28.6" "@babel/helper-module-transforms" "^7.28.6" "@babel/helpers" "^7.28.6" - "@babel/parser" "^7.28.6" + "@babel/parser" "^7.29.0" "@babel/template" "^7.28.6" - "@babel/traverse" "^7.28.6" - "@babel/types" "^7.28.6" + "@babel/traverse" "^7.29.0" + "@babel/types" "^7.29.0" "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" @@ -146,13 +146,13 @@ json5 "^2.2.3" semver "^6.3.1" -"@babel/generator@^7.28.6", "@babel/generator@^7.7.2": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.28.6.tgz#48dcc65d98fcc8626a48f72b62e263d25fc3c3f1" - integrity sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw== +"@babel/generator@^7.29.0", "@babel/generator@^7.7.2": + version "7.29.1" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.1.tgz#d09876290111abbb00ef962a7b83a5307fba0d50" + integrity sha512-qsaF+9Qcm2Qv8SRIMMscAvG4O3lJ0F1GuMo5HR/Bp02LopNgnZBC/EkbevHFeGs4ls/oPz9v+Bsmzbkbe+0dUw== dependencies: - "@babel/parser" "^7.28.6" - "@babel/types" "^7.28.6" + "@babel/parser" "^7.29.0" + "@babel/types" "^7.29.0" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" @@ -218,12 +218,12 @@ "@babel/template" "^7.28.6" "@babel/types" "^7.28.6" -"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.28.6.tgz#f01a8885b7fa1e56dd8a155130226cd698ef13fd" - integrity sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ== +"@babel/parser@^7.1.0", "@babel/parser@^7.14.7", "@babel/parser@^7.20.7", "@babel/parser@^7.23.9", "@babel/parser@^7.28.6", "@babel/parser@^7.29.0": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.0.tgz#669ef345add7d057e92b7ed15f0bac07611831b6" + integrity sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww== dependencies: - "@babel/types" "^7.28.6" + "@babel/types" "^7.29.0" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -353,23 +353,23 @@ "@babel/parser" "^7.28.6" "@babel/types" "^7.28.6" -"@babel/traverse@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.28.6.tgz#871ddc79a80599a5030c53b1cc48cbe3a5583c2e" - integrity sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg== +"@babel/traverse@^7.28.6", "@babel/traverse@^7.29.0": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.0.tgz#f323d05001440253eead3c9c858adbe00b90310a" + integrity sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA== dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/generator" "^7.28.6" + "@babel/code-frame" "^7.29.0" + "@babel/generator" "^7.29.0" "@babel/helper-globals" "^7.28.0" - "@babel/parser" "^7.28.6" + "@babel/parser" "^7.29.0" "@babel/template" "^7.28.6" - "@babel/types" "^7.28.6" + "@babel/types" "^7.29.0" debug "^4.3.1" -"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.28.6", "@babel/types@^7.3.3": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.28.6.tgz#c3e9377f1b155005bcc4c46020e7e394e13089df" - integrity sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg== +"@babel/types@^7.0.0", "@babel/types@^7.20.7", "@babel/types@^7.28.2", "@babel/types@^7.28.6", "@babel/types@^7.29.0", "@babel/types@^7.3.3": + version "7.29.0" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.0.tgz#9f5b1e838c446e72cf3cd4b918152b8c605e37c7" + integrity sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A== dependencies: "@babel/helper-string-parser" "^7.27.1" "@babel/helper-validator-identifier" "^7.28.5" @@ -379,59 +379,59 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@biomejs/biome@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.3.1.tgz#d1a9284f52986324f288cdaf450331a0f3fb1da7" - integrity sha512-A29evf1R72V5bo4o2EPxYMm5mtyGvzp2g+biZvRFx29nWebGyyeOSsDWGx3tuNNMFRepGwxmA9ZQ15mzfabK2w== +"@biomejs/biome@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.4.3.tgz#eb7a48f1763fe333949665b3ff7814267eda000f" + integrity sha512-cBrjf6PNF6yfL8+kcNl85AjiK2YHNsbU0EvDOwiZjBPbMbQ5QcgVGFpjD0O52p8nec5O8NYw7PKw3xUR7fPAkQ== optionalDependencies: - "@biomejs/cli-darwin-arm64" "2.3.1" - "@biomejs/cli-darwin-x64" "2.3.1" - "@biomejs/cli-linux-arm64" "2.3.1" - "@biomejs/cli-linux-arm64-musl" "2.3.1" - "@biomejs/cli-linux-x64" "2.3.1" - "@biomejs/cli-linux-x64-musl" "2.3.1" - "@biomejs/cli-win32-arm64" "2.3.1" - "@biomejs/cli-win32-x64" "2.3.1" - -"@biomejs/cli-darwin-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.3.1.tgz#607835f8ef043e1a80f9ad2a232c9e860941ab60" - integrity sha512-ombSf3MnTUueiYGN1SeI9tBCsDUhpWzOwS63Dove42osNh0PfE1cUtHFx6eZ1+MYCCLwXzlFlYFdrJ+U7h6LcA== - -"@biomejs/cli-darwin-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.3.1.tgz#654fe4aaa8ea5d5bde5457db4961ad5d214713ac" - integrity sha512-pcOfwyoQkrkbGvXxRvZNe5qgD797IowpJPovPX5biPk2FwMEV+INZqfCaz4G5bVq9hYnjwhRMamg11U4QsRXrQ== - -"@biomejs/cli-linux-arm64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.3.1.tgz#5fe502082a575c31ef808cf080cbcd4485964167" - integrity sha512-+DZYv8l7FlUtTrWs1Tdt1KcNCAmRO87PyOnxKGunbWm5HKg1oZBSbIIPkjrCtDZaeqSG1DiGx7qF+CPsquQRcg== - -"@biomejs/cli-linux-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.3.1.tgz#81c02547905d379dbb312e6ff24b04908c2e320f" - integrity sha512-td5O8pFIgLs8H1sAZsD6v+5quODihyEw4nv2R8z7swUfIK1FKk+15e4eiYVLcAE4jUqngvh4j3JCNgg0Y4o4IQ== - -"@biomejs/cli-linux-x64-musl@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.3.1.tgz#c7c00beb5eda1ad25185544897e66eeec6be3b0b" - integrity sha512-Y3Ob4nqgv38Mh+6EGHltuN+Cq8aj/gyMTJYzkFZV2AEj+9XzoXB9VNljz9pjfFNHUxvLEV4b55VWyxozQTBaUQ== - -"@biomejs/cli-linux-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.3.1.tgz#7481d2e7be98d4de574df233766a5bdda037c897" - integrity sha512-PYWgEO7up7XYwSAArOpzsVCiqxBCXy53gsReAb1kKYIyXaoAlhBaBMvxR/k2Rm9aTuZ662locXUmPk/Aj+Xu+Q== - -"@biomejs/cli-win32-arm64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.3.1.tgz#dac8c7c7223e97f86cd0eed7aa95584984761481" - integrity sha512-RHIG/zgo+69idUqVvV3n8+j58dKYABRpMyDmfWu2TITC+jwGPiEaT0Q3RKD+kQHiS80mpBrST0iUGeEXT0bU9A== - -"@biomejs/cli-win32-x64@2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.3.1.tgz#f8818ab2c1e3a6e2ed8a656935173e5ce4c720be" - integrity sha512-izl30JJ5Dp10mi90Eko47zhxE6pYyWPcnX1NQxKpL/yMhXxf95oLTzfpu4q+MDBh/gemNqyJEwjBpe0MT5iWPA== + "@biomejs/cli-darwin-arm64" "2.4.3" + "@biomejs/cli-darwin-x64" "2.4.3" + "@biomejs/cli-linux-arm64" "2.4.3" + "@biomejs/cli-linux-arm64-musl" "2.4.3" + "@biomejs/cli-linux-x64" "2.4.3" + "@biomejs/cli-linux-x64-musl" "2.4.3" + "@biomejs/cli-win32-arm64" "2.4.3" + "@biomejs/cli-win32-x64" "2.4.3" + +"@biomejs/cli-darwin-arm64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.3.tgz#ca188065f29940de1bb0029df2fd639719c92750" + integrity sha512-eOafSFlI/CF4id2tlwq9CVHgeEqvTL5SrhWff6ZORp6S3NL65zdsR3ugybItkgF8Pf4D9GSgtbB6sE3UNgOM9w== + +"@biomejs/cli-darwin-x64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.3.tgz#418c55c0bfd1f5d4d22c48cddf8bbd78b02e7fd7" + integrity sha512-V2+av4ilbWcBMNufTtMMXVW00nPwyIjI5qf7n9wSvUaZ+tt0EvMGk46g9sAFDJBEDOzSyoRXiSP6pCvKTOEbPA== + +"@biomejs/cli-linux-arm64-musl@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.3.tgz#58da6a862764cc6c02c27a2d737a4f187a446bcd" + integrity sha512-QuFzvsGo8BA4Xm7jGX5idkw6BqFblcCPySMTvq0AhGYnhUej5VJIDJbmTKfHqwjHepZiC4fA+T5i6wmiZolZNw== + +"@biomejs/cli-linux-arm64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.3.tgz#7642518e76df8fc2dcd0675042e85e58c03f6a74" + integrity sha512-0m+O0x9FgK99FAwDK+fiDtjs2wnqq7bvfj17KJVeCkTwT/liI+Q9njJG7lwXK0iSJVXeFNRIxukpVI3SifMYAA== + +"@biomejs/cli-linux-x64-musl@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.3.tgz#2a2fe720f636fc3894debf23925e9fe1c06da079" + integrity sha512-qEc0OCpj/uytruQ4wLM0yWNJLZy0Up8H1Er5MW3SrstqM6J2d4XqdNA86xzCy8MQCHpoVZ3lFye3GBlIL4/ljw== + +"@biomejs/cli-linux-x64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.3.tgz#dad0a81804ed2043e9ea3e4b29b3bb352c4eb26a" + integrity sha512-NVqh0saIU0u5OfOp/0jFdlKRE59+XyMvWmtx0f6Nm/2OpdxBl04coRIftBbY9d1gfu+23JVv4CItAqPYrjYh5w== + +"@biomejs/cli-win32-arm64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.3.tgz#1da3559be0924e891f9b986c8c0db7d503a34a11" + integrity sha512-gRO96vrIARilv/Cp2ZnmNNL5LSZg3RO75GPp13hsLO3N4YVpE7saaMDp2bcyV48y2N2Pbit1brkGVGta0yd6VQ== + +"@biomejs/cli-win32-x64@2.4.3": + version "2.4.3" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.3.tgz#58ddb4e205b274d693940f3d334debd6f4c94ff4" + integrity sha512-vSm/vOJe06pf14aGHfHl3Ar91Nlx4YYmohElDJ+17UbRwe99n987S/MhAlQOkONqf1utJor04ChkCPmKb8SWdw== "@bundled-es-modules/cookie@^2.0.1": version "2.0.1" @@ -765,9 +765,9 @@ integrity sha512-U69T3ItWHvLwGg5eJ0n3I62nWuE6ilHlmz7zM0npLBRvPRd7e6NYmg54vvRtP5mZG7kZqZCFVdsTWo7BPtBujg== "@sinclair/typebox@^0.27.8": - version "0.27.8" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e" - integrity sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA== + version "0.27.10" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.10.tgz#beefe675f1853f73676aecc915b2bd2ac98c4fc6" + integrity sha512-MTBk/3jGLNB2tVxv6uLlFh1iu64iYOQ2PbdOSK3NW8JZsmlaOh2q6sdtKowBhfw8QFLmYNzTW4/oK4uATIi6ZA== "@sinonjs/commons@^3.0.0": version "3.0.1" @@ -904,11 +904,11 @@ form-data "^4.0.4" "@types/node@*": - version "25.0.6" - resolved "https://registry.yarnpkg.com/@types/node/-/node-25.0.6.tgz#5ca3c46f2b256b59128f433426e42d464765dab1" - integrity sha512-NNu0sjyNxpoiW3YuVFfNz7mxSQ+S4X2G28uqg2s+CzoqoQjLPsWSbsFFyztIAqt2vb8kfEAsJNepMGPTxFDx3Q== + version "25.4.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-25.4.0.tgz#f25d8467984d6667cc4c1be1e2f79593834aaedb" + integrity sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw== dependencies: - undici-types "~7.16.0" + undici-types "~7.18.0" "@types/node@^14.14.30": version "14.18.63" @@ -1113,16 +1113,16 @@ acorn-import-phases@^1.0.3: integrity sha512-wKmbr/DDiIXzEOiWrTTUcDm24kQ2vGfZQvM2fwg2vXqR5uW6aapr7ObPtj1th32b9u90/Pf4AItvdTh42fBmVQ== acorn-walk@^8.0.2: - version "8.3.4" - resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.4.tgz#794dd169c3977edf4ba4ea47583587c5866236b7" - integrity sha512-ueEepnujpqee2o5aIYnvHU6C0A42MNdsIDeqy5BydrkuC5R1ZuUFnm27EeFJGoEHJQgn3uleRvmTXaJgfXbt4g== + version "8.3.5" + resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.5.tgz#8a6b8ca8fc5b34685af15dabb44118663c296496" + integrity sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw== dependencies: acorn "^8.11.0" -acorn@^8.1.0, acorn@^8.11.0, acorn@^8.15.0, acorn@^8.8.1: - version "8.15.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.15.0.tgz#a360898bc415edaac46c8241f6383975b930b816" - integrity sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg== +acorn@^8.1.0, acorn@^8.11.0, acorn@^8.15.0, acorn@^8.16.0, acorn@^8.8.1: + version "8.16.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.16.0.tgz#4ce79c89be40afe7afe8f3adb902a1f1ce9ac08a" + integrity sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw== agent-base@6: version "6.0.2" @@ -1151,9 +1151,9 @@ ajv-keywords@^5.1.0: fast-deep-equal "^3.1.3" ajv@^8.0.0, ajv@^8.9.0: - version "8.17.1" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" - integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + version "8.18.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.18.0.tgz#8864186b6738d003eb3a933172bb3833e10cefbc" + integrity sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A== dependencies: fast-deep-equal "^3.1.3" fast-uri "^3.0.1" @@ -1205,12 +1205,12 @@ asynckit@^0.4.0: integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== axios@^1.8.4: - version "1.13.3" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.3.tgz#f123e77356630a22b0163920662556944f2be1a1" - integrity sha512-ERT8kdX7DZjtUm7IitEyV7InTHAF42iJuMArIiDIV5YtPanJkgw4hw5Dyg9fh0mihdWNn1GKaeIWErfe56UQ1g== + version "1.13.6" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.13.6.tgz#c3f92da917dc209a15dd29936d20d5089b6b6c98" + integrity sha512-ChTCHMouEe2kn713WHbQGcuYrr6fXTBiu460OTwWrWob16g1bXn4vtz07Ope7ewMozJAnEquLk5lWQWtBig9DQ== dependencies: - follow-redirects "^1.15.6" - form-data "^4.0.4" + follow-redirects "^1.15.11" + form-data "^4.0.5" proxy-from-env "^1.1.0" babel-jest@^29.7.0: @@ -1287,9 +1287,9 @@ base64-js@^1.3.1: integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== baseline-browser-mapping@^2.9.0: - version "2.9.14" - resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.9.14.tgz#3b6af0bc032445bca04de58caa9a87cfe921cbb3" - integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg== + version "2.10.0" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.0.tgz#5b09935025bf8a80e29130251e337c6a7fc8cbb9" + integrity sha512-lIyg0szRfYbiy67j9KN8IyeD7q7hcmqnJ1ddWmNt19ItGpNN64mnllmxUNFIOdOm6by97jlL6wfpTTJrmnjWAA== brace-expansion@^1.1.7: version "1.1.12" @@ -1368,9 +1368,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001759: - version "1.0.30001764" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001764.tgz#03206c56469f236103b90f9ae10bcb8b9e1f6005" - integrity sha512-9JGuzl2M+vPL+pz70gtMF9sHdMFbY9FJaQBi186cHKH3pSzDvzoUJUPV6fqiKIMyXbud9ZLg4F3Yza1vJ1+93g== + version "1.0.30001778" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001778.tgz#79a8a124e3473a20b70616497b987c30d06570a0" + integrity sha512-PN7uxFL+ExFJO61aVmP1aIEG4i9whQd4eoSCebav62UwDyp5OHh06zN4jqKSMePVgxHifCw1QJxdRkA1Pisekg== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1524,9 +1524,9 @@ decimal.js@^10.4.2: integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg== dedent@^1.0.0: - version "1.7.1" - resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.1.tgz#364661eea3d73f3faba7089214420ec2f8f13e15" - integrity sha512-9JmrhGZpOlEgOLdQgSm0zxFaYoQon408V1v49aqTWuXENVlnCuY9JBZcXZiCsZQWDjTm5Qf/nIvAy77mXDAjEg== + version "1.7.2" + resolved "https://registry.yarnpkg.com/dedent/-/dedent-1.7.2.tgz#34e2264ab538301e27cf7b07bf2369c19baa8dd9" + integrity sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA== deepmerge@^4.2.2: version "4.3.1" @@ -1575,9 +1575,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.263: - version "1.5.267" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.267.tgz#5d84f2df8cdb6bfe7e873706bb21bd4bfb574dc7" - integrity sha512-0Drusm6MVRXSOJpGbaSVgcQsuB4hEkMpHXaVstcPmhu5LIedxs1xNK/nIxmQIU/RPC0+1/o0AVZfBTkTNJOdUw== + version "1.5.313" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.313.tgz#193e9ae2c2ab6915acb41e833068381e4ef0b3e4" + integrity sha512-QBMrTWEf00GXZmJyx2lbYD45jpI3TUFnNIzJ5BBc8piGUDwMPa1GV6HJWTZVvY/eiN3fSopl7NRbgGp9sZ9LTA== emittery@^0.13.1: version "0.13.1" @@ -1589,13 +1589,13 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -enhanced-resolve@^5.0.0, enhanced-resolve@^5.17.4: - version "5.18.4" - resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.4.tgz#c22d33055f3952035ce6a144ce092447c525f828" - integrity sha512-LgQMM4WXU3QI+SYgEc2liRgznaD5ojbmY3sb8LxyguVkIg5FxdpTkvk72te2R38/TGKxH634oLxXRGY6d7AP+Q== +enhanced-resolve@^5.0.0, enhanced-resolve@^5.20.0: + version "5.20.0" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.20.0.tgz#323c2a70d2aa7fb4bdfd6d3c24dfc705c581295d" + integrity sha512-/ce7+jQ1PQ6rVXwe+jKEg5hW5ciicHwIQUagZkp6IufBoY3YDgdTTY1azVs0qoRgVmvsNB+rbjLJxDAeHHtwsQ== dependencies: graceful-fs "^4.2.4" - tapable "^2.2.0" + tapable "^2.3.0" entities@^6.0.0: version "6.0.1" @@ -1775,7 +1775,7 @@ find-up@^4.0.0, find-up@^4.1.0: locate-path "^5.0.0" path-exists "^4.0.0" -follow-redirects@^1.15.6: +follow-redirects@^1.15.11: version "1.15.11" resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== @@ -1785,7 +1785,7 @@ form-data-encoder@^4.0.2: resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-4.1.0.tgz#497cedc94810bd5d53b99b5d4f6c152d5cbc9db2" integrity sha512-G6NsmEW15s0Uw9XnCg+33H3ViYRyiM0hMrMhhqQOR8NFc5GhYrI+6I3u7OTw7b91J2g8rtvMBZJDbcGb2YUniw== -form-data@^4.0.0, form-data@^4.0.1, form-data@^4.0.4: +form-data@^4.0.0, form-data@^4.0.1, form-data@^4.0.4, form-data@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== @@ -1888,9 +1888,9 @@ graceful-fs@^4.1.2, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.9: integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== graphql@^16.8.1: - version "16.12.0" - resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.12.0.tgz#28cc2462435b1ac3fdc6976d030cef83a0c13ac7" - integrity sha512-DKKrynuQRne0PNpEbzuEdHlYOMksHSUI8Zc9Unei5gTsMNA2/vMpoMz/yKba50pejK56qj98qM0SjYxAKi13gQ== + version "16.13.1" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.13.1.tgz#38ae5c76fbc4a009e0004dca6c76c370a1da7b54" + integrity sha512-gGgrVCoDKlIZ8fIqXBBb0pPKqDgki0Z/FSKNiQzSGj2uEYHr1tq5wmBegGwJx6QB5S5cM0khSBpi/JFHMCvsmQ== handlebars@^4.7.8: version "4.7.8" @@ -2671,9 +2671,9 @@ mimic-fn@^2.1.0: integrity sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg== minimatch@^3.0.4, minimatch@^3.1.1: - version "3.1.2" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" - integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + version "3.1.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.5.tgz#580c88f8d5445f2bd6aa8f3cadefa0de79fbd69e" + integrity sha512-VgjWUsnnT6n+NUk6eZq77zeFdpW2LWDzP6zFGrCbHXiYNul5Dzqk2HHQ5uFH2DNW5Xbp8+jVzaeNt94ssEEl4w== dependencies: brace-expansion "^1.1.7" @@ -2740,9 +2740,9 @@ node-int64@^0.4.0: integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== node-releases@^2.0.27: - version "2.0.27" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.27.tgz#eedca519205cf20f650f61d56b070db111231e4e" - integrity sha512-nmh3lCkYZ3grZvqcCH+fjmQ7X+H0OeZgP40OierEaAptX4XofMh5kwNbWh7lBduUzCcV/8kZ+NDLCwm2iorIlA== + version "2.0.36" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.36.tgz#99fd6552aaeda9e17c4713b57a63964a2e325e9d" + integrity sha512-TdC8FSgHz8Mwtw9g5L4gR/Sh9XhSP/0DEkQxfEFXOpiul5IiHgHan2VhYYb6agDSfp4KuvltmGApc8HMgUrIkA== normalize-path@^3.0.0: version "3.0.0" @@ -2919,13 +2919,6 @@ querystringify@^2.1.1: resolved "https://registry.yarnpkg.com/querystringify/-/querystringify-2.2.0.tgz#3345941b4153cb9d082d8eee4cda2016a9aef7f6" integrity sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ== -randombytes@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" - integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ== - dependencies: - safe-buffer "^5.1.0" - react-is@^18.0.0: version "18.3.1" resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e" @@ -2988,7 +2981,7 @@ rettime@^0.7.0: resolved "https://registry.yarnpkg.com/rettime/-/rettime-0.7.0.tgz#c040f1a65e396eaa4b8346dd96ed937edc79d96f" integrity sha512-LPRKoHnLKd/r3dVxcwO7vhCW+orkOGj9ViueosEBK6ie89CijnfRlhaDhHq/3Hxu4CkWQtxwlBG0mzTQY6uQjw== -safe-buffer@^5.1.0, safe-buffer@~5.2.0: +safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -3021,16 +3014,9 @@ semver@^6.3.0, semver@^6.3.1: integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA== semver@^7.3.4, semver@^7.5.3, semver@^7.5.4, semver@^7.7.3: - version "7.7.3" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.3.tgz#4b5f4143d007633a8dc671cd0a6ef9147b8bb946" - integrity sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q== - -serialize-javascript@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" - integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== - dependencies: - randombytes "^2.1.0" + version "7.7.4" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.4.tgz#28464e36060e991fa7a11d0279d2d3f3b57a7e8a" + integrity sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA== shebang-command@^2.0.0: version "2.0.0" @@ -3194,26 +3180,25 @@ symbol-tree@^3.2.4: resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2" integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw== -tapable@^2.2.0, tapable@^2.3.0: +tapable@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.0.tgz#7e3ea6d5ca31ba8e078b560f0d83ce9a14aa8be6" integrity sha512-g9ljZiwki/LfxmQADO3dEY1CbpmXT5Hm2fJ+QaGKwSXUylMybePR7/67YW7jOrrvjEgL1Fmz5kzyAjWVWLlucg== -terser-webpack-plugin@^5.3.16: - version "5.3.16" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.16.tgz#741e448cc3f93d8026ebe4f7ef9e4afacfd56330" - integrity sha512-h9oBFCWrq78NyWWVcSwZarJkZ01c2AyGrzs1crmHZO3QUg9D61Wu4NPjBy69n7JqylFF5y+CsUZYmYEIZ3mR+Q== +terser-webpack-plugin@^5.3.17: + version "5.4.0" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.4.0.tgz#95fc4cf4437e587be11ecf37d08636089174d76b" + integrity sha512-Bn5vxm48flOIfkdl5CaD2+1CiUVbonWQ3KQPyP7/EuIl9Gbzq/gQFOzaMFUEgVjB1396tcK0SG8XcNJ/2kDH8g== dependencies: "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" schema-utils "^4.3.0" - serialize-javascript "^6.0.2" terser "^5.31.1" terser@^5.31.1: - version "5.44.1" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.44.1.tgz#e391e92175c299b8c284ad6ded609e37303b0a9c" - integrity sha512-t/R3R/n0MSwnnazuPpPNVO60LX0SKL45pyl9YlvxIdkH0Of7D5qM2EVe+yASRIlY5pZ73nclYJfNANGWPwFDZw== + version "5.46.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.46.0.tgz#1b81e560d584bbdd74a8ede87b4d9477b0ff9695" + integrity sha512-jTwoImyr/QbOWFFso3YoU3ik0jBBDJ6JTOQiy/J2YxVJdZCc+5u7skhNwiOR3FQIygFqVUPHl7qbbxtjW2K3Qg== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3234,17 +3219,17 @@ tiny-warning@^1.0.3: resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== -tldts-core@^7.0.19: - version "7.0.19" - resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.19.tgz#9dd8a457a09b4e65c8266c029f1847fa78dead20" - integrity sha512-lJX2dEWx0SGH4O6p+7FPwYmJ/bu1JbcGJ8RLaG9b7liIgZ85itUVEPbMtWRVrde/0fnDPEPHW10ZsKW3kVsE9A== +tldts-core@^7.0.25: + version "7.0.25" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.0.25.tgz#eaee57facdfb5528383d961f5586d49784519de5" + integrity sha512-ZjCZK0rppSBu7rjHYDYsEaMOIbbT+nWF57hKkv4IUmZWBNrBWBOjIElc0mKRgLM8bm7x/BBlof6t2gi/Oq/Asw== tldts@^7.0.5: - version "7.0.19" - resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.19.tgz#84cd7a7f04e68ec93b93b106fac038c527b99368" - integrity sha512-8PWx8tvC4jDB39BQw1m4x8y5MH1BcQ5xHeL2n7UVFulMPH/3Q0uiamahFJ3lXA0zO2SUyRXuVVbWSDmstlt9YA== + version "7.0.25" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.0.25.tgz#e9034876e09b2ad92db547a9307ae6fa65400f8d" + integrity sha512-keinCnPbwXEUG3ilrWQZU+CqcTTzHq9m2HhoUP2l7Xmi8l1LuijAXLpAJ5zRW+ifKTNscs4NdCkfkDCBYm352w== dependencies: - tldts-core "^7.0.19" + tldts-core "^7.0.25" tmpl@1.0.5: version "1.0.5" @@ -3348,10 +3333,10 @@ undici-types@~5.26.4: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== -undici-types@~7.16.0: - version "7.16.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.16.0.tgz#ffccdff36aea4884cbfce9a750a0580224f58a46" - integrity sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw== +undici-types@~7.18.0: + version "7.18.2" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.18.2.tgz#29357a89e7b7ca4aef3bf0fd3fd0cd73884229e9" + integrity sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w== universalify@^0.2.0: version "0.2.0" @@ -3397,10 +3382,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -watchpack@^2.4.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.5.0.tgz#fa115d5ccaa4bf3aa594f586257c0bc4768939fd" - integrity sha512-e6vZvY6xboSwLz2GD36c16+O/2Z6fKvIf4pOXptw2rY9MVwE/TXc6RGqxD3I3x0a28lwBY7DE+76uTPSsBrrCA== +watchpack@^2.5.1: + version "2.5.1" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.5.1.tgz#dd38b601f669e0cbf567cb802e75cead82cde102" + integrity sha512-Zn5uXdcFNIA1+1Ei5McRd+iRzfhENPCe7LeABkJtNulSxjma+l7ltNx55BWZkRlwRnpOgHqxnjyaDgJnNXnqzg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -3415,15 +3400,15 @@ webidl-conversions@^7.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-7.0.0.tgz#256b4e1882be7debbf01d05f0aa2039778ea080a" integrity sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g== -webpack-sources@^3.3.3: - version "3.3.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.3.tgz#d4bf7f9909675d7a070ff14d0ef2a4f3c982c723" - integrity sha512-yd1RBzSGanHkitROoPFd6qsrxt+oFhg/129YzheDGqeustzX0vTZJZsSsQjVQC4yzBQ56K55XU8gaNCtIzOnTg== +webpack-sources@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.3.4.tgz#a338b95eb484ecc75fbb196cbe8a2890618b4891" + integrity sha512-7tP1PdV4vF+lYPnkMR0jMY5/la2ub5Fc/8VQrrU+lXkiM6C4TjVfGw7iKfyhnTQOsD+6Q/iKw0eFciziRgD58Q== webpack@^5.97.1: - version "5.104.1" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.104.1.tgz#94bd41eb5dbf06e93be165ba8be41b8260d4fb1a" - integrity sha512-Qphch25abbMNtekmEGJmeRUhLDbe+QfiWTiqpKYkpCOWY64v9eyl+KRRLmqOFA2AvKPpc9DC6+u2n76tQLBoaA== + version "5.105.4" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.105.4.tgz#1b77fcd55a985ac7ca9de80a746caffa38220169" + integrity sha512-jTywjboN9aHxFlToqb0K0Zs9SbBoW4zRUlGzI2tYNxVYcEi/IPpn+Xi4ye5jTLvX2YeLuic/IvxNot+Q1jMoOw== dependencies: "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" @@ -3431,11 +3416,11 @@ webpack@^5.97.1: "@webassemblyjs/ast" "^1.14.1" "@webassemblyjs/wasm-edit" "^1.14.1" "@webassemblyjs/wasm-parser" "^1.14.1" - acorn "^8.15.0" + acorn "^8.16.0" acorn-import-phases "^1.0.3" browserslist "^4.28.1" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.17.4" + enhanced-resolve "^5.20.0" es-module-lexer "^2.0.0" eslint-scope "5.1.1" events "^3.2.0" @@ -3447,9 +3432,9 @@ webpack@^5.97.1: neo-async "^2.6.2" schema-utils "^4.3.3" tapable "^2.3.0" - terser-webpack-plugin "^5.3.16" - watchpack "^2.4.4" - webpack-sources "^3.3.3" + terser-webpack-plugin "^5.3.17" + watchpack "^2.5.1" + webpack-sources "^3.3.4" whatwg-encoding@^2.0.0: version "2.0.0"