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 @@
{
".": "1.20.0"
".": "1.21.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: 89
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-fe051300804a0ee8b0212b288cec99c00918e570f4c4b8852f3f4a27afdddd1c.yml
openapi_spec_hash: d2f75f52ceb88b56e4fcf58bf876fe44
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/knock%2Fknock-40ca41599f579fdd44c2e3e32a7d1bba51ba567050c0dcd5bc099ce8d48bba97.yml
openapi_spec_hash: 72e32d434bbd7ccf7296a2eed7c642ef
config_hash: 658c551418df454aa40794f8ac679c18
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
# Changelog

## 1.21.0 (2025-10-24)

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

### Features

* **api:** api update ([84663aa](https://github.com/knocklabs/knock-node/commit/84663aa656c831dd682d3be8386420ad536572d4))
* **api:** api update ([e768187](https://github.com/knocklabs/knock-node/commit/e768187a2295fb584967d884d3c61b2893ab33bc))
* **api:** api update ([d100fa3](https://github.com/knocklabs/knock-node/commit/d100fa3559c73438ca544e113c79114f71ab6901))
* **api:** api update ([90cb9fd](https://github.com/knocklabs/knock-node/commit/90cb9fdd7810f58821c75911469fd2d871361820))
* **api:** api update ([9187675](https://github.com/knocklabs/knock-node/commit/9187675bf84ca91b29a2d33bd5d27caa88c61307))
* **api:** api update ([4bb96bc](https://github.com/knocklabs/knock-node/commit/4bb96bc2ff6b8bd9bb2a5cd001fd760d2552c2e6))

## 1.20.0 (2025-10-07)

Full Changelog: [v1.19.0...v1.20.0](https://github.com/knocklabs/knock-node/compare/v1.19.0...v1.20.0)
Expand Down
2 changes: 0 additions & 2 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ Types:
- <code><a href="./src/resources/recipients/channel-data.ts">DiscordChannelData</a></code>
- <code><a href="./src/resources/recipients/channel-data.ts">InlineChannelDataRequest</a></code>
- <code><a href="./src/resources/recipients/channel-data.ts">MsTeamsChannelData</a></code>
- <code><a href="./src/resources/recipients/channel-data.ts">OneSignalChannelData</a></code>
- <code><a href="./src/resources/recipients/channel-data.ts">PushChannelData</a></code>
- <code><a href="./src/resources/recipients/channel-data.ts">SlackChannelData</a></code>

# Users
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": "@knocklabs/node",
"version": "1.20.0",
"version": "1.21.0",
"description": "The official TypeScript library for the Knock API",
"author": "Knock <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
47 changes: 46 additions & 1 deletion src/resources/messages/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ export interface Message {
__typename: string;

/**
* The ID for the channel the message was sent through.
* @deprecated Deprecated, use channel.id instead.
*/
channel_id: string;

Expand Down Expand Up @@ -381,6 +381,11 @@ export interface Message {
*/
archived_at?: string | null;

/**
* A configured channel, which is a way to route messages to a provider.
*/
channel?: Message.Channel;

/**
* Timestamp when the message was clicked.
*/
Expand Down Expand Up @@ -469,6 +474,46 @@ export namespace Message {
*/
type?: 'broadcast' | 'workflow' | 'guide';
}

/**
* A configured channel, which is a way to route messages to a provider.
*/
export interface Channel {
/**
* The unique identifier for the channel.
*/
id: string;

/**
* The timestamp of when the channel was created.
*/
created_at: string;

/**
* The ID of the provider that this channel uses to deliver messages.
*/
provider: string;

/**
* The type of channel, determining what kind of messages it can send.
*/
type: 'email' | 'in_app' | 'in_app_feed' | 'in_app_guide' | 'sms' | 'push' | 'chat' | 'http';

/**
* The timestamp of when the channel was last updated.
*/
updated_at: string;

/**
* Unique identifier for the channel within a project (immutable once created).
*/
key?: string | null;

/**
* The human-readable name of the channel.
*/
name?: string | null;
}
}

/**
Expand Down
101 changes: 93 additions & 8 deletions src/resources/objects/objects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,13 +365,16 @@ export class Objects extends APIResource {
* __persistence_strategy__: 'merge',
* categories: {
* marketing: false,
* transactional: { channel_types: { email: false } },
* transactional: { ... },
* },
* channel_types: { email: true },
* channels: {
* '2f641633-95d3-4555-9222-9f1eb7888a80': { ... },
* 'aef6e715-df82-4ab6-b61e-b743e249f7b6': true,
* },
* commercial_subscribed: true,
* workflows: {
* 'dinosaurs-loose': {
* channel_types: { email: false },
* },
* 'dinosaurs-loose': { ... },
* },
* },
* );
Expand Down Expand Up @@ -703,25 +706,45 @@ export interface ObjectSetChannelDataParams {
* Channel data for a given channel type.
*/
data:
| ChannelDataAPI.PushChannelData
| ChannelDataAPI.OneSignalChannelData
| ObjectSetChannelDataParams.AwsSnsPushChannelData
| ObjectSetChannelDataParams.PushChannelDataTokensOnly
| ObjectSetChannelDataParams.AwssnsPushChannelDataTargetArNsOnly
| ObjectSetChannelDataParams.OneSignalChannelDataPlayerIDsOnly
| ChannelDataAPI.SlackChannelData
| ChannelDataAPI.MsTeamsChannelData
| ChannelDataAPI.DiscordChannelData;
}

export namespace ObjectSetChannelDataParams {
/**
* Push channel data.
*/
export interface PushChannelDataTokensOnly {
/**
* A list of push channel tokens.
*/
tokens: Array<string>;
}

/**
* AWS SNS push channel data.
*/
export interface AwsSnsPushChannelData {
export interface AwssnsPushChannelDataTargetArNsOnly {
/**
* A list of platform endpoint ARNs. See
* [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
*/
target_arns: Array<string>;
}

/**
* OneSignal channel data.
*/
export interface OneSignalChannelDataPlayerIDsOnly {
/**
* A list of OneSignal player IDs.
*/
player_ids: Array<string>;
}
}

export interface ObjectSetPreferencesParams {
Expand All @@ -744,6 +767,17 @@ export interface ObjectSetPreferencesParams {
*/
channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;

/**
* Channel preferences.
*/
channels?: { [key: string]: boolean | ObjectSetPreferencesParams.PreferenceSetChannelSetting } | null;

/**
* Whether the recipient is subscribed to commercial communications. When false,
* the recipient will not receive commercial workflow notifications.
*/
commercial_subscribed?: boolean | null;

/**
* An object where the key is the workflow key and the values are the preference
* settings for that workflow.
Expand All @@ -764,12 +798,43 @@ export namespace ObjectSetPreferencesParams {
*/
channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;

/**
* Channel preferences.
*/
channels?: {
[key: string]: boolean | PreferenceSetWorkflowCategorySettingObject.PreferenceSetChannelSetting;
} | null;

/**
* A list of conditions to apply to a channel type.
*/
conditions?: Array<Shared.Condition> | null;
}

export namespace PreferenceSetWorkflowCategorySettingObject {
/**
* A set of settings for a specific channel. Currently, this can only be a list of
* conditions to apply.
*/
export interface PreferenceSetChannelSetting {
/**
* A list of conditions to apply to a specific channel.
*/
conditions: Array<Shared.Condition>;
}
}

/**
* A set of settings for a specific channel. Currently, this can only be a list of
* conditions to apply.
*/
export interface PreferenceSetChannelSetting {
/**
* A list of conditions to apply to a specific channel.
*/
conditions: Array<Shared.Condition>;
}

/**
* The settings object for a workflow or category, where you can specify channel
* types or conditions.
Expand All @@ -780,11 +845,31 @@ export namespace ObjectSetPreferencesParams {
*/
channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;

/**
* Channel preferences.
*/
channels?: {
[key: string]: boolean | PreferenceSetWorkflowCategorySettingObject.PreferenceSetChannelSetting;
} | null;

/**
* A list of conditions to apply to a channel type.
*/
conditions?: Array<Shared.Condition> | null;
}

export namespace PreferenceSetWorkflowCategorySettingObject {
/**
* A set of settings for a specific channel. Currently, this can only be a list of
* conditions to apply.
*/
export interface PreferenceSetChannelSetting {
/**
* A list of conditions to apply to a specific channel.
*/
conditions: Array<Shared.Condition>;
}
}
}

Objects.Bulk = Bulk;
Expand Down
Loading