diff --git a/package.json b/package.json index 27f77a3..dba9cf0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@hookdeck/sdk", - "version": "0.3.0-beta.2", + "version": "0.3.0-beta.3", "private": false, "repository": "https://github.com/hookdeck/hookdeck-typescript-sdk", "main": "./index.js", @@ -14,6 +14,7 @@ "dependencies": { "url-join": "4.0.1", "form-data": "4.0.0", + "formdata-node": "^6.0.3", "node-fetch": "2.7.0", "qs": "6.11.2", "js-base64": "3.7.2" diff --git a/src/Client.ts b/src/Client.ts index 1cffbb9..faa92e8 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -30,6 +30,7 @@ export declare namespace HookdeckClient { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } diff --git a/src/api/resources/attempt/client/Client.ts b/src/api/resources/attempt/client/Client.ts index a724bfe..a4c5930 100644 --- a/src/api/resources/attempt/client/Client.ts +++ b/src/api/resources/attempt/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Attempt { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,22 +27,16 @@ export class Attempt { constructor(protected readonly _options: Attempt.Options) {} /** + * + * + * @param {Hookdeck.AttemptListRequest} request + * @param {Attempt.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.attempt.list() - * - * @example - * await hookdeck.attempt.list({ - * eventId: "string", - * orderBy: Hookdeck.AttemptListRequestOrderBy.CreatedAt, - * dir: Hookdeck.AttemptListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.AttemptListRequest = {}, @@ -87,7 +82,7 @@ export class Attempt { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -95,6 +90,7 @@ export class Attempt { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.EventAttemptPaginatedResult.parseOrThrow(_response.body, { @@ -152,14 +148,15 @@ export class Attempt { } /** + * + * + * @param {string} id + * @param {Attempt.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.attempt.retrieve("id") - * - * @example - * await hookdeck.attempt.retrieve("string") */ public async retrieve( id: string, @@ -168,20 +165,21 @@ export class Attempt { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `attempts/${id}` + `attempts/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.attempt.retrieve.Response.parseOrThrow(_response.body, { diff --git a/src/api/resources/attempt/client/requests/AttemptListRequest.ts b/src/api/resources/attempt/client/requests/AttemptListRequest.ts index 56c7ab7..46f7d68 100644 --- a/src/api/resources/attempt/client/requests/AttemptListRequest.ts +++ b/src/api/resources/attempt/client/requests/AttemptListRequest.ts @@ -7,36 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * eventId: "string", - * orderBy: Hookdeck.AttemptListRequestOrderBy.CreatedAt, - * dir: Hookdeck.AttemptListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * eventId: "string", - * orderBy: Hookdeck.AttemptListRequestOrderBy.CreatedAt, - * dir: Hookdeck.AttemptListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * eventId: "string", - * orderBy: Hookdeck.AttemptListRequestOrderBy.CreatedAt, - * dir: Hookdeck.AttemptListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface AttemptListRequest { eventId?: string | string[]; diff --git a/src/api/resources/attempt/client/requests/index.ts b/src/api/resources/attempt/client/requests/index.ts index 6682683..047febd 100644 --- a/src/api/resources/attempt/client/requests/index.ts +++ b/src/api/resources/attempt/client/requests/index.ts @@ -1 +1 @@ -export { AttemptListRequest } from "./AttemptListRequest"; +export { type AttemptListRequest } from "./AttemptListRequest"; diff --git a/src/api/resources/bookmark/client/Client.ts b/src/api/resources/bookmark/client/Client.ts index 2112bae..a8b4cf1 100644 --- a/src/api/resources/bookmark/client/Client.ts +++ b/src/api/resources/bookmark/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Bookmark { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,27 +27,16 @@ export class Bookmark { constructor(protected readonly _options: Bookmark.Options) {} /** + * + * + * @param {Hookdeck.BookmarkListRequest} request + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.bookmark.list() - * - * @example - * await hookdeck.bookmark.list({ - * id: "string", - * name: "string", - * webhookId: "string", - * eventDataId: "string", - * label: "string", - * lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.BookmarkListRequestOrderBy.CreatedAt, - * dir: Hookdeck.BookmarkListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.BookmarkListRequest = {}, @@ -128,7 +118,7 @@ export class Bookmark { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -136,6 +126,7 @@ export class Bookmark { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BookmarkPaginatedResult.parseOrThrow(_response.body, { @@ -193,6 +184,10 @@ export class Bookmark { } /** + * + * + * @param {Hookdeck.BookmarkCreateRequest} request + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -218,7 +213,7 @@ export class Bookmark { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -226,6 +221,7 @@ export class Bookmark { body: await serializers.BookmarkCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Bookmark.parseOrThrow(_response.body, { @@ -283,33 +279,35 @@ export class Bookmark { } /** + * + * + * @param {string} id + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.bookmark.retrieve("id") - * - * @example - * await hookdeck.bookmark.retrieve("string") */ public async retrieve(id: string, requestOptions?: Bookmark.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bookmarks/${id}` + `bookmarks/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Bookmark.parseOrThrow(_response.body, { @@ -357,6 +355,11 @@ export class Bookmark { } /** + * + * + * @param {string} id + * @param {Hookdeck.BookmarkUpdateRequest} request + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -364,9 +367,6 @@ export class Bookmark { * * @example * await hookdeck.bookmark.update("id") - * - * @example - * await hookdeck.bookmark.update("string") */ public async update( id: string, @@ -376,14 +376,14 @@ export class Bookmark { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bookmarks/${id}` + `bookmarks/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -391,6 +391,7 @@ export class Bookmark { body: await serializers.BookmarkUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Bookmark.parseOrThrow(_response.body, { @@ -458,14 +459,15 @@ export class Bookmark { } /** + * + * + * @param {string} id + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.bookmark.delete("id") - * - * @example - * await hookdeck.bookmark.delete("string") */ public async delete( id: string, @@ -474,20 +476,21 @@ export class Bookmark { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bookmarks/${id}` + `bookmarks/${encodeURIComponent(id)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.DeletedBookmarkResponse.parseOrThrow(_response.body, { @@ -535,33 +538,35 @@ export class Bookmark { } /** + * + * + * @param {string} id + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.bookmark.retrieveBody("id") - * - * @example - * await hookdeck.bookmark.retrieveBody("string") */ public async retrieveBody(id: string, requestOptions?: Bookmark.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bookmarks/${id}/raw_body` + `bookmarks/${encodeURIComponent(id)}/raw_body` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RawBody.parseOrThrow(_response.body, { @@ -609,6 +614,11 @@ export class Bookmark { } /** + * + * + * @param {string} id + * @param {Hookdeck.BookmarkTriggerRequest} request + * @param {Bookmark.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -616,9 +626,6 @@ export class Bookmark { * * @example * await hookdeck.bookmark.trigger("id") - * - * @example - * await hookdeck.bookmark.trigger("string") */ public async trigger( id: string, @@ -628,14 +635,14 @@ export class Bookmark { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bookmarks/${id}/trigger` + `bookmarks/${encodeURIComponent(id)}/trigger` ), method: "POST", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -643,6 +650,7 @@ export class Bookmark { body: await serializers.BookmarkTriggerRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.EventArray.parseOrThrow(_response.body, { diff --git a/src/api/resources/bookmark/client/requests/BookmarkCreateRequest.ts b/src/api/resources/bookmark/client/requests/BookmarkCreateRequest.ts index 5aa353f..39db4aa 100644 --- a/src/api/resources/bookmark/client/requests/BookmarkCreateRequest.ts +++ b/src/api/resources/bookmark/client/requests/BookmarkCreateRequest.ts @@ -3,27 +3,6 @@ */ /** - * @example - * { - * eventDataId: "event_data_id", - * webhookId: "webhook_id", - * label: "label" - * } - * - * @example - * { - * eventDataId: "event_data_id", - * webhookId: "webhook_id", - * label: "label" - * } - * - * @example - * { - * eventDataId: "event_data_id", - * webhookId: "webhook_id", - * label: "label" - * } - * * @example * { * eventDataId: "event_data_id", diff --git a/src/api/resources/bookmark/client/requests/BookmarkListRequest.ts b/src/api/resources/bookmark/client/requests/BookmarkListRequest.ts index deb4e15..fd22739 100644 --- a/src/api/resources/bookmark/client/requests/BookmarkListRequest.ts +++ b/src/api/resources/bookmark/client/requests/BookmarkListRequest.ts @@ -7,51 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * name: "string", - * webhookId: "string", - * eventDataId: "string", - * label: "string", - * lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.BookmarkListRequestOrderBy.CreatedAt, - * dir: Hookdeck.BookmarkListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * webhookId: "string", - * eventDataId: "string", - * label: "string", - * lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.BookmarkListRequestOrderBy.CreatedAt, - * dir: Hookdeck.BookmarkListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * webhookId: "string", - * eventDataId: "string", - * label: "string", - * lastUsedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.BookmarkListRequestOrderBy.CreatedAt, - * dir: Hookdeck.BookmarkListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface BookmarkListRequest { id?: string | string[]; diff --git a/src/api/resources/bookmark/client/requests/BookmarkTriggerRequest.ts b/src/api/resources/bookmark/client/requests/BookmarkTriggerRequest.ts index f527bd6..9bf7b02 100644 --- a/src/api/resources/bookmark/client/requests/BookmarkTriggerRequest.ts +++ b/src/api/resources/bookmark/client/requests/BookmarkTriggerRequest.ts @@ -5,18 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/bookmark/client/requests/BookmarkUpdateRequest.ts b/src/api/resources/bookmark/client/requests/BookmarkUpdateRequest.ts index 35bcb87..d5715ec 100644 --- a/src/api/resources/bookmark/client/requests/BookmarkUpdateRequest.ts +++ b/src/api/resources/bookmark/client/requests/BookmarkUpdateRequest.ts @@ -3,18 +3,6 @@ */ /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/bookmark/client/requests/index.ts b/src/api/resources/bookmark/client/requests/index.ts index ab7ca6b..ce187c1 100644 --- a/src/api/resources/bookmark/client/requests/index.ts +++ b/src/api/resources/bookmark/client/requests/index.ts @@ -1,4 +1,4 @@ -export { BookmarkListRequest } from "./BookmarkListRequest"; -export { BookmarkCreateRequest } from "./BookmarkCreateRequest"; -export { BookmarkUpdateRequest } from "./BookmarkUpdateRequest"; -export { BookmarkTriggerRequest } from "./BookmarkTriggerRequest"; +export { type BookmarkListRequest } from "./BookmarkListRequest"; +export { type BookmarkCreateRequest } from "./BookmarkCreateRequest"; +export { type BookmarkUpdateRequest } from "./BookmarkUpdateRequest"; +export { type BookmarkTriggerRequest } from "./BookmarkTriggerRequest"; diff --git a/src/api/resources/connection/client/Client.ts b/src/api/resources/connection/client/Client.ts index 17eab28..560d6d4 100644 --- a/src/api/resources/connection/client/Client.ts +++ b/src/api/resources/connection/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Connection { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,29 +27,16 @@ export class Connection { constructor(protected readonly _options: Connection.Options) {} /** + * + * + * @param {Hookdeck.ConnectionListRequest} request + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.connection.list() - * - * @example - * await hookdeck.connection.list({ - * id: "string", - * name: "string", - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * fullName: "string", - * pausedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.ConnectionListRequestOrderBy.CreatedAt, - * dir: Hookdeck.ConnectionListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.ConnectionListRequest = {}, @@ -144,7 +132,7 @@ export class Connection { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -152,6 +140,7 @@ export class Connection { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.ConnectionPaginatedResult.parseOrThrow(_response.body, { @@ -209,6 +198,10 @@ export class Connection { } /** + * + * + * @param {Hookdeck.ConnectionCreateRequest} request + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -230,7 +223,7 @@ export class Connection { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -238,6 +231,7 @@ export class Connection { body: await serializers.ConnectionCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -295,6 +289,10 @@ export class Connection { } /** + * + * + * @param {Hookdeck.ConnectionUpsertRequest} request + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -316,7 +314,7 @@ export class Connection { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -324,6 +322,7 @@ export class Connection { body: await serializers.ConnectionUpsertRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -381,21 +380,16 @@ export class Connection { } /** + * + * + * @param {Hookdeck.ConnectionCountRequest} request + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.connection.count() - * - * @example - * await hookdeck.connection.count({ - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * pausedAt: new Date("2024-01-15T09:30:00.000Z") - * }) */ public async count( request: Hookdeck.ConnectionCountRequest = {}, @@ -441,7 +435,7 @@ export class Connection { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -449,6 +443,7 @@ export class Connection { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.ConnectionCountResponse.parseOrThrow(_response.body, { @@ -506,34 +501,36 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * @throws {@link Hookdeck.GoneError} * * @example * await hookdeck.connection.retrieve("id") - * - * @example - * await hookdeck.connection.retrieve("string") */ public async retrieve(id: string, requestOptions?: Connection.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}` + `connections/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -591,6 +588,11 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Hookdeck.ConnectionUpdateRequest} request + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -598,9 +600,6 @@ export class Connection { * * @example * await hookdeck.connection.update("id") - * - * @example - * await hookdeck.connection.update("string") */ public async update( id: string, @@ -610,14 +609,14 @@ export class Connection { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}` + `connections/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -625,6 +624,7 @@ export class Connection { body: await serializers.ConnectionUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -692,14 +692,15 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.connection.delete("id") - * - * @example - * await hookdeck.connection.delete("string") */ public async delete( id: string, @@ -708,20 +709,21 @@ export class Connection { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}` + `connections/${encodeURIComponent(id)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.ConnectionDeleteResponse.parseOrThrow(_response.body, { @@ -769,33 +771,35 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.connection.disable("id") - * - * @example - * await hookdeck.connection.disable("string") */ public async disable(id: string, requestOptions?: Connection.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}/archive` + `connections/${encodeURIComponent(id)}/archive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -843,33 +847,35 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.connection.enable("id") - * - * @example - * await hookdeck.connection.enable("string") */ public async enable(id: string, requestOptions?: Connection.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}/unarchive` + `connections/${encodeURIComponent(id)}/unarchive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -917,33 +923,35 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.connection.pause("id") - * - * @example - * await hookdeck.connection.pause("string") */ public async pause(id: string, requestOptions?: Connection.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}/pause` + `connections/${encodeURIComponent(id)}/pause` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { @@ -991,33 +999,35 @@ export class Connection { } /** + * + * + * @param {string} id + * @param {Connection.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.connection.unpause("id") - * - * @example - * await hookdeck.connection.unpause("string") */ public async unpause(id: string, requestOptions?: Connection.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `connections/${id}/unpause` + `connections/${encodeURIComponent(id)}/unpause` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Connection.parseOrThrow(_response.body, { diff --git a/src/api/resources/connection/client/requests/ConnectionCountRequest.ts b/src/api/resources/connection/client/requests/ConnectionCountRequest.ts index 5490f59..3d832c3 100644 --- a/src/api/resources/connection/client/requests/ConnectionCountRequest.ts +++ b/src/api/resources/connection/client/requests/ConnectionCountRequest.ts @@ -5,33 +5,6 @@ /** * @example * {} - * - * @example - * { - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * pausedAt: new Date("2024-01-15T09:30:00.000Z") - * } - * - * @example - * { - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * pausedAt: new Date("2024-01-15T09:30:00.000Z") - * } - * - * @example - * { - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * pausedAt: new Date("2024-01-15T09:30:00.000Z") - * } */ export interface ConnectionCountRequest { destinationId?: string | string[]; diff --git a/src/api/resources/connection/client/requests/ConnectionCreateRequest.ts b/src/api/resources/connection/client/requests/ConnectionCreateRequest.ts index b7b493e..1dcdb22 100644 --- a/src/api/resources/connection/client/requests/ConnectionCreateRequest.ts +++ b/src/api/resources/connection/client/requests/ConnectionCreateRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/connection/client/requests/ConnectionListRequest.ts b/src/api/resources/connection/client/requests/ConnectionListRequest.ts index ebe0ea6..eb7929b 100644 --- a/src/api/resources/connection/client/requests/ConnectionListRequest.ts +++ b/src/api/resources/connection/client/requests/ConnectionListRequest.ts @@ -7,57 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * name: "string", - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * fullName: "string", - * pausedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.ConnectionListRequestOrderBy.CreatedAt, - * dir: Hookdeck.ConnectionListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * fullName: "string", - * pausedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.ConnectionListRequestOrderBy.CreatedAt, - * dir: Hookdeck.ConnectionListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * destinationId: "string", - * sourceId: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * fullName: "string", - * pausedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.ConnectionListRequestOrderBy.CreatedAt, - * dir: Hookdeck.ConnectionListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface ConnectionListRequest { id?: string | string[]; diff --git a/src/api/resources/connection/client/requests/ConnectionUpdateRequest.ts b/src/api/resources/connection/client/requests/ConnectionUpdateRequest.ts index 524e582..8afff99 100644 --- a/src/api/resources/connection/client/requests/ConnectionUpdateRequest.ts +++ b/src/api/resources/connection/client/requests/ConnectionUpdateRequest.ts @@ -5,18 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/connection/client/requests/ConnectionUpsertRequest.ts b/src/api/resources/connection/client/requests/ConnectionUpsertRequest.ts index 3b1d556..dfcab15 100644 --- a/src/api/resources/connection/client/requests/ConnectionUpsertRequest.ts +++ b/src/api/resources/connection/client/requests/ConnectionUpsertRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/connection/client/requests/index.ts b/src/api/resources/connection/client/requests/index.ts index 9133ca8..7d913b3 100644 --- a/src/api/resources/connection/client/requests/index.ts +++ b/src/api/resources/connection/client/requests/index.ts @@ -1,5 +1,5 @@ -export { ConnectionListRequest } from "./ConnectionListRequest"; -export { ConnectionCreateRequest } from "./ConnectionCreateRequest"; -export { ConnectionUpsertRequest } from "./ConnectionUpsertRequest"; -export { ConnectionCountRequest } from "./ConnectionCountRequest"; -export { ConnectionUpdateRequest } from "./ConnectionUpdateRequest"; +export { type ConnectionListRequest } from "./ConnectionListRequest"; +export { type ConnectionCreateRequest } from "./ConnectionCreateRequest"; +export { type ConnectionUpsertRequest } from "./ConnectionUpsertRequest"; +export { type ConnectionCountRequest } from "./ConnectionCountRequest"; +export { type ConnectionUpdateRequest } from "./ConnectionUpdateRequest"; diff --git a/src/api/resources/customDomain/client/Client.ts b/src/api/resources/customDomain/client/Client.ts index a783bb1..c36c066 100644 --- a/src/api/resources/customDomain/client/Client.ts +++ b/src/api/resources/customDomain/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace CustomDomain { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -28,6 +29,8 @@ export class CustomDomain { /** * * + * @param {CustomDomain.RequestOptions} requestOptions - Request-specific configuration. + * * @example * await hookdeck.customDomain.list() */ @@ -42,13 +45,14 @@ export class CustomDomain { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.ListCustomDomainSchema.parseOrThrow(_response.body, { @@ -85,6 +89,9 @@ export class CustomDomain { /** * * + * @param {Hookdeck.AddCustomHostname} request + * @param {CustomDomain.RequestOptions} requestOptions - Request-specific configuration. + * * @example * await hookdeck.customDomain.create({ * hostname: "hostname" @@ -104,7 +111,7 @@ export class CustomDomain { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -112,6 +119,7 @@ export class CustomDomain { body: await serializers.AddCustomHostname.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.AddCustomHostname.parseOrThrow(_response.body, { @@ -148,11 +156,11 @@ export class CustomDomain { /** * * - * @example - * await hookdeck.customDomain.delete("domain_id") + * @param {string} domainId + * @param {CustomDomain.RequestOptions} requestOptions - Request-specific configuration. * * @example - * await hookdeck.customDomain.delete("string") + * await hookdeck.customDomain.delete("domain_id") */ public async delete( domainId: string, @@ -161,20 +169,21 @@ export class CustomDomain { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `teams/current/custom_domains/${domainId}` + `teams/current/custom_domains/${encodeURIComponent(domainId)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.DeleteCustomDomainSchema.parseOrThrow(_response.body, { diff --git a/src/api/resources/destination/client/Client.ts b/src/api/resources/destination/client/Client.ts index 502bf85..4fd5d8d 100644 --- a/src/api/resources/destination/client/Client.ts +++ b/src/api/resources/destination/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Destination { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,27 +27,16 @@ export class Destination { constructor(protected readonly _options: Destination.Options) {} /** + * + * + * @param {Hookdeck.DestinationListRequest} request + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.destination.list() - * - * @example - * await hookdeck.destination.list({ - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * url: "string", - * cliPath: "string", - * orderBy: Hookdeck.DestinationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.DestinationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.DestinationListRequest = {}, @@ -116,7 +106,7 @@ export class Destination { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -124,6 +114,7 @@ export class Destination { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.DestinationPaginatedResult.parseOrThrow(_response.body, { @@ -181,6 +172,10 @@ export class Destination { } /** + * + * + * @param {Hookdeck.DestinationCreateRequest} request + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -204,7 +199,7 @@ export class Destination { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -212,6 +207,7 @@ export class Destination { body: await serializers.DestinationCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Destination.parseOrThrow(_response.body, { @@ -269,6 +265,10 @@ export class Destination { } /** + * + * + * @param {Hookdeck.DestinationUpsertRequest} request + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -292,7 +292,7 @@ export class Destination { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -300,6 +300,7 @@ export class Destination { body: await serializers.DestinationUpsertRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Destination.parseOrThrow(_response.body, { @@ -357,34 +358,36 @@ export class Destination { } /** + * + * + * @param {string} id + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * @throws {@link Hookdeck.GoneError} * * @example * await hookdeck.destination.retrieve("id") - * - * @example - * await hookdeck.destination.retrieve("string") */ public async retrieve(id: string, requestOptions?: Destination.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `destinations/${id}` + `destinations/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Destination.parseOrThrow(_response.body, { @@ -442,6 +445,11 @@ export class Destination { } /** + * + * + * @param {string} id + * @param {Hookdeck.DestinationUpdateRequest} request + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -449,9 +457,6 @@ export class Destination { * * @example * await hookdeck.destination.update("id") - * - * @example - * await hookdeck.destination.update("string") */ public async update( id: string, @@ -461,14 +466,14 @@ export class Destination { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `destinations/${id}` + `destinations/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -476,6 +481,7 @@ export class Destination { body: await serializers.DestinationUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Destination.parseOrThrow(_response.body, { @@ -543,14 +549,15 @@ export class Destination { } /** + * + * + * @param {string} id + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.destination.delete("id") - * - * @example - * await hookdeck.destination.delete("string") */ public async delete( id: string, @@ -559,20 +566,21 @@ export class Destination { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `destinations/${id}` + `destinations/${encodeURIComponent(id)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.DestinationDeleteResponse.parseOrThrow(_response.body, { @@ -620,33 +628,35 @@ export class Destination { } /** + * + * + * @param {string} id + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.destination.disable("id") - * - * @example - * await hookdeck.destination.disable("string") */ public async disable(id: string, requestOptions?: Destination.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `destinations/${id}/archive` + `destinations/${encodeURIComponent(id)}/archive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Destination.parseOrThrow(_response.body, { @@ -694,33 +704,35 @@ export class Destination { } /** + * + * + * @param {string} id + * @param {Destination.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.destination.enable("id") - * - * @example - * await hookdeck.destination.enable("string") */ public async enable(id: string, requestOptions?: Destination.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `destinations/${id}/unarchive` + `destinations/${encodeURIComponent(id)}/unarchive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Destination.parseOrThrow(_response.body, { diff --git a/src/api/resources/destination/client/requests/DestinationCreateRequest.ts b/src/api/resources/destination/client/requests/DestinationCreateRequest.ts index 4c2826c..d7c56f6 100644 --- a/src/api/resources/destination/client/requests/DestinationCreateRequest.ts +++ b/src/api/resources/destination/client/requests/DestinationCreateRequest.ts @@ -5,21 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * * @example * { * name: "name" diff --git a/src/api/resources/destination/client/requests/DestinationListRequest.ts b/src/api/resources/destination/client/requests/DestinationListRequest.ts index f269324..e970af0 100644 --- a/src/api/resources/destination/client/requests/DestinationListRequest.ts +++ b/src/api/resources/destination/client/requests/DestinationListRequest.ts @@ -7,51 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * url: "string", - * cliPath: "string", - * orderBy: Hookdeck.DestinationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.DestinationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * url: "string", - * cliPath: "string", - * orderBy: Hookdeck.DestinationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.DestinationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * url: "string", - * cliPath: "string", - * orderBy: Hookdeck.DestinationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.DestinationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface DestinationListRequest { id?: string | string[]; diff --git a/src/api/resources/destination/client/requests/DestinationUpdateRequest.ts b/src/api/resources/destination/client/requests/DestinationUpdateRequest.ts index 6916337..49220d8 100644 --- a/src/api/resources/destination/client/requests/DestinationUpdateRequest.ts +++ b/src/api/resources/destination/client/requests/DestinationUpdateRequest.ts @@ -5,18 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/destination/client/requests/DestinationUpsertRequest.ts b/src/api/resources/destination/client/requests/DestinationUpsertRequest.ts index e647585..6dd1434 100644 --- a/src/api/resources/destination/client/requests/DestinationUpsertRequest.ts +++ b/src/api/resources/destination/client/requests/DestinationUpsertRequest.ts @@ -5,21 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * * @example * { * name: "name" diff --git a/src/api/resources/destination/client/requests/index.ts b/src/api/resources/destination/client/requests/index.ts index c94680b..5ea01fc 100644 --- a/src/api/resources/destination/client/requests/index.ts +++ b/src/api/resources/destination/client/requests/index.ts @@ -1,4 +1,4 @@ -export { DestinationListRequest } from "./DestinationListRequest"; -export { DestinationCreateRequest } from "./DestinationCreateRequest"; -export { DestinationUpsertRequest } from "./DestinationUpsertRequest"; -export { DestinationUpdateRequest } from "./DestinationUpdateRequest"; +export { type DestinationListRequest } from "./DestinationListRequest"; +export { type DestinationCreateRequest } from "./DestinationCreateRequest"; +export { type DestinationUpsertRequest } from "./DestinationUpsertRequest"; +export { type DestinationUpdateRequest } from "./DestinationUpdateRequest"; diff --git a/src/api/resources/event/client/Client.ts b/src/api/resources/event/client/Client.ts index 6cb5729..80b069b 100644 --- a/src/api/resources/event/client/Client.ts +++ b/src/api/resources/event/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Event { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,43 +27,16 @@ export class Event { constructor(protected readonly _options: Event.Options) {} /** + * + * + * @param {Hookdeck.EventListRequest} request + * @param {Event.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.event.list() - * - * @example - * await hookdeck.event.list({ - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.EventListRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.EventListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.EventListRequest = {}, @@ -248,7 +222,7 @@ export class Event { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -256,6 +230,7 @@ export class Event { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.EventPaginatedResult.parseOrThrow(_response.body, { @@ -313,33 +288,35 @@ export class Event { } /** + * + * + * @param {string} id + * @param {Event.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.event.retrieve("id") - * - * @example - * await hookdeck.event.retrieve("string") */ public async retrieve(id: string, requestOptions?: Event.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `events/${id}` + `events/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Event.parseOrThrow(_response.body, { @@ -387,33 +364,35 @@ export class Event { } /** + * + * + * @param {string} id + * @param {Event.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.event.retrieveBody("id") - * - * @example - * await hookdeck.event.retrieveBody("string") */ public async retrieveBody(id: string, requestOptions?: Event.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `events/${id}/raw_body` + `events/${encodeURIComponent(id)}/raw_body` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RawBody.parseOrThrow(_response.body, { @@ -461,33 +440,35 @@ export class Event { } /** + * + * + * @param {string} id + * @param {Event.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.event.retry("id") - * - * @example - * await hookdeck.event.retry("string") */ public async retry(id: string, requestOptions?: Event.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `events/${id}/retry` + `events/${encodeURIComponent(id)}/retry` ), method: "POST", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RetriedEvent.parseOrThrow(_response.body, { @@ -535,33 +516,35 @@ export class Event { } /** + * + * + * @param {string} id + * @param {Event.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.event.mute("id") - * - * @example - * await hookdeck.event.mute("string") */ public async mute(id: string, requestOptions?: Event.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `events/${id}/mute` + `events/${encodeURIComponent(id)}/mute` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Event.parseOrThrow(_response.body, { diff --git a/src/api/resources/event/client/requests/EventListRequest.ts b/src/api/resources/event/client/requests/EventListRequest.ts index 303bb4c..97418cb 100644 --- a/src/api/resources/event/client/requests/EventListRequest.ts +++ b/src/api/resources/event/client/requests/EventListRequest.ts @@ -7,99 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.EventListRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.EventListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.EventListRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.EventListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.EventListRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.EventListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface EventListRequest { id?: string | string[]; diff --git a/src/api/resources/event/client/requests/index.ts b/src/api/resources/event/client/requests/index.ts index 95e4850..d4ded4b 100644 --- a/src/api/resources/event/client/requests/index.ts +++ b/src/api/resources/event/client/requests/index.ts @@ -1 +1 @@ -export { EventListRequest } from "./EventListRequest"; +export { type EventListRequest } from "./EventListRequest"; diff --git a/src/api/resources/eventBulkRetry/client/Client.ts b/src/api/resources/eventBulkRetry/client/Client.ts index e9ba2af..becf8ad 100644 --- a/src/api/resources/eventBulkRetry/client/Client.ts +++ b/src/api/resources/eventBulkRetry/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace EventBulkRetry { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,27 +27,16 @@ export class EventBulkRetry { constructor(protected readonly _options: EventBulkRetry.Options) {} /** + * + * + * @param {Hookdeck.EventBulkRetryListRequest} request + * @param {EventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.eventBulkRetry.list() - * - * @example - * await hookdeck.eventBulkRetry.list({ - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.EventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.EventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.EventBulkRetryListRequest = {}, @@ -124,7 +114,7 @@ export class EventBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -132,6 +122,7 @@ export class EventBulkRetry { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperationPaginatedResult.parseOrThrow(_response.body, { @@ -189,6 +180,10 @@ export class EventBulkRetry { } /** + * + * + * @param {Hookdeck.EventBulkRetryCreateRequest} request + * @param {EventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -210,7 +205,7 @@ export class EventBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -220,6 +215,7 @@ export class EventBulkRetry { }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { @@ -277,6 +273,9 @@ export class EventBulkRetry { } /** + * + * + * @param {EventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -295,13 +294,14 @@ export class EventBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.EventBulkRetryPlanResponse.parseOrThrow(_response.body, { @@ -359,14 +359,15 @@ export class EventBulkRetry { } /** + * + * + * @param {string} id + * @param {EventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.eventBulkRetry.retrieve("id") - * - * @example - * await hookdeck.eventBulkRetry.retrieve("string") */ public async retrieve( id: string, @@ -375,20 +376,21 @@ export class EventBulkRetry { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bulk/events/retry/${id}` + `bulk/events/retry/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { @@ -436,33 +438,35 @@ export class EventBulkRetry { } /** + * + * + * @param {string} id + * @param {EventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.eventBulkRetry.cancel("id") - * - * @example - * await hookdeck.eventBulkRetry.cancel("string") */ public async cancel(id: string, requestOptions?: EventBulkRetry.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bulk/events/retry/${id}/cancel` + `bulk/events/retry/${encodeURIComponent(id)}/cancel` ), method: "POST", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { diff --git a/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryCreateRequest.ts b/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryCreateRequest.ts index 7afe314..c877469 100644 --- a/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryCreateRequest.ts +++ b/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryCreateRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryListRequest.ts b/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryListRequest.ts index 355af99..6167875 100644 --- a/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryListRequest.ts +++ b/src/api/resources/eventBulkRetry/client/requests/EventBulkRetryListRequest.ts @@ -7,51 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.EventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.EventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.EventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.EventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.EventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.EventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface EventBulkRetryListRequest { cancelledAt?: Date; diff --git a/src/api/resources/eventBulkRetry/client/requests/index.ts b/src/api/resources/eventBulkRetry/client/requests/index.ts index 14361b2..61f62ae 100644 --- a/src/api/resources/eventBulkRetry/client/requests/index.ts +++ b/src/api/resources/eventBulkRetry/client/requests/index.ts @@ -1,2 +1,2 @@ -export { EventBulkRetryListRequest } from "./EventBulkRetryListRequest"; -export { EventBulkRetryCreateRequest } from "./EventBulkRetryCreateRequest"; +export { type EventBulkRetryListRequest } from "./EventBulkRetryListRequest"; +export { type EventBulkRetryCreateRequest } from "./EventBulkRetryCreateRequest"; diff --git a/src/api/resources/ignoredEventBulkRetry/client/Client.ts b/src/api/resources/ignoredEventBulkRetry/client/Client.ts index a265691..f07f42f 100644 --- a/src/api/resources/ignoredEventBulkRetry/client/Client.ts +++ b/src/api/resources/ignoredEventBulkRetry/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace IgnoredEventBulkRetry { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,27 +27,16 @@ export class IgnoredEventBulkRetry { constructor(protected readonly _options: IgnoredEventBulkRetry.Options) {} /** + * + * + * @param {Hookdeck.IgnoredEventBulkRetryListRequest} request + * @param {IgnoredEventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.ignoredEventBulkRetry.list() - * - * @example - * await hookdeck.ignoredEventBulkRetry.list({ - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.IgnoredEventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IgnoredEventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.IgnoredEventBulkRetryListRequest = {}, @@ -124,7 +114,7 @@ export class IgnoredEventBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -132,6 +122,7 @@ export class IgnoredEventBulkRetry { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperationPaginatedResult.parseOrThrow(_response.body, { @@ -189,6 +180,10 @@ export class IgnoredEventBulkRetry { } /** + * + * + * @param {Hookdeck.IgnoredEventBulkRetryCreateRequest} request + * @param {IgnoredEventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -210,7 +205,7 @@ export class IgnoredEventBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -220,6 +215,7 @@ export class IgnoredEventBulkRetry { }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { @@ -277,6 +273,9 @@ export class IgnoredEventBulkRetry { } /** + * + * + * @param {IgnoredEventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -297,13 +296,14 @@ export class IgnoredEventBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IgnoredEventBulkRetryPlanResponse.parseOrThrow(_response.body, { @@ -361,14 +361,15 @@ export class IgnoredEventBulkRetry { } /** + * + * + * @param {string} id + * @param {IgnoredEventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.ignoredEventBulkRetry.retrieve("id") - * - * @example - * await hookdeck.ignoredEventBulkRetry.retrieve("string") */ public async retrieve( id: string, @@ -377,20 +378,21 @@ export class IgnoredEventBulkRetry { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bulk/ignored-events/retry/${id}` + `bulk/ignored-events/retry/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { @@ -438,14 +440,15 @@ export class IgnoredEventBulkRetry { } /** + * + * + * @param {string} id + * @param {IgnoredEventBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.ignoredEventBulkRetry.cancel("id") - * - * @example - * await hookdeck.ignoredEventBulkRetry.cancel("string") */ public async cancel( id: string, @@ -454,20 +457,21 @@ export class IgnoredEventBulkRetry { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bulk/ignored-events/retry/${id}/cancel` + `bulk/ignored-events/retry/${encodeURIComponent(id)}/cancel` ), method: "POST", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { diff --git a/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryCreateRequest.ts b/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryCreateRequest.ts index 3f11c8d..40a5618 100644 --- a/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryCreateRequest.ts +++ b/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryCreateRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryListRequest.ts b/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryListRequest.ts index 28ad29f..399da6f 100644 --- a/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryListRequest.ts +++ b/src/api/resources/ignoredEventBulkRetry/client/requests/IgnoredEventBulkRetryListRequest.ts @@ -7,51 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.IgnoredEventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IgnoredEventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.IgnoredEventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IgnoredEventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * queryPartialMatch: true, - * inProgress: true, - * orderBy: Hookdeck.IgnoredEventBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IgnoredEventBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface IgnoredEventBulkRetryListRequest { cancelledAt?: Date; diff --git a/src/api/resources/ignoredEventBulkRetry/client/requests/index.ts b/src/api/resources/ignoredEventBulkRetry/client/requests/index.ts index f3b321f..feed02c 100644 --- a/src/api/resources/ignoredEventBulkRetry/client/requests/index.ts +++ b/src/api/resources/ignoredEventBulkRetry/client/requests/index.ts @@ -1,2 +1,2 @@ -export { IgnoredEventBulkRetryListRequest } from "./IgnoredEventBulkRetryListRequest"; -export { IgnoredEventBulkRetryCreateRequest } from "./IgnoredEventBulkRetryCreateRequest"; +export { type IgnoredEventBulkRetryListRequest } from "./IgnoredEventBulkRetryListRequest"; +export { type IgnoredEventBulkRetryCreateRequest } from "./IgnoredEventBulkRetryCreateRequest"; diff --git a/src/api/resources/issue/client/Client.ts b/src/api/resources/issue/client/Client.ts index 91de2ee..1296afc 100644 --- a/src/api/resources/issue/client/Client.ts +++ b/src/api/resources/issue/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Issue { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,6 +27,10 @@ export class Issue { constructor(protected readonly _options: Issue.Options) {} /** + * + * + * @param {Hookdeck.IssueListRequest} request + * @param {Issue.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -36,24 +41,6 @@ export class Issue { * issueTriggerId: "it_BXKv5OdJXCiVwkPhGy", * mergedWith: "iss_AXKv3OdJXCiKlkPhDz" * }) - * - * @example - * await hookdeck.issue.list({ - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueListRequestType.Delivery, - * status: Hookdeck.IssueListRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.IssueListRequest = {}, @@ -154,7 +141,7 @@ export class Issue { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -162,6 +149,7 @@ export class Issue { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueWithDataPaginatedResult.parseOrThrow(_response.body, { @@ -219,6 +207,10 @@ export class Issue { } /** + * + * + * @param {Hookdeck.IssueCountRequest} request + * @param {Issue.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.UnprocessableEntityError} * @@ -228,24 +220,6 @@ export class Issue { * issueTriggerId: "it_BXKv5OdJXCiVwkPhGy", * mergedWith: "iss_AXKv3OdJXCiKlkPhDz" * }) - * - * @example - * await hookdeck.issue.count({ - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueCountRequestType.Delivery, - * status: Hookdeck.IssueCountRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueCountRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueCountRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async count( request: Hookdeck.IssueCountRequest = {}, @@ -346,7 +320,7 @@ export class Issue { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -354,6 +328,7 @@ export class Issue { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueCount.parseOrThrow(_response.body, { @@ -401,6 +376,10 @@ export class Issue { } /** + * + * + * @param {string} id + * @param {Issue.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * @@ -411,20 +390,21 @@ export class Issue { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issues/${id}` + `issues/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueWithData.parseOrThrow(_response.body, { @@ -472,6 +452,11 @@ export class Issue { } /** + * + * + * @param {string} id + * @param {Hookdeck.IssueUpdateRequest} request + * @param {Issue.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -489,14 +474,14 @@ export class Issue { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issues/${id}` + `issues/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -504,6 +489,7 @@ export class Issue { body: await serializers.IssueUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Issue.parseOrThrow(_response.body, { @@ -561,6 +547,10 @@ export class Issue { } /** + * + * + * @param {string} id + * @param {Issue.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * @@ -571,20 +561,21 @@ export class Issue { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issues/${id}` + `issues/${encodeURIComponent(id)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Issue.parseOrThrow(_response.body, { diff --git a/src/api/resources/issue/client/requests/IssueCountRequest.ts b/src/api/resources/issue/client/requests/IssueCountRequest.ts index 531139c..cce2ffe 100644 --- a/src/api/resources/issue/client/requests/IssueCountRequest.ts +++ b/src/api/resources/issue/client/requests/IssueCountRequest.ts @@ -11,42 +11,6 @@ import * as Hookdeck from "../../../../index"; * issueTriggerId: "it_BXKv5OdJXCiVwkPhGy", * mergedWith: "iss_AXKv3OdJXCiKlkPhDz" * } - * - * @example - * { - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueCountRequestType.Delivery, - * status: Hookdeck.IssueCountRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueCountRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueCountRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueCountRequestType.Delivery, - * status: Hookdeck.IssueCountRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueCountRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueCountRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface IssueCountRequest { id?: string | string[]; diff --git a/src/api/resources/issue/client/requests/IssueListRequest.ts b/src/api/resources/issue/client/requests/IssueListRequest.ts index 48d7eb3..c984834 100644 --- a/src/api/resources/issue/client/requests/IssueListRequest.ts +++ b/src/api/resources/issue/client/requests/IssueListRequest.ts @@ -11,60 +11,6 @@ import * as Hookdeck from "../../../../index"; * issueTriggerId: "it_BXKv5OdJXCiVwkPhGy", * mergedWith: "iss_AXKv3OdJXCiKlkPhDz" * } - * - * @example - * { - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueListRequestType.Delivery, - * status: Hookdeck.IssueListRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueListRequestType.Delivery, - * status: Hookdeck.IssueListRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * issueTriggerId: "string", - * type: Hookdeck.IssueListRequestType.Delivery, - * status: Hookdeck.IssueListRequestStatus.Opened, - * mergedWith: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * firstSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * lastSeenAt: new Date("2024-01-15T09:30:00.000Z"), - * dismissedAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface IssueListRequest { id?: string | string[]; diff --git a/src/api/resources/issue/client/requests/IssueUpdateRequest.ts b/src/api/resources/issue/client/requests/IssueUpdateRequest.ts index d5ebff3..0ec8f9c 100644 --- a/src/api/resources/issue/client/requests/IssueUpdateRequest.ts +++ b/src/api/resources/issue/client/requests/IssueUpdateRequest.ts @@ -5,16 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * status: Hookdeck.IssueUpdateRequestStatus.Opened - * } - * - * @example - * { - * status: Hookdeck.IssueUpdateRequestStatus.Opened - * } - * * @example * { * status: Hookdeck.IssueUpdateRequestStatus.Opened diff --git a/src/api/resources/issue/client/requests/index.ts b/src/api/resources/issue/client/requests/index.ts index ec19c6e..489012f 100644 --- a/src/api/resources/issue/client/requests/index.ts +++ b/src/api/resources/issue/client/requests/index.ts @@ -1,3 +1,3 @@ -export { IssueListRequest } from "./IssueListRequest"; -export { IssueCountRequest } from "./IssueCountRequest"; -export { IssueUpdateRequest } from "./IssueUpdateRequest"; +export { type IssueListRequest } from "./IssueListRequest"; +export { type IssueCountRequest } from "./IssueCountRequest"; +export { type IssueUpdateRequest } from "./IssueUpdateRequest"; diff --git a/src/api/resources/issueTrigger/client/Client.ts b/src/api/resources/issueTrigger/client/Client.ts index 89479c1..7cac4af 100644 --- a/src/api/resources/issueTrigger/client/Client.ts +++ b/src/api/resources/issueTrigger/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace IssueTrigger { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,24 +27,16 @@ export class IssueTrigger { constructor(protected readonly _options: IssueTrigger.Options) {} /** + * + * + * @param {Hookdeck.IssueTriggerListRequest} request + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.issueTrigger.list() - * - * @example - * await hookdeck.issueTrigger.list({ - * name: "string", - * type: Hookdeck.IssueType.Delivery, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueTriggerListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueTriggerListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.IssueTriggerListRequest = {}, @@ -93,7 +86,7 @@ export class IssueTrigger { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -101,6 +94,7 @@ export class IssueTrigger { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTriggerPaginatedResult.parseOrThrow(_response.body, { @@ -158,6 +152,10 @@ export class IssueTrigger { } /** + * + * + * @param {Hookdeck.IssueTriggerCreateRequest} request + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -181,7 +179,7 @@ export class IssueTrigger { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -189,6 +187,7 @@ export class IssueTrigger { body: await serializers.IssueTriggerCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTrigger.parseOrThrow(_response.body, { @@ -246,6 +245,10 @@ export class IssueTrigger { } /** + * + * + * @param {Hookdeck.IssueTriggerUpsertRequest} request + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -270,7 +273,7 @@ export class IssueTrigger { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -278,6 +281,7 @@ export class IssueTrigger { body: await serializers.IssueTriggerUpsertRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTrigger.parseOrThrow(_response.body, { @@ -335,33 +339,35 @@ export class IssueTrigger { } /** + * + * + * @param {string} id + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.issueTrigger.retrieve("id") - * - * @example - * await hookdeck.issueTrigger.retrieve("string") */ public async retrieve(id: string, requestOptions?: IssueTrigger.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issue-triggers/${id}` + `issue-triggers/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTrigger.parseOrThrow(_response.body, { @@ -409,15 +415,17 @@ export class IssueTrigger { } /** + * + * + * @param {string} id + * @param {Hookdeck.IssueTriggerUpdateRequest} request + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.issueTrigger.update("id") - * - * @example - * await hookdeck.issueTrigger.update("string") */ public async update( id: string, @@ -427,14 +435,14 @@ export class IssueTrigger { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issue-triggers/${id}` + `issue-triggers/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -442,6 +450,7 @@ export class IssueTrigger { body: await serializers.IssueTriggerUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTrigger.parseOrThrow(_response.body, { @@ -499,14 +508,15 @@ export class IssueTrigger { } /** + * + * + * @param {string} id + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.issueTrigger.delete("id") - * - * @example - * await hookdeck.issueTrigger.delete("string") */ public async delete( id: string, @@ -515,20 +525,21 @@ export class IssueTrigger { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issue-triggers/${id}` + `issue-triggers/${encodeURIComponent(id)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.DeletedIssueTriggerResponse.parseOrThrow(_response.body, { @@ -576,33 +587,35 @@ export class IssueTrigger { } /** + * + * + * @param {string} id + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.issueTrigger.disable("id") - * - * @example - * await hookdeck.issueTrigger.disable("string") */ public async disable(id: string, requestOptions?: IssueTrigger.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issue-triggers/${id}/disable` + `issue-triggers/${encodeURIComponent(id)}/disable` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTrigger.parseOrThrow(_response.body, { @@ -650,33 +663,35 @@ export class IssueTrigger { } /** + * + * + * @param {string} id + * @param {IssueTrigger.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.issueTrigger.enable("id") - * - * @example - * await hookdeck.issueTrigger.enable("string") */ public async enable(id: string, requestOptions?: IssueTrigger.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `issue-triggers/${id}/enable` + `issue-triggers/${encodeURIComponent(id)}/enable` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IssueTrigger.parseOrThrow(_response.body, { diff --git a/src/api/resources/issueTrigger/client/requests/IssueTriggerCreateRequest.ts b/src/api/resources/issueTrigger/client/requests/IssueTriggerCreateRequest.ts index 001c33d..5e75f48 100644 --- a/src/api/resources/issueTrigger/client/requests/IssueTriggerCreateRequest.ts +++ b/src/api/resources/issueTrigger/client/requests/IssueTriggerCreateRequest.ts @@ -5,21 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * type: Hookdeck.IssueType.Delivery - * } - * - * @example - * { - * type: Hookdeck.IssueType.Delivery - * } - * - * @example - * { - * type: Hookdeck.IssueType.Delivery - * } - * * @example * { * type: Hookdeck.IssueType.Delivery diff --git a/src/api/resources/issueTrigger/client/requests/IssueTriggerListRequest.ts b/src/api/resources/issueTrigger/client/requests/IssueTriggerListRequest.ts index 74a0778..566b947 100644 --- a/src/api/resources/issueTrigger/client/requests/IssueTriggerListRequest.ts +++ b/src/api/resources/issueTrigger/client/requests/IssueTriggerListRequest.ts @@ -7,42 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * name: "string", - * type: Hookdeck.IssueType.Delivery, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueTriggerListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueTriggerListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * name: "string", - * type: Hookdeck.IssueType.Delivery, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueTriggerListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueTriggerListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * name: "string", - * type: Hookdeck.IssueType.Delivery, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.IssueTriggerListRequestOrderBy.CreatedAt, - * dir: Hookdeck.IssueTriggerListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface IssueTriggerListRequest { name?: string; diff --git a/src/api/resources/issueTrigger/client/requests/IssueTriggerUpdateRequest.ts b/src/api/resources/issueTrigger/client/requests/IssueTriggerUpdateRequest.ts index 5b85f39..8222ba1 100644 --- a/src/api/resources/issueTrigger/client/requests/IssueTriggerUpdateRequest.ts +++ b/src/api/resources/issueTrigger/client/requests/IssueTriggerUpdateRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/issueTrigger/client/requests/IssueTriggerUpsertRequest.ts b/src/api/resources/issueTrigger/client/requests/IssueTriggerUpsertRequest.ts index b073c68..810bac6 100644 --- a/src/api/resources/issueTrigger/client/requests/IssueTriggerUpsertRequest.ts +++ b/src/api/resources/issueTrigger/client/requests/IssueTriggerUpsertRequest.ts @@ -5,24 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * type: Hookdeck.IssueType.Delivery, - * name: "name" - * } - * - * @example - * { - * type: Hookdeck.IssueType.Delivery, - * name: "name" - * } - * - * @example - * { - * type: Hookdeck.IssueType.Delivery, - * name: "name" - * } - * * @example * { * type: Hookdeck.IssueType.Delivery, diff --git a/src/api/resources/issueTrigger/client/requests/index.ts b/src/api/resources/issueTrigger/client/requests/index.ts index 79e4e06..ad64ca2 100644 --- a/src/api/resources/issueTrigger/client/requests/index.ts +++ b/src/api/resources/issueTrigger/client/requests/index.ts @@ -1,4 +1,4 @@ -export { IssueTriggerListRequest } from "./IssueTriggerListRequest"; -export { IssueTriggerCreateRequest } from "./IssueTriggerCreateRequest"; -export { IssueTriggerUpsertRequest } from "./IssueTriggerUpsertRequest"; -export { IssueTriggerUpdateRequest } from "./IssueTriggerUpdateRequest"; +export { type IssueTriggerListRequest } from "./IssueTriggerListRequest"; +export { type IssueTriggerCreateRequest } from "./IssueTriggerCreateRequest"; +export { type IssueTriggerUpsertRequest } from "./IssueTriggerUpsertRequest"; +export { type IssueTriggerUpdateRequest } from "./IssueTriggerUpdateRequest"; diff --git a/src/api/resources/notification/client/Client.ts b/src/api/resources/notification/client/Client.ts index d3573dc..4b528cb 100644 --- a/src/api/resources/notification/client/Client.ts +++ b/src/api/resources/notification/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Notification { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -28,6 +29,9 @@ export class Notification { /** * * + * @param {Hookdeck.NotificationUpdateRequest} request + * @param {Notification.RequestOptions} requestOptions - Request-specific configuration. + * * @example * await hookdeck.notification.update() */ @@ -45,7 +49,7 @@ export class Notification { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -53,6 +57,7 @@ export class Notification { body: await serializers.NotificationUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.ToggleWebhookNotifications.parseOrThrow(_response.body, { diff --git a/src/api/resources/notification/client/requests/NotificationUpdateRequest.ts b/src/api/resources/notification/client/requests/NotificationUpdateRequest.ts index 84efc61..d381c40 100644 --- a/src/api/resources/notification/client/requests/NotificationUpdateRequest.ts +++ b/src/api/resources/notification/client/requests/NotificationUpdateRequest.ts @@ -5,9 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/notification/client/requests/index.ts b/src/api/resources/notification/client/requests/index.ts index bd0f2a2..8873458 100644 --- a/src/api/resources/notification/client/requests/index.ts +++ b/src/api/resources/notification/client/requests/index.ts @@ -1 +1 @@ -export { NotificationUpdateRequest } from "./NotificationUpdateRequest"; +export { type NotificationUpdateRequest } from "./NotificationUpdateRequest"; diff --git a/src/api/resources/request/client/Client.ts b/src/api/resources/request/client/Client.ts index fdf2491..41161f3 100644 --- a/src/api/resources/request/client/Client.ts +++ b/src/api/resources/request/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Request { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,36 +27,16 @@ export class Request { constructor(protected readonly _options: Request.Options) {} /** + * + * + * @param {Hookdeck.RequestListRequest} request + * @param {Request.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.request.list() - * - * @example - * await hookdeck.request.list({ - * id: "string", - * status: Hookdeck.RequestListRequestStatus.Accepted, - * rejectionCause: Hookdeck.RequestRejectionCause.SourceDisabled, - * sourceId: "string", - * verified: true, - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * ignoredCount: 1, - * eventsCount: 1, - * ingestedAt: new Date("2024-01-15T09:30:00.000Z"), - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListRequestOrderBy.IngestedAt, - * dir: Hookdeck.RequestListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.RequestListRequest = {}, @@ -186,7 +167,7 @@ export class Request { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -194,6 +175,7 @@ export class Request { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RequestPaginatedResult.parseOrThrow(_response.body, { @@ -251,33 +233,35 @@ export class Request { } /** + * + * + * @param {string} id + * @param {Request.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.request.retrieve("id") - * - * @example - * await hookdeck.request.retrieve("string") */ public async retrieve(id: string, requestOptions?: Request.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `requests/${id}` + `requests/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Request.parseOrThrow(_response.body, { @@ -325,33 +309,35 @@ export class Request { } /** + * + * + * @param {string} id + * @param {Request.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.request.retrieveBody("id") - * - * @example - * await hookdeck.request.retrieveBody("string") */ public async retrieveBody(id: string, requestOptions?: Request.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `requests/${id}/raw_body` + `requests/${encodeURIComponent(id)}/raw_body` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RawBody.parseOrThrow(_response.body, { @@ -399,6 +385,11 @@ export class Request { } /** + * + * + * @param {string} id + * @param {Hookdeck.RequestRetryRequest} request + * @param {Request.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -408,11 +399,6 @@ export class Request { * await hookdeck.request.retry("id", { * webhookIds: ["webhook_ids"] * }) - * - * @example - * await hookdeck.request.retry("string", { - * webhookIds: ["webhook_ids"] - * }) */ public async retry( id: string, @@ -422,14 +408,14 @@ export class Request { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `requests/${id}/retry` + `requests/${encodeURIComponent(id)}/retry` ), method: "POST", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -437,6 +423,7 @@ export class Request { body: await serializers.RequestRetryRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RetryRequest.parseOrThrow(_response.body, { @@ -504,6 +491,11 @@ export class Request { } /** + * + * + * @param {string} id + * @param {Hookdeck.RequestListEventRequest} request + * @param {Request.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -511,37 +503,6 @@ export class Request { * * @example * await hookdeck.request.listEvent("id") - * - * @example - * await hookdeck.request.listEvent("string", { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListEventRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.RequestListEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async listEvent( id: string, @@ -721,14 +682,14 @@ export class Request { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `requests/${id}/events` + `requests/${encodeURIComponent(id)}/events` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -736,6 +697,7 @@ export class Request { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.EventPaginatedResult.parseOrThrow(_response.body, { @@ -803,6 +765,11 @@ export class Request { } /** + * + * + * @param {string} id + * @param {Hookdeck.RequestListIgnoredEventRequest} request + * @param {Request.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -810,16 +777,6 @@ export class Request { * * @example * await hookdeck.request.listIgnoredEvent("id") - * - * @example - * await hookdeck.request.listIgnoredEvent("string", { - * id: "string", - * orderBy: Hookdeck.RequestListIgnoredEventRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestListIgnoredEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async listIgnoredEvent( id: string, @@ -859,14 +816,14 @@ export class Request { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `requests/${id}/ignored_events` + `requests/${encodeURIComponent(id)}/ignored_events` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -874,6 +831,7 @@ export class Request { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.IgnoredEventPaginatedResult.parseOrThrow(_response.body, { diff --git a/src/api/resources/request/client/requests/RequestListEventRequest.ts b/src/api/resources/request/client/requests/RequestListEventRequest.ts index 4e8acbd..7f4b139 100644 --- a/src/api/resources/request/client/requests/RequestListEventRequest.ts +++ b/src/api/resources/request/client/requests/RequestListEventRequest.ts @@ -7,130 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListEventRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.RequestListEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListEventRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.RequestListEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListEventRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.RequestListEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.EventStatus.Scheduled, - * webhookId: "string", - * destinationId: "string", - * sourceId: "string", - * attempts: 1, - * responseStatus: 1, - * successfulAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * errorCode: Hookdeck.AttemptErrorCodes.Cancelled, - * cliId: "string", - * lastAttemptAt: new Date("2024-01-15T09:30:00.000Z"), - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * cliUserId: "string", - * issueId: "string", - * eventDataId: "string", - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListEventRequestOrderBy.LastAttemptAt, - * dir: Hookdeck.RequestListEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface RequestListEventRequest { id?: string | string[]; diff --git a/src/api/resources/request/client/requests/RequestListIgnoredEventRequest.ts b/src/api/resources/request/client/requests/RequestListIgnoredEventRequest.ts index b56279c..674144e 100644 --- a/src/api/resources/request/client/requests/RequestListIgnoredEventRequest.ts +++ b/src/api/resources/request/client/requests/RequestListIgnoredEventRequest.ts @@ -7,46 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * orderBy: Hookdeck.RequestListIgnoredEventRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestListIgnoredEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * orderBy: Hookdeck.RequestListIgnoredEventRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestListIgnoredEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * orderBy: Hookdeck.RequestListIgnoredEventRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestListIgnoredEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * orderBy: Hookdeck.RequestListIgnoredEventRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestListIgnoredEventRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface RequestListIgnoredEventRequest { id?: string | string[]; diff --git a/src/api/resources/request/client/requests/RequestListRequest.ts b/src/api/resources/request/client/requests/RequestListRequest.ts index bab3e5f..e2ef649 100644 --- a/src/api/resources/request/client/requests/RequestListRequest.ts +++ b/src/api/resources/request/client/requests/RequestListRequest.ts @@ -7,78 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * status: Hookdeck.RequestListRequestStatus.Accepted, - * rejectionCause: Hookdeck.RequestRejectionCause.SourceDisabled, - * sourceId: "string", - * verified: true, - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * ignoredCount: 1, - * eventsCount: 1, - * ingestedAt: new Date("2024-01-15T09:30:00.000Z"), - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListRequestOrderBy.IngestedAt, - * dir: Hookdeck.RequestListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.RequestListRequestStatus.Accepted, - * rejectionCause: Hookdeck.RequestRejectionCause.SourceDisabled, - * sourceId: "string", - * verified: true, - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * ignoredCount: 1, - * eventsCount: 1, - * ingestedAt: new Date("2024-01-15T09:30:00.000Z"), - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListRequestOrderBy.IngestedAt, - * dir: Hookdeck.RequestListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * status: Hookdeck.RequestListRequestStatus.Accepted, - * rejectionCause: Hookdeck.RequestRejectionCause.SourceDisabled, - * sourceId: "string", - * verified: true, - * searchTerm: "string", - * headers: "string", - * body: "string", - * parsedQuery: "string", - * path: "string", - * ignoredCount: 1, - * eventsCount: 1, - * ingestedAt: new Date("2024-01-15T09:30:00.000Z"), - * bulkRetryId: "string", - * include: "data", - * orderBy: Hookdeck.RequestListRequestOrderBy.IngestedAt, - * dir: Hookdeck.RequestListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface RequestListRequest { id?: string | string[]; diff --git a/src/api/resources/request/client/requests/RequestRetryRequest.ts b/src/api/resources/request/client/requests/RequestRetryRequest.ts index 9485979..3ba98d6 100644 --- a/src/api/resources/request/client/requests/RequestRetryRequest.ts +++ b/src/api/resources/request/client/requests/RequestRetryRequest.ts @@ -3,26 +3,6 @@ */ /** - * @example - * { - * webhookIds: ["webhook_ids"] - * } - * - * @example - * { - * webhookIds: ["webhook_ids"] - * } - * - * @example - * { - * webhookIds: ["webhook_ids"] - * } - * - * @example - * { - * webhookIds: ["webhook_ids"] - * } - * * @example * { * webhookIds: ["webhook_ids"] diff --git a/src/api/resources/request/client/requests/index.ts b/src/api/resources/request/client/requests/index.ts index 589a879..8dfe311 100644 --- a/src/api/resources/request/client/requests/index.ts +++ b/src/api/resources/request/client/requests/index.ts @@ -1,4 +1,4 @@ -export { RequestListRequest } from "./RequestListRequest"; -export { RequestRetryRequest } from "./RequestRetryRequest"; -export { RequestListEventRequest } from "./RequestListEventRequest"; -export { RequestListIgnoredEventRequest } from "./RequestListIgnoredEventRequest"; +export { type RequestListRequest } from "./RequestListRequest"; +export { type RequestRetryRequest } from "./RequestRetryRequest"; +export { type RequestListEventRequest } from "./RequestListEventRequest"; +export { type RequestListIgnoredEventRequest } from "./RequestListIgnoredEventRequest"; diff --git a/src/api/resources/requestBulkRetry/client/Client.ts b/src/api/resources/requestBulkRetry/client/Client.ts index 81e5c37..07e6ed8 100644 --- a/src/api/resources/requestBulkRetry/client/Client.ts +++ b/src/api/resources/requestBulkRetry/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace RequestBulkRetry { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,27 +27,16 @@ export class RequestBulkRetry { constructor(protected readonly _options: RequestBulkRetry.Options) {} /** + * + * + * @param {Hookdeck.RequestBulkRetryListRequest} request + * @param {RequestBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.requestBulkRetry.list() - * - * @example - * await hookdeck.requestBulkRetry.list({ - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * inProgress: true, - * queryPartialMatch: true, - * orderBy: Hookdeck.RequestBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.RequestBulkRetryListRequest = {}, @@ -124,7 +114,7 @@ export class RequestBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -132,6 +122,7 @@ export class RequestBulkRetry { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperationPaginatedResult.parseOrThrow(_response.body, { @@ -189,6 +180,10 @@ export class RequestBulkRetry { } /** + * + * + * @param {Hookdeck.RequestBulkRetryCreateRequest} request + * @param {RequestBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -210,7 +205,7 @@ export class RequestBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -220,6 +215,7 @@ export class RequestBulkRetry { }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { @@ -277,6 +273,9 @@ export class RequestBulkRetry { } /** + * + * + * @param {RequestBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -297,13 +296,14 @@ export class RequestBulkRetry { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.RequestBulkRetryPlanResponse.parseOrThrow(_response.body, { @@ -361,14 +361,15 @@ export class RequestBulkRetry { } /** + * + * + * @param {string} id + * @param {RequestBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.requestBulkRetry.retrieve("id") - * - * @example - * await hookdeck.requestBulkRetry.retrieve("string") */ public async retrieve( id: string, @@ -377,20 +378,21 @@ export class RequestBulkRetry { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bulk/requests/retry/${id}` + `bulk/requests/retry/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { @@ -438,14 +440,15 @@ export class RequestBulkRetry { } /** + * + * + * @param {string} id + * @param {RequestBulkRetry.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.requestBulkRetry.cancel("id") - * - * @example - * await hookdeck.requestBulkRetry.cancel("string") */ public async cancel( id: string, @@ -454,20 +457,21 @@ export class RequestBulkRetry { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `bulk/requests/retry/${id}/cancel` + `bulk/requests/retry/${encodeURIComponent(id)}/cancel` ), method: "POST", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.BatchOperation.parseOrThrow(_response.body, { diff --git a/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryCreateRequest.ts b/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryCreateRequest.ts index 1c363f7..3217189 100644 --- a/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryCreateRequest.ts +++ b/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryCreateRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryListRequest.ts b/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryListRequest.ts index c000c99..0a45e56 100644 --- a/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryListRequest.ts +++ b/src/api/resources/requestBulkRetry/client/requests/RequestBulkRetryListRequest.ts @@ -7,51 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * inProgress: true, - * queryPartialMatch: true, - * orderBy: Hookdeck.RequestBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * inProgress: true, - * queryPartialMatch: true, - * orderBy: Hookdeck.RequestBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * cancelledAt: new Date("2024-01-15T09:30:00.000Z"), - * completedAt: new Date("2024-01-15T09:30:00.000Z"), - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * id: "string", - * inProgress: true, - * queryPartialMatch: true, - * orderBy: Hookdeck.RequestBulkRetryListRequestOrderBy.CreatedAt, - * dir: Hookdeck.RequestBulkRetryListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface RequestBulkRetryListRequest { cancelledAt?: Date; diff --git a/src/api/resources/requestBulkRetry/client/requests/index.ts b/src/api/resources/requestBulkRetry/client/requests/index.ts index 6147cef..b2a1a95 100644 --- a/src/api/resources/requestBulkRetry/client/requests/index.ts +++ b/src/api/resources/requestBulkRetry/client/requests/index.ts @@ -1,2 +1,2 @@ -export { RequestBulkRetryListRequest } from "./RequestBulkRetryListRequest"; -export { RequestBulkRetryCreateRequest } from "./RequestBulkRetryCreateRequest"; +export { type RequestBulkRetryListRequest } from "./RequestBulkRetryListRequest"; +export { type RequestBulkRetryCreateRequest } from "./RequestBulkRetryCreateRequest"; diff --git a/src/api/resources/source/client/Client.ts b/src/api/resources/source/client/Client.ts index d38c545..a3a0b81 100644 --- a/src/api/resources/source/client/Client.ts +++ b/src/api/resources/source/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Source { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,25 +27,16 @@ export class Source { constructor(protected readonly _options: Source.Options) {} /** + * + * + * @param {Hookdeck.SourceListRequest} request + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.source.list() - * - * @example - * await hookdeck.source.list({ - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.SourceListRequestOrderBy.CreatedAt, - * dir: Hookdeck.SourceListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.SourceListRequest = {}, @@ -102,7 +94,7 @@ export class Source { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -110,6 +102,7 @@ export class Source { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.SourcePaginatedResult.parseOrThrow(_response.body, { @@ -167,6 +160,10 @@ export class Source { } /** + * + * + * @param {Hookdeck.SourceCreateRequest} request + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -190,7 +187,7 @@ export class Source { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -198,6 +195,7 @@ export class Source { body: await serializers.SourceCreateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Source.parseOrThrow(_response.body, { @@ -255,6 +253,10 @@ export class Source { } /** + * + * + * @param {Hookdeck.SourceUpsertRequest} request + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -278,7 +280,7 @@ export class Source { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -286,6 +288,7 @@ export class Source { body: await serializers.SourceUpsertRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Source.parseOrThrow(_response.body, { @@ -343,17 +346,17 @@ export class Source { } /** + * + * + * @param {string} id + * @param {Hookdeck.SourceRetrieveRequest} request + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * @throws {@link Hookdeck.GoneError} * * @example * await hookdeck.source.retrieve("id") - * - * @example - * await hookdeck.source.retrieve("string", { - * include: "verification.configs" - * }) */ public async retrieve( id: string, @@ -369,14 +372,14 @@ export class Source { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `sources/${id}` + `sources/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -384,6 +387,7 @@ export class Source { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Source.parseOrThrow(_response.body, { @@ -441,6 +445,11 @@ export class Source { } /** + * + * + * @param {string} id + * @param {Hookdeck.SourceUpdateRequest} request + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -448,9 +457,6 @@ export class Source { * * @example * await hookdeck.source.update("id") - * - * @example - * await hookdeck.source.update("string") */ public async update( id: string, @@ -460,14 +466,14 @@ export class Source { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `sources/${id}` + `sources/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -475,6 +481,7 @@ export class Source { body: await serializers.SourceUpdateRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Source.parseOrThrow(_response.body, { @@ -542,33 +549,35 @@ export class Source { } /** + * + * + * @param {string} id + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.source.delete("id") - * - * @example - * await hookdeck.source.delete("string") */ public async delete(id: string, requestOptions?: Source.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `sources/${id}` + `sources/${encodeURIComponent(id)}` ), method: "DELETE", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.SourceDeleteResponse.parseOrThrow(_response.body, { @@ -616,33 +625,35 @@ export class Source { } /** + * + * + * @param {string} id + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.source.disable("id") - * - * @example - * await hookdeck.source.disable("string") */ public async disable(id: string, requestOptions?: Source.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `sources/${id}/archive` + `sources/${encodeURIComponent(id)}/archive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Source.parseOrThrow(_response.body, { @@ -690,33 +701,35 @@ export class Source { } /** + * + * + * @param {string} id + * @param {Source.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.source.enable("id") - * - * @example - * await hookdeck.source.enable("string") */ public async enable(id: string, requestOptions?: Source.RequestOptions): Promise { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `sources/${id}/unarchive` + `sources/${encodeURIComponent(id)}/unarchive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Source.parseOrThrow(_response.body, { diff --git a/src/api/resources/source/client/requests/SourceCreateRequest.ts b/src/api/resources/source/client/requests/SourceCreateRequest.ts index 8ba0221..11bd3f2 100644 --- a/src/api/resources/source/client/requests/SourceCreateRequest.ts +++ b/src/api/resources/source/client/requests/SourceCreateRequest.ts @@ -5,21 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * * @example * { * name: "name" diff --git a/src/api/resources/source/client/requests/SourceListRequest.ts b/src/api/resources/source/client/requests/SourceListRequest.ts index 7a03a0d..c5f367a 100644 --- a/src/api/resources/source/client/requests/SourceListRequest.ts +++ b/src/api/resources/source/client/requests/SourceListRequest.ts @@ -7,45 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.SourceListRequestOrderBy.CreatedAt, - * dir: Hookdeck.SourceListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.SourceListRequestOrderBy.CreatedAt, - * dir: Hookdeck.SourceListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * disabled: true, - * disabledAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.SourceListRequestOrderBy.CreatedAt, - * dir: Hookdeck.SourceListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface SourceListRequest { id?: string | string[]; diff --git a/src/api/resources/source/client/requests/SourceRetrieveRequest.ts b/src/api/resources/source/client/requests/SourceRetrieveRequest.ts index ebb7eb9..b73a793 100644 --- a/src/api/resources/source/client/requests/SourceRetrieveRequest.ts +++ b/src/api/resources/source/client/requests/SourceRetrieveRequest.ts @@ -5,21 +5,6 @@ /** * @example * {} - * - * @example - * { - * include: "verification.configs" - * } - * - * @example - * { - * include: "verification.configs" - * } - * - * @example - * { - * include: "verification.configs" - * } */ export interface SourceRetrieveRequest { include?: "verification.configs"; diff --git a/src/api/resources/source/client/requests/SourceUpdateRequest.ts b/src/api/resources/source/client/requests/SourceUpdateRequest.ts index d4f70cb..cfafadf 100644 --- a/src/api/resources/source/client/requests/SourceUpdateRequest.ts +++ b/src/api/resources/source/client/requests/SourceUpdateRequest.ts @@ -5,18 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/source/client/requests/SourceUpsertRequest.ts b/src/api/resources/source/client/requests/SourceUpsertRequest.ts index 2759875..9a2b8e4 100644 --- a/src/api/resources/source/client/requests/SourceUpsertRequest.ts +++ b/src/api/resources/source/client/requests/SourceUpsertRequest.ts @@ -5,21 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * - * @example - * { - * name: "name" - * } - * * @example * { * name: "name" diff --git a/src/api/resources/source/client/requests/index.ts b/src/api/resources/source/client/requests/index.ts index 5e3ea83..a493088 100644 --- a/src/api/resources/source/client/requests/index.ts +++ b/src/api/resources/source/client/requests/index.ts @@ -1,5 +1,5 @@ -export { SourceListRequest } from "./SourceListRequest"; -export { SourceCreateRequest } from "./SourceCreateRequest"; -export { SourceUpsertRequest } from "./SourceUpsertRequest"; -export { SourceRetrieveRequest } from "./SourceRetrieveRequest"; -export { SourceUpdateRequest } from "./SourceUpdateRequest"; +export { type SourceListRequest } from "./SourceListRequest"; +export { type SourceCreateRequest } from "./SourceCreateRequest"; +export { type SourceUpsertRequest } from "./SourceUpsertRequest"; +export { type SourceRetrieveRequest } from "./SourceRetrieveRequest"; +export { type SourceUpdateRequest } from "./SourceUpdateRequest"; diff --git a/src/api/resources/transformation/client/Client.ts b/src/api/resources/transformation/client/Client.ts index 097652e..fa5886b 100644 --- a/src/api/resources/transformation/client/Client.ts +++ b/src/api/resources/transformation/client/Client.ts @@ -19,6 +19,7 @@ export declare namespace Transformation { interface RequestOptions { timeoutInSeconds?: number; maxRetries?: number; + abortSignal?: AbortSignal; } } @@ -26,23 +27,16 @@ export class Transformation { constructor(protected readonly _options: Transformation.Options) {} /** + * + * + * @param {Hookdeck.TransformationListRequest} request + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.transformation.list() - * - * @example - * await hookdeck.transformation.list({ - * id: "string", - * name: "string", - * orderBy: Hookdeck.TransformationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async list( request: Hookdeck.TransformationListRequest = {}, @@ -92,7 +86,7 @@ export class Transformation { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -100,6 +94,7 @@ export class Transformation { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.TransformationPaginatedResult.parseOrThrow(_response.body, { @@ -157,6 +152,10 @@ export class Transformation { } /** + * + * + * @param {Hookdeck.TransformationCreateRequest} request + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -181,7 +180,7 @@ export class Transformation { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -191,6 +190,7 @@ export class Transformation { }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Transformation.parseOrThrow(_response.body, { @@ -248,6 +248,10 @@ export class Transformation { } /** + * + * + * @param {Hookdeck.TransformationUpsertRequest} request + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -272,7 +276,7 @@ export class Transformation { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -282,6 +286,7 @@ export class Transformation { }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Transformation.parseOrThrow(_response.body, { @@ -339,14 +344,15 @@ export class Transformation { } /** + * + * + * @param {string} id + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.transformation.retrieve("id") - * - * @example - * await hookdeck.transformation.retrieve("string") */ public async retrieve( id: string, @@ -355,20 +361,21 @@ export class Transformation { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `transformations/${id}` + `transformations/${encodeURIComponent(id)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Transformation.parseOrThrow(_response.body, { @@ -416,6 +423,11 @@ export class Transformation { } /** + * + * + * @param {string} id + * @param {Hookdeck.TransformationUpdateRequest} request + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.NotFoundError} @@ -423,9 +435,6 @@ export class Transformation { * * @example * await hookdeck.transformation.update("id") - * - * @example - * await hookdeck.transformation.update("string") */ public async update( id: string, @@ -435,14 +444,14 @@ export class Transformation { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `transformations/${id}` + `transformations/${encodeURIComponent(id)}` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -452,6 +461,7 @@ export class Transformation { }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.Transformation.parseOrThrow(_response.body, { @@ -519,6 +529,10 @@ export class Transformation { } /** + * + * + * @param {Hookdeck.TransformationRunRequest} request + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} @@ -540,7 +554,7 @@ export class Transformation { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -548,6 +562,7 @@ export class Transformation { body: await serializers.TransformationRunRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }), timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.TransformationExecutorOutput.parseOrThrow(_response.body, { @@ -605,25 +620,17 @@ export class Transformation { } /** + * + * + * @param {string} id + * @param {Hookdeck.TransformationListExecutionRequest} request + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.BadRequestError} * @throws {@link Hookdeck.UnprocessableEntityError} * * @example * await hookdeck.transformation.listExecution("id") - * - * @example - * await hookdeck.transformation.listExecution("string", { - * logLevel: Hookdeck.TransformationListExecutionRequestLogLevel.Debug, - * webhookId: "string", - * issueId: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.TransformationListExecutionRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListExecutionRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * }) */ public async listExecution( id: string, @@ -679,14 +686,14 @@ export class Transformation { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `transformations/${id}/executions` + `transformations/${encodeURIComponent(id)}/executions` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, @@ -694,6 +701,7 @@ export class Transformation { queryParameters: _queryParams, timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.TransformationExecutionPaginatedResult.parseOrThrow(_response.body, { @@ -751,14 +759,16 @@ export class Transformation { } /** + * + * + * @param {string} id + * @param {string} executionId + * @param {Transformation.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Hookdeck.NotFoundError} * * @example * await hookdeck.transformation.retrieveExecution("id", "execution_id") - * - * @example - * await hookdeck.transformation.retrieveExecution("string", "string") */ public async retrieveExecution( id: string, @@ -768,20 +778,21 @@ export class Transformation { const _response = await (this._options.fetcher ?? core.fetcher)({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.HookdeckEnvironment.Default, - `transformations/${id}/executions/${executionId}` + `transformations/${encodeURIComponent(id)}/executions/${encodeURIComponent(executionId)}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@hookdeck/sdk", - "X-Fern-SDK-Version": "0.3.0-beta.2", + "X-Fern-SDK-Version": "0.3.0-beta.3", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version, }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, maxRetries: requestOptions?.maxRetries, + abortSignal: requestOptions?.abortSignal, }); if (_response.ok) { return await serializers.TransformationExecution.parseOrThrow(_response.body, { diff --git a/src/api/resources/transformation/client/requests/TransformationCreateRequest.ts b/src/api/resources/transformation/client/requests/TransformationCreateRequest.ts index 81caf95..61b813f 100644 --- a/src/api/resources/transformation/client/requests/TransformationCreateRequest.ts +++ b/src/api/resources/transformation/client/requests/TransformationCreateRequest.ts @@ -3,24 +3,6 @@ */ /** - * @example - * { - * name: "name", - * code: "code" - * } - * - * @example - * { - * name: "name", - * code: "code" - * } - * - * @example - * { - * name: "name", - * code: "code" - * } - * * @example * { * name: "name", diff --git a/src/api/resources/transformation/client/requests/TransformationListExecutionRequest.ts b/src/api/resources/transformation/client/requests/TransformationListExecutionRequest.ts index b67c733..4df2de1 100644 --- a/src/api/resources/transformation/client/requests/TransformationListExecutionRequest.ts +++ b/src/api/resources/transformation/client/requests/TransformationListExecutionRequest.ts @@ -7,45 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * logLevel: Hookdeck.TransformationListExecutionRequestLogLevel.Debug, - * webhookId: "string", - * issueId: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.TransformationListExecutionRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListExecutionRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * logLevel: Hookdeck.TransformationListExecutionRequestLogLevel.Debug, - * webhookId: "string", - * issueId: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.TransformationListExecutionRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListExecutionRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * logLevel: Hookdeck.TransformationListExecutionRequestLogLevel.Debug, - * webhookId: "string", - * issueId: "string", - * createdAt: new Date("2024-01-15T09:30:00.000Z"), - * orderBy: Hookdeck.TransformationListExecutionRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListExecutionRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface TransformationListExecutionRequest { logLevel?: Hookdeck.TransformationListExecutionRequestLogLevel; diff --git a/src/api/resources/transformation/client/requests/TransformationListRequest.ts b/src/api/resources/transformation/client/requests/TransformationListRequest.ts index a4decfb..103fc79 100644 --- a/src/api/resources/transformation/client/requests/TransformationListRequest.ts +++ b/src/api/resources/transformation/client/requests/TransformationListRequest.ts @@ -7,39 +7,6 @@ import * as Hookdeck from "../../../../index"; /** * @example * {} - * - * @example - * { - * id: "string", - * name: "string", - * orderBy: Hookdeck.TransformationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * orderBy: Hookdeck.TransformationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } - * - * @example - * { - * id: "string", - * name: "string", - * orderBy: Hookdeck.TransformationListRequestOrderBy.CreatedAt, - * dir: Hookdeck.TransformationListRequestDir.Asc, - * limit: 1, - * next: "string", - * prev: "string" - * } */ export interface TransformationListRequest { id?: string | string[]; diff --git a/src/api/resources/transformation/client/requests/TransformationRunRequest.ts b/src/api/resources/transformation/client/requests/TransformationRunRequest.ts index 50c4446..b72bea4 100644 --- a/src/api/resources/transformation/client/requests/TransformationRunRequest.ts +++ b/src/api/resources/transformation/client/requests/TransformationRunRequest.ts @@ -5,15 +5,6 @@ import * as Hookdeck from "../../../../index"; /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/transformation/client/requests/TransformationUpdateRequest.ts b/src/api/resources/transformation/client/requests/TransformationUpdateRequest.ts index cda6829..7c03d9f 100644 --- a/src/api/resources/transformation/client/requests/TransformationUpdateRequest.ts +++ b/src/api/resources/transformation/client/requests/TransformationUpdateRequest.ts @@ -3,18 +3,6 @@ */ /** - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * - * @example - * {} - * * @example * {} */ diff --git a/src/api/resources/transformation/client/requests/TransformationUpsertRequest.ts b/src/api/resources/transformation/client/requests/TransformationUpsertRequest.ts index f817f22..b50da45 100644 --- a/src/api/resources/transformation/client/requests/TransformationUpsertRequest.ts +++ b/src/api/resources/transformation/client/requests/TransformationUpsertRequest.ts @@ -3,24 +3,6 @@ */ /** - * @example - * { - * name: "name", - * code: "code" - * } - * - * @example - * { - * name: "name", - * code: "code" - * } - * - * @example - * { - * name: "name", - * code: "code" - * } - * * @example * { * name: "name", diff --git a/src/api/resources/transformation/client/requests/index.ts b/src/api/resources/transformation/client/requests/index.ts index abd78c8..e47be8d 100644 --- a/src/api/resources/transformation/client/requests/index.ts +++ b/src/api/resources/transformation/client/requests/index.ts @@ -1,6 +1,6 @@ -export { TransformationListRequest } from "./TransformationListRequest"; -export { TransformationCreateRequest } from "./TransformationCreateRequest"; -export { TransformationUpsertRequest } from "./TransformationUpsertRequest"; -export { TransformationUpdateRequest } from "./TransformationUpdateRequest"; -export { TransformationRunRequest } from "./TransformationRunRequest"; -export { TransformationListExecutionRequest } from "./TransformationListExecutionRequest"; +export { type TransformationListRequest } from "./TransformationListRequest"; +export { type TransformationCreateRequest } from "./TransformationCreateRequest"; +export { type TransformationUpsertRequest } from "./TransformationUpsertRequest"; +export { type TransformationUpdateRequest } from "./TransformationUpdateRequest"; +export { type TransformationRunRequest } from "./TransformationRunRequest"; +export { type TransformationListExecutionRequest } from "./TransformationListExecutionRequest"; diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index a3638c8..5106568 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -1,4 +1,3 @@ -import { default as FormData } from "form-data"; import qs from "qs"; import { RUNTIME } from "../runtime"; import { APIResponse } from "./APIResponse"; @@ -16,7 +15,8 @@ export declare namespace Fetcher { timeoutMs?: number; maxRetries?: number; withCredentials?: boolean; - responseType?: "json" | "blob" | "streaming"; + abortSignal?: AbortSignal; + responseType?: "json" | "blob" | "streaming" | "text"; } export type Error = FailedStatusCodeError | NonJsonError | TimeoutError | UnknownError; @@ -67,43 +67,62 @@ async function fetcherImpl(args: Fetcher.Args): Promise { + if (body instanceof Uint8Array) { + return body; + } else if (args.contentType === "application/x-www-form-urlencoded" && typeof args.body === "string") { + return args.body; + } else { + return JSON.stringify(body); + } + }; + + if (RUNTIME.type === "node") { + if (args.body instanceof (await import("formdata-node")).FormData) { + // @ts-expect-error + body = args.body; + } else { + body = maybeStringifyBody(args.body); + } } else { - body = JSON.stringify(args.body); + if (args.body instanceof (await import("form-data")).default) { + // @ts-expect-error + body = args.body; + } else { + body = maybeStringifyBody(args.body); + } } - // In Node.js environments, the SDK always uses`node-fetch`. - // If not in Node.js the SDK uses global fetch if available, - // and falls back to node-fetch. - const fetchFn = - RUNTIME.type === "node" - ? // `.default` is required due to this issue: - // https://github.com/node-fetch/node-fetch/issues/450#issuecomment-387045223 - ((await import("node-fetch")).default as any) - : typeof fetch == "function" - ? fetch - : ((await import("node-fetch")).default as any); + const fetchFn = await getFetchFn(); const makeRequest = async (): Promise => { - const controller = new AbortController(); - let abortId = undefined; + const signals: AbortSignal[] = []; + + // Add timeout signal + let timeoutAbortId: NodeJS.Timeout | undefined = undefined; if (args.timeoutMs != null) { - abortId = setTimeout(() => controller.abort(), args.timeoutMs); + const { signal, abortId } = getTimeoutSignal(args.timeoutMs); + timeoutAbortId = abortId; + signals.push(signal); } + + // Add arbitrary signal + if (args.abortSignal != null) { + signals.push(args.abortSignal); + } + const response = await fetchFn(url, { method: args.method, headers, body, - signal: controller.signal, + signal: anySignal(signals), credentials: args.withCredentials ? "include" : undefined, }); - if (abortId != null) { - clearTimeout(abortId); + + if (timeoutAbortId != null) { + clearTimeout(timeoutAbortId); } + return response; }; @@ -130,6 +149,8 @@ async function fetcherImpl(args: Fetcher.Args): Promise 0) { @@ -165,7 +186,15 @@ async function fetcherImpl(args: Fetcher.Args): Promise(args: Fetcher.Args): Promise controller.abort(TIMEOUT), timeoutMs); + return { signal: controller.signal, abortId }; +} + +/** + * Returns an abort signal that is getting aborted when + * at least one of the specified abort signals is aborted. + * + * Requires at least node.js 18. + */ +function anySignal(...args: AbortSignal[] | [AbortSignal[]]): AbortSignal { + // Allowing signals to be passed either as array + // of signals or as multiple arguments. + const signals = (args.length === 1 && Array.isArray(args[0]) ? args[0] : args); + + const controller = new AbortController(); + + for (const signal of signals) { + if (signal.aborted) { + // Exiting early if one of the signals + // is already aborted. + controller.abort((signal as any)?.reason); + break; + } + + // Listening for signals and removing the listeners + // when at least one symbol is aborted. + signal.addEventListener("abort", () => controller.abort((signal as any)?.reason), { + signal: controller.signal, + }); + } + + return controller.signal; +} + +/** + * Returns a fetch function based on the runtime + */ +async function getFetchFn(): Promise { + // In Node.js environments, the SDK always uses`node-fetch`. + if (RUNTIME.type === "node") { + return (await import("node-fetch")).default as any; + } + + // Otherwise the SDK uses global fetch if available, + // and falls back to node-fetch. + if (typeof fetch == "function") { + return fetch; + } + + // Defaults to node `node-fetch` if global fetch isn't available + return (await import("node-fetch")).default as any; +} + export const fetcher: FetchFunction = fetcherImpl; diff --git a/src/core/runtime/runtime.ts b/src/core/runtime/runtime.ts index f0692ab..30fe077 100644 --- a/src/core/runtime/runtime.ts +++ b/src/core/runtime/runtime.ts @@ -55,13 +55,19 @@ const isNode = */ const isReactNative = typeof navigator !== "undefined" && navigator?.product === "ReactNative"; +/** + * A constant that indicates whether the environment the code is running is Cloudflare. + * https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent + */ +const isCloudflare = typeof globalThis !== "undefined" && globalThis?.navigator?.userAgent === "Cloudflare-Workers"; + /** * A constant that indicates which environment and version the SDK is running in. */ export const RUNTIME: Runtime = evaluateRuntime(); export interface Runtime { - type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown"; + type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd"; version?: string; } @@ -73,6 +79,12 @@ function evaluateRuntime(): Runtime { }; } + if (isCloudflare) { + return { + type: "workerd", + }; + } + if (isWebWorker) { return { type: "web-worker", diff --git a/yarn.lock b/yarn.lock index 5a5bb44..eedbe9a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1254,6 +1254,11 @@ form-data@4.0.0, form-data@^4.0.0: combined-stream "^1.0.8" mime-types "^2.1.12" +formdata-node@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/formdata-node/-/formdata-node-6.0.3.tgz#48f8e2206ae2befded82af621ef015f08168dc6d" + integrity sha512-8e1++BCiTzUno9v5IZ2J6bv4RU+3UKDmqWUQD0MIMVCd9AdhWkO1gw57oo1mNEX1dMq2EGI+FbWz4B92pscSQg== + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"