@novu/api 0.1.5 → 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 +12 -26
- 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 +5 -331
- 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/subscribersPreferencesList.d.ts +4 -1
- package/funcs/subscribersPreferencesList.d.ts.map +1 -1
- package/funcs/subscribersPreferencesList.js +8 -10
- package/funcs/subscribersPreferencesList.js.map +1 -1
- 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 -17
- package/sdk/preferences.d.ts.map +1 -1
- package/sdk/preferences.js +2 -30
- 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 +2321 -6117
- package/src/funcs/subscribersCreate.ts +9 -9
- package/src/funcs/subscribersPreferencesList.ts +12 -16
- 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 +2 -81
- package/src/sdk/subscribers.ts +24 -90
- 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/subscribersPreferencesRetrieve.d.ts +0 -16
- package/funcs/subscribersPreferencesRetrieve.d.ts.map +0 -1
- package/funcs/subscribersPreferencesRetrieve.js +0 -141
- package/funcs/subscribersPreferencesRetrieve.js.map +0 -1
- package/funcs/subscribersPreferencesRetrieveByLevel.d.ts +0 -13
- package/funcs/subscribersPreferencesRetrieveByLevel.d.ts.map +0 -1
- package/funcs/subscribersPreferencesRetrieveByLevel.js +0 -142
- package/funcs/subscribersPreferencesRetrieveByLevel.js.map +0 -1
- package/funcs/subscribersPreferencesUpdateGlobal.d.ts +0 -14
- package/funcs/subscribersPreferencesUpdateGlobal.d.ts.map +0 -1
- package/funcs/subscribersPreferencesUpdateGlobal.js +0 -140
- package/funcs/subscribersPreferencesUpdateGlobal.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/subscribersUpdate.d.ts +0 -17
- package/funcs/subscribersUpdate.d.ts.map +0 -1
- package/funcs/subscribersUpdate.js +0 -143
- package/funcs/subscribersUpdate.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/src/funcs/subscribersDeleteLegacy.ts +0 -200
- package/src/funcs/subscribersPreferencesRetrieve.ts +0 -203
- package/src/funcs/subscribersPreferencesRetrieveByLevel.ts +0 -203
- package/src/funcs/subscribersPreferencesUpdateGlobal.ts +0 -211
- package/src/funcs/subscribersPreferencesUpdateLegacy.ts +0 -202
- package/src/funcs/subscribersRetrieveLegacy.ts +0 -205
- package/src/funcs/subscribersUpdate.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
|
@@ -6,15 +6,11 @@
|
|
|
6
6
|
### Available Operations
|
|
7
7
|
|
|
8
8
|
* [list](#list) - Get subscriber preferences
|
|
9
|
-
* [updateGlobal](#updateglobal) - Update subscriber global preferences
|
|
10
|
-
* [retrieveByLevel](#retrievebylevel) - Get subscriber preferences by level
|
|
11
|
-
* [updateLegacy](#updatelegacy) - Update subscriber preference
|
|
12
|
-
* [retrieve](#retrieve) - Get subscriber preferences
|
|
13
9
|
* [update](#update) - Update subscriber global or workflow specific preferences
|
|
14
10
|
|
|
15
11
|
## list
|
|
16
12
|
|
|
17
|
-
Get subscriber preferences
|
|
13
|
+
Get subscriber global and workflow specific preferences
|
|
18
14
|
|
|
19
15
|
### Example Usage
|
|
20
16
|
|
|
@@ -22,7 +18,7 @@ Get subscriber preferences
|
|
|
22
18
|
import { Novu } from "@novu/api";
|
|
23
19
|
|
|
24
20
|
const novu = new Novu({
|
|
25
|
-
secretKey: "
|
|
21
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
26
22
|
});
|
|
27
23
|
|
|
28
24
|
async function run() {
|
|
@@ -46,7 +42,7 @@ import { subscribersPreferencesList } from "@novu/api/funcs/subscribersPreferenc
|
|
|
46
42
|
// Use `NovuCore` for best tree-shaking performance.
|
|
47
43
|
// You can create one instance of it to use across an application.
|
|
48
44
|
const novu = new NovuCore({
|
|
49
|
-
secretKey: "
|
|
45
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
50
46
|
});
|
|
51
47
|
|
|
52
48
|
async function run() {
|
|
@@ -67,328 +63,6 @@ run();
|
|
|
67
63
|
|
|
68
64
|
### Parameters
|
|
69
65
|
|
|
70
|
-
| Parameter | Type | Required | Description |
|
|
71
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
72
|
-
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
73
|
-
| `includeInactiveChannels` | *boolean* | :heavy_minus_sign: | A flag which specifies if the inactive workflow channels should be included in the retrieved preferences. Default is true |
|
|
74
|
-
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
75
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
76
|
-
| `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. |
|
|
77
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
78
|
-
|
|
79
|
-
### Response
|
|
80
|
-
|
|
81
|
-
**Promise\<[operations.SubscribersV1ControllerListSubscriberPreferencesResponse](../../models/operations/subscribersv1controllerlistsubscriberpreferencesresponse.md)\>**
|
|
82
|
-
|
|
83
|
-
### Errors
|
|
84
|
-
|
|
85
|
-
| Error Type | Status Code | Content Type |
|
|
86
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
87
|
-
| errors.ErrorDto | 414 | application/json |
|
|
88
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
89
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
90
|
-
| errors.ErrorDto | 500 | application/json |
|
|
91
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
92
|
-
|
|
93
|
-
## updateGlobal
|
|
94
|
-
|
|
95
|
-
Update subscriber global preferences
|
|
96
|
-
|
|
97
|
-
### Example Usage
|
|
98
|
-
|
|
99
|
-
```typescript
|
|
100
|
-
import { Novu } from "@novu/api";
|
|
101
|
-
|
|
102
|
-
const novu = new Novu({
|
|
103
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
async function run() {
|
|
107
|
-
const result = await novu.subscribers.preferences.updateGlobal({}, "<id>");
|
|
108
|
-
|
|
109
|
-
// Handle the result
|
|
110
|
-
console.log(result);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
run();
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### Standalone function
|
|
117
|
-
|
|
118
|
-
The standalone function version of this method:
|
|
119
|
-
|
|
120
|
-
```typescript
|
|
121
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
122
|
-
import { subscribersPreferencesUpdateGlobal } from "@novu/api/funcs/subscribersPreferencesUpdateGlobal.js";
|
|
123
|
-
|
|
124
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
125
|
-
// You can create one instance of it to use across an application.
|
|
126
|
-
const novu = new NovuCore({
|
|
127
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
128
|
-
});
|
|
129
|
-
|
|
130
|
-
async function run() {
|
|
131
|
-
const res = await subscribersPreferencesUpdateGlobal(novu, {}, "<id>");
|
|
132
|
-
|
|
133
|
-
if (!res.ok) {
|
|
134
|
-
throw res.error;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const { value: result } = res;
|
|
138
|
-
|
|
139
|
-
// Handle the result
|
|
140
|
-
console.log(result);
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
run();
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Parameters
|
|
147
|
-
|
|
148
|
-
| Parameter | Type | Required | Description |
|
|
149
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
150
|
-
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
151
|
-
| `updateSubscriberGlobalPreferencesRequestDto` | [components.UpdateSubscriberGlobalPreferencesRequestDto](../../models/components/updatesubscriberglobalpreferencesrequestdto.md) | :heavy_check_mark: | N/A |
|
|
152
|
-
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
153
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
154
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
155
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
156
|
-
|
|
157
|
-
### Response
|
|
158
|
-
|
|
159
|
-
**Promise\<[operations.SubscribersV1ControllerUpdateSubscriberGlobalPreferencesResponse](../../models/operations/subscribersv1controllerupdatesubscriberglobalpreferencesresponse.md)\>**
|
|
160
|
-
|
|
161
|
-
### Errors
|
|
162
|
-
|
|
163
|
-
| Error Type | Status Code | Content Type |
|
|
164
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
165
|
-
| errors.ErrorDto | 414 | application/json |
|
|
166
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
167
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
168
|
-
| errors.ErrorDto | 500 | application/json |
|
|
169
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
170
|
-
|
|
171
|
-
## retrieveByLevel
|
|
172
|
-
|
|
173
|
-
Get subscriber preferences by level
|
|
174
|
-
|
|
175
|
-
### Example Usage
|
|
176
|
-
|
|
177
|
-
```typescript
|
|
178
|
-
import { Novu } from "@novu/api";
|
|
179
|
-
|
|
180
|
-
const novu = new Novu({
|
|
181
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
async function run() {
|
|
185
|
-
const result = await novu.subscribers.preferences.retrieveByLevel({
|
|
186
|
-
preferenceLevel: "template",
|
|
187
|
-
subscriberId: "<id>",
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
// Handle the result
|
|
191
|
-
console.log(result);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
run();
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Standalone function
|
|
198
|
-
|
|
199
|
-
The standalone function version of this method:
|
|
200
|
-
|
|
201
|
-
```typescript
|
|
202
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
203
|
-
import { subscribersPreferencesRetrieveByLevel } from "@novu/api/funcs/subscribersPreferencesRetrieveByLevel.js";
|
|
204
|
-
|
|
205
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
206
|
-
// You can create one instance of it to use across an application.
|
|
207
|
-
const novu = new NovuCore({
|
|
208
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
async function run() {
|
|
212
|
-
const res = await subscribersPreferencesRetrieveByLevel(novu, {
|
|
213
|
-
preferenceLevel: "template",
|
|
214
|
-
subscriberId: "<id>",
|
|
215
|
-
});
|
|
216
|
-
|
|
217
|
-
if (!res.ok) {
|
|
218
|
-
throw res.error;
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
const { value: result } = res;
|
|
222
|
-
|
|
223
|
-
// Handle the result
|
|
224
|
-
console.log(result);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
run();
|
|
228
|
-
```
|
|
229
|
-
|
|
230
|
-
### Parameters
|
|
231
|
-
|
|
232
|
-
| Parameter | Type | Required | Description |
|
|
233
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
234
|
-
| `request` | [operations.SubscribersV1ControllerGetSubscriberPreferenceByLevelRequest](../../models/operations/subscribersv1controllergetsubscriberpreferencebylevelrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
235
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
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. |
|
|
237
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
238
|
-
|
|
239
|
-
### Response
|
|
240
|
-
|
|
241
|
-
**Promise\<[operations.SubscribersV1ControllerGetSubscriberPreferenceByLevelResponse](../../models/operations/subscribersv1controllergetsubscriberpreferencebylevelresponse.md)\>**
|
|
242
|
-
|
|
243
|
-
### Errors
|
|
244
|
-
|
|
245
|
-
| Error Type | Status Code | Content Type |
|
|
246
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
247
|
-
| errors.ErrorDto | 414 | application/json |
|
|
248
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
249
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
250
|
-
| errors.ErrorDto | 500 | application/json |
|
|
251
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
252
|
-
|
|
253
|
-
## updateLegacy
|
|
254
|
-
|
|
255
|
-
Update subscriber preference
|
|
256
|
-
|
|
257
|
-
### Example Usage
|
|
258
|
-
|
|
259
|
-
```typescript
|
|
260
|
-
import { Novu } from "@novu/api";
|
|
261
|
-
|
|
262
|
-
const novu = new Novu({
|
|
263
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
264
|
-
});
|
|
265
|
-
|
|
266
|
-
async function run() {
|
|
267
|
-
const result = await novu.subscribers.preferences.updateLegacy({
|
|
268
|
-
subscriberId: "<id>",
|
|
269
|
-
workflowId: "<id>",
|
|
270
|
-
updateSubscriberPreferenceRequestDto: {},
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
// Handle the result
|
|
274
|
-
console.log(result);
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
run();
|
|
278
|
-
```
|
|
279
|
-
|
|
280
|
-
### Standalone function
|
|
281
|
-
|
|
282
|
-
The standalone function version of this method:
|
|
283
|
-
|
|
284
|
-
```typescript
|
|
285
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
286
|
-
import { subscribersPreferencesUpdateLegacy } from "@novu/api/funcs/subscribersPreferencesUpdateLegacy.js";
|
|
287
|
-
|
|
288
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
289
|
-
// You can create one instance of it to use across an application.
|
|
290
|
-
const novu = new NovuCore({
|
|
291
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
async function run() {
|
|
295
|
-
const res = await subscribersPreferencesUpdateLegacy(novu, {
|
|
296
|
-
subscriberId: "<id>",
|
|
297
|
-
workflowId: "<id>",
|
|
298
|
-
updateSubscriberPreferenceRequestDto: {},
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
if (!res.ok) {
|
|
302
|
-
throw res.error;
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
const { value: result } = res;
|
|
306
|
-
|
|
307
|
-
// Handle the result
|
|
308
|
-
console.log(result);
|
|
309
|
-
}
|
|
310
|
-
|
|
311
|
-
run();
|
|
312
|
-
```
|
|
313
|
-
|
|
314
|
-
### Parameters
|
|
315
|
-
|
|
316
|
-
| Parameter | Type | Required | Description |
|
|
317
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
318
|
-
| `request` | [operations.SubscribersV1ControllerUpdateSubscriberPreferenceRequest](../../models/operations/subscribersv1controllerupdatesubscriberpreferencerequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
319
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
320
|
-
| `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. |
|
|
321
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
322
|
-
|
|
323
|
-
### Response
|
|
324
|
-
|
|
325
|
-
**Promise\<[operations.SubscribersV1ControllerUpdateSubscriberPreferenceResponse](../../models/operations/subscribersv1controllerupdatesubscriberpreferenceresponse.md)\>**
|
|
326
|
-
|
|
327
|
-
### Errors
|
|
328
|
-
|
|
329
|
-
| Error Type | Status Code | Content Type |
|
|
330
|
-
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
331
|
-
| errors.ErrorDto | 414 | application/json |
|
|
332
|
-
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
333
|
-
| errors.ValidationErrorDto | 422 | application/json |
|
|
334
|
-
| errors.ErrorDto | 500 | application/json |
|
|
335
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
336
|
-
|
|
337
|
-
## retrieve
|
|
338
|
-
|
|
339
|
-
Get subscriber global and workflow specific preferences
|
|
340
|
-
|
|
341
|
-
### Example Usage
|
|
342
|
-
|
|
343
|
-
```typescript
|
|
344
|
-
import { Novu } from "@novu/api";
|
|
345
|
-
|
|
346
|
-
const novu = new Novu({
|
|
347
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
348
|
-
});
|
|
349
|
-
|
|
350
|
-
async function run() {
|
|
351
|
-
const result = await novu.subscribers.preferences.retrieve("<id>");
|
|
352
|
-
|
|
353
|
-
// Handle the result
|
|
354
|
-
console.log(result);
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
run();
|
|
358
|
-
```
|
|
359
|
-
|
|
360
|
-
### Standalone function
|
|
361
|
-
|
|
362
|
-
The standalone function version of this method:
|
|
363
|
-
|
|
364
|
-
```typescript
|
|
365
|
-
import { NovuCore } from "@novu/api/core.js";
|
|
366
|
-
import { subscribersPreferencesRetrieve } from "@novu/api/funcs/subscribersPreferencesRetrieve.js";
|
|
367
|
-
|
|
368
|
-
// Use `NovuCore` for best tree-shaking performance.
|
|
369
|
-
// You can create one instance of it to use across an application.
|
|
370
|
-
const novu = new NovuCore({
|
|
371
|
-
secretKey: "<YOUR_API_KEY_HERE>",
|
|
372
|
-
});
|
|
373
|
-
|
|
374
|
-
async function run() {
|
|
375
|
-
const res = await subscribersPreferencesRetrieve(novu, "<id>");
|
|
376
|
-
|
|
377
|
-
if (!res.ok) {
|
|
378
|
-
throw res.error;
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
const { value: result } = res;
|
|
382
|
-
|
|
383
|
-
// Handle the result
|
|
384
|
-
console.log(result);
|
|
385
|
-
}
|
|
386
|
-
|
|
387
|
-
run();
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
### Parameters
|
|
391
|
-
|
|
392
66
|
| Parameter | Type | Required | Description |
|
|
393
67
|
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
394
68
|
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
@@ -421,7 +95,7 @@ Update subscriber global or workflow specific preferences
|
|
|
421
95
|
import { Novu } from "@novu/api";
|
|
422
96
|
|
|
423
97
|
const novu = new Novu({
|
|
424
|
-
secretKey: "
|
|
98
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
425
99
|
});
|
|
426
100
|
|
|
427
101
|
async function run() {
|
|
@@ -447,7 +121,7 @@ import { subscribersPreferencesUpdate } from "@novu/api/funcs/subscribersPrefere
|
|
|
447
121
|
// Use `NovuCore` for best tree-shaking performance.
|
|
448
122
|
// You can create one instance of it to use across an application.
|
|
449
123
|
const novu = new NovuCore({
|
|
450
|
-
secretKey: "
|
|
124
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
451
125
|
});
|
|
452
126
|
|
|
453
127
|
async function run() {
|
|
@@ -17,7 +17,7 @@ Used to update the subscriber isOnline flag.
|
|
|
17
17
|
import { Novu } from "@novu/api";
|
|
18
18
|
|
|
19
19
|
const novu = new Novu({
|
|
20
|
-
secretKey: "
|
|
20
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
async function run() {
|
|
@@ -43,7 +43,7 @@ import { subscribersPropertiesUpdateOnlineFlag } from "@novu/api/funcs/subscribe
|
|
|
43
43
|
// Use `NovuCore` for best tree-shaking performance.
|
|
44
44
|
// You can create one instance of it to use across an application.
|
|
45
45
|
const novu = new NovuCore({
|
|
46
|
-
secretKey: "
|
|
46
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
47
47
|
});
|
|
48
48
|
|
|
49
49
|
async function run() {
|
|
@@ -18,7 +18,7 @@ Get notification statistics
|
|
|
18
18
|
import { Novu } from "@novu/api";
|
|
19
19
|
|
|
20
20
|
const novu = new Novu({
|
|
21
|
-
secretKey: "
|
|
21
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
async function run() {
|
|
@@ -42,7 +42,7 @@ import { notificationsStatsRetrieve } from "@novu/api/funcs/notificationsStatsRe
|
|
|
42
42
|
// Use `NovuCore` for best tree-shaking performance.
|
|
43
43
|
// You can create one instance of it to use across an application.
|
|
44
44
|
const novu = new NovuCore({
|
|
45
|
-
secretKey: "
|
|
45
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
async function run() {
|
|
@@ -94,7 +94,7 @@ Get notification graph statistics
|
|
|
94
94
|
import { Novu } from "@novu/api";
|
|
95
95
|
|
|
96
96
|
const novu = new Novu({
|
|
97
|
-
secretKey: "
|
|
97
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
98
98
|
});
|
|
99
99
|
|
|
100
100
|
async function run() {
|
|
@@ -118,7 +118,7 @@ import { notificationsStatsGraph } from "@novu/api/funcs/notificationsStatsGraph
|
|
|
118
118
|
// Use `NovuCore` for best tree-shaking performance.
|
|
119
119
|
// You can create one instance of it to use across an application.
|
|
120
120
|
const novu = new NovuCore({
|
|
121
|
-
secretKey: "
|
|
121
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
122
122
|
});
|
|
123
123
|
|
|
124
124
|
async function run() {
|