diff --git a/src/api/resources/audiences/client/Client.ts b/src/api/resources/audiences/client/Client.ts index 1854e9b..103fdaf 100644 --- a/src/api/resources/audiences/client/Client.ts +++ b/src/api/resources/audiences/client/Client.ts @@ -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({ 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..e86cede 100644 --- a/src/api/resources/bulk/client/Client.ts +++ b/src/api/resources/bulk/client/Client.ts @@ -209,7 +209,7 @@ 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: { 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/messages/client/Client.ts b/src/api/resources/messages/client/Client.ts index 61532fb..9a1c202 100644 --- a/src/api/resources/messages/client/Client.ts +++ b/src/api/resources/messages/client/Client.ts @@ -372,7 +372,7 @@ 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: { diff --git a/src/api/resources/users/resources/preferences/client/Client.ts b/src/api/resources/users/resources/preferences/client/Client.ts index 3251de0..02963b0 100644 --- a/src/api/resources/users/resources/preferences/client/Client.ts +++ b/src/api/resources/users/resources/preferences/client/Client.ts @@ -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( 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/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, + }, + }; + } } }