Skip to content
This repository was archived by the owner on Feb 5, 2025. It is now read-only.

🌿 Fern Regeneration -- June 13, 2024 #14

Merged
merged 1 commit into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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"
Expand Down
1 change: 1 addition & 0 deletions src/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export declare namespace HookdeckClient {
interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
abortSignal?: AbortSignal;
}
}

Expand Down
30 changes: 14 additions & 16 deletions src/api/resources/attempt/client/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,24 @@ export declare namespace Attempt {
interface RequestOptions {
timeoutInSeconds?: number;
maxRetries?: number;
abortSignal?: AbortSignal;
}
}

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 = {},
Expand Down Expand Up @@ -87,14 +82,15 @@ 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,
},
contentType: "application/json",
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, {
Expand Down Expand Up @@ -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,
Expand All @@ -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, {
Expand Down
30 changes: 0 additions & 30 deletions src/api/resources/attempt/client/requests/AttemptListRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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[];
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/attempt/client/requests/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { AttemptListRequest } from "./AttemptListRequest";
export { type AttemptListRequest } from "./AttemptListRequest";
Loading
Loading