Skip to content

Commit 00d92b5

Browse files
release: 7.12.0 (#237)
* feat: Mark `settings` as required on POST /brands * feat: C-18612 Add Journeys `batch` node variant to OpenAPI spec * release: 7.12.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 0068c2f commit 00d92b5

9 files changed

Lines changed: 130 additions & 15 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "7.11.0"
2+
".": "7.12.0"
33
}

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 117
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-8e7ad3d889c555ff9c381518b627b24b85e3eb7376bdc3689adc7a96ec78e537.yml
3-
openapi_spec_hash: 53b3680aae719487c56efaa782bbe5b2
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/courier/courier-545ac9b590445e90e11113a1bdeb893a94389d69d95e0a7e5c6450bb15f5453a.yml
3+
openapi_spec_hash: 9e243ec62800fb4a2e443eb6481afa30
44
config_hash: 10bd597dd6cc89023541bc551b6532b8

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## 7.12.0 (2026-05-28)
4+
5+
Full Changelog: [v7.11.0...v7.12.0](https://github.com/trycourier/courier-node/compare/v7.11.0...v7.12.0)
6+
7+
### Features
8+
9+
* C-18612 Add Journeys `batch` node variant to OpenAPI spec ([65fb0be](https://github.com/trycourier/courier-node/commit/65fb0be53d35e01a4060f741b2b9db56f4adea72))
10+
* Mark `settings` as required on POST /brands ([2aed30c](https://github.com/trycourier/courier-node/commit/2aed30c8f9c4f085ca777f6ee6dbc6dfbbd0dfd4))
11+
312
## 7.11.0 (2026-05-19)
413

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@trycourier/courier",
3-
"version": "7.11.0",
3+
"version": "7.12.0",
44
"description": "The official TypeScript library for the Courier API",
55
"author": "Courier <support@courier.com>",
66
"types": "dist/index.d.ts",

src/resources/brands.ts

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,28 +10,56 @@ import { path } from '../internal/utils/path';
1010

1111
export class Brands extends APIResource {
1212
/**
13-
* Create a new brand
13+
* Create a new brand. Requires `name` and `settings` (with at least
14+
* `colors.primary` and `colors.secondary`).
15+
*
16+
* @example
17+
* ```ts
18+
* const brand = await client.brands.create({
19+
* name: 'My Brand',
20+
* settings: {
21+
* colors: { primary: '#9D3789', secondary: '#FFFFFF' },
22+
* },
23+
* });
24+
* ```
1425
*/
1526
create(body: BrandCreateParams, options?: RequestOptions): APIPromise<Brand> {
1627
return this._client.post('/brands', { body, ...options });
1728
}
1829

1930
/**
2031
* Fetch a specific brand by brand ID.
32+
*
33+
* @example
34+
* ```ts
35+
* const brand = await client.brands.retrieve('brand_id');
36+
* ```
2137
*/
2238
retrieve(brandID: string, options?: RequestOptions): APIPromise<Brand> {
2339
return this._client.get(path`/brands/${brandID}`, options);
2440
}
2541

2642
/**
2743
* Replace an existing brand with the supplied values.
44+
*
45+
* @example
46+
* ```ts
47+
* const brand = await client.brands.update('brand_id', {
48+
* name: 'name',
49+
* });
50+
* ```
2851
*/
2952
update(brandID: string, body: BrandUpdateParams, options?: RequestOptions): APIPromise<Brand> {
3053
return this._client.put(path`/brands/${brandID}`, { body, ...options });
3154
}
3255

3356
/**
3457
* Get the list of brands.
58+
*
59+
* @example
60+
* ```ts
61+
* const brands = await client.brands.list();
62+
* ```
3563
*/
3664
list(
3765
query: BrandListParams | null | undefined = {},
@@ -42,6 +70,11 @@ export class Brands extends APIResource {
4270

4371
/**
4472
* Delete a brand by brand ID.
73+
*
74+
* @example
75+
* ```ts
76+
* await client.brands.delete('brand_id');
77+
* ```
4578
*/
4679
delete(brandID: string, options?: RequestOptions): APIPromise<void> {
4780
return this._client.delete(path`/brands/${brandID}`, {
@@ -194,9 +227,9 @@ export interface BrandListResponse {
194227
export interface BrandCreateParams {
195228
name: string;
196229

197-
id?: string | null;
230+
settings: BrandSettings;
198231

199-
settings?: BrandSettings | null;
232+
id?: string | null;
200233

201234
snippets?: BrandSnippets | null;
202235
}

src/resources/journeys/journeys.ts

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,10 +472,80 @@ export type JourneyNode =
472472
| JourneyAINode
473473
| JourneyThrottleStaticNode
474474
| JourneyThrottleDynamicNode
475+
| JourneyNode.JourneyBatchNode
475476
| JourneyExitNode
476477
| JourneyNode.JourneyBranchNode;
477478

478479
export namespace JourneyNode {
480+
/**
481+
* Collect events arriving at the node into a single batch and fire one downstream
482+
* step with the aggregated payload. The first event into a batch owns the run;
483+
* later contributing events terminate at the batch step. The batch releases when
484+
* any of `max_items` is reached, a quiet window of `wait_period` elapses, or the
485+
* `max_wait_period` ceiling hits.
486+
*/
487+
export interface JourneyBatchNode {
488+
/**
489+
* ISO 8601 duration. Hard ceiling from the first event into the batch; releases
490+
* the batch unconditionally when it elapses.
491+
*/
492+
max_wait_period: string;
493+
494+
/**
495+
* How to select which collected events to retain in the aggregated payload when
496+
* the batch releases.
497+
*/
498+
retain: JourneyBatchNode.Retain;
499+
500+
scope: 'user';
501+
502+
type: 'batch';
503+
504+
/**
505+
* ISO 8601 duration. Quiet window that releases the batch when it elapses with no
506+
* new contributing events. Must be less than `max_wait_period`.
507+
*/
508+
wait_period: string;
509+
510+
id?: string;
511+
512+
/**
513+
* Optional partition key. Events with the same `category_key` are batched
514+
* together; events with different values are batched separately.
515+
*/
516+
category_key?: string;
517+
518+
/**
519+
* Condition spec for a journey node. Accepts a single condition atom, an AND/OR
520+
* group, or an AND/OR nested group. Omit the `conditions` property entirely to
521+
* express "no conditions".
522+
*/
523+
conditions?: JourneysAPI.JourneyConditionsField;
524+
525+
/**
526+
* Releases the batch once this many events have been collected.
527+
*/
528+
max_items?: number;
529+
}
530+
531+
export namespace JourneyBatchNode {
532+
/**
533+
* How to select which collected events to retain in the aggregated payload when
534+
* the batch releases.
535+
*/
536+
export interface Retain {
537+
count: number;
538+
539+
type: 'first' | 'last' | 'highest' | 'lowest';
540+
541+
/**
542+
* Dot-path into the event payload (e.g. `data.priority`). Required when `type` is
543+
* `highest` or `lowest`.
544+
*/
545+
sort_key?: string;
546+
}
547+
}
548+
479549
/**
480550
* Branch node. Routes to the first entry in `paths[]` whose `conditions` match,
481551
* else falls through to `default.nodes`.

src/version.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const VERSION = '7.11.0'; // x-release-please-version
1+
export const VERSION = '7.12.0'; // x-release-please-version

tests/api-resources/brands.test.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ const client = new Courier({
1010
describe('resource brands', () => {
1111
// Mock server tests are disabled
1212
test.skip('create: only required params', async () => {
13-
const responsePromise = client.brands.create({ name: 'name' });
13+
const responsePromise = client.brands.create({
14+
name: 'My Brand',
15+
settings: {},
16+
});
1417
const rawResponse = await responsePromise.asResponse();
1518
expect(rawResponse).toBeInstanceOf(Response);
1619
const response = await responsePromise;
@@ -23,10 +26,9 @@ describe('resource brands', () => {
2326
// Mock server tests are disabled
2427
test.skip('create: required and optional params', async () => {
2528
const response = await client.brands.create({
26-
name: 'name',
27-
id: 'id',
29+
name: 'My Brand',
2830
settings: {
29-
colors: { primary: 'primary', secondary: 'secondary' },
31+
colors: { primary: '#9D3789', secondary: '#FFFFFF' },
3032
email: {
3133
footer: { content: 'content', inheritDefault: true },
3234
head: { inheritDefault: true, content: 'content' },
@@ -66,6 +68,7 @@ describe('resource brands', () => {
6668
placement: 'top',
6769
},
6870
},
71+
id: 'id',
6972
snippets: { items: [{ name: 'name', value: 'value' }] },
7073
});
7174
});

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,9 +1215,9 @@ baseline-browser-mapping@^2.9.0:
12151215
integrity sha512-B0xUquLkiGLgHhpPBqvl7GWegWBUNuujQ6kXd/r1U38ElPT6Ok8KZ8e+FpUGEc2ZoRQUzq/aUnaKFc/svWUGSg==
12161216

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

0 commit comments

Comments
 (0)