Skip to content

Commit 28f4ceb

Browse files
release: 1.12.0 (#121)
* chore(internal): formatting change * feat(api): api update * release: 1.12.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 60b766f commit 28f4ceb

File tree

14 files changed

+59
-12
lines changed

14 files changed

+59
-12
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.11.8"
2+
".": "1.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: 89
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-f83c849e3e1c614100e19d79e4bd38ae67353a8316264cf89e4e721f3c1a5739.yml
3-
openapi_spec_hash: 01ad62e55b345d5c077dad6144249e32
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-e4ea1ded040ebfa923df0d24ef37ae3c742383828cda85e1489bc2cb5e14da29.yml
3+
openapi_spec_hash: 4cfd1f5f0d42e1b821f70ba12089b606
44
config_hash: 5c872aa99cad9b9602e84668f5b38a8a

CHANGELOG.md

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

3+
## 1.12.0 (2025-08-15)
4+
5+
Full Changelog: [v1.11.8...v1.12.0](https://github.com/knocklabs/knock-node/compare/v1.11.8...v1.12.0)
6+
7+
### Features
8+
9+
* **api:** api update ([edbcbeb](https://github.com/knocklabs/knock-node/commit/edbcbeb76e86071a770f40b7cc1dbaf0f4d1e9fc))
10+
11+
12+
### Chores
13+
14+
* **internal:** formatting change ([45c032a](https://github.com/knocklabs/knock-node/commit/45c032aacfd31a5f4985dd9fc3d400e063b33791))
15+
316
## 1.11.8 (2025-08-15)
417

518
Full Changelog: [v1.11.7...v1.11.8](https://github.com/knocklabs/knock-node/compare/v1.11.7...v1.11.8)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@knocklabs/node",
3-
"version": "1.11.8",
3+
"version": "1.12.0",
44
"description": "The official TypeScript library for the Knock API",
55
"author": "Knock <[email protected]>",
66
"types": "dist/index.d.ts",

src/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ export class Knock {
849849
channels: API.Channels = new API.Channels(this);
850850
audiences: API.Audiences = new API.Audiences(this);
851851
}
852+
852853
Knock.Shared = Shared;
853854
Knock.Recipients = Recipients;
854855
Knock.Users = Users;
@@ -862,6 +863,7 @@ Knock.Workflows = Workflows;
862863
Knock.Schedules = Schedules;
863864
Knock.Channels = Channels;
864865
Knock.Audiences = Audiences;
866+
865867
export declare namespace Knock {
866868
export type RequestOptions = Opts.RequestOptions;
867869

src/resources/objects/objects.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,11 +345,13 @@ export class Objects extends APIResource {
345345
}
346346

347347
/**
348-
* Sets preferences within the given preference set. This is a destructive
349-
* operation and will replace any existing preferences with the preferences given.
350-
* If no object exists in the current environment for the given `:collection` and
351-
* `:object_id`, Knock will create the object as part of this request. The
352-
* preference set `:id` can be either `default` or a `tenant.id`. Learn more about
348+
* Sets preferences within the given preference set. By default, this is a
349+
* destructive operation and will replace any existing preferences with the
350+
* preferences given. Use '\_\_persistence_strategy': 'merge' to merge with
351+
* existing preferences instead. If no object exists in the current environment for
352+
* the given `:collection` and `:object_id`, Knock will create the object as part
353+
* of this request. The preference set `:id` can be either `default` or a
354+
* `tenant.id`. Learn more about
353355
* [per-tenant preferences](/preferences/tenant-preferences).
354356
*
355357
* @example
@@ -359,6 +361,7 @@ export class Objects extends APIResource {
359361
* 'object_id',
360362
* 'default',
361363
* {
364+
* __persistence_strategy__: 'merge',
362365
* categories: {
363366
* marketing: false,
364367
* transactional: { channel_types: { email: false } },
@@ -717,6 +720,12 @@ export interface ObjectSetChannelDataParams {
717720
}
718721

719722
export interface ObjectSetPreferencesParams {
723+
/**
724+
* Controls how the preference set is persisted. 'replace' will completely replace
725+
* the preference set, 'merge' will merge with existing preferences.
726+
*/
727+
__persistence_strategy__?: 'merge' | 'replace';
728+
720729
/**
721730
* An object where the key is the category and the values are the preference
722731
* settings for that category.

src/resources/recipients/preferences.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,12 @@ export interface PreferenceSetChannelTypes {
125125
* A request to set a preference set for a recipient.
126126
*/
127127
export interface PreferenceSetRequest {
128+
/**
129+
* Controls how the preference set is persisted. 'replace' will completely replace
130+
* the preference set, 'merge' will merge with existing preferences.
131+
*/
132+
__persistence_strategy__?: 'merge' | 'replace';
133+
128134
/**
129135
* An object where the key is the category and the values are the preference
130136
* settings for that category.

src/resources/users/bulk.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ export class Bulk extends APIResource {
5757
* const bulkOperation =
5858
* await client.users.bulk.setPreferences({
5959
* preferences: {
60+
* __persistence_strategy__: 'merge',
6061
* categories: {
6162
* marketing: false,
6263
* transactional: { channel_types: { email: false } },

src/resources/users/users.ts

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -295,15 +295,18 @@ export class Users extends APIResource {
295295
}
296296

297297
/**
298-
* Updates a complete preference set for a user. This is a destructive operation
299-
* that will replace the existing preference set for the user.
298+
* Updates a complete preference set for a user. By default, this is a destructive
299+
* operation and will replace any existing preferences with the preferences given.
300+
* Use '**persistence_strategy**': 'merge' to merge with existing preferences
301+
* instead.
300302
*
301303
* @example
302304
* ```ts
303305
* const preferenceSet = await client.users.setPreferences(
304306
* 'user_id',
305307
* 'default',
306308
* {
309+
* __persistence_strategy__: 'merge',
307310
* categories: {
308311
* marketing: false,
309312
* transactional: { channel_types: { email: false } },
@@ -743,6 +746,12 @@ export interface UserSetChannelDataParams {
743746
}
744747

745748
export interface UserSetPreferencesParams {
749+
/**
750+
* Controls how the preference set is persisted. 'replace' will completely replace
751+
* the preference set, 'merge' will merge with existing preferences.
752+
*/
753+
__persistence_strategy__?: 'merge' | 'replace';
754+
746755
/**
747756
* An object where the key is the category and the values are the preference
748757
* settings for that category.

src/version.ts

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

0 commit comments

Comments
 (0)