@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.
- package/FUNCTIONS.md +15 -8
- package/README.md +218 -45
- package/docs/sdks/credentials/README.md +44 -0
- package/docs/sdks/messages/README.md +8 -2
- package/docs/sdks/notifications/README.md +2 -32
- package/docs/sdks/novu/README.md +247 -244
- package/docs/sdks/novumessages/README.md +4 -4
- package/docs/sdks/novunotifications/README.md +4 -2
- package/docs/sdks/preferences/README.md +4 -4
- package/docs/sdks/properties/README.md +2 -2
- package/docs/sdks/subscribers/README.md +2 -4
- package/funcs/create.d.ts +9 -0
- package/funcs/create.d.ts.map +1 -0
- package/funcs/{healthControllerHealthCheck.js → create.js} +17 -16
- package/funcs/create.js.map +1 -0
- package/funcs/supportControllerFetchUserOrganizations.d.ts +10 -0
- package/funcs/supportControllerFetchUserOrganizations.d.ts.map +1 -0
- package/funcs/{generateRandomNumber.js → supportControllerFetchUserOrganizations.js} +16 -31
- package/funcs/supportControllerFetchUserOrganizations.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/schemas.d.ts +1 -1
- package/lib/schemas.d.ts.map +1 -1
- package/lib/schemas.js +4 -1
- package/lib/schemas.js.map +1 -1
- package/models/components/createsupportthreaddto.d.ts +29 -0
- package/models/components/createsupportthreaddto.d.ts.map +1 -0
- package/models/components/{idempotencetestingresponse.js → createsupportthreaddto.js} +19 -19
- package/models/components/createsupportthreaddto.js.map +1 -0
- package/models/components/index.d.ts +2 -3
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +2 -3
- package/models/components/index.js.map +1 -1
- package/models/components/plaincardrequestdto.d.ts +100 -0
- package/models/components/plaincardrequestdto.d.ts.map +1 -0
- package/models/components/plaincardrequestdto.js +139 -0
- package/models/components/plaincardrequestdto.js.map +1 -0
- package/models/errors/index.d.ts +0 -1
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +0 -1
- package/models/errors/index.js.map +1 -1
- package/models/operations/index.d.ts +2 -3
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -3
- package/models/operations/index.js.map +1 -1
- package/models/operations/supportcontrollercreatethread.d.ts +35 -0
- package/models/operations/supportcontrollercreatethread.d.ts.map +1 -0
- package/models/operations/supportcontrollercreatethread.js +73 -0
- package/models/operations/supportcontrollercreatethread.js.map +1 -0
- package/models/operations/supportcontrollerfetchuserorganizations.d.ts +56 -0
- package/models/operations/supportcontrollerfetchuserorganizations.d.ts.map +1 -0
- package/models/operations/supportcontrollerfetchuserorganizations.js +96 -0
- package/models/operations/supportcontrollerfetchuserorganizations.js.map +1 -0
- package/package.json +5 -1
- package/sdk/sdk.d.ts +8 -3
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +14 -12
- package/sdk/sdk.js.map +1 -1
- package/sources/json-development.json +116 -1161
- package/src/funcs/{testIdempotency.ts → create.ts} +15 -57
- package/src/funcs/{healthControllerHealthCheck.ts → supportControllerFetchUserOrganizations.ts} +22 -25
- package/src/lib/config.ts +3 -3
- package/src/lib/schemas.ts +5 -0
- package/src/models/components/createsupportthreaddto.ts +66 -0
- package/src/models/components/index.ts +2 -3
- package/src/models/components/plaincardrequestdto.ts +223 -0
- package/src/models/errors/index.ts +0 -1
- package/src/models/operations/index.ts +2 -3
- package/src/models/operations/supportcontrollercreatethread.ts +90 -0
- package/src/models/operations/supportcontrollerfetchuserorganizations.ts +163 -0
- package/src/sdk/sdk.ts +34 -38
- package/funcs/generateRandomNumber.d.ts +0 -10
- package/funcs/generateRandomNumber.d.ts.map +0 -1
- package/funcs/generateRandomNumber.js.map +0 -1
- package/funcs/healthControllerHealthCheck.d.ts +0 -10
- package/funcs/healthControllerHealthCheck.d.ts.map +0 -1
- package/funcs/healthControllerHealthCheck.js.map +0 -1
- package/funcs/testIdempotency.d.ts +0 -11
- package/funcs/testIdempotency.d.ts.map +0 -1
- package/funcs/testIdempotency.js +0 -129
- package/funcs/testIdempotency.js.map +0 -1
- package/models/components/idempotencetestingresponse.d.ts +0 -32
- package/models/components/idempotencetestingresponse.d.ts.map +0 -1
- package/models/components/idempotencetestingresponse.js.map +0 -1
- package/models/components/idempotencybehaviorenum.d.ts +0 -37
- package/models/components/idempotencybehaviorenum.d.ts.map +0 -1
- package/models/components/idempotencybehaviorenum.js +0 -54
- package/models/components/idempotencybehaviorenum.js.map +0 -1
- package/models/components/idempotencytestingdto.d.ts +0 -33
- package/models/components/idempotencytestingdto.d.ts.map +0 -1
- package/models/components/idempotencytestingdto.js +0 -60
- package/models/components/idempotencytestingdto.js.map +0 -1
- package/models/errors/healthcontrollerhealthcheck.d.ts +0 -153
- package/models/errors/healthcontrollerhealthcheck.d.ts.map +0 -1
- package/models/errors/healthcontrollerhealthcheck.js +0 -190
- package/models/errors/healthcontrollerhealthcheck.js.map +0 -1
- package/models/operations/healthcontrollergeneraterandomnumber.d.ts +0 -64
- package/models/operations/healthcontrollergeneraterandomnumber.d.ts.map +0 -1
- package/models/operations/healthcontrollergeneraterandomnumber.js +0 -108
- package/models/operations/healthcontrollergeneraterandomnumber.js.map +0 -1
- package/models/operations/healthcontrollerhealthcheck.d.ts +0 -165
- package/models/operations/healthcontrollerhealthcheck.d.ts.map +0 -1
- package/models/operations/healthcontrollerhealthcheck.js +0 -206
- package/models/operations/healthcontrollerhealthcheck.js.map +0 -1
- package/models/operations/healthcontrollertestidempotency.d.ts +0 -66
- package/models/operations/healthcontrollertestidempotency.d.ts.map +0 -1
- package/models/operations/healthcontrollertestidempotency.js +0 -112
- package/models/operations/healthcontrollertestidempotency.js.map +0 -1
- package/src/funcs/generateRandomNumber.ts +0 -183
- package/src/models/components/idempotencetestingresponse.ts +0 -69
- package/src/models/components/idempotencybehaviorenum.ts +0 -42
- package/src/models/components/idempotencytestingdto.ts +0 -74
- package/src/models/errors/healthcontrollerhealthcheck.ts +0 -291
- package/src/models/operations/healthcontrollergeneraterandomnumber.ts +0 -177
- package/src/models/operations/healthcontrollerhealthcheck.ts +0 -358
- 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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
payload: {
|
|
36
|
+
"comment_id": "string",
|
|
37
|
+
"post": {
|
|
38
|
+
"text": "string",
|
|
39
39
|
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
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://
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
payload: {
|
|
93
|
+
"comment_id": "string",
|
|
94
|
+
"post": {
|
|
95
|
+
"text": "string",
|
|
96
96
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
133
|
+
payload: {
|
|
134
|
+
"comment_id": "string",
|
|
135
|
+
"post": {
|
|
136
|
+
"text": "string",
|
|
130
137
|
},
|
|
131
|
-
|
|
132
|
-
|
|
138
|
+
},
|
|
139
|
+
bridgeUrl: "https://example.com/bridge",
|
|
140
|
+
overrides: {
|
|
141
|
+
"fcm": {
|
|
142
|
+
"data": {
|
|
143
|
+
"key": "value",
|
|
144
|
+
},
|
|
133
145
|
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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: "
|
|
170
|
+
type: "Subscriber",
|
|
146
171
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
- [`
|
|
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
|
-
- [`
|
|
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 `
|
|
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
|
|
425
|
-
|
|
|
426
|
-
| errors.
|
|
427
|
-
| errors.
|
|
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
|
-
|
|
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.
|
|
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
|
|
460
|
-
// Handle err.data$:
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
-
|
|
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
|
-
|
|
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) {
|