@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,763 @@
|
|
|
1
|
+
# Subscribers
|
|
2
|
+
(*subscribers*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
A subscriber in Novu represents someone who should receive a message. A subscriber’s profile information contains important attributes about the subscriber that will be used in messages (name, email). The subscriber object can contain other key-value pairs that can be used to further personalize your messages.
|
|
7
|
+
<https://docs.novu.co/subscribers/subscribers>
|
|
8
|
+
|
|
9
|
+
### Available Operations
|
|
10
|
+
|
|
11
|
+
* [list](#list) - Get subscribers
|
|
12
|
+
* [createBulk](#createbulk) - Bulk create subscribers
|
|
13
|
+
* [search](#search) - Search for subscribers
|
|
14
|
+
* [create](#create) - Create subscriber
|
|
15
|
+
* [retrieve](#retrieve) - Get subscriber
|
|
16
|
+
* [patch](#patch) - Patch subscriber
|
|
17
|
+
* [delete](#delete) - Delete subscriber
|
|
18
|
+
|
|
19
|
+
## list
|
|
20
|
+
|
|
21
|
+
Returns a list of subscribers, could paginated using the `page` and `limit` query parameter
|
|
22
|
+
|
|
23
|
+
### Example Usage
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { Novu } from "@novu/api";
|
|
27
|
+
|
|
28
|
+
const novu = new Novu({
|
|
29
|
+
security: {
|
|
30
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
async function run() {
|
|
35
|
+
const result = await novu.subscribers.list();
|
|
36
|
+
|
|
37
|
+
for await (const page of result) {
|
|
38
|
+
// Handle the page
|
|
39
|
+
console.log(page);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
run();
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Standalone function
|
|
47
|
+
|
|
48
|
+
The standalone function version of this method:
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
52
|
+
import { subscribersList } from "@novu/api/funcs/subscribersList.js";
|
|
53
|
+
|
|
54
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
55
|
+
// You can create one instance of it to use across an application.
|
|
56
|
+
const novu = new NovuCore({
|
|
57
|
+
security: {
|
|
58
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
async function run() {
|
|
63
|
+
const res = await subscribersList(novu);
|
|
64
|
+
|
|
65
|
+
if (!res.ok) {
|
|
66
|
+
throw res.error;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const { value: result } = res;
|
|
70
|
+
|
|
71
|
+
for await (const page of result) {
|
|
72
|
+
// Handle the page
|
|
73
|
+
console.log(page);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
run();
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### React hooks and utilities
|
|
81
|
+
|
|
82
|
+
This method can be used in React components through the following hooks and
|
|
83
|
+
associated utilities.
|
|
84
|
+
|
|
85
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
86
|
+
> below and how to get started using React hooks.
|
|
87
|
+
|
|
88
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import {
|
|
92
|
+
// Query hooks for fetching data.
|
|
93
|
+
useSubscribersList,
|
|
94
|
+
useSubscribersListSuspense,
|
|
95
|
+
// Query hooks suitable for building infinite scrolling or "load more" UIs.
|
|
96
|
+
useSubscribersListInfinite,
|
|
97
|
+
useSubscribersListInfiniteSuspense,
|
|
98
|
+
|
|
99
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
100
|
+
// Server Components that will be immediately available to client components
|
|
101
|
+
// using the hooks.
|
|
102
|
+
prefetchSubscribersList,
|
|
103
|
+
|
|
104
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
105
|
+
// mutations and other user actions.
|
|
106
|
+
invalidateSubscribersList,
|
|
107
|
+
invalidateAllSubscribersList,
|
|
108
|
+
} from "@novu/api/react-query/subscribersList.js";
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Parameters
|
|
112
|
+
|
|
113
|
+
| Parameter | Type | Required | Description |
|
|
114
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
115
|
+
| `page` | *number* | :heavy_minus_sign: | N/A |
|
|
116
|
+
| `limit` | *number* | :heavy_minus_sign: | N/A |
|
|
117
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
118
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
119
|
+
| `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. |
|
|
120
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
121
|
+
|
|
122
|
+
### Response
|
|
123
|
+
|
|
124
|
+
**Promise\<[operations.SubscribersV1ControllerListSubscribersResponse](../../models/operations/subscribersv1controllerlistsubscribersresponse.md)\>**
|
|
125
|
+
|
|
126
|
+
### Errors
|
|
127
|
+
|
|
128
|
+
| Error Type | Status Code | Content Type |
|
|
129
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
130
|
+
| errors.ErrorDto | 414 | application/json |
|
|
131
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
132
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
133
|
+
| errors.ErrorDto | 500 | application/json |
|
|
134
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
135
|
+
|
|
136
|
+
## createBulk
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
Using this endpoint you can create multiple subscribers at once, to avoid multiple calls to the API.
|
|
140
|
+
The bulk API is limited to 500 subscribers per request.
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
### Example Usage
|
|
144
|
+
|
|
145
|
+
```typescript
|
|
146
|
+
import { Novu } from "@novu/api";
|
|
147
|
+
|
|
148
|
+
const novu = new Novu({
|
|
149
|
+
security: {
|
|
150
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
151
|
+
},
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
async function run() {
|
|
155
|
+
const result = await novu.subscribers.createBulk({
|
|
156
|
+
subscribers: [
|
|
157
|
+
{
|
|
158
|
+
subscriberId: "<id>",
|
|
159
|
+
},
|
|
160
|
+
],
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// Handle the result
|
|
164
|
+
console.log(result);
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
run();
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Standalone function
|
|
171
|
+
|
|
172
|
+
The standalone function version of this method:
|
|
173
|
+
|
|
174
|
+
```typescript
|
|
175
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
176
|
+
import { subscribersCreateBulk } from "@novu/api/funcs/subscribersCreateBulk.js";
|
|
177
|
+
|
|
178
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
179
|
+
// You can create one instance of it to use across an application.
|
|
180
|
+
const novu = new NovuCore({
|
|
181
|
+
security: {
|
|
182
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
183
|
+
},
|
|
184
|
+
});
|
|
185
|
+
|
|
186
|
+
async function run() {
|
|
187
|
+
const res = await subscribersCreateBulk(novu, {
|
|
188
|
+
subscribers: [
|
|
189
|
+
{
|
|
190
|
+
subscriberId: "<id>",
|
|
191
|
+
},
|
|
192
|
+
],
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
if (!res.ok) {
|
|
196
|
+
throw res.error;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
const { value: result } = res;
|
|
200
|
+
|
|
201
|
+
// Handle the result
|
|
202
|
+
console.log(result);
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
run();
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### React hooks and utilities
|
|
209
|
+
|
|
210
|
+
This method can be used in React components through the following hooks and
|
|
211
|
+
associated utilities.
|
|
212
|
+
|
|
213
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
214
|
+
> below and how to get started using React hooks.
|
|
215
|
+
|
|
216
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
217
|
+
|
|
218
|
+
```tsx
|
|
219
|
+
import {
|
|
220
|
+
// Mutation hook for triggering the API call.
|
|
221
|
+
useSubscribersCreateBulkMutation
|
|
222
|
+
} from "@novu/api/react-query/subscribersCreateBulk.js";
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Parameters
|
|
226
|
+
|
|
227
|
+
| Parameter | Type | Required | Description |
|
|
228
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
229
|
+
| `bulkSubscriberCreateDto` | [components.BulkSubscriberCreateDto](../../models/components/bulksubscribercreatedto.md) | :heavy_check_mark: | N/A |
|
|
230
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
231
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
232
|
+
| `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. |
|
|
233
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
234
|
+
|
|
235
|
+
### Response
|
|
236
|
+
|
|
237
|
+
**Promise\<[operations.SubscribersV1ControllerBulkCreateSubscribersResponse](../../models/operations/subscribersv1controllerbulkcreatesubscribersresponse.md)\>**
|
|
238
|
+
|
|
239
|
+
### Errors
|
|
240
|
+
|
|
241
|
+
| Error Type | Status Code | Content Type |
|
|
242
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
243
|
+
| errors.ErrorDto | 414 | application/json |
|
|
244
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
245
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
246
|
+
| errors.ErrorDto | 500 | application/json |
|
|
247
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
248
|
+
|
|
249
|
+
## search
|
|
250
|
+
|
|
251
|
+
Search for subscribers
|
|
252
|
+
|
|
253
|
+
### Example Usage
|
|
254
|
+
|
|
255
|
+
```typescript
|
|
256
|
+
import { Novu } from "@novu/api";
|
|
257
|
+
|
|
258
|
+
const novu = new Novu({
|
|
259
|
+
security: {
|
|
260
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
261
|
+
},
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
async function run() {
|
|
265
|
+
const result = await novu.subscribers.search({});
|
|
266
|
+
|
|
267
|
+
// Handle the result
|
|
268
|
+
console.log(result);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
run();
|
|
272
|
+
```
|
|
273
|
+
|
|
274
|
+
### Standalone function
|
|
275
|
+
|
|
276
|
+
The standalone function version of this method:
|
|
277
|
+
|
|
278
|
+
```typescript
|
|
279
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
280
|
+
import { subscribersSearch } from "@novu/api/funcs/subscribersSearch.js";
|
|
281
|
+
|
|
282
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
283
|
+
// You can create one instance of it to use across an application.
|
|
284
|
+
const novu = new NovuCore({
|
|
285
|
+
security: {
|
|
286
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
|
|
290
|
+
async function run() {
|
|
291
|
+
const res = await subscribersSearch(novu, {});
|
|
292
|
+
|
|
293
|
+
if (!res.ok) {
|
|
294
|
+
throw res.error;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
const { value: result } = res;
|
|
298
|
+
|
|
299
|
+
// Handle the result
|
|
300
|
+
console.log(result);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
run();
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
### React hooks and utilities
|
|
307
|
+
|
|
308
|
+
This method can be used in React components through the following hooks and
|
|
309
|
+
associated utilities.
|
|
310
|
+
|
|
311
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
312
|
+
> below and how to get started using React hooks.
|
|
313
|
+
|
|
314
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
315
|
+
|
|
316
|
+
```tsx
|
|
317
|
+
import {
|
|
318
|
+
// Query hooks for fetching data.
|
|
319
|
+
useSubscribersSearch,
|
|
320
|
+
useSubscribersSearchSuspense,
|
|
321
|
+
|
|
322
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
323
|
+
// Server Components that will be immediately available to client components
|
|
324
|
+
// using the hooks.
|
|
325
|
+
prefetchSubscribersSearch,
|
|
326
|
+
|
|
327
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
328
|
+
// mutations and other user actions.
|
|
329
|
+
invalidateSubscribersSearch,
|
|
330
|
+
invalidateAllSubscribersSearch,
|
|
331
|
+
} from "@novu/api/react-query/subscribersSearch.js";
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
### Parameters
|
|
335
|
+
|
|
336
|
+
| Parameter | Type | Required | Description |
|
|
337
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
338
|
+
| `request` | [operations.SubscribersControllerSearchSubscribersRequest](../../models/operations/subscriberscontrollersearchsubscribersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
339
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
340
|
+
| `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. |
|
|
341
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
342
|
+
|
|
343
|
+
### Response
|
|
344
|
+
|
|
345
|
+
**Promise\<[operations.SubscribersControllerSearchSubscribersResponse](../../models/operations/subscriberscontrollersearchsubscribersresponse.md)\>**
|
|
346
|
+
|
|
347
|
+
### Errors
|
|
348
|
+
|
|
349
|
+
| Error Type | Status Code | Content Type |
|
|
350
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
351
|
+
| errors.ErrorDto | 414 | application/json |
|
|
352
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
353
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
354
|
+
| errors.ErrorDto | 500 | application/json |
|
|
355
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
356
|
+
|
|
357
|
+
## create
|
|
358
|
+
|
|
359
|
+
Create subscriber with the given data
|
|
360
|
+
|
|
361
|
+
### Example Usage
|
|
362
|
+
|
|
363
|
+
```typescript
|
|
364
|
+
import { Novu } from "@novu/api";
|
|
365
|
+
|
|
366
|
+
const novu = new Novu({
|
|
367
|
+
security: {
|
|
368
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
369
|
+
},
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
async function run() {
|
|
373
|
+
const result = await novu.subscribers.create({
|
|
374
|
+
subscriberId: "<id>",
|
|
375
|
+
});
|
|
376
|
+
|
|
377
|
+
// Handle the result
|
|
378
|
+
console.log(result);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
run();
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
### Standalone function
|
|
385
|
+
|
|
386
|
+
The standalone function version of this method:
|
|
387
|
+
|
|
388
|
+
```typescript
|
|
389
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
390
|
+
import { subscribersCreate } from "@novu/api/funcs/subscribersCreate.js";
|
|
391
|
+
|
|
392
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
393
|
+
// You can create one instance of it to use across an application.
|
|
394
|
+
const novu = new NovuCore({
|
|
395
|
+
security: {
|
|
396
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
async function run() {
|
|
401
|
+
const res = await subscribersCreate(novu, {
|
|
402
|
+
subscriberId: "<id>",
|
|
403
|
+
});
|
|
404
|
+
|
|
405
|
+
if (!res.ok) {
|
|
406
|
+
throw res.error;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const { value: result } = res;
|
|
410
|
+
|
|
411
|
+
// Handle the result
|
|
412
|
+
console.log(result);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
run();
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### React hooks and utilities
|
|
419
|
+
|
|
420
|
+
This method can be used in React components through the following hooks and
|
|
421
|
+
associated utilities.
|
|
422
|
+
|
|
423
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
424
|
+
> below and how to get started using React hooks.
|
|
425
|
+
|
|
426
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
427
|
+
|
|
428
|
+
```tsx
|
|
429
|
+
import {
|
|
430
|
+
// Mutation hook for triggering the API call.
|
|
431
|
+
useSubscribersCreateMutation
|
|
432
|
+
} from "@novu/api/react-query/subscribersCreate.js";
|
|
433
|
+
```
|
|
434
|
+
|
|
435
|
+
### Parameters
|
|
436
|
+
|
|
437
|
+
| Parameter | Type | Required | Description |
|
|
438
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
439
|
+
| `createSubscriberRequestDto` | [components.CreateSubscriberRequestDto](../../models/components/createsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
440
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
441
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
442
|
+
| `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. |
|
|
443
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
444
|
+
|
|
445
|
+
### Response
|
|
446
|
+
|
|
447
|
+
**Promise\<[operations.SubscribersControllerCreateSubscriberResponse](../../models/operations/subscriberscontrollercreatesubscriberresponse.md)\>**
|
|
448
|
+
|
|
449
|
+
### Errors
|
|
450
|
+
|
|
451
|
+
| Error Type | Status Code | Content Type |
|
|
452
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
453
|
+
| errors.ErrorDto | 414 | application/json |
|
|
454
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
455
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
456
|
+
| errors.ErrorDto | 500 | application/json |
|
|
457
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
458
|
+
|
|
459
|
+
## retrieve
|
|
460
|
+
|
|
461
|
+
Get subscriber by your internal id used to identify the subscriber
|
|
462
|
+
|
|
463
|
+
### Example Usage
|
|
464
|
+
|
|
465
|
+
```typescript
|
|
466
|
+
import { Novu } from "@novu/api";
|
|
467
|
+
|
|
468
|
+
const novu = new Novu({
|
|
469
|
+
security: {
|
|
470
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
471
|
+
},
|
|
472
|
+
});
|
|
473
|
+
|
|
474
|
+
async function run() {
|
|
475
|
+
const result = await novu.subscribers.retrieve("<id>");
|
|
476
|
+
|
|
477
|
+
// Handle the result
|
|
478
|
+
console.log(result);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
run();
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
### Standalone function
|
|
485
|
+
|
|
486
|
+
The standalone function version of this method:
|
|
487
|
+
|
|
488
|
+
```typescript
|
|
489
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
490
|
+
import { subscribersRetrieve } from "@novu/api/funcs/subscribersRetrieve.js";
|
|
491
|
+
|
|
492
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
493
|
+
// You can create one instance of it to use across an application.
|
|
494
|
+
const novu = new NovuCore({
|
|
495
|
+
security: {
|
|
496
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
497
|
+
},
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
async function run() {
|
|
501
|
+
const res = await subscribersRetrieve(novu, "<id>");
|
|
502
|
+
|
|
503
|
+
if (!res.ok) {
|
|
504
|
+
throw res.error;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
const { value: result } = res;
|
|
508
|
+
|
|
509
|
+
// Handle the result
|
|
510
|
+
console.log(result);
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
run();
|
|
514
|
+
```
|
|
515
|
+
|
|
516
|
+
### React hooks and utilities
|
|
517
|
+
|
|
518
|
+
This method can be used in React components through the following hooks and
|
|
519
|
+
associated utilities.
|
|
520
|
+
|
|
521
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
522
|
+
> below and how to get started using React hooks.
|
|
523
|
+
|
|
524
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
525
|
+
|
|
526
|
+
```tsx
|
|
527
|
+
import {
|
|
528
|
+
// Query hooks for fetching data.
|
|
529
|
+
useSubscribersRetrieve,
|
|
530
|
+
useSubscribersRetrieveSuspense,
|
|
531
|
+
|
|
532
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
533
|
+
// Server Components that will be immediately available to client components
|
|
534
|
+
// using the hooks.
|
|
535
|
+
prefetchSubscribersRetrieve,
|
|
536
|
+
|
|
537
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
538
|
+
// mutations and other user actions.
|
|
539
|
+
invalidateSubscribersRetrieve,
|
|
540
|
+
invalidateAllSubscribersRetrieve,
|
|
541
|
+
} from "@novu/api/react-query/subscribersRetrieve.js";
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
### Parameters
|
|
545
|
+
|
|
546
|
+
| Parameter | Type | Required | Description |
|
|
547
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
548
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
549
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
550
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
551
|
+
| `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. |
|
|
552
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
553
|
+
|
|
554
|
+
### Response
|
|
555
|
+
|
|
556
|
+
**Promise\<[operations.SubscribersControllerGetSubscriberResponse](../../models/operations/subscriberscontrollergetsubscriberresponse.md)\>**
|
|
557
|
+
|
|
558
|
+
### Errors
|
|
559
|
+
|
|
560
|
+
| Error Type | Status Code | Content Type |
|
|
561
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
562
|
+
| errors.ErrorDto | 414 | application/json |
|
|
563
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
564
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
565
|
+
| errors.ErrorDto | 500 | application/json |
|
|
566
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
567
|
+
|
|
568
|
+
## patch
|
|
569
|
+
|
|
570
|
+
Patch subscriber by your internal id used to identify the subscriber
|
|
571
|
+
|
|
572
|
+
### Example Usage
|
|
573
|
+
|
|
574
|
+
```typescript
|
|
575
|
+
import { Novu } from "@novu/api";
|
|
576
|
+
|
|
577
|
+
const novu = new Novu({
|
|
578
|
+
security: {
|
|
579
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
580
|
+
},
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
async function run() {
|
|
584
|
+
const result = await novu.subscribers.patch({}, "<id>");
|
|
585
|
+
|
|
586
|
+
// Handle the result
|
|
587
|
+
console.log(result);
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
run();
|
|
591
|
+
```
|
|
592
|
+
|
|
593
|
+
### Standalone function
|
|
594
|
+
|
|
595
|
+
The standalone function version of this method:
|
|
596
|
+
|
|
597
|
+
```typescript
|
|
598
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
599
|
+
import { subscribersPatch } from "@novu/api/funcs/subscribersPatch.js";
|
|
600
|
+
|
|
601
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
602
|
+
// You can create one instance of it to use across an application.
|
|
603
|
+
const novu = new NovuCore({
|
|
604
|
+
security: {
|
|
605
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
606
|
+
},
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
async function run() {
|
|
610
|
+
const res = await subscribersPatch(novu, {}, "<id>");
|
|
611
|
+
|
|
612
|
+
if (!res.ok) {
|
|
613
|
+
throw res.error;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
const { value: result } = res;
|
|
617
|
+
|
|
618
|
+
// Handle the result
|
|
619
|
+
console.log(result);
|
|
620
|
+
}
|
|
621
|
+
|
|
622
|
+
run();
|
|
623
|
+
```
|
|
624
|
+
|
|
625
|
+
### React hooks and utilities
|
|
626
|
+
|
|
627
|
+
This method can be used in React components through the following hooks and
|
|
628
|
+
associated utilities.
|
|
629
|
+
|
|
630
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
631
|
+
> below and how to get started using React hooks.
|
|
632
|
+
|
|
633
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
634
|
+
|
|
635
|
+
```tsx
|
|
636
|
+
import {
|
|
637
|
+
// Mutation hook for triggering the API call.
|
|
638
|
+
useSubscribersPatchMutation
|
|
639
|
+
} from "@novu/api/react-query/subscribersPatch.js";
|
|
640
|
+
```
|
|
641
|
+
|
|
642
|
+
### Parameters
|
|
643
|
+
|
|
644
|
+
| Parameter | Type | Required | Description |
|
|
645
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
646
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
647
|
+
| `patchSubscriberRequestDto` | [components.PatchSubscriberRequestDto](../../models/components/patchsubscriberrequestdto.md) | :heavy_check_mark: | N/A |
|
|
648
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
649
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
650
|
+
| `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. |
|
|
651
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
652
|
+
|
|
653
|
+
### Response
|
|
654
|
+
|
|
655
|
+
**Promise\<[operations.SubscribersControllerPatchSubscriberResponse](../../models/operations/subscriberscontrollerpatchsubscriberresponse.md)\>**
|
|
656
|
+
|
|
657
|
+
### Errors
|
|
658
|
+
|
|
659
|
+
| Error Type | Status Code | Content Type |
|
|
660
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
661
|
+
| errors.ErrorDto | 414 | application/json |
|
|
662
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
663
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
664
|
+
| errors.ErrorDto | 500 | application/json |
|
|
665
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
666
|
+
|
|
667
|
+
## delete
|
|
668
|
+
|
|
669
|
+
Deletes a subscriber entity from the Novu platform
|
|
670
|
+
|
|
671
|
+
### Example Usage
|
|
672
|
+
|
|
673
|
+
```typescript
|
|
674
|
+
import { Novu } from "@novu/api";
|
|
675
|
+
|
|
676
|
+
const novu = new Novu({
|
|
677
|
+
security: {
|
|
678
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
679
|
+
},
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
async function run() {
|
|
683
|
+
const result = await novu.subscribers.delete("<id>");
|
|
684
|
+
|
|
685
|
+
// Handle the result
|
|
686
|
+
console.log(result);
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
run();
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
### Standalone function
|
|
693
|
+
|
|
694
|
+
The standalone function version of this method:
|
|
695
|
+
|
|
696
|
+
```typescript
|
|
697
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
698
|
+
import { subscribersDelete } from "@novu/api/funcs/subscribersDelete.js";
|
|
699
|
+
|
|
700
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
701
|
+
// You can create one instance of it to use across an application.
|
|
702
|
+
const novu = new NovuCore({
|
|
703
|
+
security: {
|
|
704
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
705
|
+
},
|
|
706
|
+
});
|
|
707
|
+
|
|
708
|
+
async function run() {
|
|
709
|
+
const res = await subscribersDelete(novu, "<id>");
|
|
710
|
+
|
|
711
|
+
if (!res.ok) {
|
|
712
|
+
throw res.error;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
const { value: result } = res;
|
|
716
|
+
|
|
717
|
+
// Handle the result
|
|
718
|
+
console.log(result);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
run();
|
|
722
|
+
```
|
|
723
|
+
|
|
724
|
+
### React hooks and utilities
|
|
725
|
+
|
|
726
|
+
This method can be used in React components through the following hooks and
|
|
727
|
+
associated utilities.
|
|
728
|
+
|
|
729
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
730
|
+
> below and how to get started using React hooks.
|
|
731
|
+
|
|
732
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
733
|
+
|
|
734
|
+
```tsx
|
|
735
|
+
import {
|
|
736
|
+
// Mutation hook for triggering the API call.
|
|
737
|
+
useSubscribersDeleteMutation
|
|
738
|
+
} from "@novu/api/react-query/subscribersDelete.js";
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### Parameters
|
|
742
|
+
|
|
743
|
+
| Parameter | Type | Required | Description |
|
|
744
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
745
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
746
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
747
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
748
|
+
| `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. |
|
|
749
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
750
|
+
|
|
751
|
+
### Response
|
|
752
|
+
|
|
753
|
+
**Promise\<[operations.SubscribersControllerRemoveSubscriberResponse](../../models/operations/subscriberscontrollerremovesubscriberresponse.md)\>**
|
|
754
|
+
|
|
755
|
+
### Errors
|
|
756
|
+
|
|
757
|
+
| Error Type | Status Code | Content Type |
|
|
758
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
759
|
+
| errors.ErrorDto | 414 | application/json |
|
|
760
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
761
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
762
|
+
| errors.ErrorDto | 500 | application/json |
|
|
763
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|