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 -- April 5, 2024 #184

Closed
wants to merge 1 commit into from
Closed
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.1.0",
"version": "v6.1.1",
"private": false,
"repository": "https://github.com/trycourier/courier-node",
"main": "./index.js",
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
"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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
},
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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
19 changes: 17 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.1.0",
"X-Fern-SDK-Version": "v6.1.1",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down Expand Up @@ -87,6 +87,21 @@ export class Automations {

/**
* Invoke an ad hoc automation run. This endpoint accepts a JSON payload with a series of automation steps. For information about what steps are available, checkout the ad hoc automation guide [here](https://www.courier.com/docs/automations/steps/).
*
* @example
* await courier.automations.invokeAdHocAutomation({
* data: {
* "name": "Foo"
* },
* profile: {
* "tenant_id": "abc-123"
* },
* recipient: "user-yes",
* automation: {
* cancelation_token: "delay-send--user-yes--abc-123",
* steps: []
* }
* })
*/
public async invokeAdHocAutomation(
request: Courier.AutomationAdHocInvokeParams,
Expand All @@ -102,7 +117,7 @@ export class Automations {
Authorization: await this._getAuthorizationHeader(),
"X-Fern-Language": "JavaScript",
"X-Fern-SDK-Name": "@trycourier/courier",
"X-Fern-SDK-Version": "v6.1.0",
"X-Fern-SDK-Version": "v6.1.1",
"Idempotency-Key": requestOptions?.idempotencyKey != null ? requestOptions?.idempotencyKey : undefined,
"X-Idempotency-Expiration":
requestOptions?.idempotencyExpiry != null
Expand Down
7 changes: 7 additions & 0 deletions src/api/resources/automations/types/AccessorType.ts
@@ -0,0 +1,7 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface AccessorType {
$ref: string;
}
@@ -0,0 +1,5 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type AutomationAddToBatchMaxItemsType = string | number;
36 changes: 36 additions & 0 deletions src/api/resources/automations/types/AutomationAddToBatchRetain.ts
@@ -0,0 +1,36 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* Defines what items should be retained and passed along to the next steps when the batch is released
*
* @example
* {
* type: Courier.AutomationAddToBatchRetainType.Highest,
* count: 10,
* sort_key: "refs.data.my_custom_scoring"
* }
*
* @example
* {
* type: Courier.AutomationAddToBatchRetainType.Last,
* count: 10
* }
*/
export interface AutomationAddToBatchRetain {
/**
* Keep N number of notifications based on the type. First/Last N based on notification received.
* highest/lowest based on a scoring key providing in the data accessed by sort_key
*/
type: Courier.AutomationAddToBatchRetainType;
/**
* The number of records to keep in batch. Default is 10 and only configurable by requesting from support.
* When configurable minimum is 2 and maximum is 100.
*/
count: number;
/** Defines the data value data[sort_key] that is used to sort the stored items. Required when type is set to highest or lowest. */
sort_key?: string;
}
@@ -0,0 +1,12 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type AutomationAddToBatchRetainType = "first" | "last" | "highest" | "lowest";

export const AutomationAddToBatchRetainType = {
First: "first",
Last: "last",
Highest: "highest",
Lowest: "lowest",
} as const;
11 changes: 11 additions & 0 deletions src/api/resources/automations/types/AutomationAddToBatchScope.ts
@@ -0,0 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type AutomationAddToBatchScope = "user" | "global" | "dynamic";

export const AutomationAddToBatchScope = {
User: "user",
Global: "global",
Dynamic: "dynamic",
} as const;
41 changes: 41 additions & 0 deletions src/api/resources/automations/types/AutomationAddToBatchStep.ts
@@ -0,0 +1,41 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* @example
* {
* action: "add-to-batch",
* wait_period: "PT5M",
* max_wait_period: "PT1H",
* retain: {
* type: Courier.AutomationAddToBatchRetainType.Highest,
* count: 10,
* sort_key: "refs.data.my_custom_scoring"
* },
* scope: Courier.AutomationAddToBatchScope.User,
* category_key: "refs.data.status"
* }
*/
export interface AutomationAddToBatchStep extends Courier.AutomationStep {
action: "add-to-batch";
/** Defines the period of inactivity before the batch is released. Specified as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) */
wait_period: string;
/** Defines the maximum wait time before the batch should be released. Must be less than wait period. Maximum of 60 days. Specified as an [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) */
max_wait_period: string;
/** If specified, the batch will release as soon as this number is reached */
max_items?: Courier.AutomationAddToBatchMaxItemsType;
retain: Courier.AutomationAddToBatchRetain;
/**
* Determine the scope of the batching. If user, chosen in this order: recipient, profile.user_id, data.user_id, data.userId.
* If dynamic, then specify where the batch_key or a reference to the batch_key
*/
scope?: Courier.AutomationAddToBatchScope;
/** If using scope=dynamic, provide the key or a reference (e.g., refs.data.batch_key) */
batch_key?: string;
batch_id?: string;
/** Defines the field of the data object the batch is set to when complete. Defaults to `batch` */
category_key?: string;
}
18 changes: 18 additions & 0 deletions src/api/resources/automations/types/AutomationAddToDigestStep.ts
@@ -0,0 +1,18 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* @example
* {
* action: "add-to-digest",
* subscription_topic_id: "RAJE97CMT04KDJJ88ZDS2TP1690S"
* }
*/
export interface AutomationAddToDigestStep extends Courier.AutomationStep {
action: "add-to-digest";
/** The subscription topic that has digests enabled */
subscription_topic_id: string;
}
3 changes: 3 additions & 0 deletions src/api/resources/automations/types/AutomationDelayStep.ts
Expand Up @@ -6,5 +6,8 @@ import * as Courier from "../../..";

export interface AutomationDelayStep extends Courier.AutomationStep {
action: "delay";
/** The [ISO 8601 duration](https://en.wikipedia.org/wiki/ISO_8601#Durations) string for how long to delay for */
duration?: string;
/** The ISO 8601 timestamp for when the delay should end */
until?: string;
}
33 changes: 33 additions & 0 deletions src/api/resources/automations/types/AutomationFetchDataStep.ts
@@ -0,0 +1,33 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

/**
* @example
* {
* action: "fetch-data",
* merge_strategy: Courier.MergeAlgorithm.None,
* webhook: {
* body: {
* "foo": "bar"
* },
* params: {
* "hello": "world"
* },
* headers: {
* "content-type": "application/json"
* },
* method: Courier.AutomationFetchDataWebhookMethod.Post,
* url: "https://bryan-at-courier.free.beeceptor.com"
* }
* }
*/
export interface AutomationFetchDataStep extends Courier.AutomationStep {
action: "fetch-data";
webhook: Courier.AutomationFetchDataWebhook;
merge_strategy: Courier.MergeAlgorithm;
idempotency_expiry?: string;
idempotency_key?: string;
}
13 changes: 13 additions & 0 deletions src/api/resources/automations/types/AutomationFetchDataWebhook.ts
@@ -0,0 +1,13 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

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

export interface AutomationFetchDataWebhook {
body?: Record<string, any>;
headers?: Record<string, any>;
params?: Record<string, any>;
method: Courier.AutomationFetchDataWebhookMethod;
url: string;
}
@@ -0,0 +1,10 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type AutomationFetchDataWebhookMethod = "GET" | "POST";

export const AutomationFetchDataWebhookMethod = {
Get: "GET",
Post: "POST",
} as const;
14 changes: 0 additions & 14 deletions src/api/resources/automations/types/AutomationStepAction.ts

This file was deleted.

4 changes: 4 additions & 0 deletions src/api/resources/automations/types/AutomationStepOption.ts
Expand Up @@ -5,8 +5,12 @@
import * as Courier from "../../..";

export type AutomationStepOption =
| Courier.AutomationAddToDigestStep
| Courier.AutomationAddToBatchStep
| Courier.AutomationThrottleStep
| Courier.AutomationCancelStep
| Courier.AutomationDelayStep
| Courier.AutomationFetchDataStep
| Courier.AutomationInvokeStep
| Courier.AutomationSendStep
| Courier.AutomationV2SendStep
Expand Down
@@ -0,0 +1,8 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export interface AutomationThrottleOnThrottle {
/** The node to go to if the request is throttled */
$node_id: string;
}
11 changes: 11 additions & 0 deletions src/api/resources/automations/types/AutomationThrottleScope.ts
@@ -0,0 +1,11 @@
/**
* This file was auto-generated by Fern from our API Definition.
*/

export type AutomationThrottleScope = "user" | "global" | "dynamic";

export const AutomationThrottleScope = {
User: "user",
Global: "global",
Dynamic: "dynamic",
} as const;