@knocklabs/node 1.20.0 → 1.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/client.d.mts +7 -1
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -1
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +6 -1
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/messages/messages.d.mts +38 -1
  12. package/resources/messages/messages.d.mts.map +1 -1
  13. package/resources/messages/messages.d.ts +38 -1
  14. package/resources/messages/messages.d.ts.map +1 -1
  15. package/resources/messages/messages.js.map +1 -1
  16. package/resources/messages/messages.mjs.map +1 -1
  17. package/resources/objects/bulk.d.mts +5 -19
  18. package/resources/objects/bulk.d.mts.map +1 -1
  19. package/resources/objects/bulk.d.ts +5 -19
  20. package/resources/objects/bulk.d.ts.map +1 -1
  21. package/resources/objects/bulk.js +1 -19
  22. package/resources/objects/bulk.js.map +1 -1
  23. package/resources/objects/bulk.mjs +1 -19
  24. package/resources/objects/bulk.mjs.map +1 -1
  25. package/resources/objects/objects.d.mts +40 -17
  26. package/resources/objects/objects.d.mts.map +1 -1
  27. package/resources/objects/objects.d.ts +40 -17
  28. package/resources/objects/objects.d.ts.map +1 -1
  29. package/resources/objects/objects.js +8 -4
  30. package/resources/objects/objects.js.map +1 -1
  31. package/resources/objects/objects.mjs +8 -4
  32. package/resources/objects/objects.mjs.map +1 -1
  33. package/resources/recipients/channel-data.d.mts +140 -31
  34. package/resources/recipients/channel-data.d.mts.map +1 -1
  35. package/resources/recipients/channel-data.d.ts +140 -31
  36. package/resources/recipients/channel-data.d.ts.map +1 -1
  37. package/resources/recipients/index.d.mts +2 -2
  38. package/resources/recipients/index.d.mts.map +1 -1
  39. package/resources/recipients/index.d.ts +2 -2
  40. package/resources/recipients/index.d.ts.map +1 -1
  41. package/resources/recipients/index.js.map +1 -1
  42. package/resources/recipients/index.mjs.map +1 -1
  43. package/resources/recipients/preferences.d.mts +57 -1
  44. package/resources/recipients/preferences.d.mts.map +1 -1
  45. package/resources/recipients/preferences.d.ts +57 -1
  46. package/resources/recipients/preferences.d.ts.map +1 -1
  47. package/resources/recipients/recipients.d.mts +4 -4
  48. package/resources/recipients/recipients.d.mts.map +1 -1
  49. package/resources/recipients/recipients.d.ts +4 -4
  50. package/resources/recipients/recipients.d.ts.map +1 -1
  51. package/resources/recipients/recipients.js.map +1 -1
  52. package/resources/recipients/recipients.mjs.map +1 -1
  53. package/resources/tenants/bulk.d.mts +1 -1
  54. package/resources/tenants/bulk.d.ts +1 -1
  55. package/resources/tenants/bulk.js +1 -1
  56. package/resources/tenants/bulk.mjs +1 -1
  57. package/resources/tenants/tenants.d.mts +9 -0
  58. package/resources/tenants/tenants.d.mts.map +1 -1
  59. package/resources/tenants/tenants.d.ts +9 -0
  60. package/resources/tenants/tenants.d.ts.map +1 -1
  61. package/resources/tenants/tenants.js +1 -0
  62. package/resources/tenants/tenants.js.map +1 -1
  63. package/resources/tenants/tenants.mjs +1 -0
  64. package/resources/tenants/tenants.mjs.map +1 -1
  65. package/resources/users/bulk.d.mts +13 -0
  66. package/resources/users/bulk.d.mts.map +1 -1
  67. package/resources/users/bulk.d.ts +13 -0
  68. package/resources/users/bulk.d.ts.map +1 -1
  69. package/resources/users/bulk.js +13 -0
  70. package/resources/users/bulk.js.map +1 -1
  71. package/resources/users/bulk.mjs +13 -0
  72. package/resources/users/bulk.mjs.map +1 -1
  73. package/resources/users/feeds.d.mts +7 -0
  74. package/resources/users/feeds.d.mts.map +1 -1
  75. package/resources/users/feeds.d.ts +7 -0
  76. package/resources/users/feeds.d.ts.map +1 -1
  77. package/resources/users/guides.d.mts +90 -21
  78. package/resources/users/guides.d.mts.map +1 -1
  79. package/resources/users/guides.d.ts +90 -21
  80. package/resources/users/guides.d.ts.map +1 -1
  81. package/resources/users/users.d.mts +37 -13
  82. package/resources/users/users.d.mts.map +1 -1
  83. package/resources/users/users.d.ts +37 -13
  84. package/resources/users/users.d.ts.map +1 -1
  85. package/resources/users/users.js +13 -0
  86. package/resources/users/users.js.map +1 -1
  87. package/resources/users/users.mjs +13 -0
  88. package/resources/users/users.mjs.map +1 -1
  89. package/src/client.ts +12 -0
  90. package/src/resources/messages/messages.ts +46 -1
  91. package/src/resources/objects/bulk.ts +6 -19
  92. package/src/resources/objects/objects.ts +44 -20
  93. package/src/resources/recipients/channel-data.ts +173 -41
  94. package/src/resources/recipients/index.ts +6 -2
  95. package/src/resources/recipients/preferences.ts +54 -0
  96. package/src/resources/recipients/recipients.ts +12 -4
  97. package/src/resources/tenants/bulk.ts +1 -1
  98. package/src/resources/tenants/tenants.ts +11 -0
  99. package/src/resources/users/bulk.ts +13 -0
  100. package/src/resources/users/feeds.ts +8 -0
  101. package/src/resources/users/guides.ts +118 -19
  102. package/src/resources/users/users.ts +39 -16
  103. package/src/version.ts +1 -1
  104. package/version.d.mts +1 -1
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
  107. package/version.mjs +1 -1
@@ -142,50 +142,149 @@ export interface GuideGetChannelResponse {
142
142
  /**
143
143
  * A list of guides.
144
144
  */
145
- guides: Array<GuideGetChannelResponse.Guide>;
145
+ entries: Array<GuideGetChannelResponse.Entry>;
146
146
 
147
147
  /**
148
- * The recipient of the guide.
148
+ * A map of guide group keys to their last display timestamps.
149
149
  */
150
- recipient?: GuideGetChannelResponse.Recipient | null;
150
+ guide_group_display_logs: { [key: string]: string };
151
+
152
+ /**
153
+ * A list of guide groups with their display sequences and intervals.
154
+ */
155
+ guide_groups: Array<GuideGetChannelResponse.GuideGroup>;
151
156
  }
152
157
 
153
158
  export namespace GuideGetChannelResponse {
154
- export interface Guide {
159
+ export interface Entry {
155
160
  /**
156
161
  * The unique identifier for the guide.
157
162
  */
158
163
  id?: string;
159
164
 
160
165
  /**
161
- * Whether the guide is active.
166
+ * The typename of the schema.
162
167
  */
163
- active?: boolean;
168
+ __typename?: string;
164
169
 
165
170
  /**
166
- * The content of the guide.
171
+ * A list of URL Patterns to evaluate user's current location to activate the
172
+ * guide, if matched
167
173
  */
168
- content?: string;
174
+ activation_url_patterns?: Array<Entry.ActivationURLPattern>;
169
175
 
170
176
  /**
171
- * The metadata of the guide.
177
+ * A list of URL rules to evaluate user's current location to activate the guide,
178
+ * if matched
172
179
  */
173
- metadata?: { [key: string]: unknown };
180
+ activation_url_rules?: Array<Entry.ActivationURLRule>;
174
181
 
175
182
  /**
176
- * The title of the guide.
183
+ * Whether the guide is active.
177
184
  */
178
- title?: string;
179
- }
185
+ active?: boolean;
186
+
187
+ bypass_global_group_limit?: boolean;
188
+
189
+ channel_id?: string;
190
+
191
+ inserted_at?: string;
180
192
 
181
- /**
182
- * The recipient of the guide.
183
- */
184
- export interface Recipient {
185
193
  /**
186
- * Unique identifier for the recipient.
194
+ * The key of the guide.
187
195
  */
188
- id?: string;
196
+ key?: string;
197
+
198
+ semver?: string;
199
+
200
+ steps?: Array<Entry.Step>;
201
+
202
+ /**
203
+ * The type of the guide.
204
+ */
205
+ type?: string;
206
+
207
+ updated_at?: string;
208
+ }
209
+
210
+ export namespace Entry {
211
+ export interface ActivationURLPattern {
212
+ /**
213
+ * The directive for the URL pattern ('allow' or 'block')
214
+ */
215
+ directive?: string;
216
+
217
+ /**
218
+ * The pathname pattern to match (supports wildcards like /\*)
219
+ */
220
+ pathname?: string;
221
+ }
222
+
223
+ export interface ActivationURLRule {
224
+ /**
225
+ * The value to compare against
226
+ */
227
+ argument?: string;
228
+
229
+ /**
230
+ * The directive for the URL pattern ('allow' or 'block')
231
+ */
232
+ directive?: string;
233
+
234
+ /**
235
+ * The comparison operator ('contains' or 'equal_to')
236
+ */
237
+ operator?: string;
238
+
239
+ /**
240
+ * The variable to evaluate ('pathname')
241
+ */
242
+ variable?: string;
243
+ }
244
+
245
+ export interface Step {
246
+ content?: { [key: string]: unknown };
247
+
248
+ message?: Step.Message;
249
+
250
+ ref?: string;
251
+
252
+ schema_key?: string;
253
+
254
+ schema_semver?: string;
255
+
256
+ schema_variant_key?: string;
257
+ }
258
+
259
+ export namespace Step {
260
+ export interface Message {
261
+ id?: string | null;
262
+
263
+ archived_at?: string | null;
264
+
265
+ interacted_at?: string | null;
266
+
267
+ link_clicked_at?: string | null;
268
+
269
+ read_at?: string | null;
270
+
271
+ seen_at?: string | null;
272
+ }
273
+ }
274
+ }
275
+
276
+ export interface GuideGroup {
277
+ __typename?: string;
278
+
279
+ display_interval?: number;
280
+
281
+ display_sequence?: Array<string>;
282
+
283
+ inserted_at?: string;
284
+
285
+ key?: string;
286
+
287
+ updated_at?: string;
189
288
  }
190
289
  }
191
290
 
@@ -316,6 +316,19 @@ export class Users extends APIResource {
316
316
  * transactional: { channel_types: { email: false } },
317
317
  * },
318
318
  * channel_types: { email: true },
319
+ * channels: {
320
+ * '2f641633-95d3-4555-9222-9f1eb7888a80': {
321
+ * conditions: [
322
+ * {
323
+ * argument: 'US',
324
+ * operator: 'equal_to',
325
+ * variable: 'recipient.country_code',
326
+ * },
327
+ * ],
328
+ * },
329
+ * 'aef6e715-df82-4ab6-b61e-b743e249f7b6': true,
330
+ * },
331
+ * commercial_subscribed: true,
319
332
  * workflows: {
320
333
  * 'dinosaurs-loose': {
321
334
  * channel_types: { email: false },
@@ -735,27 +748,16 @@ export interface UserSetChannelDataParams {
735
748
  * Channel data for a given channel type.
736
749
  */
737
750
  data:
738
- | ChannelDataAPI.PushChannelData
739
- | ChannelDataAPI.OneSignalChannelData
740
- | UserSetChannelDataParams.AwsSnsPushChannelData
751
+ | ChannelDataAPI.PushChannelDataTokensOnly
752
+ | ChannelDataAPI.PushChannelDataDevicesOnly
753
+ | ChannelDataAPI.AwsSnsPushChannelDataTargetArnsOnly
754
+ | ChannelDataAPI.AwsSnsPushChannelDataDevicesOnly
755
+ | ChannelDataAPI.OneSignalChannelDataPlayerIDsOnly
741
756
  | ChannelDataAPI.SlackChannelData
742
757
  | ChannelDataAPI.MsTeamsChannelData
743
758
  | ChannelDataAPI.DiscordChannelData;
744
759
  }
745
760
 
746
- export namespace UserSetChannelDataParams {
747
- /**
748
- * AWS SNS push channel data.
749
- */
750
- export interface AwsSnsPushChannelData {
751
- /**
752
- * A list of platform endpoint ARNs. See
753
- * [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
754
- */
755
- target_arns: Array<string>;
756
- }
757
- }
758
-
759
761
  export interface UserSetPreferencesParams {
760
762
  /**
761
763
  * Controls how the preference set is persisted. 'replace' will completely replace
@@ -776,6 +778,17 @@ export interface UserSetPreferencesParams {
776
778
  */
777
779
  channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;
778
780
 
781
+ /**
782
+ * Channel preferences.
783
+ */
784
+ channels?: { [key: string]: boolean | PreferencesAPI.PreferenceSetChannelSetting } | null;
785
+
786
+ /**
787
+ * Whether the recipient is subscribed to commercial communications. When false,
788
+ * the recipient will not receive commercial workflow notifications.
789
+ */
790
+ commercial_subscribed?: boolean | null;
791
+
779
792
  /**
780
793
  * An object where the key is the workflow key and the values are the preference
781
794
  * settings for that workflow.
@@ -796,6 +809,11 @@ export namespace UserSetPreferencesParams {
796
809
  */
797
810
  channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;
798
811
 
812
+ /**
813
+ * Channel preferences.
814
+ */
815
+ channels?: { [key: string]: boolean | PreferencesAPI.PreferenceSetChannelSetting } | null;
816
+
799
817
  /**
800
818
  * A list of conditions to apply to a channel type.
801
819
  */
@@ -812,6 +830,11 @@ export namespace UserSetPreferencesParams {
812
830
  */
813
831
  channel_types?: PreferencesAPI.PreferenceSetChannelTypes | null;
814
832
 
833
+ /**
834
+ * Channel preferences.
835
+ */
836
+ channels?: { [key: string]: boolean | PreferencesAPI.PreferenceSetChannelSetting } | null;
837
+
815
838
  /**
816
839
  * A list of conditions to apply to a channel type.
817
840
  */
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '1.20.0'; // x-release-please-version
1
+ export const VERSION = '1.22.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.20.0";
1
+ export declare const VERSION = "1.22.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.20.0";
1
+ export declare const VERSION = "1.22.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.20.0'; // x-release-please-version
4
+ exports.VERSION = '1.22.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.20.0'; // x-release-please-version
1
+ export const VERSION = '1.22.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map