Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 18, 2024
1 parent 0a885c5 commit 3a6e7bc
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion src/api/resources/audiences/client/Client.ts
Expand Up @@ -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<void> {
const _response = await core.fetcher({
Expand Down
1 change: 1 addition & 0 deletions src/api/resources/brands/types/BrandSettings.ts
Expand Up @@ -6,5 +6,6 @@ import * as Courier from "../../..";

export interface BrandSettings {
colors?: Courier.BrandColors;
inapp?: any;
email?: Courier.Email;
}
2 changes: 1 addition & 1 deletion src/api/resources/bulk/client/Client.ts
Expand Up @@ -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: {
Expand Down
4 changes: 3 additions & 1 deletion src/api/resources/commons/types/ChannelClassification.ts
Expand Up @@ -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;
2 changes: 1 addition & 1 deletion src/api/resources/messages/client/Client.ts
Expand Up @@ -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: {
Expand Down
Expand Up @@ -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(
Expand Down
Expand Up @@ -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;
Expand Down
Expand Up @@ -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;
Expand Down
27 changes: 15 additions & 12 deletions src/core/fetcher/Fetcher.ts
Expand Up @@ -119,18 +119,21 @@ async function fetcherImpl<R = unknown>(args: Fetcher.Args): Promise<APIResponse
body = await response.blob();
} else if (response.body != null && args.responseType === "streaming") {
body = response.body;
} else if (response.body != null) {
try {
body = await response.json();
} catch (err) {
return {
ok: false,
error: {
reason: "non-json",
statusCode: response.status,
rawBody: await response.text(),
},
};
} else {
const text = await response.text();
if (text.length > 0) {
try {
body = JSON.parse(text);
} catch (err) {
return {
ok: false,
error: {
reason: "non-json",
statusCode: response.status,
rawBody: text,
},
};
}
}
}

Expand Down

0 comments on commit 3a6e7bc

Please sign in to comment.