@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,598 @@
|
|
|
1
|
+
# Novu SDK
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
Novu API: Novu REST API. Please see https://docs.novu.co/api-reference for more details.
|
|
6
|
+
|
|
7
|
+
Novu Documentation
|
|
8
|
+
<https://docs.novu.co>
|
|
9
|
+
|
|
10
|
+
### Available Operations
|
|
11
|
+
|
|
12
|
+
* [trigger](#trigger) - Trigger event
|
|
13
|
+
* [triggerBulk](#triggerbulk) - Bulk trigger event
|
|
14
|
+
* [triggerBroadcast](#triggerbroadcast) - Broadcast event to all
|
|
15
|
+
* [cancel](#cancel) - Cancel triggered event
|
|
16
|
+
|
|
17
|
+
## trigger
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
Trigger event is the main (and only) way to send notifications to subscribers.
|
|
21
|
+
The trigger identifier is used to match the particular workflow associated with it.
|
|
22
|
+
Additional information can be passed according the body interface below.
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Example Usage
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { Novu } from "@novu/api";
|
|
29
|
+
|
|
30
|
+
const novu = new Novu({
|
|
31
|
+
security: {
|
|
32
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
async function run() {
|
|
37
|
+
const result = await novu.trigger({
|
|
38
|
+
workflowId: "workflow_identifier",
|
|
39
|
+
payload: {
|
|
40
|
+
"comment_id": "string",
|
|
41
|
+
"post": {
|
|
42
|
+
"text": "string",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
overrides: {
|
|
46
|
+
"fcm": {
|
|
47
|
+
"data": {
|
|
48
|
+
"key": "value",
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
to: {
|
|
53
|
+
subscriberId: "<id>",
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Handle the result
|
|
58
|
+
console.log(result);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
run();
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Standalone function
|
|
65
|
+
|
|
66
|
+
The standalone function version of this method:
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
70
|
+
import { trigger } from "@novu/api/funcs/trigger.js";
|
|
71
|
+
|
|
72
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
73
|
+
// You can create one instance of it to use across an application.
|
|
74
|
+
const novu = new NovuCore({
|
|
75
|
+
security: {
|
|
76
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
async function run() {
|
|
81
|
+
const res = await trigger(novu, {
|
|
82
|
+
workflowId: "workflow_identifier",
|
|
83
|
+
payload: {
|
|
84
|
+
"comment_id": "string",
|
|
85
|
+
"post": {
|
|
86
|
+
"text": "string",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
overrides: {
|
|
90
|
+
"fcm": {
|
|
91
|
+
"data": {
|
|
92
|
+
"key": "value",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
to: {
|
|
97
|
+
subscriberId: "<id>",
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
if (!res.ok) {
|
|
102
|
+
throw res.error;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const { value: result } = res;
|
|
106
|
+
|
|
107
|
+
// Handle the result
|
|
108
|
+
console.log(result);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
run();
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### React hooks and utilities
|
|
115
|
+
|
|
116
|
+
This method can be used in React components through the following hooks and
|
|
117
|
+
associated utilities.
|
|
118
|
+
|
|
119
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
120
|
+
> below and how to get started using React hooks.
|
|
121
|
+
|
|
122
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
123
|
+
|
|
124
|
+
```tsx
|
|
125
|
+
import {
|
|
126
|
+
// Mutation hook for triggering the API call.
|
|
127
|
+
useTriggerMutation
|
|
128
|
+
} from "@novu/api/react-query/trigger.js";
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Parameters
|
|
132
|
+
|
|
133
|
+
| Parameter | Type | Required | Description |
|
|
134
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
135
|
+
| `triggerEventRequestDto` | [components.TriggerEventRequestDto](../../models/components/triggereventrequestdto.md) | :heavy_check_mark: | N/A |
|
|
136
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
137
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
138
|
+
| `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. |
|
|
139
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
140
|
+
|
|
141
|
+
### Response
|
|
142
|
+
|
|
143
|
+
**Promise\<[operations.EventsControllerTriggerResponse](../../models/operations/eventscontrollertriggerresponse.md)\>**
|
|
144
|
+
|
|
145
|
+
### Errors
|
|
146
|
+
|
|
147
|
+
| Error Type | Status Code | Content Type |
|
|
148
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
149
|
+
| errors.ErrorDto | 414 | application/json |
|
|
150
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
151
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
152
|
+
| errors.ErrorDto | 500 | application/json |
|
|
153
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
154
|
+
|
|
155
|
+
## triggerBulk
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
Using this endpoint you can trigger multiple events at once, to avoid multiple calls to the API.
|
|
159
|
+
The bulk API is limited to 100 events per request.
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
### Example Usage
|
|
163
|
+
|
|
164
|
+
```typescript
|
|
165
|
+
import { Novu } from "@novu/api";
|
|
166
|
+
|
|
167
|
+
const novu = new Novu({
|
|
168
|
+
security: {
|
|
169
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
async function run() {
|
|
174
|
+
const result = await novu.triggerBulk({
|
|
175
|
+
events: [
|
|
176
|
+
{
|
|
177
|
+
workflowId: "workflow_identifier",
|
|
178
|
+
payload: {
|
|
179
|
+
"comment_id": "string",
|
|
180
|
+
"post": {
|
|
181
|
+
"text": "string",
|
|
182
|
+
},
|
|
183
|
+
},
|
|
184
|
+
overrides: {
|
|
185
|
+
"fcm": {
|
|
186
|
+
"data": {
|
|
187
|
+
"key": "value",
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
},
|
|
191
|
+
to: {
|
|
192
|
+
subscriberId: "<id>",
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
workflowId: "workflow_identifier",
|
|
197
|
+
payload: {
|
|
198
|
+
"comment_id": "string",
|
|
199
|
+
"post": {
|
|
200
|
+
"text": "string",
|
|
201
|
+
},
|
|
202
|
+
},
|
|
203
|
+
overrides: {
|
|
204
|
+
"fcm": {
|
|
205
|
+
"data": {
|
|
206
|
+
"key": "value",
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
to: [
|
|
211
|
+
{
|
|
212
|
+
topicKey: "<value>",
|
|
213
|
+
type: "Subscriber",
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
workflowId: "workflow_identifier",
|
|
219
|
+
payload: {
|
|
220
|
+
"comment_id": "string",
|
|
221
|
+
"post": {
|
|
222
|
+
"text": "string",
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
overrides: {
|
|
226
|
+
"fcm": {
|
|
227
|
+
"data": {
|
|
228
|
+
"key": "value",
|
|
229
|
+
},
|
|
230
|
+
},
|
|
231
|
+
},
|
|
232
|
+
to: [
|
|
233
|
+
"SUBSCRIBER_ID",
|
|
234
|
+
"SUBSCRIBER_ID",
|
|
235
|
+
],
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
// Handle the result
|
|
241
|
+
console.log(result);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
run();
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
### Standalone function
|
|
248
|
+
|
|
249
|
+
The standalone function version of this method:
|
|
250
|
+
|
|
251
|
+
```typescript
|
|
252
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
253
|
+
import { triggerBulk } from "@novu/api/funcs/triggerBulk.js";
|
|
254
|
+
|
|
255
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
256
|
+
// You can create one instance of it to use across an application.
|
|
257
|
+
const novu = new NovuCore({
|
|
258
|
+
security: {
|
|
259
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
|
|
263
|
+
async function run() {
|
|
264
|
+
const res = await triggerBulk(novu, {
|
|
265
|
+
events: [
|
|
266
|
+
{
|
|
267
|
+
workflowId: "workflow_identifier",
|
|
268
|
+
payload: {
|
|
269
|
+
"comment_id": "string",
|
|
270
|
+
"post": {
|
|
271
|
+
"text": "string",
|
|
272
|
+
},
|
|
273
|
+
},
|
|
274
|
+
overrides: {
|
|
275
|
+
"fcm": {
|
|
276
|
+
"data": {
|
|
277
|
+
"key": "value",
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
},
|
|
281
|
+
to: {
|
|
282
|
+
subscriberId: "<id>",
|
|
283
|
+
},
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
workflowId: "workflow_identifier",
|
|
287
|
+
payload: {
|
|
288
|
+
"comment_id": "string",
|
|
289
|
+
"post": {
|
|
290
|
+
"text": "string",
|
|
291
|
+
},
|
|
292
|
+
},
|
|
293
|
+
overrides: {
|
|
294
|
+
"fcm": {
|
|
295
|
+
"data": {
|
|
296
|
+
"key": "value",
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
to: [
|
|
301
|
+
{
|
|
302
|
+
topicKey: "<value>",
|
|
303
|
+
type: "Subscriber",
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
workflowId: "workflow_identifier",
|
|
309
|
+
payload: {
|
|
310
|
+
"comment_id": "string",
|
|
311
|
+
"post": {
|
|
312
|
+
"text": "string",
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
overrides: {
|
|
316
|
+
"fcm": {
|
|
317
|
+
"data": {
|
|
318
|
+
"key": "value",
|
|
319
|
+
},
|
|
320
|
+
},
|
|
321
|
+
},
|
|
322
|
+
to: [
|
|
323
|
+
"SUBSCRIBER_ID",
|
|
324
|
+
"SUBSCRIBER_ID",
|
|
325
|
+
],
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
});
|
|
329
|
+
|
|
330
|
+
if (!res.ok) {
|
|
331
|
+
throw res.error;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
const { value: result } = res;
|
|
335
|
+
|
|
336
|
+
// Handle the result
|
|
337
|
+
console.log(result);
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
run();
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
### React hooks and utilities
|
|
344
|
+
|
|
345
|
+
This method can be used in React components through the following hooks and
|
|
346
|
+
associated utilities.
|
|
347
|
+
|
|
348
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
349
|
+
> below and how to get started using React hooks.
|
|
350
|
+
|
|
351
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
352
|
+
|
|
353
|
+
```tsx
|
|
354
|
+
import {
|
|
355
|
+
// Mutation hook for triggering the API call.
|
|
356
|
+
useTriggerBulkMutation
|
|
357
|
+
} from "@novu/api/react-query/triggerBulk.js";
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Parameters
|
|
361
|
+
|
|
362
|
+
| Parameter | Type | Required | Description |
|
|
363
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
364
|
+
| `bulkTriggerEventDto` | [components.BulkTriggerEventDto](../../models/components/bulktriggereventdto.md) | :heavy_check_mark: | N/A |
|
|
365
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
366
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
367
|
+
| `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. |
|
|
368
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
369
|
+
|
|
370
|
+
### Response
|
|
371
|
+
|
|
372
|
+
**Promise\<[operations.EventsControllerTriggerBulkResponse](../../models/operations/eventscontrollertriggerbulkresponse.md)\>**
|
|
373
|
+
|
|
374
|
+
### Errors
|
|
375
|
+
|
|
376
|
+
| Error Type | Status Code | Content Type |
|
|
377
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
378
|
+
| errors.ErrorDto | 414 | application/json |
|
|
379
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
380
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
381
|
+
| errors.ErrorDto | 500 | application/json |
|
|
382
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
383
|
+
|
|
384
|
+
## triggerBroadcast
|
|
385
|
+
|
|
386
|
+
Trigger a broadcast event to all existing subscribers, could be used to send announcements, etc.
|
|
387
|
+
In the future could be used to trigger events to a subset of subscribers based on defined filters.
|
|
388
|
+
|
|
389
|
+
### Example Usage
|
|
390
|
+
|
|
391
|
+
```typescript
|
|
392
|
+
import { Novu } from "@novu/api";
|
|
393
|
+
|
|
394
|
+
const novu = new Novu({
|
|
395
|
+
security: {
|
|
396
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
397
|
+
},
|
|
398
|
+
});
|
|
399
|
+
|
|
400
|
+
async function run() {
|
|
401
|
+
const result = await novu.triggerBroadcast({
|
|
402
|
+
name: "<value>",
|
|
403
|
+
payload: {
|
|
404
|
+
"comment_id": "string",
|
|
405
|
+
"post": {
|
|
406
|
+
"text": "string",
|
|
407
|
+
},
|
|
408
|
+
},
|
|
409
|
+
});
|
|
410
|
+
|
|
411
|
+
// Handle the result
|
|
412
|
+
console.log(result);
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
run();
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### Standalone function
|
|
419
|
+
|
|
420
|
+
The standalone function version of this method:
|
|
421
|
+
|
|
422
|
+
```typescript
|
|
423
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
424
|
+
import { triggerBroadcast } from "@novu/api/funcs/triggerBroadcast.js";
|
|
425
|
+
|
|
426
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
427
|
+
// You can create one instance of it to use across an application.
|
|
428
|
+
const novu = new NovuCore({
|
|
429
|
+
security: {
|
|
430
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
431
|
+
},
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
async function run() {
|
|
435
|
+
const res = await triggerBroadcast(novu, {
|
|
436
|
+
name: "<value>",
|
|
437
|
+
payload: {
|
|
438
|
+
"comment_id": "string",
|
|
439
|
+
"post": {
|
|
440
|
+
"text": "string",
|
|
441
|
+
},
|
|
442
|
+
},
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
if (!res.ok) {
|
|
446
|
+
throw res.error;
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const { value: result } = res;
|
|
450
|
+
|
|
451
|
+
// Handle the result
|
|
452
|
+
console.log(result);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
run();
|
|
456
|
+
```
|
|
457
|
+
|
|
458
|
+
### React hooks and utilities
|
|
459
|
+
|
|
460
|
+
This method can be used in React components through the following hooks and
|
|
461
|
+
associated utilities.
|
|
462
|
+
|
|
463
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
464
|
+
> below and how to get started using React hooks.
|
|
465
|
+
|
|
466
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
467
|
+
|
|
468
|
+
```tsx
|
|
469
|
+
import {
|
|
470
|
+
// Mutation hook for triggering the API call.
|
|
471
|
+
useTriggerBroadcastMutation
|
|
472
|
+
} from "@novu/api/react-query/triggerBroadcast.js";
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
### Parameters
|
|
476
|
+
|
|
477
|
+
| Parameter | Type | Required | Description |
|
|
478
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
479
|
+
| `triggerEventToAllRequestDto` | [components.TriggerEventToAllRequestDto](../../models/components/triggereventtoallrequestdto.md) | :heavy_check_mark: | N/A |
|
|
480
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
481
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
482
|
+
| `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. |
|
|
483
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
484
|
+
|
|
485
|
+
### Response
|
|
486
|
+
|
|
487
|
+
**Promise\<[operations.EventsControllerBroadcastEventToAllResponse](../../models/operations/eventscontrollerbroadcasteventtoallresponse.md)\>**
|
|
488
|
+
|
|
489
|
+
### Errors
|
|
490
|
+
|
|
491
|
+
| Error Type | Status Code | Content Type |
|
|
492
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
493
|
+
| errors.ErrorDto | 414 | application/json |
|
|
494
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
495
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
496
|
+
| errors.ErrorDto | 500 | application/json |
|
|
497
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
498
|
+
|
|
499
|
+
## cancel
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
Using a previously generated transactionId during the event trigger,
|
|
503
|
+
will cancel any active or pending workflows. This is useful to cancel active digests, delays etc...
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
### Example Usage
|
|
507
|
+
|
|
508
|
+
```typescript
|
|
509
|
+
import { Novu } from "@novu/api";
|
|
510
|
+
|
|
511
|
+
const novu = new Novu({
|
|
512
|
+
security: {
|
|
513
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
514
|
+
},
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
async function run() {
|
|
518
|
+
const result = await novu.cancel("<id>");
|
|
519
|
+
|
|
520
|
+
// Handle the result
|
|
521
|
+
console.log(result);
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
run();
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### Standalone function
|
|
528
|
+
|
|
529
|
+
The standalone function version of this method:
|
|
530
|
+
|
|
531
|
+
```typescript
|
|
532
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
533
|
+
import { cancel } from "@novu/api/funcs/cancel.js";
|
|
534
|
+
|
|
535
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
536
|
+
// You can create one instance of it to use across an application.
|
|
537
|
+
const novu = new NovuCore({
|
|
538
|
+
security: {
|
|
539
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
540
|
+
},
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
async function run() {
|
|
544
|
+
const res = await cancel(novu, "<id>");
|
|
545
|
+
|
|
546
|
+
if (!res.ok) {
|
|
547
|
+
throw res.error;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
const { value: result } = res;
|
|
551
|
+
|
|
552
|
+
// Handle the result
|
|
553
|
+
console.log(result);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
run();
|
|
557
|
+
```
|
|
558
|
+
|
|
559
|
+
### React hooks and utilities
|
|
560
|
+
|
|
561
|
+
This method can be used in React components through the following hooks and
|
|
562
|
+
associated utilities.
|
|
563
|
+
|
|
564
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
565
|
+
> below and how to get started using React hooks.
|
|
566
|
+
|
|
567
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
568
|
+
|
|
569
|
+
```tsx
|
|
570
|
+
import {
|
|
571
|
+
// Mutation hook for triggering the API call.
|
|
572
|
+
useCancelMutation
|
|
573
|
+
} from "@novu/api/react-query/cancel.js";
|
|
574
|
+
```
|
|
575
|
+
|
|
576
|
+
### Parameters
|
|
577
|
+
|
|
578
|
+
| Parameter | Type | Required | Description |
|
|
579
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
580
|
+
| `transactionId` | *string* | :heavy_check_mark: | N/A |
|
|
581
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
582
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
583
|
+
| `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. |
|
|
584
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
585
|
+
|
|
586
|
+
### Response
|
|
587
|
+
|
|
588
|
+
**Promise\<[operations.EventsControllerCancelResponse](../../models/operations/eventscontrollercancelresponse.md)\>**
|
|
589
|
+
|
|
590
|
+
### Errors
|
|
591
|
+
|
|
592
|
+
| Error Type | Status Code | Content Type |
|
|
593
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
594
|
+
| errors.ErrorDto | 414 | application/json |
|
|
595
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
596
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
597
|
+
| errors.ErrorDto | 500 | application/json |
|
|
598
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|