@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,631 @@
|
|
|
1
|
+
# Integrations
|
|
2
|
+
(*integrations*)
|
|
3
|
+
|
|
4
|
+
## Overview
|
|
5
|
+
|
|
6
|
+
With the help of the Integration Store, you can easily integrate your favorite delivery provider. During the runtime of the API, the Integrations Store is responsible for storing the configurations of all the providers.
|
|
7
|
+
<https://docs.novu.co/channels-and-providers/integration-store>
|
|
8
|
+
|
|
9
|
+
### Available Operations
|
|
10
|
+
|
|
11
|
+
* [list](#list) - Get integrations
|
|
12
|
+
* [create](#create) - Create integration
|
|
13
|
+
* [listActive](#listactive) - Get active integrations
|
|
14
|
+
* [update](#update) - Update integration
|
|
15
|
+
* [delete](#delete) - Delete integration
|
|
16
|
+
* [setAsPrimary](#setasprimary) - Set integration as primary
|
|
17
|
+
|
|
18
|
+
## list
|
|
19
|
+
|
|
20
|
+
Return all the integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
|
|
21
|
+
|
|
22
|
+
### Example Usage
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { Novu } from "@novu/api";
|
|
26
|
+
|
|
27
|
+
const novu = new Novu({
|
|
28
|
+
security: {
|
|
29
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
async function run() {
|
|
34
|
+
const result = await novu.integrations.list();
|
|
35
|
+
|
|
36
|
+
// Handle the result
|
|
37
|
+
console.log(result);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
run();
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Standalone function
|
|
44
|
+
|
|
45
|
+
The standalone function version of this method:
|
|
46
|
+
|
|
47
|
+
```typescript
|
|
48
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
49
|
+
import { integrationsList } from "@novu/api/funcs/integrationsList.js";
|
|
50
|
+
|
|
51
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
52
|
+
// You can create one instance of it to use across an application.
|
|
53
|
+
const novu = new NovuCore({
|
|
54
|
+
security: {
|
|
55
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
async function run() {
|
|
60
|
+
const res = await integrationsList(novu);
|
|
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
|
+
// Query hooks for fetching data.
|
|
88
|
+
useIntegrationsList,
|
|
89
|
+
useIntegrationsListSuspense,
|
|
90
|
+
|
|
91
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
92
|
+
// Server Components that will be immediately available to client components
|
|
93
|
+
// using the hooks.
|
|
94
|
+
prefetchIntegrationsList,
|
|
95
|
+
|
|
96
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
97
|
+
// mutations and other user actions.
|
|
98
|
+
invalidateIntegrationsList,
|
|
99
|
+
invalidateAllIntegrationsList,
|
|
100
|
+
} from "@novu/api/react-query/integrationsList.js";
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Parameters
|
|
104
|
+
|
|
105
|
+
| Parameter | Type | Required | Description |
|
|
106
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
107
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
108
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
109
|
+
| `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. |
|
|
110
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
111
|
+
|
|
112
|
+
### Response
|
|
113
|
+
|
|
114
|
+
**Promise\<[operations.IntegrationsControllerListIntegrationsResponse](../../models/operations/integrationscontrollerlistintegrationsresponse.md)\>**
|
|
115
|
+
|
|
116
|
+
### Errors
|
|
117
|
+
|
|
118
|
+
| Error Type | Status Code | Content Type |
|
|
119
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
120
|
+
| errors.ErrorDto | 414 | application/json |
|
|
121
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
122
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
123
|
+
| errors.ErrorDto | 500 | application/json |
|
|
124
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
125
|
+
|
|
126
|
+
## create
|
|
127
|
+
|
|
128
|
+
Create an integration for the current environment the user is based on the API key provided
|
|
129
|
+
|
|
130
|
+
### Example Usage
|
|
131
|
+
|
|
132
|
+
```typescript
|
|
133
|
+
import { Novu } from "@novu/api";
|
|
134
|
+
|
|
135
|
+
const novu = new Novu({
|
|
136
|
+
security: {
|
|
137
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
async function run() {
|
|
142
|
+
const result = await novu.integrations.create({
|
|
143
|
+
providerId: "<id>",
|
|
144
|
+
channel: "sms",
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// Handle the result
|
|
148
|
+
console.log(result);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
run();
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Standalone function
|
|
155
|
+
|
|
156
|
+
The standalone function version of this method:
|
|
157
|
+
|
|
158
|
+
```typescript
|
|
159
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
160
|
+
import { integrationsCreate } from "@novu/api/funcs/integrationsCreate.js";
|
|
161
|
+
|
|
162
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
163
|
+
// You can create one instance of it to use across an application.
|
|
164
|
+
const novu = new NovuCore({
|
|
165
|
+
security: {
|
|
166
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
async function run() {
|
|
171
|
+
const res = await integrationsCreate(novu, {
|
|
172
|
+
providerId: "<id>",
|
|
173
|
+
channel: "sms",
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
if (!res.ok) {
|
|
177
|
+
throw res.error;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const { value: result } = res;
|
|
181
|
+
|
|
182
|
+
// Handle the result
|
|
183
|
+
console.log(result);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
run();
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
### React hooks and utilities
|
|
190
|
+
|
|
191
|
+
This method can be used in React components through the following hooks and
|
|
192
|
+
associated utilities.
|
|
193
|
+
|
|
194
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
195
|
+
> below and how to get started using React hooks.
|
|
196
|
+
|
|
197
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
198
|
+
|
|
199
|
+
```tsx
|
|
200
|
+
import {
|
|
201
|
+
// Mutation hook for triggering the API call.
|
|
202
|
+
useIntegrationsCreateMutation
|
|
203
|
+
} from "@novu/api/react-query/integrationsCreate.js";
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Parameters
|
|
207
|
+
|
|
208
|
+
| Parameter | Type | Required | Description |
|
|
209
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
210
|
+
| `createIntegrationRequestDto` | [components.CreateIntegrationRequestDto](../../models/components/createintegrationrequestdto.md) | :heavy_check_mark: | N/A |
|
|
211
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
212
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
213
|
+
| `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. |
|
|
214
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
215
|
+
|
|
216
|
+
### Response
|
|
217
|
+
|
|
218
|
+
**Promise\<[operations.IntegrationsControllerCreateIntegrationResponse](../../models/operations/integrationscontrollercreateintegrationresponse.md)\>**
|
|
219
|
+
|
|
220
|
+
### Errors
|
|
221
|
+
|
|
222
|
+
| Error Type | Status Code | Content Type |
|
|
223
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
224
|
+
| errors.ErrorDto | 414 | application/json |
|
|
225
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
226
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
227
|
+
| errors.ErrorDto | 500 | application/json |
|
|
228
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
229
|
+
|
|
230
|
+
## listActive
|
|
231
|
+
|
|
232
|
+
Return all the active integrations the user has created for that organization. Review v.0.17.0 changelog for a breaking change
|
|
233
|
+
|
|
234
|
+
### Example Usage
|
|
235
|
+
|
|
236
|
+
```typescript
|
|
237
|
+
import { Novu } from "@novu/api";
|
|
238
|
+
|
|
239
|
+
const novu = new Novu({
|
|
240
|
+
security: {
|
|
241
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
242
|
+
},
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
async function run() {
|
|
246
|
+
const result = await novu.integrations.listActive();
|
|
247
|
+
|
|
248
|
+
// Handle the result
|
|
249
|
+
console.log(result);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
run();
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### Standalone function
|
|
256
|
+
|
|
257
|
+
The standalone function version of this method:
|
|
258
|
+
|
|
259
|
+
```typescript
|
|
260
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
261
|
+
import { integrationsListActive } from "@novu/api/funcs/integrationsListActive.js";
|
|
262
|
+
|
|
263
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
264
|
+
// You can create one instance of it to use across an application.
|
|
265
|
+
const novu = new NovuCore({
|
|
266
|
+
security: {
|
|
267
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
|
|
271
|
+
async function run() {
|
|
272
|
+
const res = await integrationsListActive(novu);
|
|
273
|
+
|
|
274
|
+
if (!res.ok) {
|
|
275
|
+
throw res.error;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
const { value: result } = res;
|
|
279
|
+
|
|
280
|
+
// Handle the result
|
|
281
|
+
console.log(result);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
run();
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### React hooks and utilities
|
|
288
|
+
|
|
289
|
+
This method can be used in React components through the following hooks and
|
|
290
|
+
associated utilities.
|
|
291
|
+
|
|
292
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
293
|
+
> below and how to get started using React hooks.
|
|
294
|
+
|
|
295
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
296
|
+
|
|
297
|
+
```tsx
|
|
298
|
+
import {
|
|
299
|
+
// Query hooks for fetching data.
|
|
300
|
+
useIntegrationsListActive,
|
|
301
|
+
useIntegrationsListActiveSuspense,
|
|
302
|
+
|
|
303
|
+
// Utility for prefetching data during server-side rendering and in React
|
|
304
|
+
// Server Components that will be immediately available to client components
|
|
305
|
+
// using the hooks.
|
|
306
|
+
prefetchIntegrationsListActive,
|
|
307
|
+
|
|
308
|
+
// Utilities to invalidate the query cache for this query in response to
|
|
309
|
+
// mutations and other user actions.
|
|
310
|
+
invalidateIntegrationsListActive,
|
|
311
|
+
invalidateAllIntegrationsListActive,
|
|
312
|
+
} from "@novu/api/react-query/integrationsListActive.js";
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
### Parameters
|
|
316
|
+
|
|
317
|
+
| Parameter | Type | Required | Description |
|
|
318
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
319
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
320
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
321
|
+
| `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. |
|
|
322
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
323
|
+
|
|
324
|
+
### Response
|
|
325
|
+
|
|
326
|
+
**Promise\<[operations.IntegrationsControllerGetActiveIntegrationsResponse](../../models/operations/integrationscontrollergetactiveintegrationsresponse.md)\>**
|
|
327
|
+
|
|
328
|
+
### Errors
|
|
329
|
+
|
|
330
|
+
| Error Type | Status Code | Content Type |
|
|
331
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
332
|
+
| errors.ErrorDto | 414 | application/json |
|
|
333
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
334
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
335
|
+
| errors.ErrorDto | 500 | application/json |
|
|
336
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
337
|
+
|
|
338
|
+
## update
|
|
339
|
+
|
|
340
|
+
Update integration
|
|
341
|
+
|
|
342
|
+
### Example Usage
|
|
343
|
+
|
|
344
|
+
```typescript
|
|
345
|
+
import { Novu } from "@novu/api";
|
|
346
|
+
|
|
347
|
+
const novu = new Novu({
|
|
348
|
+
security: {
|
|
349
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
350
|
+
},
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
async function run() {
|
|
354
|
+
const result = await novu.integrations.update({}, "<id>");
|
|
355
|
+
|
|
356
|
+
// Handle the result
|
|
357
|
+
console.log(result);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
run();
|
|
361
|
+
```
|
|
362
|
+
|
|
363
|
+
### Standalone function
|
|
364
|
+
|
|
365
|
+
The standalone function version of this method:
|
|
366
|
+
|
|
367
|
+
```typescript
|
|
368
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
369
|
+
import { integrationsUpdate } from "@novu/api/funcs/integrationsUpdate.js";
|
|
370
|
+
|
|
371
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
372
|
+
// You can create one instance of it to use across an application.
|
|
373
|
+
const novu = new NovuCore({
|
|
374
|
+
security: {
|
|
375
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
376
|
+
},
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
async function run() {
|
|
380
|
+
const res = await integrationsUpdate(novu, {}, "<id>");
|
|
381
|
+
|
|
382
|
+
if (!res.ok) {
|
|
383
|
+
throw res.error;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
const { value: result } = res;
|
|
387
|
+
|
|
388
|
+
// Handle the result
|
|
389
|
+
console.log(result);
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
run();
|
|
393
|
+
```
|
|
394
|
+
|
|
395
|
+
### React hooks and utilities
|
|
396
|
+
|
|
397
|
+
This method can be used in React components through the following hooks and
|
|
398
|
+
associated utilities.
|
|
399
|
+
|
|
400
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
401
|
+
> below and how to get started using React hooks.
|
|
402
|
+
|
|
403
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
404
|
+
|
|
405
|
+
```tsx
|
|
406
|
+
import {
|
|
407
|
+
// Mutation hook for triggering the API call.
|
|
408
|
+
useIntegrationsUpdateMutation
|
|
409
|
+
} from "@novu/api/react-query/integrationsUpdate.js";
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
### Parameters
|
|
413
|
+
|
|
414
|
+
| Parameter | Type | Required | Description |
|
|
415
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
416
|
+
| `integrationId` | *string* | :heavy_check_mark: | N/A |
|
|
417
|
+
| `updateIntegrationRequestDto` | [components.UpdateIntegrationRequestDto](../../models/components/updateintegrationrequestdto.md) | :heavy_check_mark: | N/A |
|
|
418
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
419
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
420
|
+
| `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. |
|
|
421
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
422
|
+
|
|
423
|
+
### Response
|
|
424
|
+
|
|
425
|
+
**Promise\<[operations.IntegrationsControllerUpdateIntegrationByIdResponse](../../models/operations/integrationscontrollerupdateintegrationbyidresponse.md)\>**
|
|
426
|
+
|
|
427
|
+
### Errors
|
|
428
|
+
|
|
429
|
+
| Error Type | Status Code | Content Type |
|
|
430
|
+
| --------------------------------- | --------------------------------- | --------------------------------- |
|
|
431
|
+
| errors.ErrorDto | 414 | application/json |
|
|
432
|
+
| errors.ErrorDto | 400, 401, 403, 405, 409, 413, 415 | application/json |
|
|
433
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
434
|
+
| errors.ErrorDto | 500 | application/json |
|
|
435
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
436
|
+
|
|
437
|
+
## delete
|
|
438
|
+
|
|
439
|
+
Delete integration
|
|
440
|
+
|
|
441
|
+
### Example Usage
|
|
442
|
+
|
|
443
|
+
```typescript
|
|
444
|
+
import { Novu } from "@novu/api";
|
|
445
|
+
|
|
446
|
+
const novu = new Novu({
|
|
447
|
+
security: {
|
|
448
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
449
|
+
},
|
|
450
|
+
});
|
|
451
|
+
|
|
452
|
+
async function run() {
|
|
453
|
+
const result = await novu.integrations.delete("<id>");
|
|
454
|
+
|
|
455
|
+
// Handle the result
|
|
456
|
+
console.log(result);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
run();
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
### Standalone function
|
|
463
|
+
|
|
464
|
+
The standalone function version of this method:
|
|
465
|
+
|
|
466
|
+
```typescript
|
|
467
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
468
|
+
import { integrationsDelete } from "@novu/api/funcs/integrationsDelete.js";
|
|
469
|
+
|
|
470
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
471
|
+
// You can create one instance of it to use across an application.
|
|
472
|
+
const novu = new NovuCore({
|
|
473
|
+
security: {
|
|
474
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
475
|
+
},
|
|
476
|
+
});
|
|
477
|
+
|
|
478
|
+
async function run() {
|
|
479
|
+
const res = await integrationsDelete(novu, "<id>");
|
|
480
|
+
|
|
481
|
+
if (!res.ok) {
|
|
482
|
+
throw res.error;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
const { value: result } = res;
|
|
486
|
+
|
|
487
|
+
// Handle the result
|
|
488
|
+
console.log(result);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
run();
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### React hooks and utilities
|
|
495
|
+
|
|
496
|
+
This method can be used in React components through the following hooks and
|
|
497
|
+
associated utilities.
|
|
498
|
+
|
|
499
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
500
|
+
> below and how to get started using React hooks.
|
|
501
|
+
|
|
502
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
503
|
+
|
|
504
|
+
```tsx
|
|
505
|
+
import {
|
|
506
|
+
// Mutation hook for triggering the API call.
|
|
507
|
+
useIntegrationsDeleteMutation
|
|
508
|
+
} from "@novu/api/react-query/integrationsDelete.js";
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Parameters
|
|
512
|
+
|
|
513
|
+
| Parameter | Type | Required | Description |
|
|
514
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
515
|
+
| `integrationId` | *string* | :heavy_check_mark: | N/A |
|
|
516
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
517
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
518
|
+
| `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. |
|
|
519
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
520
|
+
|
|
521
|
+
### Response
|
|
522
|
+
|
|
523
|
+
**Promise\<[operations.IntegrationsControllerRemoveIntegrationResponse](../../models/operations/integrationscontrollerremoveintegrationresponse.md)\>**
|
|
524
|
+
|
|
525
|
+
### Errors
|
|
526
|
+
|
|
527
|
+
| Error Type | Status Code | Content Type |
|
|
528
|
+
| -------------------------------------- | -------------------------------------- | -------------------------------------- |
|
|
529
|
+
| errors.ErrorDto | 414 | application/json |
|
|
530
|
+
| errors.ErrorDto | 400, 401, 403, 404, 405, 409, 413, 415 | application/json |
|
|
531
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
532
|
+
| errors.ErrorDto | 500 | application/json |
|
|
533
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
534
|
+
|
|
535
|
+
## setAsPrimary
|
|
536
|
+
|
|
537
|
+
Set integration as primary
|
|
538
|
+
|
|
539
|
+
### Example Usage
|
|
540
|
+
|
|
541
|
+
```typescript
|
|
542
|
+
import { Novu } from "@novu/api";
|
|
543
|
+
|
|
544
|
+
const novu = new Novu({
|
|
545
|
+
security: {
|
|
546
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
547
|
+
},
|
|
548
|
+
});
|
|
549
|
+
|
|
550
|
+
async function run() {
|
|
551
|
+
const result = await novu.integrations.setAsPrimary("<id>");
|
|
552
|
+
|
|
553
|
+
// Handle the result
|
|
554
|
+
console.log(result);
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
run();
|
|
558
|
+
```
|
|
559
|
+
|
|
560
|
+
### Standalone function
|
|
561
|
+
|
|
562
|
+
The standalone function version of this method:
|
|
563
|
+
|
|
564
|
+
```typescript
|
|
565
|
+
import { NovuCore } from "@novu/api/core.js";
|
|
566
|
+
import { integrationsSetAsPrimary } from "@novu/api/funcs/integrationsSetAsPrimary.js";
|
|
567
|
+
|
|
568
|
+
// Use `NovuCore` for best tree-shaking performance.
|
|
569
|
+
// You can create one instance of it to use across an application.
|
|
570
|
+
const novu = new NovuCore({
|
|
571
|
+
security: {
|
|
572
|
+
secretKey: "YOUR_SECRET_KEY_HERE",
|
|
573
|
+
},
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
async function run() {
|
|
577
|
+
const res = await integrationsSetAsPrimary(novu, "<id>");
|
|
578
|
+
|
|
579
|
+
if (!res.ok) {
|
|
580
|
+
throw res.error;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
const { value: result } = res;
|
|
584
|
+
|
|
585
|
+
// Handle the result
|
|
586
|
+
console.log(result);
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
run();
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
### React hooks and utilities
|
|
593
|
+
|
|
594
|
+
This method can be used in React components through the following hooks and
|
|
595
|
+
associated utilities.
|
|
596
|
+
|
|
597
|
+
> Check out [this guide][hook-guide] for information about each of the utilities
|
|
598
|
+
> below and how to get started using React hooks.
|
|
599
|
+
|
|
600
|
+
[hook-guide]: ../../../REACT_QUERY.md
|
|
601
|
+
|
|
602
|
+
```tsx
|
|
603
|
+
import {
|
|
604
|
+
// Mutation hook for triggering the API call.
|
|
605
|
+
useIntegrationsSetAsPrimaryMutation
|
|
606
|
+
} from "@novu/api/react-query/integrationsSetAsPrimary.js";
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
### Parameters
|
|
610
|
+
|
|
611
|
+
| Parameter | Type | Required | Description |
|
|
612
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
613
|
+
| `integrationId` | *string* | :heavy_check_mark: | N/A |
|
|
614
|
+
| `idempotencyKey` | *string* | :heavy_minus_sign: | A header for idempotency purposes |
|
|
615
|
+
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
616
|
+
| `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. |
|
|
617
|
+
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
618
|
+
|
|
619
|
+
### Response
|
|
620
|
+
|
|
621
|
+
**Promise\<[operations.IntegrationsControllerSetIntegrationAsPrimaryResponse](../../models/operations/integrationscontrollersetintegrationasprimaryresponse.md)\>**
|
|
622
|
+
|
|
623
|
+
### Errors
|
|
624
|
+
|
|
625
|
+
| Error Type | Status Code | Content Type |
|
|
626
|
+
| --------------------------------- | --------------------------------- | --------------------------------- |
|
|
627
|
+
| errors.ErrorDto | 414 | application/json |
|
|
628
|
+
| errors.ErrorDto | 400, 401, 403, 405, 409, 413, 415 | application/json |
|
|
629
|
+
| errors.ValidationErrorDto | 422 | application/json |
|
|
630
|
+
| errors.ErrorDto | 500 | application/json |
|
|
631
|
+
| errors.SDKError | 4XX, 5XX | \*/\* |
|