Skip to content

Commit a63ca71

Browse files
release: 1.21.0 (#139)
* feat(api): api update * feat(api): api update * feat(api): api update * feat(api): api update * feat(api): api update * feat(api): api update * release: 1.21.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent ebd72ef commit a63ca71

File tree

19 files changed

+713
-80
lines changed

19 files changed

+713
-80
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.20.0"
2+
".": "1.21.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-fe051300804a0ee8b0212b288cec99c00918e570f4c4b8852f3f4a27afdddd1c.yml
3-
openapi_spec_hash: d2f75f52ceb88b56e4fcf58bf876fe44
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-40ca41599f579fdd44c2e3e32a7d1bba51ba567050c0dcd5bc099ce8d48bba97.yml
3+
openapi_spec_hash: 72e32d434bbd7ccf7296a2eed7c642ef
44
config_hash: 658c551418df454aa40794f8ac679c18

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.21.0 (2025-10-24)
4+
5+
Full Changelog: [v1.20.0...v1.21.0](https://github.com/knocklabs/knock-node/compare/v1.20.0...v1.21.0)
6+
7+
### Features
8+
9+
* **api:** api update ([84663aa](https://github.com/knocklabs/knock-node/commit/84663aa656c831dd682d3be8386420ad536572d4))
10+
* **api:** api update ([e768187](https://github.com/knocklabs/knock-node/commit/e768187a2295fb584967d884d3c61b2893ab33bc))
11+
* **api:** api update ([d100fa3](https://github.com/knocklabs/knock-node/commit/d100fa3559c73438ca544e113c79114f71ab6901))
12+
* **api:** api update ([90cb9fd](https://github.com/knocklabs/knock-node/commit/90cb9fdd7810f58821c75911469fd2d871361820))
13+
* **api:** api update ([9187675](https://github.com/knocklabs/knock-node/commit/9187675bf84ca91b29a2d33bd5d27caa88c61307))
14+
* **api:** api update ([4bb96bc](https://github.com/knocklabs/knock-node/commit/4bb96bc2ff6b8bd9bb2a5cd001fd760d2552c2e6))
15+
316
## 1.20.0 (2025-10-07)
417

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

api.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ Types:
3838
- <code><a href="./src/resources/recipients/channel-data.ts">DiscordChannelData</a></code>
3939
- <code><a href="./src/resources/recipients/channel-data.ts">InlineChannelDataRequest</a></code>
4040
- <code><a href="./src/resources/recipients/channel-data.ts">MsTeamsChannelData</a></code>
41-
- <code><a href="./src/resources/recipients/channel-data.ts">OneSignalChannelData</a></code>
42-
- <code><a href="./src/resources/recipients/channel-data.ts">PushChannelData</a></code>
4341
- <code><a href="./src/resources/recipients/channel-data.ts">SlackChannelData</a></code>
4442

4543
# Users

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.20.0",
3+
"version": "1.21.0",
44
"description": "The official TypeScript library for the Knock API",
55
"author": "Knock <[email protected]>",
66
"types": "dist/index.d.ts",

src/resources/messages/messages.ts

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ export interface Message {
334334
__typename: string;
335335

336336
/**
337-
* The ID for the channel the message was sent through.
337+
* @deprecated Deprecated, use channel.id instead.
338338
*/
339339
channel_id: string;
340340

@@ -381,6 +381,11 @@ export interface Message {
381381
*/
382382
archived_at?: string | null;
383383

384+
/**
385+
* A configured channel, which is a way to route messages to a provider.
386+
*/
387+
channel?: Message.Channel;
388+
384389
/**
385390
* Timestamp when the message was clicked.
386391
*/
@@ -469,6 +474,46 @@ export namespace Message {
469474
*/
470475
type?: 'broadcast' | 'workflow' | 'guide';
471476
}
477+
478+
/**
479+
* A configured channel, which is a way to route messages to a provider.
480+
*/
481+
export interface Channel {
482+
/**
483+
* The unique identifier for the channel.
484+
*/
485+
id: string;
486+
487+
/**
488+
* The timestamp of when the channel was created.
489+
*/
490+
created_at: string;
491+
492+
/**
493+
* The ID of the provider that this channel uses to deliver messages.
494+
*/
495+
provider: string;
496+
497+
/**
498+
* The type of channel, determining what kind of messages it can send.
499+
*/
500+
type: 'email' | 'in_app' | 'in_app_feed' | 'in_app_guide' | 'sms' | 'push' | 'chat' | 'http';
501+
502+
/**
503+
* The timestamp of when the channel was last updated.
504+
*/
505+
updated_at: string;
506+
507+
/**
508+
* Unique identifier for the channel within a project (immutable once created).
509+
*/
510+
key?: string | null;
511+
512+
/**
513+
* The human-readable name of the channel.
514+
*/
515+
name?: string | null;
516+
}
472517
}
473518

474519
/**

src/resources/objects/objects.ts

Lines changed: 93 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,16 @@ export class Objects extends APIResource {
365365
* __persistence_strategy__: 'merge',
366366
* categories: {
367367
* marketing: false,
368-
* transactional: { channel_types: { email: false } },
368+
* transactional: { ... },
369369
* },
370370
* channel_types: { email: true },
371+
* channels: {
372+
* '2f641633-95d3-4555-9222-9f1eb7888a80': { ... },
373+
* 'aef6e715-df82-4ab6-b61e-b743e249f7b6': true,
374+
* },
375+
* commercial_subscribed: true,
371376
* workflows: {
372-
* 'dinosaurs-loose': {
373-
* channel_types: { email: false },
374-
* },
377+
* 'dinosaurs-loose': { ... },
375378
* },
376379
* },
377380
* );
@@ -703,25 +706,45 @@ export interface ObjectSetChannelDataParams {
703706
* Channel data for a given channel type.
704707
*/
705708
data:
706-
| ChannelDataAPI.PushChannelData
707-
| ChannelDataAPI.OneSignalChannelData
708-
| ObjectSetChannelDataParams.AwsSnsPushChannelData
709+
| ObjectSetChannelDataParams.PushChannelDataTokensOnly
710+
| ObjectSetChannelDataParams.AwssnsPushChannelDataTargetArNsOnly
711+
| ObjectSetChannelDataParams.OneSignalChannelDataPlayerIDsOnly
709712
| ChannelDataAPI.SlackChannelData
710713
| ChannelDataAPI.MsTeamsChannelData
711714
| ChannelDataAPI.DiscordChannelData;
712715
}
713716

714717
export namespace ObjectSetChannelDataParams {
718+
/**
719+
* Push channel data.
720+
*/
721+
export interface PushChannelDataTokensOnly {
722+
/**
723+
* A list of push channel tokens.
724+
*/
725+
tokens: Array<string>;
726+
}
727+
715728
/**
716729
* AWS SNS push channel data.
717730
*/
718-
export interface AwsSnsPushChannelData {
731+
export interface AwssnsPushChannelDataTargetArNsOnly {
719732
/**
720733
* A list of platform endpoint ARNs. See
721734
* [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
722735
*/
723736
target_arns: Array<string>;
724737
}
738+
739+
/**
740+
* OneSignal channel data.
741+
*/
742+
export interface OneSignalChannelDataPlayerIDsOnly {
743+
/**
744+
* A list of OneSignal player IDs.
745+
*/
746+
player_ids: Array<string>;
747+
}
725748
}
726749

727750
export interface ObjectSetPreferencesParams {
@@ -744,6 +767,17 @@ export interface ObjectSetPreferencesParams {
744767
*/
745768
channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;
746769

770+
/**
771+
* Channel preferences.
772+
*/
773+
channels?: { [key: string]: boolean | ObjectSetPreferencesParams.PreferenceSetChannelSetting } | null;
774+
775+
/**
776+
* Whether the recipient is subscribed to commercial communications. When false,
777+
* the recipient will not receive commercial workflow notifications.
778+
*/
779+
commercial_subscribed?: boolean | null;
780+
747781
/**
748782
* An object where the key is the workflow key and the values are the preference
749783
* settings for that workflow.
@@ -764,12 +798,43 @@ export namespace ObjectSetPreferencesParams {
764798
*/
765799
channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;
766800

801+
/**
802+
* Channel preferences.
803+
*/
804+
channels?: {
805+
[key: string]: boolean | PreferenceSetWorkflowCategorySettingObject.PreferenceSetChannelSetting;
806+
} | null;
807+
767808
/**
768809
* A list of conditions to apply to a channel type.
769810
*/
770811
conditions?: Array<Shared.Condition> | null;
771812
}
772813

814+
export namespace PreferenceSetWorkflowCategorySettingObject {
815+
/**
816+
* A set of settings for a specific channel. Currently, this can only be a list of
817+
* conditions to apply.
818+
*/
819+
export interface PreferenceSetChannelSetting {
820+
/**
821+
* A list of conditions to apply to a specific channel.
822+
*/
823+
conditions: Array<Shared.Condition>;
824+
}
825+
}
826+
827+
/**
828+
* A set of settings for a specific channel. Currently, this can only be a list of
829+
* conditions to apply.
830+
*/
831+
export interface PreferenceSetChannelSetting {
832+
/**
833+
* A list of conditions to apply to a specific channel.
834+
*/
835+
conditions: Array<Shared.Condition>;
836+
}
837+
773838
/**
774839
* The settings object for a workflow or category, where you can specify channel
775840
* types or conditions.
@@ -780,11 +845,31 @@ export namespace ObjectSetPreferencesParams {
780845
*/
781846
channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;
782847

848+
/**
849+
* Channel preferences.
850+
*/
851+
channels?: {
852+
[key: string]: boolean | PreferenceSetWorkflowCategorySettingObject.PreferenceSetChannelSetting;
853+
} | null;
854+
783855
/**
784856
* A list of conditions to apply to a channel type.
785857
*/
786858
conditions?: Array<Shared.Condition> | null;
787859
}
860+
861+
export namespace PreferenceSetWorkflowCategorySettingObject {
862+
/**
863+
* A set of settings for a specific channel. Currently, this can only be a list of
864+
* conditions to apply.
865+
*/
866+
export interface PreferenceSetChannelSetting {
867+
/**
868+
* A list of conditions to apply to a specific channel.
869+
*/
870+
conditions: Array<Shared.Condition>;
871+
}
872+
}
788873
}
789874

790875
Objects.Bulk = Bulk;

0 commit comments

Comments
 (0)