From f158874eedcd108985cf399a15cef6f00f68552a Mon Sep 17 00:00:00 2001 From: David Alberto Adler Date: Mon, 17 Jun 2024 16:24:11 +0100 Subject: [PATCH] --- codeSamples.json | 1772 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 1772 insertions(+) create mode 100644 codeSamples.json diff --git a/codeSamples.json b/codeSamples.json new file mode 100644 index 00000000..e41ded1e --- /dev/null +++ b/codeSamples.json @@ -0,0 +1,1772 @@ +overlay: 1.0.0 +info: + title: CodeSamples overlay for typescript target + version: 0.0.0 +actions: + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_updateSubscriberGlobalPreferences + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.preferences.updateGlobal("", {}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/feed"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_getNotificationsFeed + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.notifications.retrieve({ + subscriberId: "", + payload: "btoa(JSON.stringify({ foo: 123 })) results in base64 encoded string like eyJmb28iOjEyM30=", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/notifications/unseen"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_getUnseenCount + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.notifications.unseenCount({ + seen: false, + subscriberId: "", + limit: 2166.35, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/tenants/{identifier}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: TenantController_removeTenant + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.tenants.delete(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_modifySubscriberChannel + source: |- + import { Novu } from "@novu/api"; + import { UpdateSubscriberChannelRequestDtoProviderId } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.credentials.append("", { + providerId: UpdateSubscriberChannelRequestDtoProviderId.Zulip, + credentials: { + webhookUrl: "", + }, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notifications/graph/stats"]["get"] + update: + x-codeSamples: + - lang: typescript + label: NotificationsController_getActivityGraphStats + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.notifications.stats.graph(4018.61); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/changes/bulk/apply"]["post"] + update: + x-codeSamples: + - lang: typescript + label: ChangesController_bulkApplyDiff + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.changes.applyBulk({ + changeIds: [ + "", + ], + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/messages/transaction/{transactionId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: MessagesController_deleteMessagesByTransactionId + source: "import { Novu } from \"@novu/api\";\nimport { QueryParamChannel } from \"@novu/api/models/operations\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.messages.deleteByTransactionId(\"\", QueryParamChannel.Push);\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/execution-details"]["get"] + update: + x-codeSamples: + - lang: typescript + label: ExecutionDetailsController_getExecutionDetailsForNotification + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.executionDetails.retrieve("", ""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/workflows/{workflowId}"]["put"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_updateWorkflowById + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.update("", { + name: "", + notificationGroupId: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/workflows/{workflowId}/status"]["put"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_updateActiveStatus + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.status.update("", { + active: false, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_getSubscriber + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/feeds"]["get"] + update: + x-codeSamples: + - lang: typescript + label: FeedsController_getFeeds + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.feeds.retrieve(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/tenants"]["post"] + update: + x-codeSamples: + - lang: typescript + label: TenantController_createTenant + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.tenants.create({ + identifier: "", + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/environments/api-keys/regenerate"]["post"] + update: + x-codeSamples: + - lang: typescript + label: EnvironmentsController_regenerateOrganizationApiKeys + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.environments.apiKeys.regenerate(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/bulk"]["post"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_bulkCreateSubscribers + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.createBulk({\n subscribers: [\n {\n subscriberId: \"\",\n },\n ],\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/feeds/{feedId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: FeedsController_deleteFeedById + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.feeds.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/layouts"]["get"] + update: + x-codeSamples: + - lang: typescript + label: LayoutsController_listLayouts + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.list({});\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/layouts/{layoutId}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: LayoutsController_getLayout + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.layouts.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/workflows"]["get"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_listWorkflows + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.list({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/changes"]["get"] + update: + x-codeSamples: + - lang: typescript + label: ChangesController_getChanges + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.changes.retrieve({ + promoted: "false", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/organizations"]["post"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_createOrganization + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.create({ + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations/{integrationId}"]["put"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_updateIntegrationById + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.update("", {}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials"]["put"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_updateSubscriberChannel + source: |- + import { Novu } from "@novu/api"; + import { UpdateSubscriberChannelRequestDtoProviderId } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.credentials.update("", { + providerId: UpdateSubscriberChannelRequestDtoProviderId.Pushpad, + credentials: { + webhookUrl: "", + }, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/topics/{topicKey}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_getTopic + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.topics.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations"]["get"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_listIntegrations + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/events/trigger/{transactionId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: EventsController_cancel + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.events.cancel(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations/{integrationId}/set-primary"]["post"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_setIntegrationAsPrimary + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.setAsPrimary(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_deleteSubscriberCredentials + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.credentials.delete(\"\", \"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/subscribers/{subscriberId}/online-status"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_updateSubscriberOnlineFlag + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.properties.updateOnlineFlag("", { + isOnline: false, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences/{parameter}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_getSubscriberPreferenceByLevel + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.preferences.retrieveByLevel("", ""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/topics/{topicKey}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_deleteTopic + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.delete(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}/subscribers/{externalSubscriberId}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_getTopicSubscriber + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.topics.subscribers.retrieve("", ""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/workflows/variables"]["get"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_getWorkflowVariables + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.variables.retrieve(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/tenants"]["get"] + update: + x-codeSamples: + - lang: typescript + label: TenantController_listTenants + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.tenants.list(7685.78, 10); + + for await (const page of result) { + // handle page + } + } + + run(); + - target: $["paths"]["/v1/workflows"]["post"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_create + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.create({ + name: "", + notificationGroupId: "", + steps: [ + {}, + ], + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/changes/{changeId}/apply"]["post"] + update: + x-codeSamples: + - lang: typescript + label: ChangesController_applyDiff + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.changes.apply(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/layouts/{layoutId}"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: LayoutsController_updateLayout + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.layouts.update("", { + identifier: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/topics"]["post"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_createTopic + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.topics.create({ + key: "", + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/topics/{topicKey}/subscribers/removal"]["post"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_removeSubscribers + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.subscribers.delete(\"\", {\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/tenants/{identifier}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: TenantController_getTenantById + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.tenants.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/organizations"]["get"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_listOrganizations + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notifications/{notificationId}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: NotificationsController_getNotification + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.notifications.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations"]["post"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_createIntegration + source: |- + import { Novu } from "@novu/api"; + import { CreateIntegrationRequestDtoChannel } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.create({ + providerId: "", + channel: CreateIntegrationRequestDtoChannel.Sms, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_chatAccessOauth + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.subscribers.authentication.chatAccessOauth({\n subscriberId: \"\",\n providerId: \"\",\n hmacHash: \"\",\n environmentId: \"\",\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/environments"]["get"] + update: + x-codeSamples: + - lang: typescript + label: EnvironmentsController_listMyEnvironments + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.environments.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/organizations/me"]["get"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_getSelfOrganizationData + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.retrieve(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences/{parameter}"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_updateSubscriberPreference + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.preferences.update({ + subscriberId: "", + parameter: "", + updateSubscriberPreferenceRequestDto: {}, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/mark-all"]["post"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_markAllUnreadAsRead + source: |- + import { Novu } from "@novu/api"; + import { MarkAllMessageAsRequestDtoMarkAs } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.messages.markAll("", { + markAs: MarkAllMessageAsRequestDtoMarkAs.Seen, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/feeds"]["post"] + update: + x-codeSamples: + - lang: typescript + label: FeedsController_createFeed + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.feeds.create({ + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/messages"]["get"] + update: + x-codeSamples: + - lang: typescript + label: MessagesController_getMessages + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.messages.retrieve({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/events/trigger"]["post"] + update: + x-codeSamples: + - lang: typescript + label: EventsController_trigger + source: |- + import { Novu } from "@novu/api"; + import { TopicPayloadDtoType } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.trigger({ + name: "workflow_identifier", + payload: {}, + overrides: {}, + to: [ + { + topicKey: "topic_key", + type: TopicPayloadDtoType.Topic, + }, + ], + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notifications"]["get"] + update: + x-codeSamples: + - lang: typescript + label: NotificationsController_listNotifications + source: |- + import { Novu } from "@novu/api"; + import { Channels } from "@novu/api/models/operations"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.notifications.list({ + channels: [ + Channels.Chat, + ], + templates: [ + "", + ], + emails: [ + "", + ], + search: "", + subscriberIds: [ + "", + ], + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notifications/stats"]["get"] + update: + x-codeSamples: + - lang: typescript + label: NotificationsController_getActivityStats + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.notifications.stats.retrieve(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notification-groups"]["get"] + update: + x-codeSamples: + - lang: typescript + label: NotificationGroupsController_listNotificationGroups + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflowGroups.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notification-groups/{id}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: NotificationGroupsController_getNotificationGroup + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflowGroups.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notification-groups/{id}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: NotificationGroupsController_deleteNotificationGroup + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflowGroups.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notification-groups/{id}"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: NotificationGroupsController_updateNotificationGroup + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflowGroups.update("", { + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_listSubscribers + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.list(7685.78, 10); + + for await (const page of result) { + // handle page + } + } + + run(); + - target: $["paths"]["/v1/organizations/members/{memberId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_remove + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.members.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}"]["put"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_updateSubscriber + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.update("", {}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/preferences"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_listSubscriberPreferences + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.preferences.list(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/mark-as"]["post"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_markMessagesAs + source: |- + import { Novu } from "@novu/api"; + import { MarkAs } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.messages.markAllAs("", { + messageId: "", + markAs: MarkAs.Seen, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/messages/{messageId}/actions/{type}"]["post"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_markActionAsSeen + source: |- + import { Novu } from "@novu/api"; + import { MarkMessageActionAsSeenDtoStatus } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.messages.updateAsSeen({ + messageId: "", + type: "", + subscriberId: "", + markMessageActionAsSeenDto: { + status: MarkMessageActionAsSeenDtoStatus.Done, + }, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}/credentials/{providerId}/oauth/callback"]["get"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_chatOauthCallback + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.authentication.chatAccessOauthCallBack({ + subscriberId: "", + providerId: "", + code: "", + hmacHash: "", + environmentId: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/layouts"]["post"] + update: + x-codeSamples: + - lang: typescript + label: LayoutsController_PropertyDescriptor + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.layouts.create(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/layouts/{layoutId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: LayoutsController_deleteLayout + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.delete(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/subscribers"]["post"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_createSubscriber + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.create({ + subscriberId: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/messages/{messageId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: MessagesController_deleteMessage + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.messages.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/organizations/members"]["get"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_listOrganizationMembers + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.members.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/workflows/{workflowId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_deleteWorkflowById + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/events/trigger/bulk"]["post"] + update: + x-codeSamples: + - lang: typescript + label: EventsController_triggerBulk + source: |- + import { Novu } from "@novu/api"; + import { TopicPayloadDtoType } from "@novu/api/models/components"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.events.triggerBulk({ + events: [ + { + name: "workflow_identifier", + payload: {}, + overrides: {}, + to: [ + { + topicKey: "topic_key", + type: TopicPayloadDtoType.Topic, + }, + ], + }, + ], + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/events/trigger/broadcast"]["post"] + update: + x-codeSamples: + - lang: typescript + label: EventsController_broadcastEventToAll + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.events.triggerBroadcast({ + name: "", + payload: {}, + overrides: {}, + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations/active"]["get"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_getActiveIntegrations + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.listActive(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/changes/count"]["get"] + update: + x-codeSamples: + - lang: typescript + label: ChangesController_getChangesCount + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.changes.count(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/topics/{topicKey}"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_renameTopic + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.topics.rename("", { + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/organizations"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_rename + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.rename({ + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/tenants/{identifier}"]["patch"] + update: + x-codeSamples: + - lang: typescript + label: TenantController_updateTenant + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.tenants.update("", {}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/notification-groups"]["post"] + update: + x-codeSamples: + - lang: typescript + label: NotificationGroupsController_createNotificationGroup + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflowGroups.create({ + name: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations/{integrationId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_removeIntegration + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/topics"]["get"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_listTopics + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.topics.list({}); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/organizations/branding"]["put"] + update: + x-codeSamples: + - lang: typescript + label: OrganizationController_updateBrandingDetails + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.organizations.branding.update({ + logo: "", + color: "fuchsia", + fontColor: "", + contentBackground: "", + }); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/environments/api-keys"]["get"] + update: + x-codeSamples: + - lang: typescript + label: EnvironmentsController_listOrganizationApiKeys + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.environments.apiKeys.list(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/workflows/{workflowId}"]["get"] + update: + x-codeSamples: + - lang: typescript + label: WorkflowController_getWorkflowById + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.workflows.retrieve(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/subscribers/{subscriberId}"]["delete"] + update: + x-codeSamples: + - lang: typescript + label: SubscribersController_removeSubscriber + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.subscribers.delete(""); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/layouts/{layoutId}/default"]["post"] + update: + x-codeSamples: + - lang: typescript + label: LayoutsController_setDefaultLayout + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.layouts.setAsDefault(\"\");\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/topics/{topicKey}/subscribers"]["post"] + update: + x-codeSamples: + - lang: typescript + label: TopicsController_addSubscribers + source: "import { Novu } from \"@novu/api\";\n\nconst novu = new Novu({\n apiKey: \"\",\n});\n\nasync function run() {\n await novu.topics.subscribers.assign(\"\", {\n subscribers: [\n \"\",\n ],\n });\n\n \n}\n\nrun();" + - target: $["paths"]["/v1/environments/me"]["get"] + update: + x-codeSamples: + - lang: typescript + label: EnvironmentsController_getCurrentEnvironment + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.environments.retrieve(); + + // Handle the result + console.log(result) + } + + run(); + - target: $["paths"]["/v1/integrations/webhook/provider/{providerOrIntegrationId}/status"]["get"] + update: + x-codeSamples: + - lang: typescript + label: IntegrationsController_getWebhookSupportStatus + source: |- + import { Novu } from "@novu/api"; + + const novu = new Novu({ + apiKey: "", + }); + + async function run() { + const result = await novu.integrations.webhooks.retrieve(""); + + // Handle the result + console.log(result) + } + + run();