@novu/api 0.1.6 → 0.2.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/FUNCTIONS.md +1 -1
- package/README.md +14 -31
- package/docs/sdks/authentication/README.md +4 -4
- package/docs/sdks/credentials/README.md +6 -6
- package/docs/sdks/integrations/README.md +12 -12
- package/docs/sdks/messages/README.md +6 -6
- package/docs/sdks/notifications/README.md +4 -4
- package/docs/sdks/novu/README.md +8 -8
- package/docs/sdks/novumessages/README.md +6 -6
- package/docs/sdks/novunotifications/README.md +4 -4
- package/docs/sdks/novusubscribers/README.md +6 -6
- package/docs/sdks/preferences/README.md +9 -260
- package/docs/sdks/properties/README.md +2 -2
- package/docs/sdks/stats/README.md +4 -4
- package/docs/sdks/subscribers/README.md +50 -322
- package/docs/sdks/topics/README.md +10 -10
- package/docs/sdks/webhooks/README.md +2 -2
- package/funcs/subscribersCreate.d.ts +2 -2
- package/funcs/subscribersCreate.d.ts.map +1 -1
- package/funcs/subscribersCreate.js +5 -5
- package/funcs/subscribersCreate.js.map +1 -1
- package/funcs/{subscribersPreferencesRetrieve.d.ts → subscribersPreferencesList.d.ts} +2 -2
- package/funcs/subscribersPreferencesList.d.ts.map +1 -0
- package/funcs/{subscribersPreferencesRetrieve.js → subscribersPreferencesList.js} +4 -4
- package/funcs/subscribersPreferencesList.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/models/components/index.d.ts +0 -14
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +0 -14
- package/models/components/index.js.map +1 -1
- package/models/components/subscriberresponsedto.d.ts +5 -0
- package/models/components/subscriberresponsedto.d.ts.map +1 -1
- package/models/components/subscriberresponsedto.js +2 -0
- package/models/components/subscriberresponsedto.js.map +1 -1
- package/models/operations/index.d.ts +1 -8
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +1 -8
- package/models/operations/index.js.map +1 -1
- package/models/operations/subscriberscontrollercreatesubscriber.d.ts +66 -0
- package/models/operations/subscriberscontrollercreatesubscriber.d.ts.map +1 -0
- package/models/operations/subscriberscontrollercreatesubscriber.js +112 -0
- package/models/operations/subscriberscontrollercreatesubscriber.js.map +1 -0
- package/package.json +1 -1
- package/sdk/preferences.d.ts +1 -20
- package/sdk/preferences.d.ts.map +1 -1
- package/sdk/preferences.js +3 -32
- package/sdk/preferences.js.map +1 -1
- package/sdk/subscribers.d.ts +9 -32
- package/sdk/subscribers.d.ts.map +1 -1
- package/sdk/subscribers.js +12 -44
- package/sdk/subscribers.js.map +1 -1
- package/sources/json-development.json +2313 -6112
- package/src/funcs/subscribersCreate.ts +9 -9
- package/src/funcs/{subscribersPreferencesRetrieve.ts → subscribersPreferencesList.ts} +1 -1
- package/src/lib/config.ts +3 -3
- package/src/models/components/index.ts +0 -14
- package/src/models/components/subscriberresponsedto.ts +7 -0
- package/src/models/operations/index.ts +1 -8
- package/src/models/operations/subscriberscontrollercreatesubscriber.ts +185 -0
- package/src/sdk/preferences.ts +3 -70
- package/src/sdk/subscribers.ts +24 -90
- package/docs/sdks/legacy/README.md +0 -86
- package/funcs/subscribersDeleteLegacy.d.ts +0 -18
- package/funcs/subscribersDeleteLegacy.d.ts.map +0 -1
- package/funcs/subscribersDeleteLegacy.js +0 -141
- package/funcs/subscribersDeleteLegacy.js.map +0 -1
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.d.ts +0 -14
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.d.ts.map +0 -1
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.js +0 -140
- package/funcs/subscribersPreferencesLegacyUpdateGlobal.js.map +0 -1
- package/funcs/subscribersPreferencesListLegacy.d.ts +0 -15
- package/funcs/subscribersPreferencesListLegacy.d.ts.map +0 -1
- package/funcs/subscribersPreferencesListLegacy.js +0 -145
- package/funcs/subscribersPreferencesListLegacy.js.map +0 -1
- package/funcs/subscribersPreferencesRetrieve.d.ts.map +0 -1
- package/funcs/subscribersPreferencesRetrieve.js.map +0 -1
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.d.ts +0 -15
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.d.ts.map +0 -1
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.js +0 -144
- package/funcs/subscribersPreferencesRetrieveByLevelLegacy.js.map +0 -1
- package/funcs/subscribersPreferencesUpdateLegacy.d.ts +0 -13
- package/funcs/subscribersPreferencesUpdateLegacy.d.ts.map +0 -1
- package/funcs/subscribersPreferencesUpdateLegacy.js +0 -139
- package/funcs/subscribersPreferencesUpdateLegacy.js.map +0 -1
- package/funcs/subscribersRetrieveLegacy.d.ts +0 -16
- package/funcs/subscribersRetrieveLegacy.d.ts.map +0 -1
- package/funcs/subscribersRetrieveLegacy.js +0 -144
- package/funcs/subscribersRetrieveLegacy.js.map +0 -1
- package/funcs/subscribersUpdateLegacy.d.ts +0 -17
- package/funcs/subscribersUpdateLegacy.d.ts.map +0 -1
- package/funcs/subscribersUpdateLegacy.js +0 -143
- package/funcs/subscribersUpdateLegacy.js.map +0 -1
- package/models/components/channelpreference.d.ts +0 -38
- package/models/components/channelpreference.d.ts.map +0 -1
- package/models/components/channelpreference.js +0 -62
- package/models/components/channelpreference.js.map +0 -1
- package/models/components/deletesubscriberresponsedto.d.ts +0 -66
- package/models/components/deletesubscriberresponsedto.d.ts.map +0 -1
- package/models/components/deletesubscriberresponsedto.js +0 -82
- package/models/components/deletesubscriberresponsedto.js.map +0 -1
- package/models/components/getsubscriberpreferencesresponsedto.d.ts +0 -39
- package/models/components/getsubscriberpreferencesresponsedto.d.ts.map +0 -1
- package/models/components/getsubscriberpreferencesresponsedto.js +0 -63
- package/models/components/getsubscriberpreferencesresponsedto.js.map +0 -1
- package/models/components/notificationtriggerresponse.d.ts +0 -55
- package/models/components/notificationtriggerresponse.d.ts.map +0 -1
- package/models/components/notificationtriggerresponse.js +0 -72
- package/models/components/notificationtriggerresponse.js.map +0 -1
- package/models/components/notificationtriggervariableresponse.d.ts +0 -101
- package/models/components/notificationtriggervariableresponse.d.ts.map +0 -1
- package/models/components/notificationtriggervariableresponse.js +0 -112
- package/models/components/notificationtriggervariableresponse.js.map +0 -1
- package/models/components/preference.d.ts +0 -38
- package/models/components/preference.d.ts.map +0 -1
- package/models/components/preference.js +0 -62
- package/models/components/preference.js.map +0 -1
- package/models/components/templateresponse.d.ts +0 -48
- package/models/components/templateresponse.d.ts.map +0 -1
- package/models/components/templateresponse.js +0 -75
- package/models/components/templateresponse.js.map +0 -1
- package/models/components/triggerreservedvariableresponse.d.ts +0 -69
- package/models/components/triggerreservedvariableresponse.d.ts.map +0 -1
- package/models/components/triggerreservedvariableresponse.js +0 -83
- package/models/components/triggerreservedvariableresponse.js.map +0 -1
- package/models/components/triggertypeenum.d.ts +0 -31
- package/models/components/triggertypeenum.d.ts.map +0 -1
- package/models/components/triggertypeenum.js +0 -52
- package/models/components/triggertypeenum.js.map +0 -1
- package/models/components/updatesubscriberglobalpreferencesrequestdto.d.ts +0 -38
- package/models/components/updatesubscriberglobalpreferencesrequestdto.d.ts.map +0 -1
- package/models/components/updatesubscriberglobalpreferencesrequestdto.js +0 -62
- package/models/components/updatesubscriberglobalpreferencesrequestdto.js.map +0 -1
- package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts +0 -33
- package/models/components/updatesubscriberpreferenceglobalresponsedto.d.ts.map +0 -1
- package/models/components/updatesubscriberpreferenceglobalresponsedto.js +0 -60
- package/models/components/updatesubscriberpreferenceglobalresponsedto.js.map +0 -1
- package/models/components/updatesubscriberpreferencerequestdto.d.ts +0 -38
- package/models/components/updatesubscriberpreferencerequestdto.d.ts.map +0 -1
- package/models/components/updatesubscriberpreferencerequestdto.js +0 -62
- package/models/components/updatesubscriberpreferencerequestdto.js.map +0 -1
- package/models/components/updatesubscriberpreferenceresponsedto.d.ts +0 -39
- package/models/components/updatesubscriberpreferenceresponsedto.d.ts.map +0 -1
- package/models/components/updatesubscriberpreferenceresponsedto.js +0 -63
- package/models/components/updatesubscriberpreferenceresponsedto.js.map +0 -1
- package/models/components/updatesubscriberrequestdto.d.ts +0 -72
- package/models/components/updatesubscriberrequestdto.d.ts.map +0 -1
- package/models/components/updatesubscriberrequestdto.js +0 -74
- package/models/components/updatesubscriberrequestdto.js.map +0 -1
- package/models/operations/subscribersv1controllercreatesubscriber.d.ts +0 -66
- package/models/operations/subscribersv1controllercreatesubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllercreatesubscriber.js +0 -112
- package/models/operations/subscribersv1controllercreatesubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriber.d.ts +0 -71
- package/models/operations/subscribersv1controllergetsubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriber.js +0 -112
- package/models/operations/subscribersv1controllergetsubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.d.ts +0 -108
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.d.ts.map +0 -1
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.js +0 -141
- package/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.js.map +0 -1
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.d.ts +0 -71
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.js +0 -116
- package/models/operations/subscribersv1controllerlistsubscriberpreferences.js.map +0 -1
- package/models/operations/subscribersv1controllerremovesubscriber.d.ts +0 -66
- package/models/operations/subscribersv1controllerremovesubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerremovesubscriber.js +0 -110
- package/models/operations/subscribersv1controllerremovesubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriber.d.ts +0 -68
- package/models/operations/subscribersv1controllerupdatesubscriber.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriber.js +0 -114
- package/models/operations/subscribersv1controllerupdatesubscriber.js.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.d.ts +0 -68
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.js +0 -118
- package/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.js.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.d.ts +0 -70
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.d.ts.map +0 -1
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.js +0 -120
- package/models/operations/subscribersv1controllerupdatesubscriberpreference.js.map +0 -1
- package/sdk/legacy.d.ts +0 -10
- package/sdk/legacy.d.ts.map +0 -1
- package/sdk/legacy.js +0 -19
- package/sdk/legacy.js.map +0 -1
- package/src/funcs/subscribersDeleteLegacy.ts +0 -200
- package/src/funcs/subscribersPreferencesLegacyUpdateGlobal.ts +0 -211
- package/src/funcs/subscribersPreferencesListLegacy.ts +0 -209
- package/src/funcs/subscribersPreferencesRetrieveByLevelLegacy.ts +0 -205
- package/src/funcs/subscribersPreferencesUpdateLegacy.ts +0 -202
- package/src/funcs/subscribersRetrieveLegacy.ts +0 -205
- package/src/funcs/subscribersUpdateLegacy.ts +0 -204
- package/src/models/components/channelpreference.ts +0 -81
- package/src/models/components/deletesubscriberresponsedto.ts +0 -114
- package/src/models/components/getsubscriberpreferencesresponsedto.ts +0 -93
- package/src/models/components/notificationtriggerresponse.ts +0 -126
- package/src/models/components/notificationtriggervariableresponse.ts +0 -193
- package/src/models/components/preference.ts +0 -78
- package/src/models/components/templateresponse.ts +0 -105
- package/src/models/components/triggerreservedvariableresponse.ts +0 -116
- package/src/models/components/triggertypeenum.ts +0 -38
- package/src/models/components/updatesubscriberglobalpreferencesrequestdto.ts +0 -95
- package/src/models/components/updatesubscriberpreferenceglobalresponsedto.ts +0 -88
- package/src/models/components/updatesubscriberpreferencerequestdto.ts +0 -87
- package/src/models/components/updatesubscriberpreferenceresponsedto.ts +0 -93
- package/src/models/components/updatesubscriberrequestdto.ts +0 -124
- package/src/models/operations/subscribersv1controllercreatesubscriber.ts +0 -187
- package/src/models/operations/subscribersv1controllergetsubscriber.ts +0 -188
- package/src/models/operations/subscribersv1controllergetsubscriberpreferencebylevel.ts +0 -231
- package/src/models/operations/subscribersv1controllerlistsubscriberpreferences.ts +0 -191
- package/src/models/operations/subscribersv1controllerremovesubscriber.ts +0 -183
- package/src/models/operations/subscribersv1controllerupdatesubscriber.ts +0 -191
- package/src/models/operations/subscribersv1controllerupdatesubscriberglobalpreferences.ts +0 -195
- package/src/models/operations/subscribersv1controllerupdatesubscriberpreference.ts +0 -197
- package/src/sdk/legacy.ts +0 -32
|
@@ -9,12 +9,9 @@ A subscriber in Novu represents someone who should receive a message. A subscrib
|
|
|
9
9
|
### Available Operations
|
|
10
10
|
|
|
11
11
|
* [list](#list) - Get subscribers
|
|
12
|
-
* [create](#create) - Create subscriber
|
|
13
|
-
* [retrieveLegacy](#retrievelegacy) - Get subscriber
|
|
14
|
-
* [updateLegacy](#updatelegacy) - Update subscriber
|
|
15
|
-
* [~~deleteLegacy~~](#deletelegacy) - Delete subscriber :warning: **Deprecated**
|
|
16
12
|
* [createBulk](#createbulk) - Bulk create subscribers
|
|
17
13
|
* [search](#search) - Search for subscribers
|
|
14
|
+
* [create](#create) - Create subscriber
|
|
18
15
|
* [retrieve](#retrieve) - Get subscriber
|
|
19
16
|
* [patch](#patch) - Patch subscriber
|
|
20
17
|
* [delete](#delete) - Delete subscriber
|
|
@@ -29,7 +26,7 @@ Returns a list of subscribers, could paginated using the `page` and `limit` quer
|
|
|
29
26
|
import { Novu } from "@novu/api";
|
|
30
27
|
|
|
31
28
|
const novu = new Novu({
|
|
32
|
-
secretKey: "
|
|
29
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
33
30
|
});
|
|
34
31
|
|
|
35
32
|
async function run() {
|
|
@@ -55,7 +52,7 @@ import { subscribersList } from "@novu/api/funcs/subscribersList.js";
|
|
|
55
52
|
// Use `NovuCore` for best tree-shaking performance.
|
|
56
53
|
// You can create one instance of it to use across an application.
|
|
57
54
|
const novu = new NovuCore({
|
|
58
|
-
secretKey: "
|
|
55
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
59
56
|
});
|
|
60
57
|
|
|
61
58
|
async function run() {
|
|
@@ -101,168 +98,12 @@ run();
|
|
|
101
98
|
| errors.ErrorDto | 500 | application/json |
|
|
102
99
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
103
100
|
|
|
104
|
-
##
|
|
105
|
-
|
|
106
|
-
Creates a subscriber entity, in the Novu platform. The subscriber will be later used to receive notifications, and access notification feeds. Communication credentials such as email, phone number, and 3 rd party credentials i.e slack tokens could be later associated to this entity.
|
|
107
|
-
|
|
108
|
-
### Example Usage
|
|
109
|
-
|
|
110
|
-
```typescript
|
|
111
|
-
import { Novu } from "@novu/api";
|
|
112
|
-
|
|
113
|
-
const novu = new Novu({
|
|
114
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
async function run() {
|
|
118
|
-
const result = await novu.subscribers.create({
|
|
119
|
-
subscriberId: "<id>",
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
// Handle the result
|
|
123
|
-
console.log(result);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
run();
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
### Standalone function
|
|
130
|
-
|
|
131
|
-
The standalone function version of this method:
|
|
132
|
-
|
|
133
|
-
```typescript
|
|
134
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
135
|
-
import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js";
|
|
136
|
-
|
|
137
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
138
|
-
// You can create one instance of it to use across an application.
|
|
139
|
-
const novu = new NovuCore({
|
|
140
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
async function run() {
|
|
144
|
-
const res = await subscribersCreate(novu, {
|
|
145
|
-
subscriberId: "<id>",
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
if (!res.ok) {
|
|
149
|
-
throw res.error;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
const { value: result } = res;
|
|
153
|
-
|
|
154
|
-
// Handle the result
|
|
155
|
-
console.log(result);
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
run();
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
### Parameters
|
|
162
|
-
|
|
163
|
-
| Parameter | Type | Required | Description |
|
|
164
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
165
|
-
| `createSubscriberRequestDto` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
166
|
-
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
167
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
168
|
-
| `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. |
|
|
169
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
170
|
-
|
|
171
|
-
### Response
|
|
172
|
-
|
|
173
|
-
**Promise\<[operations.SubscribersV1ControllerCreateSubscriberResponse](../../models/operations/subscribersv1controllercreatesubscriberresponse.md)\>**
|
|
174
|
-
|
|
175
|
-
### Errors
|
|
176
|
-
|
|
177
|
-
| Error Type | Status Code | Content Type |
|
|
178
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
179
|
-
| errors.ErrorDto | 414 | application/json |
|
|
180
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
181
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
182
|
-
| errors.ErrorDto | 500 | application/json |
|
|
183
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
184
|
-
|
|
185
|
-
## retrieveLegacy
|
|
186
|
-
|
|
187
|
-
Get subscriber by your internal id used to identify the subscriber
|
|
188
|
-
|
|
189
|
-
### Example Usage
|
|
190
|
-
|
|
191
|
-
```typescript
|
|
192
|
-
import { Novu } from "@novu/api";
|
|
193
|
-
|
|
194
|
-
const novu = new Novu({
|
|
195
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
async function run() {
|
|
199
|
-
const result = await novu.subscribers.retrieveLegacy("<id>");
|
|
200
|
-
|
|
201
|
-
// Handle the result
|
|
202
|
-
console.log(result);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
run();
|
|
206
|
-
```
|
|
207
|
-
|
|
208
|
-
### Standalone function
|
|
209
|
-
|
|
210
|
-
The standalone function version of this method:
|
|
211
|
-
|
|
212
|
-
```typescript
|
|
213
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
214
|
-
import { subscribersRetrieveLegacy } from "@novu/api/funcs/subscribersRetrieveLegacy.js";
|
|
215
|
-
|
|
216
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
217
|
-
// You can create one instance of it to use across an application.
|
|
218
|
-
const novu = new NovuCore({
|
|
219
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
async function run() {
|
|
223
|
-
const res = await subscribersRetrieveLegacy(novu, "<id>");
|
|
224
|
-
|
|
225
|
-
if (!res.ok) {
|
|
226
|
-
throw res.error;
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
const { value: result } = res;
|
|
230
|
-
|
|
231
|
-
// Handle the result
|
|
232
|
-
console.log(result);
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
run();
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### Parameters
|
|
239
|
-
|
|
240
|
-
| Parameter | Type | Required | Description |
|
|
241
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
242
|
-
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
243
|
-
| `includeTopics` | *boolean* | :heavy_minus_sign: | Includes the topics associated with the subscriber |
|
|
244
|
-
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
245
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
246
|
-
| `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. |
|
|
247
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
248
|
-
|
|
249
|
-
### Response
|
|
250
|
-
|
|
251
|
-
**Promise\<[operations.SubscribersV1ControllerGetSubscriberResponse](../../models/operations/subscribersv1controllergetsubscriberresponse.md)\>**
|
|
252
|
-
|
|
253
|
-
### Errors
|
|
254
|
-
|
|
255
|
-
| Error Type | Status Code | Content Type |
|
|
256
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
257
|
-
| errors.ErrorDto | 414 | application/json |
|
|
258
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
259
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
260
|
-
| errors.ErrorDto | 500 | application/json |
|
|
261
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
101
|
+
## createBulk
|
|
262
102
|
|
|
263
|
-
## updateLegacy
|
|
264
103
|
|
|
265
|
-
|
|
104
|
+
Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.
|
|
105
|
+
The bulk API is limited to 500 subscribers per request.
|
|
106
|
+
|
|
266
107
|
|
|
267
108
|
### Example Usage
|
|
268
109
|
|
|
@@ -270,28 +111,17 @@ Used to update the subscriber entity with new information
|
|
|
270
111
|
import { Novu } from "@novu/api";
|
|
271
112
|
|
|
272
113
|
const novu = new Novu({
|
|
273
|
-
secretKey: "
|
|
114
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
274
115
|
});
|
|
275
116
|
|
|
276
117
|
async function run() {
|
|
277
|
-
const result = await novu.subscribers.
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
phone: "+1234567890",
|
|
282
|
-
avatar: "https://example.com/avatar.jpg",
|
|
283
|
-
locale: "en-US",
|
|
284
|
-
data: {
|
|
285
|
-
"preferences": {
|
|
286
|
-
"notifications": true,
|
|
287
|
-
"theme": "dark",
|
|
118
|
+
const result = await novu.subscribers.createBulk({
|
|
119
|
+
subscribers: [
|
|
120
|
+
{
|
|
121
|
+
subscriberId: "<id>",
|
|
288
122
|
},
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
"newsletter",
|
|
292
|
-
],
|
|
293
|
-
},
|
|
294
|
-
}, "<id>");
|
|
123
|
+
],
|
|
124
|
+
});
|
|
295
125
|
|
|
296
126
|
// Handle the result
|
|
297
127
|
console.log(result);
|
|
@@ -306,33 +136,22 @@ The standalone function version of this method:
|
|
|
306
136
|
|
|
307
137
|
```typescript
|
|
308
138
|
import { NovuCore } from "@novu/api/core.js";
|
|
309
|
-
import {
|
|
139
|
+
import { subscribersCreateBulk } from "@novu/api/funcs/subscribersCreateBulk.js";
|
|
310
140
|
|
|
311
141
|
// Use `NovuCore` for best tree-shaking performance.
|
|
312
142
|
// You can create one instance of it to use across an application.
|
|
313
143
|
const novu = new NovuCore({
|
|
314
|
-
secretKey: "
|
|
144
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
315
145
|
});
|
|
316
146
|
|
|
317
147
|
async function run() {
|
|
318
|
-
const res = await
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
phone: "+1234567890",
|
|
323
|
-
avatar: "https://example.com/avatar.jpg",
|
|
324
|
-
locale: "en-US",
|
|
325
|
-
data: {
|
|
326
|
-
"preferences": {
|
|
327
|
-
"notifications": true,
|
|
328
|
-
"theme": "dark",
|
|
148
|
+
const res = await subscribersCreateBulk(novu, {
|
|
149
|
+
subscribers: [
|
|
150
|
+
{
|
|
151
|
+
subscriberId: "<id>",
|
|
329
152
|
},
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
"newsletter",
|
|
333
|
-
],
|
|
334
|
-
},
|
|
335
|
-
}, "<id>");
|
|
153
|
+
],
|
|
154
|
+
});
|
|
336
155
|
|
|
337
156
|
if (!res.ok) {
|
|
338
157
|
throw res.error;
|
|
@@ -351,8 +170,7 @@ run();
|
|
|
351
170
|
|
|
352
171
|
| Parameter | Type | Required | Description |
|
|
353
172
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
354
|
-
| `
|
|
355
|
-
| `updateSubscriberRequestDto` | [components.UpdateSubscriberRequestDto](../../models/components/updatesubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
173
|
+
| `bulkSubscriberCreateDto` | [components.BulkSubscriberCreateDto](../../models/components/bulksubscribercreatedto.md) | :heavy_check_mark: | N/A |
|
|
356
174
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
357
175
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
358
176
|
| `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. |
|
|
@@ -360,7 +178,7 @@ run();
|
|
|
360
178
|
|
|
361
179
|
### Response
|
|
362
180
|
|
|
363
|
-
**Promise\<[operations.
|
|
181
|
+
**Promise\<[operations.SubscribersV1ControllerBulkCreateSubscribersResponse](../../models/operations/subscribersv1controllerbulkcreatesubscribersresponse.md)\>**
|
|
364
182
|
|
|
365
183
|
### Errors
|
|
366
184
|
|
|
@@ -372,11 +190,9 @@ run();
|
|
|
372
190
|
| errors.ErrorDto | 500 | application/json |
|
|
373
191
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
374
192
|
|
|
375
|
-
##
|
|
376
|
-
|
|
377
|
-
Deletes a subscriber entity from the Novu platform
|
|
193
|
+
## search
|
|
378
194
|
|
|
379
|
-
|
|
195
|
+
Search for subscribers
|
|
380
196
|
|
|
381
197
|
### Example Usage
|
|
382
198
|
|
|
@@ -384,11 +200,11 @@ Deletes a subscriber entity from the Novu platform
|
|
|
384
200
|
import { Novu } from "@novu/api";
|
|
385
201
|
|
|
386
202
|
const novu = new Novu({
|
|
387
|
-
secretKey: "
|
|
203
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
388
204
|
});
|
|
389
205
|
|
|
390
206
|
async function run() {
|
|
391
|
-
const result = await novu.subscribers.
|
|
207
|
+
const result = await novu.subscribers.search({});
|
|
392
208
|
|
|
393
209
|
// Handle the result
|
|
394
210
|
console.log(result);
|
|
@@ -403,16 +219,16 @@ The standalone function version of this method:
|
|
|
403
219
|
|
|
404
220
|
```typescript
|
|
405
221
|
import { NovuCore } from "@novu/api/core.js";
|
|
406
|
-
import {
|
|
222
|
+
import { subscribersSearch } from "@novu/api/funcs/subscribersSearch.js";
|
|
407
223
|
|
|
408
224
|
// Use `NovuCore` for best tree-shaking performance.
|
|
409
225
|
// You can create one instance of it to use across an application.
|
|
410
226
|
const novu = new NovuCore({
|
|
411
|
-
secretKey: "
|
|
227
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
412
228
|
});
|
|
413
229
|
|
|
414
230
|
async function run() {
|
|
415
|
-
const res = await
|
|
231
|
+
const res = await subscribersSearch(novu, {});
|
|
416
232
|
|
|
417
233
|
if (!res.ok) {
|
|
418
234
|
throw res.error;
|
|
@@ -431,15 +247,14 @@ run();
|
|
|
431
247
|
|
|
432
248
|
| Parameter | Type | Required | Description |
|
|
433
249
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
434
|
-
| `
|
|
435
|
-
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
250
|
+
| `request` | [operations.SubscribersControllerSearchSubscribersRequest](../../models/operations/subscriberscontrollersearchsubscribersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
436
251
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
437
252
|
| `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. |
|
|
438
253
|
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
439
254
|
|
|
440
255
|
### Response
|
|
441
256
|
|
|
442
|
-
**Promise\<[operations.
|
|
257
|
+
**Promise\<[operations.SubscribersControllerSearchSubscribersResponse](../../models/operations/subscriberscontrollersearchsubscribersresponse.md)\>**
|
|
443
258
|
|
|
444
259
|
### Errors
|
|
445
260
|
|
|
@@ -451,12 +266,9 @@ run();
|
|
|
451
266
|
| errors.ErrorDto | 500 | application/json |
|
|
452
267
|
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
453
268
|
|
|
454
|
-
##
|
|
455
|
-
|
|
269
|
+
## create
|
|
456
270
|
|
|
457
|
-
|
|
458
|
-
The bulk API is limited to 500 subscribers per request.
|
|
459
|
-
|
|
271
|
+
Create subscriber with the given data
|
|
460
272
|
|
|
461
273
|
### Example Usage
|
|
462
274
|
|
|
@@ -464,16 +276,12 @@ run();
|
|
|
464
276
|
import { Novu } from "@novu/api";
|
|
465
277
|
|
|
466
278
|
const novu = new Novu({
|
|
467
|
-
secretKey: "
|
|
279
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
468
280
|
});
|
|
469
281
|
|
|
470
282
|
async function run() {
|
|
471
|
-
const result = await novu.subscribers.
|
|
472
|
-
|
|
473
|
-
{
|
|
474
|
-
subscriberId: "<id>",
|
|
475
|
-
},
|
|
476
|
-
],
|
|
283
|
+
const result = await novu.subscribers.create({
|
|
284
|
+
subscriberId: "<id>",
|
|
477
285
|
});
|
|
478
286
|
|
|
479
287
|
// Handle the result
|
|
@@ -489,21 +297,17 @@ The standalone function version of this method:
|
|
|
489
297
|
|
|
490
298
|
```typescript
|
|
491
299
|
import { NovuCore } from "@novu/api/core.js";
|
|
492
|
-
import {
|
|
300
|
+
import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js";
|
|
493
301
|
|
|
494
302
|
// Use `NovuCore` for best tree-shaking performance.
|
|
495
303
|
// You can create one instance of it to use across an application.
|
|
496
304
|
const novu = new NovuCore({
|
|
497
|
-
secretKey: "
|
|
305
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
498
306
|
});
|
|
499
307
|
|
|
500
308
|
async function run() {
|
|
501
|
-
const res = await
|
|
502
|
-
|
|
503
|
-
{
|
|
504
|
-
subscriberId: "<id>",
|
|
505
|
-
},
|
|
506
|
-
],
|
|
309
|
+
const res = await subscribersCreate(novu, {
|
|
310
|
+
subscriberId: "<id>",
|
|
507
311
|
});
|
|
508
312
|
|
|
509
313
|
if (!res.ok) {
|
|
@@ -523,7 +327,7 @@ run();
|
|
|
523
327
|
|
|
524
328
|
| Parameter | Type | Required | Description |
|
|
525
329
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
526
|
-
| `
|
|
330
|
+
| `createSubscriberRequestDto` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
527
331
|
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
528
332
|
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
529
333
|
| `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. |
|
|
@@ -531,83 +335,7 @@ run();
|
|
|
531
335
|
|
|
532
336
|
### Response
|
|
533
337
|
|
|
534
|
-
**Promise\<[operations.
|
|
535
|
-
|
|
536
|
-
### Errors
|
|
537
|
-
|
|
538
|
-
| Error Type | Status Code | Content Type |
|
|
539
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
540
|
-
| errors.ErrorDto | 414 | application/json |
|
|
541
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
542
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
543
|
-
| errors.ErrorDto | 500 | application/json |
|
|
544
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
545
|
-
|
|
546
|
-
## search
|
|
547
|
-
|
|
548
|
-
Search for subscribers
|
|
549
|
-
|
|
550
|
-
### Example Usage
|
|
551
|
-
|
|
552
|
-
```typescript
|
|
553
|
-
import { Novu } from "@novu/api";
|
|
554
|
-
|
|
555
|
-
const novu = new Novu({
|
|
556
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
557
|
-
});
|
|
558
|
-
|
|
559
|
-
async function run() {
|
|
560
|
-
const result = await novu.subscribers.search({});
|
|
561
|
-
|
|
562
|
-
// Handle the result
|
|
563
|
-
console.log(result);
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
run();
|
|
567
|
-
```
|
|
568
|
-
|
|
569
|
-
### Standalone function
|
|
570
|
-
|
|
571
|
-
The standalone function version of this method:
|
|
572
|
-
|
|
573
|
-
```typescript
|
|
574
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
575
|
-
import { subscribersSearch } from "@novu/api/funcs/subscribersSearch.js";
|
|
576
|
-
|
|
577
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
578
|
-
// You can create one instance of it to use across an application.
|
|
579
|
-
const novu = new NovuCore({
|
|
580
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
581
|
-
});
|
|
582
|
-
|
|
583
|
-
async function run() {
|
|
584
|
-
const res = await subscribersSearch(novu, {});
|
|
585
|
-
|
|
586
|
-
if (!res.ok) {
|
|
587
|
-
throw res.error;
|
|
588
|
-
}
|
|
589
|
-
|
|
590
|
-
const { value: result } = res;
|
|
591
|
-
|
|
592
|
-
// Handle the result
|
|
593
|
-
console.log(result);
|
|
594
|
-
}
|
|
595
|
-
|
|
596
|
-
run();
|
|
597
|
-
```
|
|
598
|
-
|
|
599
|
-
### Parameters
|
|
600
|
-
|
|
601
|
-
| Parameter | Type | Required | Description |
|
|
602
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
603
|
-
| `request` | [operations.SubscribersControllerSearchSubscribersRequest](../../models/operations/subscriberscontrollersearchsubscribersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
604
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
605
|
-
| `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. |
|
|
606
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
607
|
-
|
|
608
|
-
### Response
|
|
609
|
-
|
|
610
|
-
**Promise\<[operations.SubscribersControllerSearchSubscribersResponse](../../models/operations/subscriberscontrollersearchsubscribersresponse.md)\>**
|
|
338
|
+
**Promise\<[operations.SubscribersControllerCreateSubscriberResponse](../../models/operations/subscriberscontrollercreatesubscriberresponse.md)\>**
|
|
611
339
|
|
|
612
340
|
### Errors
|
|
613
341
|
|
|
@@ -629,7 +357,7 @@ Get subscriber by your internal id used to identify the subscriber
|
|
|
629
357
|
import { Novu } from "@novu/api";
|
|
630
358
|
|
|
631
359
|
const novu = new Novu({
|
|
632
|
-
secretKey: "
|
|
360
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
633
361
|
});
|
|
634
362
|
|
|
635
363
|
async function run() {
|
|
@@ -653,7 +381,7 @@ import { subscribersRetrieve } from "@novu/api/funcs/subscribersRetrieve.js";
|
|
|
653
381
|
// Use `NovuCore` for best tree-shaking performance.
|
|
654
382
|
// You can create one instance of it to use across an application.
|
|
655
383
|
const novu = new NovuCore({
|
|
656
|
-
secretKey: "
|
|
384
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
657
385
|
});
|
|
658
386
|
|
|
659
387
|
async function run() {
|
|
@@ -706,7 +434,7 @@ Patch subscriber by your internal id used to identify the subscriber
|
|
|
706
434
|
import { Novu } from "@novu/api";
|
|
707
435
|
|
|
708
436
|
const novu = new Novu({
|
|
709
|
-
secretKey: "
|
|
437
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
710
438
|
});
|
|
711
439
|
|
|
712
440
|
async function run() {
|
|
@@ -730,7 +458,7 @@ import { subscribersPatch } from "@novu/api/funcs/subscribersPatch.js";
|
|
|
730
458
|
// Use `NovuCore` for best tree-shaking performance.
|
|
731
459
|
// You can create one instance of it to use across an application.
|
|
732
460
|
const novu = new NovuCore({
|
|
733
|
-
secretKey: "
|
|
461
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
734
462
|
});
|
|
735
463
|
|
|
736
464
|
async function run() {
|
|
@@ -784,7 +512,7 @@ Deletes a subscriber entity from the Novu platform
|
|
|
784
512
|
import { Novu } from "@novu/api";
|
|
785
513
|
|
|
786
514
|
const novu = new Novu({
|
|
787
|
-
secretKey: "
|
|
515
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
788
516
|
});
|
|
789
517
|
|
|
790
518
|
async function run() {
|
|
@@ -808,7 +536,7 @@ import { subscribersDelete } from "@novu/api/funcs/subscribersDelete.js";
|
|
|
808
536
|
// Use `NovuCore` for best tree-shaking performance.
|
|
809
537
|
// You can create one instance of it to use across an application.
|
|
810
538
|
const novu = new NovuCore({
|
|
811
|
-
secretKey: "
|
|
539
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
812
540
|
});
|
|
813
541
|
|
|
814
542
|
async function run() {
|