@knocklabs/node 1.33.0 → 1.35.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 (116) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/client.d.mts +6 -6
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +6 -6
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +2 -2
  9. package/resources/audiences.d.mts +19 -39
  10. package/resources/audiences.d.mts.map +1 -1
  11. package/resources/audiences.d.ts +19 -39
  12. package/resources/audiences.d.ts.map +1 -1
  13. package/resources/index.d.mts +3 -3
  14. package/resources/index.d.mts.map +1 -1
  15. package/resources/index.d.ts +3 -3
  16. package/resources/index.d.ts.map +1 -1
  17. package/resources/index.js.map +1 -1
  18. package/resources/index.mjs.map +1 -1
  19. package/resources/messages/batch.d.mts +15 -252
  20. package/resources/messages/batch.d.mts.map +1 -1
  21. package/resources/messages/batch.d.ts +15 -252
  22. package/resources/messages/batch.d.ts.map +1 -1
  23. package/resources/messages/batch.js +4 -3
  24. package/resources/messages/batch.js.map +1 -1
  25. package/resources/messages/batch.mjs +4 -3
  26. package/resources/messages/batch.mjs.map +1 -1
  27. package/resources/messages/index.d.mts +2 -2
  28. package/resources/messages/index.d.mts.map +1 -1
  29. package/resources/messages/index.d.ts +2 -2
  30. package/resources/messages/index.d.ts.map +1 -1
  31. package/resources/messages/index.js.map +1 -1
  32. package/resources/messages/index.mjs.map +1 -1
  33. package/resources/messages/messages.d.mts +215 -188
  34. package/resources/messages/messages.d.mts.map +1 -1
  35. package/resources/messages/messages.d.ts +215 -188
  36. package/resources/messages/messages.d.ts.map +1 -1
  37. package/resources/messages/messages.js +1 -1
  38. package/resources/messages/messages.js.map +1 -1
  39. package/resources/messages/messages.mjs +1 -1
  40. package/resources/messages/messages.mjs.map +1 -1
  41. package/resources/objects/objects.d.mts +5 -2
  42. package/resources/objects/objects.d.mts.map +1 -1
  43. package/resources/objects/objects.d.ts +5 -2
  44. package/resources/objects/objects.d.ts.map +1 -1
  45. package/resources/objects/objects.js.map +1 -1
  46. package/resources/objects/objects.mjs.map +1 -1
  47. package/resources/recipients/channel-data.d.mts +4 -0
  48. package/resources/recipients/channel-data.d.mts.map +1 -1
  49. package/resources/recipients/channel-data.d.ts +4 -0
  50. package/resources/recipients/channel-data.d.ts.map +1 -1
  51. package/resources/recipients/preferences.d.mts +9 -4
  52. package/resources/recipients/preferences.d.mts.map +1 -1
  53. package/resources/recipients/preferences.d.ts +9 -4
  54. package/resources/recipients/preferences.d.ts.map +1 -1
  55. package/resources/recipients/preferences.js.map +1 -1
  56. package/resources/recipients/preferences.mjs.map +1 -1
  57. package/resources/users/bulk.d.mts +4 -2
  58. package/resources/users/bulk.d.mts.map +1 -1
  59. package/resources/users/bulk.d.ts +4 -2
  60. package/resources/users/bulk.d.ts.map +1 -1
  61. package/resources/users/feeds.d.mts +1 -58
  62. package/resources/users/feeds.d.mts.map +1 -1
  63. package/resources/users/feeds.d.ts +1 -58
  64. package/resources/users/feeds.d.ts.map +1 -1
  65. package/resources/users/guides.d.mts +190 -108
  66. package/resources/users/guides.d.mts.map +1 -1
  67. package/resources/users/guides.d.ts +190 -108
  68. package/resources/users/guides.d.ts.map +1 -1
  69. package/resources/users/guides.js +55 -43
  70. package/resources/users/guides.js.map +1 -1
  71. package/resources/users/guides.mjs +55 -43
  72. package/resources/users/guides.mjs.map +1 -1
  73. package/resources/users/index.d.mts +3 -2
  74. package/resources/users/index.d.mts.map +1 -1
  75. package/resources/users/index.d.ts +3 -2
  76. package/resources/users/index.d.ts.map +1 -1
  77. package/resources/users/index.js +3 -1
  78. package/resources/users/index.js.map +1 -1
  79. package/resources/users/index.mjs +1 -0
  80. package/resources/users/index.mjs.map +1 -1
  81. package/resources/users/preference-center.d.mts +175 -0
  82. package/resources/users/preference-center.d.mts.map +1 -0
  83. package/resources/users/preference-center.d.ts +175 -0
  84. package/resources/users/preference-center.d.ts.map +1 -0
  85. package/resources/users/preference-center.js +41 -0
  86. package/resources/users/preference-center.js.map +1 -0
  87. package/resources/users/preference-center.mjs +37 -0
  88. package/resources/users/preference-center.mjs.map +1 -0
  89. package/resources/users/users.d.mts +47 -5
  90. package/resources/users/users.d.mts.map +1 -1
  91. package/resources/users/users.d.ts +47 -5
  92. package/resources/users/users.d.ts.map +1 -1
  93. package/resources/users/users.js +4 -0
  94. package/resources/users/users.js.map +1 -1
  95. package/resources/users/users.mjs +4 -0
  96. package/resources/users/users.mjs.map +1 -1
  97. package/src/client.ts +16 -2
  98. package/src/resources/audiences.ts +21 -42
  99. package/src/resources/index.ts +8 -1
  100. package/src/resources/messages/batch.ts +16 -294
  101. package/src/resources/messages/index.ts +5 -1
  102. package/src/resources/messages/messages.ts +252 -218
  103. package/src/resources/objects/objects.ts +5 -2
  104. package/src/resources/recipients/channel-data.ts +5 -0
  105. package/src/resources/recipients/preferences.ts +9 -4
  106. package/src/resources/users/bulk.ts +4 -2
  107. package/src/resources/users/feeds.ts +1 -70
  108. package/src/resources/users/guides.ts +228 -120
  109. package/src/resources/users/index.ts +15 -3
  110. package/src/resources/users/preference-center.ts +224 -0
  111. package/src/resources/users/users.ts +78 -8
  112. package/src/version.ts +1 -1
  113. package/version.d.mts +1 -1
  114. package/version.d.ts +1 -1
  115. package/version.js +1 -1
  116. package/version.mjs +1 -1
@@ -25,10 +25,9 @@ export class Guides extends APIResource {
25
25
  *
26
26
  * @example
27
27
  * ```ts
28
- * const response =
28
+ * const guideActionResponse =
29
29
  * await client.users.guides.markMessageAsArchived(
30
30
  * 'user_id',
31
- * 'message_id',
32
31
  * {
33
32
  * channel_id: '123e4567-e89b-12d3-a456-426614174000',
34
33
  * guide_id: '7e9dc78c-b3b1-4127-a54e-71f1899b831a',
@@ -38,11 +37,8 @@ export class Guides extends APIResource {
38
37
  * );
39
38
  * ```
40
39
  */
41
- markMessageAsArchived(userID, messageID, body, options) {
42
- return this._client.put(path `/v1/users/${userID}/guides/messages/${messageID}/archived`, {
43
- body,
44
- ...options,
45
- });
40
+ markMessageAsArchived(userID, body, options) {
41
+ return this._client.put(path `/v1/users/${userID}/guides/messages/archived`, { body, ...options });
46
42
  }
47
43
  /**
48
44
  * Records that a user has interacted with a guide, triggering any associated
@@ -50,10 +46,9 @@ export class Guides extends APIResource {
50
46
  *
51
47
  * @example
52
48
  * ```ts
53
- * const response =
49
+ * const guideActionResponse =
54
50
  * await client.users.guides.markMessageAsInteracted(
55
51
  * 'user_id',
56
- * 'message_id',
57
52
  * {
58
53
  * channel_id: '123e4567-e89b-12d3-a456-426614174000',
59
54
  * guide_id: '7e9dc78c-b3b1-4127-a54e-71f1899b831a',
@@ -63,11 +58,8 @@ export class Guides extends APIResource {
63
58
  * );
64
59
  * ```
65
60
  */
66
- markMessageAsInteracted(userID, messageID, body, options) {
67
- return this._client.put(path `/v1/users/${userID}/guides/messages/${messageID}/interacted`, {
68
- body,
69
- ...options,
70
- });
61
+ markMessageAsInteracted(userID, body, options) {
62
+ return this._client.put(path `/v1/users/${userID}/guides/messages/interacted`, { body, ...options });
71
63
  }
72
64
  /**
73
65
  * Records that a guide has been seen by a user, triggering any associated seen
@@ -75,39 +67,59 @@ export class Guides extends APIResource {
75
67
  *
76
68
  * @example
77
69
  * ```ts
78
- * const response =
79
- * await client.users.guides.markMessageAsSeen(
80
- * 'user_id',
81
- * 'message_id',
82
- * {
83
- * channel_id: '123e4567-e89b-12d3-a456-426614174000',
84
- * guide_id: '7e9dc78c-b3b1-4127-a54e-71f1899b831a',
85
- * guide_key: 'tour_notification',
86
- * guide_step_ref: 'lab_tours',
87
- * content: {
88
- * body: "Limited spots available for today's behind-the-scenes DNA extraction demonstration.",
89
- * title: 'DNA Lab Tour Available',
90
- * },
91
- * data: {
92
- * next_time: '14:30',
93
- * spots_left: 8,
94
- * tour_id: 'dna_lab_tour',
95
- * },
96
- * metadata: {
97
- * cta: 'Reserve Spot',
98
- * theme: 'amber',
99
- * type: 'banner',
100
- * },
101
- * tenant: 'ingen_isla_nublar',
70
+ * const guideActionResponse =
71
+ * await client.users.guides.markMessageAsSeen('user_id', {
72
+ * channel_id: '123e4567-e89b-12d3-a456-426614174000',
73
+ * content: {
74
+ * body: "Limited spots available for today's behind-the-scenes DNA extraction demonstration.",
75
+ * title: 'DNA Lab Tour Available',
76
+ * },
77
+ * guide_id: '7e9dc78c-b3b1-4127-a54e-71f1899b831a',
78
+ * guide_key: 'tour_notification',
79
+ * guide_step_ref: 'lab_tours',
80
+ * data: {
81
+ * next_time: '14:30',
82
+ * spots_left: 8,
83
+ * tour_id: 'dna_lab_tour',
102
84
  * },
85
+ * tenant: 'ingen_isla_nublar',
86
+ * });
87
+ * ```
88
+ */
89
+ markMessageAsSeen(userID, body, options) {
90
+ return this._client.put(path `/v1/users/${userID}/guides/messages/seen`, { body, ...options });
91
+ }
92
+ /**
93
+ * Resets the engagement state of a guide for a user, removing the guide's
94
+ * engagement log entry so the next interaction creates a fresh engagement.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * const guideActionResponse =
99
+ * await client.users.guides.resetGuideEngagements(
100
+ * 'user_id',
101
+ * { guide_key: 'tour_notification' },
102
+ * );
103
+ * ```
104
+ */
105
+ resetGuideEngagements(userID, body, options) {
106
+ return this._client.put(path `/v1/users/${userID}/guides/engagements/reset`, { body, ...options });
107
+ }
108
+ /**
109
+ * Records that a guide has been unarchived, triggering any associated unarchived
110
+ * events.
111
+ *
112
+ * @example
113
+ * ```ts
114
+ * const guideActionResponse =
115
+ * await client.users.guides.unarchiveGuideMessage(
116
+ * 'user_id',
117
+ * { guide_key: 'tour_notification' },
103
118
  * );
104
119
  * ```
105
120
  */
106
- markMessageAsSeen(userID, messageID, body, options) {
107
- return this._client.put(path `/v1/users/${userID}/guides/messages/${messageID}/seen`, {
108
- body,
109
- ...options,
110
- });
121
+ unarchiveGuideMessage(userID, body, options) {
122
+ return this._client.delete(path `/v1/users/${userID}/guides/messages/archived`, { body, ...options });
111
123
  }
112
124
  }
113
125
  //# sourceMappingURL=guides.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"guides.mjs","sourceRoot":"","sources":["../../src/resources/users/guides.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAGlD,OAAO,EAAE,IAAI,EAAE,sCAAkC;AAEjD;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,WAAW;IACrC;;;;;;;;;;OAUG;IACH,UAAU,CACR,MAAc,EACd,SAAiB,EACjB,QAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,WAAW,SAAS,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChG,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,qBAAqB,CACnB,MAAc,EACd,SAAiB,EACjB,IAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,oBAAoB,SAAS,WAAW,EAAE;YACvF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,uBAAuB,CACrB,MAAc,EACd,SAAiB,EACjB,IAAwC,EACxC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,oBAAoB,SAAS,aAAa,EAAE;YACzF,IAAI;YACJ,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACH,iBAAiB,CACf,MAAc,EACd,SAAiB,EACjB,IAAkC,EAClC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,oBAAoB,SAAS,OAAO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;;;;;;;;;;;;OAYG;IACH,qBAAqB,CACnB,MAAc,EACd,IAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,MAAM,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpG,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,qBAAqB,CACnB,MAAc,EACd,IAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,MAAM,2BAA2B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACvG,CAAC;CACF"}
@@ -1,5 +1,6 @@
1
1
  export { Bulk, type BulkDeleteParams, type BulkIdentifyParams, type BulkSetPreferencesParams } from "./bulk.mjs";
2
2
  export { Feeds, type FeedGetSettingsResponse, type FeedListItemsResponse, type FeedListItemsParams, type FeedListItemsResponsesEntriesCursor, } from "./feeds.mjs";
3
- export { Guides, type GuideGetChannelResponse, type GuideMarkMessageAsArchivedResponse, type GuideMarkMessageAsInteractedResponse, type GuideMarkMessageAsSeenResponse, type GuideGetChannelParams, type GuideMarkMessageAsArchivedParams, type GuideMarkMessageAsInteractedParams, type GuideMarkMessageAsSeenParams, } from "./guides.mjs";
4
- export { Users, type IdentifyUserRequest, type InlineIdentifyUserRequest, type User, type UserListPreferencesResponse, type UserUpdateParams, type UserListParams, type UserGetPreferencesParams, type UserListMessagesParams, type UserListSchedulesParams, type UserListSubscriptionsParams, type UserMergeParams, type UserSetChannelDataParams, type UserSetPreferencesParams, type UsersEntriesCursor, } from "./users.mjs";
3
+ export { Guides, type GuideActionResponse, type GuideArchivedRequest, type GuideInteractedRequest, type GuideSeenRequest, type GuideGetChannelResponse, type GuideGetChannelParams, type GuideMarkMessageAsArchivedParams, type GuideMarkMessageAsInteractedParams, type GuideMarkMessageAsSeenParams, type GuideResetGuideEngagementsParams, type GuideUnarchiveGuideMessageParams, } from "./guides.mjs";
4
+ export { PreferenceCenter, type PreferenceCenterBrandingConfig, type PreferenceCenterGenerateSignedURLResponse, type PreferenceCenterGetConfigResponse, } from "./preference-center.mjs";
5
+ export { Users, type IdentifyUserRequest, type InlineIdentifyUserRequest, type ListSchedulesResponse, type ListSubscriptionsResponse, type PreferenceSetCommercialSubscribedSetting, type User, type UserListPreferencesResponse, type UserUpdateParams, type UserListParams, type UserGetPreferencesParams, type UserListMessagesParams, type UserListSchedulesParams, type UserListSubscriptionsParams, type UserMergeParams, type UserSetChannelDataParams, type UserSetPreferencesParams, type UsersEntriesCursor, } from "./users.mjs";
5
6
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,mBAAe;AAC7G,OAAO,EACL,KAAK,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mCAAmC,GACzC,oBAAgB;AACjB,OAAO,EACL,MAAM,EACN,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,EACvC,KAAK,oCAAoC,EACzC,KAAK,8BAA8B,EACnC,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,GAClC,qBAAiB;AAClB,OAAO,EACL,KAAK,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,IAAI,EACT,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,oBAAgB"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,mBAAe;AAC7G,OAAO,EACL,KAAK,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mCAAmC,GACzC,oBAAgB;AACjB,OAAO,EACL,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,GACtC,qBAAiB;AAClB,OAAO,EACL,gBAAgB,EAChB,KAAK,8BAA8B,EACnC,KAAK,yCAAyC,EAC9C,KAAK,iCAAiC,GACvC,gCAA4B;AAC7B,OAAO,EACL,KAAK,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,wCAAwC,EAC7C,KAAK,IAAI,EACT,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,oBAAgB"}
@@ -1,5 +1,6 @@
1
1
  export { Bulk, type BulkDeleteParams, type BulkIdentifyParams, type BulkSetPreferencesParams } from "./bulk.js";
2
2
  export { Feeds, type FeedGetSettingsResponse, type FeedListItemsResponse, type FeedListItemsParams, type FeedListItemsResponsesEntriesCursor, } from "./feeds.js";
3
- export { Guides, type GuideGetChannelResponse, type GuideMarkMessageAsArchivedResponse, type GuideMarkMessageAsInteractedResponse, type GuideMarkMessageAsSeenResponse, type GuideGetChannelParams, type GuideMarkMessageAsArchivedParams, type GuideMarkMessageAsInteractedParams, type GuideMarkMessageAsSeenParams, } from "./guides.js";
4
- export { Users, type IdentifyUserRequest, type InlineIdentifyUserRequest, type User, type UserListPreferencesResponse, type UserUpdateParams, type UserListParams, type UserGetPreferencesParams, type UserListMessagesParams, type UserListSchedulesParams, type UserListSubscriptionsParams, type UserMergeParams, type UserSetChannelDataParams, type UserSetPreferencesParams, type UsersEntriesCursor, } from "./users.js";
3
+ export { Guides, type GuideActionResponse, type GuideArchivedRequest, type GuideInteractedRequest, type GuideSeenRequest, type GuideGetChannelResponse, type GuideGetChannelParams, type GuideMarkMessageAsArchivedParams, type GuideMarkMessageAsInteractedParams, type GuideMarkMessageAsSeenParams, type GuideResetGuideEngagementsParams, type GuideUnarchiveGuideMessageParams, } from "./guides.js";
4
+ export { PreferenceCenter, type PreferenceCenterBrandingConfig, type PreferenceCenterGenerateSignedURLResponse, type PreferenceCenterGetConfigResponse, } from "./preference-center.js";
5
+ export { Users, type IdentifyUserRequest, type InlineIdentifyUserRequest, type ListSchedulesResponse, type ListSubscriptionsResponse, type PreferenceSetCommercialSubscribedSetting, type User, type UserListPreferencesResponse, type UserUpdateParams, type UserListParams, type UserGetPreferencesParams, type UserListMessagesParams, type UserListSchedulesParams, type UserListSubscriptionsParams, type UserMergeParams, type UserSetChannelDataParams, type UserSetPreferencesParams, type UsersEntriesCursor, } from "./users.js";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,kBAAe;AAC7G,OAAO,EACL,KAAK,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mCAAmC,GACzC,mBAAgB;AACjB,OAAO,EACL,MAAM,EACN,KAAK,uBAAuB,EAC5B,KAAK,kCAAkC,EACvC,KAAK,oCAAoC,EACzC,KAAK,8BAA8B,EACnC,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,GAClC,oBAAiB;AAClB,OAAO,EACL,KAAK,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,IAAI,EACT,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,mBAAgB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,KAAK,gBAAgB,EAAE,KAAK,kBAAkB,EAAE,KAAK,wBAAwB,EAAE,kBAAe;AAC7G,OAAO,EACL,KAAK,EACL,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,mBAAmB,EACxB,KAAK,mCAAmC,GACzC,mBAAgB;AACjB,OAAO,EACL,MAAM,EACN,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,gCAAgC,EACrC,KAAK,kCAAkC,EACvC,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,GACtC,oBAAiB;AAClB,OAAO,EACL,gBAAgB,EAChB,KAAK,8BAA8B,EACnC,KAAK,yCAAyC,EAC9C,KAAK,iCAAiC,GACvC,+BAA4B;AAC7B,OAAO,EACL,KAAK,EACL,KAAK,mBAAmB,EACxB,KAAK,yBAAyB,EAC9B,KAAK,qBAAqB,EAC1B,KAAK,yBAAyB,EAC9B,KAAK,wCAAwC,EAC7C,KAAK,IAAI,EACT,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAC7B,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,GACxB,mBAAgB"}
@@ -1,13 +1,15 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Users = exports.Guides = exports.Feeds = exports.Bulk = void 0;
4
+ exports.Users = exports.PreferenceCenter = exports.Guides = exports.Feeds = exports.Bulk = void 0;
5
5
  var bulk_1 = require("./bulk.js");
6
6
  Object.defineProperty(exports, "Bulk", { enumerable: true, get: function () { return bulk_1.Bulk; } });
7
7
  var feeds_1 = require("./feeds.js");
8
8
  Object.defineProperty(exports, "Feeds", { enumerable: true, get: function () { return feeds_1.Feeds; } });
9
9
  var guides_1 = require("./guides.js");
10
10
  Object.defineProperty(exports, "Guides", { enumerable: true, get: function () { return guides_1.Guides; } });
11
+ var preference_center_1 = require("./preference-center.js");
12
+ Object.defineProperty(exports, "PreferenceCenter", { enumerable: true, get: function () { return preference_center_1.PreferenceCenter; } });
11
13
  var users_1 = require("./users.js");
12
14
  Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return users_1.Users; } });
13
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA6G;AAApG,4FAAA,IAAI,OAAA;AACb,oCAMiB;AALf,8FAAA,KAAK,OAAA;AAMP,sCAUkB;AAThB,gGAAA,MAAM,OAAA;AAUR,oCAgBiB;AAff,8FAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kCAA6G;AAApG,4FAAA,IAAI,OAAA;AACb,oCAMiB;AALf,8FAAA,KAAK,OAAA;AAMP,sCAakB;AAZhB,gGAAA,MAAM,OAAA;AAaR,4DAK6B;AAJ3B,qHAAA,gBAAgB,OAAA;AAKlB,oCAmBiB;AAlBf,8FAAA,KAAK,OAAA"}
@@ -2,5 +2,6 @@
2
2
  export { Bulk } from "./bulk.mjs";
3
3
  export { Feeds, } from "./feeds.mjs";
4
4
  export { Guides, } from "./guides.mjs";
5
+ export { PreferenceCenter, } from "./preference-center.mjs";
5
6
  export { Users, } from "./users.mjs";
6
7
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,IAAI,EAAiF,mBAAe;AAC7G,OAAO,EACL,KAAK,GAKN,oBAAgB;AACjB,OAAO,EACL,MAAM,GASP,qBAAiB;AAClB,OAAO,EACL,KAAK,GAeN,oBAAgB"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../../src/resources/users/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF,OAAO,EAAE,IAAI,EAAiF,mBAAe;AAC7G,OAAO,EACL,KAAK,GAKN,oBAAgB;AACjB,OAAO,EACL,MAAM,GAYP,qBAAiB;AAClB,OAAO,EACL,gBAAgB,GAIjB,gCAA4B;AAC7B,OAAO,EACL,KAAK,GAkBN,oBAAgB"}
@@ -0,0 +1,175 @@
1
+ import { APIResource } from "../../core/resource.mjs";
2
+ import * as PreferenceCenterAPI from "./preference-center.mjs";
3
+ import { APIPromise } from "../../core/api-promise.mjs";
4
+ import { RequestOptions } from "../../internal/request-options.mjs";
5
+ /**
6
+ * The preference center is a hosted page where users can manage their notification preferences.
7
+ */
8
+ export declare class PreferenceCenter extends APIResource {
9
+ /**
10
+ * Generates a signed preference center URL and token for the given user in the
11
+ * current environment.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response =
16
+ * await client.users.preferenceCenter.generateSignedURL(
17
+ * 'user_id',
18
+ * );
19
+ * ```
20
+ */
21
+ generateSignedURL(userID: string, options?: RequestOptions): APIPromise<PreferenceCenterGenerateSignedURLResponse>;
22
+ /**
23
+ * Returns the preference center config with environment metadata for the given
24
+ * user.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const response =
29
+ * await client.users.preferenceCenter.getConfig('user_id');
30
+ * ```
31
+ */
32
+ getConfig(userID: string, options?: RequestOptions): APIPromise<PreferenceCenterGetConfigResponse>;
33
+ }
34
+ /**
35
+ * The branding for the preference center, sourced from public environment
36
+ * variables.
37
+ */
38
+ export interface PreferenceCenterBrandingConfig {
39
+ /**
40
+ * The icon URL for the preference center. Must point to a valid image with an
41
+ * image MIME type.
42
+ */
43
+ icon_url?: string | null;
44
+ /**
45
+ * The logo URL for the preference center. Must point to a valid image with an
46
+ * image MIME type.
47
+ */
48
+ logo_url?: string | null;
49
+ /**
50
+ * The primary color for the preference center, provided as a hex value.
51
+ */
52
+ primary_color?: string | null;
53
+ /**
54
+ * The primary color contrast for the preference center, provided as a hex value.
55
+ */
56
+ primary_color_contrast?: string | null;
57
+ }
58
+ /**
59
+ * A signed preference center URL and token for a user.
60
+ */
61
+ export interface PreferenceCenterGenerateSignedURLResponse {
62
+ /**
63
+ * The signed JWT token for the preference center, usable as the `/p/{token}` path
64
+ * segment.
65
+ */
66
+ token: string;
67
+ /**
68
+ * The full URL to the preference center for the user.
69
+ */
70
+ url: string;
71
+ }
72
+ /**
73
+ * The preference center configuration for an environment. Controls whether the
74
+ * preference center is enabled and defines the rows displayed in the UI.
75
+ */
76
+ export interface PreferenceCenterGetConfigResponse {
77
+ /**
78
+ * The name of the account that the preference center is associated with.
79
+ */
80
+ account_name: string | null;
81
+ /**
82
+ * The branding for the preference center, sourced from public environment
83
+ * variables.
84
+ */
85
+ branding: PreferenceCenterGetConfigResponse.Branding;
86
+ /**
87
+ * The preference center configuration data containing the rows to display.
88
+ */
89
+ config: PreferenceCenterGetConfigResponse.Config;
90
+ /**
91
+ * Whether the preference center is enabled for this environment.
92
+ */
93
+ enabled: boolean;
94
+ /**
95
+ * A display label for the user that the preference center is associated with,
96
+ * resolved as email, then user id.
97
+ */
98
+ user_email: string | null;
99
+ /**
100
+ * Whether Knock branding is required in the preference center.
101
+ */
102
+ knock_branding_required?: boolean;
103
+ }
104
+ export declare namespace PreferenceCenterGetConfigResponse {
105
+ /**
106
+ * The branding for the preference center, sourced from public environment
107
+ * variables.
108
+ */
109
+ interface Branding extends PreferenceCenterAPI.PreferenceCenterBrandingConfig {
110
+ /**
111
+ * The branding for the preference center, sourced from public environment
112
+ * variables.
113
+ */
114
+ dark?: PreferenceCenterAPI.PreferenceCenterBrandingConfig;
115
+ }
116
+ /**
117
+ * The preference center configuration data containing the rows to display.
118
+ */
119
+ interface Config {
120
+ /**
121
+ * The body text displayed below the title.
122
+ */
123
+ body: string;
124
+ /**
125
+ * An ordered list of rows to display in the preference center.
126
+ */
127
+ rows: Array<Config.Row>;
128
+ /**
129
+ * The title displayed at the top of the preference center.
130
+ */
131
+ title: string;
132
+ /**
133
+ * Whether the account name should be displayed in the preference center.
134
+ */
135
+ show_account_name?: boolean;
136
+ }
137
+ namespace Config {
138
+ /**
139
+ * A preference row in the preference center configuration.
140
+ */
141
+ interface Row {
142
+ /**
143
+ * The display name of the preference row.
144
+ */
145
+ name: string;
146
+ /**
147
+ * The type of this preference row. `workflow` targets a workflow, `channel`
148
+ * targets a specific channel, `category` targets a workflow category,
149
+ * `channel_types` controls per-channel-type opt-in/out, and
150
+ * `commercial_subscribed` is the commercial notification toggle.
151
+ */
152
+ type: 'workflow' | 'channel' | 'category' | 'channel_types' | 'commercial_subscribed';
153
+ /**
154
+ * The list of channel types this preference is scoped to. An empty list (or
155
+ * `null`) means the preference applies to all channel types. Present for
156
+ * `workflow`, `category`, and `channel_types` types.
157
+ */
158
+ channel_types?: Array<'email' | 'in_app' | 'in_app_feed' | 'in_app_guide' | 'sms' | 'push' | 'chat' | 'http' | 'log' | 'deferred_log'> | null;
159
+ /**
160
+ * A description shown below the preference row name.
161
+ */
162
+ description?: string;
163
+ /**
164
+ * The category name, workflow key, or channel ID this row controls (e.g.
165
+ * `marketing`, `new-project-mentions`, or a channel UUID). Present for `workflow`,
166
+ * `channel`, and `category` types.
167
+ */
168
+ identifier?: string | null;
169
+ }
170
+ }
171
+ }
172
+ export declare namespace PreferenceCenter {
173
+ export { type PreferenceCenterBrandingConfig as PreferenceCenterBrandingConfig, type PreferenceCenterGenerateSignedURLResponse as PreferenceCenterGenerateSignedURLResponse, type PreferenceCenterGetConfigResponse as PreferenceCenterGetConfigResponse, };
174
+ }
175
+ //# sourceMappingURL=preference-center.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference-center.d.mts","sourceRoot":"","sources":["../../src/resources/users/preference-center.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,KAAK,mBAAmB,gCAA4B;AAC3D,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yCAAyC,CAAC;IAIxD;;;;;;;;;OASG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,E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AAiB,CAAC,EAAE,OAAO,CAAC;KAC7B;IAED,UAAiB,MAAM,CAAC;QACtB;;WAEG;QACH,UAAiB,GAAG;YAClB;;eAEG;YACH,IAAI,EAAE,MAAM,CAAC;YAEb;;;;;eAKG;YACH,IAAI,EAAE,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,eAAe,GAAG,uBAAuB,CAAC;YAEtF;;;;eAIG;YACH,aAAa,CAAC,EAAE,KAAK,CACjB,OAAO,GACP,QAAQ,GACR,aAAa,GACb,cAAc,GACd,KAAK,GACL,MAAM,GACN,MAAM,GACN,MAAM,GACN,KAAK,GACL,cAAc,CACjB,GAAG,IAAI,CAAC;YAET;;eAEG;YACH,WAAW,CAAC,EAAE,MAAM,CAAC;YAErB;;;;eAIG;YACH,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;SAC5B;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,175 @@
1
+ import { APIResource } from "../../core/resource.js";
2
+ import * as PreferenceCenterAPI from "./preference-center.js";
3
+ import { APIPromise } from "../../core/api-promise.js";
4
+ import { RequestOptions } from "../../internal/request-options.js";
5
+ /**
6
+ * The preference center is a hosted page where users can manage their notification preferences.
7
+ */
8
+ export declare class PreferenceCenter extends APIResource {
9
+ /**
10
+ * Generates a signed preference center URL and token for the given user in the
11
+ * current environment.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const response =
16
+ * await client.users.preferenceCenter.generateSignedURL(
17
+ * 'user_id',
18
+ * );
19
+ * ```
20
+ */
21
+ generateSignedURL(userID: string, options?: RequestOptions): APIPromise<PreferenceCenterGenerateSignedURLResponse>;
22
+ /**
23
+ * Returns the preference center config with environment metadata for the given
24
+ * user.
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const response =
29
+ * await client.users.preferenceCenter.getConfig('user_id');
30
+ * ```
31
+ */
32
+ getConfig(userID: string, options?: RequestOptions): APIPromise<PreferenceCenterGetConfigResponse>;
33
+ }
34
+ /**
35
+ * The branding for the preference center, sourced from public environment
36
+ * variables.
37
+ */
38
+ export interface PreferenceCenterBrandingConfig {
39
+ /**
40
+ * The icon URL for the preference center. Must point to a valid image with an
41
+ * image MIME type.
42
+ */
43
+ icon_url?: string | null;
44
+ /**
45
+ * The logo URL for the preference center. Must point to a valid image with an
46
+ * image MIME type.
47
+ */
48
+ logo_url?: string | null;
49
+ /**
50
+ * The primary color for the preference center, provided as a hex value.
51
+ */
52
+ primary_color?: string | null;
53
+ /**
54
+ * The primary color contrast for the preference center, provided as a hex value.
55
+ */
56
+ primary_color_contrast?: string | null;
57
+ }
58
+ /**
59
+ * A signed preference center URL and token for a user.
60
+ */
61
+ export interface PreferenceCenterGenerateSignedURLResponse {
62
+ /**
63
+ * The signed JWT token for the preference center, usable as the `/p/{token}` path
64
+ * segment.
65
+ */
66
+ token: string;
67
+ /**
68
+ * The full URL to the preference center for the user.
69
+ */
70
+ url: string;
71
+ }
72
+ /**
73
+ * The preference center configuration for an environment. Controls whether the
74
+ * preference center is enabled and defines the rows displayed in the UI.
75
+ */
76
+ export interface PreferenceCenterGetConfigResponse {
77
+ /**
78
+ * The name of the account that the preference center is associated with.
79
+ */
80
+ account_name: string | null;
81
+ /**
82
+ * The branding for the preference center, sourced from public environment
83
+ * variables.
84
+ */
85
+ branding: PreferenceCenterGetConfigResponse.Branding;
86
+ /**
87
+ * The preference center configuration data containing the rows to display.
88
+ */
89
+ config: PreferenceCenterGetConfigResponse.Config;
90
+ /**
91
+ * Whether the preference center is enabled for this environment.
92
+ */
93
+ enabled: boolean;
94
+ /**
95
+ * A display label for the user that the preference center is associated with,
96
+ * resolved as email, then user id.
97
+ */
98
+ user_email: string | null;
99
+ /**
100
+ * Whether Knock branding is required in the preference center.
101
+ */
102
+ knock_branding_required?: boolean;
103
+ }
104
+ export declare namespace PreferenceCenterGetConfigResponse {
105
+ /**
106
+ * The branding for the preference center, sourced from public environment
107
+ * variables.
108
+ */
109
+ interface Branding extends PreferenceCenterAPI.PreferenceCenterBrandingConfig {
110
+ /**
111
+ * The branding for the preference center, sourced from public environment
112
+ * variables.
113
+ */
114
+ dark?: PreferenceCenterAPI.PreferenceCenterBrandingConfig;
115
+ }
116
+ /**
117
+ * The preference center configuration data containing the rows to display.
118
+ */
119
+ interface Config {
120
+ /**
121
+ * The body text displayed below the title.
122
+ */
123
+ body: string;
124
+ /**
125
+ * An ordered list of rows to display in the preference center.
126
+ */
127
+ rows: Array<Config.Row>;
128
+ /**
129
+ * The title displayed at the top of the preference center.
130
+ */
131
+ title: string;
132
+ /**
133
+ * Whether the account name should be displayed in the preference center.
134
+ */
135
+ show_account_name?: boolean;
136
+ }
137
+ namespace Config {
138
+ /**
139
+ * A preference row in the preference center configuration.
140
+ */
141
+ interface Row {
142
+ /**
143
+ * The display name of the preference row.
144
+ */
145
+ name: string;
146
+ /**
147
+ * The type of this preference row. `workflow` targets a workflow, `channel`
148
+ * targets a specific channel, `category` targets a workflow category,
149
+ * `channel_types` controls per-channel-type opt-in/out, and
150
+ * `commercial_subscribed` is the commercial notification toggle.
151
+ */
152
+ type: 'workflow' | 'channel' | 'category' | 'channel_types' | 'commercial_subscribed';
153
+ /**
154
+ * The list of channel types this preference is scoped to. An empty list (or
155
+ * `null`) means the preference applies to all channel types. Present for
156
+ * `workflow`, `category`, and `channel_types` types.
157
+ */
158
+ channel_types?: Array<'email' | 'in_app' | 'in_app_feed' | 'in_app_guide' | 'sms' | 'push' | 'chat' | 'http' | 'log' | 'deferred_log'> | null;
159
+ /**
160
+ * A description shown below the preference row name.
161
+ */
162
+ description?: string;
163
+ /**
164
+ * The category name, workflow key, or channel ID this row controls (e.g.
165
+ * `marketing`, `new-project-mentions`, or a channel UUID). Present for `workflow`,
166
+ * `channel`, and `category` types.
167
+ */
168
+ identifier?: string | null;
169
+ }
170
+ }
171
+ }
172
+ export declare namespace PreferenceCenter {
173
+ export { type PreferenceCenterBrandingConfig as PreferenceCenterBrandingConfig, type PreferenceCenterGenerateSignedURLResponse as PreferenceCenterGenerateSignedURLResponse, type PreferenceCenterGetConfigResponse as PreferenceCenterGetConfigResponse, };
174
+ }
175
+ //# sourceMappingURL=preference-center.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference-center.d.ts","sourceRoot":"","sources":["../../src/resources/users/preference-center.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,+BAA4B;AAClD,OAAO,KAAK,mBAAmB,+BAA4B;AAC3D,OAAO,EAAE,UAAU,EAAE,kCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,0CAAuC;AAGhE;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,yCAAyC,CAAC;IAIxD;;;;;;;;;OASG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,iCAAiC,CAAC;CAGnG;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;GAEG;AACH,MAAM,WAAW,yCAAyC;IACxD;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;G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,GAAG,IAAI,CAAC;SAC5B;KACF;CACF;AAED,MAAM,CAAC,OAAO,WAAW,gBAAgB,CAAC;IACxC,OAAO,EACL,KAAK,8BAA8B,IAAI,8BAA8B,EACrE,KAAK,yCAAyC,IAAI,yCAAyC,EAC3F,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.PreferenceCenter = void 0;
5
+ const resource_1 = require("../../core/resource.js");
6
+ const path_1 = require("../../internal/utils/path.js");
7
+ /**
8
+ * The preference center is a hosted page where users can manage their notification preferences.
9
+ */
10
+ class PreferenceCenter extends resource_1.APIResource {
11
+ /**
12
+ * Generates a signed preference center URL and token for the given user in the
13
+ * current environment.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const response =
18
+ * await client.users.preferenceCenter.generateSignedURL(
19
+ * 'user_id',
20
+ * );
21
+ * ```
22
+ */
23
+ generateSignedURL(userID, options) {
24
+ return this._client.post((0, path_1.path) `/v1/users/${userID}/preference_center/signed_url`, options);
25
+ }
26
+ /**
27
+ * Returns the preference center config with environment metadata for the given
28
+ * user.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const response =
33
+ * await client.users.preferenceCenter.getConfig('user_id');
34
+ * ```
35
+ */
36
+ getConfig(userID, options) {
37
+ return this._client.get((0, path_1.path) `/v1/users/${userID}/preference_center/config`, options);
38
+ }
39
+ }
40
+ exports.PreferenceCenter = PreferenceCenter;
41
+ //# sourceMappingURL=preference-center.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preference-center.js","sourceRoot":"","sources":["../../src/resources/users/preference-center.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,qDAAkD;AAIlD,uDAAiD;AAEjD;;GAEG;AACH,MAAa,gBAAiB,SAAQ,sBAAW;IAC/C;;;;;;;;;;;OAWG;IACH,iBAAiB,CACf,MAAc,EACd,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,+BAA+B,EAAE,OAAO,CAAC,CAAC;IAC5F,CAAC;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,MAAc,EAAE,OAAwB;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,MAAM,2BAA2B,EAAE,OAAO,CAAC,CAAC;IACvF,CAAC;CACF;AAjCD,4CAiCC"}