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 Feb 12, 2024
1 parent b34d48b commit 80f815b
Show file tree
Hide file tree
Showing 37 changed files with 2,384 additions and 204 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -16,8 +16,21 @@ jobs:
- name: Compile
run: yarn && yarn build

test:
runs-on: ubuntu-latest

steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up node
uses: actions/setup-node@v3

- name: Compile
run: yarn && yarn test

publish:
needs: [ compile ]
needs: [ compile, test ]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
runs-on: ubuntu-latest

Expand Down
5 changes: 5 additions & 0 deletions jest.config.js
@@ -0,0 +1,5 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
};
8 changes: 6 additions & 2 deletions package.json
@@ -1,14 +1,15 @@
{
"name": "@trycourier/courier",
"version": "v6.0.8",
"version": "v6.1.0",
"private": false,
"repository": "https://github.com/trycourier/courier-node",
"main": "./index.js",
"types": "./index.d.ts",
"scripts": {
"format": "prettier --write 'src/**/*.ts'",
"build": "tsc",
"prepack": "cp -rv dist/. ."
"prepack": "cp -rv dist/. .",
"test": "jest"
},
"dependencies": {
"url-join": "4.0.1",
Expand All @@ -21,6 +22,9 @@
"@types/url-join": "4.0.1",
"@types/qs": "6.9.8",
"@types/node-fetch": "2.6.9",
"jest": "^29.7.0",
"@types/jest": "^29.5.5",
"ts-jest": "^29.1.1",
"@types/node": "17.0.33",
"prettier": "2.7.1",
"typescript": "4.6.4"
Expand Down
2 changes: 1 addition & 1 deletion src/Client.ts
Expand Up @@ -60,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.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/audiences/client/Client.ts
Expand Up @@ -38,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -88,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
body: request,
Expand Down Expand Up @@ -135,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -192,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -254,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/auditEvents/client/Client.ts
Expand Up @@ -47,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -94,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
2 changes: 1 addition & 1 deletion src/api/resources/authTokens/client/Client.ts
Expand Up @@ -46,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.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
4 changes: 2 additions & 2 deletions src/api/resources/automations/client/Client.ts
Expand Up @@ -47,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.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -102,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.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/brands/client/Client.ts
Expand Up @@ -48,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.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -109,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -164,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -212,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -267,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.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
body: request,
Expand Down
10 changes: 5 additions & 5 deletions src/api/resources/bulk/client/Client.ts
Expand Up @@ -46,7 +46,7 @@ export class Bulk {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -107,7 +107,7 @@ export class Bulk {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -160,7 +160,7 @@ export class Bulk {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -217,7 +217,7 @@ export class Bulk {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -272,7 +272,7 @@ export class Bulk {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
37 changes: 11 additions & 26 deletions src/api/resources/lists/client/Client.ts
Expand Up @@ -57,7 +57,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -99,21 +99,7 @@ export class Lists {
* Returns a list based on the list ID provided.
* @throws {@link Courier.NotFoundError}
*/
public async get(
listId: string,
request: Courier.GetListRequest = {},
requestOptions?: Lists.RequestOptions
): Promise<Courier.List> {
const { cursor, pattern } = request;
const _queryParams: Record<string, string | string[]> = {};
if (cursor != null) {
_queryParams["cursor"] = cursor;
}

if (pattern != null) {
_queryParams["pattern"] = pattern;
}

public async get(listId: string, requestOptions?: Lists.RequestOptions): Promise<Courier.List> {
const _response = await (this._options.fetcher ?? core.fetcher)({
url: urlJoin(
(await core.Supplier.get(this._options.environment)) ?? environments.CourierEnvironment.Production,
Expand All @@ -124,10 +110,9 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
maxRetries: requestOptions?.maxRetries,
});
Expand Down Expand Up @@ -180,7 +165,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
body: request,
Expand Down Expand Up @@ -227,7 +212,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -273,7 +258,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down Expand Up @@ -330,7 +315,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
queryParameters: _queryParams,
Expand Down Expand Up @@ -387,7 +372,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
body: request,
Expand Down Expand Up @@ -444,7 +429,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -506,7 +491,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
body: request,
Expand Down Expand Up @@ -554,7 +539,7 @@ export class Lists {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.0.8",
"X-Fern-SDK-Version": "v6.1.0",
},
contentType: "application/json",
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
Expand Down
14 changes: 0 additions & 14 deletions src/api/resources/lists/client/requests/GetListRequest.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/api/resources/lists/client/requests/index.ts
@@ -1,4 +1,3 @@
export { GetAllListsRequest } from "./GetAllListsRequest";
export { GetListRequest } from "./GetListRequest";
export { GetSubscriptionForListRequest } from "./GetSubscriptionForListRequest";
export { SubscribeUserToListRequest } from "./SubscribeUserToListRequest";
7 changes: 0 additions & 7 deletions src/api/resources/lists/types/ListFindByRecipientIdParams.ts

This file was deleted.

0 comments on commit 80f815b

Please sign in to comment.