Skip to content
Open
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-49d884fb310569a4fab4e8a6c953ee2ae9d0eb69690fc73e4a30467fba42dbe8.yml
openapi_spec_hash: d934f41b399656e45b087112ea59dd65
config_hash: 10bd597dd6cc89023541bc551b6532b8
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 7.12.0 (2026-05-27)

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

### Features

* 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
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