@novu/api 3.12.0-rc.0 → 3.13.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 (242) hide show
  1. package/README.md +25 -23
  2. package/_speakeasy/.github/action-inputs-config.json +53 -0
  3. package/_speakeasy/.github/action-security-config.json +88 -0
  4. package/examples/package-lock.json +1 -1
  5. package/funcs/channelConnectionsCreate.d.ts +1 -1
  6. package/funcs/channelConnectionsCreate.js +1 -1
  7. package/funcs/channelConnectionsDelete.d.ts +1 -1
  8. package/funcs/channelConnectionsDelete.js +1 -1
  9. package/funcs/channelConnectionsList.d.ts +2 -2
  10. package/funcs/channelConnectionsList.js +2 -2
  11. package/funcs/channelConnectionsRetrieve.d.ts +1 -1
  12. package/funcs/channelConnectionsRetrieve.js +1 -1
  13. package/funcs/channelConnectionsUpdate.d.ts +1 -1
  14. package/funcs/channelConnectionsUpdate.js +1 -1
  15. package/funcs/channelEndpointsCreate.d.ts +1 -1
  16. package/funcs/channelEndpointsCreate.js +1 -1
  17. package/funcs/channelEndpointsDelete.d.ts +1 -1
  18. package/funcs/channelEndpointsDelete.js +1 -1
  19. package/funcs/channelEndpointsList.d.ts +2 -2
  20. package/funcs/channelEndpointsList.js +2 -2
  21. package/funcs/channelEndpointsRetrieve.d.ts +1 -1
  22. package/funcs/channelEndpointsRetrieve.js +1 -1
  23. package/funcs/channelEndpointsUpdate.d.ts +1 -1
  24. package/funcs/channelEndpointsUpdate.js +1 -1
  25. package/funcs/notificationsList.js +1 -0
  26. package/funcs/notificationsList.js.map +1 -1
  27. package/funcs/subscribersPreferencesList.d.ts +1 -1
  28. package/funcs/subscribersPreferencesList.d.ts.map +1 -1
  29. package/funcs/subscribersPreferencesList.js +5 -9
  30. package/funcs/subscribersPreferencesList.js.map +1 -1
  31. package/funcs/subscribersTopicsList.js +1 -0
  32. package/funcs/subscribersTopicsList.js.map +1 -1
  33. package/funcs/topicsSubscriptionsGetSubscription.d.ts +18 -0
  34. package/funcs/topicsSubscriptionsGetSubscription.d.ts.map +1 -0
  35. package/funcs/topicsSubscriptionsGetSubscription.js +160 -0
  36. package/funcs/topicsSubscriptionsGetSubscription.js.map +1 -0
  37. package/funcs/topicsSubscriptionsList.js +1 -0
  38. package/funcs/topicsSubscriptionsList.js.map +1 -1
  39. package/funcs/topicsSubscriptionsUpdate.d.ts +1 -1
  40. package/funcs/topicsSubscriptionsUpdate.js +6 -3
  41. package/funcs/topicsSubscriptionsUpdate.js.map +1 -1
  42. package/funcs/trigger.d.ts +1 -1
  43. package/funcs/trigger.js +1 -1
  44. package/jsr.json +1 -1
  45. package/lib/config.d.ts +4 -4
  46. package/lib/config.js +4 -4
  47. package/lib/config.js.map +1 -1
  48. package/lib/sdks.js +2 -2
  49. package/lib/sdks.js.map +1 -1
  50. package/models/components/activitynotificationjobresponsedto.d.ts +4 -4
  51. package/models/components/activitynotificationjobresponsedto.d.ts.map +1 -1
  52. package/models/components/activitynotificationjobresponsedto.js +6 -7
  53. package/models/components/activitynotificationjobresponsedto.js.map +1 -1
  54. package/models/components/bulkupdatesubscriberpreferencesdto.d.ts +34 -0
  55. package/models/components/bulkupdatesubscriberpreferencesdto.d.ts.map +1 -1
  56. package/models/components/bulkupdatesubscriberpreferencesdto.js +17 -1
  57. package/models/components/bulkupdatesubscriberpreferencesdto.js.map +1 -1
  58. package/models/components/createchannelconnectionrequestdto.d.ts +10 -10
  59. package/models/components/createchannelconnectionrequestdto.d.ts.map +1 -1
  60. package/models/components/createchannelconnectionrequestdto.js +16 -12
  61. package/models/components/createchannelconnectionrequestdto.js.map +1 -1
  62. package/models/components/createslackchannelendpointdto.d.ts +8 -8
  63. package/models/components/createslackchannelendpointdto.d.ts.map +1 -1
  64. package/models/components/createslackchannelendpointdto.js +13 -7
  65. package/models/components/createslackchannelendpointdto.js.map +1 -1
  66. package/models/components/createtopicsubscriptionsrequestdto.d.ts +34 -0
  67. package/models/components/createtopicsubscriptionsrequestdto.d.ts.map +1 -1
  68. package/models/components/createtopicsubscriptionsrequestdto.js +23 -1
  69. package/models/components/createtopicsubscriptionsrequestdto.js.map +1 -1
  70. package/models/components/delaystepresponsedto.d.ts +1 -1
  71. package/models/components/delaystepresponsedto.d.ts.map +1 -1
  72. package/models/components/emailstepresponsedto.d.ts +3 -3
  73. package/models/components/emailstepresponsedto.d.ts.map +1 -1
  74. package/models/components/generatechatoauthurlrequestdto.d.ts +1 -1
  75. package/models/components/inappcontroldto.d.ts +1 -1
  76. package/models/components/inappstepresponsedto.d.ts +2 -2
  77. package/models/components/inappstepresponsedto.d.ts.map +1 -1
  78. package/models/components/index.d.ts +1 -0
  79. package/models/components/index.d.ts.map +1 -1
  80. package/models/components/index.js +1 -0
  81. package/models/components/index.js.map +1 -1
  82. package/models/components/messageactionresult.d.ts +3 -8
  83. package/models/components/messageactionresult.d.ts.map +1 -1
  84. package/models/components/messageactionresult.js +2 -8
  85. package/models/components/messageactionresult.js.map +1 -1
  86. package/models/components/messageresponsedto.d.ts +6 -16
  87. package/models/components/messageresponsedto.d.ts.map +1 -1
  88. package/models/components/messageresponsedto.js +3 -15
  89. package/models/components/messageresponsedto.js.map +1 -1
  90. package/models/components/notificationfeeditemdto.d.ts +4 -0
  91. package/models/components/notificationfeeditemdto.d.ts.map +1 -1
  92. package/models/components/notificationfeeditemdto.js +1 -0
  93. package/models/components/notificationfeeditemdto.js.map +1 -1
  94. package/models/components/patchsubscriberpreferencesdto.d.ts +34 -0
  95. package/models/components/patchsubscriberpreferencesdto.d.ts.map +1 -1
  96. package/models/components/patchsubscriberpreferencesdto.js +19 -1
  97. package/models/components/patchsubscriberpreferencesdto.js.map +1 -1
  98. package/models/components/redirectdto.d.ts +1 -1
  99. package/models/components/subscriberworkflowpreferencedto.d.ts +4 -0
  100. package/models/components/subscriberworkflowpreferencedto.d.ts.map +1 -1
  101. package/models/components/subscriberworkflowpreferencedto.js +1 -0
  102. package/models/components/subscriberworkflowpreferencedto.js.map +1 -1
  103. package/models/components/subscriptiondetailsresponsedto.d.ts +30 -0
  104. package/models/components/subscriptiondetailsresponsedto.d.ts.map +1 -0
  105. package/models/components/{createtopicsubscriptionsresponsedto.js → subscriptiondetailsresponsedto.js} +12 -12
  106. package/models/components/subscriptiondetailsresponsedto.js.map +1 -0
  107. package/models/components/subscriptiondto.d.ts +4 -0
  108. package/models/components/subscriptiondto.d.ts.map +1 -1
  109. package/models/components/subscriptiondto.js +1 -0
  110. package/models/components/subscriptiondto.js.map +1 -1
  111. package/models/components/subscriptionresponsedto.d.ts +4 -0
  112. package/models/components/subscriptionresponsedto.d.ts.map +1 -1
  113. package/models/components/subscriptionresponsedto.js +1 -0
  114. package/models/components/subscriptionresponsedto.js.map +1 -1
  115. package/models/components/throttlestepresponsedto.d.ts +2 -2
  116. package/models/components/throttlestepresponsedto.d.ts.map +1 -1
  117. package/models/components/topicsubscriptionresponsedto.d.ts +8 -0
  118. package/models/components/topicsubscriptionresponsedto.d.ts.map +1 -1
  119. package/models/components/topicsubscriptionresponsedto.js +2 -0
  120. package/models/components/topicsubscriptionresponsedto.js.map +1 -1
  121. package/models/components/triggereventrequestdto.d.ts +2 -2
  122. package/models/components/workflowresponsedto.d.ts +2 -2
  123. package/models/components/workflowresponsedto.d.ts.map +1 -1
  124. package/models/operations/inboundwebhookscontrollerhandlewebhook.d.ts +6 -2
  125. package/models/operations/inboundwebhookscontrollerhandlewebhook.d.ts.map +1 -1
  126. package/models/operations/inboundwebhookscontrollerhandlewebhook.js +1 -1
  127. package/models/operations/inboundwebhookscontrollerhandlewebhook.js.map +1 -1
  128. package/models/operations/index.d.ts +1 -0
  129. package/models/operations/index.d.ts.map +1 -1
  130. package/models/operations/index.js +1 -0
  131. package/models/operations/index.js.map +1 -1
  132. package/models/operations/notificationscontrollerlistnotifications.d.ts +5 -0
  133. package/models/operations/notificationscontrollerlistnotifications.d.ts.map +1 -1
  134. package/models/operations/notificationscontrollerlistnotifications.js +1 -0
  135. package/models/operations/notificationscontrollerlistnotifications.js.map +1 -1
  136. package/models/operations/subscriberscontrollergetsubscriberpreferences.d.ts +5 -0
  137. package/models/operations/subscriberscontrollergetsubscriberpreferences.d.ts.map +1 -1
  138. package/models/operations/subscriberscontrollergetsubscriberpreferences.js +1 -0
  139. package/models/operations/subscriberscontrollergetsubscriberpreferences.js.map +1 -1
  140. package/models/operations/subscriberscontrollerlistsubscribertopics.d.ts +5 -0
  141. package/models/operations/subscriberscontrollerlistsubscribertopics.d.ts.map +1 -1
  142. package/models/operations/subscriberscontrollerlistsubscribertopics.js +1 -0
  143. package/models/operations/subscriberscontrollerlistsubscribertopics.js.map +1 -1
  144. package/models/operations/topicscontrollergettopicsubscription.d.ts +37 -0
  145. package/models/operations/topicscontrollergettopicsubscription.d.ts.map +1 -0
  146. package/models/operations/topicscontrollergettopicsubscription.js +72 -0
  147. package/models/operations/topicscontrollergettopicsubscription.js.map +1 -0
  148. package/models/operations/topicscontrollerlisttopicsubscriptions.d.ts +5 -0
  149. package/models/operations/topicscontrollerlisttopicsubscriptions.d.ts.map +1 -1
  150. package/models/operations/topicscontrollerlisttopicsubscriptions.js +1 -0
  151. package/models/operations/topicscontrollerlisttopicsubscriptions.js.map +1 -1
  152. package/models/operations/topicscontrollerupdatetopicsubscription.d.ts +2 -2
  153. package/models/operations/topicscontrollerupdatetopicsubscription.d.ts.map +1 -1
  154. package/models/operations/topicscontrollerupdatetopicsubscription.js +1 -1
  155. package/models/operations/topicscontrollerupdatetopicsubscription.js.map +1 -1
  156. package/package.json +1 -1
  157. package/sdk/channelconnections.d.ts +6 -6
  158. package/sdk/channelconnections.js +6 -6
  159. package/sdk/channelendpoints.d.ts +6 -6
  160. package/sdk/channelendpoints.js +6 -6
  161. package/sdk/preferences.d.ts +1 -1
  162. package/sdk/preferences.d.ts.map +1 -1
  163. package/sdk/preferences.js +2 -2
  164. package/sdk/preferences.js.map +1 -1
  165. package/sdk/sdk.d.ts +1 -1
  166. package/sdk/sdk.js +1 -1
  167. package/sdk/subscriptions.d.ts +8 -1
  168. package/sdk/subscriptions.d.ts.map +1 -1
  169. package/sdk/subscriptions.js +11 -1
  170. package/sdk/subscriptions.js.map +1 -1
  171. package/sources/json-development.json +954 -183
  172. package/src/funcs/channelConnectionsCreate.ts +1 -1
  173. package/src/funcs/channelConnectionsDelete.ts +1 -1
  174. package/src/funcs/channelConnectionsList.ts +2 -2
  175. package/src/funcs/channelConnectionsRetrieve.ts +1 -1
  176. package/src/funcs/channelConnectionsUpdate.ts +1 -1
  177. package/src/funcs/channelEndpointsCreate.ts +1 -1
  178. package/src/funcs/channelEndpointsDelete.ts +1 -1
  179. package/src/funcs/channelEndpointsList.ts +2 -2
  180. package/src/funcs/channelEndpointsRetrieve.ts +1 -1
  181. package/src/funcs/channelEndpointsUpdate.ts +1 -1
  182. package/src/funcs/notificationsList.ts +1 -0
  183. package/src/funcs/subscribersPreferencesList.ts +5 -17
  184. package/src/funcs/subscribersTopicsList.ts +1 -0
  185. package/src/funcs/topicsSubscriptionsGetSubscription.ts +242 -0
  186. package/src/funcs/topicsSubscriptionsList.ts +1 -0
  187. package/src/funcs/topicsSubscriptionsUpdate.ts +8 -9
  188. package/src/funcs/trigger.ts +1 -1
  189. package/src/lib/config.ts +4 -4
  190. package/src/lib/sdks.ts +2 -2
  191. package/src/models/components/activitynotificationjobresponsedto.ts +9 -19
  192. package/src/models/components/bulkupdatesubscriberpreferencesdto.ts +62 -0
  193. package/src/models/components/createchannelconnectionrequestdto.ts +51 -18
  194. package/src/models/components/createslackchannelendpointdto.ts +31 -13
  195. package/src/models/components/createtopicsubscriptionsrequestdto.ts +82 -0
  196. package/src/models/components/delaystepresponsedto.ts +1 -1
  197. package/src/models/components/emailstepresponsedto.ts +3 -3
  198. package/src/models/components/generatechatoauthurlrequestdto.ts +1 -1
  199. package/src/models/components/inappcontroldto.ts +1 -1
  200. package/src/models/components/inappstepresponsedto.ts +2 -2
  201. package/src/models/components/index.ts +1 -0
  202. package/src/models/components/messageactionresult.ts +2 -21
  203. package/src/models/components/messageresponsedto.ts +4 -48
  204. package/src/models/components/notificationfeeditemdto.ts +5 -0
  205. package/src/models/components/patchsubscriberpreferencesdto.ts +48 -0
  206. package/src/models/components/redirectdto.ts +1 -1
  207. package/src/models/components/subscriberworkflowpreferencedto.ts +5 -0
  208. package/src/models/components/subscriptiondetailsresponsedto.ts +58 -0
  209. package/src/models/components/subscriptiondto.ts +5 -0
  210. package/src/models/components/subscriptionresponsedto.ts +5 -0
  211. package/src/models/components/throttlestepresponsedto.ts +2 -2
  212. package/src/models/components/topicsubscriptionresponsedto.ts +10 -0
  213. package/src/models/components/triggereventrequestdto.ts +2 -2
  214. package/src/models/components/workflowresponsedto.ts +2 -2
  215. package/src/models/operations/inboundwebhookscontrollerhandlewebhook.ts +3 -3
  216. package/src/models/operations/index.ts +1 -0
  217. package/src/models/operations/notificationscontrollerlistnotifications.ts +6 -0
  218. package/src/models/operations/subscriberscontrollergetsubscriberpreferences.ts +6 -0
  219. package/src/models/operations/subscriberscontrollerlistsubscribertopics.ts +6 -0
  220. package/src/models/operations/topicscontrollergettopicsubscription.ts +96 -0
  221. package/src/models/operations/topicscontrollerlisttopicsubscriptions.ts +6 -0
  222. package/src/models/operations/topicscontrollerupdatetopicsubscription.ts +3 -3
  223. package/src/sdk/channelconnections.ts +6 -6
  224. package/src/sdk/channelendpoints.ts +6 -6
  225. package/src/sdk/preferences.ts +2 -6
  226. package/src/sdk/sdk.ts +1 -1
  227. package/src/sdk/subscriptions.ts +23 -1
  228. package/models/components/createtopicsubscriptionsresponsedto.d.ts +0 -24
  229. package/models/components/createtopicsubscriptionsresponsedto.d.ts.map +0 -1
  230. package/models/components/createtopicsubscriptionsresponsedto.js.map +0 -1
  231. package/models/components/steptypeenum.d.ts +0 -26
  232. package/models/components/steptypeenum.d.ts.map +0 -1
  233. package/models/components/steptypeenum.js +0 -60
  234. package/models/components/steptypeenum.js.map +0 -1
  235. package/models/components/uploadtranslationsrequestdto.d.ts +0 -34
  236. package/models/components/uploadtranslationsrequestdto.d.ts.map +0 -1
  237. package/models/components/uploadtranslationsrequestdto.js +0 -60
  238. package/models/components/uploadtranslationsrequestdto.js.map +0 -1
  239. package/src/models/components/createtopicsubscriptionsresponsedto.ts +0 -54
  240. package/src/models/components/steptypeenum.ts +0 -33
  241. package/src/models/components/uploadtranslationsrequestdto.ts +0 -62
  242. package/temp/example.ts +0 -5
@@ -0,0 +1,58 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { safeParse } from "../../lib/schemas.js";
7
+ import { Result as SafeParseResult } from "../../types/fp.js";
8
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
9
+ import {
10
+ SubscriptionPreferenceDto,
11
+ SubscriptionPreferenceDto$inboundSchema,
12
+ } from "./subscriptionpreferencedto.js";
13
+
14
+ export type SubscriptionDetailsResponseDto = {
15
+ /**
16
+ * The unique identifier of the subscription
17
+ */
18
+ id: string;
19
+ /**
20
+ * The identifier of the subscription
21
+ */
22
+ identifier?: string | undefined;
23
+ /**
24
+ * The name of the subscription
25
+ */
26
+ name?: string | undefined;
27
+ /**
28
+ * The preferences/rules for the subscription
29
+ */
30
+ preferences?: Array<SubscriptionPreferenceDto> | undefined;
31
+ /**
32
+ * Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123)
33
+ */
34
+ contextKeys?: Array<string> | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const SubscriptionDetailsResponseDto$inboundSchema: z.ZodType<
39
+ SubscriptionDetailsResponseDto,
40
+ z.ZodTypeDef,
41
+ unknown
42
+ > = z.object({
43
+ id: z.string(),
44
+ identifier: z.string().optional(),
45
+ name: z.string().optional(),
46
+ preferences: z.array(SubscriptionPreferenceDto$inboundSchema).optional(),
47
+ contextKeys: z.array(z.string()).optional(),
48
+ });
49
+
50
+ export function subscriptionDetailsResponseDtoFromJSON(
51
+ jsonString: string,
52
+ ): SafeParseResult<SubscriptionDetailsResponseDto, SDKValidationError> {
53
+ return safeParse(
54
+ jsonString,
55
+ (x) => SubscriptionDetailsResponseDto$inboundSchema.parse(JSON.parse(x)),
56
+ `Failed to parse 'SubscriptionDetailsResponseDto' from JSON`,
57
+ );
58
+ }
@@ -56,6 +56,10 @@ export type SubscriptionDto = {
56
56
  * The subscriber information
57
57
  */
58
58
  subscriber: SubscriptionDtoSubscriber | null;
59
+ /**
60
+ * Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123)
61
+ */
62
+ contextKeys?: Array<string> | undefined;
59
63
  /**
60
64
  * The creation date of the subscription
61
65
  */
@@ -104,6 +108,7 @@ export const SubscriptionDto$inboundSchema: z.ZodType<
104
108
  identifier: z.string().optional(),
105
109
  topic: TopicDto$inboundSchema,
106
110
  subscriber: z.nullable(z.lazy(() => SubscriptionDtoSubscriber$inboundSchema)),
111
+ contextKeys: z.array(z.string()).optional(),
107
112
  createdAt: z.string(),
108
113
  updatedAt: z.string(),
109
114
  }).transform((v) => {
@@ -68,6 +68,10 @@ export type SubscriptionResponseDto = {
68
68
  * The preferences for workflows in this subscription
69
69
  */
70
70
  preferences?: Array<SubscriptionPreferenceDto> | undefined;
71
+ /**
72
+ * Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123)
73
+ */
74
+ contextKeys?: Array<string> | undefined;
71
75
  /**
72
76
  * The creation date of the subscription
73
77
  */
@@ -118,6 +122,7 @@ export const SubscriptionResponseDto$inboundSchema: z.ZodType<
118
122
  topic: TopicDto$inboundSchema,
119
123
  subscriber: z.nullable(z.lazy(() => Subscriber$inboundSchema)),
120
124
  preferences: z.array(SubscriptionPreferenceDto$inboundSchema).optional(),
125
+ contextKeys: z.array(z.string()).optional(),
121
126
  createdAt: z.string(),
122
127
  updatedAt: z.string(),
123
128
  }).transform((v) => {
@@ -61,7 +61,7 @@ export type ThrottleStepResponseDtoControlValues = {
61
61
  /**
62
62
  * The type of throttle window.
63
63
  */
64
- type?: ThrottleStepResponseDtoType | undefined;
64
+ type: ThrottleStepResponseDtoType;
65
65
  /**
66
66
  * The amount of time for the throttle window (required for fixed type).
67
67
  */
@@ -77,7 +77,7 @@ export type ThrottleStepResponseDtoControlValues = {
77
77
  /**
78
78
  * The maximum number of executions allowed within the window. Defaults to 1.
79
79
  */
80
- threshold?: number | undefined;
80
+ threshold: number;
81
81
  /**
82
82
  * Optional key for grouping throttle rules. If not provided, defaults to workflow and subscriber combination.
83
83
  */
@@ -18,6 +18,10 @@ export type TopicSubscriptionResponseDto = {
18
18
  * The identifier of the subscription
19
19
  */
20
20
  id: string;
21
+ /**
22
+ * The identifier of the subscription
23
+ */
24
+ identifier: string;
21
25
  /**
22
26
  * The date and time the subscription was created
23
27
  */
@@ -30,6 +34,10 @@ export type TopicSubscriptionResponseDto = {
30
34
  * Subscriber information
31
35
  */
32
36
  subscriber: SubscriberDto;
37
+ /**
38
+ * Context keys that scope this subscription (e.g., tenant:org-a, project:proj-123)
39
+ */
40
+ contextKeys?: Array<string> | undefined;
33
41
  };
34
42
 
35
43
  /** @internal */
@@ -39,9 +47,11 @@ export const TopicSubscriptionResponseDto$inboundSchema: z.ZodType<
39
47
  unknown
40
48
  > = z.object({
41
49
  _id: z.string(),
50
+ identifier: z.string(),
42
51
  createdAt: z.string(),
43
52
  topic: TopicResponseDto$inboundSchema,
44
53
  subscriber: SubscriberDto$inboundSchema,
54
+ contextKeys: z.array(z.string()).optional(),
45
55
  }).transform((v) => {
46
56
  return remap$(v, {
47
57
  "_id": "id",
@@ -99,7 +99,7 @@ export type Overrides = {
99
99
  export type To1 = TopicPayloadDto | SubscriberPayloadDto | string;
100
100
 
101
101
  /**
102
- * The recipients list of people who will receive the notification.
102
+ * The recipients list of people who will receive the notification. Maximum number of recipients can be 100.
103
103
  */
104
104
  export type To =
105
105
  | TopicPayloadDto
@@ -156,7 +156,7 @@ export type TriggerEventRequestDto = {
156
156
  */
157
157
  overrides?: Overrides | undefined;
158
158
  /**
159
- * The recipients list of people who will receive the notification.
159
+ * The recipients list of people who will receive the notification. Maximum number of recipients can be 100.
160
160
  */
161
161
  to:
162
162
  | TopicPayloadDto
@@ -135,7 +135,7 @@ export type WorkflowResponseDto = {
135
135
  /**
136
136
  * Whether the workflow is active
137
137
  */
138
- active?: boolean | undefined;
138
+ active: boolean;
139
139
  /**
140
140
  * Enable or disable payload schema validation
141
141
  */
@@ -147,7 +147,7 @@ export type WorkflowResponseDto = {
147
147
  /**
148
148
  * Enable or disable translations for this workflow
149
149
  */
150
- isTranslationEnabled?: boolean | undefined;
150
+ isTranslationEnabled: boolean;
151
151
  /**
152
152
  * Database identifier of the workflow
153
153
  */
@@ -21,7 +21,7 @@ export type InboundWebhooksControllerHandleWebhookRequest = {
21
21
  /**
22
22
  * Webhook event payload from the delivery provider
23
23
  */
24
- requestBody?: any | undefined;
24
+ requestBody: { [k: string]: any };
25
25
  };
26
26
 
27
27
  /** @internal */
@@ -29,7 +29,7 @@ export type InboundWebhooksControllerHandleWebhookRequest$Outbound = {
29
29
  environmentId: string;
30
30
  integrationId: string;
31
31
  "idempotency-key"?: string | undefined;
32
- RequestBody?: any | undefined;
32
+ RequestBody: { [k: string]: any };
33
33
  };
34
34
 
35
35
  /** @internal */
@@ -42,7 +42,7 @@ export const InboundWebhooksControllerHandleWebhookRequest$outboundSchema:
42
42
  environmentId: z.string(),
43
43
  integrationId: z.string(),
44
44
  idempotencyKey: z.string().optional(),
45
- requestBody: z.any().optional(),
45
+ requestBody: z.record(z.any()),
46
46
  }).transform((v) => {
47
47
  return remap$(v, {
48
48
  idempotencyKey: "idempotency-key",
@@ -71,6 +71,7 @@ export * from "./topicscontrollercreatetopicsubscriptions.js";
71
71
  export * from "./topicscontrollerdeletetopic.js";
72
72
  export * from "./topicscontrollerdeletetopicsubscriptions.js";
73
73
  export * from "./topicscontrollergettopic.js";
74
+ export * from "./topicscontrollergettopicsubscription.js";
74
75
  export * from "./topicscontrollerlisttopics.js";
75
76
  export * from "./topicscontrollerlisttopicsubscriptions.js";
76
77
  export * from "./topicscontrollerupdatetopic.js";
@@ -52,6 +52,10 @@ export type NotificationsControllerListNotificationsRequest = {
52
52
  * Topic Key for filtering notifications by topic
53
53
  */
54
54
  topicKey?: string | undefined;
55
+ /**
56
+ * Subscription ID for filtering notifications by subscription
57
+ */
58
+ subscriptionId?: string | undefined;
55
59
  /**
56
60
  * Filter by exact context keys, order insensitive (format: "type:id")
57
61
  */
@@ -87,6 +91,7 @@ export type NotificationsControllerListNotificationsRequest$Outbound = {
87
91
  limit: number;
88
92
  transactionId?: string | undefined;
89
93
  topicKey?: string | undefined;
94
+ subscriptionId?: string | undefined;
90
95
  contextKeys?: Array<string> | undefined;
91
96
  after?: string | undefined;
92
97
  before?: string | undefined;
@@ -110,6 +115,7 @@ export const NotificationsControllerListNotificationsRequest$outboundSchema:
110
115
  limit: z.number().default(10),
111
116
  transactionId: z.string().optional(),
112
117
  topicKey: z.string().optional(),
118
+ subscriptionId: z.string().optional(),
113
119
  contextKeys: z.array(z.string()).optional(),
114
120
  after: z.string().optional(),
115
121
  before: z.string().optional(),
@@ -20,6 +20,10 @@ export type Criticality = ClosedEnum<typeof Criticality>;
20
20
  export type SubscribersControllerGetSubscriberPreferencesRequest = {
21
21
  subscriberId: string;
22
22
  criticality?: Criticality | undefined;
23
+ /**
24
+ * Context keys for filtering preferences (e.g., ["tenant:acme"])
25
+ */
26
+ contextKeys?: Array<string> | undefined;
23
27
  /**
24
28
  * A header for idempotency purposes
25
29
  */
@@ -39,6 +43,7 @@ export const Criticality$outboundSchema: z.ZodNativeEnum<typeof Criticality> = z
39
43
  export type SubscribersControllerGetSubscriberPreferencesRequest$Outbound = {
40
44
  subscriberId: string;
41
45
  criticality: string;
46
+ contextKeys?: Array<string> | undefined;
42
47
  "idempotency-key"?: string | undefined;
43
48
  };
44
49
 
@@ -51,6 +56,7 @@ export const SubscribersControllerGetSubscriberPreferencesRequest$outboundSchema
51
56
  > = z.object({
52
57
  subscriberId: z.string(),
53
58
  criticality: Criticality$outboundSchema.default("nonCritical"),
59
+ contextKeys: z.array(z.string()).optional(),
54
60
  idempotencyKey: z.string().optional(),
55
61
  }).transform((v) => {
56
62
  return remap$(v, {
@@ -61,6 +61,10 @@ export type SubscribersControllerListSubscriberTopicsRequest = {
61
61
  * Filter by topic key
62
62
  */
63
63
  key?: string | undefined;
64
+ /**
65
+ * Filter by exact context keys, order insensitive (format: "type:id")
66
+ */
67
+ contextKeys?: Array<string> | undefined;
64
68
  /**
65
69
  * A header for idempotency purposes
66
70
  */
@@ -90,6 +94,7 @@ export type SubscribersControllerListSubscriberTopicsRequest$Outbound = {
90
94
  orderBy?: string | undefined;
91
95
  includeCursor?: boolean | undefined;
92
96
  key?: string | undefined;
97
+ contextKeys?: Array<string> | undefined;
93
98
  "idempotency-key"?: string | undefined;
94
99
  };
95
100
 
@@ -110,6 +115,7 @@ export const SubscribersControllerListSubscriberTopicsRequest$outboundSchema:
110
115
  orderBy: z.string().optional(),
111
116
  includeCursor: z.boolean().optional(),
112
117
  key: z.string().optional(),
118
+ contextKeys: z.array(z.string()).optional(),
113
119
  idempotencyKey: z.string().optional(),
114
120
  }).transform((v) => {
115
121
  return remap$(v, {
@@ -0,0 +1,96 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type TopicsControllerGetTopicSubscriptionRequest = {
13
+ /**
14
+ * The key identifier of the topic
15
+ */
16
+ topicKey: string;
17
+ /**
18
+ * The unique identifier of the subscription
19
+ */
20
+ identifier: string;
21
+ /**
22
+ * A header for idempotency purposes
23
+ */
24
+ idempotencyKey?: string | undefined;
25
+ };
26
+
27
+ export type TopicsControllerGetTopicSubscriptionResponse = {
28
+ headers: { [k: string]: Array<string> };
29
+ result: components.SubscriptionDetailsResponseDto;
30
+ };
31
+
32
+ /** @internal */
33
+ export type TopicsControllerGetTopicSubscriptionRequest$Outbound = {
34
+ topicKey: string;
35
+ identifier: string;
36
+ "idempotency-key"?: string | undefined;
37
+ };
38
+
39
+ /** @internal */
40
+ export const TopicsControllerGetTopicSubscriptionRequest$outboundSchema:
41
+ z.ZodType<
42
+ TopicsControllerGetTopicSubscriptionRequest$Outbound,
43
+ z.ZodTypeDef,
44
+ TopicsControllerGetTopicSubscriptionRequest
45
+ > = z.object({
46
+ topicKey: z.string(),
47
+ identifier: z.string(),
48
+ idempotencyKey: z.string().optional(),
49
+ }).transform((v) => {
50
+ return remap$(v, {
51
+ idempotencyKey: "idempotency-key",
52
+ });
53
+ });
54
+
55
+ export function topicsControllerGetTopicSubscriptionRequestToJSON(
56
+ topicsControllerGetTopicSubscriptionRequest:
57
+ TopicsControllerGetTopicSubscriptionRequest,
58
+ ): string {
59
+ return JSON.stringify(
60
+ TopicsControllerGetTopicSubscriptionRequest$outboundSchema.parse(
61
+ topicsControllerGetTopicSubscriptionRequest,
62
+ ),
63
+ );
64
+ }
65
+
66
+ /** @internal */
67
+ export const TopicsControllerGetTopicSubscriptionResponse$inboundSchema:
68
+ z.ZodType<
69
+ TopicsControllerGetTopicSubscriptionResponse,
70
+ z.ZodTypeDef,
71
+ unknown
72
+ > = z.object({
73
+ Headers: z.record(z.array(z.string())).default({}),
74
+ Result: components.SubscriptionDetailsResponseDto$inboundSchema,
75
+ }).transform((v) => {
76
+ return remap$(v, {
77
+ "Headers": "headers",
78
+ "Result": "result",
79
+ });
80
+ });
81
+
82
+ export function topicsControllerGetTopicSubscriptionResponseFromJSON(
83
+ jsonString: string,
84
+ ): SafeParseResult<
85
+ TopicsControllerGetTopicSubscriptionResponse,
86
+ SDKValidationError
87
+ > {
88
+ return safeParse(
89
+ jsonString,
90
+ (x) =>
91
+ TopicsControllerGetTopicSubscriptionResponse$inboundSchema.parse(
92
+ JSON.parse(x),
93
+ ),
94
+ `Failed to parse 'TopicsControllerGetTopicSubscriptionResponse' from JSON`,
95
+ );
96
+ }
@@ -60,6 +60,10 @@ export type TopicsControllerListTopicSubscriptionsRequest = {
60
60
  * Filter by subscriber ID
61
61
  */
62
62
  subscriberId?: string | undefined;
63
+ /**
64
+ * Filter by exact context keys, order insensitive (format: "type:id")
65
+ */
66
+ contextKeys?: Array<string> | undefined;
63
67
  /**
64
68
  * A header for idempotency purposes
65
69
  */
@@ -89,6 +93,7 @@ export type TopicsControllerListTopicSubscriptionsRequest$Outbound = {
89
93
  orderBy?: string | undefined;
90
94
  includeCursor?: boolean | undefined;
91
95
  subscriberId?: string | undefined;
96
+ contextKeys?: Array<string> | undefined;
92
97
  "idempotency-key"?: string | undefined;
93
98
  };
94
99
 
@@ -109,6 +114,7 @@ export const TopicsControllerListTopicSubscriptionsRequest$outboundSchema:
109
114
  orderBy: z.string().optional(),
110
115
  includeCursor: z.boolean().optional(),
111
116
  subscriberId: z.string().optional(),
117
+ contextKeys: z.array(z.string()).optional(),
112
118
  idempotencyKey: z.string().optional(),
113
119
  }).transform((v) => {
114
120
  return remap$(v, {
@@ -17,7 +17,7 @@ export type TopicsControllerUpdateTopicSubscriptionRequest = {
17
17
  /**
18
18
  * The unique identifier of the subscription
19
19
  */
20
- subscriptionIdOrIdentifier: string;
20
+ identifier: string;
21
21
  /**
22
22
  * A header for idempotency purposes
23
23
  */
@@ -34,7 +34,7 @@ export type TopicsControllerUpdateTopicSubscriptionResponse = {
34
34
  /** @internal */
35
35
  export type TopicsControllerUpdateTopicSubscriptionRequest$Outbound = {
36
36
  topicKey: string;
37
- subscriptionIdOrIdentifier: string;
37
+ identifier: string;
38
38
  "idempotency-key"?: string | undefined;
39
39
  UpdateTopicSubscriptionRequestDto:
40
40
  components.UpdateTopicSubscriptionRequestDto$Outbound;
@@ -48,7 +48,7 @@ export const TopicsControllerUpdateTopicSubscriptionRequest$outboundSchema:
48
48
  TopicsControllerUpdateTopicSubscriptionRequest
49
49
  > = z.object({
50
50
  topicKey: z.string(),
51
- subscriptionIdOrIdentifier: z.string(),
51
+ identifier: z.string(),
52
52
  idempotencyKey: z.string().optional(),
53
53
  updateTopicSubscriptionRequestDto:
54
54
  components.UpdateTopicSubscriptionRequestDto$outboundSchema,
@@ -14,10 +14,10 @@ import { unwrapAsync } from "../types/fp.js";
14
14
 
15
15
  export class ChannelConnections extends ClientSDK {
16
16
  /**
17
- * List channel connections
17
+ * List all channel connections
18
18
  *
19
19
  * @remarks
20
- * Retrieve all channel connections for a resource.
20
+ * List all channel connections for a resource.
21
21
  */
22
22
  async list(
23
23
  request:
@@ -34,7 +34,7 @@ export class ChannelConnections extends ClientSDK {
34
34
  }
35
35
 
36
36
  /**
37
- * Create channel connection for a resource and integration
37
+ * Create a channel connection
38
38
  *
39
39
  * @remarks
40
40
  * Create a new channel connection for a resource for given integration. Only one channel connection is allowed per resource and integration.
@@ -56,7 +56,7 @@ export class ChannelConnections extends ClientSDK {
56
56
  }
57
57
 
58
58
  /**
59
- * Retrieve channel connection by identifier
59
+ * Retrieve a channel connection
60
60
  *
61
61
  * @remarks
62
62
  * Retrieve a specific channel connection by its unique identifier.
@@ -77,7 +77,7 @@ export class ChannelConnections extends ClientSDK {
77
77
  }
78
78
 
79
79
  /**
80
- * Update channel connection
80
+ * Update a channel connection
81
81
  *
82
82
  * @remarks
83
83
  * Update an existing channel connection by its unique identifier.
@@ -101,7 +101,7 @@ export class ChannelConnections extends ClientSDK {
101
101
  }
102
102
 
103
103
  /**
104
- * Delete channel connection
104
+ * Delete a channel connection
105
105
  *
106
106
  * @remarks
107
107
  * Delete a specific channel connection by its unique identifier.
@@ -14,10 +14,10 @@ import { unwrapAsync } from "../types/fp.js";
14
14
 
15
15
  export class ChannelEndpoints extends ClientSDK {
16
16
  /**
17
- * List channel endpoints
17
+ * List all channel endpoints
18
18
  *
19
19
  * @remarks
20
- * Retrieve all channel endpoints for a resource based on query filters.
20
+ * List all channel endpoints for a resource based on query filters.
21
21
  */
22
22
  async list(
23
23
  request: operations.ChannelEndpointsControllerListChannelEndpointsRequest,
@@ -33,7 +33,7 @@ export class ChannelEndpoints extends ClientSDK {
33
33
  }
34
34
 
35
35
  /**
36
- * Create channel endpoint for a resource
36
+ * Create a channel endpoint
37
37
  *
38
38
  * @remarks
39
39
  * Create a new channel endpoint for a resource.
@@ -55,7 +55,7 @@ export class ChannelEndpoints extends ClientSDK {
55
55
  }
56
56
 
57
57
  /**
58
- * Retrieve channel endpoint by identifier
58
+ * Retrieve a channel endpoint
59
59
  *
60
60
  * @remarks
61
61
  * Retrieve a specific channel endpoint by its unique identifier.
@@ -74,7 +74,7 @@ export class ChannelEndpoints extends ClientSDK {
74
74
  }
75
75
 
76
76
  /**
77
- * Update channel endpoint
77
+ * Update a channel endpoint
78
78
  *
79
79
  * @remarks
80
80
  * Update an existing channel endpoint by its unique identifier.
@@ -97,7 +97,7 @@ export class ChannelEndpoints extends ClientSDK {
97
97
  }
98
98
 
99
99
  /**
100
- * Delete channel endpoint by identifier
100
+ * Delete a channel endpoint
101
101
  *
102
102
  * @remarks
103
103
  * Delete a specific channel endpoint by its unique identifier.
@@ -19,16 +19,12 @@ export class Preferences extends ClientSDK {
19
19
  * This API returns all five channels preferences for all workflows and global preferences.
20
20
  */
21
21
  async list(
22
- subscriberId: string,
23
- criticality?: operations.Criticality | undefined,
24
- idempotencyKey?: string | undefined,
22
+ request: operations.SubscribersControllerGetSubscriberPreferencesRequest,
25
23
  options?: RequestOptions,
26
24
  ): Promise<operations.SubscribersControllerGetSubscriberPreferencesResponse> {
27
25
  return unwrapAsync(subscribersPreferencesList(
28
26
  this,
29
- subscriberId,
30
- criticality,
31
- idempotencyKey,
27
+ request,
32
28
  options,
33
29
  ));
34
30
  }
package/src/sdk/sdk.ts CHANGED
@@ -95,7 +95,7 @@ export class Novu extends ClientSDK {
95
95
  *
96
96
  * @remarks
97
97
  *
98
- * Trigger event is the main (and only) way to send notifications to subscribers. The trigger identifier is used to match the particular workflow associated with it. Additional information can be passed according the body interface below.
98
+ * Trigger event is the main (and only) way to send notifications to subscribers. The trigger identifier is used to match the particular workflow associated with it. Maximum number of recipients can be 100. Additional information can be passed according the body interface below.
99
99
  * To prevent duplicate triggers, you can optionally pass a **transactionId** in the request body. If the same **transactionId** is used again, the trigger will be ignored. The retention period depends on your billing tier.
100
100
  */
101
101
  async trigger(
@@ -4,6 +4,7 @@
4
4
 
5
5
  import { topicsSubscriptionsCreate } from "../funcs/topicsSubscriptionsCreate.js";
6
6
  import { topicsSubscriptionsDelete } from "../funcs/topicsSubscriptionsDelete.js";
7
+ import { topicsSubscriptionsGetSubscription } from "../funcs/topicsSubscriptionsGetSubscription.js";
7
8
  import { topicsSubscriptionsList } from "../funcs/topicsSubscriptionsList.js";
8
9
  import { topicsSubscriptionsUpdate } from "../funcs/topicsSubscriptionsUpdate.js";
9
10
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
@@ -75,11 +76,32 @@ export class Subscriptions extends ClientSDK {
75
76
  ));
76
77
  }
77
78
 
79
+ /**
80
+ * Get a topic subscription
81
+ *
82
+ * @remarks
83
+ * Get a subscription by its unique identifier for a topic.
84
+ */
85
+ async getSubscription(
86
+ topicKey: string,
87
+ identifier: string,
88
+ idempotencyKey?: string | undefined,
89
+ options?: RequestOptions,
90
+ ): Promise<operations.TopicsControllerGetTopicSubscriptionResponse> {
91
+ return unwrapAsync(topicsSubscriptionsGetSubscription(
92
+ this,
93
+ topicKey,
94
+ identifier,
95
+ idempotencyKey,
96
+ options,
97
+ ));
98
+ }
99
+
78
100
  /**
79
101
  * Update a topic subscription
80
102
  *
81
103
  * @remarks
82
- * Update a subscription by its unique identifier **subscriptionIdOrIdentifier** for a topic. You can update the preferences and name associated with the subscription.
104
+ * Update a subscription by its unique identifier for a topic. You can update the preferences and name associated with the subscription.
83
105
  */
84
106
  async update(
85
107
  request: operations.TopicsControllerUpdateTopicSubscriptionRequest,
@@ -1,24 +0,0 @@
1
- import * as z from "zod/v3";
2
- import { Result as SafeParseResult } from "../../types/fp.js";
3
- import { SDKValidationError } from "../errors/sdkvalidationerror.js";
4
- import { MetaDto } from "./metadto.js";
5
- import { SubscriptionDto } from "./subscriptiondto.js";
6
- import { SubscriptionErrorDto } from "./subscriptionerrordto.js";
7
- export type CreateTopicSubscriptionsResponseDto = {
8
- /**
9
- * The list of successfully created subscriptions
10
- */
11
- data: Array<SubscriptionDto>;
12
- /**
13
- * Metadata about the operation
14
- */
15
- meta: MetaDto;
16
- /**
17
- * The list of errors for failed subscription attempts
18
- */
19
- errors?: Array<SubscriptionErrorDto> | undefined;
20
- };
21
- /** @internal */
22
- export declare const CreateTopicSubscriptionsResponseDto$inboundSchema: z.ZodType<CreateTopicSubscriptionsResponseDto, z.ZodTypeDef, unknown>;
23
- export declare function createTopicSubscriptionsResponseDtoFromJSON(jsonString: string): SafeParseResult<CreateTopicSubscriptionsResponseDto, SDKValidationError>;
24
- //# sourceMappingURL=createtopicsubscriptionsresponsedto.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createtopicsubscriptionsresponsedto.d.ts","sourceRoot":"","sources":["../../src/models/components/createtopicsubscriptionsresponsedto.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,OAAO,EAAyB,MAAM,cAAc,CAAC;AAC9D,OAAO,EACL,eAAe,EAEhB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,oBAAoB,EAErB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,MAAM,mCAAmC,GAAG;IAChD;;OAEG;IACH,IAAI,EAAE,KAAK,CAAC,eAAe,CAAC,CAAC;IAC7B;;OAEG;IACH,IAAI,EAAE,OAAO,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC;CAClD,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,iDAAiD,EAAE,CAAC,CAAC,OAAO,CACvE,mCAAmC,EACnC,CAAC,CAAC,UAAU,EACZ,OAAO,CAKP,CAAC;AAEH,wBAAgB,2CAA2C,CACzD,UAAU,EAAE,MAAM,GACjB,eAAe,CAAC,mCAAmC,EAAE,kBAAkB,CAAC,CAO1E"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"createtopicsubscriptionsresponsedto.js","sourceRoot":"","sources":["../../src/models/components/createtopicsubscriptionsresponsedto.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CH,kGASC;AAjDD,0CAA4B;AAC5B,qDAAiD;AAGjD,6CAA8D;AAC9D,6DAG8B;AAC9B,uEAGmC;AAiBnC,gBAAgB;AACH,QAAA,iDAAiD,GAI1D,CAAC,CAAC,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,kDAA6B,CAAC;IAC5C,IAAI,EAAE,kCAAqB;IAC3B,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,4DAAkC,CAAC,CAAC,QAAQ,EAAE;CAC/D,CAAC,CAAC;AAEH,SAAgB,2CAA2C,CACzD,UAAkB;IAElB,OAAO,IAAA,sBAAS,EACd,UAAU,EACV,CAAC,CAAC,EAAE,EAAE,CACJ,yDAAiD,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EACxE,iEAAiE,CAClE,CAAC;AACJ,CAAC"}