@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
package/FUNCTIONS.md CHANGED
@@ -32,16 +32,23 @@ const novu = new NovuCore({
32
32
  async function run() {
33
33
  const res = await trigger(novu, {
34
34
  name: "workflow_identifier",
35
- to: [
36
- {
37
- topicKey: "<value>",
38
- type: "Topic",
35
+ payload: {
36
+ "comment_id": "string",
37
+ "post": {
38
+ "text": "string",
39
39
  },
40
- {
41
- topicKey: "<value>",
42
- type: "Topic",
40
+ },
41
+ bridgeUrl: "https://example.com/bridge",
42
+ overrides: {
43
+ "fcm": {
44
+ "data": {
45
+ "key": "value",
46
+ },
43
47
  },
44
- ],
48
+ },
49
+ to: {
50
+ subscriberId: "<id>",
51
+ },
45
52
  });
46
53
 
47
54
  switch (true) {
package/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  <div align="center">
2
- <img src="https://github.com/speakeasy-sdks/novu-ts/assets/68016351/dabaa829-32c8-451b-b912-0fa1d10300bd" width="500">
2
+ <img src="https://raw.githubusercontent.com/novuhq/novu-ts/HEAD/assets/banner.png" width="500">
3
3
  <p>Novu is an open-source notification infrastructure.</p>
4
4
  <a href="https://docs.novu.co/api-reference/overview"><img src="https://img.shields.io/static/v1?label=Docs&message=API Ref&color=000000&style=for-the-badge" /></a>
5
5
  <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-blue.svg?style=for-the-badge" /></a>
@@ -89,16 +89,23 @@ const novu = new Novu({
89
89
  async function run() {
90
90
  const result = await novu.trigger({
91
91
  name: "workflow_identifier",
92
- to: [
93
- {
94
- topicKey: "<value>",
95
- type: "Topic",
92
+ payload: {
93
+ "comment_id": "string",
94
+ "post": {
95
+ "text": "string",
96
96
  },
97
- {
98
- topicKey: "<value>",
99
- type: "Topic",
97
+ },
98
+ bridgeUrl: "https://example.com/bridge",
99
+ overrides: {
100
+ "fcm": {
101
+ "data": {
102
+ "key": "value",
103
+ },
100
104
  },
101
- ],
105
+ },
106
+ to: {
107
+ subscriberId: "<id>",
108
+ },
102
109
  });
103
110
 
104
111
  // Handle the result
@@ -123,31 +130,66 @@ async function run() {
123
130
  events: [
124
131
  {
125
132
  name: "workflow_identifier",
126
- to: [
127
- {
128
- topicKey: "<value>",
129
- type: "Topic",
133
+ payload: {
134
+ "comment_id": "string",
135
+ "post": {
136
+ "text": "string",
130
137
  },
131
- {
132
- subscriberId: "<id>",
138
+ },
139
+ bridgeUrl: "https://example.com/bridge",
140
+ overrides: {
141
+ "fcm": {
142
+ "data": {
143
+ "key": "value",
144
+ },
133
145
  },
134
- ],
135
- },
136
- {
137
- name: "workflow_identifier",
138
- to: [],
146
+ },
147
+ to: {
148
+ subscriberId: "<id>",
149
+ },
139
150
  },
140
151
  {
141
152
  name: "workflow_identifier",
153
+ payload: {
154
+ "comment_id": "string",
155
+ "post": {
156
+ "text": "string",
157
+ },
158
+ },
159
+ bridgeUrl: "https://example.com/bridge",
160
+ overrides: {
161
+ "fcm": {
162
+ "data": {
163
+ "key": "value",
164
+ },
165
+ },
166
+ },
142
167
  to: [
143
168
  {
144
169
  topicKey: "<value>",
145
- type: "Topic",
170
+ type: "Subscriber",
146
171
  },
147
- {
148
- topicKey: "<value>",
149
- type: "Topic",
172
+ ],
173
+ },
174
+ {
175
+ name: "workflow_identifier",
176
+ payload: {
177
+ "comment_id": "string",
178
+ "post": {
179
+ "text": "string",
180
+ },
181
+ },
182
+ bridgeUrl: "https://example.com/bridge",
183
+ overrides: {
184
+ "fcm": {
185
+ "data": {
186
+ "key": "value",
187
+ },
150
188
  },
189
+ },
190
+ to: [
191
+ "SUBSCRIBER_ID",
192
+ "SUBSCRIBER_ID",
151
193
  ],
152
194
  },
153
195
  ],
@@ -247,13 +289,12 @@ run();
247
289
 
248
290
  ### [Novu SDK](docs/sdks/novu/README.md)
249
291
 
250
- * [healthControllerHealthCheck](docs/sdks/novu/README.md#healthcontrollerhealthcheck)
251
- * [testIdempotency](docs/sdks/novu/README.md#testidempotency)
252
- * [generateRandomNumber](docs/sdks/novu/README.md#generaterandomnumber)
253
292
  * [trigger](docs/sdks/novu/README.md#trigger) - Trigger event
254
293
  * [triggerBulk](docs/sdks/novu/README.md#triggerbulk) - Bulk trigger event
255
294
  * [triggerBroadcast](docs/sdks/novu/README.md#triggerbroadcast) - Broadcast event to all
256
295
  * [cancel](docs/sdks/novu/README.md#cancel) - Cancel triggered event
296
+ * [supportControllerFetchUserOrganizations](docs/sdks/novu/README.md#supportcontrollerfetchuserorganizations)
297
+ * [create](docs/sdks/novu/README.md#create)
257
298
 
258
299
  ### [subscribers](docs/sdks/subscribers/README.md)
259
300
 
@@ -330,8 +371,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
330
371
  <summary>Available standalone functions</summary>
331
372
 
332
373
  - [`cancel`](docs/sdks/novu/README.md#cancel) - Cancel triggered event
333
- - [`generateRandomNumber`](docs/sdks/novu/README.md#generaterandomnumber)
334
- - [`healthControllerHealthCheck`](docs/sdks/novu/README.md#healthcontrollerhealthcheck)
374
+ - [`create`](docs/sdks/novu/README.md#create)
335
375
  - [`integrationsCreate`](docs/sdks/integrations/README.md#create) - Create integration
336
376
  - [`integrationsDelete`](docs/sdks/integrations/README.md#delete) - Delete integration
337
377
  - [`integrationsList`](docs/sdks/integrations/README.md#list) - Get integrations
@@ -367,7 +407,7 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
367
407
  - [`subscribersPropertiesUpdateOnlineFlag`](docs/sdks/properties/README.md#updateonlineflag) - Update subscriber online status
368
408
  - [`subscribersRetrieve`](docs/sdks/subscribers/README.md#retrieve) - Get subscriber
369
409
  - [`subscribersUpdate`](docs/sdks/subscribers/README.md#update) - Update subscriber
370
- - [`testIdempotency`](docs/sdks/novu/README.md#testidempotency)
410
+ - [`supportControllerFetchUserOrganizations`](docs/sdks/novu/README.md#supportcontrollerfetchuserorganizations)
371
411
  - [`topicsCreate`](docs/sdks/topics/README.md#create) - Topic creation
372
412
  - [`topicsDelete`](docs/sdks/topics/README.md#delete) - Delete topic
373
413
  - [`topicsList`](docs/sdks/topics/README.md#list) - Get topic list filtered
@@ -403,7 +443,7 @@ const novu = new Novu({
403
443
  });
404
444
 
405
445
  async function run() {
406
- const result = await novu.subscribers.list();
446
+ const result = await novu.subscribers.list(10);
407
447
 
408
448
  for await (const page of result) {
409
449
  // Handle the page
@@ -419,20 +459,24 @@ run();
419
459
  <!-- Start Error Handling [errors] -->
420
460
  ## Error Handling
421
461
 
422
- Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `healthControllerHealthCheck` method may throw the following errors:
462
+ Some methods specify known errors which can be thrown. All the known errors are enumerated in the `models/errors/errors.ts` module. The known errors for a method are documented under the *Errors* tables in SDK docs. For example, the `trigger` method may throw the following errors:
423
463
 
424
- | Error Type | Status Code | Content Type |
425
- | ---------------------------------------------- | ----------- | ---------------- |
426
- | errors.HealthControllerHealthCheckResponseBody | 503 | application/json |
427
- | errors.SDKError | 4XX, 5XX | \*/\* |
464
+ | Error Type | Status Code | Content Type |
465
+ | ------------------------- | -------------------------------------- | ---------------- |
466
+ | errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
467
+ | errors.ErrorDto | 414 | application/json |
468
+ | errors.ValidationErrorDto | 422 | application/json |
469
+ | errors.ErrorDto | 500 | application/json |
470
+ | errors.SDKError | 4XX, 5XX | \*/\* |
428
471
 
429
472
  If the method throws an error and it is not captured by the known errors, it will default to throwing a `SDKError`.
430
473
 
431
474
  ```typescript
432
475
  import { Novu } from "@novu/api";
433
476
  import {
434
- HealthControllerHealthCheckResponseBody,
477
+ ErrorDto,
435
478
  SDKValidationError,
479
+ ValidationErrorDto,
436
480
  } from "@novu/api/models/errors";
437
481
 
438
482
  const novu = new Novu({
@@ -442,7 +486,26 @@ const novu = new Novu({
442
486
  async function run() {
443
487
  let result;
444
488
  try {
445
- result = await novu.healthControllerHealthCheck();
489
+ result = await novu.trigger({
490
+ name: "workflow_identifier",
491
+ payload: {
492
+ "comment_id": "string",
493
+ "post": {
494
+ "text": "string",
495
+ },
496
+ },
497
+ bridgeUrl: "https://example.com/bridge",
498
+ overrides: {
499
+ "fcm": {
500
+ "data": {
501
+ "key": "value",
502
+ },
503
+ },
504
+ },
505
+ to: {
506
+ subscriberId: "<id>",
507
+ },
508
+ });
446
509
 
447
510
  // Handle the result
448
511
  console.log(result);
@@ -456,8 +519,23 @@ async function run() {
456
519
  console.error(err.rawValue);
457
520
  return;
458
521
  }
459
- case (err instanceof HealthControllerHealthCheckResponseBody): {
460
- // Handle err.data$: HealthControllerHealthCheckResponseBodyData
522
+ case (err instanceof ErrorDto): {
523
+ // Handle err.data$: ErrorDtoData
524
+ console.error(err);
525
+ return;
526
+ }
527
+ case (err instanceof ErrorDto): {
528
+ // Handle err.data$: ErrorDtoData
529
+ console.error(err);
530
+ return;
531
+ }
532
+ case (err instanceof ValidationErrorDto): {
533
+ // Handle err.data$: ValidationErrorDtoData
534
+ console.error(err);
535
+ return;
536
+ }
537
+ case (err instanceof ErrorDto): {
538
+ // Handle err.data$: ErrorDtoData
461
539
  console.error(err);
462
540
  return;
463
541
  }
@@ -509,7 +587,26 @@ const novu = new Novu({
509
587
  });
510
588
 
511
589
  async function run() {
512
- const result = await novu.healthControllerHealthCheck();
590
+ const result = await novu.trigger({
591
+ name: "workflow_identifier",
592
+ payload: {
593
+ "comment_id": "string",
594
+ "post": {
595
+ "text": "string",
596
+ },
597
+ },
598
+ bridgeUrl: "https://example.com/bridge",
599
+ overrides: {
600
+ "fcm": {
601
+ "data": {
602
+ "key": "value",
603
+ },
604
+ },
605
+ },
606
+ to: {
607
+ subscriberId: "<id>",
608
+ },
609
+ });
513
610
 
514
611
  // Handle the result
515
612
  console.log(result);
@@ -531,7 +628,26 @@ const novu = new Novu({
531
628
  });
532
629
 
533
630
  async function run() {
534
- const result = await novu.healthControllerHealthCheck();
631
+ const result = await novu.trigger({
632
+ name: "workflow_identifier",
633
+ payload: {
634
+ "comment_id": "string",
635
+ "post": {
636
+ "text": "string",
637
+ },
638
+ },
639
+ bridgeUrl: "https://example.com/bridge",
640
+ overrides: {
641
+ "fcm": {
642
+ "data": {
643
+ "key": "value",
644
+ },
645
+ },
646
+ },
647
+ to: {
648
+ subscriberId: "<id>",
649
+ },
650
+ });
535
651
 
536
652
  // Handle the result
537
653
  console.log(result);
@@ -611,7 +727,26 @@ const novu = new Novu({
611
727
  });
612
728
 
613
729
  async function run() {
614
- const result = await novu.healthControllerHealthCheck();
730
+ const result = await novu.trigger({
731
+ name: "workflow_identifier",
732
+ payload: {
733
+ "comment_id": "string",
734
+ "post": {
735
+ "text": "string",
736
+ },
737
+ },
738
+ bridgeUrl: "https://example.com/bridge",
739
+ overrides: {
740
+ "fcm": {
741
+ "data": {
742
+ "key": "value",
743
+ },
744
+ },
745
+ },
746
+ to: {
747
+ subscriberId: "<id>",
748
+ },
749
+ });
615
750
 
616
751
  // Handle the result
617
752
  console.log(result);
@@ -636,7 +771,26 @@ const novu = new Novu({
636
771
  });
637
772
 
638
773
  async function run() {
639
- const result = await novu.healthControllerHealthCheck({
774
+ const result = await novu.trigger({
775
+ name: "workflow_identifier",
776
+ payload: {
777
+ "comment_id": "string",
778
+ "post": {
779
+ "text": "string",
780
+ },
781
+ },
782
+ bridgeUrl: "https://example.com/bridge",
783
+ overrides: {
784
+ "fcm": {
785
+ "data": {
786
+ "key": "value",
787
+ },
788
+ },
789
+ },
790
+ to: {
791
+ subscriberId: "<id>",
792
+ },
793
+ }, {
640
794
  retries: {
641
795
  strategy: "backoff",
642
796
  backoff: {
@@ -676,7 +830,26 @@ const novu = new Novu({
676
830
  });
677
831
 
678
832
  async function run() {
679
- const result = await novu.healthControllerHealthCheck();
833
+ const result = await novu.trigger({
834
+ name: "workflow_identifier",
835
+ payload: {
836
+ "comment_id": "string",
837
+ "post": {
838
+ "text": "string",
839
+ },
840
+ },
841
+ bridgeUrl: "https://example.com/bridge",
842
+ overrides: {
843
+ "fcm": {
844
+ "data": {
845
+ "key": "value",
846
+ },
847
+ },
848
+ },
849
+ to: {
850
+ subscriberId: "<id>",
851
+ },
852
+ });
680
853
 
681
854
  // Handle the result
682
855
  console.log(result);
@@ -27,6 +27,17 @@ async function run() {
27
27
  providerId: "pushpad",
28
28
  credentials: {
29
29
  webhookUrl: "https://example.com/webhook",
30
+ channel: "general",
31
+ deviceTokens: [
32
+ "token1",
33
+ "token2",
34
+ "token3",
35
+ ],
36
+ alertUid: "12345-abcde",
37
+ title: "Critical Alert",
38
+ imageUrl: "https://example.com/image.png",
39
+ state: "resolved",
40
+ externalUrl: "https://example.com/details",
30
41
  },
31
42
  }, "<id>");
32
43
 
@@ -56,6 +67,17 @@ async function run() {
56
67
  providerId: "pushpad",
57
68
  credentials: {
58
69
  webhookUrl: "https://example.com/webhook",
70
+ channel: "general",
71
+ deviceTokens: [
72
+ "token1",
73
+ "token2",
74
+ "token3",
75
+ ],
76
+ alertUid: "12345-abcde",
77
+ title: "Critical Alert",
78
+ imageUrl: "https://example.com/image.png",
79
+ state: "resolved",
80
+ externalUrl: "https://example.com/details",
59
81
  },
60
82
  }, "<id>");
61
83
 
@@ -116,6 +138,17 @@ async function run() {
116
138
  providerId: "zulip",
117
139
  credentials: {
118
140
  webhookUrl: "https://example.com/webhook",
141
+ channel: "general",
142
+ deviceTokens: [
143
+ "token1",
144
+ "token2",
145
+ "token3",
146
+ ],
147
+ alertUid: "12345-abcde",
148
+ title: "Critical Alert",
149
+ imageUrl: "https://example.com/image.png",
150
+ state: "resolved",
151
+ externalUrl: "https://example.com/details",
119
152
  },
120
153
  }, "<id>");
121
154
 
@@ -145,6 +178,17 @@ async function run() {
145
178
  providerId: "zulip",
146
179
  credentials: {
147
180
  webhookUrl: "https://example.com/webhook",
181
+ channel: "general",
182
+ deviceTokens: [
183
+ "token1",
184
+ "token2",
185
+ "token3",
186
+ ],
187
+ alertUid: "12345-abcde",
188
+ title: "Critical Alert",
189
+ imageUrl: "https://example.com/image.png",
190
+ state: "resolved",
191
+ externalUrl: "https://example.com/details",
148
192
  },
149
193
  }, "<id>");
150
194
 
@@ -26,7 +26,10 @@ const novu = new Novu({
26
26
  });
27
27
 
28
28
  async function run() {
29
- const result = await novu.messages.retrieve({});
29
+ const result = await novu.messages.retrieve({
30
+ page: 0,
31
+ limit: 10,
32
+ });
30
33
 
31
34
  // Handle the result
32
35
  console.log(result);
@@ -50,7 +53,10 @@ const novu = new NovuCore({
50
53
  });
51
54
 
52
55
  async function run() {
53
- const res = await messagesRetrieve(novu, {});
56
+ const res = await messagesRetrieve(novu, {
57
+ page: 0,
58
+ limit: 10,
59
+ });
54
60
 
55
61
  if (!res.ok) {
56
62
  throw res.error;
@@ -23,22 +23,7 @@ const novu = new Novu({
23
23
 
24
24
  async function run() {
25
25
  const result = await novu.notifications.list({
26
- channels: [
27
- "sms",
28
- "chat",
29
- "in_app",
30
- ],
31
- templates: [
32
-
33
- ],
34
- emails: [
35
-
36
- ],
37
- search: "<value>",
38
- subscriberIds: [
39
- "<value>",
40
- "<value>",
41
- ],
26
+ page: 0,
42
27
  });
43
28
 
44
29
  // Handle the result
@@ -64,22 +49,7 @@ const novu = new NovuCore({
64
49
 
65
50
  async function run() {
66
51
  const res = await notificationsList(novu, {
67
- channels: [
68
- "sms",
69
- "chat",
70
- "in_app",
71
- ],
72
- templates: [
73
-
74
- ],
75
- emails: [
76
-
77
- ],
78
- search: "<value>",
79
- subscriberIds: [
80
- "<value>",
81
- "<value>",
82
- ],
52
+ page: 0,
83
53
  });
84
54
 
85
55
  if (!res.ok) {