From 12acca8e68a1084437a85f635638770850885888 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Thu, 18 Jan 2024 22:17:45 +0000 Subject: [PATCH] SDK regeneration --- package.json | 2 +- src/Client.ts | 2 +- src/api/resources/audiences/client/Client.ts | 12 ++++----- .../resources/auditEvents/client/Client.ts | 4 +-- src/api/resources/authTokens/client/Client.ts | 2 +- .../resources/automations/client/Client.ts | 4 +-- src/api/resources/brands/client/Client.ts | 10 +++---- .../resources/brands/types/BrandSettings.ts | 1 + src/api/resources/bulk/client/Client.ts | 12 ++++----- .../commons/types/ChannelClassification.ts | 4 ++- src/api/resources/lists/client/Client.ts | 20 +++++++------- src/api/resources/messages/client/Client.ts | 14 +++++----- .../resources/notifications/client/Client.ts | 16 +++++------ src/api/resources/profiles/client/Client.ts | 14 +++++----- src/api/resources/templates/client/Client.ts | 2 +- src/api/resources/tenants/client/Client.ts | 8 +++--- .../resources/translations/client/Client.ts | 4 +-- .../resources/preferences/client/Client.ts | 8 +++--- .../requests/UserPreferencesUpdateParams.ts | 2 +- .../preferences/types/TopicPreference.ts | 2 +- .../users/resources/tenants/client/Client.ts | 8 +++--- .../users/resources/tokens/client/Client.ts | 10 +++---- src/core/fetcher/Fetcher.ts | 27 ++++++++++--------- 23 files changed, 97 insertions(+), 91 deletions(-) diff --git a/package.json b/package.json index 9e77b3b..e267cf8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@trycourier/courier", - "version": "v6.0.4", + "version": "v6.0.5", "private": false, "repository": "https://github.com/trycourier/courier-node", "main": "./index.js", diff --git a/src/Client.ts b/src/Client.ts index 3b46983..be38f50 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -59,7 +59,7 @@ export class CourierClient { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null diff --git a/src/api/resources/audiences/client/Client.ts b/src/api/resources/audiences/client/Client.ts index 1854e9b..6c35bc3 100644 --- a/src/api/resources/audiences/client/Client.ts +++ b/src/api/resources/audiences/client/Client.ts @@ -37,7 +37,7 @@ export class Audiences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -87,7 +87,7 @@ export class Audiences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -121,7 +121,7 @@ export class Audiences { } /** - * Deletes the specified recipient Profile. + * Deletes the specified audience. */ public async delete(audienceId: string, requestOptions?: Audiences.RequestOptions): Promise { const _response = await core.fetcher({ @@ -134,7 +134,7 @@ export class Audiences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -191,7 +191,7 @@ export class Audiences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -253,7 +253,7 @@ export class Audiences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, diff --git a/src/api/resources/auditEvents/client/Client.ts b/src/api/resources/auditEvents/client/Client.ts index d9f7758..3d1a6d9 100644 --- a/src/api/resources/auditEvents/client/Client.ts +++ b/src/api/resources/auditEvents/client/Client.ts @@ -46,7 +46,7 @@ export class AuditEvents { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -93,7 +93,7 @@ export class AuditEvents { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/authTokens/client/Client.ts b/src/api/resources/authTokens/client/Client.ts index 61dd005..a46a544 100644 --- a/src/api/resources/authTokens/client/Client.ts +++ b/src/api/resources/authTokens/client/Client.ts @@ -45,7 +45,7 @@ export class AuthTokens { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null diff --git a/src/api/resources/automations/client/Client.ts b/src/api/resources/automations/client/Client.ts index 0ff8957..6ce58d6 100644 --- a/src/api/resources/automations/client/Client.ts +++ b/src/api/resources/automations/client/Client.ts @@ -46,7 +46,7 @@ export class Automations { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -101,7 +101,7 @@ export class Automations { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null diff --git a/src/api/resources/brands/client/Client.ts b/src/api/resources/brands/client/Client.ts index 28f408a..c632a0f 100644 --- a/src/api/resources/brands/client/Client.ts +++ b/src/api/resources/brands/client/Client.ts @@ -47,7 +47,7 @@ export class Brands { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -108,7 +108,7 @@ export class Brands { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -163,7 +163,7 @@ export class Brands { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -211,7 +211,7 @@ export class Brands { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -266,7 +266,7 @@ export class Brands { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, diff --git a/src/api/resources/brands/types/BrandSettings.ts b/src/api/resources/brands/types/BrandSettings.ts index 7c06ba8..c929263 100644 --- a/src/api/resources/brands/types/BrandSettings.ts +++ b/src/api/resources/brands/types/BrandSettings.ts @@ -6,5 +6,6 @@ import * as Courier from "../../.."; export interface BrandSettings { colors?: Courier.BrandColors; + inapp?: any; email?: Courier.Email; } diff --git a/src/api/resources/bulk/client/Client.ts b/src/api/resources/bulk/client/Client.ts index 7baff41..f217baf 100644 --- a/src/api/resources/bulk/client/Client.ts +++ b/src/api/resources/bulk/client/Client.ts @@ -45,7 +45,7 @@ export class Bulk { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -106,7 +106,7 @@ export class Bulk { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -159,7 +159,7 @@ export class Bulk { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -209,14 +209,14 @@ export class Bulk { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production, - `/bulk/${jobId}/run` + `/bulk/${jobId}` ), method: "GET", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -271,7 +271,7 @@ export class Bulk { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/commons/types/ChannelClassification.ts b/src/api/resources/commons/types/ChannelClassification.ts index 21984cc..5b3a155 100644 --- a/src/api/resources/commons/types/ChannelClassification.ts +++ b/src/api/resources/commons/types/ChannelClassification.ts @@ -2,11 +2,13 @@ * This file was auto-generated by Fern from our API Definition. */ -export type ChannelClassification = "direct_message" | "email" | "push" | "sms"; +export type ChannelClassification = "direct_message" | "email" | "push" | "sms" | "webhook" | "inbox"; export const ChannelClassification = { DirectMessage: "direct_message", Email: "email", Push: "push", Sms: "sms", + Webhook: "webhook", + Inbox: "inbox", } as const; diff --git a/src/api/resources/lists/client/Client.ts b/src/api/resources/lists/client/Client.ts index e6feee7..c1d010a 100644 --- a/src/api/resources/lists/client/Client.ts +++ b/src/api/resources/lists/client/Client.ts @@ -56,7 +56,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -123,7 +123,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -179,7 +179,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -226,7 +226,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -272,7 +272,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -329,7 +329,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -386,7 +386,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -443,7 +443,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -505,7 +505,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -553,7 +553,7 @@ export class Lists { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/messages/client/Client.ts b/src/api/resources/messages/client/Client.ts index 61532fb..f5292df 100644 --- a/src/api/resources/messages/client/Client.ts +++ b/src/api/resources/messages/client/Client.ts @@ -103,7 +103,7 @@ export class Messages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -152,7 +152,7 @@ export class Messages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -208,7 +208,7 @@ export class Messages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -271,7 +271,7 @@ export class Messages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -329,7 +329,7 @@ export class Messages { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -372,14 +372,14 @@ export class Messages { const _response = await core.fetcher({ url: urlJoin( (await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production, - `messages/${requestId}/output` + `requests/${requestId}/archive` ), method: "PUT", headers: { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/notifications/client/Client.ts b/src/api/resources/notifications/client/Client.ts index 56f6dcd..4acfd5b 100644 --- a/src/api/resources/notifications/client/Client.ts +++ b/src/api/resources/notifications/client/Client.ts @@ -43,7 +43,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -90,7 +90,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -136,7 +136,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -183,7 +183,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -231,7 +231,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -279,7 +279,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -327,7 +327,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -375,7 +375,7 @@ export class Notifications { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/profiles/client/Client.ts b/src/api/resources/profiles/client/Client.ts index 59ec98b..bffe1eb 100644 --- a/src/api/resources/profiles/client/Client.ts +++ b/src/api/resources/profiles/client/Client.ts @@ -43,7 +43,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -99,7 +99,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -164,7 +164,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -217,7 +217,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -279,7 +279,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, @@ -336,7 +336,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", "Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined, "X-Idempotency-Expiration": requestOptions?.idempotencyExpiry != null @@ -397,7 +397,7 @@ export class Profiles { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/templates/client/Client.ts b/src/api/resources/templates/client/Client.ts index c2d9824..0773af6 100644 --- a/src/api/resources/templates/client/Client.ts +++ b/src/api/resources/templates/client/Client.ts @@ -46,7 +46,7 @@ export class Templates { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, diff --git a/src/api/resources/tenants/client/Client.ts b/src/api/resources/tenants/client/Client.ts index 9be91a9..173f212 100644 --- a/src/api/resources/tenants/client/Client.ts +++ b/src/api/resources/tenants/client/Client.ts @@ -41,7 +41,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -93,7 +93,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -141,7 +141,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -184,7 +184,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/api/resources/translations/client/Client.ts b/src/api/resources/translations/client/Client.ts index ce0dc13..12f0b64 100644 --- a/src/api/resources/translations/client/Client.ts +++ b/src/api/resources/translations/client/Client.ts @@ -38,7 +38,7 @@ export class Translations { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -95,7 +95,7 @@ export class Translations { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, diff --git a/src/api/resources/users/resources/preferences/client/Client.ts b/src/api/resources/users/resources/preferences/client/Client.ts index 3251de0..1ef6579 100644 --- a/src/api/resources/users/resources/preferences/client/Client.ts +++ b/src/api/resources/users/resources/preferences/client/Client.ts @@ -41,7 +41,7 @@ export class Preferences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -97,7 +97,7 @@ export class Preferences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -135,7 +135,7 @@ export class Preferences { } /** - * Fetch user preferences for a specific subscription topic. + * Update or Create user preferences for a specific subscription topic. * @throws {@link Courier.BadRequestError} */ public async update( @@ -154,7 +154,7 @@ export class Preferences { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, diff --git a/src/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.ts b/src/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.ts index 5d61517..115d092 100644 --- a/src/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.ts +++ b/src/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.ts @@ -6,7 +6,7 @@ import * as Courier from "../../../../../.."; export interface UserPreferencesUpdateParams { status: Courier.PreferenceStatus; - /** Should contain unique items. */ + /** The Channels a user has chosen to receive notifications through for this topic */ custom_routing?: Courier.ChannelClassification[]; default_status: Courier.PreferenceStatus; has_custom_routing?: boolean; diff --git a/src/api/resources/users/resources/preferences/types/TopicPreference.ts b/src/api/resources/users/resources/preferences/types/TopicPreference.ts index c7a28e2..a995b87 100644 --- a/src/api/resources/users/resources/preferences/types/TopicPreference.ts +++ b/src/api/resources/users/resources/preferences/types/TopicPreference.ts @@ -5,7 +5,7 @@ import * as Courier from "../../../../.."; export interface TopicPreference { - /** Should contain unique items. */ + /** The Channels a user has chosen to receive notifications through for this topic */ custom_routing?: Courier.ChannelClassification[]; default_status: Courier.PreferenceStatus; has_custom_routing?: boolean; diff --git a/src/api/resources/users/resources/tenants/client/Client.ts b/src/api/resources/users/resources/tenants/client/Client.ts index b48574e..222bd01 100644 --- a/src/api/resources/users/resources/tenants/client/Client.ts +++ b/src/api/resources/users/resources/tenants/client/Client.ts @@ -45,7 +45,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -101,7 +101,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -148,7 +148,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -208,7 +208,7 @@ export class Tenants { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", queryParameters: _queryParams, diff --git a/src/api/resources/users/resources/tokens/client/Client.ts b/src/api/resources/users/resources/tokens/client/Client.ts index 183410e..ef2a66b 100644 --- a/src/api/resources/users/resources/tokens/client/Client.ts +++ b/src/api/resources/users/resources/tokens/client/Client.ts @@ -38,7 +38,7 @@ export class Tokens { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -95,7 +95,7 @@ export class Tokens { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -153,7 +153,7 @@ export class Tokens { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", body: request, @@ -210,7 +210,7 @@ export class Tokens { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, @@ -265,7 +265,7 @@ export class Tokens { Authorization: await this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@trycourier/courier", - "X-Fern-SDK-Version": "v6.0.4", + "X-Fern-SDK-Version": "v6.0.5", }, contentType: "application/json", timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000, diff --git a/src/core/fetcher/Fetcher.ts b/src/core/fetcher/Fetcher.ts index e25819a..e5a6fa3 100644 --- a/src/core/fetcher/Fetcher.ts +++ b/src/core/fetcher/Fetcher.ts @@ -119,18 +119,21 @@ async function fetcherImpl(args: Fetcher.Args): Promise 0) { + try { + body = JSON.parse(text); + } catch (err) { + return { + ok: false, + error: { + reason: "non-json", + statusCode: response.status, + rawBody: text, + }, + }; + } } }