Skip to content

Commit

Permalink
🌿 Fern Regeneration -- updates to tenants, brands, and `notificat…
Browse files Browse the repository at this point in the history
…ions` resources (#167)

* SDK regeneration

* update README

* typos

* remove note that v6 is unstable

* update userPreferences -> users.preferences

---------

Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com>
Co-authored-by: dsinghvi <dsinghvi@umich.edu>
  • Loading branch information
fern-api[bot] and dsinghvi committed Jan 3, 2024
1 parent 5fd5d50 commit 67ccdd4
Show file tree
Hide file tree
Showing 143 changed files with 1,900 additions and 462 deletions.
222 changes: 112 additions & 110 deletions README.md

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "@trycourier/courier",
"version": "6.0.1",
"version": "v6.0.2",
"private": false,
"repository": "https://github.com/trycourier/courier-node",
"main": "./index.js",
Expand All @@ -12,13 +12,15 @@
},
"dependencies": {
"url-join": "4.0.1",
"@types/url-join": "4.0.1",
"axios": "0.27.2",
"form-data": "4.0.0",
"node-fetch": "2.7.0",
"qs": "6.11.2",
"@types/qs": "6.9.8",
"js-base64": "3.7.2"
},
"devDependencies": {
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
Expand Down
28 changes: 14 additions & 14 deletions src/Client.ts
Expand Up @@ -15,17 +15,17 @@ import { Brands } from "./api/resources/brands/client/Client";
import { Bulk } from "./api/resources/bulk/client/Client";
import { Lists } from "./api/resources/lists/client/Client";
import { Messages } from "./api/resources/messages/client/Client";
import { Notifications } from "./api/resources/notifications/client/Client";
import { Profiles } from "./api/resources/profiles/client/Client";
import { Templates } from "./api/resources/templates/client/Client";
import { Tenants } from "./api/resources/tenants/client/Client";
import { TokenManagement } from "./api/resources/tokenManagement/client/Client";
import { Translations } from "./api/resources/translations/client/Client";
import { UserPreferences } from "./api/resources/userPreferences/client/Client";
import { Users } from "./api/resources/users/client/Client";

export declare namespace CourierClient {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken: core.Supplier<core.BearerToken | undefined>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
}

interface RequestOptions {
Expand All @@ -40,7 +40,7 @@ export declare namespace CourierClient {
}

export class CourierClient {
constructor(protected readonly _options: CourierClient.Options) {}
constructor(protected readonly _options: CourierClient.Options = {}) {}

/**
* Use the send API to send a message to one or more recipients.
Expand All @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -145,6 +145,12 @@ export class CourierClient {
return (this._messages ??= new Messages(this._options));
}

protected _notifications: Notifications | undefined;

public get notifications(): Notifications {
return (this._notifications ??= new Notifications(this._options));
}

protected _profiles: Profiles | undefined;

public get profiles(): Profiles {
Expand All @@ -163,22 +169,16 @@ export class CourierClient {
return (this._tenants ??= new Tenants(this._options));
}

protected _tokenManagement: TokenManagement | undefined;

public get tokenManagement(): TokenManagement {
return (this._tokenManagement ??= new TokenManagement(this._options));
}

protected _translations: Translations | undefined;

public get translations(): Translations {
return (this._translations ??= new Translations(this._options));
}

protected _userPreferences: UserPreferences | undefined;
protected _users: Users | undefined;

public get userPreferences(): UserPreferences {
return (this._userPreferences ??= new UserPreferences(this._options));
public get users(): Users {
return (this._users ??= new Users(this._options));
}

protected async _getAuthorizationHeader() {
Expand Down
24 changes: 12 additions & 12 deletions src/api/resources/audiences/client/Client.ts
Expand Up @@ -11,7 +11,7 @@ import * as errors from "../../../../errors";
export declare namespace Audiences {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken: core.Supplier<core.BearerToken | undefined>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
}

interface RequestOptions {
Expand All @@ -21,7 +21,7 @@ export declare namespace Audiences {
}

export class Audiences {
constructor(protected readonly _options: Audiences.Options) {}
constructor(protected readonly _options: Audiences.Options = {}) {}

/**
* Returns the specified audience by id.
Expand All @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -74,9 +74,9 @@ export class Audiences {
*/
public async update(
audienceId: string,
request: Courier.AudienceRequest,
request: Courier.AudienceUpdateParams = {},
requestOptions?: Audiences.RequestOptions
): Promise<Courier.Audience> {
): Promise<Courier.AudienceUpdateResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
Expand All @@ -87,15 +87,15 @@ export class Audiences {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
body: request,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return _response.body as Courier.Audience;
return _response.body as Courier.AudienceUpdateResponse;
}

if (_response.error.reason === "status-code") {
Expand Down Expand Up @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -172,7 +172,7 @@ export class Audiences {
*/
public async listMembers(
audienceId: string,
request: Courier.ListAudienceMembersRequest = {},
request: Courier.AudienceMembersListParams = {},
requestOptions?: Audiences.RequestOptions
): Promise<Courier.AudienceMemberListResponse> {
const { cursor } = request;
Expand All @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -234,7 +234,7 @@ export class Audiences {
* @throws {@link Courier.BadRequestError}
*/
public async listAudiences(
request: Courier.ListAudiencesRequest = {},
request: Courier.AudiencesListParams = {},
requestOptions?: Audiences.RequestOptions
): Promise<Courier.AudienceListResponse> {
const { cursor } = request;
Expand All @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
Expand Up @@ -2,10 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface ListAudienceMembersRequest {
export interface AudienceMembersListParams {
/**
* A unique identifier that allows for fetching the next set of members
*
*/
cursor?: string;
}
Expand Up @@ -2,11 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

import * as Courier from "../../..";
import * as Courier from "../../../..";

export interface AudienceRequest {
/** A unique identifier representing the audience_id */
id?: string;
export interface AudienceUpdateParams {
/** The name of the audience */
name?: string;
/** A description of the audience */
Expand Down
Expand Up @@ -2,10 +2,9 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface ListAudiencesRequest {
export interface AudiencesListParams {
/**
* A unique identifier that allows for fetching the next set of audiences
*
*/
cursor?: string;
}
5 changes: 3 additions & 2 deletions src/api/resources/audiences/client/requests/index.ts
@@ -1,2 +1,3 @@
export { ListAudienceMembersRequest } from "./ListAudienceMembersRequest";
export { ListAudiencesRequest } from "./ListAudiencesRequest";
export { AudienceUpdateParams } from "./AudienceUpdateParams";
export { AudienceMembersListParams } from "./AudienceMembersListParams";
export { AudiencesListParams } from "./AudiencesListParams";
Expand Up @@ -4,6 +4,6 @@

import * as Courier from "../../..";

export interface AudiencePutResponse {
export interface AudienceUpdateResponse {
audience: Courier.Audience;
}
5 changes: 1 addition & 4 deletions src/api/resources/audiences/types/BaseFilterConfig.ts
Expand Up @@ -5,9 +5,6 @@
import * as Courier from "../../..";

export interface BaseFilterConfig {
/**
* The operator to use for filtering
*
*/
/** The operator to use for filtering */
operator: Courier.Operator;
}
3 changes: 1 addition & 2 deletions src/api/resources/audiences/types/index.ts
@@ -1,4 +1,3 @@
export * from "./AudienceRequest";
export * from "./Filter";
export * from "./Operator";
export * from "./BaseFilterConfig";
Expand All @@ -12,4 +11,4 @@ export * from "./AudienceMember";
export * from "./AudienceListResponse";
export * from "./AudienceMemberGetResponse";
export * from "./AudienceMemberListResponse";
export * from "./AudiencePutResponse";
export * from "./AudienceUpdateResponse";
8 changes: 4 additions & 4 deletions src/api/resources/auditEvents/client/Client.ts
Expand Up @@ -11,7 +11,7 @@ import * as errors from "../../../../errors";
export declare namespace AuditEvents {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken: core.Supplier<core.BearerToken | undefined>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
}

interface RequestOptions {
Expand All @@ -21,7 +21,7 @@ export declare namespace AuditEvents {
}

export class AuditEvents {
constructor(protected readonly _options: AuditEvents.Options) {}
constructor(protected readonly _options: AuditEvents.Options = {}) {}

/**
* Fetch the list of audit events
Expand All @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
Expand Up @@ -5,7 +5,6 @@
export interface ListAuditEventsRequest {
/**
* A unique identifier that allows for fetching the next set of audit events.
*
*/
cursor?: string;
}
12 changes: 6 additions & 6 deletions src/api/resources/authTokens/client/Client.ts
Expand Up @@ -11,7 +11,7 @@ import * as errors from "../../../../errors";
export declare namespace AuthTokens {
interface Options {
environment?: core.Supplier<environments.CourierEnvironment | string>;
authorizationToken: core.Supplier<core.BearerToken | undefined>;
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
}

interface RequestOptions {
Expand All @@ -26,15 +26,15 @@ export declare namespace AuthTokens {
}

export class AuthTokens {
constructor(protected readonly _options: AuthTokens.Options) {}
constructor(protected readonly _options: AuthTokens.Options = {}) {}

/**
* Returns a new access token.
*/
public async issueToken(
request: Courier.AuthIssueTokenParameters,
request: Courier.IssueTokenParams,
requestOptions?: AuthTokens.IdempotentRequestOptions
): Promise<Courier.AuthIssueTokenResponse> {
): Promise<Courier.IssueTokenResponse> {
const _response = await core.fetcher({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
Expand All @@ -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": "6.0.1",
"X-Fern-SDK-Version": "v6.0.2",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand All @@ -58,7 +58,7 @@ export class AuthTokens {
maxRetries: requestOptions?.maxRetries,
});
if (_response.ok) {
return _response.body as Courier.AuthIssueTokenResponse;
return _response.body as Courier.IssueTokenResponse;
}

if (_response.error.reason === "status-code") {
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/authTokens/client/index.ts
@@ -1 +1 @@
export {};
export * from "./requests";
Expand Up @@ -2,7 +2,7 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface AuthIssueTokenParameters {
export interface IssueTokenParams {
scope: string;
expiresIn: string;
expires_in: string;
}
1 change: 1 addition & 0 deletions src/api/resources/authTokens/client/requests/index.ts
@@ -0,0 +1 @@
export { IssueTokenParams } from "./IssueTokenParams";
Expand Up @@ -2,6 +2,6 @@
* This file was auto-generated by Fern from our API Definition.
*/

export interface AuthIssueTokenResponse {
export interface IssueTokenResponse {
token?: string;
}
3 changes: 1 addition & 2 deletions src/api/resources/authTokens/types/index.ts
@@ -1,2 +1 @@
export * from "./AuthIssueTokenParameters";
export * from "./AuthIssueTokenResponse";
export * from "./IssueTokenResponse";

0 comments on commit 67ccdd4

Please sign in to comment.