Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🌿 Fern Regeneration -- February 2, 2024 #180

Merged
merged 1 commit into from Feb 2, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@trycourier/courier",
"version": "v6.0.7",
"version": "v6.0.8",
"private": false,
"repository": "https://github.com/trycourier/courier-node",
"main": "./index.js",
Expand Down
5 changes: 3 additions & 2 deletions src/Client.ts
Expand Up @@ -26,6 +26,7 @@ export declare namespace CourierClient {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}

interface RequestOptions {
Expand All @@ -49,7 +50,7 @@ export class CourierClient {
request: Courier.SendMessageRequest,
requestOptions?: CourierClient.IdempotentRequestOptions
): Promise<Courier.SendMessageResponse> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/send"
Expand All @@ -59,7 +60,7 @@ export class CourierClient {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
21 changes: 11 additions & 10 deletions src/api/resources/audiences/client/Client.ts
Expand Up @@ -12,6 +12,7 @@ export declare namespace Audiences {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}

interface RequestOptions {
Expand All @@ -27,7 +28,7 @@ export class Audiences {
* Returns the specified audience by id.
*/
public async get(audienceId: string, requestOptions?: Audiences.RequestOptions): Promise<Courier.Audience> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/audiences/${audienceId}`
Expand All @@ -37,7 +38,7 @@ export class Audiences {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -77,7 +78,7 @@ export class Audiences {
request: Courier.AudienceUpdateParams = {},
requestOptions?: Audiences.RequestOptions
): Promise<Courier.AudienceUpdateResponse> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/audiences/${audienceId}`
Expand All @@ -87,7 +88,7 @@ export class Audiences {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
body: request,
Expand Down Expand Up @@ -124,7 +125,7 @@ export class Audiences {
* Deletes the specified audience.
*/
public async delete(audienceId: string, requestOptions?: Audiences.RequestOptions): Promise<void> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/audiences/${audienceId}`
Expand All @@ -134,7 +135,7 @@ export class Audiences {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -181,7 +182,7 @@ export class Audiences {
_queryParams["cursor"] = cursor;
}

const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/audiences/${audienceId}/members`
Expand All @@ -191,7 +192,7 @@ export class Audiences {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -243,7 +244,7 @@ export class Audiences {
_queryParams["cursor"] = cursor;
}

const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/audiences"
Expand All @@ -253,7 +254,7 @@ export class Audiences {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
9 changes: 5 additions & 4 deletions src/api/resources/auditEvents/client/Client.ts
Expand Up @@ -12,6 +12,7 @@ export declare namespace AuditEvents {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}

interface RequestOptions {
Expand All @@ -36,7 +37,7 @@ export class AuditEvents {
_queryParams["cursor"] = cursor;
}

const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/audit-events"
Expand All @@ -46,7 +47,7 @@ export class AuditEvents {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -83,7 +84,7 @@ export class AuditEvents {
* Fetch a specific audit event by ID.
*/
public async get(auditEventId: string, requestOptions?: AuditEvents.RequestOptions): Promise<Courier.AuditEvent> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/audit-events/${auditEventId}`
Expand All @@ -93,7 +94,7 @@ export class AuditEvents {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
5 changes: 3 additions & 2 deletions src/api/resources/authTokens/client/Client.ts
Expand Up @@ -12,6 +12,7 @@ export declare namespace AuthTokens {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}

interface RequestOptions {
Expand All @@ -35,7 +36,7 @@ export class AuthTokens {
request: Courier.IssueTokenParams,
requestOptions?: AuthTokens.IdempotentRequestOptions
): Promise<Courier.IssueTokenResponse> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/auth/issue-token"
Expand All @@ -45,7 +46,7 @@ export class AuthTokens {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
9 changes: 5 additions & 4 deletions src/api/resources/automations/client/Client.ts
Expand Up @@ -12,6 +12,7 @@ export declare namespace Automations {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}

interface RequestOptions {
Expand All @@ -36,7 +37,7 @@ export class Automations {
request: Courier.AutomationInvokeParams,
requestOptions?: Automations.IdempotentRequestOptions
): Promise<Courier.AutomationInvokeResponse> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/automations/${templateId}/invoke`
Expand All @@ -46,7 +47,7 @@ export class Automations {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -91,7 +92,7 @@ export class Automations {
request: Courier.AutomationAdHocInvokeParams,
requestOptions?: Automations.IdempotentRequestOptions
): Promise<Courier.AutomationInvokeResponse> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/automations/invoke"
Expand All @@ -101,7 +102,7 @@ export class Automations {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
21 changes: 11 additions & 10 deletions src/api/resources/brands/client/Client.ts
Expand Up @@ -12,6 +12,7 @@ export declare namespace Brands {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
fetcher?: core.FetchFunction;
}

interface RequestOptions {
Expand All @@ -37,7 +38,7 @@ export class Brands {
request: Courier.BrandParameters,
requestOptions?: Brands.IdempotentRequestOptions
): Promise<Courier.Brand> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/brands"
Expand All @@ -47,7 +48,7 @@ export class Brands {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -98,7 +99,7 @@ export class Brands {
* Fetch a specific brand by brand ID.
*/
public async get(brandId: string, requestOptions?: Brands.RequestOptions): Promise<Courier.Brand> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/brands/${brandId}`
Expand All @@ -108,7 +109,7 @@ export class Brands {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -153,7 +154,7 @@ export class Brands {
_queryParams["cursor"] = cursor;
}

const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
"/brands"
Expand All @@ -163,7 +164,7 @@ export class Brands {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -201,7 +202,7 @@ export class Brands {
* @throws {@link Courier.ConflictError}
*/
public async delete(brandId: string, requestOptions?: Brands.RequestOptions): Promise<void> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/brands/${brandId}`
Expand All @@ -211,7 +212,7 @@ export class Brands {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -256,7 +257,7 @@ export class Brands {
request: Courier.BrandUpdateParameters,
requestOptions?: Brands.RequestOptions
): Promise<Courier.Brand> {
const _response = await core.fetcher({
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
`/brands/${brandId}`
Expand All @@ -266,7 +267,7 @@ export class Brands {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.7",
"X-Fern-SDK-Version": "v6.0.8",
},
contentType: "application/json",
body: request,
Expand Down