diff --git a/README.md b/README.md index cd3a4a2..7b766e7 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,396 @@ try { } ``` +## Binary Response + +You can consume binary data from endpoints using the `BinaryResponse` type which lets you choose how to consume the data: + +```typescript +const response = await client.fileStash.downloadFile(...); +const stream: ReadableStream = response.stream(); +// const arrayBuffer: ArrayBuffer = await response.arrayBuffer(); +// const blob: Blob = response.blob(); +// const bytes: Uint8Array = response.bytes(); +// You can only use the response body once, so you must choose one of the above methods. +// If you want to check if the response body has been used, you can use the following property. +const bodyUsed = response.bodyUsed; +``` + +
+Save binary response to a file + +
+
+Node.js + +
+
+ReadableStream (most-efficient) + +```ts +import { createWriteStream } from 'fs'; +import { Readable } from 'stream'; +import { pipeline } from 'stream/promises'; + +const response = await client.fileStash.downloadFile(...); + +const stream = response.stream(); +const nodeStream = Readable.fromWeb(stream); +const writeStream = createWriteStream('path/to/file'); + +await pipeline(nodeStream, writeStream); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.fileStash.downloadFile(...); + +const arrayBuffer = await response.arrayBuffer(); +await writeFile('path/to/file', Buffer.from(arrayBuffer)); +``` + +
+
+ +
+
+Blob + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.fileStash.downloadFile(...); + +const blob = await response.blob(); +const arrayBuffer = await blob.arrayBuffer(); +await writeFile('output.bin', Buffer.from(arrayBuffer)); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +import { writeFile } from 'fs/promises'; + +const response = await client.fileStash.downloadFile(...); + +const bytes = await response.bytes(); +await writeFile('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Bun + +
+
+ReadableStream (most-efficient) + +```ts +const response = await client.fileStash.downloadFile(...); + +const stream = response.stream(); +await Bun.write('path/to/file', stream); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.fileStash.downloadFile(...); + +const arrayBuffer = await response.arrayBuffer(); +await Bun.write('path/to/file', arrayBuffer); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.fileStash.downloadFile(...); + +const blob = await response.blob(); +await Bun.write('path/to/file', blob); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.fileStash.downloadFile(...); + +const bytes = await response.bytes(); +await Bun.write('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Deno + +
+
+ReadableStream (most-efficient) + +```ts +const response = await client.fileStash.downloadFile(...); + +const stream = response.stream(); +const file = await Deno.open('path/to/file', { write: true, create: true }); +await stream.pipeTo(file.writable); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.fileStash.downloadFile(...); + +const arrayBuffer = await response.arrayBuffer(); +await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.fileStash.downloadFile(...); + +const blob = await response.blob(); +const arrayBuffer = await blob.arrayBuffer(); +await Deno.writeFile('path/to/file', new Uint8Array(arrayBuffer)); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.fileStash.downloadFile(...); + +const bytes = await response.bytes(); +await Deno.writeFile('path/to/file', bytes); +``` + +
+
+ +
+
+ +
+
+Browser + +
+
+Blob (most-efficient) + +```ts +const response = await client.fileStash.downloadFile(...); + +const blob = await response.blob(); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ReadableStream + +```ts +const response = await client.fileStash.downloadFile(...); + +const stream = response.stream(); +const reader = stream.getReader(); +const chunks = []; + +while (true) { + const { done, value } = await reader.read(); + if (done) break; + chunks.push(value); +} + +const blob = new Blob(chunks); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.fileStash.downloadFile(...); + +const arrayBuffer = await response.arrayBuffer(); +const blob = new Blob([arrayBuffer]); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.fileStash.downloadFile(...); + +const bytes = await response.bytes(); +const blob = new Blob([bytes]); +const url = URL.createObjectURL(blob); + +// trigger download +const a = document.createElement('a'); +a.href = url; +a.download = 'filename'; +a.click(); +URL.revokeObjectURL(url); +``` + +
+
+ +
+
+ +
+ + +
+Convert binary response to text + +
+
+ReadableStream + +```ts +const response = await client.fileStash.downloadFile(...); + +const stream = response.stream(); +const text = await new Response(stream).text(); +``` + +
+
+ +
+
+ArrayBuffer + +```ts +const response = await client.fileStash.downloadFile(...); + +const arrayBuffer = await response.arrayBuffer(); +const text = new TextDecoder().decode(arrayBuffer); +``` + +
+
+ +
+
+Blob + +```ts +const response = await client.fileStash.downloadFile(...); + +const blob = await response.blob(); +const text = await blob.text(); +``` + +
+
+ +
+
+Bytes (UIntArray8) + +```ts +const response = await client.fileStash.downloadFile(...); + +const bytes = await response.bytes(); +const text = new TextDecoder().decode(bytes); +``` + +
+
+ +
+ ## Pagination List endpoints are paginated. The SDK provides an iterator so that you can simply loop over the items: @@ -85,13 +475,27 @@ const client = new PipedreamClient({ projectEnvironment: "YOUR_PROJECT_ENVIRONMENT", projectId: "YOUR_PROJECT_ID", }); -const response = await client.apps.list(); +const response = await client.apps.list({ + after: "after", + before: "before", + limit: 1, + q: "q", + sortKey: "name", + sortDirection: "asc", +}); for await (const item of response) { console.log(item); } // Or you can manually iterate page-by-page -let page = await client.apps.list(); +let page = await client.apps.list({ + after: "after", + before: "before", + limit: 1, + q: "q", + sortKey: "name", + sortDirection: "asc", +}); while (page.hasNextPage()) { page = page.getNextPage(); } diff --git a/package.json b/package.json index 4a9189b..583b2c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sdk", - "version": "2.0.10", + "version": "2.0.11", "private": false, "repository": "github:PipedreamHQ/pipedream-sdk-typescript", "type": "commonjs", diff --git a/src/api/resources/accounts/client/Client.ts b/src/api/resources/accounts/client/Client.ts index 33b346f..3caa762 100644 --- a/src/api/resources/accounts/client/Client.ts +++ b/src/api/resources/accounts/client/Client.ts @@ -54,7 +54,15 @@ export class Accounts { * @throws {@link Pipedream.TooManyRequestsError} * * @example - * await client.accounts.list() + * await client.accounts.list({ + * externalUserId: "external_user_id", + * oauthAppId: "oauth_app_id", + * after: "after", + * before: "before", + * limit: 1, + * app: "app", + * includeCredentials: true + * }) */ public async list( request: Pipedream.AccountsListRequest = {}, @@ -64,11 +72,8 @@ export class Accounts { async ( request: Pipedream.AccountsListRequest, ): Promise> => { - const { app, externalUserId, oauthAppId, after, before, limit, includeCredentials } = request; + const { externalUserId, oauthAppId, after, before, limit, app, includeCredentials } = request; const _queryParams: Record = {}; - if (app != null) { - _queryParams["app"] = app; - } if (externalUserId != null) { _queryParams["external_user_id"] = externalUserId; } @@ -84,6 +89,9 @@ export class Accounts { if (limit != null) { _queryParams["limit"] = limit.toString(); } + if (app != null) { + _queryParams["app"] = app; + } if (includeCredentials != null) { _queryParams["include_credentials"] = includeCredentials.toString(); } @@ -158,11 +166,11 @@ export class Accounts { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.pageInfo.endCursor != null && + !(typeof response?.pageInfo.endCursor === "string" && response?.pageInfo.endCursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.pageInfo.endCursor)); }, }); } @@ -177,6 +185,8 @@ export class Accounts { * * @example * await client.accounts.create({ + * externalUserId: "external_user_id", + * oauthAppId: "oauth_app_id", * appSlug: "app_slug", * cfmapJson: "cfmap_json", * connectToken: "connect_token" @@ -193,12 +203,8 @@ export class Accounts { request: Pipedream.CreateAccountOpts, requestOptions?: Accounts.RequestOptions, ): Promise> { - const { appId, externalUserId, oauthAppId, ..._body } = request; + const { externalUserId, oauthAppId, ..._body } = request; const _queryParams: Record = {}; - if (appId != null) { - _queryParams["app_id"] = appId; - } - if (externalUserId != null) { _queryParams["external_user_id"] = externalUserId; } @@ -290,7 +296,9 @@ export class Accounts { * @throws {@link Pipedream.TooManyRequestsError} * * @example - * await client.accounts.retrieve("account_id") + * await client.accounts.retrieve("account_id", { + * includeCredentials: true + * }) */ public retrieve( accountId: string, diff --git a/src/api/resources/accounts/client/requests/AccountsListRequest.ts b/src/api/resources/accounts/client/requests/AccountsListRequest.ts index 3d6b739..c565249 100644 --- a/src/api/resources/accounts/client/requests/AccountsListRequest.ts +++ b/src/api/resources/accounts/client/requests/AccountsListRequest.ts @@ -4,11 +4,17 @@ /** * @example - * {} + * { + * externalUserId: "external_user_id", + * oauthAppId: "oauth_app_id", + * after: "after", + * before: "before", + * limit: 1, + * app: "app", + * includeCredentials: true + * } */ export interface AccountsListRequest { - /** The app slug or ID to filter accounts by. */ - app?: string; externalUserId?: string; /** The OAuth app ID to filter by, if applicable */ oauthAppId?: string; @@ -18,6 +24,8 @@ export interface AccountsListRequest { before?: string; /** The maximum number of results to return */ limit?: number; + /** The app slug or ID to filter accounts by. */ + app?: string; /** Whether to retrieve the account's credentials or not */ includeCredentials?: boolean; } diff --git a/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts b/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts index 59f4f6b..3ec0e43 100644 --- a/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts +++ b/src/api/resources/accounts/client/requests/AccountsRetrieveRequest.ts @@ -4,7 +4,9 @@ /** * @example - * {} + * { + * includeCredentials: true + * } */ export interface AccountsRetrieveRequest { /** Whether to retrieve the account's credentials or not */ diff --git a/src/api/resources/accounts/client/requests/CreateAccountOpts.ts b/src/api/resources/accounts/client/requests/CreateAccountOpts.ts index 1db32a3..f520948 100644 --- a/src/api/resources/accounts/client/requests/CreateAccountOpts.ts +++ b/src/api/resources/accounts/client/requests/CreateAccountOpts.ts @@ -5,14 +5,14 @@ /** * @example * { + * externalUserId: "external_user_id", + * oauthAppId: "oauth_app_id", * appSlug: "app_slug", * cfmapJson: "cfmap_json", * connectToken: "connect_token" * } */ export interface CreateAccountOpts { - /** The app slug or ID to filter accounts by. */ - appId?: string; externalUserId?: string; /** The OAuth app ID to filter by, if applicable */ oauthAppId?: string; diff --git a/src/api/resources/actions/client/Client.ts b/src/api/resources/actions/client/Client.ts index 9525952..d270006 100644 --- a/src/api/resources/actions/client/Client.ts +++ b/src/api/resources/actions/client/Client.ts @@ -54,7 +54,13 @@ export class Actions { * @throws {@link Pipedream.TooManyRequestsError} * * @example - * await client.actions.list() + * await client.actions.list({ + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * app: "app" + * }) */ public async list( request: Pipedream.ActionsListRequest = {}, @@ -152,11 +158,11 @@ export class Actions { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.pageInfo.endCursor != null && + !(typeof response?.pageInfo.endCursor === "string" && response?.pageInfo.endCursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.pageInfo.endCursor)); }, }); } diff --git a/src/api/resources/actions/client/requests/ActionsListRequest.ts b/src/api/resources/actions/client/requests/ActionsListRequest.ts index 42df32d..31663ba 100644 --- a/src/api/resources/actions/client/requests/ActionsListRequest.ts +++ b/src/api/resources/actions/client/requests/ActionsListRequest.ts @@ -4,7 +4,13 @@ /** * @example - * {} + * { + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * app: "app" + * } */ export interface ActionsListRequest { /** The cursor to start from for pagination */ diff --git a/src/api/resources/apps/client/Client.ts b/src/api/resources/apps/client/Client.ts index e04648c..6108f1c 100644 --- a/src/api/resources/apps/client/Client.ts +++ b/src/api/resources/apps/client/Client.ts @@ -52,7 +52,14 @@ export class Apps { * @param {Apps.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await client.apps.list() + * await client.apps.list({ + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * sortKey: "name", + * sortDirection: "asc" + * }) */ public async list( request: Pipedream.AppsListRequest = {}, @@ -157,11 +164,11 @@ export class Apps { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.pageInfo.endCursor != null && + !(typeof response?.pageInfo.endCursor === "string" && response?.pageInfo.endCursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.pageInfo.endCursor)); }, }); } diff --git a/src/api/resources/apps/client/requests/AppsListRequest.ts b/src/api/resources/apps/client/requests/AppsListRequest.ts index 4354f1f..27f463f 100644 --- a/src/api/resources/apps/client/requests/AppsListRequest.ts +++ b/src/api/resources/apps/client/requests/AppsListRequest.ts @@ -6,7 +6,14 @@ import * as Pipedream from "../../../../index.js"; /** * @example - * {} + * { + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * sortKey: "name", + * sortDirection: "asc" + * } */ export interface AppsListRequest { /** The cursor to start from for pagination */ diff --git a/src/api/resources/components/client/Client.ts b/src/api/resources/components/client/Client.ts index 3c66665..03c28b9 100644 --- a/src/api/resources/components/client/Client.ts +++ b/src/api/resources/components/client/Client.ts @@ -54,7 +54,14 @@ export class Components { * @throws {@link Pipedream.TooManyRequestsError} * * @example - * await client.components.list() + * await client.components.list({ + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * app: "app", + * componentType: "trigger" + * }) */ public async list( request: Pipedream.ComponentsListRequest = {}, @@ -158,11 +165,11 @@ export class Components { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.pageInfo.endCursor != null && + !(typeof response?.pageInfo.endCursor === "string" && response?.pageInfo.endCursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.pageInfo.endCursor)); }, }); } diff --git a/src/api/resources/components/client/requests/ComponentsListRequest.ts b/src/api/resources/components/client/requests/ComponentsListRequest.ts index cc72dc3..a88ce34 100644 --- a/src/api/resources/components/client/requests/ComponentsListRequest.ts +++ b/src/api/resources/components/client/requests/ComponentsListRequest.ts @@ -6,7 +6,14 @@ import * as Pipedream from "../../../../index.js"; /** * @example - * {} + * { + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * app: "app", + * componentType: "trigger" + * } */ export interface ComponentsListRequest { /** The cursor to start from for pagination */ diff --git a/src/api/resources/deployedTriggers/client/Client.ts b/src/api/resources/deployedTriggers/client/Client.ts index 438212b..e708be4 100644 --- a/src/api/resources/deployedTriggers/client/Client.ts +++ b/src/api/resources/deployedTriggers/client/Client.ts @@ -55,6 +55,9 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.list({ + * after: "after", + * before: "before", + * limit: 1, * externalUserId: "external_user_id" * }) */ @@ -149,11 +152,11 @@ export class DeployedTriggers { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.pageInfo.endCursor != null && + !(typeof response?.pageInfo.endCursor === "string" && response?.pageInfo.endCursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.pageInfo.endCursor)); }, }); } @@ -369,7 +372,8 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.delete("trigger_id", { - * externalUserId: "external_user_id" + * externalUserId: "external_user_id", + * ignoreHookErrors: true * }) */ public delete( @@ -461,7 +465,8 @@ export class DeployedTriggers { * * @example * await client.deployedTriggers.listEvents("trigger_id", { - * externalUserId: "external_user_id" + * externalUserId: "external_user_id", + * n: 1 * }) */ public listEvents( diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts index 85caddb..1a4a83f 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersDeleteRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * externalUserId: "external_user_id" + * externalUserId: "external_user_id", + * ignoreHookErrors: true * } */ export interface DeployedTriggersDeleteRequest { diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts index 252c88d..c65e990 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListEventsRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * externalUserId: "external_user_id" + * externalUserId: "external_user_id", + * n: 1 * } */ export interface DeployedTriggersListEventsRequest { diff --git a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts index 15808d7..6aa5405 100644 --- a/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts +++ b/src/api/resources/deployedTriggers/client/requests/DeployedTriggersListRequest.ts @@ -5,6 +5,9 @@ /** * @example * { + * after: "after", + * before: "before", + * limit: 1, * externalUserId: "external_user_id" * } */ diff --git a/src/api/resources/fileStash/client/Client.ts b/src/api/resources/fileStash/client/Client.ts index 2b6b503..c3de2fd 100644 --- a/src/api/resources/fileStash/client/Client.ts +++ b/src/api/resources/fileStash/client/Client.ts @@ -46,28 +46,19 @@ export class FileStash { /** * Download a file from File Stash - * - * @param {Pipedream.FileStashDownloadFileRequest} request - * @param {FileStash.RequestOptions} requestOptions - Request-specific configuration. - * * @throws {@link Pipedream.TooManyRequestsError} - * - * @example - * await client.fileStash.downloadFile({ - * s3Key: "s3_key" - * }) */ public downloadFile( request: Pipedream.FileStashDownloadFileRequest, requestOptions?: FileStash.RequestOptions, - ): core.HttpResponsePromise { + ): core.HttpResponsePromise { return core.HttpResponsePromise.fromPromise(this.__downloadFile(request, requestOptions)); } private async __downloadFile( request: Pipedream.FileStashDownloadFileRequest, requestOptions?: FileStash.RequestOptions, - ): Promise> { + ): Promise> { const { s3Key } = request; const _queryParams: Record = {}; _queryParams["s3_key"] = s3Key; @@ -79,7 +70,7 @@ export class FileStash { }), requestOptions?.headers, ); - const _response = await core.fetcher({ + const _response = await core.fetcher({ url: core.url.join( (await core.Supplier.get(this._options.baseUrl)) ?? (await core.Supplier.get(this._options.environment)) ?? @@ -89,12 +80,13 @@ export class FileStash { method: "GET", headers: _headers, queryParameters: { ..._queryParams, ...requestOptions?.queryParams }, + responseType: "binary-response", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { - return { data: undefined, rawResponse: _response.rawResponse }; + return { data: _response.body, rawResponse: _response.rawResponse }; } if (_response.error.reason === "status-code") { diff --git a/src/api/resources/tokens/client/Client.ts b/src/api/resources/tokens/client/Client.ts index b745382..9ba0aa2 100644 --- a/src/api/resources/tokens/client/Client.ts +++ b/src/api/resources/tokens/client/Client.ts @@ -153,7 +153,8 @@ export class Tokens { * * @example * await client.tokens.validate("ctok", { - * appId: "app_id" + * appId: "app_id", + * oauthAppId: "oauth_app_id" * }) */ public validate( diff --git a/src/api/resources/tokens/client/requests/TokensValidateRequest.ts b/src/api/resources/tokens/client/requests/TokensValidateRequest.ts index 8a584a2..14cca48 100644 --- a/src/api/resources/tokens/client/requests/TokensValidateRequest.ts +++ b/src/api/resources/tokens/client/requests/TokensValidateRequest.ts @@ -5,7 +5,8 @@ /** * @example * { - * appId: "app_id" + * appId: "app_id", + * oauthAppId: "oauth_app_id" * } */ export interface TokensValidateRequest { diff --git a/src/api/resources/triggers/client/Client.ts b/src/api/resources/triggers/client/Client.ts index c1c8386..b6c73eb 100644 --- a/src/api/resources/triggers/client/Client.ts +++ b/src/api/resources/triggers/client/Client.ts @@ -54,7 +54,13 @@ export class Triggers { * @throws {@link Pipedream.TooManyRequestsError} * * @example - * await client.triggers.list() + * await client.triggers.list({ + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * app: "app" + * }) */ public async list( request: Pipedream.TriggersListRequest = {}, @@ -152,11 +158,11 @@ export class Triggers { response: dataWithRawResponse.data, rawResponse: dataWithRawResponse.rawResponse, hasNextPage: (response) => - response?.pageInfo?.endCursor != null && - !(typeof response?.pageInfo?.endCursor === "string" && response?.pageInfo?.endCursor === ""), + response?.pageInfo.endCursor != null && + !(typeof response?.pageInfo.endCursor === "string" && response?.pageInfo.endCursor === ""), getItems: (response) => response?.data ?? [], loadPage: (response) => { - return list(core.setObjectProperty(request, "after", response?.pageInfo?.endCursor)); + return list(core.setObjectProperty(request, "after", response?.pageInfo.endCursor)); }, }); } diff --git a/src/api/resources/triggers/client/requests/TriggersListRequest.ts b/src/api/resources/triggers/client/requests/TriggersListRequest.ts index ce4d486..134a445 100644 --- a/src/api/resources/triggers/client/requests/TriggersListRequest.ts +++ b/src/api/resources/triggers/client/requests/TriggersListRequest.ts @@ -4,7 +4,13 @@ /** * @example - * {} + * { + * after: "after", + * before: "before", + * limit: 1, + * q: "q", + * app: "app" + * } */ export interface TriggersListRequest { /** The cursor to start from for pagination */ diff --git a/src/api/types/Component.ts b/src/api/types/Component.ts index 9a17048..4cb2dc9 100644 --- a/src/api/types/Component.ts +++ b/src/api/types/Component.ts @@ -17,4 +17,5 @@ export interface Component { /** The type of component (trigger or action) */ componentType?: string; stash?: Pipedream.ComponentStash; + annotations?: Pipedream.ToolAnnotations; } diff --git a/src/api/types/ConfigurablePropAny.ts b/src/api/types/ConfigurablePropAny.ts index 50fab72..2dbf634 100644 --- a/src/api/types/ConfigurablePropAny.ts +++ b/src/api/types/ConfigurablePropAny.ts @@ -2,8 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropAny { type: "any"; + default?: Pipedream.ConfiguredPropValueAny | undefined; + options?: Pipedream.ConfigurablePropAnyOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropAnyOptionsItem.ts b/src/api/types/ConfigurablePropAnyOptionsItem.ts new file mode 100644 index 0000000..69654a4 --- /dev/null +++ b/src/api/types/ConfigurablePropAnyOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropAnyOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropBoolean.ts b/src/api/types/ConfigurablePropBoolean.ts index 2f87222..e5e85e4 100644 --- a/src/api/types/ConfigurablePropBoolean.ts +++ b/src/api/types/ConfigurablePropBoolean.ts @@ -2,10 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropBoolean { type: "boolean"; - /** The default value for this prop */ - default?: boolean; + default?: Pipedream.ConfiguredPropValueBoolean; + options?: Pipedream.ConfigurablePropBooleanOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropBooleanOptionsItem.ts b/src/api/types/ConfigurablePropBooleanOptionsItem.ts new file mode 100644 index 0000000..e723f4d --- /dev/null +++ b/src/api/types/ConfigurablePropBooleanOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropBooleanOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropInteger.ts b/src/api/types/ConfigurablePropInteger.ts index e64e2d0..b3299f3 100644 --- a/src/api/types/ConfigurablePropInteger.ts +++ b/src/api/types/ConfigurablePropInteger.ts @@ -2,16 +2,17 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropInteger { type: "integer"; /** The minimum value for this integer prop. */ min?: number; /** The maximum value for this integer prop. */ max?: number; - /** Default integer value */ - default?: number; + default?: Pipedream.ConfiguredPropValueInteger; /** Available integer options */ - options?: number[]; + options?: Pipedream.ConfigurablePropIntegerOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropIntegerArray.ts b/src/api/types/ConfigurablePropIntegerArray.ts index ebcfde1..3244cde 100644 --- a/src/api/types/ConfigurablePropIntegerArray.ts +++ b/src/api/types/ConfigurablePropIntegerArray.ts @@ -2,6 +2,8 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropIntegerArray { type: "integer[]"; /** The minimum value for integers in this array */ @@ -9,9 +11,9 @@ export interface ConfigurablePropIntegerArray { /** The maximum value for integers in this array */ max?: number; /** Default array of integers */ - default?: number[]; + default?: Pipedream.ConfiguredPropValueInteger[]; /** Available options for the integer array */ - options?: number[]; + options?: Pipedream.ConfigurablePropIntegerArrayOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropIntegerArrayOptionsItem.ts b/src/api/types/ConfigurablePropIntegerArrayOptionsItem.ts new file mode 100644 index 0000000..6850ac0 --- /dev/null +++ b/src/api/types/ConfigurablePropIntegerArrayOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropIntegerArrayOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropIntegerOptionsItem.ts b/src/api/types/ConfigurablePropIntegerOptionsItem.ts new file mode 100644 index 0000000..bfc1264 --- /dev/null +++ b/src/api/types/ConfigurablePropIntegerOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropIntegerOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropObject.ts b/src/api/types/ConfigurablePropObject.ts index 84a0dea..5556ee3 100644 --- a/src/api/types/ConfigurablePropObject.ts +++ b/src/api/types/ConfigurablePropObject.ts @@ -2,8 +2,12 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropObject { type: "object"; + default?: Pipedream.ConfiguredPropValueObject; + options?: Pipedream.ConfigurablePropObjectOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropObjectOptionsItem.ts b/src/api/types/ConfigurablePropObjectOptionsItem.ts new file mode 100644 index 0000000..c72db71 --- /dev/null +++ b/src/api/types/ConfigurablePropObjectOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropObjectOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropSql.ts b/src/api/types/ConfigurablePropSql.ts index f917401..63a1219 100644 --- a/src/api/types/ConfigurablePropSql.ts +++ b/src/api/types/ConfigurablePropSql.ts @@ -7,8 +7,8 @@ import * as Pipedream from "../index.js"; export interface ConfigurablePropSql { type: "sql"; auth?: Pipedream.ConfigurablePropSqlAuth; - /** Default SQL query */ - default?: string; + default?: Pipedream.ConfiguredPropValueSql; + options?: Pipedream.ConfigurablePropSqlOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropSqlOptionsItem.ts b/src/api/types/ConfigurablePropSqlOptionsItem.ts new file mode 100644 index 0000000..81052ce --- /dev/null +++ b/src/api/types/ConfigurablePropSqlOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropSqlOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropString.ts b/src/api/types/ConfigurablePropString.ts index 80eef13..a99c62a 100644 --- a/src/api/types/ConfigurablePropString.ts +++ b/src/api/types/ConfigurablePropString.ts @@ -2,12 +2,14 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropString { type: "string"; - /** The default value for this prop */ - default?: string; /** If true, this prop is a secret and should not be displayed in plain text. */ secret?: boolean; + default?: Pipedream.ConfiguredPropValueString; + options?: Pipedream.ConfigurablePropStringOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropStringArray.ts b/src/api/types/ConfigurablePropStringArray.ts index 7682e1d..c340675 100644 --- a/src/api/types/ConfigurablePropStringArray.ts +++ b/src/api/types/ConfigurablePropStringArray.ts @@ -2,12 +2,15 @@ * This file was auto-generated by Fern from our API Definition. */ +import * as Pipedream from "../index.js"; + export interface ConfigurablePropStringArray { type: "string[]"; - /** The default value for this prop */ - default?: string[]; /** If true, this prop is a secret and should not be displayed in plain text. */ secret?: boolean; + /** The default value for this prop */ + default?: Pipedream.ConfiguredPropValueString[]; + options?: Pipedream.ConfigurablePropStringArrayOptionsItem[]; /** When building `configuredProps`, make sure to use this field as the key when setting the prop value */ name: string; /** Value to use as an input label. In cases where `type` is "app", should load the app via `getApp`, etc. and show `app.name` instead. */ diff --git a/src/api/types/ConfigurablePropStringArrayOptionsItem.ts b/src/api/types/ConfigurablePropStringArrayOptionsItem.ts new file mode 100644 index 0000000..5c95180 --- /dev/null +++ b/src/api/types/ConfigurablePropStringArrayOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropStringArrayOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ConfigurablePropStringOptionsItem.ts b/src/api/types/ConfigurablePropStringOptionsItem.ts new file mode 100644 index 0000000..a00fa72 --- /dev/null +++ b/src/api/types/ConfigurablePropStringOptionsItem.ts @@ -0,0 +1,11 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as Pipedream from "../index.js"; + +export type ConfigurablePropStringOptionsItem = + | Pipedream.PropOption + | Pipedream.PropOptionNested + | Pipedream.PropOptionValue + | undefined; diff --git a/src/api/types/ToolAnnotations.ts b/src/api/types/ToolAnnotations.ts new file mode 100644 index 0000000..33b82e8 --- /dev/null +++ b/src/api/types/ToolAnnotations.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +/** + * Optional properties describing component behavior + */ +export interface ToolAnnotations { + /** If true, the component may perform destructive updates to its environment. If false, the component performs only additive updates. */ + destructiveHint?: boolean; + /** If true, calling the component repeatedly with the same arguments will have no additional effect on the its environment. */ + idempotentHint?: boolean; + /** If true, this component may interact with an “open world” of external entities. If false, the component's domain of interaction is closed. For example, the world of a web search component is open, whereas that of a memory component is not. */ + openWorldHint?: boolean; + /** If true, the component does not modify its environment. */ + readOnlyHint?: boolean; + /** A human-readable title for the component. */ + title?: string; +} diff --git a/src/api/types/index.ts b/src/api/types/index.ts index 2740dab..5bd33b5 100644 --- a/src/api/types/index.ts +++ b/src/api/types/index.ts @@ -16,21 +16,29 @@ export * from "./ConfigurablePropAirtableViewId.js"; export * from "./ConfigurablePropAlert.js"; export * from "./ConfigurablePropAlertType.js"; export * from "./ConfigurablePropAny.js"; +export * from "./ConfigurablePropAnyOptionsItem.js"; export * from "./ConfigurablePropApp.js"; export * from "./ConfigurablePropApphook.js"; export * from "./ConfigurablePropBoolean.js"; +export * from "./ConfigurablePropBooleanOptionsItem.js"; export * from "./ConfigurablePropDb.js"; export * from "./ConfigurablePropDiscord.js"; export * from "./ConfigurablePropDiscordChannel.js"; export * from "./ConfigurablePropDiscordChannelArray.js"; export * from "./ConfigurablePropHttp.js"; export * from "./ConfigurablePropInteger.js"; +export * from "./ConfigurablePropIntegerOptionsItem.js"; export * from "./ConfigurablePropIntegerArray.js"; +export * from "./ConfigurablePropIntegerArrayOptionsItem.js"; export * from "./ConfigurablePropObject.js"; +export * from "./ConfigurablePropObjectOptionsItem.js"; export * from "./ConfigurablePropSql.js"; export * from "./ConfigurablePropSqlAuth.js"; +export * from "./ConfigurablePropSqlOptionsItem.js"; export * from "./ConfigurablePropString.js"; +export * from "./ConfigurablePropStringOptionsItem.js"; export * from "./ConfigurablePropStringArray.js"; +export * from "./ConfigurablePropStringArrayOptionsItem.js"; export * from "./ConfigurablePropTimer.js"; export * from "./ConfigurablePropTimerDefault.js"; export * from "./ConfigurablePropTimerOption.js"; @@ -95,5 +103,6 @@ export * from "./StashId.js"; export * from "./TimerCron.js"; export * from "./TimerInterface.js"; export * from "./TimerInterval.js"; +export * from "./ToolAnnotations.js"; export * from "./TooManyRequestsErrorBody.js"; export * from "./ValidateTokenResponse.js"; diff --git a/src/core/fetcher/requestWithRetries.ts b/src/core/fetcher/requestWithRetries.ts index 6728d33..560432e 100644 --- a/src/core/fetcher/requestWithRetries.ts +++ b/src/core/fetcher/requestWithRetries.ts @@ -3,20 +3,25 @@ const MAX_RETRY_DELAY = 60000; // in milliseconds const DEFAULT_MAX_RETRIES = 2; const JITTER_FACTOR = 0.2; // 20% random jitter -function addJitter(delay: number): number { - // Generate a random value between -JITTER_FACTOR and +JITTER_FACTOR - const jitterMultiplier = 1 + (Math.random() * 2 - 1) * JITTER_FACTOR; +function addPositiveJitter(delay: number): number { + // Generate a random value between 0 and +JITTER_FACTOR + const jitterMultiplier = 1 + Math.random() * JITTER_FACTOR; + return delay * jitterMultiplier; +} + +function addSymmetricJitter(delay: number): number { + // Generate a random value in a JITTER_FACTOR-sized percentage range around delay + const jitterMultiplier = 1 + (Math.random() - 0.5) * JITTER_FACTOR; return delay * jitterMultiplier; } function getRetryDelayFromHeaders(response: Response, retryAttempt: number): number { - // Check for Retry-After header first (RFC 7231) + // Check for Retry-After header first (RFC 7231), with no jitter const retryAfter = response.headers.get("Retry-After"); if (retryAfter) { // Parse as number of seconds... const retryAfterSeconds = parseInt(retryAfter, 10); - if (!isNaN(retryAfterSeconds)) { - // Convert seconds to milliseconds and cap at MAX_RETRY_DELAY + if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) { return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY); } @@ -24,11 +29,13 @@ function getRetryDelayFromHeaders(response: Response, retryAttempt: number): num const retryAfterDate = new Date(retryAfter); if (!isNaN(retryAfterDate.getTime())) { const delay = retryAfterDate.getTime() - Date.now(); - return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + if (delay > 0) { + return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY); + } } } - // Then check for industry-standard X-RateLimit-Reset header + // Then check for industry-standard X-RateLimit-Reset header, with positive jitter const rateLimitReset = response.headers.get("X-RateLimit-Reset"); if (rateLimitReset) { const resetTime = parseInt(rateLimitReset, 10); @@ -36,13 +43,13 @@ function getRetryDelayFromHeaders(response: Response, retryAttempt: number): num // Assume Unix timestamp in epoch seconds const delay = resetTime * 1000 - Date.now(); if (delay > 0) { - return Math.min(delay, MAX_RETRY_DELAY); + return addPositiveJitter(Math.min(delay, MAX_RETRY_DELAY)); } } } - // Fall back to exponential backoff - return Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY); + // Fall back to exponential backoff, with symmetric jitter + return addSymmetricJitter(Math.min(INITIAL_RETRY_DELAY * Math.pow(2, retryAttempt), MAX_RETRY_DELAY)); } export async function requestWithRetries( @@ -53,13 +60,10 @@ export async function requestWithRetries( for (let i = 0; i < maxRetries; ++i) { if ([408, 429].includes(response.status) || response.status >= 500) { - // Get delay from headers or fall back to exponential backoff - const baseDelay = getRetryDelayFromHeaders(response, i); - - // Add jitter to the delay - const delayWithJitter = addJitter(baseDelay); + // Get delay with appropriate jitter applied + const delay = getRetryDelayFromHeaders(response, i); - await new Promise((resolve) => setTimeout(resolve, delayWithJitter)); + await new Promise((resolve) => setTimeout(resolve, delay)); response = await requestFn(); } else { break; diff --git a/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts b/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts index 7b57e2f..9bede19 100644 --- a/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts +++ b/src/serialization/resources/accounts/client/requests/CreateAccountOpts.ts @@ -8,7 +8,7 @@ import * as core from "../../../../../core/index.js"; export const CreateAccountOpts: core.serialization.Schema< serializers.CreateAccountOpts.Raw, - Omit + Omit > = core.serialization.object({ appSlug: core.serialization.property("app_slug", core.serialization.string()), cfmapJson: core.serialization.property("cfmap_json", core.serialization.string()), diff --git a/src/serialization/types/Component.ts b/src/serialization/types/Component.ts index 2d287e2..30c8b00 100644 --- a/src/serialization/types/Component.ts +++ b/src/serialization/types/Component.ts @@ -7,6 +7,7 @@ import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; import { ConfigurableProp } from "./ConfigurableProp.js"; import { ComponentStash } from "./ComponentStash.js"; +import { ToolAnnotations } from "./ToolAnnotations.js"; export const Component: core.serialization.ObjectSchema = core.serialization.object({ @@ -17,6 +18,7 @@ export const Component: core.serialization.ObjectSchema = core.serialization.object({ type: core.serialization.stringLiteral("any"), + default: ConfiguredPropValueAny.optional(), + options: core.serialization.list(ConfigurablePropAnyOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -26,6 +30,8 @@ export const ConfigurablePropAny: core.serialization.ObjectSchema< export declare namespace ConfigurablePropAny { export interface Raw { type: "any"; + default?: (ConfiguredPropValueAny.Raw | undefined) | null; + options?: ConfigurablePropAnyOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropAnyOptionsItem.ts b/src/serialization/types/ConfigurablePropAnyOptionsItem.ts new file mode 100644 index 0000000..3158fd5 --- /dev/null +++ b/src/serialization/types/ConfigurablePropAnyOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropAnyOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropAnyOptionsItem.Raw, + Pipedream.ConfigurablePropAnyOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropAnyOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropBoolean.ts b/src/serialization/types/ConfigurablePropBoolean.ts index 31c78ae..1f94ace 100644 --- a/src/serialization/types/ConfigurablePropBoolean.ts +++ b/src/serialization/types/ConfigurablePropBoolean.ts @@ -5,13 +5,16 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; +import { ConfiguredPropValueBoolean } from "./ConfiguredPropValueBoolean.js"; +import { ConfigurablePropBooleanOptionsItem } from "./ConfigurablePropBooleanOptionsItem.js"; export const ConfigurablePropBoolean: core.serialization.ObjectSchema< serializers.ConfigurablePropBoolean.Raw, Pipedream.ConfigurablePropBoolean > = core.serialization.object({ type: core.serialization.stringLiteral("boolean"), - default: core.serialization.boolean().optional(), + default: ConfiguredPropValueBoolean.optional(), + options: core.serialization.list(ConfigurablePropBooleanOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -27,7 +30,8 @@ export const ConfigurablePropBoolean: core.serialization.ObjectSchema< export declare namespace ConfigurablePropBoolean { export interface Raw { type: "boolean"; - default?: boolean | null; + default?: ConfiguredPropValueBoolean.Raw | null; + options?: ConfigurablePropBooleanOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropBooleanOptionsItem.ts b/src/serialization/types/ConfigurablePropBooleanOptionsItem.ts new file mode 100644 index 0000000..8b7418f --- /dev/null +++ b/src/serialization/types/ConfigurablePropBooleanOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropBooleanOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropBooleanOptionsItem.Raw, + Pipedream.ConfigurablePropBooleanOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropBooleanOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropInteger.ts b/src/serialization/types/ConfigurablePropInteger.ts index f43e2b5..a6bb184 100644 --- a/src/serialization/types/ConfigurablePropInteger.ts +++ b/src/serialization/types/ConfigurablePropInteger.ts @@ -5,6 +5,8 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; +import { ConfiguredPropValueInteger } from "./ConfiguredPropValueInteger.js"; +import { ConfigurablePropIntegerOptionsItem } from "./ConfigurablePropIntegerOptionsItem.js"; export const ConfigurablePropInteger: core.serialization.ObjectSchema< serializers.ConfigurablePropInteger.Raw, @@ -13,8 +15,8 @@ export const ConfigurablePropInteger: core.serialization.ObjectSchema< type: core.serialization.stringLiteral("integer"), min: core.serialization.number().optional(), max: core.serialization.number().optional(), - default: core.serialization.number().optional(), - options: core.serialization.list(core.serialization.number()).optional(), + default: ConfiguredPropValueInteger.optional(), + options: core.serialization.list(ConfigurablePropIntegerOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -32,8 +34,8 @@ export declare namespace ConfigurablePropInteger { type: "integer"; min?: number | null; max?: number | null; - default?: number | null; - options?: number[] | null; + default?: ConfiguredPropValueInteger.Raw | null; + options?: ConfigurablePropIntegerOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropIntegerArray.ts b/src/serialization/types/ConfigurablePropIntegerArray.ts index 148b0d2..bc717cb 100644 --- a/src/serialization/types/ConfigurablePropIntegerArray.ts +++ b/src/serialization/types/ConfigurablePropIntegerArray.ts @@ -5,6 +5,8 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; +import { ConfiguredPropValueInteger } from "./ConfiguredPropValueInteger.js"; +import { ConfigurablePropIntegerArrayOptionsItem } from "./ConfigurablePropIntegerArrayOptionsItem.js"; export const ConfigurablePropIntegerArray: core.serialization.ObjectSchema< serializers.ConfigurablePropIntegerArray.Raw, @@ -13,8 +15,8 @@ export const ConfigurablePropIntegerArray: core.serialization.ObjectSchema< type: core.serialization.stringLiteral("integer[]"), min: core.serialization.number().optional(), max: core.serialization.number().optional(), - default: core.serialization.list(core.serialization.number()).optional(), - options: core.serialization.list(core.serialization.number()).optional(), + default: core.serialization.list(ConfiguredPropValueInteger).optional(), + options: core.serialization.list(ConfigurablePropIntegerArrayOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -32,8 +34,8 @@ export declare namespace ConfigurablePropIntegerArray { type: "integer[]"; min?: number | null; max?: number | null; - default?: number[] | null; - options?: number[] | null; + default?: ConfiguredPropValueInteger.Raw[] | null; + options?: ConfigurablePropIntegerArrayOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropIntegerArrayOptionsItem.ts b/src/serialization/types/ConfigurablePropIntegerArrayOptionsItem.ts new file mode 100644 index 0000000..76b7916 --- /dev/null +++ b/src/serialization/types/ConfigurablePropIntegerArrayOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropIntegerArrayOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropIntegerArrayOptionsItem.Raw, + Pipedream.ConfigurablePropIntegerArrayOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropIntegerArrayOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropIntegerOptionsItem.ts b/src/serialization/types/ConfigurablePropIntegerOptionsItem.ts new file mode 100644 index 0000000..abd80e2 --- /dev/null +++ b/src/serialization/types/ConfigurablePropIntegerOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropIntegerOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropIntegerOptionsItem.Raw, + Pipedream.ConfigurablePropIntegerOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropIntegerOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropObject.ts b/src/serialization/types/ConfigurablePropObject.ts index 6abd5d7..e2ed6b0 100644 --- a/src/serialization/types/ConfigurablePropObject.ts +++ b/src/serialization/types/ConfigurablePropObject.ts @@ -5,12 +5,16 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; +import { ConfiguredPropValueObject } from "./ConfiguredPropValueObject.js"; +import { ConfigurablePropObjectOptionsItem } from "./ConfigurablePropObjectOptionsItem.js"; export const ConfigurablePropObject: core.serialization.ObjectSchema< serializers.ConfigurablePropObject.Raw, Pipedream.ConfigurablePropObject > = core.serialization.object({ type: core.serialization.stringLiteral("object"), + default: ConfiguredPropValueObject.optional(), + options: core.serialization.list(ConfigurablePropObjectOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -26,6 +30,8 @@ export const ConfigurablePropObject: core.serialization.ObjectSchema< export declare namespace ConfigurablePropObject { export interface Raw { type: "object"; + default?: ConfiguredPropValueObject.Raw | null; + options?: ConfigurablePropObjectOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropObjectOptionsItem.ts b/src/serialization/types/ConfigurablePropObjectOptionsItem.ts new file mode 100644 index 0000000..ac0febe --- /dev/null +++ b/src/serialization/types/ConfigurablePropObjectOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropObjectOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropObjectOptionsItem.Raw, + Pipedream.ConfigurablePropObjectOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropObjectOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropSql.ts b/src/serialization/types/ConfigurablePropSql.ts index 4360aa0..1081eb0 100644 --- a/src/serialization/types/ConfigurablePropSql.ts +++ b/src/serialization/types/ConfigurablePropSql.ts @@ -6,6 +6,8 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; import { ConfigurablePropSqlAuth } from "./ConfigurablePropSqlAuth.js"; +import { ConfiguredPropValueSql } from "./ConfiguredPropValueSql.js"; +import { ConfigurablePropSqlOptionsItem } from "./ConfigurablePropSqlOptionsItem.js"; export const ConfigurablePropSql: core.serialization.ObjectSchema< serializers.ConfigurablePropSql.Raw, @@ -13,7 +15,8 @@ export const ConfigurablePropSql: core.serialization.ObjectSchema< > = core.serialization.object({ type: core.serialization.stringLiteral("sql"), auth: ConfigurablePropSqlAuth.optional(), - default: core.serialization.string().optional(), + default: ConfiguredPropValueSql.optional(), + options: core.serialization.list(ConfigurablePropSqlOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -30,7 +33,8 @@ export declare namespace ConfigurablePropSql { export interface Raw { type: "sql"; auth?: ConfigurablePropSqlAuth.Raw | null; - default?: string | null; + default?: ConfiguredPropValueSql.Raw | null; + options?: ConfigurablePropSqlOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropSqlOptionsItem.ts b/src/serialization/types/ConfigurablePropSqlOptionsItem.ts new file mode 100644 index 0000000..7ecfe68 --- /dev/null +++ b/src/serialization/types/ConfigurablePropSqlOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropSqlOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropSqlOptionsItem.Raw, + Pipedream.ConfigurablePropSqlOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropSqlOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropString.ts b/src/serialization/types/ConfigurablePropString.ts index 17e48f7..e3a5bbb 100644 --- a/src/serialization/types/ConfigurablePropString.ts +++ b/src/serialization/types/ConfigurablePropString.ts @@ -5,14 +5,17 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; +import { ConfiguredPropValueString } from "./ConfiguredPropValueString.js"; +import { ConfigurablePropStringOptionsItem } from "./ConfigurablePropStringOptionsItem.js"; export const ConfigurablePropString: core.serialization.ObjectSchema< serializers.ConfigurablePropString.Raw, Pipedream.ConfigurablePropString > = core.serialization.object({ type: core.serialization.stringLiteral("string"), - default: core.serialization.string().optional(), secret: core.serialization.boolean().optional(), + default: ConfiguredPropValueString.optional(), + options: core.serialization.list(ConfigurablePropStringOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -28,8 +31,9 @@ export const ConfigurablePropString: core.serialization.ObjectSchema< export declare namespace ConfigurablePropString { export interface Raw { type: "string"; - default?: string | null; secret?: boolean | null; + default?: ConfiguredPropValueString.Raw | null; + options?: ConfigurablePropStringOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropStringArray.ts b/src/serialization/types/ConfigurablePropStringArray.ts index 110d9f5..16d71ba 100644 --- a/src/serialization/types/ConfigurablePropStringArray.ts +++ b/src/serialization/types/ConfigurablePropStringArray.ts @@ -5,14 +5,17 @@ import * as serializers from "../index.js"; import * as Pipedream from "../../api/index.js"; import * as core from "../../core/index.js"; +import { ConfiguredPropValueString } from "./ConfiguredPropValueString.js"; +import { ConfigurablePropStringArrayOptionsItem } from "./ConfigurablePropStringArrayOptionsItem.js"; export const ConfigurablePropStringArray: core.serialization.ObjectSchema< serializers.ConfigurablePropStringArray.Raw, Pipedream.ConfigurablePropStringArray > = core.serialization.object({ type: core.serialization.stringLiteral("string[]"), - default: core.serialization.list(core.serialization.string()).optional(), secret: core.serialization.boolean().optional(), + default: core.serialization.list(ConfiguredPropValueString).optional(), + options: core.serialization.list(ConfigurablePropStringArrayOptionsItem).optional(), name: core.serialization.string(), label: core.serialization.string().optional(), description: core.serialization.string().optional(), @@ -28,8 +31,9 @@ export const ConfigurablePropStringArray: core.serialization.ObjectSchema< export declare namespace ConfigurablePropStringArray { export interface Raw { type: "string[]"; - default?: string[] | null; secret?: boolean | null; + default?: ConfiguredPropValueString.Raw[] | null; + options?: ConfigurablePropStringArrayOptionsItem.Raw[] | null; name: string; label?: string | null; description?: string | null; diff --git a/src/serialization/types/ConfigurablePropStringArrayOptionsItem.ts b/src/serialization/types/ConfigurablePropStringArrayOptionsItem.ts new file mode 100644 index 0000000..dc9926d --- /dev/null +++ b/src/serialization/types/ConfigurablePropStringArrayOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropStringArrayOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropStringArrayOptionsItem.Raw, + Pipedream.ConfigurablePropStringArrayOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropStringArrayOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ConfigurablePropStringOptionsItem.ts b/src/serialization/types/ConfigurablePropStringOptionsItem.ts new file mode 100644 index 0000000..782b8a9 --- /dev/null +++ b/src/serialization/types/ConfigurablePropStringOptionsItem.ts @@ -0,0 +1,19 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; +import { PropOption } from "./PropOption.js"; +import { PropOptionNested } from "./PropOptionNested.js"; +import { PropOptionValue } from "./PropOptionValue.js"; + +export const ConfigurablePropStringOptionsItem: core.serialization.Schema< + serializers.ConfigurablePropStringOptionsItem.Raw, + Pipedream.ConfigurablePropStringOptionsItem +> = core.serialization.undiscriminatedUnion([PropOption, PropOptionNested, PropOptionValue.optional()]); + +export declare namespace ConfigurablePropStringOptionsItem { + export type Raw = PropOption.Raw | PropOptionNested.Raw | (PropOptionValue.Raw | null | undefined); +} diff --git a/src/serialization/types/ToolAnnotations.ts b/src/serialization/types/ToolAnnotations.ts new file mode 100644 index 0000000..2621a46 --- /dev/null +++ b/src/serialization/types/ToolAnnotations.ts @@ -0,0 +1,28 @@ +/** + * This file was auto-generated by Fern from our API Definition. + */ + +import * as serializers from "../index.js"; +import * as Pipedream from "../../api/index.js"; +import * as core from "../../core/index.js"; + +export const ToolAnnotations: core.serialization.ObjectSchema< + serializers.ToolAnnotations.Raw, + Pipedream.ToolAnnotations +> = core.serialization.object({ + destructiveHint: core.serialization.boolean().optional(), + idempotentHint: core.serialization.boolean().optional(), + openWorldHint: core.serialization.boolean().optional(), + readOnlyHint: core.serialization.boolean().optional(), + title: core.serialization.string().optional(), +}); + +export declare namespace ToolAnnotations { + export interface Raw { + destructiveHint?: boolean | null; + idempotentHint?: boolean | null; + openWorldHint?: boolean | null; + readOnlyHint?: boolean | null; + title?: string | null; + } +} diff --git a/src/serialization/types/index.ts b/src/serialization/types/index.ts index 5d6fe59..3483f3c 100644 --- a/src/serialization/types/index.ts +++ b/src/serialization/types/index.ts @@ -7,6 +7,7 @@ export * from "./AppCategory.js"; export * from "./BackendClientOpts.js"; export * from "./ClientOpts.js"; export * from "./Component.js"; +export * from "./ToolAnnotations.js"; export * from "./ComponentStash.js"; export * from "./ComponentType.js"; export * from "./TimerInterval.js"; @@ -15,17 +16,21 @@ export * from "./ConfigurablePropType.js"; export * from "./ConfigurableProp.js"; export * from "./ConfigurablePropAlert.js"; export * from "./ConfigurablePropAlertType.js"; +export * from "./ConfigurablePropAnyOptionsItem.js"; export * from "./ConfigurablePropAny.js"; export * from "./ConfigurablePropApp.js"; +export * from "./ConfigurablePropBooleanOptionsItem.js"; export * from "./ConfigurablePropBoolean.js"; export * from "./ConfigurablePropTimer.js"; export * from "./ConfigurablePropTimerDefault.js"; export * from "./ConfigurablePropTimerOption.js"; export * from "./ConfigurablePropTimerStatic.js"; export * from "./ConfigurablePropApphook.js"; +export * from "./ConfigurablePropIntegerArrayOptionsItem.js"; export * from "./ConfigurablePropIntegerArray.js"; export * from "./ConfigurablePropHttp.js"; export * from "./ConfigurablePropDb.js"; +export * from "./ConfigurablePropSqlOptionsItem.js"; export * from "./ConfigurablePropSql.js"; export * from "./ConfigurablePropSqlAuth.js"; export * from "./ConfigurablePropAirtableBaseId.js"; @@ -35,9 +40,13 @@ export * from "./ConfigurablePropAirtableFieldId.js"; export * from "./ConfigurablePropDiscordChannel.js"; export * from "./ConfigurablePropDiscordChannelArray.js"; export * from "./ConfigurablePropDiscord.js"; +export * from "./ConfigurablePropIntegerOptionsItem.js"; export * from "./ConfigurablePropInteger.js"; +export * from "./ConfigurablePropObjectOptionsItem.js"; export * from "./ConfigurablePropObject.js"; +export * from "./ConfigurablePropStringOptionsItem.js"; export * from "./ConfigurablePropString.js"; +export * from "./ConfigurablePropStringArrayOptionsItem.js"; export * from "./ConfigurablePropStringArray.js"; export * from "./ConfiguredPropValueAny.js"; export * from "./ConfiguredPropValueApp.js"; @@ -58,8 +67,8 @@ export * from "./CreateOAuthTokenResponse.js"; export * from "./CreateTokenResponse.js"; export * from "./DeleteTriggerOpts.js"; export * from "./DeployedComponent.js"; -export * from "./DeployTriggerResponse.js"; export * from "./DeployTriggerResponseData.js"; +export * from "./DeployTriggerResponse.js"; export * from "./DynamicProps.js"; export * from "./EmittedEvent.js"; export * from "./ErrorResponse.js"; diff --git a/src/version.ts b/src/version.ts index e1e0bf8..97a5322 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const SDK_VERSION = "2.0.10"; +export const SDK_VERSION = "2.0.11"; diff --git a/tests/unit/fetcher/requestWithRetries.test.ts b/tests/unit/fetcher/requestWithRetries.test.ts index 779f4fb..6f9426f 100644 --- a/tests/unit/fetcher/requestWithRetries.test.ts +++ b/tests/unit/fetcher/requestWithRetries.test.ts @@ -201,11 +201,11 @@ describe("requestWithRetries", () => { await jest.runAllTimersAsync(); const response = await responsePromise; - // Should use the x-ratelimit-reset delay (approximately 4000ms, but with jitter) + // Should use the x-ratelimit-reset delay (approximately 4000ms, but with positive jitter) expect(setTimeoutSpy).toHaveBeenCalledWith(expect.any(Function), expect.any(Number)); const actualDelay = setTimeoutSpy.mock.calls[0][1]; expect(actualDelay).toBeGreaterThan(3000); - expect(actualDelay).toBeLessThan(5000); + expect(actualDelay).toBeLessThan(6000); expect(response.status).toBe(200); }); diff --git a/yarn.lock b/yarn.lock index d8f31ac..af10758 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1348,9 +1348,9 @@ dunder-proto@^1.0.1: gopd "^1.2.0" electron-to-chromium@^1.5.218: - version "1.5.222" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.222.tgz#965c93783ad989116b74593ae3068b9466fdb237" - integrity sha512-gA7psSwSwQRE60CEoLz6JBCQPIxNeuzB2nL8vE03GK/OHxlvykbLyeiumQy1iH5C2f3YbRAZpGCMT12a/9ih9w== + version "1.5.221" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.221.tgz#bd98014b2a247701c4ebd713080448d539545d79" + integrity sha512-/1hFJ39wkW01ogqSyYoA4goOXOtMRy6B+yvA1u42nnsEGtHzIzmk93aPISumVQeblj47JUHLC9coCjUxb1EvtQ== emittery@^0.13.1: version "0.13.1"