@novu/api 0.0.5 → 0.1.1

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 (117) hide show
  1. package/FUNCTIONS.md +15 -8
  2. package/README.md +218 -45
  3. package/docs/sdks/credentials/README.md +44 -0
  4. package/docs/sdks/messages/README.md +8 -2
  5. package/docs/sdks/notifications/README.md +2 -32
  6. package/docs/sdks/novu/README.md +247 -244
  7. package/docs/sdks/novumessages/README.md +4 -4
  8. package/docs/sdks/novunotifications/README.md +4 -2
  9. package/docs/sdks/preferences/README.md +4 -4
  10. package/docs/sdks/properties/README.md +2 -2
  11. package/docs/sdks/subscribers/README.md +2 -4
  12. package/funcs/create.d.ts +9 -0
  13. package/funcs/create.d.ts.map +1 -0
  14. package/funcs/{healthControllerHealthCheck.js → create.js} +17 -16
  15. package/funcs/create.js.map +1 -0
  16. package/funcs/supportControllerFetchUserOrganizations.d.ts +10 -0
  17. package/funcs/supportControllerFetchUserOrganizations.d.ts.map +1 -0
  18. package/funcs/{generateRandomNumber.js → supportControllerFetchUserOrganizations.js} +16 -31
  19. package/funcs/supportControllerFetchUserOrganizations.js.map +1 -0
  20. package/jsr.json +1 -1
  21. package/lib/config.d.ts +3 -3
  22. package/lib/config.js +3 -3
  23. package/lib/schemas.d.ts +1 -1
  24. package/lib/schemas.d.ts.map +1 -1
  25. package/lib/schemas.js +4 -1
  26. package/lib/schemas.js.map +1 -1
  27. package/models/components/createsupportthreaddto.d.ts +29 -0
  28. package/models/components/createsupportthreaddto.d.ts.map +1 -0
  29. package/models/components/{idempotencetestingresponse.js → createsupportthreaddto.js} +19 -19
  30. package/models/components/createsupportthreaddto.js.map +1 -0
  31. package/models/components/index.d.ts +2 -3
  32. package/models/components/index.d.ts.map +1 -1
  33. package/models/components/index.js +2 -3
  34. package/models/components/index.js.map +1 -1
  35. package/models/components/plaincardrequestdto.d.ts +100 -0
  36. package/models/components/plaincardrequestdto.d.ts.map +1 -0
  37. package/models/components/plaincardrequestdto.js +139 -0
  38. package/models/components/plaincardrequestdto.js.map +1 -0
  39. package/models/errors/index.d.ts +0 -1
  40. package/models/errors/index.d.ts.map +1 -1
  41. package/models/errors/index.js +0 -1
  42. package/models/errors/index.js.map +1 -1
  43. package/models/operations/index.d.ts +2 -3
  44. package/models/operations/index.d.ts.map +1 -1
  45. package/models/operations/index.js +2 -3
  46. package/models/operations/index.js.map +1 -1
  47. package/models/operations/supportcontrollercreatethread.d.ts +35 -0
  48. package/models/operations/supportcontrollercreatethread.d.ts.map +1 -0
  49. package/models/operations/supportcontrollercreatethread.js +73 -0
  50. package/models/operations/supportcontrollercreatethread.js.map +1 -0
  51. package/models/operations/supportcontrollerfetchuserorganizations.d.ts +56 -0
  52. package/models/operations/supportcontrollerfetchuserorganizations.d.ts.map +1 -0
  53. package/models/operations/supportcontrollerfetchuserorganizations.js +96 -0
  54. package/models/operations/supportcontrollerfetchuserorganizations.js.map +1 -0
  55. package/package.json +5 -1
  56. package/sdk/sdk.d.ts +8 -3
  57. package/sdk/sdk.d.ts.map +1 -1
  58. package/sdk/sdk.js +14 -12
  59. package/sdk/sdk.js.map +1 -1
  60. package/sources/json-development.json +116 -1161
  61. package/src/funcs/{testIdempotency.ts → create.ts} +15 -57
  62. package/src/funcs/{healthControllerHealthCheck.ts → supportControllerFetchUserOrganizations.ts} +22 -25
  63. package/src/lib/config.ts +3 -3
  64. package/src/lib/schemas.ts +5 -0
  65. package/src/models/components/createsupportthreaddto.ts +66 -0
  66. package/src/models/components/index.ts +2 -3
  67. package/src/models/components/plaincardrequestdto.ts +223 -0
  68. package/src/models/errors/index.ts +0 -1
  69. package/src/models/operations/index.ts +2 -3
  70. package/src/models/operations/supportcontrollercreatethread.ts +90 -0
  71. package/src/models/operations/supportcontrollerfetchuserorganizations.ts +163 -0
  72. package/src/sdk/sdk.ts +34 -38
  73. package/funcs/generateRandomNumber.d.ts +0 -10
  74. package/funcs/generateRandomNumber.d.ts.map +0 -1
  75. package/funcs/generateRandomNumber.js.map +0 -1
  76. package/funcs/healthControllerHealthCheck.d.ts +0 -10
  77. package/funcs/healthControllerHealthCheck.d.ts.map +0 -1
  78. package/funcs/healthControllerHealthCheck.js.map +0 -1
  79. package/funcs/testIdempotency.d.ts +0 -11
  80. package/funcs/testIdempotency.d.ts.map +0 -1
  81. package/funcs/testIdempotency.js +0 -129
  82. package/funcs/testIdempotency.js.map +0 -1
  83. package/models/components/idempotencetestingresponse.d.ts +0 -32
  84. package/models/components/idempotencetestingresponse.d.ts.map +0 -1
  85. package/models/components/idempotencetestingresponse.js.map +0 -1
  86. package/models/components/idempotencybehaviorenum.d.ts +0 -37
  87. package/models/components/idempotencybehaviorenum.d.ts.map +0 -1
  88. package/models/components/idempotencybehaviorenum.js +0 -54
  89. package/models/components/idempotencybehaviorenum.js.map +0 -1
  90. package/models/components/idempotencytestingdto.d.ts +0 -33
  91. package/models/components/idempotencytestingdto.d.ts.map +0 -1
  92. package/models/components/idempotencytestingdto.js +0 -60
  93. package/models/components/idempotencytestingdto.js.map +0 -1
  94. package/models/errors/healthcontrollerhealthcheck.d.ts +0 -153
  95. package/models/errors/healthcontrollerhealthcheck.d.ts.map +0 -1
  96. package/models/errors/healthcontrollerhealthcheck.js +0 -190
  97. package/models/errors/healthcontrollerhealthcheck.js.map +0 -1
  98. package/models/operations/healthcontrollergeneraterandomnumber.d.ts +0 -64
  99. package/models/operations/healthcontrollergeneraterandomnumber.d.ts.map +0 -1
  100. package/models/operations/healthcontrollergeneraterandomnumber.js +0 -108
  101. package/models/operations/healthcontrollergeneraterandomnumber.js.map +0 -1
  102. package/models/operations/healthcontrollerhealthcheck.d.ts +0 -165
  103. package/models/operations/healthcontrollerhealthcheck.d.ts.map +0 -1
  104. package/models/operations/healthcontrollerhealthcheck.js +0 -206
  105. package/models/operations/healthcontrollerhealthcheck.js.map +0 -1
  106. package/models/operations/healthcontrollertestidempotency.d.ts +0 -66
  107. package/models/operations/healthcontrollertestidempotency.d.ts.map +0 -1
  108. package/models/operations/healthcontrollertestidempotency.js +0 -112
  109. package/models/operations/healthcontrollertestidempotency.js.map +0 -1
  110. package/src/funcs/generateRandomNumber.ts +0 -183
  111. package/src/models/components/idempotencetestingresponse.ts +0 -69
  112. package/src/models/components/idempotencybehaviorenum.ts +0 -42
  113. package/src/models/components/idempotencytestingdto.ts +0 -74
  114. package/src/models/errors/healthcontrollerhealthcheck.ts +0 -291
  115. package/src/models/operations/healthcontrollergeneraterandomnumber.ts +0 -177
  116. package/src/models/operations/healthcontrollerhealthcheck.ts +0 -358
  117. package/src/models/operations/healthcontrollertestidempotency.ts +0 -174
@@ -9,86 +9,20 @@ Novu Documentation
9
9
 
10
10
  ### Available Operations
11
11
 
12
- * [healthControllerHealthCheck](#healthcontrollerhealthcheck)
13
- * [testIdempotency](#testidempotency)
14
- * [generateRandomNumber](#generaterandomnumber)
15
12
  * [trigger](#trigger) - Trigger event
16
13
  * [triggerBulk](#triggerbulk) - Bulk trigger event
17
14
  * [triggerBroadcast](#triggerbroadcast) - Broadcast event to all
18
15
  * [cancel](#cancel) - Cancel triggered event
16
+ * [supportControllerFetchUserOrganizations](#supportcontrollerfetchuserorganizations)
17
+ * [create](#create)
19
18
 
20
- ## healthControllerHealthCheck
21
-
22
- ### Example Usage
23
-
24
- ```typescript
25
- import { Novu } from "@novu/api";
26
-
27
- const novu = new Novu({
28
- apiKey: "<YOUR_API_KEY_HERE>",
29
- });
30
-
31
- async function run() {
32
- const result = await novu.healthControllerHealthCheck();
33
-
34
- // Handle the result
35
- console.log(result);
36
- }
37
-
38
- run();
39
- ```
40
-
41
- ### Standalone function
42
-
43
- The standalone function version of this method:
44
-
45
- ```typescript
46
- import { NovuCore } from "@novu/api/core.js";
47
- import { healthControllerHealthCheck } from "@novu/api/funcs/healthControllerHealthCheck.js";
48
-
49
- // Use `NovuCore` for best tree-shaking performance.
50
- // You can create one instance of it to use across an application.
51
- const novu = new NovuCore({
52
- apiKey: "<YOUR_API_KEY_HERE>",
53
- });
54
-
55
- async function run() {
56
- const res = await healthControllerHealthCheck(novu);
57
-
58
- if (!res.ok) {
59
- throw res.error;
60
- }
61
-
62
- const { value: result } = res;
63
-
64
- // Handle the result
65
- console.log(result);
66
- }
67
-
68
- run();
69
- ```
70
-
71
- ### Parameters
72
-
73
- | Parameter | Type | Required | Description |
74
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
75
- | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
76
- | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
77
- | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
78
- | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
79
-
80
- ### Response
81
-
82
- **Promise\<[operations.HealthControllerHealthCheckResponseBody](../../models/operations/healthcontrollerhealthcheckresponsebody.md)\>**
83
-
84
- ### Errors
19
+ ## trigger
85
20
 
86
- | Error Type | Status Code | Content Type |
87
- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- |
88
- | errors.HealthControllerHealthCheckResponseBody | 503 | application/json |
89
- | errors.SDKError | 4XX, 5XX | \*/\* |
90
21
 
91
- ## testIdempotency
22
+ Trigger event is the main (and only) way to send notifications to subscribers.
23
+ The trigger identifier is used to match the particular workflow associated with it.
24
+ Additional information can be passed according the body interface below.
25
+
92
26
 
93
27
  ### Example Usage
94
28
 
@@ -100,8 +34,25 @@ const novu = new Novu({
100
34
  });
101
35
 
102
36
  async function run() {
103
- const result = await novu.testIdempotency({
104
- expectedBehavior: "IMMEDIATE_EXCEPTION",
37
+ const result = await novu.trigger({
38
+ name: "workflow_identifier",
39
+ payload: {
40
+ "comment_id": "string",
41
+ "post": {
42
+ "text": "string",
43
+ },
44
+ },
45
+ bridgeUrl: "https://example.com/bridge",
46
+ overrides: {
47
+ "fcm": {
48
+ "data": {
49
+ "key": "value",
50
+ },
51
+ },
52
+ },
53
+ to: {
54
+ subscriberId: "<id>",
55
+ },
105
56
  });
106
57
 
107
58
  // Handle the result
@@ -117,7 +68,7 @@ The standalone function version of this method:
117
68
 
118
69
  ```typescript
119
70
  import { NovuCore } from "@novu/api/core.js";
120
- import { testIdempotency } from "@novu/api/funcs/testIdempotency.js";
71
+ import { trigger } from "@novu/api/funcs/trigger.js";
121
72
 
122
73
  // Use `NovuCore` for best tree-shaking performance.
123
74
  // You can create one instance of it to use across an application.
@@ -126,8 +77,25 @@ const novu = new NovuCore({
126
77
  });
127
78
 
128
79
  async function run() {
129
- const res = await testIdempotency(novu, {
130
- expectedBehavior: "IMMEDIATE_EXCEPTION",
80
+ const res = await trigger(novu, {
81
+ name: "workflow_identifier",
82
+ payload: {
83
+ "comment_id": "string",
84
+ "post": {
85
+ "text": "string",
86
+ },
87
+ },
88
+ bridgeUrl: "https://example.com/bridge",
89
+ overrides: {
90
+ "fcm": {
91
+ "data": {
92
+ "key": "value",
93
+ },
94
+ },
95
+ },
96
+ to: {
97
+ subscriberId: "<id>",
98
+ },
131
99
  });
132
100
 
133
101
  if (!res.ok) {
@@ -147,7 +115,7 @@ run();
147
115
 
148
116
  | Parameter | Type | Required | Description |
149
117
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
150
- | `idempotencyTestingDto` | [components.IdempotencyTestingDto](../../models/components/idempotencytestingdto.md) | :heavy_check_mark: | N/A |
118
+ | `triggerEventRequestDto` | [components.TriggerEventRequestDto](../../models/components/triggereventrequestdto.md) | :heavy_check_mark: | N/A |
151
119
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
152
120
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
153
121
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -155,7 +123,7 @@ run();
155
123
 
156
124
  ### Response
157
125
 
158
- **Promise\<[operations.HealthControllerTestIdempotencyResponse](../../models/operations/healthcontrollertestidempotencyresponse.md)\>**
126
+ **Promise\<[operations.EventsControllerTriggerResponse](../../models/operations/eventscontrollertriggerresponse.md)\>**
159
127
 
160
128
  ### Errors
161
129
 
@@ -167,7 +135,12 @@ run();
167
135
  | errors.ErrorDto | 500 | application/json |
168
136
  | errors.SDKError | 4XX, 5XX | \*/\* |
169
137
 
170
- ## generateRandomNumber
138
+ ## triggerBulk
139
+
140
+
141
+ Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.
142
+ The bulk API is limited to 100 events per request.
143
+
171
144
 
172
145
  ### Example Usage
173
146
 
@@ -179,7 +152,74 @@ const novu = new Novu({
179
152
  });
180
153
 
181
154
  async function run() {
182
- const result = await novu.generateRandomNumber();
155
+ const result = await novu.triggerBulk({
156
+ events: [
157
+ {
158
+ name: "workflow_identifier",
159
+ payload: {
160
+ "comment_id": "string",
161
+ "post": {
162
+ "text": "string",
163
+ },
164
+ },
165
+ bridgeUrl: "https://example.com/bridge",
166
+ overrides: {
167
+ "fcm": {
168
+ "data": {
169
+ "key": "value",
170
+ },
171
+ },
172
+ },
173
+ to: {
174
+ subscriberId: "<id>",
175
+ },
176
+ },
177
+ {
178
+ name: "workflow_identifier",
179
+ payload: {
180
+ "comment_id": "string",
181
+ "post": {
182
+ "text": "string",
183
+ },
184
+ },
185
+ bridgeUrl: "https://example.com/bridge",
186
+ overrides: {
187
+ "fcm": {
188
+ "data": {
189
+ "key": "value",
190
+ },
191
+ },
192
+ },
193
+ to: [
194
+ {
195
+ topicKey: "<value>",
196
+ type: "Subscriber",
197
+ },
198
+ ],
199
+ },
200
+ {
201
+ name: "workflow_identifier",
202
+ payload: {
203
+ "comment_id": "string",
204
+ "post": {
205
+ "text": "string",
206
+ },
207
+ },
208
+ bridgeUrl: "https://example.com/bridge",
209
+ overrides: {
210
+ "fcm": {
211
+ "data": {
212
+ "key": "value",
213
+ },
214
+ },
215
+ },
216
+ to: [
217
+ "SUBSCRIBER_ID",
218
+ "SUBSCRIBER_ID",
219
+ ],
220
+ },
221
+ ],
222
+ });
183
223
 
184
224
  // Handle the result
185
225
  console.log(result);
@@ -194,7 +234,7 @@ The standalone function version of this method:
194
234
 
195
235
  ```typescript
196
236
  import { NovuCore } from "@novu/api/core.js";
197
- import { generateRandomNumber } from "@novu/api/funcs/generateRandomNumber.js";
237
+ import { triggerBulk } from "@novu/api/funcs/triggerBulk.js";
198
238
 
199
239
  // Use `NovuCore` for best tree-shaking performance.
200
240
  // You can create one instance of it to use across an application.
@@ -203,7 +243,74 @@ const novu = new NovuCore({
203
243
  });
204
244
 
205
245
  async function run() {
206
- const res = await generateRandomNumber(novu);
246
+ const res = await triggerBulk(novu, {
247
+ events: [
248
+ {
249
+ name: "workflow_identifier",
250
+ payload: {
251
+ "comment_id": "string",
252
+ "post": {
253
+ "text": "string",
254
+ },
255
+ },
256
+ bridgeUrl: "https://example.com/bridge",
257
+ overrides: {
258
+ "fcm": {
259
+ "data": {
260
+ "key": "value",
261
+ },
262
+ },
263
+ },
264
+ to: {
265
+ subscriberId: "<id>",
266
+ },
267
+ },
268
+ {
269
+ name: "workflow_identifier",
270
+ payload: {
271
+ "comment_id": "string",
272
+ "post": {
273
+ "text": "string",
274
+ },
275
+ },
276
+ bridgeUrl: "https://example.com/bridge",
277
+ overrides: {
278
+ "fcm": {
279
+ "data": {
280
+ "key": "value",
281
+ },
282
+ },
283
+ },
284
+ to: [
285
+ {
286
+ topicKey: "<value>",
287
+ type: "Subscriber",
288
+ },
289
+ ],
290
+ },
291
+ {
292
+ name: "workflow_identifier",
293
+ payload: {
294
+ "comment_id": "string",
295
+ "post": {
296
+ "text": "string",
297
+ },
298
+ },
299
+ bridgeUrl: "https://example.com/bridge",
300
+ overrides: {
301
+ "fcm": {
302
+ "data": {
303
+ "key": "value",
304
+ },
305
+ },
306
+ },
307
+ to: [
308
+ "SUBSCRIBER_ID",
309
+ "SUBSCRIBER_ID",
310
+ ],
311
+ },
312
+ ],
313
+ });
207
314
 
208
315
  if (!res.ok) {
209
316
  throw res.error;
@@ -222,6 +329,7 @@ run();
222
329
 
223
330
  | Parameter | Type | Required | Description |
224
331
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
332
+ | `bulkTriggerEventDto` | [components.BulkTriggerEventDto](../../models/components/bulktriggereventdto.md) | :heavy_check_mark: | N/A |
225
333
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
226
334
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
227
335
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -229,7 +337,7 @@ run();
229
337
 
230
338
  ### Response
231
339
 
232
- **Promise\<[operations.HealthControllerGenerateRandomNumberResponse](../../models/operations/healthcontrollergeneraterandomnumberresponse.md)\>**
340
+ **Promise\<[operations.EventsControllerTriggerBulkResponse](../../models/operations/eventscontrollertriggerbulkresponse.md)\>**
233
341
 
234
342
  ### Errors
235
343
 
@@ -241,13 +349,10 @@ run();
241
349
  | errors.ErrorDto | 500 | application/json |
242
350
  | errors.SDKError | 4XX, 5XX | \*/\* |
243
351
 
244
- ## trigger
245
-
352
+ ## triggerBroadcast
246
353
 
247
- Trigger event is the main (and only) way to send notifications to subscribers.
248
- The trigger identifier is used to match the particular workflow associated with it.
249
- Additional information can be passed according the body interface below.
250
-
354
+ Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc.
355
+ In the future could be used to trigger events to a subset of subscribers based on defined filters.
251
356
 
252
357
  ### Example Usage
253
358
 
@@ -259,18 +364,14 @@ const novu = new Novu({
259
364
  });
260
365
 
261
366
  async function run() {
262
- const result = await novu.trigger({
263
- name: "workflow_identifier",
264
- to: [
265
- {
266
- topicKey: "<value>",
267
- type: "Topic",
268
- },
269
- {
270
- topicKey: "<value>",
271
- type: "Topic",
367
+ const result = await novu.triggerBroadcast({
368
+ name: "<value>",
369
+ payload: {
370
+ "comment_id": "string",
371
+ "post": {
372
+ "text": "string",
272
373
  },
273
- ],
374
+ },
274
375
  });
275
376
 
276
377
  // Handle the result
@@ -286,7 +387,7 @@ The standalone function version of this method:
286
387
 
287
388
  ```typescript
288
389
  import { NovuCore } from "@novu/api/core.js";
289
- import { trigger } from "@novu/api/funcs/trigger.js";
390
+ import { triggerBroadcast } from "@novu/api/funcs/triggerBroadcast.js";
290
391
 
291
392
  // Use `NovuCore` for best tree-shaking performance.
292
393
  // You can create one instance of it to use across an application.
@@ -295,18 +396,14 @@ const novu = new NovuCore({
295
396
  });
296
397
 
297
398
  async function run() {
298
- const res = await trigger(novu, {
299
- name: "workflow_identifier",
300
- to: [
301
- {
302
- topicKey: "<value>",
303
- type: "Topic",
304
- },
305
- {
306
- topicKey: "<value>",
307
- type: "Topic",
399
+ const res = await triggerBroadcast(novu, {
400
+ name: "<value>",
401
+ payload: {
402
+ "comment_id": "string",
403
+ "post": {
404
+ "text": "string",
308
405
  },
309
- ],
406
+ },
310
407
  });
311
408
 
312
409
  if (!res.ok) {
@@ -326,7 +423,7 @@ run();
326
423
 
327
424
  | Parameter | Type | Required | Description |
328
425
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
329
- | `triggerEventRequestDto` | [components.TriggerEventRequestDto](../../models/components/triggereventrequestdto.md) | :heavy_check_mark: | N/A |
426
+ | `triggerEventToAllRequestDto` | [components.TriggerEventToAllRequestDto](../../models/components/triggereventtoallrequestdto.md) | :heavy_check_mark: | N/A |
330
427
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
331
428
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
332
429
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -334,7 +431,7 @@ run();
334
431
 
335
432
  ### Response
336
433
 
337
- **Promise\<[operations.EventsControllerTriggerResponse](../../models/operations/eventscontrollertriggerresponse.md)\>**
434
+ **Promise\<[operations.EventsControllerBroadcastEventToAllResponse](../../models/operations/eventscontrollerbroadcasteventtoallresponse.md)\>**
338
435
 
339
436
  ### Errors
340
437
 
@@ -346,11 +443,11 @@ run();
346
443
  | errors.ErrorDto | 500 | application/json |
347
444
  | errors.SDKError | 4XX, 5XX | \*/\* |
348
445
 
349
- ## triggerBulk
446
+ ## cancel
350
447
 
351
448
 
352
- Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.
353
- The bulk API is limited to 100 events per request.
449
+ Using a previously generated transactionId during the event trigger,
450
+ will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...
354
451
 
355
452
 
356
453
  ### Example Usage
@@ -363,41 +460,7 @@ const novu = new Novu({
363
460
  });
364
461
 
365
462
  async function run() {
366
- const result = await novu.triggerBulk({
367
- events: [
368
- {
369
- name: "workflow_identifier",
370
- to: [
371
- {
372
- topicKey: "<value>",
373
- type: "Topic",
374
- },
375
- {
376
- subscriberId: "<id>",
377
- },
378
- ],
379
- },
380
- {
381
- name: "workflow_identifier",
382
- to: [
383
-
384
- ],
385
- },
386
- {
387
- name: "workflow_identifier",
388
- to: [
389
- {
390
- topicKey: "<value>",
391
- type: "Topic",
392
- },
393
- {
394
- topicKey: "<value>",
395
- type: "Topic",
396
- },
397
- ],
398
- },
399
- ],
400
- });
463
+ const result = await novu.cancel("<id>");
401
464
 
402
465
  // Handle the result
403
466
  console.log(result);
@@ -412,7 +475,7 @@ The standalone function version of this method:
412
475
 
413
476
  ```typescript
414
477
  import { NovuCore } from "@novu/api/core.js";
415
- import { triggerBulk } from "@novu/api/funcs/triggerBulk.js";
478
+ import { cancel } from "@novu/api/funcs/cancel.js";
416
479
 
417
480
  // Use `NovuCore` for best tree-shaking performance.
418
481
  // You can create one instance of it to use across an application.
@@ -421,41 +484,7 @@ const novu = new NovuCore({
421
484
  });
422
485
 
423
486
  async function run() {
424
- const res = await triggerBulk(novu, {
425
- events: [
426
- {
427
- name: "workflow_identifier",
428
- to: [
429
- {
430
- topicKey: "<value>",
431
- type: "Topic",
432
- },
433
- {
434
- subscriberId: "<id>",
435
- },
436
- ],
437
- },
438
- {
439
- name: "workflow_identifier",
440
- to: [
441
-
442
- ],
443
- },
444
- {
445
- name: "workflow_identifier",
446
- to: [
447
- {
448
- topicKey: "<value>",
449
- type: "Topic",
450
- },
451
- {
452
- topicKey: "<value>",
453
- type: "Topic",
454
- },
455
- ],
456
- },
457
- ],
458
- });
487
+ const res = await cancel(novu, "<id>");
459
488
 
460
489
  if (!res.ok) {
461
490
  throw res.error;
@@ -474,7 +503,7 @@ run();
474
503
 
475
504
  | Parameter | Type | Required | Description |
476
505
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
477
- | `bulkTriggerEventDto` | [components.BulkTriggerEventDto](../../models/components/bulktriggereventdto.md) | :heavy_check_mark: | N/A |
506
+ | `transactionId` | *string* | :heavy_check_mark: | N/A |
478
507
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
479
508
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
480
509
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -482,7 +511,7 @@ run();
482
511
 
483
512
  ### Response
484
513
 
485
- **Promise\<[operations.EventsControllerTriggerBulkResponse](../../models/operations/eventscontrollertriggerbulkresponse.md)\>**
514
+ **Promise\<[operations.EventsControllerCancelResponse](../../models/operations/eventscontrollercancelresponse.md)\>**
486
515
 
487
516
  ### Errors
488
517
 
@@ -494,10 +523,7 @@ run();
494
523
  | errors.ErrorDto | 500 | application/json |
495
524
  | errors.SDKError | 4XX, 5XX | \*/\* |
496
525
 
497
- ## triggerBroadcast
498
-
499
- Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc.
500
- In the future could be used to trigger events to a subset of subscribers based on defined filters.
526
+ ## supportControllerFetchUserOrganizations
501
527
 
502
528
  ### Example Usage
503
529
 
@@ -509,14 +535,8 @@ const novu = new Novu({
509
535
  });
510
536
 
511
537
  async function run() {
512
- const result = await novu.triggerBroadcast({
513
- name: "<value>",
514
- payload: {
515
- "comment_id": "string",
516
- "post": {
517
- "text": "string",
518
- },
519
- },
538
+ const result = await novu.supportControllerFetchUserOrganizations({
539
+ timestamp: "<value>",
520
540
  });
521
541
 
522
542
  // Handle the result
@@ -532,7 +552,7 @@ The standalone function version of this method:
532
552
 
533
553
  ```typescript
534
554
  import { NovuCore } from "@novu/api/core.js";
535
- import { triggerBroadcast } from "@novu/api/funcs/triggerBroadcast.js";
555
+ import { supportControllerFetchUserOrganizations } from "@novu/api/funcs/supportControllerFetchUserOrganizations.js";
536
556
 
537
557
  // Use `NovuCore` for best tree-shaking performance.
538
558
  // You can create one instance of it to use across an application.
@@ -541,14 +561,8 @@ const novu = new NovuCore({
541
561
  });
542
562
 
543
563
  async function run() {
544
- const res = await triggerBroadcast(novu, {
545
- name: "<value>",
546
- payload: {
547
- "comment_id": "string",
548
- "post": {
549
- "text": "string",
550
- },
551
- },
564
+ const res = await supportControllerFetchUserOrganizations(novu, {
565
+ timestamp: "<value>",
552
566
  });
553
567
 
554
568
  if (!res.ok) {
@@ -568,7 +582,7 @@ run();
568
582
 
569
583
  | Parameter | Type | Required | Description |
570
584
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
571
- | `triggerEventToAllRequestDto` | [components.TriggerEventToAllRequestDto](../../models/components/triggereventtoallrequestdto.md) | :heavy_check_mark: | N/A |
585
+ | `plainCardRequestDto` | [components.PlainCardRequestDto](../../models/components/plaincardrequestdto.md) | :heavy_check_mark: | N/A |
572
586
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
573
587
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
574
588
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -576,24 +590,15 @@ run();
576
590
 
577
591
  ### Response
578
592
 
579
- **Promise\<[operations.EventsControllerBroadcastEventToAllResponse](../../models/operations/eventscontrollerbroadcasteventtoallresponse.md)\>**
593
+ **Promise\<[operations.SupportControllerFetchUserOrganizationsResponseBody](../../models/operations/supportcontrollerfetchuserorganizationsresponsebody.md)\>**
580
594
 
581
595
  ### Errors
582
596
 
583
- | Error Type | Status Code | Content Type |
584
- | -------------------------------------- | -------------------------------------- | -------------------------------------- |
585
- | errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
586
- | errors.ErrorDto | 414 | application/json |
587
- | errors.ValidationErrorDto | 422 | application/json |
588
- | errors.ErrorDto | 500 | application/json |
589
- | errors.SDKError | 4XX, 5XX | \*/\* |
590
-
591
- ## cancel
592
-
597
+ | Error Type | Status Code | Content Type |
598
+ | --------------- | --------------- | --------------- |
599
+ | errors.SDKError | 4XX, 5XX | \*/\* |
593
600
 
594
- Using a previously generated transactionId during the event trigger,
595
- will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...
596
-
601
+ ## create
597
602
 
598
603
  ### Example Usage
599
604
 
@@ -605,10 +610,11 @@ const novu = new Novu({
605
610
  });
606
611
 
607
612
  async function run() {
608
- const result = await novu.cancel("<id>");
613
+ await novu.create({
614
+ text: "<value>",
615
+ });
616
+
609
617
 
610
- // Handle the result
611
- console.log(result);
612
618
  }
613
619
 
614
620
  run();
@@ -620,7 +626,7 @@ The standalone function version of this method:
620
626
 
621
627
  ```typescript
622
628
  import { NovuCore } from "@novu/api/core.js";
623
- import { cancel } from "@novu/api/funcs/cancel.js";
629
+ import { create } from "@novu/api/funcs/create.js";
624
630
 
625
631
  // Use `NovuCore` for best tree-shaking performance.
626
632
  // You can create one instance of it to use across an application.
@@ -629,7 +635,9 @@ const novu = new NovuCore({
629
635
  });
630
636
 
631
637
  async function run() {
632
- const res = await cancel(novu, "<id>");
638
+ const res = await create(novu, {
639
+ text: "<value>",
640
+ });
633
641
 
634
642
  if (!res.ok) {
635
643
  throw res.error;
@@ -637,8 +645,7 @@ async function run() {
637
645
 
638
646
  const { value: result } = res;
639
647
 
640
- // Handle the result
641
- console.log(result);
648
+
642
649
  }
643
650
 
644
651
  run();
@@ -648,7 +655,7 @@ run();
648
655
 
649
656
  | Parameter | Type | Required | Description |
650
657
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
651
- | `transactionId` | *string* | :heavy_check_mark: | N/A |
658
+ | `createSupportThreadDto` | [components.CreateSupportThreadDto](../../models/components/createsupportthreaddto.md) | :heavy_check_mark: | N/A |
652
659
  | `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
653
660
  | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
654
661
  | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
@@ -656,14 +663,10 @@ run();
656
663
 
657
664
  ### Response
658
665
 
659
- **Promise\<[operations.EventsControllerCancelResponse](../../models/operations/eventscontrollercancelresponse.md)\>**
666
+ **Promise\<void\>**
660
667
 
661
668
  ### Errors
662
669
 
663
- | Error Type | Status Code | Content Type |
664
- | -------------------------------------- | -------------------------------------- | -------------------------------------- |
665
- | errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
666
- | errors.ErrorDto | 414 | application/json |
667
- | errors.ValidationErrorDto | 422 | application/json |
668
- | errors.ErrorDto | 500 | application/json |
669
- | errors.SDKError | 4XX, 5XX | \*/\* |
670
+ | Error Type | Status Code | Content Type |
671
+ | --------------- | --------------- | --------------- |
672
+ | errors.SDKError | 4XX, 5XX | \*/\* |