@novu/api 0.5.0 → 0.6.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.
- package/README.md +97 -64
- package/bin/mcp-server.js +223 -173
- package/bin/mcp-server.js.map +65 -64
- package/docs/sdks/authentication/README.md +17 -17
- package/docs/sdks/integrations/README.md +55 -55
- package/docs/sdks/novu/README.md +146 -146
- package/docs/sdks/novumessages/README.md +34 -34
- package/docs/sdks/stats/README.md +14 -14
- package/docs/sdks/subscribers/README.md +82 -82
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/sdks.d.ts.map +1 -1
- package/lib/sdks.js +2 -8
- package/lib/sdks.js.map +1 -1
- package/lib/security.d.ts +4 -3
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js +6 -1
- package/lib/security.js.map +1 -1
- package/mcp-server/extensions.d.ts +11 -0
- package/mcp-server/extensions.d.ts.map +1 -0
- package/mcp-server/extensions.js +6 -0
- package/mcp-server/extensions.js.map +1 -0
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/prompts.d.ts +26 -0
- package/mcp-server/prompts.d.ts.map +1 -0
- package/mcp-server/prompts.js +48 -0
- package/mcp-server/prompts.js.map +1 -0
- package/mcp-server/resources.d.ts +9 -4
- package/mcp-server/resources.d.ts.map +1 -1
- package/mcp-server/resources.js +38 -10
- package/mcp-server/resources.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +31 -24
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/integrationsCreate.js +1 -1
- package/mcp-server/tools/integrationsDelete.js +1 -1
- package/mcp-server/tools/integrationsList.js +1 -1
- package/mcp-server/tools/integrationsListActive.js +1 -1
- package/mcp-server/tools/integrationsSetAsPrimary.js +1 -1
- package/mcp-server/tools/integrationsUpdate.js +1 -1
- package/mcp-server/tools/integrationsWebhooksRetrieve.js +1 -1
- package/mcp-server/tools/messagesDelete.js +1 -1
- package/mcp-server/tools/messagesDeleteByTransactionId.js +1 -1
- package/mcp-server/tools/messagesRetrieve.js +1 -1
- package/mcp-server/tools/notificationsList.js +1 -1
- package/mcp-server/tools/notificationsRetrieve.js +1 -1
- package/mcp-server/tools/notificationsStatsGraph.js +1 -1
- package/mcp-server/tools/notificationsStatsRetrieve.js +1 -1
- package/mcp-server/tools/subscribersAuthenticationChatAccessOauth.js +1 -1
- package/mcp-server/tools/subscribersAuthenticationChatAccessOauthCallBack.js +1 -1
- package/mcp-server/tools/subscribersCreate.js +1 -1
- package/mcp-server/tools/subscribersCreateBulk.js +1 -1
- package/mcp-server/tools/subscribersCredentialsAppend.js +1 -1
- package/mcp-server/tools/subscribersCredentialsDelete.js +1 -1
- package/mcp-server/tools/subscribersCredentialsUpdate.js +1 -1
- package/mcp-server/tools/subscribersDelete.js +1 -1
- package/mcp-server/tools/subscribersList.js +1 -1
- package/mcp-server/tools/subscribersMessagesMarkAll.js +1 -1
- package/mcp-server/tools/subscribersMessagesMarkAllAs.js +1 -1
- package/mcp-server/tools/subscribersMessagesUpdateAsSeen.js +1 -1
- package/mcp-server/tools/subscribersNotificationsFeed.js +1 -1
- package/mcp-server/tools/subscribersNotificationsUnseenCount.js +1 -1
- package/mcp-server/tools/subscribersPatch.js +1 -1
- package/mcp-server/tools/subscribersPreferencesList.js +1 -1
- package/mcp-server/tools/subscribersPreferencesUpdate.js +1 -1
- package/mcp-server/tools/subscribersPropertiesUpdateOnlineFlag.js +1 -1
- package/mcp-server/tools/subscribersRetrieve.js +1 -1
- package/mcp-server/tools/subscribersSearch.js +1 -1
- package/mcp-server/tools/topicsCreate.js +1 -1
- package/mcp-server/tools/topicsDelete.js +1 -1
- package/mcp-server/tools/topicsList.js +1 -1
- package/mcp-server/tools/topicsRename.js +1 -1
- package/mcp-server/tools/topicsRetrieve.js +1 -1
- package/mcp-server/tools/topicsSubscribersAssign.js +1 -1
- package/mcp-server/tools/topicsSubscribersRemove.js +1 -1
- package/mcp-server/tools/topicsSubscribersRetrieve.js +1 -1
- package/mcp-server/tools.d.ts.map +1 -1
- package/mcp-server/tools.js +4 -0
- package/mcp-server/tools.js.map +1 -1
- package/models/components/activitynotificationjobresponsedto.d.ts +9 -0
- package/models/components/activitynotificationjobresponsedto.d.ts.map +1 -1
- package/models/components/activitynotificationjobresponsedto.js +2 -0
- package/models/components/activitynotificationjobresponsedto.js.map +1 -1
- package/models/components/channelsettingsdto.d.ts +8 -8
- package/models/components/channelsettingsdto.d.ts.map +1 -1
- package/models/components/channelsettingsdto.js +14 -13
- package/models/components/channelsettingsdto.js.map +1 -1
- package/models/components/index.d.ts +0 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -1
- package/models/components/index.js.map +1 -1
- package/models/components/integrationresponsedto.d.ts +8 -8
- package/models/components/integrationresponsedto.d.ts.map +1 -1
- package/models/components/integrationresponsedto.js +13 -14
- package/models/components/integrationresponsedto.js.map +1 -1
- package/models/components/markallmessageasrequestdto.d.ts +8 -8
- package/models/components/markallmessageasrequestdto.d.ts.map +1 -1
- package/models/components/markallmessageasrequestdto.js +14 -13
- package/models/components/markallmessageasrequestdto.js.map +1 -1
- package/models/components/messagemarkasrequestdto.d.ts +8 -8
- package/models/components/messagemarkasrequestdto.d.ts.map +1 -1
- package/models/components/messagemarkasrequestdto.js +13 -14
- package/models/components/messagemarkasrequestdto.js.map +1 -1
- package/models/components/overrides.d.ts +8 -8
- package/models/components/overrides.d.ts.map +1 -1
- package/models/components/overrides.js +14 -13
- package/models/components/overrides.js.map +1 -1
- package/models/components/patchsubscriberrequestdto.d.ts +15 -15
- package/models/components/patchsubscriberrequestdto.d.ts.map +1 -1
- package/models/components/patchsubscriberrequestdto.js +19 -20
- package/models/components/patchsubscriberrequestdto.js.map +1 -1
- package/models/components/subscriberchanneldto.d.ts +8 -8
- package/models/components/subscriberchanneldto.d.ts.map +1 -1
- package/models/components/subscriberchanneldto.js +13 -14
- package/models/components/subscriberchanneldto.js.map +1 -1
- package/models/components/subscriberpayloaddto.d.ts +13 -13
- package/models/components/subscriberpayloaddto.d.ts.map +1 -1
- package/models/components/subscriberpayloaddto.js +16 -17
- package/models/components/subscriberpayloaddto.js.map +1 -1
- package/models/operations/eventscontrollercancel.d.ts +2 -3
- package/models/operations/eventscontrollercancel.d.ts.map +1 -1
- package/models/operations/eventscontrollercancel.js +2 -3
- package/models/operations/eventscontrollercancel.js.map +1 -1
- package/models/operations/notificationscontrollerlistnotifications.d.ts +2 -2
- package/package.json +1 -1
- package/sdk/authentication.d.ts +4 -4
- package/sdk/authentication.d.ts.map +1 -1
- package/sdk/authentication.js +6 -6
- package/sdk/authentication.js.map +1 -1
- package/sdk/integrations.d.ts +7 -7
- package/sdk/integrations.d.ts.map +1 -1
- package/sdk/integrations.js +9 -9
- package/sdk/integrations.js.map +1 -1
- package/sdk/novumessages.d.ts +4 -4
- package/sdk/novumessages.d.ts.map +1 -1
- package/sdk/novumessages.js +6 -6
- package/sdk/novumessages.js.map +1 -1
- package/sdk/sdk.d.ts +12 -12
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +15 -15
- package/sdk/sdk.js.map +1 -1
- package/sdk/stats.d.ts +4 -4
- package/sdk/stats.d.ts.map +1 -1
- package/sdk/stats.js +6 -6
- package/sdk/stats.js.map +1 -1
- package/sdk/subscribers.d.ts +26 -26
- package/sdk/subscribers.d.ts.map +1 -1
- package/sdk/subscribers.js +29 -29
- package/sdk/subscribers.js.map +1 -1
- package/sources/json-development.json +1146 -1148
- package/src/lib/config.ts +3 -3
- package/src/lib/sdks.ts +2 -7
- package/src/lib/security.ts +11 -3
- package/src/mcp-server/extensions.ts +17 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/prompts.ts +110 -0
- package/src/mcp-server/resources.ts +76 -14
- package/src/mcp-server/server.ts +41 -24
- package/src/mcp-server/tools/integrationsCreate.ts +1 -1
- package/src/mcp-server/tools/integrationsDelete.ts +1 -1
- package/src/mcp-server/tools/integrationsList.ts +1 -1
- package/src/mcp-server/tools/integrationsListActive.ts +1 -1
- package/src/mcp-server/tools/integrationsSetAsPrimary.ts +1 -1
- package/src/mcp-server/tools/integrationsUpdate.ts +1 -1
- package/src/mcp-server/tools/integrationsWebhooksRetrieve.ts +1 -1
- package/src/mcp-server/tools/messagesDelete.ts +1 -1
- package/src/mcp-server/tools/messagesDeleteByTransactionId.ts +1 -1
- package/src/mcp-server/tools/messagesRetrieve.ts +1 -1
- package/src/mcp-server/tools/notificationsList.ts +1 -1
- package/src/mcp-server/tools/notificationsRetrieve.ts +1 -1
- package/src/mcp-server/tools/notificationsStatsGraph.ts +1 -1
- package/src/mcp-server/tools/notificationsStatsRetrieve.ts +1 -1
- package/src/mcp-server/tools/subscribersAuthenticationChatAccessOauth.ts +1 -1
- package/src/mcp-server/tools/subscribersAuthenticationChatAccessOauthCallBack.ts +1 -1
- package/src/mcp-server/tools/subscribersCreate.ts +1 -1
- package/src/mcp-server/tools/subscribersCreateBulk.ts +1 -1
- package/src/mcp-server/tools/subscribersCredentialsAppend.ts +1 -1
- package/src/mcp-server/tools/subscribersCredentialsDelete.ts +1 -1
- package/src/mcp-server/tools/subscribersCredentialsUpdate.ts +1 -1
- package/src/mcp-server/tools/subscribersDelete.ts +1 -1
- package/src/mcp-server/tools/subscribersList.ts +1 -1
- package/src/mcp-server/tools/subscribersMessagesMarkAll.ts +1 -1
- package/src/mcp-server/tools/subscribersMessagesMarkAllAs.ts +1 -1
- package/src/mcp-server/tools/subscribersMessagesUpdateAsSeen.ts +1 -1
- package/src/mcp-server/tools/subscribersNotificationsFeed.ts +1 -1
- package/src/mcp-server/tools/subscribersNotificationsUnseenCount.ts +1 -1
- package/src/mcp-server/tools/subscribersPatch.ts +1 -1
- package/src/mcp-server/tools/subscribersPreferencesList.ts +1 -1
- package/src/mcp-server/tools/subscribersPreferencesUpdate.ts +1 -1
- package/src/mcp-server/tools/subscribersPropertiesUpdateOnlineFlag.ts +1 -1
- package/src/mcp-server/tools/subscribersRetrieve.ts +1 -1
- package/src/mcp-server/tools/subscribersSearch.ts +1 -1
- package/src/mcp-server/tools/topicsCreate.ts +1 -1
- package/src/mcp-server/tools/topicsDelete.ts +1 -1
- package/src/mcp-server/tools/topicsList.ts +1 -1
- package/src/mcp-server/tools/topicsRename.ts +1 -1
- package/src/mcp-server/tools/topicsRetrieve.ts +1 -1
- package/src/mcp-server/tools/topicsSubscribersAssign.ts +1 -1
- package/src/mcp-server/tools/topicsSubscribersRemove.ts +1 -1
- package/src/mcp-server/tools/topicsSubscribersRetrieve.ts +1 -1
- package/src/mcp-server/tools.ts +5 -0
- package/src/models/components/activitynotificationjobresponsedto.ts +7 -0
- package/src/models/components/channelsettingsdto.ts +14 -18
- package/src/models/components/index.ts +0 -1
- package/src/models/components/integrationresponsedto.ts +18 -14
- package/src/models/components/markallmessageasrequestdto.ts +14 -18
- package/src/models/components/messagemarkasrequestdto.ts +18 -14
- package/src/models/components/overrides.ts +14 -16
- package/src/models/components/patchsubscriberrequestdto.ts +23 -37
- package/src/models/components/subscriberchanneldto.ts +18 -14
- package/src/models/components/subscriberpayloaddto.ts +37 -19
- package/src/models/operations/eventscontrollercancel.ts +4 -5
- package/src/models/operations/notificationscontrollerlistnotifications.ts +2 -2
- package/src/sdk/authentication.ts +16 -16
- package/src/sdk/integrations.ts +17 -17
- package/src/sdk/novumessages.ts +16 -16
- package/src/sdk/sdk.ts +24 -24
- package/src/sdk/stats.ts +10 -10
- package/src/sdk/subscribers.ts +61 -61
- package/models/components/databooleandto.d.ts +0 -29
- package/models/components/databooleandto.d.ts.map +0 -1
- package/models/components/databooleandto.js +0 -59
- package/models/components/databooleandto.js.map +0 -1
- package/src/models/components/databooleandto.ts +0 -62
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
|
-
* [retrieve](#retrieve) - Get notification statistics
|
|
9
8
|
* [graph](#graph) - Get notification graph statistics
|
|
9
|
+
* [retrieve](#retrieve) - Get notification statistics
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## graph
|
|
12
12
|
|
|
13
|
-
Get notification statistics
|
|
13
|
+
Get notification graph statistics
|
|
14
14
|
|
|
15
15
|
### Example Usage
|
|
16
16
|
|
|
@@ -22,7 +22,7 @@ const novu = new Novu({
|
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
async function run() {
|
|
25
|
-
const result = await novu.notifications.stats.
|
|
25
|
+
const result = await novu.notifications.stats.graph();
|
|
26
26
|
|
|
27
27
|
// Handle the result
|
|
28
28
|
console.log(result);
|
|
@@ -37,7 +37,7 @@ The standalone function version of this method:
|
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
39
|
import { NovuCore } from "@novu/api/core.js";
|
|
40
|
-
import {
|
|
40
|
+
import { notificationsStatsGraph } from "@novu/api/funcs/notificationsStatsGraph.js";
|
|
41
41
|
|
|
42
42
|
// Use `NovuCore` for best tree-shaking performance.
|
|
43
43
|
// You can create one instance of it to use across an application.
|
|
@@ -46,7 +46,7 @@ const novu = new NovuCore({
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
async function run() {
|
|
49
|
-
const res = await
|
|
49
|
+
const res = await notificationsStatsGraph(novu);
|
|
50
50
|
|
|
51
51
|
if (!res.ok) {
|
|
52
52
|
throw res.error;
|
|
@@ -65,6 +65,7 @@ run();
|
|
|
65
65
|
|
|
66
66
|
| Parameter | Type | Required | Description |
|
|
67
67
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
68
|
+
| `days` | *number* | :heavy_minus_sign: | N/A |
|
|
68
69
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
69
70
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
70
71
|
| `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. |
|
|
@@ -72,7 +73,7 @@ run();
|
|
|
72
73
|
|
|
73
74
|
### Response
|
|
74
75
|
|
|
75
|
-
**Promise\<[operations.
|
|
76
|
+
**Promise\<[operations.NotificationsControllerGetActivityGraphStatsResponse](../../models/operations/notificationscontrollergetactivitygraphstatsresponse.md)\>**
|
|
76
77
|
|
|
77
78
|
### Errors
|
|
78
79
|
|
|
@@ -84,9 +85,9 @@ run();
|
|
|
84
85
|
| errors.ErrorDto | 500 | application/json |
|
|
85
86
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
86
87
|
|
|
87
|
-
##
|
|
88
|
+
## retrieve
|
|
88
89
|
|
|
89
|
-
Get notification
|
|
90
|
+
Get notification statistics
|
|
90
91
|
|
|
91
92
|
### Example Usage
|
|
92
93
|
|
|
@@ -98,7 +99,7 @@ const novu = new Novu({
|
|
|
98
99
|
});
|
|
99
100
|
|
|
100
101
|
async function run() {
|
|
101
|
-
const result = await novu.notifications.stats.
|
|
102
|
+
const result = await novu.notifications.stats.retrieve();
|
|
102
103
|
|
|
103
104
|
// Handle the result
|
|
104
105
|
console.log(result);
|
|
@@ -113,7 +114,7 @@ The standalone function version of this method:
|
|
|
113
114
|
|
|
114
115
|
```typescript
|
|
115
116
|
import { NovuCore } from "@novu/api/core.js";
|
|
116
|
-
import {
|
|
117
|
+
import { notificationsStatsRetrieve } from "@novu/api/funcs/notificationsStatsRetrieve.js";
|
|
117
118
|
|
|
118
119
|
// Use `NovuCore` for best tree-shaking performance.
|
|
119
120
|
// You can create one instance of it to use across an application.
|
|
@@ -122,7 +123,7 @@ const novu = new NovuCore({
|
|
|
122
123
|
});
|
|
123
124
|
|
|
124
125
|
async function run() {
|
|
125
|
-
const res = await
|
|
126
|
+
const res = await notificationsStatsRetrieve(novu);
|
|
126
127
|
|
|
127
128
|
if (!res.ok) {
|
|
128
129
|
throw res.error;
|
|
@@ -141,7 +142,6 @@ run();
|
|
|
141
142
|
|
|
142
143
|
| Parameter | Type | Required | Description |
|
|
143
144
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
144
|
-
| `days` | *number* | :heavy_minus_sign: | N/A |
|
|
145
145
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
146
146
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
147
147
|
| `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. |
|
|
@@ -149,7 +149,7 @@ run();
|
|
|
149
149
|
|
|
150
150
|
### Response
|
|
151
151
|
|
|
152
|
-
**Promise\<[operations.
|
|
152
|
+
**Promise\<[operations.NotificationsControllerGetActivityStatsResponse](../../models/operations/notificationscontrollergetactivitystatsresponse.md)\>**
|
|
153
153
|
|
|
154
154
|
### Errors
|
|
155
155
|
|
|
@@ -8,17 +8,17 @@ A subscriber in Novu represents someone who should receive a message. A subscrib
|
|
|
8
8
|
|
|
9
9
|
### Available Operations
|
|
10
10
|
|
|
11
|
-
* [list](#list) - Get subscribers
|
|
12
|
-
* [createBulk](#createbulk) - Bulk create subscribers
|
|
13
11
|
* [search](#search) - Search for subscribers
|
|
14
12
|
* [create](#create) - Create subscriber
|
|
15
13
|
* [retrieve](#retrieve) - Get subscriber
|
|
16
14
|
* [patch](#patch) - Patch subscriber
|
|
17
15
|
* [delete](#delete) - Delete subscriber
|
|
16
|
+
* [list](#list) - Get subscribers
|
|
17
|
+
* [createBulk](#createbulk) - Bulk create subscribers
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## search
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Search for subscribers
|
|
22
22
|
|
|
23
23
|
### Example Usage
|
|
24
24
|
|
|
@@ -30,12 +30,10 @@ const novu = new Novu({
|
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
async function run() {
|
|
33
|
-
const result = await novu.subscribers.
|
|
33
|
+
const result = await novu.subscribers.search({});
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
console.log(page);
|
|
38
|
-
}
|
|
35
|
+
// Handle the result
|
|
36
|
+
console.log(result);
|
|
39
37
|
}
|
|
40
38
|
|
|
41
39
|
run();
|
|
@@ -47,7 +45,7 @@ The standalone function version of this method:
|
|
|
47
45
|
|
|
48
46
|
```typescript
|
|
49
47
|
import { NovuCore } from "@novu/api/core.js";
|
|
50
|
-
import {
|
|
48
|
+
import { subscribersSearch } from "@novu/api/funcs/subscribersSearch.js";
|
|
51
49
|
|
|
52
50
|
// Use `NovuCore` for best tree-shaking performance.
|
|
53
51
|
// You can create one instance of it to use across an application.
|
|
@@ -56,7 +54,7 @@ const novu = new NovuCore({
|
|
|
56
54
|
});
|
|
57
55
|
|
|
58
56
|
async function run() {
|
|
59
|
-
const res = await
|
|
57
|
+
const res = await subscribersSearch(novu, {});
|
|
60
58
|
|
|
61
59
|
if (!res.ok) {
|
|
62
60
|
throw res.error;
|
|
@@ -64,10 +62,8 @@ async function run() {
|
|
|
64
62
|
|
|
65
63
|
const { value: result } = res;
|
|
66
64
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
console.log(page);
|
|
70
|
-
}
|
|
65
|
+
// Handle the result
|
|
66
|
+
console.log(result);
|
|
71
67
|
}
|
|
72
68
|
|
|
73
69
|
run();
|
|
@@ -77,16 +73,14 @@ run();
|
|
|
77
73
|
|
|
78
74
|
| Parameter | Type | Required | Description |
|
|
79
75
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
80
|
-
| `
|
|
81
|
-
| `limit` | *number* | :heavy_minus_sign: | N/A |
|
|
82
|
-
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
76
|
+
| `request` | [operations.SubscribersControllerSearchSubscribersRequest](../../models/operations/subscriberscontrollersearchsubscribersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
83
77
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
84
78
|
| `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. |
|
|
85
79
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
86
80
|
|
|
87
81
|
### Response
|
|
88
82
|
|
|
89
|
-
**Promise\<[operations.
|
|
83
|
+
**Promise\<[operations.SubscribersControllerSearchSubscribersResponse](../../models/operations/subscriberscontrollersearchsubscribersresponse.md)\>**
|
|
90
84
|
|
|
91
85
|
### Errors
|
|
92
86
|
|
|
@@ -98,12 +92,9 @@ run();
|
|
|
98
92
|
| errors.ErrorDto | 500 | application/json |
|
|
99
93
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
100
94
|
|
|
101
|
-
##
|
|
102
|
-
|
|
95
|
+
## create
|
|
103
96
|
|
|
104
|
-
|
|
105
|
-
The bulk API is limited to 500 subscribers per request.
|
|
106
|
-
|
|
97
|
+
Create subscriber with the given data
|
|
107
98
|
|
|
108
99
|
### Example Usage
|
|
109
100
|
|
|
@@ -115,12 +106,8 @@ const novu = new Novu({
|
|
|
115
106
|
});
|
|
116
107
|
|
|
117
108
|
async function run() {
|
|
118
|
-
const result = await novu.subscribers.
|
|
119
|
-
|
|
120
|
-
{
|
|
121
|
-
subscriberId: "<id>",
|
|
122
|
-
},
|
|
123
|
-
],
|
|
109
|
+
const result = await novu.subscribers.create({
|
|
110
|
+
subscriberId: "<id>",
|
|
124
111
|
});
|
|
125
112
|
|
|
126
113
|
// Handle the result
|
|
@@ -136,7 +123,7 @@ The standalone function version of this method:
|
|
|
136
123
|
|
|
137
124
|
```typescript
|
|
138
125
|
import { NovuCore } from "@novu/api/core.js";
|
|
139
|
-
import {
|
|
126
|
+
import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js";
|
|
140
127
|
|
|
141
128
|
// Use `NovuCore` for best tree-shaking performance.
|
|
142
129
|
// You can create one instance of it to use across an application.
|
|
@@ -145,12 +132,8 @@ const novu = new NovuCore({
|
|
|
145
132
|
});
|
|
146
133
|
|
|
147
134
|
async function run() {
|
|
148
|
-
const res = await
|
|
149
|
-
|
|
150
|
-
{
|
|
151
|
-
subscriberId: "<id>",
|
|
152
|
-
},
|
|
153
|
-
],
|
|
135
|
+
const res = await subscribersCreate(novu, {
|
|
136
|
+
subscriberId: "<id>",
|
|
154
137
|
});
|
|
155
138
|
|
|
156
139
|
if (!res.ok) {
|
|
@@ -170,7 +153,7 @@ run();
|
|
|
170
153
|
|
|
171
154
|
| Parameter | Type | Required | Description |
|
|
172
155
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
173
|
-
| `
|
|
156
|
+
| `createSubscriberRequestDto` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
174
157
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
175
158
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
176
159
|
| `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. |
|
|
@@ -178,7 +161,7 @@ run();
|
|
|
178
161
|
|
|
179
162
|
### Response
|
|
180
163
|
|
|
181
|
-
**Promise\<[operations.
|
|
164
|
+
**Promise\<[operations.SubscribersControllerCreateSubscriberResponse](../../models/operations/subscriberscontrollercreatesubscriberresponse.md)\>**
|
|
182
165
|
|
|
183
166
|
### Errors
|
|
184
167
|
|
|
@@ -190,9 +173,9 @@ run();
|
|
|
190
173
|
| errors.ErrorDto | 500 | application/json |
|
|
191
174
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
192
175
|
|
|
193
|
-
##
|
|
176
|
+
## retrieve
|
|
194
177
|
|
|
195
|
-
|
|
178
|
+
Get subscriber by your internal id used to identify the subscriber
|
|
196
179
|
|
|
197
180
|
### Example Usage
|
|
198
181
|
|
|
@@ -204,7 +187,7 @@ const novu = new Novu({
|
|
|
204
187
|
});
|
|
205
188
|
|
|
206
189
|
async function run() {
|
|
207
|
-
const result = await novu.subscribers.
|
|
190
|
+
const result = await novu.subscribers.retrieve("<id>");
|
|
208
191
|
|
|
209
192
|
// Handle the result
|
|
210
193
|
console.log(result);
|
|
@@ -219,7 +202,7 @@ The standalone function version of this method:
|
|
|
219
202
|
|
|
220
203
|
```typescript
|
|
221
204
|
import { NovuCore } from "@novu/api/core.js";
|
|
222
|
-
import {
|
|
205
|
+
import { subscribersRetrieve } from "@novu/api/funcs/subscribersRetrieve.js";
|
|
223
206
|
|
|
224
207
|
// Use `NovuCore` for best tree-shaking performance.
|
|
225
208
|
// You can create one instance of it to use across an application.
|
|
@@ -228,7 +211,7 @@ const novu = new NovuCore({
|
|
|
228
211
|
});
|
|
229
212
|
|
|
230
213
|
async function run() {
|
|
231
|
-
const res = await
|
|
214
|
+
const res = await subscribersRetrieve(novu, "<id>");
|
|
232
215
|
|
|
233
216
|
if (!res.ok) {
|
|
234
217
|
throw res.error;
|
|
@@ -247,14 +230,15 @@ run();
|
|
|
247
230
|
|
|
248
231
|
| Parameter | Type | Required | Description |
|
|
249
232
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
250
|
-
| `
|
|
233
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
234
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
251
235
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
252
236
|
| `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. |
|
|
253
237
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
254
238
|
|
|
255
239
|
### Response
|
|
256
240
|
|
|
257
|
-
**Promise\<[operations.
|
|
241
|
+
**Promise\<[operations.SubscribersControllerGetSubscriberResponse](../../models/operations/subscriberscontrollergetsubscriberresponse.md)\>**
|
|
258
242
|
|
|
259
243
|
### Errors
|
|
260
244
|
|
|
@@ -266,9 +250,9 @@ run();
|
|
|
266
250
|
| errors.ErrorDto | 500 | application/json |
|
|
267
251
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
268
252
|
|
|
269
|
-
##
|
|
253
|
+
## patch
|
|
270
254
|
|
|
271
|
-
|
|
255
|
+
Patch subscriber by your internal id used to identify the subscriber
|
|
272
256
|
|
|
273
257
|
### Example Usage
|
|
274
258
|
|
|
@@ -280,9 +264,7 @@ const novu = new Novu({
|
|
|
280
264
|
});
|
|
281
265
|
|
|
282
266
|
async function run() {
|
|
283
|
-
const result = await novu.subscribers.
|
|
284
|
-
subscriberId: "<id>",
|
|
285
|
-
});
|
|
267
|
+
const result = await novu.subscribers.patch({}, "<id>");
|
|
286
268
|
|
|
287
269
|
// Handle the result
|
|
288
270
|
console.log(result);
|
|
@@ -297,7 +279,7 @@ The standalone function version of this method:
|
|
|
297
279
|
|
|
298
280
|
```typescript
|
|
299
281
|
import { NovuCore } from "@novu/api/core.js";
|
|
300
|
-
import {
|
|
282
|
+
import { subscribersPatch } from "@novu/api/funcs/subscribersPatch.js";
|
|
301
283
|
|
|
302
284
|
// Use `NovuCore` for best tree-shaking performance.
|
|
303
285
|
// You can create one instance of it to use across an application.
|
|
@@ -306,9 +288,7 @@ const novu = new NovuCore({
|
|
|
306
288
|
});
|
|
307
289
|
|
|
308
290
|
async function run() {
|
|
309
|
-
const res = await
|
|
310
|
-
subscriberId: "<id>",
|
|
311
|
-
});
|
|
291
|
+
const res = await subscribersPatch(novu, {}, "<id>");
|
|
312
292
|
|
|
313
293
|
if (!res.ok) {
|
|
314
294
|
throw res.error;
|
|
@@ -327,7 +307,8 @@ run();
|
|
|
327
307
|
|
|
328
308
|
| Parameter | Type | Required | Description |
|
|
329
309
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
330
|
-
| `
|
|
310
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
311
|
+
| `patchSubscriberRequestDto` | [components.PatchSubscriberRequestDto](../../models/components/patchsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
331
312
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
332
313
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
333
314
|
| `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. |
|
|
@@ -335,7 +316,7 @@ run();
|
|
|
335
316
|
|
|
336
317
|
### Response
|
|
337
318
|
|
|
338
|
-
**Promise\<[operations.
|
|
319
|
+
**Promise\<[operations.SubscribersControllerPatchSubscriberResponse](../../models/operations/subscriberscontrollerpatchsubscriberresponse.md)\>**
|
|
339
320
|
|
|
340
321
|
### Errors
|
|
341
322
|
|
|
@@ -347,9 +328,9 @@ run();
|
|
|
347
328
|
| errors.ErrorDto | 500 | application/json |
|
|
348
329
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
349
330
|
|
|
350
|
-
##
|
|
331
|
+
## delete
|
|
351
332
|
|
|
352
|
-
|
|
333
|
+
Deletes a subscriber entity from the Novu platform
|
|
353
334
|
|
|
354
335
|
### Example Usage
|
|
355
336
|
|
|
@@ -361,7 +342,7 @@ const novu = new Novu({
|
|
|
361
342
|
});
|
|
362
343
|
|
|
363
344
|
async function run() {
|
|
364
|
-
const result = await novu.subscribers.
|
|
345
|
+
const result = await novu.subscribers.delete("<id>");
|
|
365
346
|
|
|
366
347
|
// Handle the result
|
|
367
348
|
console.log(result);
|
|
@@ -376,7 +357,7 @@ The standalone function version of this method:
|
|
|
376
357
|
|
|
377
358
|
```typescript
|
|
378
359
|
import { NovuCore } from "@novu/api/core.js";
|
|
379
|
-
import {
|
|
360
|
+
import { subscribersDelete } from "@novu/api/funcs/subscribersDelete.js";
|
|
380
361
|
|
|
381
362
|
// Use `NovuCore` for best tree-shaking performance.
|
|
382
363
|
// You can create one instance of it to use across an application.
|
|
@@ -385,7 +366,7 @@ const novu = new NovuCore({
|
|
|
385
366
|
});
|
|
386
367
|
|
|
387
368
|
async function run() {
|
|
388
|
-
const res = await
|
|
369
|
+
const res = await subscribersDelete(novu, "<id>");
|
|
389
370
|
|
|
390
371
|
if (!res.ok) {
|
|
391
372
|
throw res.error;
|
|
@@ -412,7 +393,7 @@ run();
|
|
|
412
393
|
|
|
413
394
|
### Response
|
|
414
395
|
|
|
415
|
-
**Promise\<[operations.
|
|
396
|
+
**Promise\<[operations.SubscribersControllerRemoveSubscriberResponse](../../models/operations/subscriberscontrollerremovesubscriberresponse.md)\>**
|
|
416
397
|
|
|
417
398
|
### Errors
|
|
418
399
|
|
|
@@ -424,9 +405,9 @@ run();
|
|
|
424
405
|
| errors.ErrorDto | 500 | application/json |
|
|
425
406
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
426
407
|
|
|
427
|
-
##
|
|
408
|
+
## list
|
|
428
409
|
|
|
429
|
-
|
|
410
|
+
Returns a list of subscribers, could paginated using the `page` and `limit` query parameter
|
|
430
411
|
|
|
431
412
|
### Example Usage
|
|
432
413
|
|
|
@@ -438,10 +419,12 @@ const novu = new Novu({
|
|
|
438
419
|
});
|
|
439
420
|
|
|
440
421
|
async function run() {
|
|
441
|
-
const result = await novu.subscribers.
|
|
422
|
+
const result = await novu.subscribers.list();
|
|
442
423
|
|
|
443
|
-
|
|
444
|
-
|
|
424
|
+
for await (const page of result) {
|
|
425
|
+
// Handle the page
|
|
426
|
+
console.log(page);
|
|
427
|
+
}
|
|
445
428
|
}
|
|
446
429
|
|
|
447
430
|
run();
|
|
@@ -453,7 +436,7 @@ The standalone function version of this method:
|
|
|
453
436
|
|
|
454
437
|
```typescript
|
|
455
438
|
import { NovuCore } from "@novu/api/core.js";
|
|
456
|
-
import {
|
|
439
|
+
import { subscribersList } from "@novu/api/funcs/subscribersList.js";
|
|
457
440
|
|
|
458
441
|
// Use `NovuCore` for best tree-shaking performance.
|
|
459
442
|
// You can create one instance of it to use across an application.
|
|
@@ -462,7 +445,7 @@ const novu = new NovuCore({
|
|
|
462
445
|
});
|
|
463
446
|
|
|
464
447
|
async function run() {
|
|
465
|
-
const res = await
|
|
448
|
+
const res = await subscribersList(novu);
|
|
466
449
|
|
|
467
450
|
if (!res.ok) {
|
|
468
451
|
throw res.error;
|
|
@@ -470,8 +453,10 @@ async function run() {
|
|
|
470
453
|
|
|
471
454
|
const { value: result } = res;
|
|
472
455
|
|
|
473
|
-
|
|
474
|
-
|
|
456
|
+
for await (const page of result) {
|
|
457
|
+
// Handle the page
|
|
458
|
+
console.log(page);
|
|
459
|
+
}
|
|
475
460
|
}
|
|
476
461
|
|
|
477
462
|
run();
|
|
@@ -481,8 +466,8 @@ run();
|
|
|
481
466
|
|
|
482
467
|
| Parameter | Type | Required | Description |
|
|
483
468
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
484
|
-
| `
|
|
485
|
-
| `
|
|
469
|
+
| `page` | *number* | :heavy_minus_sign: | N/A |
|
|
470
|
+
| `limit` | *number* | :heavy_minus_sign: | N/A |
|
|
486
471
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
487
472
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
488
473
|
| `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. |
|
|
@@ -490,7 +475,7 @@ run();
|
|
|
490
475
|
|
|
491
476
|
### Response
|
|
492
477
|
|
|
493
|
-
**Promise\<[operations.
|
|
478
|
+
**Promise\<[operations.SubscribersV1ControllerListSubscribersResponse](../../models/operations/subscribersv1controllerlistsubscribersresponse.md)\>**
|
|
494
479
|
|
|
495
480
|
### Errors
|
|
496
481
|
|
|
@@ -502,9 +487,12 @@ run();
|
|
|
502
487
|
| errors.ErrorDto | 500 | application/json |
|
|
503
488
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
504
489
|
|
|
505
|
-
##
|
|
490
|
+
## createBulk
|
|
506
491
|
|
|
507
|
-
|
|
492
|
+
|
|
493
|
+
Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.
|
|
494
|
+
The bulk API is limited to 500 subscribers per request.
|
|
495
|
+
|
|
508
496
|
|
|
509
497
|
### Example Usage
|
|
510
498
|
|
|
@@ -516,7 +504,13 @@ const novu = new Novu({
|
|
|
516
504
|
});
|
|
517
505
|
|
|
518
506
|
async function run() {
|
|
519
|
-
const result = await novu.subscribers.
|
|
507
|
+
const result = await novu.subscribers.createBulk({
|
|
508
|
+
subscribers: [
|
|
509
|
+
{
|
|
510
|
+
subscriberId: "<id>",
|
|
511
|
+
},
|
|
512
|
+
],
|
|
513
|
+
});
|
|
520
514
|
|
|
521
515
|
// Handle the result
|
|
522
516
|
console.log(result);
|
|
@@ -531,7 +525,7 @@ The standalone function version of this method:
|
|
|
531
525
|
|
|
532
526
|
```typescript
|
|
533
527
|
import { NovuCore } from "@novu/api/core.js";
|
|
534
|
-
import {
|
|
528
|
+
import { subscribersCreateBulk } from "@novu/api/funcs/subscribersCreateBulk.js";
|
|
535
529
|
|
|
536
530
|
// Use `NovuCore` for best tree-shaking performance.
|
|
537
531
|
// You can create one instance of it to use across an application.
|
|
@@ -540,7 +534,13 @@ const novu = new NovuCore({
|
|
|
540
534
|
});
|
|
541
535
|
|
|
542
536
|
async function run() {
|
|
543
|
-
const res = await
|
|
537
|
+
const res = await subscribersCreateBulk(novu, {
|
|
538
|
+
subscribers: [
|
|
539
|
+
{
|
|
540
|
+
subscriberId: "<id>",
|
|
541
|
+
},
|
|
542
|
+
],
|
|
543
|
+
});
|
|
544
544
|
|
|
545
545
|
if (!res.ok) {
|
|
546
546
|
throw res.error;
|
|
@@ -559,7 +559,7 @@ run();
|
|
|
559
559
|
|
|
560
560
|
| Parameter | Type | Required | Description |
|
|
561
561
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
562
|
-
| `
|
|
562
|
+
| `bulkSubscriberCreateDto` | [components.BulkSubscriberCreateDto](../../models/components/bulksubscribercreatedto.md) | :heavy_check_mark: | N/A |
|
|
563
563
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
564
564
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
565
565
|
| `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. |
|
|
@@ -567,7 +567,7 @@ run();
|
|
|
567
567
|
|
|
568
568
|
### Response
|
|
569
569
|
|
|
570
|
-
**Promise\<[operations.
|
|
570
|
+
**Promise\<[operations.SubscribersV1ControllerBulkCreateSubscribersResponse](../../models/operations/subscribersv1controllerbulkcreatesubscribersresponse.md)\>**
|
|
571
571
|
|
|
572
572
|
### Errors
|
|
573
573
|
|