Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "7.11.0"
".": "7.12.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 117
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-8e7ad3d889c555ff9c381518b627b24b85e3eb7376bdc3689adc7a96ec78e537.yml
openapi_spec_hash: 53b3680aae719487c56efaa782bbe5b2
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-545ac9b590445e90e11113a1bdeb893a94389d69d95e0a7e5c6450bb15f5453a.yml
openapi_spec_hash: 9e243ec62800fb4a2e443eb6481afa30
config_hash: 10bd597dd6cc89023541bc551b6532b8
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 7.12.0 (2026-05-28)

Full Changelog: [v7.11.0...v7.12.0](https://github.com/trycourier/courier-node/compare/v7.11.0...v7.12.0)

### Features

* C-18612 Add Journeys `batch` node variant to OpenAPI spec ([65fb0be](https://github.com/trycourier/courier-node/commit/65fb0be53d35e01a4060f741b2b9db56f4adea72))
* Mark `settings` as required on POST /brands ([2aed30c](https://github.com/trycourier/courier-node/commit/2aed30c8f9c4f085ca777f6ee6dbc6dfbbd0dfd4))

## 7.11.0 (2026-05-19)

Full Changelog: [v7.10.2...v7.11.0](https://github.com/trycourier/courier-node/compare/v7.10.2...v7.11.0)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trycourier/courier",
"version": "7.11.0",
"version": "7.12.0",
"description": "The official TypeScript library for the Courier API",
"author": "Courier <support@courier.com>",
"types": "dist/index.d.ts",
Expand Down
39 changes: 36 additions & 3 deletions src/resources/brands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,56 @@ import { path } from '../internal/utils/path';

export class Brands extends APIResource {
/**
* Create a new brand
* Create a new brand. Requires `name` and `settings` (with at least
* `colors.primary` and `colors.secondary`).
*
* @example
* ```ts
* const brand = await client.brands.create({
* name: 'My Brand',
* settings: {
* colors: { primary: '#9D3789', secondary: '#FFFFFF' },
* },
* });
* ```
*/
create(body: BrandCreateParams, options?: RequestOptions): APIPromise<Brand> {
return this._client.post('/brands', { body, ...options });
}

/**
* Fetch a specific brand by brand ID.
*
* @example
* ```ts
* const brand = await client.brands.retrieve('brand_id');
* ```
*/
retrieve(brandID: string, options?: RequestOptions): APIPromise<Brand> {
return this._client.get(path`/brands/${brandID}`, options);
}

/**
* Replace an existing brand with the supplied values.
*
* @example
* ```ts
* const brand = await client.brands.update('brand_id', {
* name: 'name',
* });
* ```
*/
update(brandID: string, body: BrandUpdateParams, options?: RequestOptions): APIPromise<Brand> {
return this._client.put(path`/brands/${brandID}`, { body, ...options });
}

/**
* Get the list of brands.
*
* @example
* ```ts
* const brands = await client.brands.list();
* ```
*/
list(
query: BrandListParams | null | undefined = {},
Expand All @@ -42,6 +70,11 @@ export class Brands extends APIResource {

/**
* Delete a brand by brand ID.
*
* @example
* ```ts
* await client.brands.delete('brand_id');
* ```
*/
delete(brandID: string, options?: RequestOptions): APIPromise<void> {
return this._client.delete(path`/brands/${brandID}`, {
Expand Down Expand Up @@ -194,9 +227,9 @@ export interface BrandListResponse {
export interface BrandCreateParams {
name: string;

id?: string | null;
settings: BrandSettings;

settings?: BrandSettings | null;
id?: string | null;

snippets?: BrandSnippets | null;
}
Expand Down
70 changes: 70 additions & 0 deletions src/resources/journeys/journeys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,80 @@ export type JourneyNode =
| JourneyAINode
| JourneyThrottleStaticNode
| JourneyThrottleDynamicNode
| JourneyNode.JourneyBatchNode
| JourneyExitNode
| JourneyNode.JourneyBranchNode;

export namespace JourneyNode {
/**
* Collect events arriving at the node into a single batch and fire one downstream
* step with the aggregated payload. The first event into a batch owns the run;
* later contributing events terminate at the batch step. The batch releases when
* any of `max_items` is reached, a quiet window of `wait_period` elapses, or the
* `max_wait_period` ceiling hits.
*/
export interface JourneyBatchNode {
/**
* ISO 8601 duration. Hard ceiling from the first event into the batch; releases
* the batch unconditionally when it elapses.
*/
max_wait_period: string;

/**
* How to select which collected events to retain in the aggregated payload when
* the batch releases.
*/
retain: JourneyBatchNode.Retain;

scope: 'user';

type: 'batch';

/**
* ISO 8601 duration. Quiet window that releases the batch when it elapses with no
* new contributing events. Must be less than `max_wait_period`.
*/
wait_period: string;

id?: string;

/**
* Optional partition key. Events with the same `category_key` are batched
* together; events with different values are batched separately.
*/
category_key?: string;

/**
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
* express "no conditions".
*/
conditions?: JourneysAPI.JourneyConditionsField;

/**
* Releases the batch once this many events have been collected.
*/
max_items?: number;
}

export namespace JourneyBatchNode {
/**
* How to select which collected events to retain in the aggregated payload when
* the batch releases.
*/
export interface Retain {
count: number;

type: 'first' | 'last' | 'highest' | 'lowest';

/**
* Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
* `highest` or `lowest`.
*/
sort_key?: string;
}
}

/**
* Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
* else falls through to `default.nodes`.
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '7.11.0'; // x-release-please-version
export const VERSION = '7.12.0'; // x-release-please-version
11 changes: 7 additions & 4 deletions tests/api-resources/brands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ const client = new Courier({
describe('resource brands', () => {
// Mock server tests are disabled
test.skip('create: only required params', async () => {
const responsePromise = client.brands.create({ name: 'name' });
const responsePromise = client.brands.create({
name: 'My Brand',
settings: {},
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
const response = await responsePromise;
Expand All @@ -23,10 +26,9 @@ describe('resource brands', () => {
// Mock server tests are disabled
test.skip('create: required and optional params', async () => {
const response = await client.brands.create({
name: 'name',
id: 'id',
name: 'My Brand',
settings: {
colors: { primary: 'primary', secondary: 'secondary' },
colors: { primary: '#9D3789', secondary: '#FFFFFF' },
email: {
footer: { content: 'content', inheritDefault: true },
head: { inheritDefault: true, content: 'content' },
Expand Down Expand Up @@ -66,6 +68,7 @@ describe('resource brands', () => {
placement: 'top',
},
},
id: 'id',
snippets: { items: [{ name: 'name', value: 'value' }] },
});
});
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1215,9 +1215,9 @@ baseline-browser-mapping@^2.9.0:
integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==

brace-expansion@^2.0.2:
version "2.1.0"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.0.tgz#4f41a41190216ee36067ec381526fe9539c4f0ae"
integrity sha512-TN1kCZAgdgweJhWWpgKYrQaMNHcDULHkWwQIspdtjV4Y5aurRdZpjAqn6yX3FPqTA9ngHCc4hJxMAMgGfve85w==
version "2.1.1"
resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.1.1.tgz#c68b1c4111c76aae3a6fba55d496cee10c39dad8"
integrity sha512-WR1cURNjuvBLMZBMbqM0UoE+WAfdUcEV1ccD8PVBVOI+Z3ND4+SZbN8RsfT2bMuG1qwz5RFvPukSZm5fF2D5eA==
dependencies:
balanced-match "^1.0.0"

Expand Down
Loading