@novu/api 2.6.5 → 2.6.6
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 +124 -0
- package/REACT_QUERY.md +354 -0
- package/README.md +1032 -0
- package/docs/sdks/authentication/README.md +247 -0
- package/docs/sdks/credentials/README.md +372 -0
- package/docs/sdks/integrations/README.md +631 -0
- package/docs/sdks/messages/README.md +318 -0
- package/docs/sdks/notifications/README.md +226 -0
- package/docs/sdks/novu/README.md +598 -0
- package/docs/sdks/novumessages/README.md +329 -0
- package/docs/sdks/novunotifications/README.md +235 -0
- package/docs/sdks/novusubscribers/README.md +340 -0
- package/docs/sdks/preferences/README.md +221 -0
- package/docs/sdks/properties/README.md +111 -0
- package/docs/sdks/stats/README.md +226 -0
- package/docs/sdks/subscribers/README.md +763 -0
- package/docs/sdks/topics/README.md +541 -0
- package/docs/sdks/webhooks/README.md +117 -0
- package/docs/sdks/workflows/README.md +1123 -0
- package/funcs/cancel.d.ts.map +1 -1
- package/funcs/cancel.js +1 -0
- package/funcs/cancel.js.map +1 -1
- package/funcs/environmentsGenerateSession.d.ts +10 -0
- package/funcs/environmentsGenerateSession.d.ts.map +1 -0
- package/funcs/environmentsGenerateSession.js +131 -0
- package/funcs/environmentsGenerateSession.js.map +1 -0
- package/funcs/environmentsRetrieve.d.ts +10 -0
- package/funcs/environmentsRetrieve.d.ts.map +1 -0
- package/funcs/environmentsRetrieve.js +131 -0
- package/funcs/environmentsRetrieve.js.map +1 -0
- package/funcs/integrationsCreate.d.ts.map +1 -1
- package/funcs/integrationsCreate.js +1 -0
- package/funcs/integrationsCreate.js.map +1 -1
- package/funcs/integrationsDelete.d.ts.map +1 -1
- package/funcs/integrationsDelete.js +1 -0
- package/funcs/integrationsDelete.js.map +1 -1
- package/funcs/integrationsList.d.ts.map +1 -1
- package/funcs/integrationsList.js +1 -0
- package/funcs/integrationsList.js.map +1 -1
- package/funcs/integrationsListActive.d.ts.map +1 -1
- package/funcs/integrationsListActive.js +1 -0
- package/funcs/integrationsListActive.js.map +1 -1
- package/funcs/integrationsSetAsPrimary.d.ts.map +1 -1
- package/funcs/integrationsSetAsPrimary.js +1 -0
- package/funcs/integrationsSetAsPrimary.js.map +1 -1
- package/funcs/integrationsUpdate.d.ts.map +1 -1
- package/funcs/integrationsUpdate.js +1 -0
- package/funcs/integrationsUpdate.js.map +1 -1
- package/funcs/integrationsWebhooksRetrieve.d.ts.map +1 -1
- package/funcs/integrationsWebhooksRetrieve.js +1 -0
- package/funcs/integrationsWebhooksRetrieve.js.map +1 -1
- package/funcs/messagesDelete.d.ts.map +1 -1
- package/funcs/messagesDelete.js +1 -0
- package/funcs/messagesDelete.js.map +1 -1
- package/funcs/messagesDeleteByTransactionId.d.ts.map +1 -1
- package/funcs/messagesDeleteByTransactionId.js +1 -0
- package/funcs/messagesDeleteByTransactionId.js.map +1 -1
- package/funcs/messagesRetrieve.d.ts.map +1 -1
- package/funcs/messagesRetrieve.js +1 -0
- package/funcs/messagesRetrieve.js.map +1 -1
- package/funcs/notificationsList.d.ts.map +1 -1
- package/funcs/notificationsList.js +2 -0
- package/funcs/notificationsList.js.map +1 -1
- package/funcs/notificationsRetrieve.d.ts.map +1 -1
- package/funcs/notificationsRetrieve.js +1 -0
- package/funcs/notificationsRetrieve.js.map +1 -1
- package/funcs/notificationsStatsGraph.d.ts.map +1 -1
- package/funcs/notificationsStatsGraph.js +1 -0
- package/funcs/notificationsStatsGraph.js.map +1 -1
- package/funcs/notificationsStatsRetrieve.d.ts.map +1 -1
- package/funcs/notificationsStatsRetrieve.js +1 -0
- package/funcs/notificationsStatsRetrieve.js.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauth.d.ts.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauth.js +1 -0
- package/funcs/subscribersAuthenticationChatAccessOauth.js.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.d.ts.map +1 -1
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.js +1 -0
- package/funcs/subscribersAuthenticationChatAccessOauthCallBack.js.map +1 -1
- package/funcs/subscribersCreate.d.ts.map +1 -1
- package/funcs/subscribersCreate.js +2 -1
- package/funcs/subscribersCreate.js.map +1 -1
- package/funcs/subscribersCreateBulk.d.ts.map +1 -1
- package/funcs/subscribersCreateBulk.js +1 -0
- package/funcs/subscribersCreateBulk.js.map +1 -1
- package/funcs/subscribersCredentialsAppend.d.ts.map +1 -1
- package/funcs/subscribersCredentialsAppend.js +1 -0
- package/funcs/subscribersCredentialsAppend.js.map +1 -1
- package/funcs/subscribersCredentialsDelete.d.ts.map +1 -1
- package/funcs/subscribersCredentialsDelete.js +1 -0
- package/funcs/subscribersCredentialsDelete.js.map +1 -1
- package/funcs/subscribersCredentialsUpdate.d.ts.map +1 -1
- package/funcs/subscribersCredentialsUpdate.js +1 -0
- package/funcs/subscribersCredentialsUpdate.js.map +1 -1
- package/funcs/subscribersDelete.d.ts.map +1 -1
- package/funcs/subscribersDelete.js +1 -0
- package/funcs/subscribersDelete.js.map +1 -1
- package/funcs/subscribersList.d.ts.map +1 -1
- package/funcs/subscribersList.js +1 -0
- package/funcs/subscribersList.js.map +1 -1
- package/funcs/subscribersMessagesMarkAll.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAll.js +1 -0
- package/funcs/subscribersMessagesMarkAll.js.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.d.ts.map +1 -1
- package/funcs/subscribersMessagesMarkAllAs.js +1 -0
- package/funcs/subscribersMessagesMarkAllAs.js.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.d.ts.map +1 -1
- package/funcs/subscribersMessagesUpdateAsSeen.js +1 -0
- package/funcs/subscribersMessagesUpdateAsSeen.js.map +1 -1
- package/funcs/subscribersNotificationsFeed.d.ts.map +1 -1
- package/funcs/subscribersNotificationsFeed.js +1 -0
- package/funcs/subscribersNotificationsFeed.js.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.d.ts.map +1 -1
- package/funcs/subscribersNotificationsUnseenCount.js +1 -0
- package/funcs/subscribersNotificationsUnseenCount.js.map +1 -1
- package/funcs/subscribersPatch.d.ts.map +1 -1
- package/funcs/subscribersPatch.js +1 -0
- package/funcs/subscribersPatch.js.map +1 -1
- package/funcs/subscribersPreferencesList.d.ts.map +1 -1
- package/funcs/subscribersPreferencesList.js +1 -0
- package/funcs/subscribersPreferencesList.js.map +1 -1
- package/funcs/subscribersPreferencesUpdate.d.ts.map +1 -1
- package/funcs/subscribersPreferencesUpdate.js +1 -0
- package/funcs/subscribersPreferencesUpdate.js.map +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.d.ts.map +1 -1
- package/funcs/subscribersPropertiesUpdateOnlineFlag.js +1 -0
- package/funcs/subscribersPropertiesUpdateOnlineFlag.js.map +1 -1
- package/funcs/subscribersRetrieve.d.ts.map +1 -1
- package/funcs/subscribersRetrieve.js +1 -0
- package/funcs/subscribersRetrieve.js.map +1 -1
- package/funcs/subscribersSearch.d.ts.map +1 -1
- package/funcs/subscribersSearch.js +1 -0
- package/funcs/subscribersSearch.js.map +1 -1
- package/funcs/topicsCreate.d.ts.map +1 -1
- package/funcs/topicsCreate.js +1 -0
- package/funcs/topicsCreate.js.map +1 -1
- package/funcs/topicsDelete.d.ts.map +1 -1
- package/funcs/topicsDelete.js +1 -0
- package/funcs/topicsDelete.js.map +1 -1
- package/funcs/topicsList.d.ts.map +1 -1
- package/funcs/topicsList.js +1 -0
- package/funcs/topicsList.js.map +1 -1
- package/funcs/topicsRename.d.ts.map +1 -1
- package/funcs/topicsRename.js +1 -0
- package/funcs/topicsRename.js.map +1 -1
- package/funcs/topicsRetrieve.d.ts.map +1 -1
- package/funcs/topicsRetrieve.js +1 -0
- package/funcs/topicsRetrieve.js.map +1 -1
- package/funcs/topicsSubscribersAssign.d.ts.map +1 -1
- package/funcs/topicsSubscribersAssign.js +1 -0
- package/funcs/topicsSubscribersAssign.js.map +1 -1
- package/funcs/topicsSubscribersRemove.d.ts.map +1 -1
- package/funcs/topicsSubscribersRemove.js +1 -0
- package/funcs/topicsSubscribersRemove.js.map +1 -1
- package/funcs/topicsSubscribersRetrieve.d.ts.map +1 -1
- package/funcs/topicsSubscribersRetrieve.js +1 -0
- package/funcs/topicsSubscribersRetrieve.js.map +1 -1
- package/funcs/trigger.d.ts.map +1 -1
- package/funcs/trigger.js +1 -0
- package/funcs/trigger.js.map +1 -1
- package/funcs/triggerBroadcast.d.ts.map +1 -1
- package/funcs/triggerBroadcast.js +1 -0
- package/funcs/triggerBroadcast.js.map +1 -1
- package/funcs/triggerBulk.d.ts.map +1 -1
- package/funcs/triggerBulk.js +1 -0
- package/funcs/triggerBulk.js.map +1 -1
- package/funcs/workflowsCreate.d.ts.map +1 -1
- package/funcs/workflowsCreate.js +1 -0
- package/funcs/workflowsCreate.js.map +1 -1
- package/funcs/workflowsDelete.d.ts.map +1 -1
- package/funcs/workflowsDelete.js +1 -0
- package/funcs/workflowsDelete.js.map +1 -1
- package/funcs/workflowsGetStepData.d.ts.map +1 -1
- package/funcs/workflowsGetStepData.js +1 -0
- package/funcs/workflowsGetStepData.js.map +1 -1
- package/funcs/workflowsGetWorkflowTestData.d.ts.map +1 -1
- package/funcs/workflowsGetWorkflowTestData.js +1 -0
- package/funcs/workflowsGetWorkflowTestData.js.map +1 -1
- package/funcs/workflowsRetrieve.d.ts.map +1 -1
- package/funcs/workflowsRetrieve.js +1 -0
- package/funcs/workflowsRetrieve.js.map +1 -1
- package/funcs/workflowsUpdate.d.ts.map +1 -1
- package/funcs/workflowsUpdate.js +1 -0
- package/funcs/workflowsUpdate.js.map +1 -1
- package/funcs/workflowsWorkflowControllerGeneratePreview.d.ts.map +1 -1
- package/funcs/workflowsWorkflowControllerGeneratePreview.js +1 -0
- package/funcs/workflowsWorkflowControllerGeneratePreview.js.map +1 -1
- package/funcs/workflowsWorkflowControllerPatchWorkflow.d.ts.map +1 -1
- package/funcs/workflowsWorkflowControllerPatchWorkflow.js +1 -0
- package/funcs/workflowsWorkflowControllerPatchWorkflow.js.map +1 -1
- package/funcs/workflowsWorkflowControllerPatchWorkflowStepData.d.ts.map +1 -1
- package/funcs/workflowsWorkflowControllerPatchWorkflowStepData.js +1 -0
- package/funcs/workflowsWorkflowControllerPatchWorkflowStepData.js.map +1 -1
- package/funcs/workflowsWorkflowControllerSearchWorkflows.d.ts.map +1 -1
- package/funcs/workflowsWorkflowControllerSearchWorkflows.js +1 -0
- package/funcs/workflowsWorkflowControllerSearchWorkflows.js.map +1 -1
- package/funcs/workflowsWorkflowControllerSync.d.ts.map +1 -1
- package/funcs/workflowsWorkflowControllerSync.js +1 -0
- package/funcs/workflowsWorkflowControllerSync.js.map +1 -1
- package/hooks/types.d.ts +1 -0
- package/hooks/types.d.ts.map +1 -1
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/lib/security.d.ts.map +1 -1
- package/lib/security.js.map +1 -1
- package/models/components/activitynotificationtemplateresponsedto.d.ts +6 -0
- package/models/components/activitynotificationtemplateresponsedto.d.ts.map +1 -1
- package/models/components/activitynotificationtemplateresponsedto.js +3 -0
- package/models/components/activitynotificationtemplateresponsedto.js.map +1 -1
- package/models/components/createsubscriberrequestdto.d.ts +28 -50
- package/models/components/createsubscriberrequestdto.d.ts.map +1 -1
- package/models/components/createsubscriberrequestdto.js +17 -41
- package/models/components/createsubscriberrequestdto.js.map +1 -1
- package/models/components/getenvironmenttagsdto.d.ts +29 -0
- package/models/components/getenvironmenttagsdto.d.ts.map +1 -0
- package/models/components/getenvironmenttagsdto.js +59 -0
- package/models/components/getenvironmenttagsdto.js.map +1 -0
- package/models/components/index.d.ts +1 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +1 -0
- package/models/components/index.js.map +1 -1
- package/models/components/patchsubscriberrequestdto.d.ts +0 -5
- package/models/components/patchsubscriberrequestdto.d.ts.map +1 -1
- package/models/components/patchsubscriberrequestdto.js +0 -2
- package/models/components/patchsubscriberrequestdto.js.map +1 -1
- package/models/components/sessiongeneratedresponsedto.d.ts +32 -0
- package/models/components/sessiongeneratedresponsedto.d.ts.map +1 -0
- package/models/components/sessiongeneratedresponsedto.js +59 -0
- package/models/components/sessiongeneratedresponsedto.js.map +1 -0
- package/models/components/subscriberpayloaddto.d.ts +5 -0
- package/models/components/subscriberpayloaddto.d.ts.map +1 -1
- package/models/components/subscriberpayloaddto.js +2 -0
- package/models/components/subscriberpayloaddto.js.map +1 -1
- package/models/components/triggereventresponsedto.d.ts +3 -0
- package/models/components/triggereventresponsedto.d.ts.map +1 -1
- package/models/components/triggereventresponsedto.js +1 -0
- package/models/components/triggereventresponsedto.js.map +1 -1
- package/models/components/workfloworiginenum.d.ts +37 -0
- package/models/components/workfloworiginenum.d.ts.map +1 -0
- package/models/components/workfloworiginenum.js +54 -0
- package/models/components/workfloworiginenum.js.map +1 -0
- package/models/operations/environmentscontrollergeneratesession.d.ts +66 -0
- package/models/operations/environmentscontrollergeneratesession.d.ts.map +1 -0
- package/models/operations/environmentscontrollergeneratesession.js +110 -0
- package/models/operations/environmentscontrollergeneratesession.js.map +1 -0
- package/models/operations/environmentscontrollergetenvironmenttags.d.ts +66 -0
- package/models/operations/environmentscontrollergetenvironmenttags.d.ts.map +1 -0
- package/models/operations/environmentscontrollergetenvironmenttags.js +110 -0
- package/models/operations/environmentscontrollergetenvironmenttags.js.map +1 -0
- package/models/operations/notificationscontrollerlistnotifications.d.ts +5 -0
- package/models/operations/notificationscontrollerlistnotifications.d.ts.map +1 -1
- package/models/operations/notificationscontrollerlistnotifications.js +2 -0
- package/models/operations/notificationscontrollerlistnotifications.js.map +1 -1
- package/package.json +1 -1
- package/react-query/environmentsGenerateSession.d.ts +18 -0
- package/react-query/environmentsGenerateSession.d.ts.map +1 -0
- package/react-query/environmentsGenerateSession.js +41 -0
- package/react-query/environmentsGenerateSession.js.map +1 -0
- package/react-query/environmentsRetrieve.d.ts +30 -0
- package/react-query/environmentsRetrieve.d.ts.map +1 -0
- package/react-query/environmentsRetrieve.js +70 -0
- package/react-query/environmentsRetrieve.js.map +1 -0
- package/react-query/notificationsList.d.ts +3 -0
- package/react-query/notificationsList.d.ts.map +1 -1
- package/react-query/notificationsList.js +1 -0
- package/react-query/notificationsList.js.map +1 -1
- package/sdk/environments.d.ts +13 -0
- package/sdk/environments.d.ts.map +1 -0
- package/sdk/environments.js +26 -0
- package/sdk/environments.js.map +1 -0
- package/sources/json-development.json +32352 -0
- package/src/funcs/cancel.ts +1 -0
- package/src/funcs/integrationsCreate.ts +1 -0
- package/src/funcs/integrationsDelete.ts +1 -0
- package/src/funcs/integrationsList.ts +1 -0
- package/src/funcs/integrationsListActive.ts +1 -0
- package/src/funcs/integrationsSetAsPrimary.ts +1 -0
- package/src/funcs/integrationsUpdate.ts +1 -0
- package/src/funcs/integrationsWebhooksRetrieve.ts +1 -0
- package/src/funcs/messagesDelete.ts +1 -0
- package/src/funcs/messagesDeleteByTransactionId.ts +1 -0
- package/src/funcs/messagesRetrieve.ts +1 -0
- package/src/funcs/notificationsList.ts +2 -0
- package/src/funcs/notificationsRetrieve.ts +1 -0
- package/src/funcs/notificationsStatsGraph.ts +1 -0
- package/src/funcs/notificationsStatsRetrieve.ts +1 -0
- package/src/funcs/subscribersAuthenticationChatAccessOauth.ts +1 -0
- package/src/funcs/subscribersAuthenticationChatAccessOauthCallBack.ts +1 -0
- package/src/funcs/subscribersCreate.ts +2 -1
- package/src/funcs/subscribersCreateBulk.ts +1 -0
- package/src/funcs/subscribersCredentialsAppend.ts +1 -0
- package/src/funcs/subscribersCredentialsDelete.ts +1 -0
- package/src/funcs/subscribersCredentialsUpdate.ts +1 -0
- package/src/funcs/subscribersDelete.ts +1 -0
- package/src/funcs/subscribersList.ts +1 -0
- package/src/funcs/subscribersMessagesMarkAll.ts +1 -0
- package/src/funcs/subscribersMessagesMarkAllAs.ts +1 -0
- package/src/funcs/subscribersMessagesUpdateAsSeen.ts +1 -0
- package/src/funcs/subscribersNotificationsFeed.ts +1 -0
- package/src/funcs/subscribersNotificationsUnseenCount.ts +1 -0
- package/src/funcs/subscribersPatch.ts +1 -0
- package/src/funcs/subscribersPreferencesList.ts +1 -0
- package/src/funcs/subscribersPreferencesUpdate.ts +1 -0
- package/src/funcs/subscribersPropertiesUpdateOnlineFlag.ts +1 -0
- package/src/funcs/subscribersRetrieve.ts +1 -0
- package/src/funcs/subscribersSearch.ts +1 -0
- package/src/funcs/topicsCreate.ts +1 -0
- package/src/funcs/topicsDelete.ts +1 -0
- package/src/funcs/topicsList.ts +1 -0
- package/src/funcs/topicsRename.ts +1 -0
- package/src/funcs/topicsRetrieve.ts +1 -0
- package/src/funcs/topicsSubscribersAssign.ts +1 -0
- package/src/funcs/topicsSubscribersRemove.ts +1 -0
- package/src/funcs/topicsSubscribersRetrieve.ts +1 -0
- package/src/funcs/trigger.ts +1 -0
- package/src/funcs/triggerBroadcast.ts +1 -0
- package/src/funcs/triggerBulk.ts +1 -0
- package/src/funcs/workflowsCreate.ts +1 -0
- package/src/funcs/workflowsDelete.ts +1 -0
- package/src/funcs/workflowsGetStepData.ts +1 -0
- package/src/funcs/workflowsGetWorkflowTestData.ts +1 -0
- package/src/funcs/workflowsRetrieve.ts +1 -0
- package/src/funcs/workflowsUpdate.ts +1 -0
- package/src/funcs/workflowsWorkflowControllerGeneratePreview.ts +1 -0
- package/src/funcs/workflowsWorkflowControllerPatchWorkflow.ts +1 -0
- package/src/funcs/workflowsWorkflowControllerPatchWorkflowStepData.ts +1 -0
- package/src/funcs/workflowsWorkflowControllerSearchWorkflows.ts +1 -0
- package/src/funcs/workflowsWorkflowControllerSync.ts +1 -0
- package/src/hooks/types.ts +1 -0
- package/src/lib/config.ts +2 -2
- package/src/lib/security.ts +0 -1
- package/src/models/components/activitynotificationtemplateresponsedto.ts +12 -0
- package/src/models/components/createsubscriberrequestdto.ts +41 -111
- package/src/models/components/index.ts +1 -0
- package/src/models/components/patchsubscriberrequestdto.ts +0 -7
- package/src/models/components/subscriberpayloaddto.ts +7 -0
- package/src/models/components/triggereventresponsedto.ts +1 -0
- package/src/models/components/workfloworiginenum.ts +40 -0
- package/src/models/operations/notificationscontrollerlistnotifications.ts +7 -0
- package/src/react-query/notificationsList.ts +4 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
# NovuSubscribers
|
|
2
|
+
(*topics.subscribers*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [assign](#assign) - Subscribers addition
|
|
9
|
+
* [retrieve](#retrieve) - Check topic subscriber
|
|
10
|
+
* [remove](#remove) - Subscribers removal
|
|
11
|
+
|
|
12
|
+
## assign
|
|
13
|
+
|
|
14
|
+
Add subscribers to a topic by key
|
|
15
|
+
|
|
16
|
+
### Example Usage
|
|
17
|
+
|
|
18
|
+
```typescript
|
|
19
|
+
import { Novu } from "@novu/api";
|
|
20
|
+
|
|
21
|
+
const novu = new Novu({
|
|
22
|
+
security: {
|
|
23
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
async function run() {
|
|
28
|
+
const result = await novu.topics.subscribers.assign({
|
|
29
|
+
subscribers: [
|
|
30
|
+
"<value>",
|
|
31
|
+
"<value>",
|
|
32
|
+
"<value>",
|
|
33
|
+
],
|
|
34
|
+
}, "<value>");
|
|
35
|
+
|
|
36
|
+
// Handle the result
|
|
37
|
+
console.log(result);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
run();
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Standalone function
|
|
44
|
+
|
|
45
|
+
The standalone function version of this method:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
49
|
+
import { topicsSubscribersAssign } from "@novu/api/funcs/topicsSubscribersAssign.js";
|
|
50
|
+
|
|
51
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
52
|
+
// You can create one instance of it to use across an application.
|
|
53
|
+
const novu = new NovuCore({
|
|
54
|
+
security: {
|
|
55
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
async function run() {
|
|
60
|
+
const res = await topicsSubscribersAssign(novu, {
|
|
61
|
+
subscribers: [
|
|
62
|
+
"<value>",
|
|
63
|
+
"<value>",
|
|
64
|
+
"<value>",
|
|
65
|
+
],
|
|
66
|
+
}, "<value>");
|
|
67
|
+
|
|
68
|
+
if (!res.ok) {
|
|
69
|
+
throw res.error;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const { value: result } = res;
|
|
73
|
+
|
|
74
|
+
// Handle the result
|
|
75
|
+
console.log(result);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
run();
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### React hooks and utilities
|
|
82
|
+
|
|
83
|
+
This method can be used in React components through the following hooks and
|
|
84
|
+
associated utilities.
|
|
85
|
+
|
|
86
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
87
|
+
> below and how to get started using React hooks.
|
|
88
|
+
|
|
89
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
90
|
+
|
|
91
|
+
```tsx
|
|
92
|
+
import {
|
|
93
|
+
// Mutation hook for triggering the API call.
|
|
94
|
+
useTopicsSubscribersAssignMutation
|
|
95
|
+
} from "@novu/api/react-query/topicsSubscribersAssign.js";
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Parameters
|
|
99
|
+
|
|
100
|
+
| Parameter | Type | Required | Description |
|
|
101
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
102
|
+
| `topicKey` | *string* | :heavy_check_mark: | The topic key |
|
|
103
|
+
| `addSubscribersRequestDto` | [components.AddSubscribersRequestDto](../../models/components/addsubscribersrequestdto.md) | :heavy_check_mark: | N/A |
|
|
104
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
105
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
106
|
+
| `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. |
|
|
107
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
108
|
+
|
|
109
|
+
### Response
|
|
110
|
+
|
|
111
|
+
**Promise\<[operations.TopicsControllerAssignResponse](../../models/operations/topicscontrollerassignresponse.md)\>**
|
|
112
|
+
|
|
113
|
+
### Errors
|
|
114
|
+
|
|
115
|
+
| Error Type | Status Code | Content Type |
|
|
116
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
117
|
+
| errors.ErrorDto | 414 | application/json |
|
|
118
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
119
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
120
|
+
| errors.ErrorDto | 500 | application/json |
|
|
121
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
122
|
+
|
|
123
|
+
## retrieve
|
|
124
|
+
|
|
125
|
+
Check if a subscriber belongs to a certain topic
|
|
126
|
+
|
|
127
|
+
### Example Usage
|
|
128
|
+
|
|
129
|
+
```typescript
|
|
130
|
+
import { Novu } from "@novu/api";
|
|
131
|
+
|
|
132
|
+
const novu = new Novu({
|
|
133
|
+
security: {
|
|
134
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
135
|
+
},
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
async function run() {
|
|
139
|
+
const result = await novu.topics.subscribers.retrieve("<value>", "<id>");
|
|
140
|
+
|
|
141
|
+
// Handle the result
|
|
142
|
+
console.log(result);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
run();
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
### Standalone function
|
|
149
|
+
|
|
150
|
+
The standalone function version of this method:
|
|
151
|
+
|
|
152
|
+
```typescript
|
|
153
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
154
|
+
import { topicsSubscribersRetrieve } from "@novu/api/funcs/topicsSubscribersRetrieve.js";
|
|
155
|
+
|
|
156
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
157
|
+
// You can create one instance of it to use across an application.
|
|
158
|
+
const novu = new NovuCore({
|
|
159
|
+
security: {
|
|
160
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
161
|
+
},
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
async function run() {
|
|
165
|
+
const res = await topicsSubscribersRetrieve(novu, "<value>", "<id>");
|
|
166
|
+
|
|
167
|
+
if (!res.ok) {
|
|
168
|
+
throw res.error;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
const { value: result } = res;
|
|
172
|
+
|
|
173
|
+
// Handle the result
|
|
174
|
+
console.log(result);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
run();
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### React hooks and utilities
|
|
181
|
+
|
|
182
|
+
This method can be used in React components through the following hooks and
|
|
183
|
+
associated utilities.
|
|
184
|
+
|
|
185
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
186
|
+
> below and how to get started using React hooks.
|
|
187
|
+
|
|
188
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
189
|
+
|
|
190
|
+
```tsx
|
|
191
|
+
import {
|
|
192
|
+
// Query hooks for fetching data.
|
|
193
|
+
useTopicsSubscribersRetrieve,
|
|
194
|
+
useTopicsSubscribersRetrieveSuspense,
|
|
195
|
+
|
|
196
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
197
|
+
// Server Components that will be immediately available to client components
|
|
198
|
+
// using the hooks.
|
|
199
|
+
prefetchTopicsSubscribersRetrieve,
|
|
200
|
+
|
|
201
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
202
|
+
// mutations and other user actions.
|
|
203
|
+
invalidateTopicsSubscribersRetrieve,
|
|
204
|
+
invalidateAllTopicsSubscribersRetrieve,
|
|
205
|
+
} from "@novu/api/react-query/topicsSubscribersRetrieve.js";
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Parameters
|
|
209
|
+
|
|
210
|
+
| Parameter | Type | Required | Description |
|
|
211
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
212
|
+
| `topicKey` | *string* | :heavy_check_mark: | The topic key |
|
|
213
|
+
| `externalSubscriberId` | *string* | :heavy_check_mark: | The external subscriber id |
|
|
214
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
215
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
216
|
+
| `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. |
|
|
217
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
218
|
+
|
|
219
|
+
### Response
|
|
220
|
+
|
|
221
|
+
**Promise\<[operations.TopicsControllerGetTopicSubscriberResponse](../../models/operations/topicscontrollergettopicsubscriberresponse.md)\>**
|
|
222
|
+
|
|
223
|
+
### Errors
|
|
224
|
+
|
|
225
|
+
| Error Type | Status Code | Content Type |
|
|
226
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
227
|
+
| errors.ErrorDto | 414 | application/json |
|
|
228
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
229
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
230
|
+
| errors.ErrorDto | 500 | application/json |
|
|
231
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
232
|
+
|
|
233
|
+
## remove
|
|
234
|
+
|
|
235
|
+
Remove subscribers from a topic
|
|
236
|
+
|
|
237
|
+
### Example Usage
|
|
238
|
+
|
|
239
|
+
```typescript
|
|
240
|
+
import { Novu } from "@novu/api";
|
|
241
|
+
|
|
242
|
+
const novu = new Novu({
|
|
243
|
+
security: {
|
|
244
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
245
|
+
},
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
async function run() {
|
|
249
|
+
const result = await novu.topics.subscribers.remove({
|
|
250
|
+
subscribers: [
|
|
251
|
+
"<value>",
|
|
252
|
+
"<value>",
|
|
253
|
+
],
|
|
254
|
+
}, "<value>");
|
|
255
|
+
|
|
256
|
+
// Handle the result
|
|
257
|
+
console.log(result);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
run();
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
### Standalone function
|
|
264
|
+
|
|
265
|
+
The standalone function version of this method:
|
|
266
|
+
|
|
267
|
+
```typescript
|
|
268
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
269
|
+
import { topicsSubscribersRemove } from "@novu/api/funcs/topicsSubscribersRemove.js";
|
|
270
|
+
|
|
271
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
272
|
+
// You can create one instance of it to use across an application.
|
|
273
|
+
const novu = new NovuCore({
|
|
274
|
+
security: {
|
|
275
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
|
|
279
|
+
async function run() {
|
|
280
|
+
const res = await topicsSubscribersRemove(novu, {
|
|
281
|
+
subscribers: [
|
|
282
|
+
"<value>",
|
|
283
|
+
"<value>",
|
|
284
|
+
],
|
|
285
|
+
}, "<value>");
|
|
286
|
+
|
|
287
|
+
if (!res.ok) {
|
|
288
|
+
throw res.error;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
const { value: result } = res;
|
|
292
|
+
|
|
293
|
+
// Handle the result
|
|
294
|
+
console.log(result);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
run();
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### React hooks and utilities
|
|
301
|
+
|
|
302
|
+
This method can be used in React components through the following hooks and
|
|
303
|
+
associated utilities.
|
|
304
|
+
|
|
305
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
306
|
+
> below and how to get started using React hooks.
|
|
307
|
+
|
|
308
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
309
|
+
|
|
310
|
+
```tsx
|
|
311
|
+
import {
|
|
312
|
+
// Mutation hook for triggering the API call.
|
|
313
|
+
useTopicsSubscribersRemoveMutation
|
|
314
|
+
} from "@novu/api/react-query/topicsSubscribersRemove.js";
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
### Parameters
|
|
318
|
+
|
|
319
|
+
| Parameter | Type | Required | Description |
|
|
320
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
321
|
+
| `topicKey` | *string* | :heavy_check_mark: | The topic key |
|
|
322
|
+
| `removeSubscribersRequestDto` | [components.RemoveSubscribersRequestDto](../../models/components/removesubscribersrequestdto.md) | :heavy_check_mark: | N/A |
|
|
323
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
324
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
325
|
+
| `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. |
|
|
326
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
327
|
+
|
|
328
|
+
### Response
|
|
329
|
+
|
|
330
|
+
**Promise\<[operations.TopicsControllerRemoveSubscribersResponse](../../models/operations/topicscontrollerremovesubscribersresponse.md)\>**
|
|
331
|
+
|
|
332
|
+
### Errors
|
|
333
|
+
|
|
334
|
+
| Error Type | Status Code | Content Type |
|
|
335
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
336
|
+
| errors.ErrorDto | 414 | application/json |
|
|
337
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
338
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
339
|
+
| errors.ErrorDto | 500 | application/json |
|
|
340
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
# Preferences
|
|
2
|
+
(*subscribers.preferences*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [list](#list) - Get subscriber preferences
|
|
9
|
+
* [update](#update) - Update subscriber global or workflow specific preferences
|
|
10
|
+
|
|
11
|
+
## list
|
|
12
|
+
|
|
13
|
+
Get subscriber global and workflow specific preferences
|
|
14
|
+
|
|
15
|
+
### Example Usage
|
|
16
|
+
|
|
17
|
+
```typescript
|
|
18
|
+
import { Novu } from "@novu/api";
|
|
19
|
+
|
|
20
|
+
const novu = new Novu({
|
|
21
|
+
security: {
|
|
22
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
async function run() {
|
|
27
|
+
const result = await novu.subscribers.preferences.list("<id>");
|
|
28
|
+
|
|
29
|
+
// Handle the result
|
|
30
|
+
console.log(result);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
run();
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Standalone function
|
|
37
|
+
|
|
38
|
+
The standalone function version of this method:
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
42
|
+
import { subscribersPreferencesList } from "@novu/api/funcs/subscribersPreferencesList.js";
|
|
43
|
+
|
|
44
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
45
|
+
// You can create one instance of it to use across an application.
|
|
46
|
+
const novu = new NovuCore({
|
|
47
|
+
security: {
|
|
48
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
async function run() {
|
|
53
|
+
const res = await subscribersPreferencesList(novu, "<id>");
|
|
54
|
+
|
|
55
|
+
if (!res.ok) {
|
|
56
|
+
throw res.error;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const { value: result } = res;
|
|
60
|
+
|
|
61
|
+
// Handle the result
|
|
62
|
+
console.log(result);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
run();
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### React hooks and utilities
|
|
69
|
+
|
|
70
|
+
This method can be used in React components through the following hooks and
|
|
71
|
+
associated utilities.
|
|
72
|
+
|
|
73
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
74
|
+
> below and how to get started using React hooks.
|
|
75
|
+
|
|
76
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
77
|
+
|
|
78
|
+
```tsx
|
|
79
|
+
import {
|
|
80
|
+
// Query hooks for fetching data.
|
|
81
|
+
useSubscribersPreferencesList,
|
|
82
|
+
useSubscribersPreferencesListSuspense,
|
|
83
|
+
|
|
84
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
85
|
+
// Server Components that will be immediately available to client components
|
|
86
|
+
// using the hooks.
|
|
87
|
+
prefetchSubscribersPreferencesList,
|
|
88
|
+
|
|
89
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
90
|
+
// mutations and other user actions.
|
|
91
|
+
invalidateSubscribersPreferencesList,
|
|
92
|
+
invalidateAllSubscribersPreferencesList,
|
|
93
|
+
} from "@novu/api/react-query/subscribersPreferencesList.js";
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Parameters
|
|
97
|
+
|
|
98
|
+
| Parameter | Type | Required | Description |
|
|
99
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
100
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
101
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
102
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
103
|
+
| `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. |
|
|
104
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
105
|
+
|
|
106
|
+
### Response
|
|
107
|
+
|
|
108
|
+
**Promise\<[operations.SubscribersControllerGetSubscriberPreferencesResponse](../../models/operations/subscriberscontrollergetsubscriberpreferencesresponse.md)\>**
|
|
109
|
+
|
|
110
|
+
### Errors
|
|
111
|
+
|
|
112
|
+
| Error Type | Status Code | Content Type |
|
|
113
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
114
|
+
| errors.ErrorDto | 414 | application/json |
|
|
115
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
116
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
117
|
+
| errors.ErrorDto | 500 | application/json |
|
|
118
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
119
|
+
|
|
120
|
+
## update
|
|
121
|
+
|
|
122
|
+
Update subscriber global or workflow specific preferences
|
|
123
|
+
|
|
124
|
+
### Example Usage
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { Novu } from "@novu/api";
|
|
128
|
+
|
|
129
|
+
const novu = new Novu({
|
|
130
|
+
security: {
|
|
131
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
async function run() {
|
|
136
|
+
const result = await novu.subscribers.preferences.update({
|
|
137
|
+
channels: {},
|
|
138
|
+
}, "<id>");
|
|
139
|
+
|
|
140
|
+
// Handle the result
|
|
141
|
+
console.log(result);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
run();
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
### Standalone function
|
|
148
|
+
|
|
149
|
+
The standalone function version of this method:
|
|
150
|
+
|
|
151
|
+
```typescript
|
|
152
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
153
|
+
import { subscribersPreferencesUpdate } from "@novu/api/funcs/subscribersPreferencesUpdate.js";
|
|
154
|
+
|
|
155
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
156
|
+
// You can create one instance of it to use across an application.
|
|
157
|
+
const novu = new NovuCore({
|
|
158
|
+
security: {
|
|
159
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
async function run() {
|
|
164
|
+
const res = await subscribersPreferencesUpdate(novu, {
|
|
165
|
+
channels: {},
|
|
166
|
+
}, "<id>");
|
|
167
|
+
|
|
168
|
+
if (!res.ok) {
|
|
169
|
+
throw res.error;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const { value: result } = res;
|
|
173
|
+
|
|
174
|
+
// Handle the result
|
|
175
|
+
console.log(result);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
run();
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
### React hooks and utilities
|
|
182
|
+
|
|
183
|
+
This method can be used in React components through the following hooks and
|
|
184
|
+
associated utilities.
|
|
185
|
+
|
|
186
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
187
|
+
> below and how to get started using React hooks.
|
|
188
|
+
|
|
189
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
190
|
+
|
|
191
|
+
```tsx
|
|
192
|
+
import {
|
|
193
|
+
// Mutation hook for triggering the API call.
|
|
194
|
+
useSubscribersPreferencesUpdateMutation
|
|
195
|
+
} from "@novu/api/react-query/subscribersPreferencesUpdate.js";
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Parameters
|
|
199
|
+
|
|
200
|
+
| Parameter | Type | Required | Description |
|
|
201
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
202
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
203
|
+
| `patchSubscriberPreferencesDto` | [components.PatchSubscriberPreferencesDto](../../models/components/patchsubscriberpreferencesdto.md) | :heavy_check_mark: | N/A |
|
|
204
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
205
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
206
|
+
| `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. |
|
|
207
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
208
|
+
|
|
209
|
+
### Response
|
|
210
|
+
|
|
211
|
+
**Promise\<[operations.SubscribersControllerUpdateSubscriberPreferencesResponse](../../models/operations/subscriberscontrollerupdatesubscriberpreferencesresponse.md)\>**
|
|
212
|
+
|
|
213
|
+
### Errors
|
|
214
|
+
|
|
215
|
+
| Error Type | Status Code | Content Type |
|
|
216
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
217
|
+
| errors.ErrorDto | 414 | application/json |
|
|
218
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
219
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
220
|
+
| errors.ErrorDto | 500 | application/json |
|
|
221
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|