@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,329 @@
|
|
|
1
|
+
# NovuMessages
|
|
2
|
+
(*subscribers.messages*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [markAllAs](#markallas) - Mark a subscriber messages as seen, read, unseen or unread
|
|
9
|
+
* [markAll](#markall) - Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
|
|
10
|
+
* [updateAsSeen](#updateasseen) - Mark message action as seen
|
|
11
|
+
|
|
12
|
+
## markAllAs
|
|
13
|
+
|
|
14
|
+
Mark a subscriber messages as seen, read, unseen or unread
|
|
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.subscribers.messages.markAllAs({
|
|
29
|
+
messageId: "<id>",
|
|
30
|
+
markAs: "unread",
|
|
31
|
+
}, "<id>");
|
|
32
|
+
|
|
33
|
+
// Handle the result
|
|
34
|
+
console.log(result);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
run();
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### Standalone function
|
|
41
|
+
|
|
42
|
+
The standalone function version of this method:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
46
|
+
import { subscribersMessagesMarkAllAs } from "@novu/api/funcs/subscribersMessagesMarkAllAs.js";
|
|
47
|
+
|
|
48
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
49
|
+
// You can create one instance of it to use across an application.
|
|
50
|
+
const novu = new NovuCore({
|
|
51
|
+
security: {
|
|
52
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
async function run() {
|
|
57
|
+
const res = await subscribersMessagesMarkAllAs(novu, {
|
|
58
|
+
messageId: "<id>",
|
|
59
|
+
markAs: "unread",
|
|
60
|
+
}, "<id>");
|
|
61
|
+
|
|
62
|
+
if (!res.ok) {
|
|
63
|
+
throw res.error;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const { value: result } = res;
|
|
67
|
+
|
|
68
|
+
// Handle the result
|
|
69
|
+
console.log(result);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
run();
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### React hooks and utilities
|
|
76
|
+
|
|
77
|
+
This method can be used in React components through the following hooks and
|
|
78
|
+
associated utilities.
|
|
79
|
+
|
|
80
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
81
|
+
> below and how to get started using React hooks.
|
|
82
|
+
|
|
83
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
84
|
+
|
|
85
|
+
```tsx
|
|
86
|
+
import {
|
|
87
|
+
// Mutation hook for triggering the API call.
|
|
88
|
+
useSubscribersMessagesMarkAllAsMutation
|
|
89
|
+
} from "@novu/api/react-query/subscribersMessagesMarkAllAs.js";
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Parameters
|
|
93
|
+
|
|
94
|
+
| Parameter | Type | Required | Description |
|
|
95
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
96
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
97
|
+
| `messageMarkAsRequestDto` | [components.MessageMarkAsRequestDto](../../models/components/messagemarkasrequestdto.md) | :heavy_check_mark: | N/A |
|
|
98
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
99
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
100
|
+
| `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. |
|
|
101
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
102
|
+
|
|
103
|
+
### Response
|
|
104
|
+
|
|
105
|
+
**Promise\<[operations.SubscribersV1ControllerMarkMessagesAsResponse](../../models/operations/subscribersv1controllermarkmessagesasresponse.md)\>**
|
|
106
|
+
|
|
107
|
+
### Errors
|
|
108
|
+
|
|
109
|
+
| Error Type | Status Code | Content Type |
|
|
110
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
111
|
+
| errors.ErrorDto | 414 | application/json |
|
|
112
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
113
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
114
|
+
| errors.ErrorDto | 500 | application/json |
|
|
115
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
116
|
+
|
|
117
|
+
## markAll
|
|
118
|
+
|
|
119
|
+
Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
|
|
120
|
+
|
|
121
|
+
### Example Usage
|
|
122
|
+
|
|
123
|
+
```typescript
|
|
124
|
+
import { Novu } from "@novu/api";
|
|
125
|
+
|
|
126
|
+
const novu = new Novu({
|
|
127
|
+
security: {
|
|
128
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
async function run() {
|
|
133
|
+
const result = await novu.subscribers.messages.markAll({
|
|
134
|
+
markAs: "seen",
|
|
135
|
+
}, "<id>");
|
|
136
|
+
|
|
137
|
+
// Handle the result
|
|
138
|
+
console.log(result);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
run();
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Standalone function
|
|
145
|
+
|
|
146
|
+
The standalone function version of this method:
|
|
147
|
+
|
|
148
|
+
```typescript
|
|
149
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
150
|
+
import { subscribersMessagesMarkAll } from "@novu/api/funcs/subscribersMessagesMarkAll.js";
|
|
151
|
+
|
|
152
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
153
|
+
// You can create one instance of it to use across an application.
|
|
154
|
+
const novu = new NovuCore({
|
|
155
|
+
security: {
|
|
156
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
async function run() {
|
|
161
|
+
const res = await subscribersMessagesMarkAll(novu, {
|
|
162
|
+
markAs: "seen",
|
|
163
|
+
}, "<id>");
|
|
164
|
+
|
|
165
|
+
if (!res.ok) {
|
|
166
|
+
throw res.error;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
const { value: result } = res;
|
|
170
|
+
|
|
171
|
+
// Handle the result
|
|
172
|
+
console.log(result);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
run();
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### React hooks and utilities
|
|
179
|
+
|
|
180
|
+
This method can be used in React components through the following hooks and
|
|
181
|
+
associated utilities.
|
|
182
|
+
|
|
183
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
184
|
+
> below and how to get started using React hooks.
|
|
185
|
+
|
|
186
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
import {
|
|
190
|
+
// Mutation hook for triggering the API call.
|
|
191
|
+
useSubscribersMessagesMarkAllMutation
|
|
192
|
+
} from "@novu/api/react-query/subscribersMessagesMarkAll.js";
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
### Parameters
|
|
196
|
+
|
|
197
|
+
| Parameter | Type | Required | Description |
|
|
198
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
199
|
+
| `subscriberId` | *string* | :heavy_check_mark: | N/A |
|
|
200
|
+
| `markAllMessageAsRequestDto` | [components.MarkAllMessageAsRequestDto](../../models/components/markallmessageasrequestdto.md) | :heavy_check_mark: | N/A |
|
|
201
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
202
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
203
|
+
| `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. |
|
|
204
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
205
|
+
|
|
206
|
+
### Response
|
|
207
|
+
|
|
208
|
+
**Promise\<[operations.SubscribersV1ControllerMarkAllUnreadAsReadResponse](../../models/operations/subscribersv1controllermarkallunreadasreadresponse.md)\>**
|
|
209
|
+
|
|
210
|
+
### Errors
|
|
211
|
+
|
|
212
|
+
| Error Type | Status Code | Content Type |
|
|
213
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
214
|
+
| errors.ErrorDto | 414 | application/json |
|
|
215
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
216
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
217
|
+
| errors.ErrorDto | 500 | application/json |
|
|
218
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
219
|
+
|
|
220
|
+
## updateAsSeen
|
|
221
|
+
|
|
222
|
+
Mark message action as seen
|
|
223
|
+
|
|
224
|
+
### Example Usage
|
|
225
|
+
|
|
226
|
+
```typescript
|
|
227
|
+
import { Novu } from "@novu/api";
|
|
228
|
+
|
|
229
|
+
const novu = new Novu({
|
|
230
|
+
security: {
|
|
231
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
async function run() {
|
|
236
|
+
const result = await novu.subscribers.messages.updateAsSeen({
|
|
237
|
+
messageId: "<id>",
|
|
238
|
+
type: "<value>",
|
|
239
|
+
subscriberId: "<id>",
|
|
240
|
+
markMessageActionAsSeenDto: {
|
|
241
|
+
status: "done",
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// Handle the result
|
|
246
|
+
console.log(result);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
run();
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
### Standalone function
|
|
253
|
+
|
|
254
|
+
The standalone function version of this method:
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
258
|
+
import { subscribersMessagesUpdateAsSeen } from "@novu/api/funcs/subscribersMessagesUpdateAsSeen.js";
|
|
259
|
+
|
|
260
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
261
|
+
// You can create one instance of it to use across an application.
|
|
262
|
+
const novu = new NovuCore({
|
|
263
|
+
security: {
|
|
264
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
265
|
+
},
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
async function run() {
|
|
269
|
+
const res = await subscribersMessagesUpdateAsSeen(novu, {
|
|
270
|
+
messageId: "<id>",
|
|
271
|
+
type: "<value>",
|
|
272
|
+
subscriberId: "<id>",
|
|
273
|
+
markMessageActionAsSeenDto: {
|
|
274
|
+
status: "done",
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
if (!res.ok) {
|
|
279
|
+
throw res.error;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
const { value: result } = res;
|
|
283
|
+
|
|
284
|
+
// Handle the result
|
|
285
|
+
console.log(result);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
run();
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
### React hooks and utilities
|
|
292
|
+
|
|
293
|
+
This method can be used in React components through the following hooks and
|
|
294
|
+
associated utilities.
|
|
295
|
+
|
|
296
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
297
|
+
> below and how to get started using React hooks.
|
|
298
|
+
|
|
299
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
300
|
+
|
|
301
|
+
```tsx
|
|
302
|
+
import {
|
|
303
|
+
// Mutation hook for triggering the API call.
|
|
304
|
+
useSubscribersMessagesUpdateAsSeenMutation
|
|
305
|
+
} from "@novu/api/react-query/subscribersMessagesUpdateAsSeen.js";
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
### Parameters
|
|
309
|
+
|
|
310
|
+
| Parameter | Type | Required | Description |
|
|
311
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
312
|
+
| `request` | [operations.SubscribersV1ControllerMarkActionAsSeenRequest](../../models/operations/subscribersv1controllermarkactionasseenrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
313
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
314
|
+
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
315
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
316
|
+
|
|
317
|
+
### Response
|
|
318
|
+
|
|
319
|
+
**Promise\<[operations.SubscribersV1ControllerMarkActionAsSeenResponse](../../models/operations/subscribersv1controllermarkactionasseenresponse.md)\>**
|
|
320
|
+
|
|
321
|
+
### Errors
|
|
322
|
+
|
|
323
|
+
| Error Type | Status Code | Content Type |
|
|
324
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
325
|
+
| errors.ErrorDto | 414 | application/json |
|
|
326
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
327
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
328
|
+
| errors.ErrorDto | 500 | application/json |
|
|
329
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
# NovuNotifications
|
|
2
|
+
(*subscribers.notifications*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
### Available Operations
|
|
7
|
+
|
|
8
|
+
* [feed](#feed) - Get in-app notification feed for a particular subscriber
|
|
9
|
+
* [unseenCount](#unseencount) - Get the unseen in-app notifications count for subscribers feed
|
|
10
|
+
|
|
11
|
+
## feed
|
|
12
|
+
|
|
13
|
+
Get in-app notification feed for a particular subscriber
|
|
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.notifications.feed({
|
|
28
|
+
subscriberId: "<id>",
|
|
29
|
+
payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=",
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Handle the result
|
|
33
|
+
console.log(result);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
run();
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Standalone function
|
|
40
|
+
|
|
41
|
+
The standalone function version of this method:
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
45
|
+
import { subscribersNotificationsFeed } from "@novu/api/funcs/subscribersNotificationsFeed.js";
|
|
46
|
+
|
|
47
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
48
|
+
// You can create one instance of it to use across an application.
|
|
49
|
+
const novu = new NovuCore({
|
|
50
|
+
security: {
|
|
51
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
async function run() {
|
|
56
|
+
const res = await subscribersNotificationsFeed(novu, {
|
|
57
|
+
subscriberId: "<id>",
|
|
58
|
+
payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=",
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
if (!res.ok) {
|
|
62
|
+
throw res.error;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const { value: result } = res;
|
|
66
|
+
|
|
67
|
+
// Handle the result
|
|
68
|
+
console.log(result);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
run();
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
### React hooks and utilities
|
|
75
|
+
|
|
76
|
+
This method can be used in React components through the following hooks and
|
|
77
|
+
associated utilities.
|
|
78
|
+
|
|
79
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
80
|
+
> below and how to get started using React hooks.
|
|
81
|
+
|
|
82
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
83
|
+
|
|
84
|
+
```tsx
|
|
85
|
+
import {
|
|
86
|
+
// Query hooks for fetching data.
|
|
87
|
+
useSubscribersNotificationsFeed,
|
|
88
|
+
useSubscribersNotificationsFeedSuspense,
|
|
89
|
+
|
|
90
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
91
|
+
// Server Components that will be immediately available to client components
|
|
92
|
+
// using the hooks.
|
|
93
|
+
prefetchSubscribersNotificationsFeed,
|
|
94
|
+
|
|
95
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
96
|
+
// mutations and other user actions.
|
|
97
|
+
invalidateSubscribersNotificationsFeed,
|
|
98
|
+
invalidateAllSubscribersNotificationsFeed,
|
|
99
|
+
} from "@novu/api/react-query/subscribersNotificationsFeed.js";
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Parameters
|
|
103
|
+
|
|
104
|
+
| Parameter | Type | Required | Description |
|
|
105
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
106
|
+
| `request` | [operations.SubscribersV1ControllerGetNotificationsFeedRequest](../../models/operations/subscribersv1controllergetnotificationsfeedrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
107
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
108
|
+
| `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. |
|
|
109
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
110
|
+
|
|
111
|
+
### Response
|
|
112
|
+
|
|
113
|
+
**Promise\<[operations.SubscribersV1ControllerGetNotificationsFeedResponse](../../models/operations/subscribersv1controllergetnotificationsfeedresponse.md)\>**
|
|
114
|
+
|
|
115
|
+
### Errors
|
|
116
|
+
|
|
117
|
+
| Error Type | Status Code | Content Type |
|
|
118
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
119
|
+
| errors.ErrorDto | 414 | application/json |
|
|
120
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
121
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
122
|
+
| errors.ErrorDto | 500 | application/json |
|
|
123
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
124
|
+
|
|
125
|
+
## unseenCount
|
|
126
|
+
|
|
127
|
+
Get the unseen in-app notifications count for subscribers feed
|
|
128
|
+
|
|
129
|
+
### Example Usage
|
|
130
|
+
|
|
131
|
+
```typescript
|
|
132
|
+
import { Novu } from "@novu/api";
|
|
133
|
+
|
|
134
|
+
const novu = new Novu({
|
|
135
|
+
security: {
|
|
136
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
async function run() {
|
|
141
|
+
const result = await novu.subscribers.notifications.unseenCount({
|
|
142
|
+
subscriberId: "<id>",
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// Handle the result
|
|
146
|
+
console.log(result);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
run();
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Standalone function
|
|
153
|
+
|
|
154
|
+
The standalone function version of this method:
|
|
155
|
+
|
|
156
|
+
```typescript
|
|
157
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
158
|
+
import { subscribersNotificationsUnseenCount } from "@novu/api/funcs/subscribersNotificationsUnseenCount.js";
|
|
159
|
+
|
|
160
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
161
|
+
// You can create one instance of it to use across an application.
|
|
162
|
+
const novu = new NovuCore({
|
|
163
|
+
security: {
|
|
164
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
165
|
+
},
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
async function run() {
|
|
169
|
+
const res = await subscribersNotificationsUnseenCount(novu, {
|
|
170
|
+
subscriberId: "<id>",
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
if (!res.ok) {
|
|
174
|
+
throw res.error;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const { value: result } = res;
|
|
178
|
+
|
|
179
|
+
// Handle the result
|
|
180
|
+
console.log(result);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
run();
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### React hooks and utilities
|
|
187
|
+
|
|
188
|
+
This method can be used in React components through the following hooks and
|
|
189
|
+
associated utilities.
|
|
190
|
+
|
|
191
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
192
|
+
> below and how to get started using React hooks.
|
|
193
|
+
|
|
194
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
import {
|
|
198
|
+
// Query hooks for fetching data.
|
|
199
|
+
useSubscribersNotificationsUnseenCount,
|
|
200
|
+
useSubscribersNotificationsUnseenCountSuspense,
|
|
201
|
+
|
|
202
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
203
|
+
// Server Components that will be immediately available to client components
|
|
204
|
+
// using the hooks.
|
|
205
|
+
prefetchSubscribersNotificationsUnseenCount,
|
|
206
|
+
|
|
207
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
208
|
+
// mutations and other user actions.
|
|
209
|
+
invalidateSubscribersNotificationsUnseenCount,
|
|
210
|
+
invalidateAllSubscribersNotificationsUnseenCount,
|
|
211
|
+
} from "@novu/api/react-query/subscribersNotificationsUnseenCount.js";
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Parameters
|
|
215
|
+
|
|
216
|
+
| Parameter | Type | Required | Description |
|
|
217
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
218
|
+
| `request` | [operations.SubscribersV1ControllerGetUnseenCountRequest](../../models/operations/subscribersv1controllergetunseencountrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
219
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
220
|
+
| `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. |
|
|
221
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
222
|
+
|
|
223
|
+
### Response
|
|
224
|
+
|
|
225
|
+
**Promise\<[operations.SubscribersV1ControllerGetUnseenCountResponse](../../models/operations/subscribersv1controllergetunseencountresponse.md)\>**
|
|
226
|
+
|
|
227
|
+
### Errors
|
|
228
|
+
|
|
229
|
+
| Error Type | Status Code | Content Type |
|
|
230
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
231
|
+
| errors.ErrorDto | 414 | application/json |
|
|
232
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
233
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
234
|
+
| errors.ErrorDto | 500 | application/json |
|
|
235
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|