diff --git a/.fern/metadata.json b/.fern/metadata.json index 151030e32..28f2ab537 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -1,7 +1,7 @@ { - "cliVersion": "3.98.5", + "cliVersion": "5.55.1", "generatorName": "fernapi/fern-typescript-sdk", - "generatorVersion": "3.43.8", + "generatorVersion": "3.73.4", "generatorConfig": { "namespaceExport": "Square", "allowCustomFetcher": true, @@ -54,5 +54,10 @@ } } }, - "sdkVersion": "44.2.0" + "originGitCommit": "d93545d18ea2da3477384a0d47d4a3223daf24d5", + "originGitCommitIsDirty": false, + "invokedBy": "ci", + "requestedVersion": "44.1.1", + "ciProvider": "github", + "sdkVersion": "44.1.1" } diff --git a/.fern/verify.sh b/.fern/verify.sh new file mode 100755 index 000000000..6d2cc0ea9 --- /dev/null +++ b/.fern/verify.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -euo pipefail +yarn install +yarn build +yarn test diff --git a/README.md b/README.md index 97548a298..3317b7b49 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,15 @@ The Square TypeScript library provides convenient access to the Square APIs from - [Versioning](#versioning) - [Usage](#usage) - [Legacy Sdk](#legacy-sdk) +- [Environments](#environments) - [Request and Response Types](#request-and-response-types) - [Exception Handling](#exception-handling) - [File Uploads](#file-uploads) - [Pagination](#pagination) - [Webhook Signature Verification](#webhook-signature-verification) -- [Reporting API](#reporting-api) +- [Reporting Api](#reporting-api) - [Advanced](#advanced) + - [Subpackage Exports](#subpackage-exports) - [Additional Headers](#additional-headers) - [Additional Query String Parameters](#additional-query-string-parameters) - [Retries](#retries) @@ -26,6 +28,8 @@ The Square TypeScript library provides convenient access to the Square APIs from - [Aborting Requests](#aborting-requests) - [Access Raw Response Data](#access-raw-response-data) - [Logging](#logging) + - [Custom Fetch](#custom-fetch) + - [Custom Fetcher](#custom-fetcher) - [Runtime Compatibility](#runtime-compatibility) - [Contributing](#contributing) @@ -146,6 +150,18 @@ We recommend migrating to the new SDK using the following steps: 3. Gradually move over to use the new SDK by importing it from the `"square"` import. +## Environments + +This SDK allows you to configure different environments for API requests. + +```typescript +import { SquareClient, SquareEnvironment } from "square"; + +const client = new SquareClient({ + environment: SquareEnvironment.Production, +}); +``` + ## Request and Response Types The SDK exports all request and response types as TypeScript interfaces. Simply import them with the @@ -330,6 +346,16 @@ const response = await ReportingHelper.loadAndWait( ## 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. @@ -369,11 +395,19 @@ The SDK is instrumented with automatic retries with exponential backoff. A reque as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2). -A request is deemed retryable when any of the following HTTP status codes is returned: +Which status codes are retried depends on the `retryStatusCodes` generator configuration: + +**`legacy`** (current default): retries on +- [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) +- [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) +- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status#server_error_responses) (All server errors, including 500) +**`recommended`**: retries on - [408](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) (Timeout) - [429](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) (Too Many Requests) -- [5XX](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) (Internal Server Errors) +- [502](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) (Bad Gateway) +- [503](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) (Service Unavailable) +- [504](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504) (Gateway Timeout) Use the `maxRetries` request option to configure this behavior. @@ -480,22 +514,27 @@ const logger: logging.ILogger = { -### Runtime Compatibility - - -The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following -runtimes: +### Custom Fetch +The SDK provides a low-level `fetch` method for making custom HTTP requests while still +benefiting from SDK-level configuration like authentication, retries, timeouts, and logging. +This is useful for calling API endpoints not yet supported in the SDK. +```typescript +const response = await client.fetch("/v1/custom/endpoint", { + method: "GET", +}, { + timeoutInSeconds: 30, + maxRetries: 3, + headers: { + "X-Custom-Header": "custom-value", + }, +}); -- Node.js 18+ -- Vercel -- Cloudflare Workers -- Deno v1.25+ -- Bun 1.0+ -- React Native +const data = await response.json(); +``` -### Customizing Fetch Client +### Custom Fetcher The SDK provides a way for you to customize the underlying HTTP client / Fetch function. If you're running in an unsupported environment, this provides a way for you to break glass and ensure the SDK works. @@ -509,6 +548,22 @@ const client = new SquareClient({ }); ``` +### Runtime Compatibility + + +The SDK defaults to `node-fetch` but will use the global fetch client if present. The SDK works in the following +runtimes: + + + +- Node.js 18+ +- Vercel +- Cloudflare Workers +- Deno v1.25+ +- Bun 1.0+ +- React Native + + ## Contributing While we value open-source contributions to this SDK, this library is generated programmatically. diff --git a/biome.json b/biome.json index a777468e4..6b89164f9 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.10/schema.json", "root": true, "vcs": { "enabled": false diff --git a/package.json b/package.json index 86d985bbc..d84e8453e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "square", - "version": "44.2.0", + "version": "44.1.1", "private": false, "repository": { "type": "git", @@ -24,33 +24,34 @@ "test:integration": "jest --selectProjects integration" }, "dependencies": { - "form-data": "^4.0.4", + "form-data": "^4.0.6", "formdata-node": "^6.0.3", "node-fetch": "^2.7.0", - "readable-stream": "^4.5.2", - "form-data-encoder": "^4.0.2", + "readable-stream": "^4.7.0", + "form-data-encoder": "^4.1.0", "square-legacy": "npm:square@^39.1.1" }, "devDependencies": { "@types/node-fetch": "^2.6.12", - "@types/readable-stream": "^4.0.18", - "webpack": "^5.97.1", - "ts-loader": "^9.5.1", + "@types/readable-stream": "^4.0.23", + "webpack": "^5.105.4", + "ts-loader": "^9.5.4", "jest": "^29.7.0", "@jest/globals": "^29.7.0", "@types/jest": "^29.5.14", "ts-jest": "^29.3.4", "jest-environment-jsdom": "^29.7.0", "msw": "2.11.2", - "@types/node": "^18.19.70", - "typescript": "~5.7.2", - "@biomejs/biome": "2.3.1" + "@types/node": "^20.0.0", + "typescript": "~5.9.3", + "@biomejs/biome": "2.4.10" }, "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 baa667ffa..816e9a955 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>
@@ -4578,7 +4578,7 @@ await client.events.listEventTypes({
-**request:** `Square.ListEventTypesRequest` +**request:** `Square.ListEventTypesBody`
@@ -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>
@@ -6625,7 +6625,7 @@ await client.invoices.createInvoiceAttachment({
-**request:** `Square.CreateInvoiceAttachmentRequest` +**request:** `Square.CreateInvoiceAttachmentBody`
@@ -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>
@@ -13829,7 +13829,7 @@ await client.reporting.load();
## Bookings CustomAttributeDefinitions -
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page +
client.bookings.customAttributeDefinitions.list({ ...params }) -> core.Page<Square.CustomAttributeDefinition, Square.ListBookingCustomAttributeDefinitionsResponse>
@@ -14349,7 +14349,7 @@ await client.bookings.customAttributes.batchUpsert({
-
client.bookings.customAttributes.list({ ...params }) -> core.Page +
client.bookings.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListBookingCustomAttributesResponse>
@@ -14654,7 +14654,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>
@@ -14736,7 +14736,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>
@@ -14887,7 +14887,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>
@@ -15044,7 +15044,7 @@ await client.cashDrawers.shifts.get({
-
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page +
client.cashDrawers.shifts.listEvents({ ...params }) -> core.Page<Square.CashDrawerShiftEvent, Square.ListCashDrawerShiftEventsResponse>
@@ -15489,7 +15489,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>
@@ -15847,7 +15847,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>
@@ -16346,7 +16346,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>
@@ -16833,7 +16833,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>
@@ -17126,7 +17126,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>
@@ -17441,7 +17441,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>
@@ -17663,7 +17663,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>
@@ -17880,7 +17880,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>
@@ -18052,7 +18052,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>
@@ -18424,7 +18424,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>
@@ -19001,7 +19001,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>
@@ -19150,7 +19150,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>
@@ -19302,7 +19302,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>
@@ -19849,7 +19849,7 @@ await client.locations.customAttributes.batchUpsert({
-
client.locations.customAttributes.list({ ...params }) -> core.Page +
client.locations.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListLocationCustomAttributesResponse>
@@ -21382,7 +21382,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>
@@ -21698,7 +21698,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>
@@ -22235,7 +22235,7 @@ await client.merchants.customAttributes.batchUpsert({
-
client.merchants.customAttributes.list({ ...params }) -> core.Page +
client.merchants.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListMerchantCustomAttributesResponse>
@@ -22542,7 +22542,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>
@@ -23101,7 +23101,7 @@ await client.orders.customAttributes.batchUpsert({
-
client.orders.customAttributes.list({ ...params }) -> core.Page +
client.orders.customAttributes.list({ ...params }) -> core.Page<Square.CustomAttribute, Square.ListOrderCustomAttributesResponse>
@@ -24460,7 +24460,7 @@ await client.webhooks.eventTypes.list({
-**request:** `Square.webhooks.ListEventTypesRequest` +**request:** `Square.webhooks.ListEventTypesBody`
@@ -24481,7 +24481,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>
@@ -24967,3 +24967,4 @@ await client.webhooks.subscriptions.test({
+ diff --git a/src/BaseClient.ts b/src/BaseClient.ts index 7df2da7bd..38a3a68a7 100644 --- a/src/BaseClient.ts +++ b/src/BaseClient.ts @@ -5,6 +5,12 @@ import * as core from "./core"; import { mergeHeaders } from "./core/headers"; import type * as environments from "./environments"; +export type AuthOption = + | false + | core.AuthProvider["getAuthRequest"] + | core.AuthProvider + | BearerAuthProvider.AuthOptions; + export type BaseClientOptions = { environment?: core.Supplier; /** Specify a custom URL to connect the client to. */ @@ -22,6 +28,8 @@ export type BaseClientOptions = { fetcher?: core.FetchFunction; /** Configure logging for the client. */ logging?: core.logging.LogConfig | core.logging.Logger; + /** Override auth. Pass false to disable, a function returning auth headers, an AuthProvider, or auth options. */ + auth?: AuthOption; } & BearerAuthProvider.AuthOptions; export interface BaseRequestOptions { @@ -56,8 +64,8 @@ export function normalizeClientOptions { const normalized = normalizeClientOptions(options) as NormalizedClientOptionsWithAuth; + + if (options.auth === false) { + normalized.authProvider = new core.NoOpAuthProvider(); + return normalized; + } + if (options.auth != null) { + if (typeof options.auth === "function") { + normalized.authProvider = { getAuthRequest: options.auth }; + return normalized; + } + if (core.isAuthProvider(options.auth)) { + normalized.authProvider = options.auth; + return normalized; + } + Object.assign(normalized, options.auth); + } + const normalizedWithNoOpAuthProvider = withNoOpAuthProvider(normalized); normalized.authProvider ??= new BearerAuthProvider(normalizedWithNoOpAuthProvider); return normalized; diff --git a/src/Client.ts b/src/Client.ts index 6e10d24b1..ee670298f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -38,6 +38,7 @@ import { VendorsClient } from "./api/resources/vendors/client/Client"; import { WebhooksClient } from "./api/resources/webhooks/client/Client"; import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient"; import { type NormalizedClientOptionsWithAuth, normalizeClientOptionsWithAuth } from "./BaseClient"; +import * as core from "./core"; export declare namespace SquareClient { export type Options = BaseClientOptions; @@ -231,4 +232,35 @@ export class SquareClient { public get webhooks(): WebhooksClient { return (this._webhooks ??= new WebhooksClient(this._options)); } + + /** + * Make a passthrough request using the SDK's configured auth, retry, logging, etc. + * This is useful for making requests to endpoints not yet supported in the SDK. + * The input can be a URL string, URL object, or Request object. Relative paths are resolved against the configured base URL. + * + * @param {Request | string | URL} input - The URL, path, or Request object. + * @param {RequestInit} init - Standard fetch RequestInit options. + * @param {core.PassthroughRequest.RequestOptions} requestOptions - Per-request overrides (timeout, retries, headers, abort signal). + * @returns {Promise} A standard Response object. + */ + public async fetch( + input: Request | string | URL, + init?: RequestInit, + requestOptions?: core.PassthroughRequest.RequestOptions, + ): Promise { + return core.makePassthroughRequest( + input, + init, + { + baseUrl: this._options.baseUrl ?? this._options.environment, + headers: this._options.headers, + timeoutInSeconds: this._options.timeoutInSeconds, + maxRetries: this._options.maxRetries, + fetch: this._options.fetch, + logging: this._options.logging, + getAuthHeaders: async () => (await this._options.authProvider.getAuthRequest()).headers, + }, + requestOptions, + ); + } } diff --git a/src/api/resources/applePay/client/Client.ts b/src/api/resources/applePay/client/Client.ts index e027b1c72..f17ab2128 100644 --- a/src/api/resources/applePay/client/Client.ts +++ b/src/api/resources/applePay/client/Client.ts @@ -75,7 +75,7 @@ export class ApplePayClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.RegisterDomainRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/applePay/exports.ts b/src/api/resources/applePay/exports.ts new file mode 100644 index 000000000..c12756551 --- /dev/null +++ b/src/api/resources/applePay/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ApplePayClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/bankAccounts/client/Client.ts b/src/api/resources/bankAccounts/client/Client.ts index aea1f5e3b..e43f76a81 100644 --- a/src/api/resources/bankAccounts/client/Client.ts +++ b/src/api/resources/bankAccounts/client/Client.ts @@ -68,7 +68,11 @@ export class BankAccountsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -151,7 +155,7 @@ export class BankAccountsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateBankAccountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -226,7 +230,7 @@ export class BankAccountsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -301,7 +305,7 @@ export class BankAccountsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -376,7 +380,7 @@ export class BankAccountsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/bankAccounts/exports.ts b/src/api/resources/bankAccounts/exports.ts new file mode 100644 index 000000000..b4ea789d8 --- /dev/null +++ b/src/api/resources/bankAccounts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { BankAccountsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/bookings/client/Client.ts b/src/api/resources/bookings/client/Client.ts index b79453b61..84c616899 100644 --- a/src/api/resources/bookings/client/Client.ts +++ b/src/api/resources/bookings/client/Client.ts @@ -99,7 +99,11 @@ export class BookingsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -193,7 +197,7 @@ export class BookingsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateBookingRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -275,7 +279,7 @@ export class BookingsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchAvailabilityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -358,7 +362,7 @@ export class BookingsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkRetrieveBookingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -427,7 +431,7 @@ export class BookingsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -502,7 +506,7 @@ export class BookingsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -579,7 +583,7 @@ export class BookingsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkRetrieveTeamMemberBookingProfilesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -662,7 +666,7 @@ export class BookingsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -740,7 +744,7 @@ export class BookingsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -822,7 +826,7 @@ export class BookingsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CancelBookingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/bookings/exports.ts b/src/api/resources/bookings/exports.ts new file mode 100644 index 000000000..65fa0ec4e --- /dev/null +++ b/src/api/resources/bookings/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { BookingsClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts index 3c6c76e92..6244c6b8a 100644 --- a/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/client/Client.ts @@ -67,7 +67,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -159,7 +163,7 @@ export class CustomAttributeDefinitionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.bookings.CreateBookingCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -246,7 +250,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -329,7 +337,7 @@ export class CustomAttributeDefinitionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.bookings.UpdateBookingCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -415,7 +423,7 @@ export class CustomAttributeDefinitionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/bookings/resources/customAttributeDefinitions/exports.ts b/src/api/resources/bookings/resources/customAttributeDefinitions/exports.ts new file mode 100644 index 000000000..89a965824 --- /dev/null +++ b/src/api/resources/bookings/resources/customAttributeDefinitions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributeDefinitionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/bookings/resources/customAttributes/client/Client.ts b/src/api/resources/bookings/resources/customAttributes/client/Client.ts index 2618fc89e..a36aabaf6 100644 --- a/src/api/resources/bookings/resources/customAttributes/client/Client.ts +++ b/src/api/resources/bookings/resources/customAttributes/client/Client.ts @@ -73,7 +73,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.bookings.BulkDeleteBookingCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -164,7 +164,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.bookings.BulkUpsertBookingCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -252,7 +252,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -348,7 +352,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -432,7 +440,7 @@ export class CustomAttributesClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.bookings.UpsertBookingCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -519,7 +527,7 @@ export class CustomAttributesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/bookings/resources/customAttributes/exports.ts b/src/api/resources/bookings/resources/customAttributes/exports.ts new file mode 100644 index 000000000..52a02441c --- /dev/null +++ b/src/api/resources/bookings/resources/customAttributes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts index 277b7923c..7731a6620 100644 --- a/src/api/resources/bookings/resources/locationProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/locationProfiles/client/Client.ts @@ -64,7 +64,11 @@ export class LocationProfilesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/bookings/resources/locationProfiles/exports.ts b/src/api/resources/bookings/resources/locationProfiles/exports.ts new file mode 100644 index 000000000..3becdcc39 --- /dev/null +++ b/src/api/resources/bookings/resources/locationProfiles/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { LocationProfilesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts index 0ef2a7d95..0f69be699 100644 --- a/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts +++ b/src/api/resources/bookings/resources/teamMemberProfiles/client/Client.ts @@ -68,7 +68,11 @@ export class TeamMemberProfilesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -154,7 +158,7 @@ export class TeamMemberProfilesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/bookings/resources/teamMemberProfiles/exports.ts b/src/api/resources/bookings/resources/teamMemberProfiles/exports.ts new file mode 100644 index 000000000..b8c24fb05 --- /dev/null +++ b/src/api/resources/bookings/resources/teamMemberProfiles/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TeamMemberProfilesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/cards/client/Client.ts b/src/api/resources/cards/client/Client.ts index a0c3519ee..eea2cda71 100644 --- a/src/api/resources/cards/client/Client.ts +++ b/src/api/resources/cards/client/Client.ts @@ -57,7 +57,7 @@ export class CardsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -75,7 +75,11 @@ export class CardsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -170,7 +174,7 @@ export class CardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateCardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -245,7 +249,7 @@ export class CardsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -316,7 +320,7 @@ export class CardsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/cards/exports.ts b/src/api/resources/cards/exports.ts new file mode 100644 index 000000000..ff70342c6 --- /dev/null +++ b/src/api/resources/cards/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CardsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/cashDrawers/exports.ts b/src/api/resources/cashDrawers/exports.ts new file mode 100644 index 000000000..92662a019 --- /dev/null +++ b/src/api/resources/cashDrawers/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CashDrawersClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts index d4826f2b2..b801fb320 100644 --- a/src/api/resources/cashDrawers/resources/shifts/client/Client.ts +++ b/src/api/resources/cashDrawers/resources/shifts/client/Client.ts @@ -57,7 +57,7 @@ export class ShiftsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, begin_time: beginTime, end_time: endTime, limit, @@ -79,7 +79,11 @@ export class ShiftsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -170,7 +174,11 @@ export class ShiftsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -250,7 +258,11 @@ export class ShiftsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/cashDrawers/resources/shifts/exports.ts b/src/api/resources/cashDrawers/resources/shifts/exports.ts new file mode 100644 index 000000000..c9bb12df4 --- /dev/null +++ b/src/api/resources/cashDrawers/resources/shifts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ShiftsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/catalog/client/Client.ts b/src/api/resources/catalog/client/Client.ts index 49eea8e63..d1eff38a7 100644 --- a/src/api/resources/catalog/client/Client.ts +++ b/src/api/resources/catalog/client/Client.ts @@ -87,7 +87,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchDeleteCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -168,7 +168,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchGetCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -270,7 +270,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchUpsertCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -338,7 +338,7 @@ export class CatalogClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -417,7 +417,11 @@ export class CatalogClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -514,7 +518,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchCatalogObjectsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -619,7 +623,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchCatalogItemsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -703,7 +707,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateItemModifierListsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -787,7 +791,7 @@ export class CatalogClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateItemTaxesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/catalog/exports.ts b/src/api/resources/catalog/exports.ts new file mode 100644 index 000000000..84e3b0ff1 --- /dev/null +++ b/src/api/resources/catalog/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CatalogClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/catalog/resources/images/client/Client.ts b/src/api/resources/catalog/resources/images/client/Client.ts index 977f8d1d8..f1a895184 100644 --- a/src/api/resources/catalog/resources/images/client/Client.ts +++ b/src/api/resources/catalog/resources/images/client/Client.ts @@ -87,7 +87,7 @@ export class ImagesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, @@ -184,7 +184,7 @@ export class ImagesClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, diff --git a/src/api/resources/catalog/resources/images/exports.ts b/src/api/resources/catalog/resources/images/exports.ts new file mode 100644 index 000000000..478c9103f --- /dev/null +++ b/src/api/resources/catalog/resources/images/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ImagesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/catalog/resources/object/client/Client.ts b/src/api/resources/catalog/resources/object/client/Client.ts index 2166cac01..e462fde51 100644 --- a/src/api/resources/catalog/resources/object/client/Client.ts +++ b/src/api/resources/catalog/resources/object/client/Client.ts @@ -70,7 +70,7 @@ export class ObjectClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.catalog.UpsertCatalogObjectRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -159,7 +159,11 @@ export class ObjectClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -243,7 +247,7 @@ export class ObjectClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/catalog/resources/object/exports.ts b/src/api/resources/catalog/resources/object/exports.ts new file mode 100644 index 000000000..51e313d73 --- /dev/null +++ b/src/api/resources/catalog/resources/object/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ObjectClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/channels/client/Client.ts b/src/api/resources/channels/client/Client.ts index 3dae96ba2..88ac7eb15 100644 --- a/src/api/resources/channels/client/Client.ts +++ b/src/api/resources/channels/client/Client.ts @@ -50,7 +50,7 @@ export class ChannelsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, reference_id: referenceId, status: status !== undefined @@ -58,7 +58,7 @@ export class ChannelsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, limit, }; @@ -78,7 +78,11 @@ export class ChannelsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -157,7 +161,7 @@ export class ChannelsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkRetrieveChannelsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -230,7 +234,7 @@ export class ChannelsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/channels/exports.ts b/src/api/resources/channels/exports.ts new file mode 100644 index 000000000..b9483e855 --- /dev/null +++ b/src/api/resources/channels/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ChannelsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/checkout/client/Client.ts b/src/api/resources/checkout/client/Client.ts index 395d3cf06..2fedfeee1 100644 --- a/src/api/resources/checkout/client/Client.ts +++ b/src/api/resources/checkout/client/Client.ts @@ -68,7 +68,7 @@ export class CheckoutClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -145,7 +145,7 @@ export class CheckoutClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateLocationSettingsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -219,7 +219,7 @@ export class CheckoutClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -294,7 +294,7 @@ export class CheckoutClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateMerchantSettingsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/checkout/exports.ts b/src/api/resources/checkout/exports.ts new file mode 100644 index 000000000..cf2a0354d --- /dev/null +++ b/src/api/resources/checkout/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CheckoutClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts index ad519e012..f14a49c7f 100644 --- a/src/api/resources/checkout/resources/paymentLinks/client/Client.ts +++ b/src/api/resources/checkout/resources/paymentLinks/client/Client.ts @@ -64,7 +64,11 @@ export class PaymentLinksClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -158,7 +162,7 @@ export class PaymentLinksClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.checkout.CreatePaymentLinkRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -238,7 +242,7 @@ export class PaymentLinksClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -322,7 +326,7 @@ export class PaymentLinksClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.checkout.UpdatePaymentLinkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -402,7 +406,7 @@ export class PaymentLinksClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/checkout/resources/paymentLinks/exports.ts b/src/api/resources/checkout/resources/paymentLinks/exports.ts new file mode 100644 index 000000000..71422e654 --- /dev/null +++ b/src/api/resources/checkout/resources/paymentLinks/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PaymentLinksClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/customers/client/Client.ts b/src/api/resources/customers/client/Client.ts index 2f29e6215..7f8d7bdd3 100644 --- a/src/api/resources/customers/client/Client.ts +++ b/src/api/resources/customers/client/Client.ts @@ -90,14 +90,14 @@ export class CustomersClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, sort_order: sortOrder !== undefined ? serializers.SortOrder.jsonOrThrow(sortOrder, { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, count, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -116,7 +116,11 @@ export class CustomersClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -219,7 +223,7 @@ export class CustomersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateCustomerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -337,7 +341,7 @@ export class CustomersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkCreateCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -414,7 +418,7 @@ export class CustomersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkDeleteCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -491,7 +495,7 @@ export class CustomersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkRetrieveCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -579,7 +583,7 @@ export class CustomersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkUpdateCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -684,7 +688,7 @@ export class CustomersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchCustomersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -759,7 +763,7 @@ export class CustomersClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -836,7 +840,7 @@ export class CustomersClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateCustomerRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -917,7 +921,11 @@ export class CustomersClient { ), method: "DELETE", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/customers/exports.ts b/src/api/resources/customers/exports.ts new file mode 100644 index 000000000..bf376b833 --- /dev/null +++ b/src/api/resources/customers/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomersClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/customers/resources/cards/client/Client.ts b/src/api/resources/customers/resources/cards/client/Client.ts index f1cfc17c9..ae1c0cf16 100644 --- a/src/api/resources/customers/resources/cards/client/Client.ts +++ b/src/api/resources/customers/resources/cards/client/Client.ts @@ -24,6 +24,8 @@ export class CardsClient { } /** + * @deprecated + * * Adds a card on file to an existing customer. * * As with charges, calls to `CreateCustomerCard` are idempotent. Multiple @@ -77,7 +79,7 @@ export class CardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.CreateCustomerCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -119,6 +121,8 @@ export class CardsClient { } /** + * @deprecated + * * Removes a card on file from a customer. * * @param {Square.customers.DeleteCardsRequest} request @@ -158,7 +162,7 @@ export class CardsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/customers/resources/cards/exports.ts b/src/api/resources/customers/resources/cards/exports.ts new file mode 100644 index 000000000..ff70342c6 --- /dev/null +++ b/src/api/resources/customers/resources/cards/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CardsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts index 09b5f0562..ba8a9c262 100644 --- a/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributeDefinitions/client/Client.ts @@ -69,7 +69,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -173,7 +177,7 @@ export class CustomAttributeDefinitionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.CreateCustomerCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -261,7 +265,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -347,7 +355,7 @@ export class CustomAttributeDefinitionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.UpdateCustomerCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -432,7 +440,7 @@ export class CustomAttributeDefinitionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -556,7 +564,7 @@ export class CustomAttributeDefinitionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.BatchUpsertCustomerCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/customers/resources/customAttributeDefinitions/exports.ts b/src/api/resources/customers/resources/customAttributeDefinitions/exports.ts new file mode 100644 index 000000000..89a965824 --- /dev/null +++ b/src/api/resources/customers/resources/customAttributeDefinitions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributeDefinitionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/customers/resources/customAttributes/client/Client.ts b/src/api/resources/customers/resources/customAttributes/client/Client.ts index 9b299b9fb..89e2a4764 100644 --- a/src/api/resources/customers/resources/customAttributes/client/Client.ts +++ b/src/api/resources/customers/resources/customAttributes/client/Client.ts @@ -74,7 +74,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -174,7 +178,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -262,7 +270,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.UpsertCustomerCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -347,7 +355,7 @@ export class CustomAttributesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/customers/resources/customAttributes/exports.ts b/src/api/resources/customers/resources/customAttributes/exports.ts new file mode 100644 index 000000000..52a02441c --- /dev/null +++ b/src/api/resources/customers/resources/customAttributes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/customers/resources/groups/client/Client.ts b/src/api/resources/customers/resources/groups/client/Client.ts index 4cb120ec5..f99bdcdba 100644 --- a/src/api/resources/customers/resources/groups/client/Client.ts +++ b/src/api/resources/customers/resources/groups/client/Client.ts @@ -64,7 +64,11 @@ export class GroupsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -149,7 +153,7 @@ export class GroupsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.CreateCustomerGroupRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -224,7 +228,7 @@ export class GroupsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -303,7 +307,7 @@ export class GroupsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.customers.UpdateCustomerGroupRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -383,7 +387,7 @@ export class GroupsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -462,7 +466,7 @@ export class GroupsClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -541,7 +545,7 @@ export class GroupsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/customers/resources/groups/exports.ts b/src/api/resources/customers/resources/groups/exports.ts new file mode 100644 index 000000000..182dc3ec5 --- /dev/null +++ b/src/api/resources/customers/resources/groups/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { GroupsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/customers/resources/segments/client/Client.ts b/src/api/resources/customers/resources/segments/client/Client.ts index 33a9369fe..c68a3dbeb 100644 --- a/src/api/resources/customers/resources/segments/client/Client.ts +++ b/src/api/resources/customers/resources/segments/client/Client.ts @@ -64,7 +64,11 @@ export class SegmentsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -150,7 +154,7 @@ export class SegmentsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/customers/resources/segments/exports.ts b/src/api/resources/customers/resources/segments/exports.ts new file mode 100644 index 000000000..479a37247 --- /dev/null +++ b/src/api/resources/customers/resources/segments/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SegmentsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/devices/client/Client.ts b/src/api/resources/devices/client/Client.ts index 8cbfa6624..9db628658 100644 --- a/src/api/resources/devices/client/Client.ts +++ b/src/api/resources/devices/client/Client.ts @@ -59,7 +59,7 @@ export class DevicesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, location_id: locationId, }; @@ -79,7 +79,11 @@ export class DevicesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -160,7 +164,7 @@ export class DevicesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/devices/exports.ts b/src/api/resources/devices/exports.ts new file mode 100644 index 000000000..994e61496 --- /dev/null +++ b/src/api/resources/devices/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DevicesClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/devices/resources/codes/client/Client.ts b/src/api/resources/devices/resources/codes/client/Client.ts index 96a39097c..3b3fc7393 100644 --- a/src/api/resources/devices/resources/codes/client/Client.ts +++ b/src/api/resources/devices/resources/codes/client/Client.ts @@ -55,14 +55,14 @@ export class CodesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, status: status !== undefined ? serializers.DeviceCodeStatus.jsonOrThrow(status, { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -80,7 +80,11 @@ export class CodesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -167,7 +171,7 @@ export class CodesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.devices.CreateDeviceCodeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -242,7 +246,7 @@ export class CodesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/devices/resources/codes/exports.ts b/src/api/resources/devices/resources/codes/exports.ts new file mode 100644 index 000000000..6a6297846 --- /dev/null +++ b/src/api/resources/devices/resources/codes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CodesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/disputes/client/Client.ts b/src/api/resources/disputes/client/Client.ts index 157a6d828..a53c0ada7 100644 --- a/src/api/resources/disputes/client/Client.ts +++ b/src/api/resources/disputes/client/Client.ts @@ -58,7 +58,7 @@ export class DisputesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, location_id: locationId, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -77,7 +77,11 @@ export class DisputesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -158,7 +162,7 @@ export class DisputesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -232,7 +236,7 @@ export class DisputesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -329,7 +333,7 @@ export class DisputesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, @@ -411,7 +415,7 @@ export class DisputesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateDisputeEvidenceTextRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -497,7 +501,7 @@ export class DisputesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/disputes/exports.ts b/src/api/resources/disputes/exports.ts new file mode 100644 index 000000000..d7e7002cf --- /dev/null +++ b/src/api/resources/disputes/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { DisputesClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/disputes/resources/evidence/client/Client.ts b/src/api/resources/disputes/resources/evidence/client/Client.ts index 061142aac..c3100fa96 100644 --- a/src/api/resources/disputes/resources/evidence/client/Client.ts +++ b/src/api/resources/disputes/resources/evidence/client/Client.ts @@ -63,7 +63,11 @@ export class EvidenceClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -152,7 +156,7 @@ export class EvidenceClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -229,7 +233,7 @@ export class EvidenceClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/disputes/resources/evidence/exports.ts b/src/api/resources/disputes/resources/evidence/exports.ts new file mode 100644 index 000000000..e8282b9b1 --- /dev/null +++ b/src/api/resources/disputes/resources/evidence/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EvidenceClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/employees/client/Client.ts b/src/api/resources/employees/client/Client.ts index 2187ac83e..541058112 100644 --- a/src/api/resources/employees/client/Client.ts +++ b/src/api/resources/employees/client/Client.ts @@ -24,6 +24,8 @@ export class EmployeesClient { } /** + * @deprecated + * * @param {Square.ListEmployeesRequest} request * @param {EmployeesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -52,7 +54,7 @@ export class EmployeesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, cursor, }; @@ -72,7 +74,11 @@ export class EmployeesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -115,6 +121,8 @@ export class EmployeesClient { } /** + * @deprecated + * * @param {Square.GetEmployeesRequest} request * @param {EmployeesClient.RequestOptions} requestOptions - Request-specific configuration. * @@ -151,7 +159,7 @@ export class EmployeesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/employees/exports.ts b/src/api/resources/employees/exports.ts new file mode 100644 index 000000000..d2ce07706 --- /dev/null +++ b/src/api/resources/employees/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EmployeesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/events/client/Client.ts b/src/api/resources/events/client/Client.ts index fc367ae29..ac6e6e8a7 100644 --- a/src/api/resources/events/client/Client.ts +++ b/src/api/resources/events/client/Client.ts @@ -60,7 +60,7 @@ export class EventsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchEventsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -131,7 +131,7 @@ export class EventsClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -195,7 +195,7 @@ export class EventsClient { ), method: "PUT", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -229,7 +229,7 @@ export class EventsClient { /** * Lists all event types that you can subscribe to as webhooks or query using the Events API. * - * @param {Square.ListEventTypesRequest} request + * @param {Square.ListEventTypesBody} request * @param {EventsClient.RequestOptions} requestOptions - Request-specific configuration. * * @example @@ -238,14 +238,14 @@ export class EventsClient { * }) */ public listEventTypes( - request: Square.ListEventTypesRequest = {}, + request: Square.ListEventTypesBody = {}, requestOptions?: EventsClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__listEventTypes(request, requestOptions)); } private async __listEventTypes( - request: Square.ListEventTypesRequest = {}, + request: Square.ListEventTypesBody = {}, requestOptions?: EventsClient.RequestOptions, ): Promise> { const { apiVersion } = request; @@ -268,7 +268,11 @@ export class EventsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/events/client/requests/ListEventTypesRequest.ts b/src/api/resources/events/client/requests/ListEventTypesBody.ts similarity index 88% rename from src/api/resources/events/client/requests/ListEventTypesRequest.ts rename to src/api/resources/events/client/requests/ListEventTypesBody.ts index 4b8cfb8d4..683b0ae89 100644 --- a/src/api/resources/events/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/events/client/requests/ListEventTypesBody.ts @@ -6,7 +6,7 @@ * apiVersion: "api_version" * } */ -export interface ListEventTypesRequest { +export interface ListEventTypesBody { /** The API version for which to list event types. Setting this field overrides the default version used by the application. */ apiVersion?: string | null; } diff --git a/src/api/resources/events/client/requests/index.ts b/src/api/resources/events/client/requests/index.ts index 07d2f52ca..d2d5cc5f9 100644 --- a/src/api/resources/events/client/requests/index.ts +++ b/src/api/resources/events/client/requests/index.ts @@ -1,2 +1,2 @@ -export type { ListEventTypesRequest } from "./ListEventTypesRequest"; +export type { ListEventTypesBody } from "./ListEventTypesBody"; export type { SearchEventsRequest } from "./SearchEventsRequest"; diff --git a/src/api/resources/events/exports.ts b/src/api/resources/events/exports.ts new file mode 100644 index 000000000..4cfbd2f8a --- /dev/null +++ b/src/api/resources/events/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EventsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/giftCards/client/Client.ts b/src/api/resources/giftCards/client/Client.ts index 7b56927ef..394918dc8 100644 --- a/src/api/resources/giftCards/client/Client.ts +++ b/src/api/resources/giftCards/client/Client.ts @@ -77,7 +77,11 @@ export class GiftCardsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -166,7 +170,7 @@ export class GiftCardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateGiftCardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -241,7 +245,7 @@ export class GiftCardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.GetGiftCardFromGanRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -316,7 +320,7 @@ export class GiftCardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.GetGiftCardFromNonceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -393,7 +397,7 @@ export class GiftCardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.LinkCustomerToGiftCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -475,7 +479,7 @@ export class GiftCardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UnlinkCustomerFromGiftCardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -555,7 +559,7 @@ export class GiftCardsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/giftCards/exports.ts b/src/api/resources/giftCards/exports.ts new file mode 100644 index 000000000..db5ec451e --- /dev/null +++ b/src/api/resources/giftCards/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { GiftCardsClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/giftCards/resources/activities/client/Client.ts b/src/api/resources/giftCards/resources/activities/client/Client.ts index 16c1c2d9f..0f6c14d67 100644 --- a/src/api/resources/giftCards/resources/activities/client/Client.ts +++ b/src/api/resources/giftCards/resources/activities/client/Client.ts @@ -79,7 +79,11 @@ export class ActivitiesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -175,7 +179,7 @@ export class ActivitiesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.giftCards.CreateGiftCardActivityRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/giftCards/resources/activities/exports.ts b/src/api/resources/giftCards/resources/activities/exports.ts new file mode 100644 index 000000000..bc36be9c9 --- /dev/null +++ b/src/api/resources/giftCards/resources/activities/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ActivitiesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/inventory/client/Client.ts b/src/api/resources/inventory/client/Client.ts index b071db8b7..187ed420b 100644 --- a/src/api/resources/inventory/client/Client.ts +++ b/src/api/resources/inventory/client/Client.ts @@ -24,6 +24,8 @@ export class InventoryClient { } /** + * @deprecated + * * Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL * is updated to conform to the standard convention. * @@ -63,7 +65,7 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -139,7 +141,7 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -176,6 +178,8 @@ export class InventoryClient { } /** + * @deprecated + * * Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL * is updated to conform to the standard convention. * @@ -228,7 +232,7 @@ export class InventoryClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchChangeInventoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -265,6 +269,8 @@ export class InventoryClient { } /** + * @deprecated + * * Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL * is updated to conform to the standard convention. * @@ -309,7 +315,7 @@ export class InventoryClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchRetrieveInventoryChangesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -351,6 +357,8 @@ export class InventoryClient { } /** + * @deprecated + * * Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL * is updated to conform to the standard convention. * @@ -392,7 +400,7 @@ export class InventoryClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchGetInventoryCountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -489,7 +497,7 @@ export class InventoryClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchChangeInventoryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -578,7 +586,7 @@ export class InventoryClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchRetrieveInventoryChangesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -678,7 +686,7 @@ export class InventoryClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchGetInventoryCountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -731,6 +739,8 @@ export class InventoryClient { } /** + * @deprecated + * * Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL * is updated to conform to the standard convention. * @@ -770,7 +780,7 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -846,7 +856,7 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -922,7 +932,7 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1003,7 +1013,11 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -1051,6 +1065,8 @@ export class InventoryClient { } /** + * @deprecated + * * Returns a set of physical counts and inventory adjustments for the * provided [CatalogObject](entity:CatalogObject) at the requested * [Location](entity:Location)s. @@ -1104,7 +1120,11 @@ export class InventoryClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/inventory/exports.ts b/src/api/resources/inventory/exports.ts new file mode 100644 index 000000000..f1443941c --- /dev/null +++ b/src/api/resources/inventory/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { InventoryClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/invoices/client/Client.ts b/src/api/resources/invoices/client/Client.ts index 85037e1ef..b3703f490 100644 --- a/src/api/resources/invoices/client/Client.ts +++ b/src/api/resources/invoices/client/Client.ts @@ -67,7 +67,11 @@ export class InvoicesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -192,7 +196,7 @@ export class InvoicesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateInvoiceRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -283,7 +287,7 @@ export class InvoicesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchInvoicesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -358,7 +362,7 @@ export class InvoicesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -440,7 +444,7 @@ export class InvoicesClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -521,7 +525,11 @@ export class InvoicesClient { ), method: "DELETE", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -562,7 +570,7 @@ export class InvoicesClient { * * __NOTE:__ When testing in the Sandbox environment, the total file size is limited to 1 KB. * - * @param {Square.CreateInvoiceAttachmentRequest} request + * @param {Square.CreateInvoiceAttachmentBody} request * @param {InvoicesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example @@ -572,14 +580,14 @@ export class InvoicesClient { * }) */ public createInvoiceAttachment( - request: Square.CreateInvoiceAttachmentRequest, + request: Square.CreateInvoiceAttachmentBody, requestOptions?: InvoicesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__createInvoiceAttachment(request, requestOptions)); } private async __createInvoiceAttachment( - request: Square.CreateInvoiceAttachmentRequest, + request: Square.CreateInvoiceAttachmentBody, requestOptions?: InvoicesClient.RequestOptions, ): Promise> { const _body = await core.newFormData(); @@ -619,7 +627,7 @@ export class InvoicesClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "file", duplex: _maybeEncodedRequest.duplex, body: _maybeEncodedRequest.body, @@ -699,7 +707,7 @@ export class InvoicesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -779,7 +787,7 @@ export class InvoicesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CancelInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -875,7 +883,7 @@ export class InvoicesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.PublishInvoiceRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts b/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentBody.ts similarity index 89% rename from src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts rename to src/api/resources/invoices/client/requests/CreateInvoiceAttachmentBody.ts index a0d66240e..4baa9fd12 100644 --- a/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentRequest.ts +++ b/src/api/resources/invoices/client/requests/CreateInvoiceAttachmentBody.ts @@ -9,7 +9,7 @@ import type * as Square from "../../../../index"; * invoiceId: "invoice_id" * } */ -export interface CreateInvoiceAttachmentRequest { +export interface CreateInvoiceAttachmentBody { /** The ID of the [invoice](entity:Invoice) to attach the file to. */ invoiceId: string; request?: Square.CreateInvoiceAttachmentRequestData; diff --git a/src/api/resources/invoices/client/requests/index.ts b/src/api/resources/invoices/client/requests/index.ts index 71c00300b..8dc836cb7 100644 --- a/src/api/resources/invoices/client/requests/index.ts +++ b/src/api/resources/invoices/client/requests/index.ts @@ -1,5 +1,5 @@ export type { CancelInvoiceRequest } from "./CancelInvoiceRequest"; -export type { CreateInvoiceAttachmentRequest } from "./CreateInvoiceAttachmentRequest"; +export type { CreateInvoiceAttachmentBody } from "./CreateInvoiceAttachmentBody"; export type { CreateInvoiceRequest } from "./CreateInvoiceRequest"; export type { DeleteInvoiceAttachmentRequest } from "./DeleteInvoiceAttachmentRequest"; export type { DeleteInvoicesRequest } from "./DeleteInvoicesRequest"; diff --git a/src/api/resources/invoices/exports.ts b/src/api/resources/invoices/exports.ts new file mode 100644 index 000000000..ee7f23975 --- /dev/null +++ b/src/api/resources/invoices/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { InvoicesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/labor/client/Client.ts b/src/api/resources/labor/client/Client.ts index 351a94378..ba8f3f909 100644 --- a/src/api/resources/labor/client/Client.ts +++ b/src/api/resources/labor/client/Client.ts @@ -110,7 +110,7 @@ export class LaborClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateScheduledShiftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -193,7 +193,7 @@ export class LaborClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkPublishScheduledShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -284,7 +284,7 @@ export class LaborClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchScheduledShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -364,7 +364,7 @@ export class LaborClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -461,7 +461,7 @@ export class LaborClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateScheduledShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -546,7 +546,7 @@ export class LaborClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.PublishScheduledShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -669,7 +669,7 @@ export class LaborClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateTimecardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -769,7 +769,7 @@ export class LaborClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchTimecardsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -844,7 +844,7 @@ export class LaborClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -950,7 +950,7 @@ export class LaborClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateTimecardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -1025,7 +1025,7 @@ export class LaborClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/labor/exports.ts b/src/api/resources/labor/exports.ts new file mode 100644 index 000000000..b6f90f50e --- /dev/null +++ b/src/api/resources/labor/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { LaborClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/labor/resources/breakTypes/client/Client.ts b/src/api/resources/labor/resources/breakTypes/client/Client.ts index 8cb63fcab..9dce1d1ee 100644 --- a/src/api/resources/labor/resources/breakTypes/client/Client.ts +++ b/src/api/resources/labor/resources/breakTypes/client/Client.ts @@ -66,7 +66,11 @@ export class BreakTypesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -166,7 +170,7 @@ export class BreakTypesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.labor.CreateBreakTypeRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -241,7 +245,7 @@ export class BreakTypesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -319,7 +323,7 @@ export class BreakTypesClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.labor.UpdateBreakTypeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -396,7 +400,7 @@ export class BreakTypesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/labor/resources/breakTypes/exports.ts b/src/api/resources/labor/resources/breakTypes/exports.ts new file mode 100644 index 000000000..fe16c48fa --- /dev/null +++ b/src/api/resources/labor/resources/breakTypes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { BreakTypesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/labor/resources/employeeWages/client/Client.ts b/src/api/resources/labor/resources/employeeWages/client/Client.ts index 25d59c1df..74b8b5c33 100644 --- a/src/api/resources/labor/resources/employeeWages/client/Client.ts +++ b/src/api/resources/labor/resources/employeeWages/client/Client.ts @@ -24,6 +24,8 @@ export class EmployeeWagesClient { } /** + * @deprecated + * * Returns a paginated list of `EmployeeWage` instances for a business. * * @param {Square.labor.ListEmployeeWagesRequest} request @@ -66,7 +68,11 @@ export class EmployeeWagesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -114,6 +120,8 @@ export class EmployeeWagesClient { } /** + * @deprecated + * * Returns a single `EmployeeWage` specified by `id`. * * @param {Square.labor.GetEmployeeWagesRequest} request @@ -152,7 +160,7 @@ export class EmployeeWagesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/labor/resources/employeeWages/exports.ts b/src/api/resources/labor/resources/employeeWages/exports.ts new file mode 100644 index 000000000..a09b705b7 --- /dev/null +++ b/src/api/resources/labor/resources/employeeWages/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EmployeeWagesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/labor/resources/shifts/client/Client.ts b/src/api/resources/labor/resources/shifts/client/Client.ts index 8aed242c2..3d38eab8d 100644 --- a/src/api/resources/labor/resources/shifts/client/Client.ts +++ b/src/api/resources/labor/resources/shifts/client/Client.ts @@ -24,6 +24,8 @@ export class ShiftsClient { } /** + * @deprecated + * * Creates a new `Shift`. * * A `Shift` represents a complete workday for a single team member. @@ -105,7 +107,7 @@ export class ShiftsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.labor.CreateShiftRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -142,6 +144,8 @@ export class ShiftsClient { } /** + * @deprecated + * * Returns a paginated list of `Shift` records for a business. * The list to be returned can be filtered by: * - Location IDs @@ -205,7 +209,7 @@ export class ShiftsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.labor.SearchShiftsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -242,6 +246,8 @@ export class ShiftsClient { } /** + * @deprecated + * * Returns a single `Shift` specified by `id`. * * @param {Square.labor.GetShiftsRequest} request @@ -280,7 +286,7 @@ export class ShiftsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -312,6 +318,8 @@ export class ShiftsClient { } /** + * @deprecated + * * Updates an existing `Shift`. * * When adding a `Break` to a `Shift`, any earlier `Break` instances in the `Shift` have @@ -385,7 +393,7 @@ export class ShiftsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.labor.UpdateShiftRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -422,6 +430,8 @@ export class ShiftsClient { } /** + * @deprecated + * * Deletes a `Shift`. * * @param {Square.labor.DeleteShiftsRequest} request @@ -460,7 +470,7 @@ export class ShiftsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/labor/resources/shifts/exports.ts b/src/api/resources/labor/resources/shifts/exports.ts new file mode 100644 index 000000000..c9bb12df4 --- /dev/null +++ b/src/api/resources/labor/resources/shifts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ShiftsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts index 0384d6faa..fa2301359 100644 --- a/src/api/resources/labor/resources/teamMemberWages/client/Client.ts +++ b/src/api/resources/labor/resources/teamMemberWages/client/Client.ts @@ -66,7 +66,11 @@ export class TeamMemberWagesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -152,7 +156,7 @@ export class TeamMemberWagesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/labor/resources/teamMemberWages/exports.ts b/src/api/resources/labor/resources/teamMemberWages/exports.ts new file mode 100644 index 000000000..0262fc5ac --- /dev/null +++ b/src/api/resources/labor/resources/teamMemberWages/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TeamMemberWagesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts index 3f5f57504..d943f5c1d 100644 --- a/src/api/resources/labor/resources/workweekConfigs/client/Client.ts +++ b/src/api/resources/labor/resources/workweekConfigs/client/Client.ts @@ -64,7 +64,11 @@ export class WorkweekConfigsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -156,7 +160,7 @@ export class WorkweekConfigsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.labor.UpdateWorkweekConfigRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/labor/resources/workweekConfigs/exports.ts b/src/api/resources/labor/resources/workweekConfigs/exports.ts new file mode 100644 index 000000000..52bc2c560 --- /dev/null +++ b/src/api/resources/labor/resources/workweekConfigs/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WorkweekConfigsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/locations/client/Client.ts b/src/api/resources/locations/client/Client.ts index 474ebd104..00ff86cf6 100644 --- a/src/api/resources/locations/client/Client.ts +++ b/src/api/resources/locations/client/Client.ts @@ -75,7 +75,7 @@ export class LocationsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -160,7 +160,7 @@ export class LocationsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateLocationRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -236,7 +236,7 @@ export class LocationsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -325,7 +325,7 @@ export class LocationsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateLocationRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -362,6 +362,8 @@ export class LocationsClient { } /** + * @deprecated + * * Links a `checkoutId` to a `checkout_page_url` that customers are * directed to in order to provide their payment information using a * payment processing workflow hosted on connect.squareup.com. @@ -481,7 +483,7 @@ export class LocationsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateCheckoutRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/locations/exports.ts b/src/api/resources/locations/exports.ts new file mode 100644 index 000000000..6d68e98c7 --- /dev/null +++ b/src/api/resources/locations/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { LocationsClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts index c78db3f56..f8a009804 100644 --- a/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributeDefinitions/client/Client.ts @@ -55,7 +55,7 @@ export class CustomAttributeDefinitionsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, cursor, }; @@ -75,7 +75,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -175,7 +179,7 @@ export class CustomAttributeDefinitionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.locations.CreateLocationCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -261,7 +265,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -344,7 +352,7 @@ export class CustomAttributeDefinitionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.locations.UpdateLocationCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -427,7 +435,7 @@ export class CustomAttributeDefinitionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/locations/resources/customAttributeDefinitions/exports.ts b/src/api/resources/locations/resources/customAttributeDefinitions/exports.ts new file mode 100644 index 000000000..89a965824 --- /dev/null +++ b/src/api/resources/locations/resources/customAttributeDefinitions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributeDefinitionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/locations/resources/customAttributes/client/Client.ts b/src/api/resources/locations/resources/customAttributes/client/Client.ts index 619f30894..440e9260c 100644 --- a/src/api/resources/locations/resources/customAttributes/client/Client.ts +++ b/src/api/resources/locations/resources/customAttributes/client/Client.ts @@ -74,7 +74,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.locations.BulkDeleteLocationCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -185,7 +185,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.locations.BulkUpsertLocationCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -262,7 +262,7 @@ export class CustomAttributesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, cursor, with_definitions: withDefinitions, @@ -283,7 +283,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -380,7 +384,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -465,7 +473,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.locations.UpsertLocationCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -548,7 +556,7 @@ export class CustomAttributesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/locations/resources/customAttributes/exports.ts b/src/api/resources/locations/resources/customAttributes/exports.ts new file mode 100644 index 000000000..52a02441c --- /dev/null +++ b/src/api/resources/locations/resources/customAttributes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/locations/resources/transactions/client/Client.ts b/src/api/resources/locations/resources/transactions/client/Client.ts index 0d7fe7333..b405a6e56 100644 --- a/src/api/resources/locations/resources/transactions/client/Client.ts +++ b/src/api/resources/locations/resources/transactions/client/Client.ts @@ -24,6 +24,8 @@ export class TransactionsClient { } /** + * @deprecated + * * Lists transactions for a particular location. * * Transactions include payment information from sales and exchanges and refund @@ -64,7 +66,7 @@ export class TransactionsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -83,7 +85,11 @@ export class TransactionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -120,6 +126,8 @@ export class TransactionsClient { } /** + * @deprecated + * * Retrieves details for a single transaction. * * @param {Square.locations.GetTransactionsRequest} request @@ -159,7 +167,7 @@ export class TransactionsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -196,6 +204,8 @@ export class TransactionsClient { } /** + * @deprecated + * * Captures a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) * endpoint with a `delay_capture` value of `true`. * @@ -240,7 +250,7 @@ export class TransactionsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -277,6 +287,8 @@ export class TransactionsClient { } /** + * @deprecated + * * Cancels a transaction that was created with the [Charge](api-endpoint:Transactions-Charge) * endpoint with a `delay_capture` value of `true`. * @@ -321,7 +333,7 @@ export class TransactionsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/locations/resources/transactions/exports.ts b/src/api/resources/locations/resources/transactions/exports.ts new file mode 100644 index 000000000..4e81432c9 --- /dev/null +++ b/src/api/resources/locations/resources/transactions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransactionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/loyalty/client/Client.ts b/src/api/resources/loyalty/client/Client.ts index 9a09f8f47..be5585ea8 100644 --- a/src/api/resources/loyalty/client/Client.ts +++ b/src/api/resources/loyalty/client/Client.ts @@ -94,7 +94,7 @@ export class LoyaltyClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchLoyaltyEventsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/loyalty/exports.ts b/src/api/resources/loyalty/exports.ts new file mode 100644 index 000000000..5c8f8c9ce --- /dev/null +++ b/src/api/resources/loyalty/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { LoyaltyClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/loyalty/resources/accounts/client/Client.ts b/src/api/resources/loyalty/resources/accounts/client/Client.ts index 482339179..8b2ec4b39 100644 --- a/src/api/resources/loyalty/resources/accounts/client/Client.ts +++ b/src/api/resources/loyalty/resources/accounts/client/Client.ts @@ -68,7 +68,7 @@ export class AccountsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.CreateLoyaltyAccountRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -152,7 +152,7 @@ export class AccountsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.SearchLoyaltyAccountsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -227,7 +227,7 @@ export class AccountsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -321,7 +321,7 @@ export class AccountsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.AccumulateLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -411,7 +411,7 @@ export class AccountsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.AdjustLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/loyalty/resources/accounts/exports.ts b/src/api/resources/loyalty/resources/accounts/exports.ts new file mode 100644 index 000000000..11698f7e4 --- /dev/null +++ b/src/api/resources/loyalty/resources/accounts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { AccountsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/loyalty/resources/programs/client/Client.ts b/src/api/resources/loyalty/resources/programs/client/Client.ts index b7729302d..b8347a406 100644 --- a/src/api/resources/loyalty/resources/programs/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/client/Client.ts @@ -30,6 +30,8 @@ export class ProgramsClient { } /** + * @deprecated + * * Returns a list of loyalty programs in the seller's account. * Loyalty programs define how buyers can earn points and redeem points for rewards. Square sellers can have only one loyalty program, which is created and managed from the Seller Dashboard. For more information, see [Loyalty Program Overview](https://developer.squareup.com/docs/loyalty/overview). * @@ -66,7 +68,7 @@ export class ProgramsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -138,7 +140,7 @@ export class ProgramsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -230,7 +232,7 @@ export class ProgramsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.CalculateLoyaltyPointsRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/loyalty/resources/programs/exports.ts b/src/api/resources/loyalty/resources/programs/exports.ts new file mode 100644 index 000000000..52999825e --- /dev/null +++ b/src/api/resources/loyalty/resources/programs/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ProgramsClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts index d282d3de2..938fea448 100644 --- a/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/client/Client.ts @@ -57,7 +57,7 @@ export class PromotionsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, limit, }; @@ -77,7 +77,11 @@ export class PromotionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -191,7 +195,7 @@ export class PromotionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.programs.CreateLoyaltyPromotionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -272,7 +276,7 @@ export class PromotionsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -353,7 +357,7 @@ export class PromotionsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/loyalty/resources/programs/resources/promotions/exports.ts b/src/api/resources/loyalty/resources/programs/resources/promotions/exports.ts new file mode 100644 index 000000000..055dd47fd --- /dev/null +++ b/src/api/resources/loyalty/resources/programs/resources/promotions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PromotionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/loyalty/resources/rewards/client/Client.ts b/src/api/resources/loyalty/resources/rewards/client/Client.ts index dac79bc92..dd29812b7 100644 --- a/src/api/resources/loyalty/resources/rewards/client/Client.ts +++ b/src/api/resources/loyalty/resources/rewards/client/Client.ts @@ -74,7 +74,7 @@ export class RewardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.CreateLoyaltyRewardRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -158,7 +158,7 @@ export class RewardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.SearchLoyaltyRewardsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -233,7 +233,7 @@ export class RewardsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -316,7 +316,7 @@ export class RewardsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -404,7 +404,7 @@ export class RewardsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.loyalty.RedeemLoyaltyRewardRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/loyalty/resources/rewards/exports.ts b/src/api/resources/loyalty/resources/rewards/exports.ts new file mode 100644 index 000000000..049a41520 --- /dev/null +++ b/src/api/resources/loyalty/resources/rewards/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { RewardsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/merchants/client/Client.ts b/src/api/resources/merchants/client/Client.ts index 111608f6f..b1414c928 100644 --- a/src/api/resources/merchants/client/Client.ts +++ b/src/api/resources/merchants/client/Client.ts @@ -83,7 +83,11 @@ export class MerchantsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -164,7 +168,7 @@ export class MerchantsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/merchants/exports.ts b/src/api/resources/merchants/exports.ts new file mode 100644 index 000000000..2d9c1b2cc --- /dev/null +++ b/src/api/resources/merchants/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { MerchantsClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts index 677d1f05f..648bf2434 100644 --- a/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/client/Client.ts @@ -55,7 +55,7 @@ export class CustomAttributeDefinitionsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, cursor, }; @@ -75,7 +75,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -175,7 +179,7 @@ export class CustomAttributeDefinitionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.merchants.CreateMerchantCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -261,7 +265,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -344,7 +352,7 @@ export class CustomAttributeDefinitionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.merchants.UpdateMerchantCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -427,7 +435,7 @@ export class CustomAttributeDefinitionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/merchants/resources/customAttributeDefinitions/exports.ts b/src/api/resources/merchants/resources/customAttributeDefinitions/exports.ts new file mode 100644 index 000000000..89a965824 --- /dev/null +++ b/src/api/resources/merchants/resources/customAttributeDefinitions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributeDefinitionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/merchants/resources/customAttributes/client/Client.ts b/src/api/resources/merchants/resources/customAttributes/client/Client.ts index eb83c6e38..0993e0fbd 100644 --- a/src/api/resources/merchants/resources/customAttributes/client/Client.ts +++ b/src/api/resources/merchants/resources/customAttributes/client/Client.ts @@ -71,7 +71,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.merchants.BulkDeleteMerchantCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -175,7 +175,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.merchants.BulkUpsertMerchantCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -252,7 +252,7 @@ export class CustomAttributesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, cursor, with_definitions: withDefinitions, @@ -273,7 +273,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -370,7 +374,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -455,7 +463,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.merchants.UpsertMerchantCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -538,7 +546,7 @@ export class CustomAttributesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/merchants/resources/customAttributes/exports.ts b/src/api/resources/merchants/resources/customAttributes/exports.ts new file mode 100644 index 000000000..52a02441c --- /dev/null +++ b/src/api/resources/merchants/resources/customAttributes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/oAuth/client/Client.ts b/src/api/resources/oAuth/client/Client.ts index 1e5baa589..bad07811a 100644 --- a/src/api/resources/oAuth/client/Client.ts +++ b/src/api/resources/oAuth/client/Client.ts @@ -76,7 +76,7 @@ export class OAuthClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.RevokeTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -172,7 +172,7 @@ export class OAuthClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.ObtainTokenRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -254,7 +254,7 @@ export class OAuthClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -312,7 +312,7 @@ export class OAuthClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/oAuth/exports.ts b/src/api/resources/oAuth/exports.ts new file mode 100644 index 000000000..feabce85d --- /dev/null +++ b/src/api/resources/oAuth/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { OAuthClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/orders/client/Client.ts b/src/api/resources/orders/client/Client.ts index 12f15db0a..1a5803e45 100644 --- a/src/api/resources/orders/client/Client.ts +++ b/src/api/resources/orders/client/Client.ts @@ -125,7 +125,7 @@ export class OrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -203,7 +203,7 @@ export class OrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchGetOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -300,7 +300,7 @@ export class OrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CalculateOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -378,7 +378,7 @@ export class OrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CloneOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -488,7 +488,7 @@ export class OrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -563,7 +563,7 @@ export class OrdersClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -663,7 +663,7 @@ export class OrdersClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -754,7 +754,7 @@ export class OrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.PayOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/orders/exports.ts b/src/api/resources/orders/exports.ts new file mode 100644 index 000000000..4e34b9508 --- /dev/null +++ b/src/api/resources/orders/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { OrdersClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts index e55a6ab4d..c36446414 100644 --- a/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributeDefinitions/client/Client.ts @@ -57,7 +57,7 @@ export class CustomAttributeDefinitionsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, limit, }; @@ -77,7 +77,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -176,7 +180,7 @@ export class CustomAttributeDefinitionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.orders.CreateOrderCustomAttributeDefinitionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -264,7 +268,11 @@ export class CustomAttributeDefinitionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -348,7 +356,7 @@ export class CustomAttributeDefinitionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.orders.UpdateOrderCustomAttributeDefinitionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -430,7 +438,7 @@ export class CustomAttributeDefinitionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/orders/resources/customAttributeDefinitions/exports.ts b/src/api/resources/orders/resources/customAttributeDefinitions/exports.ts new file mode 100644 index 000000000..89a965824 --- /dev/null +++ b/src/api/resources/orders/resources/customAttributeDefinitions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributeDefinitionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/orders/resources/customAttributes/client/Client.ts b/src/api/resources/orders/resources/customAttributes/client/Client.ts index caff150dc..a8de600a7 100644 --- a/src/api/resources/orders/resources/customAttributes/client/Client.ts +++ b/src/api/resources/orders/resources/customAttributes/client/Client.ts @@ -84,7 +84,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.orders.BulkDeleteOrderCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -194,7 +194,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.orders.BulkUpsertOrderCustomAttributesRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -273,7 +273,7 @@ export class CustomAttributesClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, limit, with_definitions: withDefinitions, @@ -294,7 +294,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -394,7 +398,11 @@ export class CustomAttributesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -484,7 +492,7 @@ export class CustomAttributesClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.orders.UpsertOrderCustomAttributeRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -569,7 +577,7 @@ export class CustomAttributesClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/orders/resources/customAttributes/exports.ts b/src/api/resources/orders/resources/customAttributes/exports.ts new file mode 100644 index 000000000..52a02441c --- /dev/null +++ b/src/api/resources/orders/resources/customAttributes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CustomAttributesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/payments/client/Client.ts b/src/api/resources/payments/client/Client.ts index 46cb14ef6..fdb570f0c 100644 --- a/src/api/resources/payments/client/Client.ts +++ b/src/api/resources/payments/client/Client.ts @@ -97,7 +97,7 @@ export class PaymentsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -115,7 +115,11 @@ export class PaymentsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -217,7 +221,7 @@ export class PaymentsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreatePaymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -302,7 +306,7 @@ export class PaymentsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CancelPaymentByIdempotencyKeyRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -377,7 +381,7 @@ export class PaymentsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -461,7 +465,7 @@ export class PaymentsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdatePaymentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -537,7 +541,7 @@ export class PaymentsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -616,7 +620,7 @@ export class PaymentsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CompletePaymentRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/payments/exports.ts b/src/api/resources/payments/exports.ts new file mode 100644 index 000000000..eba9d5cce --- /dev/null +++ b/src/api/resources/payments/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PaymentsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/payouts/client/Client.ts b/src/api/resources/payouts/client/Client.ts index a9de82cf3..2c65647ab 100644 --- a/src/api/resources/payouts/client/Client.ts +++ b/src/api/resources/payouts/client/Client.ts @@ -57,7 +57,7 @@ export class PayoutsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, begin_time: beginTime, end_time: endTime, sort_order: @@ -66,7 +66,7 @@ export class PayoutsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, limit, }; @@ -86,7 +86,11 @@ export class PayoutsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -168,7 +172,7 @@ export class PayoutsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -230,7 +234,7 @@ export class PayoutsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, cursor, limit, }; @@ -250,7 +254,11 @@ export class PayoutsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/payouts/exports.ts b/src/api/resources/payouts/exports.ts new file mode 100644 index 000000000..eadf67733 --- /dev/null +++ b/src/api/resources/payouts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { PayoutsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/refunds/client/Client.ts b/src/api/resources/refunds/client/Client.ts index aa3ab82da..7ad6262d4 100644 --- a/src/api/resources/refunds/client/Client.ts +++ b/src/api/resources/refunds/client/Client.ts @@ -87,7 +87,7 @@ export class RefundsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); const _headers: core.Fetcher.Args["headers"] = mergeHeaders( @@ -105,7 +105,11 @@ export class RefundsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -199,7 +203,7 @@ export class RefundsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.RefundPaymentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -274,7 +278,7 @@ export class RefundsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/refunds/exports.ts b/src/api/resources/refunds/exports.ts new file mode 100644 index 000000000..1bfb30e22 --- /dev/null +++ b/src/api/resources/refunds/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { RefundsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/reporting/client/Client.ts b/src/api/resources/reporting/client/Client.ts index 51451ccbc..ac765f587 100644 --- a/src/api/resources/reporting/client/Client.ts +++ b/src/api/resources/reporting/client/Client.ts @@ -56,7 +56,7 @@ export class ReportingClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -124,7 +124,7 @@ export class ReportingClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.LoadRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/reporting/exports.ts b/src/api/resources/reporting/exports.ts new file mode 100644 index 000000000..788237825 --- /dev/null +++ b/src/api/resources/reporting/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ReportingClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/sites/client/Client.ts b/src/api/resources/sites/client/Client.ts index f1ae33b79..ed071b9f3 100644 --- a/src/api/resources/sites/client/Client.ts +++ b/src/api/resources/sites/client/Client.ts @@ -57,7 +57,7 @@ export class SitesClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/sites/exports.ts b/src/api/resources/sites/exports.ts new file mode 100644 index 000000000..5d5012d4c --- /dev/null +++ b/src/api/resources/sites/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SitesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/snippets/client/Client.ts b/src/api/resources/snippets/client/Client.ts index 5136b5906..bcc7bb45b 100644 --- a/src/api/resources/snippets/client/Client.ts +++ b/src/api/resources/snippets/client/Client.ts @@ -67,7 +67,7 @@ export class SnippetsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -147,7 +147,7 @@ export class SnippetsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpsertSnippetRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -227,7 +227,7 @@ export class SnippetsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/snippets/exports.ts b/src/api/resources/snippets/exports.ts new file mode 100644 index 000000000..b8a0dca07 --- /dev/null +++ b/src/api/resources/snippets/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SnippetsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/subscriptions/client/Client.ts b/src/api/resources/subscriptions/client/Client.ts index 90c244e23..0f9a7b58c 100644 --- a/src/api/resources/subscriptions/client/Client.ts +++ b/src/api/resources/subscriptions/client/Client.ts @@ -82,7 +82,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateSubscriptionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -160,7 +160,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BulkSwapPlanRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -259,7 +259,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchSubscriptionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -338,7 +338,11 @@ export class SubscriptionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -418,7 +422,7 @@ export class SubscriptionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -499,7 +503,7 @@ export class SubscriptionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -577,7 +581,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.ChangeBillingAnchorDateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -659,7 +663,7 @@ export class SubscriptionsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -737,7 +741,11 @@ export class SubscriptionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -824,7 +832,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.PauseSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -905,7 +913,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.ResumeSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -992,7 +1000,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SwapPlanRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/subscriptions/exports.ts b/src/api/resources/subscriptions/exports.ts new file mode 100644 index 000000000..c81709609 --- /dev/null +++ b/src/api/resources/subscriptions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SubscriptionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/team/client/Client.ts b/src/api/resources/team/client/Client.ts index 16907dc6f..91e0de25e 100644 --- a/src/api/resources/team/client/Client.ts +++ b/src/api/resources/team/client/Client.ts @@ -65,7 +65,11 @@ export class TeamClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -140,7 +144,7 @@ export class TeamClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateJobRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -215,7 +219,7 @@ export class TeamClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -297,7 +301,7 @@ export class TeamClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateJobRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/team/exports.ts b/src/api/resources/team/exports.ts new file mode 100644 index 000000000..51ee1de62 --- /dev/null +++ b/src/api/resources/team/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TeamClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/teamMembers/client/Client.ts b/src/api/resources/teamMembers/client/Client.ts index 7db7a22c4..9473a13c2 100644 --- a/src/api/resources/teamMembers/client/Client.ts +++ b/src/api/resources/teamMembers/client/Client.ts @@ -104,7 +104,7 @@ export class TeamMembersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateTeamMemberRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -210,7 +210,7 @@ export class TeamMembersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchCreateTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -319,7 +319,7 @@ export class TeamMembersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchUpdateTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -402,7 +402,7 @@ export class TeamMembersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchTeamMembersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -478,7 +478,7 @@ export class TeamMembersClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -588,7 +588,7 @@ export class TeamMembersClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateTeamMemberRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/teamMembers/exports.ts b/src/api/resources/teamMembers/exports.ts new file mode 100644 index 000000000..454d0d7b4 --- /dev/null +++ b/src/api/resources/teamMembers/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TeamMembersClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts index 804521edf..07d045117 100644 --- a/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts +++ b/src/api/resources/teamMembers/resources/wageSetting/client/Client.ts @@ -67,7 +67,7 @@ export class WageSettingClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -169,7 +169,7 @@ export class WageSettingClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.teamMembers.UpdateWageSettingRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/teamMembers/resources/wageSetting/exports.ts b/src/api/resources/teamMembers/resources/wageSetting/exports.ts new file mode 100644 index 000000000..1caaead85 --- /dev/null +++ b/src/api/resources/teamMembers/resources/wageSetting/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WageSettingClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/terminal/client/Client.ts b/src/api/resources/terminal/client/Client.ts index f0cb9e79c..694234f16 100644 --- a/src/api/resources/terminal/client/Client.ts +++ b/src/api/resources/terminal/client/Client.ts @@ -82,7 +82,7 @@ export class TerminalClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -157,7 +157,7 @@ export class TerminalClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -232,7 +232,7 @@ export class TerminalClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/terminal/exports.ts b/src/api/resources/terminal/exports.ts new file mode 100644 index 000000000..a2ad5ee01 --- /dev/null +++ b/src/api/resources/terminal/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TerminalClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/terminal/resources/actions/client/Client.ts b/src/api/resources/terminal/resources/actions/client/Client.ts index 2bb65adfb..7ee08804e 100644 --- a/src/api/resources/terminal/resources/actions/client/Client.ts +++ b/src/api/resources/terminal/resources/actions/client/Client.ts @@ -71,7 +71,7 @@ export class ActionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.terminal.CreateTerminalActionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -156,7 +156,7 @@ export class ActionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.terminal.SearchTerminalActionsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -231,7 +231,7 @@ export class ActionsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -306,7 +306,7 @@ export class ActionsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/terminal/resources/actions/exports.ts b/src/api/resources/terminal/resources/actions/exports.ts new file mode 100644 index 000000000..1893fe644 --- /dev/null +++ b/src/api/resources/terminal/resources/actions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { ActionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/terminal/resources/checkouts/client/Client.ts b/src/api/resources/terminal/resources/checkouts/client/Client.ts index 01ab09c89..6f8840c78 100644 --- a/src/api/resources/terminal/resources/checkouts/client/Client.ts +++ b/src/api/resources/terminal/resources/checkouts/client/Client.ts @@ -74,7 +74,7 @@ export class CheckoutsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.terminal.CreateTerminalCheckoutRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -154,7 +154,7 @@ export class CheckoutsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.terminal.SearchTerminalCheckoutsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -234,7 +234,7 @@ export class CheckoutsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -309,7 +309,7 @@ export class CheckoutsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/terminal/resources/checkouts/exports.ts b/src/api/resources/terminal/resources/checkouts/exports.ts new file mode 100644 index 000000000..2020d5f4a --- /dev/null +++ b/src/api/resources/terminal/resources/checkouts/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { CheckoutsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/terminal/resources/refunds/client/Client.ts b/src/api/resources/terminal/resources/refunds/client/Client.ts index 683468d8c..2ffb3ca3b 100644 --- a/src/api/resources/terminal/resources/refunds/client/Client.ts +++ b/src/api/resources/terminal/resources/refunds/client/Client.ts @@ -71,7 +71,7 @@ export class RefundsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.terminal.CreateTerminalRefundRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -151,7 +151,7 @@ export class RefundsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.terminal.SearchTerminalRefundsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -226,7 +226,7 @@ export class RefundsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -301,7 +301,7 @@ export class RefundsClient { ), method: "POST", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/terminal/resources/refunds/exports.ts b/src/api/resources/terminal/resources/refunds/exports.ts new file mode 100644 index 000000000..1bfb30e22 --- /dev/null +++ b/src/api/resources/terminal/resources/refunds/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { RefundsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/transferOrders/client/Client.ts b/src/api/resources/transferOrders/client/Client.ts index 9b6c09075..a39b36f58 100644 --- a/src/api/resources/transferOrders/client/Client.ts +++ b/src/api/resources/transferOrders/client/Client.ts @@ -96,7 +96,7 @@ export class TransferOrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateTransferOrderRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -186,7 +186,7 @@ export class TransferOrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchTransferOrdersRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -283,7 +283,7 @@ export class TransferOrdersClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -381,7 +381,7 @@ export class TransferOrdersClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -469,7 +469,11 @@ export class TransferOrdersClient { ), method: "DELETE", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -556,7 +560,7 @@ export class TransferOrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CancelTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -666,7 +670,7 @@ export class TransferOrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.ReceiveTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -756,7 +760,7 @@ export class TransferOrdersClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.StartTransferOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/transferOrders/exports.ts b/src/api/resources/transferOrders/exports.ts new file mode 100644 index 000000000..fa2b8c58e --- /dev/null +++ b/src/api/resources/transferOrders/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { TransferOrdersClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/v1Transactions/client/Client.ts b/src/api/resources/v1Transactions/client/Client.ts index e599da1d9..9e9b45a28 100644 --- a/src/api/resources/v1Transactions/client/Client.ts +++ b/src/api/resources/v1Transactions/client/Client.ts @@ -24,6 +24,8 @@ export class V1TransactionsClient { } /** + * @deprecated + * * Provides summary information for a merchant's online store orders. * * @param {Square.V1ListOrdersRequest} request @@ -53,7 +55,7 @@ export class V1TransactionsClient { order: order !== undefined ? serializers.SortOrder.jsonOrThrow(order, { unrecognizedObjectKeys: "strip", omitUndefined: true }) - : null, + : undefined, limit, batch_token: batchToken, }; @@ -73,7 +75,11 @@ export class V1TransactionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -105,6 +111,8 @@ export class V1TransactionsClient { } /** + * @deprecated + * * Provides comprehensive information for a single online store order, including the order's history. * * @param {Square.V1RetrieveOrderRequest} request @@ -144,7 +152,7 @@ export class V1TransactionsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -181,6 +189,8 @@ export class V1TransactionsClient { } /** + * @deprecated + * * Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: * * @param {Square.V1UpdateOrderRequest} request @@ -222,7 +232,7 @@ export class V1TransactionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.V1UpdateOrderRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/v1Transactions/exports.ts b/src/api/resources/v1Transactions/exports.ts new file mode 100644 index 000000000..c349b8a7b --- /dev/null +++ b/src/api/resources/v1Transactions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { V1TransactionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/vendors/client/Client.ts b/src/api/resources/vendors/client/Client.ts index d0255b28d..979dd170b 100644 --- a/src/api/resources/vendors/client/Client.ts +++ b/src/api/resources/vendors/client/Client.ts @@ -82,7 +82,7 @@ export class VendorsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchCreateVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -157,7 +157,7 @@ export class VendorsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchGetVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -239,7 +239,7 @@ export class VendorsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.BatchUpdateVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -333,7 +333,7 @@ export class VendorsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.CreateVendorRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -406,7 +406,7 @@ export class VendorsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.SearchVendorsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -481,7 +481,7 @@ export class VendorsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -561,7 +561,7 @@ export class VendorsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.UpdateVendorRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/vendors/exports.ts b/src/api/resources/vendors/exports.ts new file mode 100644 index 000000000..2d371726a --- /dev/null +++ b/src/api/resources/vendors/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { VendorsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/webhooks/exports.ts b/src/api/resources/webhooks/exports.ts new file mode 100644 index 000000000..f1c7c94fd --- /dev/null +++ b/src/api/resources/webhooks/exports.ts @@ -0,0 +1,5 @@ +// This file was auto-generated by Fern from our API Definition. + +export { WebhooksClient } from "./client/Client"; +export * from "./client/index"; +export * from "./resources/index"; diff --git a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts index 9dfeb98e0..e0e876ff0 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/Client.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/Client.ts @@ -26,7 +26,7 @@ export class EventTypesClient { /** * Lists all webhook event types that can be subscribed to. * - * @param {Square.webhooks.ListEventTypesRequest} request + * @param {Square.webhooks.ListEventTypesBody} request * @param {EventTypesClient.RequestOptions} requestOptions - Request-specific configuration. * * @example @@ -35,14 +35,14 @@ export class EventTypesClient { * }) */ public list( - request: Square.webhooks.ListEventTypesRequest = {}, + request: Square.webhooks.ListEventTypesBody = {}, requestOptions?: EventTypesClient.RequestOptions, ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__list(request, requestOptions)); } private async __list( - request: Square.webhooks.ListEventTypesRequest = {}, + request: Square.webhooks.ListEventTypesBody = {}, requestOptions?: EventTypesClient.RequestOptions, ): Promise> { const { apiVersion } = request; @@ -65,7 +65,11 @@ export class EventTypesClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesBody.ts similarity index 88% rename from src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts rename to src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesBody.ts index 4b8cfb8d4..683b0ae89 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesRequest.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/ListEventTypesBody.ts @@ -6,7 +6,7 @@ * apiVersion: "api_version" * } */ -export interface ListEventTypesRequest { +export interface ListEventTypesBody { /** The API version for which to list event types. Setting this field overrides the default version used by the application. */ apiVersion?: string | null; } diff --git a/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts b/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts index 6482bea3a..809f0099c 100644 --- a/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts +++ b/src/api/resources/webhooks/resources/eventTypes/client/requests/index.ts @@ -1 +1 @@ -export type { ListEventTypesRequest } from "./ListEventTypesRequest"; +export type { ListEventTypesBody } from "./ListEventTypesBody"; diff --git a/src/api/resources/webhooks/resources/eventTypes/exports.ts b/src/api/resources/webhooks/resources/eventTypes/exports.ts new file mode 100644 index 000000000..f072eb204 --- /dev/null +++ b/src/api/resources/webhooks/resources/eventTypes/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { EventTypesClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts index f16a46a9f..e5b246bfc 100644 --- a/src/api/resources/webhooks/resources/subscriptions/client/Client.ts +++ b/src/api/resources/webhooks/resources/subscriptions/client/Client.ts @@ -55,7 +55,7 @@ export class SubscriptionsClient { unrecognizedObjectKeys: "strip", omitUndefined: true, }) - : null, + : undefined, limit, }; const _authRequest: core.AuthRequest = await this._options.authProvider.getAuthRequest(); @@ -74,7 +74,11 @@ export class SubscriptionsClient { ), method: "GET", headers: _headers, - queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + queryString: core.url + .queryBuilder() + .addMany(_queryParams) + .mergeAdditional(requestOptions?.queryParams) + .build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -166,7 +170,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.webhooks.CreateWebhookSubscriptionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip", @@ -241,7 +245,7 @@ export class SubscriptionsClient { ), method: "GET", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -321,7 +325,7 @@ export class SubscriptionsClient { method: "PUT", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.webhooks.UpdateWebhookSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -401,7 +405,7 @@ export class SubscriptionsClient { ), method: "DELETE", headers: _headers, - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000, maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries, abortSignal: requestOptions?.abortSignal, @@ -478,7 +482,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.webhooks.UpdateWebhookSubscriptionSignatureKeyRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", @@ -560,7 +564,7 @@ export class SubscriptionsClient { method: "POST", headers: _headers, contentType: "application/json", - queryParameters: requestOptions?.queryParams, + queryString: core.url.queryBuilder().mergeAdditional(requestOptions?.queryParams).build(), requestType: "json", body: serializers.webhooks.TestWebhookSubscriptionRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip", diff --git a/src/api/resources/webhooks/resources/subscriptions/exports.ts b/src/api/resources/webhooks/resources/subscriptions/exports.ts new file mode 100644 index 000000000..c81709609 --- /dev/null +++ b/src/api/resources/webhooks/resources/subscriptions/exports.ts @@ -0,0 +1,4 @@ +// This file was auto-generated by Fern from our API Definition. + +export { SubscriptionsClient } from "./client/Client"; +export * from "./client/index"; diff --git a/src/api/types/Fulfillment.ts b/src/api/types/Fulfillment.ts index ba69a5c04..e46180ce5 100644 --- a/src/api/types/Fulfillment.ts +++ b/src/api/types/Fulfillment.ts @@ -60,7 +60,7 @@ export interface Fulfillment { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; /** * Contains details for a pickup fulfillment. These details are required when the fulfillment * type is `PICKUP`. diff --git a/src/api/types/FulfillmentFulfillmentEntry.ts b/src/api/types/FulfillmentFulfillmentEntry.ts index e7d955961..3140f2ccd 100644 --- a/src/api/types/FulfillmentFulfillmentEntry.ts +++ b/src/api/types/FulfillmentFulfillmentEntry.ts @@ -38,5 +38,5 @@ export interface FulfillmentFulfillmentEntry { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; } diff --git a/src/api/types/LoadResponse.ts b/src/api/types/LoadResponse.ts index 8754c1cf1..be4c24e8e 100644 --- a/src/api/types/LoadResponse.ts +++ b/src/api/types/LoadResponse.ts @@ -5,14 +5,13 @@ import type * as Square from "../index"; export interface LoadResponse { dataSource?: string; annotation?: Square.LoadResultAnnotation; - data?: Square.LoadResultDataRow; - refreshKeyValues?: Record[]; + data?: Square.LoadResultData; lastRefreshTime?: string; - pivotQuery?: Record; - slowQuery?: boolean; - queryType?: string; query?: Record; + slowQuery?: boolean; external?: boolean; dbType?: string; - error?: string; + refreshKeyValues?: Record[]; + pivotQuery?: Record; + queryType?: string; } diff --git a/src/api/types/LoadResult.ts b/src/api/types/LoadResult.ts deleted file mode 100644 index 30c972163..000000000 --- a/src/api/types/LoadResult.ts +++ /dev/null @@ -1,11 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../index"; - -export interface LoadResult { - dataSource?: string; - annotation: Square.LoadResultAnnotation; - data: Square.LoadResultData; - refreshKeyValues?: Record[]; - lastRefreshTime?: string; -} diff --git a/src/api/types/LoyaltyEvent.ts b/src/api/types/LoyaltyEvent.ts index 0d1499926..322f2f4d5 100644 --- a/src/api/types/LoyaltyEvent.ts +++ b/src/api/types/LoyaltyEvent.ts @@ -13,7 +13,7 @@ export interface LoyaltyEvent { * The type of the loyalty event. * See [LoyaltyEventType](#type-loyaltyeventtype) for possible values */ - type: Square.LoyaltyEventType; + type?: Square.LoyaltyEventType; /** The timestamp when the event was created, in RFC 3339 format. */ createdAt?: string; /** Provides metadata when the event `type` is `ACCUMULATE_POINTS`. */ @@ -34,7 +34,7 @@ export interface LoyaltyEvent { * Defines whether the event was generated by the Square Point of Sale. * See [LoyaltyEventSource](#type-loyaltyeventsource) for possible values */ - source: Square.LoyaltyEventSource; + source?: Square.LoyaltyEventSource; /** Provides metadata when the event `type` is `EXPIRE_POINTS`. */ expirePoints?: Square.LoyaltyEventExpirePoints; /** Provides metadata when the event `type` is `OTHER`. */ diff --git a/src/api/types/Order.ts b/src/api/types/Order.ts index 0cf2e9d87..dfcf110ea 100644 --- a/src/api/types/Order.ts +++ b/src/api/types/Order.ts @@ -108,7 +108,7 @@ export interface Order { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; /** The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). */ createdAt?: string; /** The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). */ diff --git a/src/api/types/OrderLineItem.ts b/src/api/types/OrderLineItem.ts index 8ff483a7d..6aa4386c8 100644 --- a/src/api/types/OrderLineItem.ts +++ b/src/api/types/OrderLineItem.ts @@ -60,7 +60,7 @@ export interface OrderLineItem { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; /** The [CatalogModifier](entity:CatalogModifier)s applied to this line item. */ modifiers?: Square.OrderLineItemModifier[] | null; /** diff --git a/src/api/types/OrderLineItemDiscount.ts b/src/api/types/OrderLineItemDiscount.ts index 4ccd30a5a..2ef2df5f2 100644 --- a/src/api/types/OrderLineItemDiscount.ts +++ b/src/api/types/OrderLineItemDiscount.ts @@ -69,7 +69,7 @@ export interface OrderLineItemDiscount { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; /** * Indicates the level at which the discount applies. For `ORDER` scoped discounts, * Square generates references in `applied_discounts` on all order line items that do diff --git a/src/api/types/OrderLineItemModifier.ts b/src/api/types/OrderLineItemModifier.ts index 651192f32..d22d85bee 100644 --- a/src/api/types/OrderLineItemModifier.ts +++ b/src/api/types/OrderLineItemModifier.ts @@ -57,5 +57,5 @@ export interface OrderLineItemModifier { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; } diff --git a/src/api/types/OrderLineItemTax.ts b/src/api/types/OrderLineItemTax.ts index 46f8582a5..d2acdbe26 100644 --- a/src/api/types/OrderLineItemTax.ts +++ b/src/api/types/OrderLineItemTax.ts @@ -49,7 +49,7 @@ export interface OrderLineItemTax { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; /** * The amount of money applied to the order by the tax. * diff --git a/src/api/types/OrderServiceCharge.ts b/src/api/types/OrderServiceCharge.ts index 78b2d6770..2d7c053d7 100644 --- a/src/api/types/OrderServiceCharge.ts +++ b/src/api/types/OrderServiceCharge.ts @@ -93,7 +93,7 @@ export interface OrderServiceCharge { * * For more information, see [Metadata](https://developer.squareup.com/docs/build-basics/metadata). */ - metadata?: Record | null; + metadata?: Record | null; /** * The type of the service charge. * See [OrderServiceChargeType](#type-orderservicechargetype) for possible values diff --git a/src/api/types/ResponseFormat.ts b/src/api/types/ResponseFormat.ts deleted file mode 100644 index 5783d563a..000000000 --- a/src/api/types/ResponseFormat.ts +++ /dev/null @@ -1,9 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -/** Output format of the result `data` payload. `default` returns row-oriented data (`LoadResultDataRow`); `compact` returns a `{ members, dataset }` object with rows of primitive arrays (`LoadResultDataCompact`); `columnar` returns a `{ members, columns }` object with one primitive array per member (`LoadResultDataColumnar`). */ -export const ResponseFormat = { - Default: "default", - Compact: "compact", - Columnar: "columnar", -} as const; -export type ResponseFormat = (typeof ResponseFormat)[keyof typeof ResponseFormat]; diff --git a/src/api/types/TimeDimension.ts b/src/api/types/TimeDimension.ts index 4909d11b1..a8df59386 100644 --- a/src/api/types/TimeDimension.ts +++ b/src/api/types/TimeDimension.ts @@ -1,7 +1,9 @@ // This file was auto-generated by Fern from our API Definition. +import type * as Square from "../index"; + export interface TimeDimension { dimension: string; granularity?: string; - dateRange?: string | string[] | Record; + dateRange?: Square.TimeDimensionDateRange; } diff --git a/src/api/types/TimeDimensionDateRange.ts b/src/api/types/TimeDimensionDateRange.ts new file mode 100644 index 000000000..d4cc88df7 --- /dev/null +++ b/src/api/types/TimeDimensionDateRange.ts @@ -0,0 +1,3 @@ +// This file was auto-generated by Fern from our API Definition. + +export type TimeDimensionDateRange = string | string[] | Record; diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 8cb2912c3..0f157e6da 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -807,7 +807,6 @@ export * from "./ListWebhookEventTypesResponse"; export * from "./ListWebhookSubscriptionsResponse"; export * from "./ListWorkweekConfigsResponse"; export * from "./LoadResponse"; -export * from "./LoadResult"; export * from "./LoadResultAnnotation"; export * from "./LoadResultData"; export * from "./LoadResultDataColumnar"; @@ -1094,7 +1093,6 @@ export * from "./RegisterDomainResponse"; export * from "./RegisterDomainResponseStatus"; export * from "./RemoveGroupFromCustomerResponse"; export * from "./ReportingError"; -export * from "./ResponseFormat"; export * from "./ResumeSubscriptionResponse"; export * from "./RetrieveBookingCustomAttributeDefinitionResponse"; export * from "./RetrieveBookingCustomAttributeResponse"; @@ -1296,6 +1294,7 @@ export * from "./TimecardWage"; export * from "./TimecardWorkday"; export * from "./TimecardWorkdayMatcher"; export * from "./TimeDimension"; +export * from "./TimeDimensionDateRange"; export * from "./TimeRange"; export * from "./TipSettings"; export * from "./Transaction"; diff --git a/src/core/auth/AuthProvider.ts b/src/core/auth/AuthProvider.ts index ccb4263ea..b25445927 100644 --- a/src/core/auth/AuthProvider.ts +++ b/src/core/auth/AuthProvider.ts @@ -4,3 +4,12 @@ import type { AuthRequest } from "./AuthRequest"; export interface AuthProvider { getAuthRequest(arg?: { endpointMetadata?: EndpointMetadata }): Promise; } + +export function isAuthProvider(value: unknown): value is AuthProvider { + return ( + typeof value === "object" && + value !== null && + "getAuthRequest" in value && + typeof value.getAuthRequest === "function" + ); +} diff --git a/src/core/auth/BasicAuth.ts b/src/core/auth/BasicAuth.ts index c6efa5e26..60d551485 100644 --- a/src/core/auth/BasicAuth.ts +++ b/src/core/auth/BasicAuth.ts @@ -1,8 +1,8 @@ import { base64Decode, base64Encode } from "../base64"; export interface BasicAuth { - username: string; - password: string; + username?: string; + password?: string; } const BASIC_AUTH_HEADER_PREFIX = /^Basic /i; @@ -12,7 +12,12 @@ export const BasicAuth = { if (basicAuth == null) { return undefined; } - const token = base64Encode(`${basicAuth.username}:${basicAuth.password}`); + const username = basicAuth.username ?? ""; + const password = basicAuth.password ?? ""; + if (username === "" && password === "") { + return undefined; + } + const token = base64Encode(`${username}:${password}`); return `Basic ${token}`; }, fromAuthorizationHeader: (header: string): BasicAuth => { diff --git a/src/core/auth/index.ts b/src/core/auth/index.ts index 49c181aec..79abb441d 100644 --- a/src/core/auth/index.ts +++ b/src/core/auth/index.ts @@ -1,4 +1,4 @@ -export type { AuthProvider } from "./AuthProvider"; +export { type AuthProvider, isAuthProvider } from "./AuthProvider"; export type { AuthRequest } from "./AuthRequest"; export { BasicAuth } from "./BasicAuth"; export { BearerToken } from "./BearerToken"; diff --git a/src/core/fetcher/BinaryResponse.ts b/src/core/fetcher/BinaryResponse.ts index bca7f4c77..b9e40fb62 100644 --- a/src/core/fetcher/BinaryResponse.ts +++ b/src/core/fetcher/BinaryResponse.ts @@ -14,7 +14,7 @@ export type BinaryResponse = { * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Request/bytes) * Some versions of the Fetch API may not support this method. */ - bytes?(): ReturnType; + bytes?(): Promise; }; export function getBinaryResponse(response: Response): BinaryResponse { diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index 7c22d4f8f..f59409ce0 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -21,7 +21,13 @@ export declare namespace Fetcher { method: string; contentType?: string; headers?: Record; + /** + * @deprecated Prefer `queryString` (produced by `core.url.queryBuilder()`). + * Retained for backwards compatibility with custom fetchers and callers that + * still construct request args with a query-parameter object. + */ queryParameters?: Record; + queryString?: string; body?: unknown; timeoutMs?: number; maxRetries?: number; @@ -56,11 +62,13 @@ export declare namespace Fetcher { export interface TimeoutError { reason: "timeout"; + cause?: unknown; } export interface UnknownError { reason: "unknown"; errorMessage: string; + cause?: unknown; } } @@ -116,17 +124,15 @@ const SENSITIVE_QUERY_PARAMS = new Set([ "session-id", ]); -function redactQueryParameters(queryParameters?: Record): Record | undefined { +function redactQueryParameters( + queryParameters: Record | undefined, +): Record | undefined { if (queryParameters == null) { - return queryParameters; + return undefined; } const redacted: Record = {}; for (const [key, value] of Object.entries(queryParameters)) { - if (SENSITIVE_QUERY_PARAMS.has(key.toLowerCase())) { - redacted[key] = "[REDACTED]"; - } else { - redacted[key] = value; - } + redacted[key] = SENSITIVE_QUERY_PARAMS.has(key.toLowerCase()) ? "[REDACTED]" : value; } return redacted; } @@ -218,7 +224,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); @@ -243,7 +255,12 @@ async function getHeaders(args: Fetcher.Args): Promise { } export async function fetcherImpl(args: Fetcher.Args): Promise> { - const url = createRequestUrl(args.url, args.queryParameters); + let url = args.url; + if (args.queryString != null && args.queryString.length > 0) { + url = `${url}?${args.queryString}`; + } else { + url = createRequestUrl(args.url, args.queryParameters); + } const requestBody: BodyInit | undefined = await getRequestBody({ body: args.body, type: args.requestType ?? "other", @@ -276,6 +293,7 @@ export async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise { switch (responseType) { case "binary-response": @@ -21,8 +31,9 @@ export async function getResponseBody(response: Response, responseType?: string) }, }; } + retainResponse(response.body, response); return response.body; - case "streaming": + case "streaming": { if (response.body == null) { return { ok: false, @@ -33,7 +44,10 @@ export async function getResponseBody(response: Response, responseType?: string) }; } - return chooseStreamWrapper(response.body); + const wrapper = await chooseStreamWrapper(response.body); + retainResponse(wrapper, response); + return wrapper; + } case "text": return await response.text(); diff --git a/src/core/fetcher/index.ts b/src/core/fetcher/index.ts index 2f32091ef..6e165a0de 100644 --- a/src/core/fetcher/index.ts +++ b/src/core/fetcher/index.ts @@ -6,6 +6,8 @@ export type { Fetcher, FetchFunction } from "./Fetcher"; export { fetcher } from "./Fetcher"; export { getHeader } from "./getHeader"; export { HttpResponsePromise } from "./HttpResponsePromise"; +export type { PassthroughRequest } from "./makePassthroughRequest"; +export { makePassthroughRequest } from "./makePassthroughRequest"; export type { RawResponse, WithRawResponse } from "./RawResponse"; export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse"; export { Supplier } from "./Supplier"; diff --git a/src/core/fetcher/makePassthroughRequest.ts b/src/core/fetcher/makePassthroughRequest.ts new file mode 100644 index 000000000..82166dcf1 --- /dev/null +++ b/src/core/fetcher/makePassthroughRequest.ts @@ -0,0 +1,189 @@ +import { createLogger, type LogConfig, type Logger } from "../logging/logger"; +import { join } from "../url/join"; +import { EndpointSupplier } from "./EndpointSupplier"; +import { getFetchFn } from "./getFetchFn"; +import { makeRequest } from "./makeRequest"; +import { requestWithRetries } from "./requestWithRetries"; +import { Supplier } from "./Supplier"; + +export declare namespace PassthroughRequest { + /** + * Per-request options that can override the SDK client defaults. + */ + export interface RequestOptions { + /** Override the default timeout for this request (in seconds). */ + timeoutInSeconds?: number; + /** Override the default number of retries for this request. */ + maxRetries?: number; + /** Additional headers to include in this request. */ + headers?: Record; + /** Abort signal for this request. */ + abortSignal?: AbortSignal; + } + + /** + * SDK client configuration used by the passthrough fetch method. + */ + export interface ClientOptions { + /** The base URL or environment for the client. */ + environment?: Supplier; + /** Override the base URL. */ + baseUrl?: Supplier; + /** Default headers to include in requests. */ + headers?: Record; + /** Default maximum time to wait for a response in seconds. */ + timeoutInSeconds?: number; + /** Default number of times to retry the request. Defaults to 2. */ + maxRetries?: number; + /** A custom fetch function. */ + fetch?: typeof fetch; + /** Logging configuration. */ + logging?: LogConfig | Logger; + /** A function that returns auth headers. */ + getAuthHeaders?: () => Promise>; + } +} + +/** + * Makes a passthrough HTTP request using the SDK's configuration (auth, retry, logging, etc.) + * while mimicking the standard `fetch` API. + * + * @param input - The URL, path, or Request object. If a relative path, it will be resolved against the configured base URL. + * @param init - Standard RequestInit options (method, headers, body, signal, etc.) + * @param clientOptions - SDK client options (auth, default headers, logging, etc.) + * @param requestOptions - Per-request overrides (timeout, retries, extra headers, abort signal). + * @returns A standard Response object. + */ +export async function makePassthroughRequest( + input: Request | string | URL, + init: RequestInit | undefined, + clientOptions: PassthroughRequest.ClientOptions, + requestOptions?: PassthroughRequest.RequestOptions, +): Promise { + const logger = createLogger(clientOptions.logging); + + // Extract URL and default init properties from Request object if provided + let url: string; + let effectiveInit: RequestInit | undefined = init; + if (input instanceof Request) { + url = input.url; + // If no explicit init provided, extract properties from the Request object + if (init == null) { + effectiveInit = { + method: input.method, + headers: Object.fromEntries(input.headers.entries()), + body: input.body, + signal: input.signal, + credentials: input.credentials, + cache: input.cache as RequestCache, + redirect: input.redirect, + referrer: input.referrer, + integrity: input.integrity, + mode: input.mode, + }; + } + } else { + url = input instanceof URL ? input.toString() : input; + } + + // Resolve the base URL + const baseUrl = + (clientOptions.baseUrl != null ? await Supplier.get(clientOptions.baseUrl) : undefined) ?? + (clientOptions.environment != null ? await Supplier.get(clientOptions.environment) : undefined); + + // Determine the full URL + let fullUrl: string; + if (url.startsWith("http://") || url.startsWith("https://")) { + fullUrl = url; + } else if (baseUrl != null) { + fullUrl = join(baseUrl, url); + } else { + fullUrl = url; + } + + // Merge headers: SDK default headers -> auth headers -> user-provided headers + const mergedHeaders: Record = {}; + + // Apply SDK default headers (resolve suppliers) + if (clientOptions.headers != null) { + for (const [key, value] of Object.entries(clientOptions.headers)) { + const resolved = await EndpointSupplier.get(value, { endpointMetadata: {} }); + if (resolved != null) { + mergedHeaders[key.toLowerCase()] = `${resolved}`; + } + } + } + + // Apply auth headers + if (clientOptions.getAuthHeaders != null) { + const authHeaders = await clientOptions.getAuthHeaders(); + for (const [key, value] of Object.entries(authHeaders)) { + mergedHeaders[key.toLowerCase()] = value; + } + } + + // Apply user-provided headers from init + if (effectiveInit?.headers != null) { + const initHeaders = + effectiveInit.headers instanceof Headers + ? Object.fromEntries(effectiveInit.headers.entries()) + : Array.isArray(effectiveInit.headers) + ? Object.fromEntries(effectiveInit.headers) + : effectiveInit.headers; + for (const [key, value] of Object.entries(initHeaders)) { + if (value != null) { + mergedHeaders[key.toLowerCase()] = value; + } + } + } + + // Apply per-request option headers (highest priority) + if (requestOptions?.headers != null) { + for (const [key, value] of Object.entries(requestOptions.headers)) { + mergedHeaders[key.toLowerCase()] = value; + } + } + + const method = effectiveInit?.method ?? "GET"; + const body = effectiveInit?.body; + const timeoutInSeconds = requestOptions?.timeoutInSeconds ?? clientOptions.timeoutInSeconds; + const timeoutMs = timeoutInSeconds != null ? timeoutInSeconds * 1000 : undefined; + const maxRetries = requestOptions?.maxRetries ?? clientOptions.maxRetries; + const abortSignal = requestOptions?.abortSignal ?? effectiveInit?.signal ?? undefined; + const fetchFn = clientOptions.fetch ?? (await getFetchFn()); + + if (logger.isDebug()) { + logger.debug("Making passthrough HTTP request", { + method, + url: fullUrl, + hasBody: body != null, + }); + } + + const response = await requestWithRetries( + async () => + makeRequest( + fetchFn, + fullUrl, + method, + mergedHeaders, + body ?? undefined, + timeoutMs, + abortSignal, + effectiveInit?.credentials === "include", + undefined, // duplex + false, // disableCache + ), + maxRetries, + ); + + if (logger.isDebug()) { + logger.debug("Passthrough HTTP request completed", { + method, + url: fullUrl, + statusCode: response.status, + }); + } + + return response; +} diff --git a/src/core/fetcher/makeRequest.ts b/src/core/fetcher/makeRequest.ts index a00ac2e23..821101b57 100644 --- a/src/core/fetcher/makeRequest.ts +++ b/src/core/fetcher/makeRequest.ts @@ -1,5 +1,31 @@ import { anySignal, getTimeoutSignal } from "./signals"; +/** + * Cached result of checking whether the current runtime supports + * the `cache` option in `Request`. Some runtimes (e.g. Cloudflare Workers) + * throw a TypeError when this option is used. + */ +let _cacheNoStoreSupported: boolean | undefined; +export function isCacheNoStoreSupported(): boolean { + if (_cacheNoStoreSupported != null) { + return _cacheNoStoreSupported; + } + try { + new Request("http://localhost", { cache: "no-store" }); + _cacheNoStoreSupported = true; + } catch { + _cacheNoStoreSupported = false; + } + return _cacheNoStoreSupported; +} + +/** + * Reset the cached result of `isCacheNoStoreSupported`. Exposed for testing only. + */ +export function resetCacheNoStoreSupported(): void { + _cacheNoStoreSupported = undefined; +} + export const makeRequest = async ( fetchFn: (url: string, init: RequestInit) => 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/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index 1f689688c..5e66b9330 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,6 +3,10 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter +function isRetryableStatusCode(statusCode: number): boolean { + return [408, 429].includes(statusCode) || statusCode >= 500; +} + function addPositiveJitter(delay: number): number { const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; return delay * jitterMultiplier; @@ -51,7 +55,7 @@ export async function requestWithRetries( let response: Response = await requestFn(); for (let i = 0; i < maxRetries; ++i) { - if ([408, 429].includes(response.status) || response.status >= 500) { + if (isRetryableStatusCode(response.status)) { const delay = getRetryDelayFromHeaders(response, i); await new Promise((resolve) => setTimeout(resolve, delay)); diff --git a/src/core/fetcher/signals.ts b/src/core/fetcher/signals.ts index 7bd3757ec..ba74c4d02 100644 --- a/src/core/fetcher/signals.ts +++ b/src/core/fetcher/signals.ts @@ -14,12 +14,21 @@ export function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal for (const signal of signals) { if (signal.aborted) { controller.abort((signal as any)?.reason); - break; + return controller.signal; } signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { signal: controller.signal, }); + + // Re-check after adding listener: the signal may have aborted + // between the initial `signal.aborted` check and the `addEventListener` + // call above. If it did, the abort event was already dispatched and + // the listener will never fire — we must manually abort. + if (signal.aborted) { + controller.abort((signal as any)?.reason); + return controller.signal; + } } return controller.signal; diff --git a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts index aae72d2f2..3cbc25b70 100644 --- a/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.ts @@ -183,7 +183,7 @@ export class Node18UniversalStreamWrapper(): Promise { diff --git a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts index 262ac1303..9b9a1961b 100644 --- a/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts +++ b/src/core/fetcher/stream-wrappers/UndiciStreamWrapper.ts @@ -156,7 +156,7 @@ export class UndiciStreamWrapper { - const chunks: BlobPart[] = []; + const chunks: ReadFormat[] = []; while (true) { const { done, value } = await this.reader.read(); @@ -169,7 +169,7 @@ export class UndiciStreamWrapper(): Promise { diff --git a/src/core/file/file.ts b/src/core/file/file.ts index 35044a220..65065c3f0 100644 --- a/src/core/file/file.ts +++ b/src/core/file/file.ts @@ -48,7 +48,7 @@ async function getFileWithMetadata( if ("path" in file) { const fs = await import("fs"); - if (!fs || !fs.createReadStream) { + if (!fs?.createReadStream) { throw new Error("File path uploads are not supported in this environment."); } const data = fs.createReadStream(file.path); @@ -97,7 +97,7 @@ function isFileLike(value: unknown): value is Uploadable.FileLike { async function tryGetFileSizeFromPath(path: string): Promise { try { const fs = await import("fs"); - if (!fs || !fs.promises || !fs.promises.stat) { + if (!fs?.promises?.stat) { return undefined; } const fileStat = await fs.promises.stat(path); diff --git a/src/core/form-data-utils/FormDataWrapper.ts b/src/core/form-data-utils/FormDataWrapper.ts index 5e5ddc142..78fdf35de 100644 --- a/src/core/form-data-utils/FormDataWrapper.ts +++ b/src/core/form-data-utils/FormDataWrapper.ts @@ -248,7 +248,7 @@ async function streamToBuffer(stream: unknown): Promise { async function convertToBlob(value: unknown, contentType?: string): Promise { if (isStreamLike(value) || isReadableStream(value)) { const buffer = await streamToBuffer(value); - return new Blob([buffer], { type: contentType }); + return new Blob([buffer as BlobPart], { type: contentType }); } if (value instanceof Blob) { @@ -256,7 +256,7 @@ async function convertToBlob(value: unknown, contentType?: string): Promise 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/enum/enum.ts b/src/core/schemas/builders/enum/enum.ts index c2c49a323..f163d0b56 100644 --- a/src/core/schemas/builders/enum/enum.ts +++ b/src/core/schemas/builders/enum/enum.ts @@ -41,3 +41,10 @@ export function enum_(values: E): Schema(values: E): Schema { + return enum_(values).transform({ + transform: (val) => val, + untransform: (val) => val, + }); +} diff --git a/src/core/schemas/builders/enum/index.ts b/src/core/schemas/builders/enum/index.ts index fe6faed93..6faa631e3 100644 --- a/src/core/schemas/builders/enum/index.ts +++ b/src/core/schemas/builders/enum/index.ts @@ -1 +1 @@ -export { enum_ } from "./enum"; +export { enum_, forwardCompatibleEnum_ } from "./enum"; 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/schema-utils/JsonError.ts b/src/core/schemas/builders/schema-utils/JsonError.ts index 7573c76be..4f21ff3f6 100644 --- a/src/core/schemas/builders/schema-utils/JsonError.ts +++ b/src/core/schemas/builders/schema-utils/JsonError.ts @@ -5,5 +5,6 @@ export class JsonError extends Error { constructor(public readonly errors: ValidationError[]) { super(errors.map(stringifyValidationError).join("; ")); Object.setPrototypeOf(this, JsonError.prototype); + this.name = "JsonError"; } } diff --git a/src/core/schemas/builders/schema-utils/ParseError.ts b/src/core/schemas/builders/schema-utils/ParseError.ts index f1914b596..2340120ba 100644 --- a/src/core/schemas/builders/schema-utils/ParseError.ts +++ b/src/core/schemas/builders/schema-utils/ParseError.ts @@ -5,5 +5,6 @@ export class ParseError extends Error { constructor(public readonly errors: ValidationError[]) { super(errors.map(stringifyValidationError).join("; ")); Object.setPrototypeOf(this, ParseError.prototype); + this.name = "ParseError"; } } 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/core/url/QueryStringBuilder.ts b/src/core/url/QueryStringBuilder.ts new file mode 100644 index 000000000..61fde6c59 --- /dev/null +++ b/src/core/url/QueryStringBuilder.ts @@ -0,0 +1,87 @@ +import { toQueryString } from "./qs"; + +/** + * Creates a fluent builder for constructing URL query strings. + * + * Each `.add()` call serializes its value immediately (like C#'s builder), + * so no format tracking is needed — the style is applied at add-time. + * + * Usage (generated code): + * + * const qs = core.url.queryBuilder() + * .add("limit", limit) + * .add("tags", tags, { style: "comma" }) // explode: false + * .mergeAdditional(requestOptions?.queryParams) + * .build(); + */ +export function queryBuilder(): QueryStringBuilder { + return new QueryStringBuilder(); +} + +class QueryStringBuilder { + private parts: Map = new Map(); + + /** + * Adds a query parameter, serializing it immediately. + * + * By default arrays use "repeat" format (`key=a&key=b`). + * Pass `{ style: "comma" }` for OpenAPI `explode: false` parameters + * to get comma-separated values (`key=a,b,c`). + * + * Null / undefined values are silently skipped. + */ + add(key: string, value: unknown, options?: { style?: "comma" }): this { + if (value === undefined || value === null) { + return this; + } + const serialized = toQueryString( + { [key]: value }, + { arrayFormat: options?.style === "comma" ? "comma" : "repeat" }, + ); + if (serialized.length > 0) { + this.parts.set(key, serialized); + } + return this; + } + + /** + * Adds multiple query parameters at once from a record. + * All parameters use the default "repeat" array format. + * Null / undefined values are silently skipped. + */ + addMany(params: Record): this { + if (params != null) { + for (const [key, value] of Object.entries(params)) { + this.add(key, value); + } + } + return this; + } + + /** + * Merges additional query parameters supplied at call-time via + * `requestOptions.queryParams`. Overrides existing keys (last-write-wins). + */ + mergeAdditional(additionalParams?: Record): this { + if (additionalParams != null) { + for (const [key, value] of Object.entries(additionalParams)) { + if (value === undefined || value === null) { + continue; + } + const serialized = toQueryString({ [key]: value }, { arrayFormat: "repeat" }); + if (serialized.length > 0) { + this.parts.set(key, serialized); + } + } + } + return this; + } + + /** + * Returns the assembled query string (without the leading `?`). + * Returns an empty string when no parameters were added. + */ + build(): string { + return [...this.parts.values()].join("&"); + } +} diff --git a/src/core/url/index.ts b/src/core/url/index.ts index 62f9123be..b71fadd30 100644 --- a/src/core/url/index.ts +++ b/src/core/url/index.ts @@ -1,3 +1,4 @@ export { encodePathParam } from "./encodePathParam"; export { join } from "./join"; +export { queryBuilder } from "./QueryStringBuilder"; export { toQueryString } from "./qs"; diff --git a/src/core/url/qs.ts b/src/core/url/qs.ts index 13e89be9d..aebb95a38 100644 --- a/src/core/url/qs.ts +++ b/src/core/url/qs.ts @@ -1,5 +1,7 @@ +type ArrayFormat = "indices" | "repeat" | "comma"; + interface QueryStringOptions { - arrayFormat?: "indices" | "repeat"; + arrayFormat?: ArrayFormat; encode?: boolean; } @@ -25,7 +27,7 @@ function stringifyObject(obj: Record, prefix = "", options: Req for (const [key, value] of Object.entries(obj)) { const fullKey = prefix ? `${prefix}[${key}]` : key; - if (value === undefined) { + if (value == null) { continue; } @@ -33,18 +35,29 @@ function stringifyObject(obj: Record, prefix = "", options: Req if (value.length === 0) { continue; } - for (let i = 0; i < value.length; i++) { - const item = value[i]; - if (item === undefined) { - continue; + const effectiveFormat = options.arrayFormat; + if (effectiveFormat === "comma") { + const encodedKey = options.encode ? encodeURIComponent(fullKey) : fullKey; + const encodedValues = value + .filter((item) => item !== undefined && item !== null) + .map((item) => encodeValue(item, options.encode)); + if (encodedValues.length > 0) { + parts.push(`${encodedKey}=${encodedValues.join(",")}`); } - if (typeof item === "object" && !Array.isArray(item) && item !== null) { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - parts.push(...stringifyObject(item as Record, arrayKey, options)); - } else { - const arrayKey = options.arrayFormat === "indices" ? `${fullKey}[${i}]` : fullKey; - const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; - parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } else { + for (let i = 0; i < value.length; i++) { + const item = value[i]; + if (item == null) { + continue; + } + if (typeof item === "object" && !Array.isArray(item) && item !== null) { + const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + parts.push(...stringifyObject(item as Record, arrayKey, options)); + } else { + const arrayKey = effectiveFormat === "indices" ? `${fullKey}[${i}]` : fullKey; + const encodedKey = options.encode ? encodeURIComponent(arrayKey) : arrayKey; + parts.push(`${encodedKey}=${encodeValue(item, options.encode)}`); + } } } } else if (typeof value === "object" && value !== null) { diff --git a/src/errors/SquareTimeoutError.ts b/src/errors/SquareTimeoutError.ts index b410e2c0b..3cd53caf2 100644 --- a/src/errors/SquareTimeoutError.ts +++ b/src/errors/SquareTimeoutError.ts @@ -1,13 +1,18 @@ // This file was auto-generated by Fern from our API Definition. export class SquareTimeoutError extends Error { - constructor(message: string) { + public readonly cause?: unknown; + + constructor(message: string, opts?: { cause?: unknown }) { super(message); Object.setPrototypeOf(this, new.target.prototype); if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } - this.name = this.constructor.name; + this.name = "SquareTimeoutError"; + if (opts?.cause != null) { + this.cause = opts.cause; + } } } diff --git a/src/errors/handleNonStatusCodeError.ts b/src/errors/handleNonStatusCodeError.ts index c293714bf..7018fec8b 100644 --- a/src/errors/handleNonStatusCodeError.ts +++ b/src/errors/handleNonStatusCodeError.ts @@ -22,11 +22,14 @@ export function handleNonStatusCodeError( rawResponse: rawResponse, }); case "timeout": - throw new errors.SquareTimeoutError(`Timeout exceeded when calling ${method} ${path}.`); + throw new errors.SquareTimeoutError(`Timeout exceeded when calling ${method} ${path}.`, { + cause: error.cause, + }); case "unknown": throw new errors.SquareError({ message: error.errorMessage, rawResponse: rawResponse, + cause: error.cause, }); default: throw new errors.SquareError({ diff --git a/src/serialization/types/Fulfillment.ts b/src/serialization/types/Fulfillment.ts index 3458a0a0c..f47d10747 100644 --- a/src/serialization/types/Fulfillment.ts +++ b/src/serialization/types/Fulfillment.ts @@ -22,7 +22,7 @@ export const Fulfillment: core.serialization.ObjectSchema | null | undefined) | null; + metadata?: (Record | null | undefined) | null; pickup_details?: FulfillmentPickupDetails.Raw | null; shipment_details?: FulfillmentShipmentDetails.Raw | null; delivery_details?: FulfillmentDeliveryDetails.Raw | null; diff --git a/src/serialization/types/FulfillmentFulfillmentEntry.ts b/src/serialization/types/FulfillmentFulfillmentEntry.ts index bcefb9b10..2ac44dede 100644 --- a/src/serialization/types/FulfillmentFulfillmentEntry.ts +++ b/src/serialization/types/FulfillmentFulfillmentEntry.ts @@ -12,7 +12,7 @@ export const FulfillmentFulfillmentEntry: core.serialization.ObjectSchema< lineItemUid: core.serialization.property("line_item_uid", core.serialization.string()), quantity: core.serialization.string(), metadata: core.serialization - .record(core.serialization.string(), core.serialization.string().optionalNullable()) + .record(core.serialization.string(), core.serialization.string().nullable()) .optionalNullable(), }); @@ -21,6 +21,6 @@ export declare namespace FulfillmentFulfillmentEntry { uid?: (string | null | undefined) | null; line_item_uid: string; quantity: string; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/LoadResponse.ts b/src/serialization/types/LoadResponse.ts index 3c47a3d38..1631e63b8 100644 --- a/src/serialization/types/LoadResponse.ts +++ b/src/serialization/types/LoadResponse.ts @@ -4,39 +4,37 @@ import type * as Square from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; import { LoadResultAnnotation } from "./LoadResultAnnotation"; -import { LoadResultDataRow } from "./LoadResultDataRow"; +import { LoadResultData } from "./LoadResultData"; export const LoadResponse: core.serialization.ObjectSchema = core.serialization.object({ dataSource: core.serialization.string().optional(), annotation: LoadResultAnnotation.optional(), - data: LoadResultDataRow.optional(), + data: LoadResultData.optional(), + lastRefreshTime: core.serialization.string().optional(), + query: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), + slowQuery: core.serialization.boolean().optional(), + external: core.serialization.boolean().optional(), + dbType: core.serialization.string().optional(), refreshKeyValues: core.serialization .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) .optional(), - lastRefreshTime: core.serialization.string().optional(), pivotQuery: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - slowQuery: core.serialization.boolean().optional(), queryType: core.serialization.string().optional(), - query: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(), - external: core.serialization.boolean().optional(), - dbType: core.serialization.string().optional(), - error: core.serialization.string().optional(), }); export declare namespace LoadResponse { export interface Raw { dataSource?: string | null; annotation?: LoadResultAnnotation.Raw | null; - data?: LoadResultDataRow.Raw | null; - refreshKeyValues?: Record[] | null; + data?: LoadResultData.Raw | null; lastRefreshTime?: string | null; - pivotQuery?: Record | null; - slowQuery?: boolean | null; - queryType?: string | null; query?: Record | null; + slowQuery?: boolean | null; external?: boolean | null; dbType?: string | null; - error?: string | null; + refreshKeyValues?: Record[] | null; + pivotQuery?: Record | null; + queryType?: string | null; } } diff --git a/src/serialization/types/LoadResult.ts b/src/serialization/types/LoadResult.ts deleted file mode 100644 index 1e3249532..000000000 --- a/src/serialization/types/LoadResult.ts +++ /dev/null @@ -1,28 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; -import { LoadResultAnnotation } from "./LoadResultAnnotation"; -import { LoadResultData } from "./LoadResultData"; - -export const LoadResult: core.serialization.ObjectSchema = - core.serialization.object({ - dataSource: core.serialization.string().optional(), - annotation: LoadResultAnnotation, - data: LoadResultData, - refreshKeyValues: core.serialization - .list(core.serialization.record(core.serialization.string(), core.serialization.unknown())) - .optional(), - lastRefreshTime: core.serialization.string().optional(), - }); - -export declare namespace LoadResult { - export interface Raw { - dataSource?: string | null; - annotation: LoadResultAnnotation.Raw; - data: LoadResultData.Raw; - refreshKeyValues?: Record[] | null; - lastRefreshTime?: string | null; - } -} diff --git a/src/serialization/types/LoyaltyEvent.ts b/src/serialization/types/LoyaltyEvent.ts index d62607706..c804564ee 100644 --- a/src/serialization/types/LoyaltyEvent.ts +++ b/src/serialization/types/LoyaltyEvent.ts @@ -17,7 +17,7 @@ import { LoyaltyEventType } from "./LoyaltyEventType"; export const LoyaltyEvent: core.serialization.ObjectSchema = core.serialization.object({ id: core.serialization.string().optional(), - type: LoyaltyEventType, + type: LoyaltyEventType.optional(), createdAt: core.serialization.property("created_at", core.serialization.string().optional()), accumulatePoints: core.serialization.property("accumulate_points", LoyaltyEventAccumulatePoints.optional()), createReward: core.serialization.property("create_reward", LoyaltyEventCreateReward.optional()), @@ -26,7 +26,7 @@ export const LoyaltyEvent: core.serialization.ObjectSchema | null | undefined) | null; + metadata?: (Record | null | undefined) | null; created_at?: string | null; updated_at?: string | null; closed_at?: string | null; diff --git a/src/serialization/types/OrderLineItem.ts b/src/serialization/types/OrderLineItem.ts index dbda01b7e..4d379a518 100644 --- a/src/serialization/types/OrderLineItem.ts +++ b/src/serialization/types/OrderLineItem.ts @@ -27,7 +27,7 @@ export const OrderLineItem: core.serialization.ObjectSchema | null | undefined) | null; + metadata?: (Record | null | undefined) | null; modifiers?: (OrderLineItemModifier.Raw[] | null | undefined) | null; applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null | undefined) | null; applied_discounts?: (OrderLineItemAppliedDiscount.Raw[] | null | undefined) | null; diff --git a/src/serialization/types/OrderLineItemDiscount.ts b/src/serialization/types/OrderLineItemDiscount.ts index 4574eddc8..73bc06bd1 100644 --- a/src/serialization/types/OrderLineItemDiscount.ts +++ b/src/serialization/types/OrderLineItemDiscount.ts @@ -20,7 +20,7 @@ export const OrderLineItemDiscount: core.serialization.ObjectSchema< amountMoney: core.serialization.property("amount_money", Money.optional()), appliedMoney: core.serialization.property("applied_money", Money.optional()), metadata: core.serialization - .record(core.serialization.string(), core.serialization.string().optionalNullable()) + .record(core.serialization.string(), core.serialization.string().nullable()) .optionalNullable(), scope: OrderLineItemDiscountScope.optional(), rewardIds: core.serialization.property( @@ -40,7 +40,7 @@ export declare namespace OrderLineItemDiscount { percentage?: (string | null | undefined) | null; amount_money?: Money.Raw | null; applied_money?: Money.Raw | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null | undefined) | null; scope?: OrderLineItemDiscountScope.Raw | null; reward_ids?: string[] | null; pricing_rule_id?: string | null; diff --git a/src/serialization/types/OrderLineItemModifier.ts b/src/serialization/types/OrderLineItemModifier.ts index e01ddfc95..1662836b9 100644 --- a/src/serialization/types/OrderLineItemModifier.ts +++ b/src/serialization/types/OrderLineItemModifier.ts @@ -17,7 +17,7 @@ export const OrderLineItemModifier: core.serialization.ObjectSchema< basePriceMoney: core.serialization.property("base_price_money", Money.optional()), totalPriceMoney: core.serialization.property("total_price_money", Money.optional()), metadata: core.serialization - .record(core.serialization.string(), core.serialization.string().optionalNullable()) + .record(core.serialization.string(), core.serialization.string().nullable()) .optionalNullable(), }); @@ -30,6 +30,6 @@ export declare namespace OrderLineItemModifier { quantity?: (string | null | undefined) | null; base_price_money?: Money.Raw | null; total_price_money?: Money.Raw | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null | undefined) | null; } } diff --git a/src/serialization/types/OrderLineItemTax.ts b/src/serialization/types/OrderLineItemTax.ts index 2a16d6efd..ec253f129 100644 --- a/src/serialization/types/OrderLineItemTax.ts +++ b/src/serialization/types/OrderLineItemTax.ts @@ -18,7 +18,7 @@ export const OrderLineItemTax: core.serialization.ObjectSchema< type: OrderLineItemTaxType.optional(), percentage: core.serialization.string().optionalNullable(), metadata: core.serialization - .record(core.serialization.string(), core.serialization.string().optionalNullable()) + .record(core.serialization.string(), core.serialization.string().nullable()) .optionalNullable(), appliedMoney: core.serialization.property("applied_money", Money.optional()), scope: OrderLineItemTaxScope.optional(), @@ -33,7 +33,7 @@ export declare namespace OrderLineItemTax { name?: (string | null | undefined) | null; type?: OrderLineItemTaxType.Raw | null; percentage?: (string | null | undefined) | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null | undefined) | null; applied_money?: Money.Raw | null; scope?: OrderLineItemTaxScope.Raw | null; auto_applied?: boolean | null; diff --git a/src/serialization/types/OrderServiceCharge.ts b/src/serialization/types/OrderServiceCharge.ts index b2bad2fd2..f91a80dcd 100644 --- a/src/serialization/types/OrderServiceCharge.ts +++ b/src/serialization/types/OrderServiceCharge.ts @@ -30,7 +30,7 @@ export const OrderServiceCharge: core.serialization.ObjectSchema< core.serialization.list(OrderLineItemAppliedTax).optionalNullable(), ), metadata: core.serialization - .record(core.serialization.string(), core.serialization.string().optionalNullable()) + .record(core.serialization.string(), core.serialization.string().nullable()) .optionalNullable(), type: OrderServiceChargeType.optional(), treatmentType: core.serialization.property("treatment_type", OrderServiceChargeTreatmentType.optional()), @@ -51,7 +51,7 @@ export declare namespace OrderServiceCharge { calculation_phase?: OrderServiceChargeCalculationPhase.Raw | null; taxable?: (boolean | null | undefined) | null; applied_taxes?: (OrderLineItemAppliedTax.Raw[] | null | undefined) | null; - metadata?: (Record | null | undefined) | null; + metadata?: (Record | null | undefined) | null; type?: OrderServiceChargeType.Raw | null; treatment_type?: OrderServiceChargeTreatmentType.Raw | null; scope?: OrderServiceChargeScope.Raw | null; diff --git a/src/serialization/types/ResponseFormat.ts b/src/serialization/types/ResponseFormat.ts deleted file mode 100644 index f582eabf9..000000000 --- a/src/serialization/types/ResponseFormat.ts +++ /dev/null @@ -1,12 +0,0 @@ -// This file was auto-generated by Fern from our API Definition. - -import type * as Square from "../../api/index"; -import * as core from "../../core"; -import type * as serializers from "../index"; - -export const ResponseFormat: core.serialization.Schema = - core.serialization.enum_(["default", "compact", "columnar"]); - -export declare namespace ResponseFormat { - export type Raw = "default" | "compact" | "columnar"; -} diff --git a/src/serialization/types/TimeDimension.ts b/src/serialization/types/TimeDimension.ts index dbc266c2a..a0e0b3551 100644 --- a/src/serialization/types/TimeDimension.ts +++ b/src/serialization/types/TimeDimension.ts @@ -3,24 +3,19 @@ import type * as Square from "../../api/index"; import * as core from "../../core"; import type * as serializers from "../index"; +import { TimeDimensionDateRange } from "./TimeDimensionDateRange"; export const TimeDimension: core.serialization.ObjectSchema = core.serialization.object({ dimension: core.serialization.string(), granularity: core.serialization.string().optional(), - dateRange: core.serialization - .undiscriminatedUnion([ - core.serialization.string(), - core.serialization.list(core.serialization.string()), - core.serialization.record(core.serialization.string(), core.serialization.unknown()), - ]) - .optional(), + dateRange: TimeDimensionDateRange.optional(), }); export declare namespace TimeDimension { export interface Raw { dimension: string; granularity?: string | null; - dateRange?: string | string[] | Record | null; + dateRange?: TimeDimensionDateRange.Raw | null; } } diff --git a/src/serialization/types/TimeDimensionDateRange.ts b/src/serialization/types/TimeDimensionDateRange.ts new file mode 100644 index 000000000..cebbf6349 --- /dev/null +++ b/src/serialization/types/TimeDimensionDateRange.ts @@ -0,0 +1,18 @@ +// This file was auto-generated by Fern from our API Definition. + +import type * as Square from "../../api/index"; +import * as core from "../../core"; +import type * as serializers from "../index"; + +export const TimeDimensionDateRange: core.serialization.Schema< + serializers.TimeDimensionDateRange.Raw, + Square.TimeDimensionDateRange +> = core.serialization.undiscriminatedUnion([ + core.serialization.string(), + core.serialization.list(core.serialization.string()), + core.serialization.record(core.serialization.string(), core.serialization.unknown()), +]); + +export declare namespace TimeDimensionDateRange { + export type Raw = string | string[] | Record; +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 8cb2912c3..0f157e6da 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -807,7 +807,6 @@ export * from "./ListWebhookEventTypesResponse"; export * from "./ListWebhookSubscriptionsResponse"; export * from "./ListWorkweekConfigsResponse"; export * from "./LoadResponse"; -export * from "./LoadResult"; export * from "./LoadResultAnnotation"; export * from "./LoadResultData"; export * from "./LoadResultDataColumnar"; @@ -1094,7 +1093,6 @@ export * from "./RegisterDomainResponse"; export * from "./RegisterDomainResponseStatus"; export * from "./RemoveGroupFromCustomerResponse"; export * from "./ReportingError"; -export * from "./ResponseFormat"; export * from "./ResumeSubscriptionResponse"; export * from "./RetrieveBookingCustomAttributeDefinitionResponse"; export * from "./RetrieveBookingCustomAttributeResponse"; @@ -1296,6 +1294,7 @@ export * from "./TimecardWage"; export * from "./TimecardWorkday"; export * from "./TimecardWorkdayMatcher"; export * from "./TimeDimension"; +export * from "./TimeDimensionDateRange"; export * from "./TimeRange"; export * from "./TipSettings"; export * from "./Transaction"; diff --git a/src/version.ts b/src/version.ts index 32c9f109a..8d8a5429f 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "44.2.0"; +export const SDK_VERSION = "44.1.1"; diff --git a/tests/mock-server/MockServerPool.ts b/tests/mock-server/MockServerPool.ts index e1a90f7fb..d7d891a2d 100644 --- a/tests/mock-server/MockServerPool.ts +++ b/tests/mock-server/MockServerPool.ts @@ -103,4 +103,4 @@ class MockServerPool { } } -export const mockServerPool = new MockServerPool(); +export const mockServerPool: MockServerPool = new MockServerPool(); 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/auth/BasicAuth.test.ts b/tests/unit/auth/BasicAuth.test.ts index 9b5123364..8c82c1b72 100644 --- a/tests/unit/auth/BasicAuth.test.ts +++ b/tests/unit/auth/BasicAuth.test.ts @@ -3,8 +3,8 @@ import { BasicAuth } from "../../../src/core/auth/BasicAuth"; describe("BasicAuth", () => { interface ToHeaderTestCase { description: string; - input: { username: string; password: string }; - expected: string; + input: { username?: string; password?: string }; + expected: string | undefined; } interface FromHeaderTestCase { @@ -22,10 +22,30 @@ describe("BasicAuth", () => { describe("toAuthorizationHeader", () => { const toHeaderTests: ToHeaderTestCase[] = [ { - description: "correctly converts to header", + description: "correctly converts to header with both username and password", input: { username: "username", password: "password" }, expected: "Basic dXNlcm5hbWU6cGFzc3dvcmQ=", }, + { + description: "encodes username only with trailing colon", + input: { username: "username" }, + expected: "Basic dXNlcm5hbWU6", + }, + { + description: "encodes password only with leading colon", + input: { password: "password" }, + expected: "Basic OnBhc3N3b3Jk", + }, + { + description: "returns undefined when neither provided", + input: {}, + expected: undefined, + }, + { + description: "returns undefined when both are empty strings", + input: { username: "", password: "" }, + expected: undefined, + }, ]; toHeaderTests.forEach(({ description, input, expected }) => { diff --git a/tests/unit/fetcher/createRequestUrl.test.ts b/tests/unit/fetcher/createRequestUrl.test.ts index a92f1b5e8..7787e5530 100644 --- a/tests/unit/fetcher/createRequestUrl.test.ts +++ b/tests/unit/fetcher/createRequestUrl.test.ts @@ -77,7 +77,7 @@ describe("Test createRequestUrl", () => { undefinedValue: undefined, emptyString: "", }, - expected: "https://api.example.com?valid=value&nullValue=&emptyString=", + expected: "https://api.example.com?valid=value&emptyString=", }, { description: "should handle deeply nested objects", @@ -160,4 +160,8 @@ describe("Test createRequestUrl", () => { expect(createRequestUrl(baseUrl, queryParams)).toBe(expected); }); }); + + it("should default to repeat format for arrays", () => { + expect(createRequestUrl(BASE_URL, { items: ["a", "b"] })).toBe("https://api.example.com?items=a&items=b"); + }); }); diff --git a/tests/unit/fetcher/getResponseBody.test.ts b/tests/unit/fetcher/getResponseBody.test.ts index 4d8b66e04..482038b7d 100644 --- a/tests/unit/fetcher/getResponseBody.test.ts +++ b/tests/unit/fetcher/getResponseBody.test.ts @@ -75,6 +75,21 @@ describe("Test getResponseBody", () => { } }); + it("should retain a reference to the parent Response for sse responses", async () => { + if (RUNTIME.type === "node") { + const mockStream = new ReadableStream(); + const mockResponse = new Response(mockStream); + const result = (await getResponseBody(mockResponse, "sse")) as ReadableStream & { + __fern_response_ref?: Response; + }; + // Pins the parent Response so undici's FinalizationRegistry can't GC it and cancel the stream. + expect(result.__fern_response_ref).toBe(mockResponse); + // The pin must be non-enumerable so it does not leak through JSON.stringify or Object.keys. + const descriptor = Object.getOwnPropertyDescriptor(result, "__fern_response_ref"); + expect(descriptor?.enumerable).toBe(false); + } + }); + it("should handle streaming response type", async () => { if (RUNTIME.type === "node") { const mockStream = new ReadableStream(); @@ -84,4 +99,17 @@ describe("Test getResponseBody", () => { expect(JSON.stringify(result)).toBe(JSON.stringify(await chooseStreamWrapper(new ReadableStream()))); } }); + + it("should retain a reference to the parent Response on the stream wrapper", async () => { + if (RUNTIME.type === "node") { + const mockStream = new ReadableStream(); + const mockResponse = new Response(mockStream); + const result = (await getResponseBody(mockResponse, "streaming")) as object & { + __fern_response_ref?: Response; + }; + expect(result.__fern_response_ref).toBe(mockResponse); + const descriptor = Object.getOwnPropertyDescriptor(result, "__fern_response_ref"); + expect(descriptor?.enumerable).toBe(false); + } + }); }); diff --git a/tests/unit/fetcher/makePassthroughRequest.test.ts b/tests/unit/fetcher/makePassthroughRequest.test.ts new file mode 100644 index 000000000..31a510126 --- /dev/null +++ b/tests/unit/fetcher/makePassthroughRequest.test.ts @@ -0,0 +1,397 @@ +import { makePassthroughRequest } from "../../../src/core/fetcher/makePassthroughRequest"; + +describe("makePassthroughRequest", () => { + let mockFetch: jest.Mock; + + beforeEach(() => { + mockFetch = jest.fn(); + mockFetch.mockResolvedValue(new Response(JSON.stringify({ ok: true }), { status: 200 })); + }); + + describe("URL resolution", () => { + it("should use absolute URL directly", async () => { + await makePassthroughRequest("https://api.example.com/v1/users", undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + + it("should resolve relative path against baseUrl", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://api.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + + it("should resolve relative path against environment when baseUrl is not set", async () => { + await makePassthroughRequest("/v1/users", undefined, { + environment: "https://env.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://env.example.com/v1/users"); + }); + + it("should prefer baseUrl over environment", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: "https://base.example.com", + environment: "https://env.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://base.example.com/v1/users"); + }); + + it("should pass relative URL through as-is when no baseUrl or environment", async () => { + await makePassthroughRequest("/v1/users", undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("/v1/users"); + }); + + it("should resolve baseUrl supplier", async () => { + await makePassthroughRequest("/v1/users", undefined, { + baseUrl: () => "https://dynamic.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://dynamic.example.com/v1/users"); + }); + + it("should ignore absolute URL even when baseUrl is set", async () => { + await makePassthroughRequest("https://other.example.com/path", undefined, { + baseUrl: "https://base.example.com", + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://other.example.com/path"); + }); + + it("should accept a URL object", async () => { + await makePassthroughRequest(new URL("https://api.example.com/v1/users"), undefined, { + fetch: mockFetch, + }); + const [calledUrl] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/users"); + }); + }); + + describe("header merge order", () => { + it("should merge headers in correct priority: SDK defaults < auth < init < requestOptions", async () => { + await makePassthroughRequest( + "https://api.example.com", + { + headers: { "X-Custom": "from-init", Authorization: "from-init" }, + }, + { + headers: { + "X-Custom": "from-sdk", + "X-SDK-Only": "sdk-value", + Authorization: "from-sdk", + }, + getAuthHeaders: async () => ({ + Authorization: "Bearer auth-token", + "X-Auth-Only": "auth-value", + }), + fetch: mockFetch, + }, + { + headers: { Authorization: "from-request-options" }, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + const headers = calledOptions.headers; + + // requestOptions.headers wins for Authorization (highest priority) + expect(headers.authorization).toBe("from-request-options"); + // init.headers wins over SDK defaults for X-Custom + expect(headers["x-custom"]).toBe("from-init"); + // SDK-only header is preserved + expect(headers["x-sdk-only"]).toBe("sdk-value"); + // Auth-only header is preserved + expect(headers["x-auth-only"]).toBe("auth-value"); + }); + + it("should lowercase all header keys", async () => { + await makePassthroughRequest( + "https://api.example.com", + { + headers: { "Content-Type": "application/json" }, + }, + { + headers: { "X-Fern-Language": "JavaScript" }, + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + const headers = calledOptions.headers; + expect(headers["content-type"]).toBe("application/json"); + expect(headers["x-fern-language"]).toBe("JavaScript"); + expect(headers["Content-Type"]).toBeUndefined(); + expect(headers["X-Fern-Language"]).toBeUndefined(); + }); + + it("should handle Headers object in init", async () => { + const initHeaders = new Headers(); + initHeaders.set("X-From-Headers-Object", "value"); + await makePassthroughRequest("https://api.example.com", { headers: initHeaders }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-from-headers-object"]).toBe("value"); + }); + + it("should handle array-style headers in init", async () => { + await makePassthroughRequest( + "https://api.example.com", + { headers: [["X-Array-Header", "array-value"]] }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-array-header"]).toBe("array-value"); + }); + + it("should skip null SDK default header values", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + headers: { "X-Present": "value", "X-Null": null }, + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-present"]).toBe("value"); + expect(calledOptions.headers["x-null"]).toBeUndefined(); + }); + }); + + describe("auth headers", () => { + it("should include auth headers when getAuthHeaders is provided", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + getAuthHeaders: async () => ({ Authorization: "Bearer my-token" }), + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer my-token"); + }); + + it("should work without auth headers", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBeUndefined(); + }); + + it("should allow init headers to override auth headers", async () => { + await makePassthroughRequest( + "https://api.example.com", + { headers: { Authorization: "Bearer override" } }, + { + getAuthHeaders: async () => ({ Authorization: "Bearer sdk-auth" }), + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers.authorization).toBe("Bearer override"); + }); + }); + + describe("method and body", () => { + it("should default to GET when no method specified", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("GET"); + }); + + it("should use the method from init", async () => { + await makePassthroughRequest( + "https://api.example.com", + { method: "POST", body: JSON.stringify({ key: "value" }) }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("POST"); + expect(calledOptions.body).toBe(JSON.stringify({ key: "value" })); + }); + + it("should pass body as undefined when not provided", async () => { + await makePassthroughRequest("https://api.example.com", { method: "GET" }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.body).toBeUndefined(); + }); + }); + + describe("timeout and retries", () => { + it("should use requestOptions timeout over client timeout", async () => { + await makePassthroughRequest( + "https://api.example.com", + undefined, + { timeoutInSeconds: 30, fetch: mockFetch }, + { timeoutInSeconds: 10 }, + ); + // The timeout is passed to makeRequest which converts to ms + // We verify via the signal timing behavior (indirectly tested through makeRequest) + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + + it("should use client timeout when requestOptions timeout is not set", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + timeoutInSeconds: 30, + fetch: mockFetch, + }); + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + + it("should use requestOptions maxRetries over client maxRetries", async () => { + mockFetch.mockResolvedValue(new Response("", { status: 502 })); + jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + await makePassthroughRequest( + "https://api.example.com", + undefined, + { maxRetries: 5, fetch: mockFetch }, + { maxRetries: 1 }, + ); + // 1 initial + 1 retry = 2 calls + expect(mockFetch).toHaveBeenCalledTimes(2); + + jest.restoreAllMocks(); + }); + }); + + describe("abort signal", () => { + it("should use requestOptions.abortSignal over init.signal", async () => { + const initController = new AbortController(); + const requestController = new AbortController(); + + await makePassthroughRequest( + "https://api.example.com", + { signal: initController.signal }, + { fetch: mockFetch }, + { abortSignal: requestController.signal }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + // The signal passed to makeRequest is combined with timeout signal via anySignal, + // but the requestOptions.abortSignal should be the one that's used (not init.signal) + expect(calledOptions.signal).toBeDefined(); + }); + + it("should use init.signal when requestOptions.abortSignal is not set", async () => { + const initController = new AbortController(); + + await makePassthroughRequest( + "https://api.example.com", + { signal: initController.signal }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.signal).toBeDefined(); + }); + }); + + describe("credentials", () => { + it("should pass credentials include when set", async () => { + await makePassthroughRequest("https://api.example.com", { credentials: "include" }, { fetch: mockFetch }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.credentials).toBe("include"); + }); + + it("should not pass credentials when not set to include", async () => { + await makePassthroughRequest( + "https://api.example.com", + { credentials: "same-origin" }, + { + fetch: mockFetch, + }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.credentials).toBeUndefined(); + }); + }); + + describe("response", () => { + it("should return the Response object from fetch", async () => { + const mockResponse = new Response(JSON.stringify({ data: "test" }), { + status: 200, + headers: { "Content-Type": "application/json" }, + }); + mockFetch.mockResolvedValue(mockResponse); + + const response = await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + expect(response).toBe(mockResponse); + expect(response.status).toBe(200); + }); + + it("should return error responses without throwing", async () => { + const errorResponse = new Response("Not Found", { status: 404 }); + mockFetch.mockResolvedValue(errorResponse); + + const response = await makePassthroughRequest("https://api.example.com", undefined, { + fetch: mockFetch, + }); + expect(response.status).toBe(404); + }); + }); + + describe("Request object input", () => { + it("should extract URL from Request object", async () => { + const request = new Request("https://api.example.com/v1/resource", { method: "POST" }); + await makePassthroughRequest(request, undefined, { + fetch: mockFetch, + }); + const [calledUrl, calledOptions] = mockFetch.mock.calls[0]; + expect(calledUrl).toBe("https://api.example.com/v1/resource"); + expect(calledOptions.method).toBe("POST"); + }); + + it("should extract headers from Request object when no init provided", async () => { + const request = new Request("https://api.example.com", { + headers: { "X-From-Request": "request-value" }, + }); + await makePassthroughRequest(request, undefined, { + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-from-request"]).toBe("request-value"); + }); + + it("should use explicit init over Request object properties", async () => { + const request = new Request("https://api.example.com", { + method: "POST", + headers: { "X-From-Request": "request-value" }, + }); + await makePassthroughRequest( + request, + { method: "PUT", headers: { "X-From-Init": "init-value" } }, + { fetch: mockFetch }, + ); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.method).toBe("PUT"); + expect(calledOptions.headers["x-from-init"]).toBe("init-value"); + // Request headers should NOT be present since explicit init was provided + expect(calledOptions.headers["x-from-request"]).toBeUndefined(); + }); + }); + + describe("SDK default header suppliers", () => { + it("should resolve supplier functions for SDK default headers", async () => { + await makePassthroughRequest("https://api.example.com", undefined, { + headers: { + "X-Static": "static-value", + "X-Dynamic": () => "dynamic-value", + }, + fetch: mockFetch, + }); + const [, calledOptions] = mockFetch.mock.calls[0]; + expect(calledOptions.headers["x-static"]).toBe("static-value"); + expect(calledOptions.headers["x-dynamic"]).toBe("dynamic-value"); + }); + }); +}); 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/fetcher/redacting.test.ts b/tests/unit/fetcher/redacting.test.ts index 884ce4ccc..5bd451333 100644 --- a/tests/unit/fetcher/redacting.test.ts +++ b/tests/unit/fetcher/redacting.test.ts @@ -703,6 +703,112 @@ describe("Redacting Logic", () => { }); }); + describe("Query String Redaction", () => { + it("should redact api_key in queryString via URL", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "api_key=secret-key&page=1", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?api_key=[REDACTED]&page=1", + }), + ); + }); + + it("should redact multiple sensitive params in queryString", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "token=t&password=p&page=1", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?token=[REDACTED]&password=[REDACTED]&page=1", + }), + ); + }); + + it("should not redact non-sensitive params in queryString", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "page=1&limit=10&sort=name", + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?page=1&limit=10&sort=name", + }), + ); + }); + + it("should prefer queryString over queryParameters when both provided", async () => { + const mockLogger = createMockLogger(); + mockSuccessResponse(); + + await fetcherImpl({ + url: "https://example.com/api", + method: "GET", + queryString: "page=1", + queryParameters: { api_key: "secret-key" }, + responseType: "json", + maxRetries: 0, + logging: { + level: "debug", + logger: mockLogger, + silent: false, + }, + }); + + expect(mockLogger.debug).toHaveBeenCalledWith( + "Making HTTP request", + expect.objectContaining({ + url: "https://example.com/api?page=1", + queryParameters: expect.objectContaining({ + api_key: "[REDACTED]", + }), + }), + ); + }); + }); + describe("URL Redaction", () => { it("should redact credentials in URL", async () => { const mockLogger = createMockLogger(); diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index 9c2aaf216..9fffdf626 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -20,13 +20,13 @@ describe("requestWithRetries", () => { jest.clearAllTimers(); }); - it("should retry on retryable status codes", async () => { + it("should retry on retryable status codes (legacy mode)", async () => { setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { process.nextTick(callback); return null as any; }); - const retryableStatuses = [408, 429, 500, 502]; + const retryableStatuses = [408, 429, 500, 501, 502, 503, 504, 505]; let callCount = 0; mockFetch.mockImplementation(async () => { @@ -44,6 +44,24 @@ describe("requestWithRetries", () => { expect(response.status).toBe(200); }); + it("should retry on 500 Internal Server Error in legacy mode", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(2); + expect(response.status).toBe(200); + }); + it("should respect maxRetries limit", async () => { setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { process.nextTick(callback); @@ -51,14 +69,48 @@ describe("requestWithRetries", () => { }); const maxRetries = 2; - mockFetch.mockResolvedValue(new Response("", { status: 500 })); + mockFetch.mockResolvedValue(new Response("", { status: 503 })); const responsePromise = requestWithRetries(() => mockFetch(), maxRetries); await jest.runAllTimersAsync(); const response = await responsePromise; expect(mockFetch).toHaveBeenCalledTimes(maxRetries + 1); - expect(response.status).toBe(500); + expect(response.status).toBe(503); + }); + + it("should retry on status 599 (upper boundary of retryable 5xx in legacy mode)", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch + .mockResolvedValueOnce(new Response("", { status: 599 })) + .mockResolvedValueOnce(new Response("", { status: 200 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(2); + expect(response.status).toBe(200); + }); + + it("should not retry on non-retryable client error (400)", async () => { + setTimeoutSpy = jest.spyOn(global, "setTimeout").mockImplementation((callback: (args: void) => void) => { + process.nextTick(callback); + return null as any; + }); + + mockFetch.mockResolvedValueOnce(new Response("", { status: 400 })); + + const responsePromise = requestWithRetries(() => mockFetch(), 3); + await jest.runAllTimersAsync(); + const response = await responsePromise; + + expect(mockFetch).toHaveBeenCalledTimes(1); + expect(response.status).toBe(400); }); it("should not retry on success status codes", async () => { @@ -150,7 +202,7 @@ describe("requestWithRetries", () => { return null as any; }); - mockFetch.mockResolvedValue(new Response("", { status: 500 })); + mockFetch.mockResolvedValue(new Response("", { status: 502 })); const maxRetries = 3; const expectedDelays = [1000, 2000, 4000]; @@ -174,8 +226,8 @@ describe("requestWithRetries", () => { }); mockFetch - .mockResolvedValueOnce(new Response("", { status: 500 })) - .mockResolvedValueOnce(new Response("", { status: 500 })) + .mockResolvedValueOnce(new Response("", { status: 502 })) + .mockResolvedValueOnce(new Response("", { status: 502 })) .mockResolvedValueOnce(new Response("", { status: 200 })) .mockResolvedValueOnce(new Response("", { status: 200 })); diff --git a/tests/unit/fetcher/signals.test.ts b/tests/unit/fetcher/signals.test.ts index 9cabfa074..b834df806 100644 --- a/tests/unit/fetcher/signals.test.ts +++ b/tests/unit/fetcher/signals.test.ts @@ -66,4 +66,49 @@ describe("Test anySignal", () => { const signal = anySignal(controller1.signal, controller2.signal); expect(signal.aborted).toBe(true); }); + + it("should detect a signal that aborts between the initial aborted check and the event listener registration", () => { + const ctrlA = new AbortController(); + const ctrlB = new AbortController(); + + const originalAddEventListener = ctrlA.signal.addEventListener.bind(ctrlA.signal); + const originalRemoveEventListener = ctrlA.signal.removeEventListener.bind(ctrlA.signal); + + let abortedAccessCount = 0; + const proxy = new Proxy(ctrlA.signal, { + get(target, prop, receiver) { + if (prop === "aborted") { + abortedAccessCount++; + if (abortedAccessCount === 1) return false; + return Reflect.get(target, prop, receiver); + } + if (prop === "addEventListener") { + return (...args: Parameters) => { + if (abortedAccessCount >= 1 && args[0] === "abort") { + ctrlA.abort("too-late"); + } + return originalAddEventListener(...args); + }; + } + if (prop === "removeEventListener") { + return originalRemoveEventListener; + } + return Reflect.get(target, prop, receiver); + }, + }); + + const combined = anySignal(proxy, ctrlB.signal); + + expect(combined.aborted).toBe(true); + expect(combined.reason).toBe("too-late"); + }); + + it("should forward the abort reason from a source signal", () => { + const controller = new AbortController(); + const combined = anySignal(controller.signal); + + controller.abort("test-reason"); + expect(combined.aborted).toBe(true); + expect(combined.reason).toBe("test-reason"); + }); }); 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/encodeAsFormParameter.test.ts b/tests/unit/form-data-utils/encodeAsFormParameter.test.ts index d4b0c4503..898f527e9 100644 --- a/tests/unit/form-data-utils/encodeAsFormParameter.test.ts +++ b/tests/unit/form-data-utils/encodeAsFormParameter.test.ts @@ -63,7 +63,6 @@ describe("encodeAsFormParameter", () => { const obj = { items: ["a", null, "c", undefined, "e"] }; expect(encodeAsFormParameter(obj)).toEqual({ "items[0]": "a", - "items[1]": "", "items[2]": "c", "items[4]": "e", }); @@ -247,7 +246,6 @@ describe("encodeAsFormParameter", () => { const obj = { name: "John", age: null, email: undefined, active: true }; expect(encodeAsFormParameter(obj)).toEqual({ name: "John", - age: "", active: "true", }); }); 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/unit/url/QueryStringBuilder.test.ts b/tests/unit/url/QueryStringBuilder.test.ts new file mode 100644 index 000000000..1afa2d222 --- /dev/null +++ b/tests/unit/url/QueryStringBuilder.test.ts @@ -0,0 +1,236 @@ +import { queryBuilder } from "../../../src/core/url/QueryStringBuilder"; + +describe("QueryStringBuilder", () => { + describe("add() — default repeat format", () => { + it("adds a scalar string value", () => { + const qs = queryBuilder().add("key", "value").build(); + expect(qs).toBe("key=value"); + }); + + it("adds a scalar number value", () => { + const qs = queryBuilder().add("limit", 10).build(); + expect(qs).toBe("limit=10"); + }); + + it("adds a boolean value", () => { + const qs = queryBuilder().add("active", true).build(); + expect(qs).toBe("active=true"); + }); + + it("skips undefined values", () => { + const qs = queryBuilder().add("key", undefined).build(); + expect(qs).toBe(""); + }); + + it("skips null values", () => { + const qs = queryBuilder().add("key", null).build(); + expect(qs).toBe(""); + }); + + it("repeats array elements as separate key=value pairs", () => { + const qs = queryBuilder().add("color", ["red", "blue", "green"]).build(); + expect(qs).toBe("color=red&color=blue&color=green"); + }); + + it("skips undefined items within arrays", () => { + const qs = queryBuilder().add("color", ["red", undefined, "blue"]).build(); + expect(qs).toBe("color=red&color=blue"); + }); + + it("returns empty string for empty array", () => { + const qs = queryBuilder().add("color", []).build(); + expect(qs).toBe(""); + }); + + it("encodes special characters in keys and values", () => { + const qs = queryBuilder().add("my key", "hello world").build(); + expect(qs).toBe("my%20key=hello%20world"); + }); + + it("handles nested objects", () => { + const qs = queryBuilder().add("filter", { status: "active" }).build(); + expect(qs).toBe("filter%5Bstatus%5D=active"); + }); + }); + + describe("add() — comma style", () => { + it("joins array values with literal commas", () => { + const qs = queryBuilder().add("tags", ["a", "b", "c"], { style: "comma" }).build(); + expect(qs).toBe("tags=a,b,c"); + }); + + it("handles single-element array", () => { + const qs = queryBuilder().add("tags", ["only"], { style: "comma" }).build(); + expect(qs).toBe("tags=only"); + }); + + it("returns empty string for empty array", () => { + const qs = queryBuilder().add("tags", [], { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("skips undefined values", () => { + const qs = queryBuilder().add("tags", undefined, { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("skips null values", () => { + const qs = queryBuilder().add("tags", null, { style: "comma" }).build(); + expect(qs).toBe(""); + }); + + it("treats scalar values same as default add()", () => { + const qs = queryBuilder().add("tag", "single", { style: "comma" }).build(); + expect(qs).toBe("tag=single"); + }); + + it("encodes commas within individual values as %2C", () => { + const qs = queryBuilder().add("items", ["a,b", "c"], { style: "comma" }).build(); + expect(qs).toBe("items=a%2Cb,c"); + }); + + it("encodes special characters in values", () => { + const qs = queryBuilder().add("tags", ["hello world", "foo&bar"], { style: "comma" }).build(); + expect(qs).toBe("tags=hello%20world,foo%26bar"); + }); + }); + + describe("chaining", () => { + it("chains multiple add() calls", () => { + const qs = queryBuilder().add("limit", 10).add("offset", 20).build(); + expect(qs).toBe("limit=10&offset=20"); + }); + + it("chains add() with default and comma styles", () => { + const qs = queryBuilder() + .add("limit", 10) + .add("tags", ["ACCESS_GRANTED", "COPY", "DELETE"], { style: "comma" }) + .add("active", true) + .build(); + expect(qs).toBe("limit=10&tags=ACCESS_GRANTED,COPY,DELETE&active=true"); + }); + + it("skips undefined/null params in chain without breaking", () => { + const qs = queryBuilder() + .add("a", "1") + .add("b", undefined) + .add("c", null, { style: "comma" }) + .add("d", "4") + .build(); + expect(qs).toBe("a=1&d=4"); + }); + }); + + describe("addMany()", () => { + it("adds all params from a record", () => { + const qs = queryBuilder().addMany({ limit: 10, offset: 20, name: "test" }).build(); + expect(qs).toBe("limit=10&offset=20&name=test"); + }); + + it("skips null and undefined values", () => { + const qs = queryBuilder().addMany({ a: "1", b: null, c: undefined, d: "4" }).build(); + expect(qs).toBe("a=1&d=4"); + }); + + it("handles empty record", () => { + const qs = queryBuilder().addMany({}).build(); + expect(qs).toBe(""); + }); + + it("works with comma-style override after addMany", () => { + const params = { limit: 10, tags: ["a", "b"], active: true }; + const qs = queryBuilder().addMany(params).add("tags", params.tags, { style: "comma" }).build(); + expect(qs).toBe("limit=10&tags=a,b&active=true"); + }); + + it("handles array values with default repeat format", () => { + const qs = queryBuilder() + .addMany({ ids: [1, 2, 3] }) + .build(); + expect(qs).toBe("ids=1&ids=2&ids=3"); + }); + }); + + describe("mergeAdditional()", () => { + it("appends additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: "value" }).build(); + expect(qs).toBe("limit=10&extra=value"); + }); + + it("overrides existing keys (last-write-wins)", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ limit: 20 }).build(); + expect(qs).toBe("limit=20"); + }); + + it("handles undefined additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional(undefined).build(); + expect(qs).toBe("limit=10"); + }); + + it("skips undefined values in additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: undefined }).build(); + expect(qs).toBe("limit=10"); + }); + + it("skips null values in additional params", () => { + const qs = queryBuilder().add("limit", 10).mergeAdditional({ extra: null }).build(); + expect(qs).toBe("limit=10"); + }); + + it("handles array values in additional params using repeat format", () => { + const qs = queryBuilder() + .mergeAdditional({ ids: [1, 2, 3] }) + .build(); + expect(qs).toBe("ids=1&ids=2&ids=3"); + }); + + it("overrides a comma-style param with repeat format", () => { + const qs = queryBuilder() + .add("tags", ["a", "b"], { style: "comma" }) + .mergeAdditional({ tags: ["x", "y"] }) + .build(); + expect(qs).toBe("tags=x&tags=y"); + }); + }); + + describe("build()", () => { + it("returns empty string when no params added", () => { + const qs = queryBuilder().build(); + expect(qs).toBe(""); + }); + + it("does not include leading ?", () => { + const qs = queryBuilder().add("key", "value").build(); + expect(qs).not.toContain("?"); + }); + }); + + describe("end-to-end scenarios", () => { + it("matches expected query-parameters-openapi output pattern", () => { + const params: Record = { + limit: 1, + id: "d5e9c84f-c2b2-4bf4-b4b0-7ffd7a9ffc32", + date: "2023-01-15", + deadline: "2024-01-15T09:30:00.000Z", + bytes: "SGVsbG8gd29ybGQh", + user: "user", + userList: ["user"], + optionalString: "optionalString", + nestedUser: "nestedUser", + excludeUser: "excludeUser", + filter: "filter", + tags: ["tags"], + optionalTags: undefined, + }; + const qs = queryBuilder() + .addMany(params) + .add("tags", params.tags, { style: "comma" }) + .add("optionalTags", params.optionalTags, { style: "comma" }) + .mergeAdditional(undefined) + .build(); + expect(qs).toContain("limit=1"); + expect(qs).toContain("tags=tags"); + expect(qs).not.toContain("optionalTags"); + }); + }); +}); diff --git a/tests/unit/url/qs.test.ts b/tests/unit/url/qs.test.ts index 42cdffb9e..54d2d9ce3 100644 --- a/tests/unit/url/qs.test.ts +++ b/tests/unit/url/qs.test.ts @@ -34,7 +34,7 @@ describe("Test qs toQueryString", () => { interface ArrayTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices" }; + options?: { arrayFormat?: "repeat" | "indices" | "comma" }; expected: string; } @@ -150,7 +150,7 @@ describe("Test qs toQueryString", () => { interface MixedTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices" }; + options?: { arrayFormat?: "repeat" | "indices" | "comma" }; expected: string; } @@ -189,12 +189,12 @@ describe("Test qs toQueryString", () => { { description: "should handle arrays with null/undefined values", input: { items: ["a", null, "c", undefined, "e"] }, - expected: "items%5B0%5D=a&items%5B1%5D=&items%5B2%5D=c&items%5B4%5D=e", + expected: "items%5B0%5D=a&items%5B2%5D=c&items%5B4%5D=e", }, { description: "should handle objects with null/undefined values", input: { name: "John", age: null, email: undefined, active: true }, - expected: "name=John&age=&active=true", + expected: "name=John&active=true", }, ]; @@ -241,11 +241,107 @@ describe("Test qs toQueryString", () => { }); }); + describe("Comma array format", () => { + interface CommaTestCase { + description: string; + input: any; + options?: { arrayFormat?: "comma"; encode?: boolean }; + expected: string; + } + + const commaTests: CommaTestCase[] = [ + { + description: "should join array values with commas", + input: { event_type: ["ACCESS_GRANTED", "COPY", "DELETE"] }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED,COPY,DELETE", + }, + { + description: "should handle single-element array", + input: { event_type: ["ACCESS_GRANTED"] }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED", + }, + { + description: "should handle empty array", + input: { event_type: [] }, + options: { arrayFormat: "comma" }, + expected: "", + }, + { + description: "should not percent-encode commas", + input: { items: ["a", "b", "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,b,c", + }, + { + description: "should encode values but not commas", + input: { items: ["a b", "c d"] }, + options: { arrayFormat: "comma" }, + expected: "items=a%20b,c%20d", + }, + { + description: "should not encode when encode is false", + input: { items: ["a b", "c d"] }, + options: { arrayFormat: "comma", encode: false }, + expected: "items=a b,c d", + }, + { + description: "should handle mixed parameters with comma and non-array values", + input: { event_type: ["ACCESS_GRANTED", "COPY", "DELETE"], limit: 10, offset: 0 }, + options: { arrayFormat: "comma" }, + expected: "event_type=ACCESS_GRANTED,COPY,DELETE&limit=10&offset=0", + }, + { + description: "should handle numeric array values", + input: { ids: [1, 2, 3] }, + options: { arrayFormat: "comma" }, + expected: "ids=1,2,3", + }, + { + description: "should handle boolean array values", + input: { flags: [true, false, true] }, + options: { arrayFormat: "comma" }, + expected: "flags=true,false,true", + }, + { + description: "should skip null values in comma format", + input: { items: ["a", null, "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,c", + }, + { + description: "should skip undefined values in comma format", + input: { items: ["a", undefined, "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a,c", + }, + { + description: "should produce empty string for all-null array in comma format", + input: { items: [null, undefined] }, + options: { arrayFormat: "comma" }, + expected: "", + }, + { + description: "should encode commas within values while keeping separator commas literal", + input: { items: ["a,b", "c"] }, + options: { arrayFormat: "comma" }, + expected: "items=a%2Cb,c", + }, + ]; + + commaTests.forEach(({ description, input, options, expected }) => { + it(description, () => { + expect(toQueryString(input, options)).toBe(expected); + }); + }); + }); + describe("Options combinations", () => { interface OptionsTestCase { description: string; input: any; - options?: { arrayFormat?: "repeat" | "indices"; encode?: boolean }; + options?: { arrayFormat?: "repeat" | "indices" | "comma"; encode?: boolean }; expected: string; } 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 7ada00977..e899cef85 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") @@ -351,6 +352,7 @@ describe("PaymentsClient", () => { version_token: "TPtNEOBOa6Qq6E3C3IjckSVOM6b3hMbfhjvTxHBQUsB6o", }, }; + server .mockEndpoint() .post("/v2/payments") @@ -580,6 +582,7 @@ describe("PaymentsClient", () => { const rawResponseBody = { errors: [{ category: "API_ERROR", code: "INTERNAL_SERVER_ERROR", detail: "detail", field: "field" }], }; + server .mockEndpoint() .post("/v2/payments/cancel") @@ -747,6 +750,7 @@ describe("PaymentsClient", () => { version_token: "56pRkL3slrzet2iQrTp9n0bdJVYTB9YEWdTNjQfZOPV6o", }, }; + server .mockEndpoint() .get("/v2/payments/payment_id") @@ -1104,6 +1108,7 @@ describe("PaymentsClient", () => { version_token: "rDrXnqiS7fJgexccgdpzmwqTiXui1aIKCp9EchZ7trE6o", }, }; + server .mockEndpoint() .put("/v2/payments/payment_id") @@ -1460,6 +1465,7 @@ describe("PaymentsClient", () => { version_token: "N8AGYgEjCiY9Q57Jw7aVHEpBq8bzGCDCQMRX8Vs56N06o", }, }; + server .mockEndpoint() .post("/v2/payments/payment_id/cancel") @@ -1810,6 +1816,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/reporting.test.ts b/tests/wire/reporting.test.ts index d69085da6..006d6ada8 100644 --- a/tests/wire/reporting.test.ts +++ b/tests/wire/reporting.test.ts @@ -27,6 +27,7 @@ describe("ReportingClient", () => { ], compilerId: "compilerId", }; + server.mockEndpoint().get("/reporting/v1/meta").respondWith().statusCode(200).jsonBody(rawResponseBody).build(); const response = await client.reporting.getMetadata(); @@ -94,7 +95,6 @@ describe("ReportingClient", () => { const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); const rawRequestBody = {}; const rawResponseBody = { - slowQuery: true, dataSource: "dataSource", annotation: { measures: { key: "value" }, @@ -103,12 +103,16 @@ describe("ReportingClient", () => { timeDimensions: { key: "value" }, }, data: [{ key: "value" }], - refreshKeyValues: [{ key: "value" }], lastRefreshTime: "lastRefreshTime", query: { key: "value" }, - external: false, + slowQuery: true, + external: true, dbType: "dbType", + refreshKeyValues: [{ key: "value" }], + pivotQuery: { key: "value" }, + queryType: "queryType", }; + server .mockEndpoint() .post("/reporting/v1/load") @@ -120,7 +124,6 @@ describe("ReportingClient", () => { const response = await client.reporting.load(); expect(response).toEqual({ - slowQuery: true, dataSource: "dataSource", annotation: { measures: { @@ -141,67 +144,22 @@ describe("ReportingClient", () => { key: "value", }, ], + lastRefreshTime: "lastRefreshTime", + query: { + key: "value", + }, + slowQuery: true, + external: true, + dbType: "dbType", refreshKeyValues: [ { key: "value", }, ], - lastRefreshTime: "lastRefreshTime", - query: { + pivotQuery: { key: "value", }, - external: false, - dbType: "dbType", + queryType: "queryType", }); }); - - test("load serializes documented query shapes", async () => { - const server = mockServerPool.createServer(); - const client = new SquareClient({ maxRetries: 0, token: "test", environment: server.baseUrl }); - const rawRequestBody = { - query: { - measures: ["Sales.net_sales"], - dimensions: ["Sales.channel_name"], - timeDimensions: [ - { - dimension: "Sales.local_reporting_timestamp", - dateRange: "last 30 days", - granularity: "day", - }, - { - dimension: "Sales.local_reporting_timestamp", - dateRange: ["2026-05-01", "2026-05-31"], - }, - ], - order: [["Sales.net_sales", "desc"]], - filters: [ - { - or: [ - { member: "Sales.channel_name", operator: "equals", values: ["Online"] }, - { member: "Sales.channel_name", operator: "equals", values: ["In-Store"] }, - ], - }, - { - and: [{ member: "Sales.location_name", operator: "set" }], - }, - ], - limit: 10, - offset: 5, - }, - }; - const rawResponseBody = { - data: [], - }; - server - .mockEndpoint() - .post("/reporting/v1/load") - .jsonBody(rawRequestBody) - .respondWith() - .statusCode(200) - .jsonBody(rawResponseBody) - .build(); - - const response = await client.reporting.load(rawRequestBody); - expect(response).toEqual(rawResponseBody); - }); }); 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/tsconfig.json b/tsconfig.json index 0140f4117..2e282c337 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -9,7 +9,6 @@ "declaration": true, "outDir": "dist", "rootDir": "src", - "baseUrl": "src", "isolatedModules": true, "isolatedDeclarations": true, "module": "CommonJS" diff --git a/yarn.lock b/yarn.lock index 1a064180f..20f50e259 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.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.29.7.tgz#f2fbbfea87c44a21590ec515b778b2c26d8866e7" + integrity sha512-Aup7aUOfpbAUg2ROOJN6Iw5f9DMBlzu0mIkm/malLQFN/YQgO48wCj0Kxa3sEHJvPVFg7siR+qRInwXd2qhQKw== dependencies: - "@babel/helper-validator-identifier" "^7.28.5" + "@babel/helper-validator-identifier" "^7.29.7" 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== +"@babel/compat-data@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.29.7.tgz#6f0237f0f36d2e51c0570a636faed9d2d0efe629" + integrity sha512-locTkQyKvwIEgBzVrn8693ebc97F2U8ZHjbXwDXJ5Fn2TCpNwTlKcaKLkdHop5c/icOFE7qt7Q9JC5hnKNa6Gg== "@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== - dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/generator" "^7.28.6" - "@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/template" "^7.28.6" - "@babel/traverse" "^7.28.6" - "@babel/types" "^7.28.6" + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.29.7.tgz#80c10b17248082968b57a857b91640971f2070f7" + integrity sha512-RgHBCvtjbOK2gXSNBNIkNoEc9qoVEtau3hj8gEqKQuL3HZAibKarWFEI3Lfm6EYKkLalOh8eSrj9b+ch9H/VBA== + dependencies: + "@babel/code-frame" "^7.29.7" + "@babel/generator" "^7.29.7" + "@babel/helper-compilation-targets" "^7.29.7" + "@babel/helper-module-transforms" "^7.29.7" + "@babel/helpers" "^7.29.7" + "@babel/parser" "^7.29.7" + "@babel/template" "^7.29.7" + "@babel/traverse" "^7.29.7" + "@babel/types" "^7.29.7" "@jridgewell/remapping" "^2.3.5" convert-source-map "^2.0.0" debug "^4.1.0" @@ -146,84 +146,84 @@ 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.7", "@babel/generator@^7.7.2": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.29.7.tgz#cca0b8827e6bcf3ba176788e7f3b180ad6db2fa3" + integrity sha512-DkXD5OJQaAQIdZ1bt3UZdEnHAn9Imd3IVBdX03UFe+ony9Ojw5pzr9YVKGDY1jt+Gcn/FnGkNf8r+Vj5NOJWtQ== dependencies: - "@babel/parser" "^7.28.6" - "@babel/types" "^7.28.6" + "@babel/parser" "^7.29.7" + "@babel/types" "^7.29.7" "@jridgewell/gen-mapping" "^0.3.12" "@jridgewell/trace-mapping" "^0.3.28" jsesc "^3.0.2" -"@babel/helper-compilation-targets@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.28.6.tgz#32c4a3f41f12ed1532179b108a4d746e105c2b25" - integrity sha512-JYtls3hqi15fcx5GaSNL7SCTJ2MNmjrkHXg4FSpOA/grxK8KwyZ5bubHsCq8FXCkua6xhuaaBit+3b7+VZRfcA== +"@babel/helper-compilation-targets@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.29.7.tgz#7a1def704302401c47f64fa85589e974ae217042" + integrity sha512-wem6WaBj4NaVYVdNhLPPVacES6ZJ+KBBfSkTMD3YZxbP3rm3Di85tJU5ljaUNhaOynt+Aj0xruhYuzQBt8n71g== dependencies: - "@babel/compat-data" "^7.28.6" - "@babel/helper-validator-option" "^7.27.1" + "@babel/compat-data" "^7.29.7" + "@babel/helper-validator-option" "^7.29.7" browserslist "^4.24.0" lru-cache "^5.1.1" semver "^6.3.1" -"@babel/helper-globals@^7.28.0": - version "7.28.0" - resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.28.0.tgz#b9430df2aa4e17bc28665eadeae8aa1d985e6674" - integrity sha512-+W6cISkXFa1jXsDEdYA8HeevQT/FULhxzR99pxphltZcVaugps53THCeiWA8SguxxpSp3gKPiuYfSWopkLQ4hw== +"@babel/helper-globals@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-globals/-/helper-globals-7.29.7.tgz#f04a96fbd8473241b1079243f5b3f03a3010ab7b" + integrity sha512-3nQVUAtvkKH9zahfWgw96Jc/uFOmjACE1kQz82E2lqWmHBgjzbNlsC22nuQTfahmWeQtTq5nQ/4Nnd2A1wj4zA== -"@babel/helper-module-imports@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.28.6.tgz#60632cbd6ffb70b22823187201116762a03e2d5c" - integrity sha512-l5XkZK7r7wa9LucGw9LwZyyCUscb4x37JWTPz7swwFE/0FMQAGpiWUZn8u9DzkSBWEcK25jmvubfpw2dnAMdbw== +"@babel/helper-module-imports@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.29.7.tgz#ef25048a518e828d7393fac5882ddd73921d7396" + integrity sha512-ejHwrQQYcm9xnTivShn2IDOlIzInN34AXskvq9QicvCtEzq1Vzclu/tKF8Jq1Cg8JG2GL6/EmjgsCT7lXepE3g== dependencies: - "@babel/traverse" "^7.28.6" - "@babel/types" "^7.28.6" + "@babel/traverse" "^7.29.7" + "@babel/types" "^7.29.7" -"@babel/helper-module-transforms@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.28.6.tgz#9312d9d9e56edc35aeb6e95c25d4106b50b9eb1e" - integrity sha512-67oXFAYr2cDLDVGLXTEABjdBJZ6drElUSI7WKp70NrpyISso3plG9SAGEF6y7zbha/wOzUByWWTJvEDVNIUGcA== +"@babel/helper-module-transforms@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.29.7.tgz#b062747a5997ba138637201328bbff77960574ae" + integrity sha512-UPUVSyXbOh627KiCIGQSgwWzGeBKLkaJ9PJEdrngIwMSzxLR4jS4+f1f1jb7VzBbg8nFLaYotvVPFCTqdrmTAg== dependencies: - "@babel/helper-module-imports" "^7.28.6" - "@babel/helper-validator-identifier" "^7.28.5" - "@babel/traverse" "^7.28.6" + "@babel/helper-module-imports" "^7.29.7" + "@babel/helper-validator-identifier" "^7.29.7" + "@babel/traverse" "^7.29.7" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.28.6", "@babel/helper-plugin-utils@^7.8.0": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.28.6.tgz#6f13ea251b68c8532e985fd532f28741a8af9ac8" - integrity sha512-S9gzZ/bz83GRysI7gAD4wPT/AI3uCnY+9xn+Mx/KPs2JwHJIz1W8PZkg2cqyt3RNOBM8ejcXhV6y8Og7ly/Dug== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.29.7", "@babel/helper-plugin-utils@^7.8.0": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.29.7.tgz#c0a0766f1a13617d8a17407d7ab8f9d486225ea4" + integrity sha512-G7sHYigPY17oO5SYWnfD/0MTBwVR781S/JI643e/JhUYgVgWE/61SoW3NH9KWUKyKq5LVh3npif99Wkt6j86Jw== -"@babel/helper-string-parser@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.27.1.tgz#54da796097ab19ce67ed9f88b47bb2ec49367687" - integrity sha512-qMlSxKbpRlAridDExk92nSobyDdpPijUq2DW6oDnUqd0iOGxmQjyqhMIihI9+zv4LPyZdRje2cavWPbCbWm3eA== +"@babel/helper-string-parser@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.29.7.tgz#7f0871d99824d23137d60f86fcf6130fd5a1b51f" + integrity sha512-Pb5ijPrZ89GDH8223L4UP8i6QApWxs04RbPQJTeWDV0/keR2E36MeKnyr6LYmUUvqRRI+Iv87SuF1W6ErINzYw== -"@babel/helper-validator-identifier@^7.28.5": - version "7.28.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.28.5.tgz#010b6938fab7cb7df74aa2bbc06aa503b8fe5fb4" - integrity sha512-qSs4ifwzKJSV39ucNjsvc6WVHs6b7S03sOh2OcHF9UHfVPqWWALUsNUVzhSBiItjRZoLHx7nIarVjqKVusUZ1Q== +"@babel/helper-validator-identifier@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.29.7.tgz#bd87084ced0c796ec46bda492de6e83d29e89fc2" + integrity sha512-qehxGkRj55h/ff8EMaJ+cYhyaKlHIxqYDn682wQD7RNp9UujOQsHog2uS0r2vzr4pW+sXf90NeeayjcNaX3fFg== -"@babel/helper-validator-option@^7.27.1": - version "7.27.1" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.27.1.tgz#fa52f5b1e7db1ab049445b421c4471303897702f" - integrity sha512-YvjJow9FxbhFFKDSuFnVCe2WxXk1zWc22fFePVNEaWJEu8IrZVlda6N0uHwzZrUM1il7NC9Mlp4MaJYbYd9JSg== +"@babel/helper-validator-option@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.29.7.tgz#cf315be940213b354eb4abcc0bd01ebe3f73bc2a" + integrity sha512-N9ZErrD+yW5geCDtBqnOoxmR8+tNKiGuxKlDpuJxfsqpa2dFcexaziGAE/qoHLiDDreVNMupxGmSoNlyvsA3gw== -"@babel/helpers@^7.28.6": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.28.6.tgz#fca903a313ae675617936e8998b814c415cbf5d7" - integrity sha512-xOBvwq86HHdB7WUDTfKfT/Vuxh7gElQ+Sfti2Cy6yIWNW05P8iUslOVcZ4/sKbE+/jQaukQAdz/gf3724kYdqw== +"@babel/helpers@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.29.7.tgz#45abfde7548997e34376c3e69feb475cffb4a607" + integrity sha512-1k2lAGRMfHTcwuNYcCNUmaUffmQv8KWMfh2iJUUeRlwlwH4FdNG7mfPI10NPfLHJFThE4Tyr4mv7kTNZOiPuBg== dependencies: - "@babel/template" "^7.28.6" - "@babel/types" "^7.28.6" + "@babel/template" "^7.29.7" + "@babel/types" "^7.29.7" -"@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.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.29.7.tgz#837b87387cbf5ec5530cb634b3c622f68edb9334" + integrity sha512-hnORnjP/1P/zFEndoeX+n+t1RwWRJiJpM/jO7FW32Kn9r5+sJB2JWOdYo4L6k78j15eCwY3Gm/7364B1EMwtNg== dependencies: - "@babel/types" "^7.28.6" + "@babel/types" "^7.29.7" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -254,11 +254,11 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-import-attributes@^7.24.7": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.28.6.tgz#b71d5914665f60124e133696f17cd7669062c503" - integrity sha512-jiLC0ma9XkQT3TKJ9uYvlakm66Pamywo+qwL+oL8HJOvc6TWdZXVfhqJr8CCzbSGUAbDOzlGHJC1U+vRfLQDvw== + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.29.7.tgz#6115264516e95ead0f35a41710906612e447f605" + integrity sha512-zGYcYfq/WmZ4V+kBIXQon9dSSc8ircGZqw9ZaNhhGj9nZkeBu1jHLBDQqYYi5WA9uawvA2sIMbry2nCFhf5Djg== dependencies: - "@babel/helper-plugin-utils" "^7.28.6" + "@babel/helper-plugin-utils" "^7.29.7" "@babel/plugin-syntax-import-meta@^7.10.4": version "7.10.4" @@ -275,11 +275,11 @@ "@babel/helper-plugin-utils" "^7.8.0" "@babel/plugin-syntax-jsx@^7.7.2": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.28.6.tgz#f8ca28bbd84883b5fea0e447c635b81ba73997ee" - integrity sha512-wgEmr06G6sIpqr8YDwA2dSRTE3bJ+V0IfpzfSY3Lfgd7YWOaAdlykvJi13ZKBt8cZHfgH1IXN+CL656W3uUa4w== + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.29.7.tgz#622c16f9ad63782fe6e83dadc7e40330744b7f1e" + integrity sha512-TSu8+mHCoEaaCDEZ0I3+6mvTBYR4PCxQwf2z9/r5Tbztv6NaLR3B9thGTTxX2WGuGHJqRiAbKPeGTJ5XWXVg6A== dependencies: - "@babel/helper-plugin-utils" "^7.28.6" + "@babel/helper-plugin-utils" "^7.29.7" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" @@ -338,100 +338,100 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.7.2": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.28.6.tgz#c7b2ddf1d0a811145b1de800d1abd146af92e3a2" - integrity sha512-+nDNmQye7nlnuuHDboPbGm00Vqg3oO8niRRL27/4LYHUsHYh0zJ1xWOz0uRwNFmM1Avzk8wZbc6rdiYhomzv/A== - dependencies: - "@babel/helper-plugin-utils" "^7.28.6" - -"@babel/template@^7.28.6", "@babel/template@^7.3.3": - version "7.28.6" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.28.6.tgz#0e7e56ecedb78aeef66ce7972b082fce76a23e57" - integrity sha512-YA6Ma2KsCdGb+WC6UpBVFJGXL58MDA6oyONbjyF/+5sBgxY/dwkhLogbMT2GXXyU84/IhRw/2D1Os1B/giz+BQ== - dependencies: - "@babel/code-frame" "^7.28.6" - "@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== - dependencies: - "@babel/code-frame" "^7.28.6" - "@babel/generator" "^7.28.6" - "@babel/helper-globals" "^7.28.0" - "@babel/parser" "^7.28.6" - "@babel/template" "^7.28.6" - "@babel/types" "^7.28.6" + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.29.7.tgz#7c29388932313ed58413a0343048d75d92fb5b24" + integrity sha512-ngr+82Sh0xMz25TPCZi+nC2iTzjfCdWS2ONXTp/PtSCHCgaCNBpdMqgvJ2ccdLlClVZ7sisIgB914j/JFe+RZA== + dependencies: + "@babel/helper-plugin-utils" "^7.29.7" + +"@babel/template@^7.29.7", "@babel/template@^7.3.3": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.29.7.tgz#4d9d4004f645cdd304de958c725162784ecac700" + integrity sha512-puq+Gf35oI24FeN11LkoUQFqv9uwNeWpxXZi/Ji3rRIoKAzKnxRaZ+Gkj0vKS9ZCiTESfng1N9LyOyXvo+m+Gg== + dependencies: + "@babel/code-frame" "^7.29.7" + "@babel/parser" "^7.29.7" + "@babel/types" "^7.29.7" + +"@babel/traverse@^7.29.7": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.29.7.tgz#c47b07a41b95da0907d026b5dd894d98de7d2f2d" + integrity sha512-EhlfNQtZ+NK22w5BM61ciuiq1m58ed33Wr1Xan//ZRTy6hgjnwyCffRYwzsGXdASJSUJ1guZILsErh1eQcl+zw== + dependencies: + "@babel/code-frame" "^7.29.7" + "@babel/generator" "^7.29.7" + "@babel/helper-globals" "^7.29.7" + "@babel/parser" "^7.29.7" + "@babel/template" "^7.29.7" + "@babel/types" "^7.29.7" 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.29.7", "@babel/types@^7.3.3": + version "7.29.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.29.7.tgz#8005e31d82712ee7adaef6e23c63b71a62770a92" + integrity sha512-4zBIxpPzowiZpusoFkyGVwakdRJUyuH5PxQ/PrqghfdFWWasvnCdPfQXHrenDai+gyLARulZjZowCOj6fjT4pA== dependencies: - "@babel/helper-string-parser" "^7.27.1" - "@babel/helper-validator-identifier" "^7.28.5" + "@babel/helper-string-parser" "^7.29.7" + "@babel/helper-validator-identifier" "^7.29.7" "@bcoe/v8-coverage@^0.2.3": version "0.2.3" 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.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/biome/-/biome-2.4.10.tgz#daa52be56f027d16ca6fe36e313fd6b405b5d0f4" + integrity sha512-xxA3AphFQ1geij4JTHXv4EeSTda1IFn22ye9LdyVPoJU19fNVl0uzfEuhsfQ4Yue/0FaLs2/ccVi4UDiE7R30w== 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.10" + "@biomejs/cli-darwin-x64" "2.4.10" + "@biomejs/cli-linux-arm64" "2.4.10" + "@biomejs/cli-linux-arm64-musl" "2.4.10" + "@biomejs/cli-linux-x64" "2.4.10" + "@biomejs/cli-linux-x64-musl" "2.4.10" + "@biomejs/cli-win32-arm64" "2.4.10" + "@biomejs/cli-win32-x64" "2.4.10" + +"@biomejs/cli-darwin-arm64@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-2.4.10.tgz#bc348350bb2949ae814bc171354379819101268b" + integrity sha512-vuzzI1cWqDVzOMIkYyHbKqp+AkQq4K7k+UCXWpkYcY/HDn1UxdsbsfgtVpa40shem8Kax4TLDLlx8kMAecgqiw== + +"@biomejs/cli-darwin-x64@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-darwin-x64/-/cli-darwin-x64-2.4.10.tgz#864610f590005d877bed7f3e6ec39b25718caae2" + integrity sha512-14fzASRo+BPotwp7nWULy2W5xeUyFnTaq1V13Etrrxkrih+ez/2QfgFm5Ehtf5vSjtgx/IJycMMpn5kPd5ZNaA== + +"@biomejs/cli-linux-arm64-musl@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64-musl/-/cli-linux-arm64-musl-2.4.10.tgz#3542e9e89a3b83c6c6561e72d82ce40ce2063330" + integrity sha512-WrJY6UuiSD/Dh+nwK2qOTu8kdMDlLV3dLMmychIghHPAysWFq1/DGC1pVZx8POE3ZkzKR3PUUnVrtZfMfaJjyQ== + +"@biomejs/cli-linux-arm64@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-arm64/-/cli-linux-arm64-2.4.10.tgz#4d6b78d7c0eedbf97d41f0223fe715d603d66273" + integrity sha512-7MH1CMW5uuxQ/s7FLST63qF8B3Hgu2HRdZ7tA1X1+mk+St4JOuIrqdhIBnnyqeyWJNI+Bww7Es5QZ0wIc1Cmkw== + +"@biomejs/cli-linux-x64-musl@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64-musl/-/cli-linux-x64-musl-2.4.10.tgz#4bad644dfa1f6e6a58440943d197cd406c85d9f7" + integrity sha512-kDTi3pI6PBN6CiczsWYOyP2zk0IJI08EWEQyDMQWW221rPaaEz6FvjLhnU07KMzLv8q3qSuoB93ua6inSQ55Tw== + +"@biomejs/cli-linux-x64@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-linux-x64/-/cli-linux-x64-2.4.10.tgz#d63810a2cb3e80c727314df497aca47c72ccded5" + integrity sha512-tZLvEEi2u9Xu1zAqRjTcpIDGVtldigVvzug2fTuPG0ME/g8/mXpRPcNgLB22bGn6FvLJpHHnqLnwliOu8xjYrg== + +"@biomejs/cli-win32-arm64@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-arm64/-/cli-win32-arm64-2.4.10.tgz#e6927c6267776a8546908b1f45d394b416722dde" + integrity sha512-umwQU6qPzH+ISTf/eHyJ/QoQnJs3V9Vpjz2OjZXe9MVBZ7prgGafMy7yYeRGnlmDAn87AKTF3Q6weLoMGpeqdQ== + +"@biomejs/cli-win32-x64@2.4.10": + version "2.4.10" + resolved "https://registry.yarnpkg.com/@biomejs/cli-win32-x64/-/cli-win32-x64-2.4.10.tgz#fcd5c63f96f7342e55cd66df25f3d20a12cbf621" + integrity sha512-aW/JU5GuyH4uxMrNYpoC2kjaHlyJGLgIa3XkhPEZI0uKhZhJZU8BuEyJmvgzSPQNGozBwWjC972RaNdcJ9KyJg== "@bundled-es-modules/cookie@^2.0.1": version "2.0.1" @@ -496,9 +496,9 @@ resolve-from "^5.0.0" "@istanbuljs/schema@^0.1.2", "@istanbuljs/schema@^0.1.3": - version "0.1.3" - resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" - integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + version "0.1.6" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.6.tgz#8dc9afa2ac1506cb1a58f89940f1c124446c8df3" + integrity sha512-+Sg6GCR/wy1oSmQDFq4LQDAhm3ETKnorxN+y5nbLULOR3P0c14f2Wurzj3/xqPXtasLFfHd5iRFQ7AJt4KH2cw== "@jest/console@^29.7.0": version "29.7.0" @@ -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" @@ -784,9 +784,9 @@ "@sinonjs/commons" "^3.0.0" "@tootallnate/once@2": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" - integrity sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A== + version "2.0.1" + resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.1.tgz#35adc6222e3662fa2222ce123b961476a746b9ea" + integrity sha512-HqmEUIGRJ5fSXchkVgR5F7qn48bDBzv0kWj/Kfu5e6uci4UlEeng4331LnBkWffb++Ei3FOVLxo8JJWMFBDMeQ== "@types/babel__core@^7.1.14": version "7.20.5" @@ -826,26 +826,10 @@ resolved "https://registry.yarnpkg.com/@types/cookie/-/cookie-0.6.0.tgz#eac397f28bf1d6ae0ae081363eca2f425bedf0d5" integrity sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA== -"@types/eslint-scope@^3.7.7": - version "3.7.7" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" - integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== - dependencies: - "@types/eslint" "*" - "@types/estree" "*" - -"@types/eslint@*": - version "9.6.1" - resolved "https://registry.yarnpkg.com/@types/eslint/-/eslint-9.6.1.tgz#d5795ad732ce81715f27f75da913004a56751584" - integrity sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag== - dependencies: - "@types/estree" "*" - "@types/json-schema" "*" - -"@types/estree@*", "@types/estree@^1.0.8": - version "1.0.8" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.8.tgz#958b91c991b1867ced318bedea0e215ee050726e" - integrity sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w== +"@types/estree@^1.0.8": + version "1.0.9" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.9.tgz#cf3f0e876d7bee15a93ab925b82bf570a3904a24" + integrity sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg== "@types/graceful-fs@^4.1.3": version "4.1.9" @@ -890,7 +874,7 @@ "@types/tough-cookie" "*" parse5 "^7.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.15", "@types/json-schema@^7.0.9": +"@types/json-schema@^7.0.15", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" integrity sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA== @@ -904,25 +888,25 @@ 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 "26.0.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-26.0.1.tgz#4a60e2c7a6d68bd261e265f8983bfe1601263ce3" + integrity sha512-fc3KiUoBt6kie0N9bIW3E47vZsuaMf0PM2AaUpLCLT0s/LvX1nxAim6Fc049cNxODPpGm6qRAuUOB86SkRuPQw== dependencies: - undici-types "~7.16.0" + undici-types "~8.3.0" "@types/node@^14.14.30": version "14.18.63" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.63.tgz#1788fa8da838dbb5f9ea994b834278205db6ca2b" integrity sha512-fAtCfv4jJg+ExtXhvCkCqUKZ+4ok/JQk01qDKhL5BDDoS3AxKXhV5/MAVUZyQnSEd2GT92fkgZl0pz0Q0AzcIQ== -"@types/node@^18.19.70": - version "18.19.130" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.19.130.tgz#da4c6324793a79defb7a62cba3947ec5add00d59" - integrity sha512-GRaXQx6jGfL8sKfaIDD6OupbIHBr9jv7Jnaml9tB7l4v068PAOXqfcujMMo5PhbIs6ggR1XODELqahT2R8v0fg== +"@types/node@^20.0.0": + version "20.19.43" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.43.tgz#fcecf580ba42a0db55cf404c372c97973c376c97" + integrity sha512-6oYBAi5ikg4Pl+kGsoYtawUMBT2zZMCvPNF7pVLnHZfd1zf38DRiWn/gT01RYCdUqkv7Fhr+C9ot4/tb+2sVvA== dependencies: - undici-types "~5.26.4" + undici-types "~6.21.0" -"@types/readable-stream@^4.0.18": +"@types/readable-stream@^4.0.23": version "4.0.23" resolved "https://registry.yarnpkg.com/@types/readable-stream/-/readable-stream-4.0.23.tgz#fcd0f7472f45ceb43154f08f0083ccd1c76e53ce" integrity sha512-wwXrtQvbMHxCbBgjHaMGEmImFTQxxpfMOR/ZoQnXxB1woqkUbdLGFDgauo00Py9IudiaqSeiBiulSV9i6XIPig== @@ -1113,16 +1097,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.17.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.17.0.tgz#1785adb84faf8d8add10369b93826fc2bd08f1fe" + integrity sha512-xRQbDb9BnwDafYNn6Vwl839DYVjqXYb1XVGtWAZ1kcDc6iwAL4hg3B1dZlRiuENFeO2H53gFG3in621AdERVAg== agent-base@6: version "6.0.2" @@ -1151,9 +1135,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.20.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.20.0.tgz#304b3636add88ba7d936760dd50ece006dea95f9" + integrity sha512-Thbli+OlOj+iMPYFBVBfJ3OmCAnaSyNn4M1vz9T6Gka5Jt9ba/HIR56joy65tY6kx/FCF5VXNB819Y7/GUrBGA== dependencies: fast-deep-equal "^3.1.3" fast-uri "^3.0.1" @@ -1205,9 +1189,9 @@ asynckit@^0.4.0: integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== axios@^1.8.4: - version "1.17.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.17.0.tgz#ae5a1164a4f719942cd73c67e6a3f62d3ccb8f2b" - integrity sha512-J8SwNxprqqpbfenehxWYXE7CW+wM1BB4w3+N+g+/Wx40xM4rsLrfPmHHxSWIxJLYDgSY/HqlFPIYb2/S3rxafw== + version "1.18.1" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.18.1.tgz#d63f9863bcd8938815c86f9e2abd380189d96dfe" + integrity sha512-3nTvFlvpn9Zu/RkHUqtc7/+al4UpRW5az71ap5zccp6e8RAYEzhMTecX8Dz1wWDYrPpUoB1HAQEGEAEvUr7S9g== dependencies: follow-redirects "^1.16.0" form-data "^4.0.5" @@ -1287,15 +1271,15 @@ base64-js@^1.3.1: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" 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== +baseline-browser-mapping@^2.10.38: + version "2.10.40" + resolved "https://registry.yarnpkg.com/baseline-browser-mapping/-/baseline-browser-mapping-2.10.40.tgz#f372c8eb36ff4ad0b5e7ae467014abef124554ba" + integrity sha512-BSSLZ9/Cjjv7Gtj5B68ZzXcXUg8iOf3fme+FCuh8rC/Go+Kmh8cox7M3A8dolou16s64QjLPOSdngh7GxXvkSw== brace-expansion@^1.1.7: - version "1.1.12" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.12.tgz#ab9b454466e5a8cc3a187beaad580412a9c5b843" - integrity sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg== + version "1.1.15" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.15.tgz#a6d90d54067236e5f42570a3b7378d594d9b7738" + integrity sha512-EwOCDEex4quD37XhqM3omwtMoJjr//isUZz1JopUNWms+4Z2ViyM/k1YIRePpoVNnQhENnxtFjLaxNHrT7xIUg== dependencies: balanced-match "^1.0.0" concat-map "0.0.1" @@ -1308,15 +1292,15 @@ braces@^3.0.3: fill-range "^7.1.1" browserslist@^4.24.0, browserslist@^4.28.1: - version "4.28.1" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.1.tgz#7f534594628c53c63101079e27e40de490456a95" - integrity sha512-ZC5Bd0LgJXgwGqUknZY/vkUQ04r8NXnJZ3yYi4vDmSiZmC/pdSN0NbNRPxZpbtO4uAfDUAFffO8IZoM3Gj8IkA== + version "4.28.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.28.4.tgz#dd8b8167a32845ff5f8cd6ce13f5abba16cd04c9" + integrity sha512-MTc8i/x9jBQd1iMw2CFGS+rwMa07eYjLR0CCTLDACl9xhxy+nIs3KeML/biicXtk9JrZ6dnnTatmc7ErPXIxqw== dependencies: - baseline-browser-mapping "^2.9.0" - caniuse-lite "^1.0.30001759" - electron-to-chromium "^1.5.263" - node-releases "^2.0.27" - update-browserslist-db "^1.2.0" + baseline-browser-mapping "^2.10.38" + caniuse-lite "^1.0.30001799" + electron-to-chromium "^1.5.376" + node-releases "^2.0.48" + update-browserslist-db "^1.2.3" bs-logger@^0.2.6: version "0.2.6" @@ -1368,10 +1352,10 @@ camelcase@^6.2.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" 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== +caniuse-lite@^1.0.30001799: + version "1.0.30001799" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001799.tgz#5c909138c27f1a61219d3e092071c1cc7d32dc55" + integrity sha512-hG1bReV+OUU+MOqK4t/ZWI0tZOyz3rqS9XuhOUz1cIcbwBKjOyJEJuw9ER5JuNyqxNk8u/JUVbGibBOL1yrjFw== chalk@^4.0.0, chalk@^4.1.0: version "4.1.2" @@ -1525,9 +1509,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,10 +1559,10 @@ dunder-proto@^1.0.1: es-errors "^1.3.0" 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== +electron-to-chromium@^1.5.376: + version "1.5.379" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.379.tgz#ccece5fdc4a19880b570a3903881701df848b763" + integrity sha512-v/qV5aV5EUA2pGilzUCq5/eyOloZAqDZBu9UMBIzgPpLlprjSR6zswsWBTv0KpqxLGUAZEwhO95ZCt7srymNVA== emittery@^0.13.1: version "0.13.1" @@ -1590,13 +1574,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.22.2: + version "5.24.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.24.1.tgz#b2439adf5d31d7e4764de1f9ecf942d6cd3fc874" + integrity sha512-7DdUaTjmNwMcH2gLr1qycesKII3BK4RLy/mdAb7x10Lq7bR4aNKHt1BR1ZALSv0rPM/hF5wYF0PhGop/rJm8vw== dependencies: graceful-fs "^4.2.4" - tapable "^2.2.0" + tapable "^2.3.3" entities@^6.0.0: version "6.0.1" @@ -1620,15 +1604,15 @@ es-errors@^1.3.0: resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-module-lexer@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.0.0.tgz#f657cd7a9448dcdda9c070a3cb75e5dc1e85f5b1" - integrity sha512-5POEcUuZybH7IdmGsD8wlf0AI55wMecM9rVBTI/qEAy2c1kTOm3DjFYjrBdI2K3BaJjJYfYFeRtM0t9ssnRuxw== +es-module-lexer@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-2.1.0.tgz#1dfcbb5ea3bbfb63f28e1fc3676c3676d1c9624c" + integrity sha512-n27zTYMjYu1aj4MjCWzSP7G9r75utsaoc8m61weK+W8JMBGGQybd43GstCXZ3WNmSFtGT9wi59qQTW6mhTR5LQ== es-object-atoms@^1.0.0, es-object-atoms@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.1.tgz#1c4f2c4837327597ce69d2ca190a7fdd172338c1" - integrity sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA== + version "1.1.2" + resolved "https://registry.yarnpkg.com/es-object-atoms/-/es-object-atoms-1.1.2.tgz#a2d0b373205724dfa525d23b0c3e1b1ca582c99b" + integrity sha512-HWcBoN6NileqtSydK2FqHbS/LoDd2pqrnQHLyJzBj4kOp/ky2MWMN694xOfkK8/SnUsW2DH7EfyVlydKCsm1Zw== dependencies: es-errors "^1.3.0" @@ -1750,9 +1734,9 @@ fast-json-stable-stringify@2.x, fast-json-stable-stringify@^2.1.0: integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== fast-uri@^3.0.1: - version "3.1.0" - resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.0.tgz#66eecff6c764c0df9b762e62ca7edcfb53b4edfa" - integrity sha512-iPeeDKJSWf4IEOasVVrknXpaBV0IApz/gp7S2bb7Z4Lljbl2MGJRqInZiUrQwV16cpzw/D3S5j5Julj/gT52AA== + version "3.1.2" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.1.2.tgz#8af3d4fc9d3e71b11572cc2673b514a7d1a8c8ec" + integrity sha512-rVjf7ArG3LTk+FS6Yw81V1DLuZl1bRbNrev6Tmd/9RaroeeRRJhAt7jg/6YFxbvAQXUCavSoZhPPj6oOx+5KjQ== fb-watchman@^2.0.0: version "2.0.2" @@ -1781,21 +1765,21 @@ follow-redirects@^1.16.0: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.16.0.tgz#28474a159d3b9d11ef62050a14ed60e4df6d61bc" integrity sha512-y5rN/uOsadFT/JfYwhxRS5R7Qce+g3zG97+JrtFZlC9klX/W5hD7iiLzScI4nZqUS7DNUdhPgw4xI8W2LuXlUw== -form-data-encoder@^4.0.2: +form-data-encoder@^4.1.0: version "4.1.0" 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.5: - version "4.0.5" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.5.tgz#b49e48858045ff4cbf6b03e1805cebcad3679053" - integrity sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w== +form-data@^4.0.0, form-data@^4.0.1, form-data@^4.0.4, form-data@^4.0.5, form-data@^4.0.6: + version "4.0.6" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.6.tgz#28e864e1b786dbebb68db1f452f9635278665827" + integrity sha512-vKatAh4SlVfgbv+YtmhiRjhEMJsYpsG1Y2rMQtR+SVSbytsSD1YGzDIcrAJmdFec88u/+VoGmxnl+80gL1tRCQ== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" es-set-tostringtag "^2.1.0" - hasown "^2.0.2" - mime-types "^2.1.12" + hasown "^2.0.4" + mime-types "^2.1.35" formdata-node@^6.0.3: version "6.0.3" @@ -1861,11 +1845,6 @@ get-stream@^6.0.0: resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== -glob-to-regexp@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" - integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== - glob@^7.1.3, glob@^7.1.4: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" @@ -1889,14 +1868,14 @@ 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.14.2" + resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.14.2.tgz#83faf25869e3df727cc855161db5da85b0e5b2c0" + integrity sha512-Chq1s4CY7jmh8gO2qvLIJyfCDIN+EHLFW/9iShnp1z8FjBQMoodWP1kDC36VAMXXIvAjj4ARa7ntfAV2BrjsbA== -handlebars@^4.7.8: - version "4.7.8" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" - integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== +handlebars@^4.7.9: + version "4.7.9" + resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.9.tgz#6f139082ab58dc4e5a0e51efe7db5ae890d56a0f" + integrity sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ== dependencies: minimist "^1.2.5" neo-async "^2.6.2" @@ -1922,10 +1901,10 @@ has-tostringtag@^1.0.2: dependencies: has-symbols "^1.0.3" -hasown@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.2.tgz#003eaf91be7adc372e84ec59dc37252cedb80003" - integrity sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ== +hasown@^2.0.2, hasown@^2.0.3, hasown@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/hasown/-/hasown-2.0.4.tgz#8c62d8cb90beb2aad5d0a5b67581ad9854c3f003" + integrity sha512-T2UbfbBEF32wiepXIsMlTW9+dDYC6wMh/t/vYA4tuOMKqWz/n3vr1NFSxQiyP+zk2mXsoMA/i/7qV6LKut1t1A== dependencies: function-bind "^1.1.2" @@ -2028,11 +2007,11 @@ is-arrayish@^0.2.1: integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== is-core-module@^2.16.1: - version "2.16.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4" - integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w== + version "2.16.2" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.2.tgz#3e07450a8080ebce3fbf0cac494f4d2ab324e082" + integrity sha512-evOr8xfXKxE6qSR0hSXL2r3sd7ALj8+7jQEUvPYcm5sgZFdJ+AYzT6yNmJenvIYQBgIGwfwz08sL8zoL7yq2BA== dependencies: - hasown "^2.0.2" + hasown "^2.0.3" is-fullwidth-code-point@^3.0.0: version "3.0.0" @@ -2553,7 +2532,7 @@ jsesc@^3.0.2: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-3.1.0.tgz#74d335a234f67ed19907fdadfac7ccf9d409825d" integrity sha512-/sM3dO2FOzXjKQhJuo0Q173wf2KOo8t4I8vHy6lF9poUp7bKT0/NHE8fPX23PwfhnykfqnC2xRxOnVw5XuGIaA== -json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: +json-parse-even-better-errors@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== @@ -2583,10 +2562,10 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== -loader-runner@^4.3.1: - version "4.3.1" - resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.1.tgz#6c76ed29b0ccce9af379208299f07f876de737e3" - integrity sha512-IWqP2SCPhyVFTBtRcgMHdzlf9ul25NwaFx4wCEH/KjAXuuHY4yNjvPXsBokp8jCB936PyWRaPKUNh8NvylLp2Q== +loader-runner@^4.3.2: + version "4.3.2" + resolved "https://registry.yarnpkg.com/loader-runner/-/loader-runner-4.3.2.tgz#9913d3a15971f8f635915e601fb5c9d495d918e9" + integrity sha512-DFEqQ3ihfS9blba08cLfYf1NRAIEm+dDjic073DRDc3/JspI/8wYmtDsHwd3+4hwvdxSK7PGaElfTmm0awWJ4w== locate-path@^5.0.0: version "5.0.0" @@ -2646,7 +2625,7 @@ merge-stream@^2.0.0: resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== -micromatch@^4.0.0, micromatch@^4.0.4: +micromatch@^4.0.4: version "4.0.8" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202" integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA== @@ -2659,7 +2638,12 @@ mime-db@1.52.0: resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== -mime-types@^2.1.12, mime-types@^2.1.27: +mime-db@^1.54.0: + version "1.54.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.54.0.tgz#cddb3ee4f9c64530dff640236661d42cb6a314f5" + integrity sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ== + +mime-types@^2.1.35: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -2672,9 +2656,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" @@ -2683,6 +2667,16 @@ minimist@^1.2.5: resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== +minimizer-webpack-plugin@^5.6.1: + version "5.6.1" + resolved "https://registry.yarnpkg.com/minimizer-webpack-plugin/-/minimizer-webpack-plugin-5.6.1.tgz#289922a4c96c4ed1ddb76b8a00bd8074e89a2f7f" + integrity sha512-DoeAZz8Q1C1znwsUzej1fdoi4jCf7/+Em27ouLqfK/+3m8G+D7yDhUwrc3CNhjSzGUN1kn7Iv4sWmjflQHenpw== + dependencies: + "@jridgewell/trace-mapping" "^0.3.25" + jest-worker "^27.4.5" + schema-utils "^4.3.0" + terser "^5.31.1" + ms@^2.1.3: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" @@ -2740,10 +2734,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" 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== +node-releases@^2.0.48: + version "2.0.50" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.50.tgz#597197a852071ce42fc2550e58e223242bcba969" + integrity sha512-J6l92tKHX6w8Jy5nO1Vuc01NoIiRGi/d6qBKVxh+IQ8Cr3b6HbVNfKiF8ZpFKufTwpwxMmce2W3iQZ861ZRyTg== normalize-path@^3.0.0: version "3.0.0" @@ -2758,9 +2752,9 @@ npm-run-path@^4.0.1: path-key "^3.0.0" nwsapi@^2.2.2: - version "2.2.23" - resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.23.tgz#59712c3a88e6de2bb0b6ccc1070397267019cf6c" - integrity sha512-7wfH4sLbt4M0gCDzGE6vzQBo0bfTKjU7Sfpqy/7gs1qBfYz2vEJH6vXcBKpO3+6Yu1telwd0t9HpyOoLEQQbIQ== + version "2.2.24" + resolved "https://registry.yarnpkg.com/nwsapi/-/nwsapi-2.2.24.tgz#f8927043d4c9b516abdebe804a32c8d1f9484d1f" + integrity sha512-7YRhZ3jS45LwmSCT4b2sVFHt/WuovaktDU07QrtOBY2PXskss5a9jfmR9jptyumwXST+rFjrmppMY1KT/yn35A== once@^1.3.0: version "1.4.0" @@ -2855,9 +2849,14 @@ picocolors@^1.1.1: integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" - integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + version "2.3.2" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.2.tgz#5a942915e26b372dc0f0e6753149a16e6b1c5601" + integrity sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA== + +picomatch@^4.0.0: + version "4.0.4" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.4.tgz#fd6f5e00a143086e074dffe4c924b8fb293b0589" + integrity sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A== pirates@^4.0.4: version "4.0.7" @@ -2920,19 +2919,12 @@ 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" integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg== -readable-stream@^4.5.2: +readable-stream@^4.7.0: version "4.7.0" resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-4.7.0.tgz#cedbd8a1146c13dfff8dab14068028d58c15ac91" integrity sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg== @@ -2976,10 +2968,11 @@ resolve.exports@^2.0.0: integrity sha512-OcXjMsGdhL4XnbShKpAcSqPMzQoYkYyhbEaeSko47MjRP9NfEQMhZkXL1DoFlt9LWQn4YttrdnV6X2OiyzBi+A== resolve@^1.20.0: - version "1.22.11" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.11.tgz#aad857ce1ffb8bfa9b0b1ac29f1156383f68c262" - integrity sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ== + version "1.22.12" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.12.tgz#f5b2a680897c69c238a13cd16b15671f8b73549f" + integrity sha512-TyeJ1zif53BPfHootBGwPRYT1RUt6oGWsaQr8UyZW/eAm9bKoijtvruSDEmZHm92CwS9nj7/fWttqPCgzep8CA== dependencies: + es-errors "^1.3.0" is-core-module "^2.16.1" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -2989,7 +2982,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,17 +3014,10 @@ semver@^6.3.0, semver@^6.3.1: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.1.tgz#556d2ef8689146e46dcea4bfdd095f3434dffcb4" 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" +semver@^7.5.3, semver@^7.5.4, semver@^7.8.0: + version "7.8.5" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.8.5.tgz#39b646037dd50c14fb451e7e4cac58ed8b863f69" + integrity sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA== shebang-command@^2.0.0: version "2.0.0" @@ -3195,26 +3181,15 @@ 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: - 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== - 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" +tapable@^2.3.0, tapable@^2.3.3: + version "2.3.3" + resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.3.3.tgz#5da7c9992c46038221267985ab28421a8879f160" + integrity sha512-uxc/zpqFg6x7C8vOE7lh6Lbda8eEL9zmVm/PLeTPBRhh1xCgdWaQ+J1CUieGpIfm2HdtsUpRv+HshiasBMcc6A== 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.48.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.48.0.tgz#8b391171cfbb7ac4a88f9f04ba1cfabc54f643db" + integrity sha512-J/9An6vs9Us6wKRriSFXBWdRZapREHqFzdNUKk0pmu804EMR6dr6winwo7e5JDxN4xahxQsuysyYFwlwj4XN/Q== dependencies: "@jridgewell/source-map" "^0.3.3" acorn "^8.15.0" @@ -3235,17 +3210,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.4.4: + version "7.4.4" + resolved "https://registry.yarnpkg.com/tldts-core/-/tldts-core-7.4.4.tgz#a06de228c70a334e26d1597af7a82376e8588bce" + integrity sha512-vwVLJVvvpslm7vqAH7+XNj/neA/Ynq7DT2EEcMuwc5YzN5XaMyRAqxwU+uX3azZ1FQtB2gvrvnLnAEkvYlVdfg== 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.4.4" + resolved "https://registry.yarnpkg.com/tldts/-/tldts-7.4.4.tgz#343191348abbff80118732a1a84e90fcf95b29df" + integrity sha512-kFXFK7O4WPextIUAOk8qtnw9dxR9UIXP9CjuH1cTBVBZMDeQcUPgr/IazGiw1B0Yiw5L75gHLWeW4iD793r90g== dependencies: - tldts-core "^7.0.19" + tldts-core "^7.4.4" tmpl@1.0.5: version "1.0.5" @@ -3270,9 +3245,9 @@ tough-cookie@^4.1.2: url-parse "^1.5.3" tough-cookie@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-6.0.0.tgz#11e418b7864a2c0d874702bc8ce0f011261940e5" - integrity sha512-kXuRi1mtaKMrsLUxz3sQYvVl37B0Ns6MzfrtV5DvJceE9bPyspOqk9xxv7XbZWcfLWbFmm997vl83qUWVJA64w== + version "6.0.1" + resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-6.0.1.tgz#a495f833836609ed983c19bc65639cfbceb54c76" + integrity sha512-LktZQb3IeoUWB9lqR5EWTHgW/VTITCXg4D21M+lvybRVdylLrRMnqaIONLVb5mav8vM19m44HIcGq4qASeu2Qw== dependencies: tldts "^7.0.5" @@ -3289,29 +3264,27 @@ tr46@~0.0.3: integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw== ts-jest@^29.3.4: - version "29.4.6" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.6.tgz#51cb7c133f227396818b71297ad7409bb77106e9" - integrity sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA== + version "29.4.11" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.11.tgz#42f5de21c37ccc01a580253afae6955abbf4d0b3" + integrity sha512-IrFl7l9AuB/qrNw5quqvAv/hmKMb8dhWOH4jQOGo0Oq8tCeo1O86/iTFG1FaRimgUkF13l4PcepO8ATFT6Ns4g== dependencies: bs-logger "^0.2.6" fast-json-stable-stringify "^2.1.0" - handlebars "^4.7.8" + handlebars "^4.7.9" json5 "^2.2.3" lodash.memoize "^4.1.2" make-error "^1.3.6" - semver "^7.7.3" + semver "^7.8.0" type-fest "^4.41.0" yargs-parser "^21.1.1" -ts-loader@^9.5.1: - version "9.5.4" - resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.5.4.tgz#44b571165c10fb5a90744aa5b7e119233c4f4585" - integrity sha512-nCz0rEwunlTZiy6rXFByQU1kVVpCIgUpc/psFiKVrUwrizdnIbRFu8w7bxhUF0X613DYwT4XzrZHpVyMe758hQ== +ts-loader@^9.5.4: + version "9.6.2" + resolved "https://registry.yarnpkg.com/ts-loader/-/ts-loader-9.6.2.tgz#a08f4935ddb87edbd58ce33b7b2558c2a77fdd47" + integrity sha512-R4iuczmtgxvtuI556s+hTZ6/7Ee03VCAk/l/M8LY1OAsUgB7YydsCxkgq9D9pKRaD7GJqUi2u8fp9zZP/ufjKA== dependencies: chalk "^4.1.0" - enhanced-resolve "^5.0.0" - micromatch "^4.0.0" - semver "^7.3.4" + picomatch "^4.0.0" source-map "^0.7.4" tslib@2.8.1, tslib@^2.8.1: @@ -3334,32 +3307,32 @@ type-fest@^4.26.1, type-fest@^4.41.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-4.41.0.tgz#6ae1c8e5731273c2bf1f58ad39cbae2c91a46c58" integrity sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA== -typescript@~5.7.2: - version "5.7.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.7.3.tgz#919b44a7dbb8583a9b856d162be24a54bf80073e" - integrity sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw== +typescript@~5.9.3: + version "5.9.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.3.tgz#5b4f59e15310ab17a216f5d6cf53ee476ede670f" + integrity sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw== uglify-js@^3.1.4: version "3.19.3" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.19.3.tgz#82315e9bbc6f2b25888858acd1fff8441035b77f" integrity sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ== -undici-types@~5.26.4: - version "5.26.5" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617" - integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA== +undici-types@~6.21.0: + version "6.21.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" + integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== -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@~8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-8.3.0.tgz#44e9fc9f3244648cdea35e4f9bb2d681e9410809" + integrity sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ== universalify@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.2.0.tgz#6451760566fa857534745ab1dde952d1b1761be0" integrity sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg== -update-browserslist-db@^1.2.0: +update-browserslist-db@^1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.2.3.tgz#64d76db58713136acbeb4c49114366cc6cc2e80d" integrity sha512-Js0m9cx+qOgDxo0eMiFGEueWztz+d4+M3rGlmKPT+T4IS/jP4ylw3Nwpu6cpTTP8R1MAC1kF4VbdLt3ARf209w== @@ -3398,12 +3371,11 @@ 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.2: + version "2.5.2" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.5.2.tgz#e12e82d84674266fc1c6dbfe38891b92ff0522ec" + integrity sha512-6i/00NBjP4yGPs+caKSyRfpTF/8Torsu0MOW3mMzIbhgISFder8i7xbqgHlLMwJrdiN8ndBV3UA1/AfzPSr+jg== dependencies: - glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" webidl-conversions@^3.0.0: @@ -3416,41 +3388,38 @@ 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.5.0: + version "3.5.0" + resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.5.0.tgz#87bf7f5801a4e985b1f1c92b64b9620a02f76d08" + integrity sha512-HPuy+uuoTCaaoEoI1LQ3JN9+vrPBvEesnnX1jADHy728cHSMlq4wUc4afYqahq2B1mhQVZxCXOkNTnXltr+2vQ== -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== +webpack@^5.105.4: + version "5.108.1" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.108.1.tgz#cd5856f9a88e55f344d64a6623c09bf34446cc9d" + integrity sha512-UUCihHQK3O7483Woa0SulNLDeAiOhHI2PN2PAPU4fVWJqbzhv04EJ8FaWtB9WWh3i8fRt28543U7VfuJTOrpgQ== dependencies: - "@types/eslint-scope" "^3.7.7" "@types/estree" "^1.0.8" "@types/json-schema" "^7.0.15" "@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" - es-module-lexer "^2.0.0" + enhanced-resolve "^5.22.2" + es-module-lexer "^2.1.0" eslint-scope "5.1.1" events "^3.2.0" - glob-to-regexp "^0.4.1" graceful-fs "^4.2.11" - json-parse-even-better-errors "^2.3.1" - loader-runner "^4.3.1" - mime-types "^2.1.27" + loader-runner "^4.3.2" + mime-db "^1.54.0" + minimizer-webpack-plugin "^5.6.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" + watchpack "^2.5.2" + webpack-sources "^3.5.0" whatwg-encoding@^2.0.0: version "2.0.0" @@ -3524,9 +3493,9 @@ write-file-atomic@^4.0.2: signal-exit "^3.0.7" ws@^8.11.0: - version "8.19.0" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.19.0.tgz#ddc2bdfa5b9ad860204f5a72a4863a8895fd8c8b" - integrity sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg== + version "8.21.0" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.21.0.tgz#012e413fc07429945121b0c153158c4343086951" + integrity sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g== xml-name-validator@^4.0.0: version "4.0.0" @@ -3554,9 +3523,9 @@ yargs-parser@^21.1.1: integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs@^17.3.1, yargs@^17.7.2: - version "17.7.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.2.tgz#991df39aca675a192b816e1e0363f9d75d2aa269" - integrity sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w== + version "17.7.3" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.7.3.tgz#779dffe6bcafec596a7172e983289a588647faaa" + integrity sha512-GZtjxm/J/4TSxuL3FNYjCmLktBTnIw/rVmKSIyKeYAZpmJB2ig9VauCC5xsa82GNKVKDAqpOn3KVzNt0zmrU0g== dependencies: cliui "^8.0.1" escalade "^3.1.1"