### TypeScript Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllerupdatesubscriberchannelrequest.md Demonstrates how to instantiate and populate the SubscribersV1ControllerUpdateSubscriberChannelRequest object in TypeScript. Ensure you have the necessary Novu API client installed. ```typescript import { SubscribersV1ControllerUpdateSubscriberChannelRequest } from "@novu/api/models/operations"; let value: SubscribersV1ControllerUpdateSubscriberChannelRequest = { subscriberId: "", updateSubscriberChannelRequestDto: { providerId: "appio", credentials: { webhookUrl: "https://example.com/webhook", channel: "general", deviceTokens: [ "token1", "token2", "token3", ], alertUid: "12345-abcde", title: "Critical Alert", imageUrl: "https://example.com/image.png", state: "resolved", externalUrl: "https://example.com/details", }, }, }; ``` -------------------------------- ### Build and Run Example Source: https://github.com/novuhq/novu-ts/blob/main/examples/README.md Builds the project and then runs a TypeScript example file using tsx. ```bash npm run build && npx tsx example.ts ``` -------------------------------- ### Install Novu TypeScript SDK Source: https://context7.com/novuhq/novu-ts/llms.txt Install the Novu TypeScript SDK using npm, pnpm, or bun. ```bash npm add @novu/api # or pnpm add @novu/api # or bun add @novu/api ``` -------------------------------- ### Get Domain Request Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/domainscontrollergetdomainrequest.md Demonstrates how to create a DomainsControllerGetDomainRequest object. Ensure the necessary import is included. ```typescript import { DomainsControllerGetDomainRequest } from "@novu/api/models/operations"; let value: DomainsControllerGetDomainRequest = { domain: "sugary-haversack.com", }; ``` -------------------------------- ### Install Novu API SDK with Bun Source: https://github.com/novuhq/novu-ts/blob/main/README.md Install the Novu API SDK using Bun. Bun is a fast JavaScript runtime and toolkit. ```bash bun add @novu/api ``` -------------------------------- ### Install Novu API SDK with NPM Source: https://github.com/novuhq/novu-ts/blob/main/README.md Install the Novu API SDK using npm. This is the primary method for Node.js projects. ```bash npm add @novu/api ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllermarkactionasseenresponse.md Demonstrates how to instantiate and populate the SubscribersV1ControllerMarkActionAsSeenResponse object in TypeScript. This example shows the structure and expected fields for a successful response. ```typescript import { SubscribersV1ControllerMarkActionAsSeenResponse } from "@novu/api/models/operations"; let value: SubscribersV1ControllerMarkActionAsSeenResponse = { headers: { "key": [], "key1": [ "", "", "", ], }, result: { environmentId: "", organizationId: "", notificationId: "", subscriberId: "", subscriber: { channels: [ { providerId: "expo", credentials: { webhookUrl: "https://example.com/webhook", channel: "general", deviceTokens: [ "token1", "token2", "token3", ], alertUid: "12345-abcde", title: "Critical Alert", imageUrl: "https://example.com/image.png", state: "resolved", externalUrl: "https://example.com/details", }, integrationId: "", }, ], subscriberId: "", organizationId: "", environmentId: "", deleted: false, createdAt: "1705073857759", updatedAt: "1735637622608", }, template: { name: "", description: "fooey tasty aching although", active: true, draft: false, preferenceSettings: { email: true, sms: false, inApp: true, chat: false, push: true, }, critical: true, tags: [ "", "", "", ], steps: [], organizationId: "", creatorId: "", environmentId: "", triggers: [ { type: "event", identifier: "", variables: [ { name: "", }, ], }, ], notificationGroupId: "", deleted: true, deletedAt: "", deletedBy: "", }, createdAt: "1720844674049", transactionId: "", channel: "email", read: false, seen: true, cta: {}, status: "warning", contextKeys: [ "tenant:org-123", "region:us-east-1", ], }, }; ``` -------------------------------- ### Install Novu API SDK with PNPM Source: https://github.com/novuhq/novu-ts/blob/main/README.md Install the Novu API SDK using pnpm. This package manager is known for its efficiency. ```bash pnpm add @novu/api ``` -------------------------------- ### Install Novu API SDK with Yarn Source: https://github.com/novuhq/novu-ts/blob/main/README.md Install the Novu API SDK using Yarn. A popular package manager for JavaScript. ```bash yarn add @novu/api ``` -------------------------------- ### BulkCreateSubscriberResponseDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/bulkcreatesubscriberresponsedto.md Demonstrates how to define and use the BulkCreateSubscriberResponseDto in TypeScript. This example shows the structure for updated, created, and failed subscriber entries. ```typescript import { BulkCreateSubscriberResponseDto } from "@novu/api/models/components"; let value: BulkCreateSubscriberResponseDto = { updated: [ { subscriberId: "", }, ], created: [ { subscriberId: "", }, ], failed: [], }; ``` -------------------------------- ### ContextsControllerUpdateContextResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/contextscontrollerupdatecontextresponse.md Example of how to instantiate and use the ContextsControllerUpdateContextResponse model. Ensure you have the necessary imports from '@novu/api/models/operations'. ```typescript import { ContextsControllerUpdateContextResponse } from "@novu/api/models/operations"; let value: ContextsControllerUpdateContextResponse = { headers: { "key": [ "", "", ], "key1": [ "", "", ], }, result: { type: "", id: "", data: { "key": "", }, createdAt: "1720585696592", updatedAt: "1735668520825", }, }; ``` -------------------------------- ### Get Subscriber Request Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscriberscontrollergetsubscriberrequest.md Demonstrates how to import and instantiate the SubscribersControllerGetSubscriberRequest. The subscriberId is a required field. ```typescript import { SubscribersControllerGetSubscriberRequest } from "@novu/api/models/operations"; let value: SubscribersControllerGetSubscriberRequest = { subscriberId: "", }; ``` -------------------------------- ### WorkflowResponseDto Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/workflowresponsedto.md Demonstrates how to instantiate and use the WorkflowResponseDto in TypeScript. Ensure the @novu/api package is installed. ```typescript import { WorkflowResponseDto } from "@novu/api/models/components"; let value: WorkflowResponseDto = { name: "", id: "", workflowId: "", slug: "", updatedAt: "1735609164075", createdAt: "1716341927646", steps: [], origin: "novu-cloud", preferences: { user: { all: { enabled: true, readOnly: false, }, channels: { "email": {}, "sms": { enabled: false, }, }, }, default: { all: { enabled: true, readOnly: false, }, channels: { "email": {}, "sms": { enabled: false, }, }, }, }, status: "ERROR", severity: "medium", }; ``` -------------------------------- ### SmsControlsMetadataResponseDto Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/smscontrolsmetadataresponsedto.md Demonstrates how to instantiate and use the SmsControlsMetadataResponseDto in TypeScript. Ensure the @novu/api package is installed. ```typescript import { SmsControlsMetadataResponseDto } from "@novu/api/models/components"; let value: SmsControlsMetadataResponseDto = { values: { skip: { "and": [ { "==": [ { "var": "payload.tier", }, "pro", ], }, { "==": [ { "var": "subscriber.data.role", }, "admin", ], }, { ">": [ { "var": "payload.amount", }, "4", ], }, ], }, }, }; ``` -------------------------------- ### DomainsControllerGetDomainAutoConfigureResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/domainscontrollergetdomainautoconfigureresponse.md Demonstrates how to create an instance of DomainsControllerGetDomainAutoConfigureResponse with sample data. Ensure you have the necessary imports from the @novu/api library. ```typescript import { DomainsControllerGetDomainAutoConfigureResponse } from "@novu/api/models/operations"; let value: DomainsControllerGetDomainAutoConfigureResponse = { headers: { "key": [ "", ], "key1": [ "", ], }, result: { available: false, manualRecords: [ { type: "MX", name: "inbound", content: "inbound-smtp.us-east-1.amazonaws.com", ttl: "Auto", priority: 10, }, ], }, }; ``` -------------------------------- ### CreateLayoutDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/createlayoutdto.md Demonstrates how to import and instantiate the CreateLayoutDto with required fields. Ensure you have the correct path for the import. ```typescript import { CreateLayoutDto } from "@novu/api/models/components"; let value: CreateLayoutDto = { layoutId: "", name: "", }; ``` -------------------------------- ### ChatControlsMetadataResponseDto Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/chatcontrolsmetadataresponsedto.md Demonstrates how to instantiate and use the ChatControlsMetadataResponseDto in TypeScript. Ensure the @novu/api package is installed. ```typescript import { ChatControlsMetadataResponseDto } from "@novu/api/models/components"; let value: ChatControlsMetadataResponseDto = { values: { skip: { "and": [ { "==": [ { "var": "payload.tier", }, "pro", ], }, { "==": [ { "var": "subscriber.data.role", }, "admin", ], }, { ">": [ { "var": "payload.amount", }, "4", ], }, ], }, }, }; ``` -------------------------------- ### PushControlsMetadataResponseDto Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/pushcontrolsmetadataresponsedto.md Demonstrates how to instantiate and use the PushControlsMetadataResponseDto in TypeScript. Ensure the @novu/api package is installed and imported. ```typescript import { PushControlsMetadataResponseDto } from "@novu/api/models/components"; let value: PushControlsMetadataResponseDto = { values: { skip: { "and": [ { "==": [ { "var": "payload.tier", }, "pro", ], }, { "==": [ { "var": "subscriber.data.role", }, "admin", ], }, { ">": [ { "var": "payload.amount", }, "4", ], }, ], }, }, }; ``` -------------------------------- ### DomainsControllerStartDomainAutoConfigureResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/domainscontrollerstartdomainautoconfigureresponse.md Demonstrates how to import and use the DomainsControllerStartDomainAutoConfigureResponse type to define a response object with headers and result details. ```typescript import { DomainsControllerStartDomainAutoConfigureResponse } from "@novu/api/models/operations"; let value: DomainsControllerStartDomainAutoConfigureResponse = { headers: { "key": [], "key1": [ "", ], "key2": [ "", "", ], }, result: { applyUrl: "https://square-whack.com/", providerName: "", redirectUri: "https://separate-stump.org", }, }; ``` -------------------------------- ### EnvironmentDiffSummaryDto Usage Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/environmentdiffsummarydto.md Demonstrates how to import and initialize an EnvironmentDiffSummaryDto object in TypeScript. Ensure the @novu/api package is installed. ```typescript import { EnvironmentDiffSummaryDto } from "@novu/api/models/components"; let value: EnvironmentDiffSummaryDto = { totalEntities: 8018.52, totalChanges: 3380.91, hasChanges: false, }; ``` -------------------------------- ### PublishEnvironmentResponseDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/publishenvironmentresponsedto.md Demonstrates how to instantiate and populate a PublishEnvironmentResponseDto object with sample data for sync results and summary. ```typescript import { PublishEnvironmentResponseDto } from "@novu/api/models/components"; let value: PublishEnvironmentResponseDto = { results: [ { resourceType: "REGULAR", successful: [], failed: [ { resourceType: "REGULAR", resourceId: "", resourceName: "", error: "", }, ], skipped: [], totalProcessed: 2749.86, }, ], summary: { resources: 3200.4, successful: 3983.21, failed: 6873.9, skipped: 1386.22, }, }; ``` -------------------------------- ### LayoutsControllerGetUsageResponse Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/layoutscontrollergetusageresponse.md Demonstrates how to import and initialize the LayoutsControllerGetUsageResponse type in TypeScript. Ensure you have the necessary Novu API types installed. ```typescript import { LayoutsControllerGetUsageResponse } from "@novu/api/models/operations"; let value: LayoutsControllerGetUsageResponse = { headers: { "key": [], }, result: { workflows: [], }, }; ``` -------------------------------- ### Initialize Configurations Object Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/configurations.md Demonstrates how to import and initialize an empty Configurations object in TypeScript. ```typescript import { Configurations } from "@novu/api/models/components"; let value: Configurations = {}; ``` -------------------------------- ### Friday Schedule Model Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/friday.md Example of how to define a Friday schedule object. Ensure the 'isEnabled' field is set and provide an array of 'hours' with 'start' and 'end' times. ```typescript import { Friday } from "@novu/api/models/components"; let value: Friday = { isEnabled: true, hours: [ { start: "09:00 AM", end: "05:00 PM", }, ], }; ``` -------------------------------- ### TypeScript Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllerupdatesubscriberonlineflagrequest.md Demonstrates how to instantiate and use the SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest in TypeScript. Ensure you have the necessary Novu API models imported. ```typescript import { SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest } from "@novu/api/models/operations"; let value: SubscribersV1ControllerUpdateSubscriberOnlineFlagRequest = { subscriberId: "", updateSubscriberOnlineFlagRequestDto: { isOnline: false, }, }; ``` -------------------------------- ### Define SMS Step Control Values Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/smsstepresponsedtocontrolvalues.md Example of how to define control values for an SMS step, including conditions to skip the step based on payload or subscriber data. Ensure the @novu/api package is installed. ```typescript import { SmsStepResponseDtoControlValues } from "@novu/api/models/components"; let value: SmsStepResponseDtoControlValues = { skip: { "and": [ { "==": [ { "var": "payload.tier", }, "pro", ], }, { "==": [ { "var": "subscriber.data.role", }, "admin", ], }, { ">": [ { "var": "payload.amount", }, "4", ], }, ], }, }; ``` -------------------------------- ### StartDomainAutoConfigure Source: https://github.com/novuhq/novu-ts/blob/main/docs/sdks/autoconfigure/README.md Initiates the auto-configuration process for a domain. This operation returns a promise that resolves with the configuration response or rejects with an error. ```APIDOC ## StartDomainAutoConfigure ### Description Initiates the auto-configuration process for a domain. ### Response - **Promise** - Resolves with the domain auto-configuration response. ### Errors - **errors.ErrorDto** (414) - Represents a generic error with a specific status code. - **errors.ErrorDto** (400, 401, 403, 404, 405, 409, 413, 415) - Represents common client-side errors. - **errors.ValidationErrorDto** (422) - Indicates validation errors in the request. - **errors.ErrorDto** (500) - Represents a server-side error. - **errors.SDKError** (4XX, 5XX) - Catches any other client or server errors. ``` -------------------------------- ### Example DeleteTopicSubscriptionsRequestDto Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/deletetopicsubscriptionsrequestdto.md Provides an example of the DeleteTopicSubscriptionsRequestDto structure, demonstrating how to specify subscriptions for deletion. It includes examples with both 'identifier' and 'subscriberId', and with 'subscriberId' only. ```json [ { "identifier": "subscriber-123-subscription-a", "subscriberId": "subscriber-123" }, { "subscriberId": "subscriber-456" }, { "identifier": "subscriber-789-subscription-b" } ] ``` -------------------------------- ### SubscribersControllerUnsnoozeNotificationResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscriberscontrollerunsnoozenotificationresponse.md An example of how to use the SubscribersControllerUnsnoozeNotificationResponse in TypeScript. ```APIDOC ## SubscribersControllerUnsnoozeNotificationResponse ### Description Represents the response object when a subscriber's notification is unsnoozed. ### Fields #### `headers` - **Type**: `Record` - **Required**: Yes - **Description**: Contains headers associated with the response. #### `result` - **Type**: `components.InboxNotificationDto` - **Required**: Yes - **Description**: The details of the notification that was unsnoozed. ### Example Usage ```typescript import { SubscribersControllerUnsnoozeNotificationResponse } from "@novu/api/models/operations"; let value: SubscribersControllerUnsnoozeNotificationResponse = { headers: { "key": [ "", ], "key1": [], "key2": [ "", "", "", ], }, result: { id: "", transactionId: "", body: "", to: { id: "", subscriberId: "", }, isRead: false, isSeen: true, isArchived: false, isSnoozed: false, createdAt: "1717643813197", channelType: "email", severity: "low", }, }; ``` ``` -------------------------------- ### Create Environment Response Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/environmentscontrollerv1createenvironmentresponse.md Demonstrates how to instantiate and use the EnvironmentsControllerV1CreateEnvironmentResponse model in TypeScript. This is useful for understanding the structure of a successful environment creation response. ```typescript import { EnvironmentsControllerV1CreateEnvironmentResponse } from "@novu/api/models/operations"; let value: EnvironmentsControllerV1CreateEnvironmentResponse = { headers: {}, result: { id: "60d5ecb8b3b3a30015f3e1a1", name: "Production Environment", organizationId: "60d5ecb8b3b3a30015f3e1a2", identifier: "prod-env-01", type: "prod", apiKeys: [ { key: "sk_test_1234567890abcdef", userId: "60d5ecb8b3b3a30015f3e1a4", hash: "hash_value_here", }, ], parentId: "60d5ecb8b3b3a30015f3e1a3", slug: "production", }, }; ``` -------------------------------- ### Instantiate DiffSummaryDto Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/diffsummarydto.md Demonstrates how to import and create an instance of DiffSummaryDto with sample values. Ensure the @novu/api library is installed. ```typescript import { DiffSummaryDto } from "@novu/api/models/components"; let value: DiffSummaryDto = { added: 5209.41, modified: 3810.49, deleted: 6091.68, unchanged: 1970.68, }; ``` -------------------------------- ### EventsControllerTriggerResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/eventscontrollertriggerresponse.md An example of how to use the EventsControllerTriggerResponse in TypeScript. ```APIDOC ## EventsControllerTriggerResponse ### Description Represents the response received after triggering an event. ### Fields #### `headers` - **Type**: `Record` - **Required**: Yes - **Description**: Contains headers returned with the event trigger response. #### `result` - **Type**: `TriggerEventResponseDto` (See [components.TriggerEventResponseDto](../../models/components/triggereventresponsedto.md)) - **Required**: Yes - **Description**: The result of the event trigger operation, indicating success and status. ### Example Usage ```typescript import { EventsControllerTriggerResponse } from "@novu/api/models/operations"; let value: EventsControllerTriggerResponse = { headers: { "key": [ "", ], "key1": [ "", ], "key2": [ "", ], }, result: { acknowledged: true, status: "no_workflow_steps_defined", }, }; ``` ``` -------------------------------- ### DomainsControllerListDomainsResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/domainscontrollerlistdomainsresponse.md An example of how to use the DomainsControllerListDomainsResponse in TypeScript. ```APIDOC ## DomainsControllerListDomainsResponse ### Description Represents the response structure for listing domains. ### Fields #### `headers` - **Type**: `Record` - **Required**: Yes - **Description**: Headers associated with the domain list response. #### `result` - **Type**: `ListDomainsResponseDto` (refer to `components/listdomainsresponsedto.md`) - **Required**: Yes - **Description**: The main data payload containing the list of domains and pagination information. ### Example Usage ```typescript import { DomainsControllerListDomainsResponse } from "@novu/api/models/operations"; let value: DomainsControllerListDomainsResponse = { headers: { "key": [ "", "", "", ], "key1": [ "", "", ], "key2": [], }, result: { data: [ { id: "", name: "", status: "pending", mxRecordConfigured: false, environmentId: "", organizationId: "", createdAt: "1728012190537", updatedAt: "1735613859020", expectedDnsRecords: [ { type: "MX", name: "inbound", content: "inbound-smtp.us-east-1.amazonaws.com", ttl: "Auto", priority: 10, }, ], }, ], next: "", previous: "", totalCount: 388.82, totalCountCapped: true, }, }; ``` ``` -------------------------------- ### Create Channel Connection Response Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/channelconnectionscontrollercreatechannelconnectionresponse.md Demonstrates how to create an instance of ChannelConnectionsControllerCreateChannelConnectionResponse with sample data for headers and result fields. ```typescript import { ChannelConnectionsControllerCreateChannelConnectionResponse } from "@novu/api/models/operations"; let value: ChannelConnectionsControllerCreateChannelConnectionResponse = { headers: { "key": [ "", "", "", ], "key1": [ "", ], "key2": [ "", ], }, result: { identifier: "", channel: "in_app", providerId: "slack", integrationIdentifier: "slack-prod", subscriberId: "subscriber-123", contextKeys: [ "tenant:org-123", "region:us-east-1", ], workspace: { id: "T123456", name: "Acme HQ", }, auth: { accessToken: "Workspace access token", }, createdAt: "1725328375497", updatedAt: "1735640461995", }, }; ``` -------------------------------- ### ChannelConnectionsControllerUpdateChannelConnectionResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/channelconnectionscontrollerupdatechannelconnectionresponse.md An example of the ChannelConnectionsControllerUpdateChannelConnectionResponse object in TypeScript. ```APIDOC ## ChannelConnectionsControllerUpdateChannelConnectionResponse ### Description Represents the response structure for updating a channel connection. ### Fields #### `headers` (Record) - Required #### `result` (components.GetChannelConnectionResponseDto) - Required ### Example Usage ```typescript import { ChannelConnectionsControllerUpdateChannelConnectionResponse } from "@novu/api/models/operations"; let value: ChannelConnectionsControllerUpdateChannelConnectionResponse = { headers: { "key": [ "", "", "", ], "key1": [ "", "", "", ], "key2": [ "", "", ], }, result: { identifier: "", channel: "in_app", providerId: "slack", integrationIdentifier: "slack-prod", subscriberId: "subscriber-123", contextKeys: [ "tenant:org-123", "region:us-east-1", ], workspace: { id: "T123456", name: "Acme HQ", }, auth: { accessToken: "Workspace access token", }, createdAt: "1725328375497", updatedAt: "1735640461995", }, }; ``` ``` -------------------------------- ### CreateChannelConnectionRequestDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/createchannelconnectionrequestdto.md Demonstrates how to instantiate and populate the CreateChannelConnectionRequestDto with necessary details for creating a channel connection. ```typescript import { CreateChannelConnectionRequestDto } from "@novu/api/models/components"; let value: CreateChannelConnectionRequestDto = { identifier: "slack-prod-user123-abc4", subscriberId: "subscriber-123", context: { "key": "org-acme", }, connectionMode: "shared", integrationIdentifier: "slack-prod", workspace: { id: "T123456", name: "Acme HQ", }, auth: { accessToken: "Workspace access token", }, }; ``` -------------------------------- ### WorkflowControllerGetWorkflowStepDataRequest Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/workflowcontrollergetworkflowstepdatarequest.md An example of how to instantiate and use the WorkflowControllerGetWorkflowStepDataRequest in TypeScript. ```APIDOC ## WorkflowControllerGetWorkflowStepDataRequest ### Description Represents the request object for fetching data related to a specific workflow step. ### Fields #### Required Fields - **workflowId** (string) - The ID of the workflow. - **stepId** (string) - The ID of the workflow step. #### Optional Fields - **idempotencyKey** (string) - A header for idempotency purposes. ``` -------------------------------- ### ChannelSettingsDto Example Usage Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/channelsettingsdto.md Demonstrates how to instantiate and populate a ChannelSettingsDto object with provider-specific credentials. ```typescript import { ChannelSettingsDto } from "@novu/api/models/components"; let value: ChannelSettingsDto = { providerId: "whatsapp-business", credentials: { webhookUrl: "https://example.com/webhook", channel: "general", deviceTokens: [ "token1", "token2", "token3", ], alertUid: "12345-abcde", title: "Critical Alert", imageUrl: "https://example.com/image.png", state: "resolved", externalUrl: "https://example.com/details", }, integrationId: "", }; ``` -------------------------------- ### ChatStepResponseDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/chatstepresponsedto.md Demonstrates how to instantiate and populate a ChatStepResponseDto object with control logic, variables, and step details. ```typescript import { ChatStepResponseDto } from "@novu/api/models/components"; let value: ChatStepResponseDto = { controls: { values: { skip: { "and": [ { "==": [ { "var": "payload.tier", }, "pro", ], }, { "==": [ { "var": "subscriber.data.role", }, "admin", ], }, { ">": [ { "var": "payload.amount", }, "4", ], }, ], }, }, }, controlValues: { skip: { "and": [ { "==": [ { "var": "payload.tier", }, "pro", ], }, { "==": [ { "var": "subscriber.data.role", }, "admin", ], }, { ">": [ { "var": "payload.amount", }, "4", ], }, ], }, }, variables: { "key": "", "key1": "", "key2": "", }, stepId: "", id: "", name: "", slug: "", type: "chat", origin: "novu-cloud", workflowId: "", workflowDatabaseId: "", }; ``` -------------------------------- ### TopicsControllerCreateTopicSubscriptionsResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/topicscontrollercreatetopicsubscriptionsresponse.md An example of how to use the TopicsControllerCreateTopicSubscriptionsResponse type in TypeScript. ```APIDOC ## TopicsControllerCreateTopicSubscriptionsResponse ### Description Represents the response structure for creating topic subscriptions. ### Fields #### `headers` - **Type**: `Record` - **Required**: Yes - **Description**: N/A #### `result` - **Type**: `components.CreateSubscriptionsResponseDto` - **Required**: Yes - **Description**: N/A ### Example Usage ```typescript import { TopicsControllerCreateTopicSubscriptionsResponse } from "@novu/api/models/operations"; let value: TopicsControllerCreateTopicSubscriptionsResponse = { headers: {}, result: { data: [ { id: "64f5e95d3d7946d80d0cb679", identifier: "tk=product-updates:si=subscriber-123", name: "My Subscription", topic: { id: "64f5e95d3d7946d80d0cb677", key: "product-updates", name: "Product Updates", }, subscriber: { id: "64da692e9a94fb2e6449ad07", subscriberId: "user-123", avatar: "https://example.com/avatar.png", firstName: "John", lastName: "Doe", email: "john@example.com", }, preferences: [ { subscriptionId: "64f5e95d3d7946d80d0cb679", workflow: { id: "64a1b2c3d4e5f6g7h8i9j0k1", identifier: "welcome-email", name: "Welcome Email Workflow", critical: false, tags: [ "user-onboarding", "email", ], data: {}, severity: "none", }, enabled: true, condition: { "and": [ { "===": [ { "var": "tier", }, "premium", ], }, ], }, }, ], contextKeys: [ "tenant:org-a", "project:proj-123", ], createdAt: "2025-04-24T05:40:21Z", updatedAt: "2025-04-24T05:40:21Z", }, ], meta: { totalCount: 3, successful: 2, failed: 1, }, errors: [ { subscriberId: "invalid-subscriber-id", code: "SUBSCRIBER_NOT_FOUND", message: "Subscriber with ID invalid-subscriber-id could not be found", }, ], }, }; ``` ``` -------------------------------- ### TopicsControllerUpdateTopicRequest Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/topicscontrollerupdatetopicrequest.md An example of how to construct a TopicsControllerUpdateTopicRequest object in TypeScript. ```APIDOC ## TopicsControllerUpdateTopicRequest ### Description Represents the request object for updating a topic. ### Fields #### `topicKey` (string) - Required The key identifier of the topic. #### `idempotencyKey` (string) - Optional A header for idempotency purposes. #### `updateTopicRequestDto` (object) - Required An object containing the fields to update for the topic. ##### `name` (string) - Optional The new name for the topic. ``` -------------------------------- ### LayoutResponseDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/layoutresponsedto.md Demonstrates how to instantiate a LayoutResponseDto object with sample data. Ensure the correct import path is used. ```typescript import { LayoutResponseDto } from "@novu/api/models/components"; let value: LayoutResponseDto = { id: "", layoutId: "", slug: "", name: "", isDefault: true, isTranslationEnabled: false, updatedAt: "1735616454094", createdAt: "1711314093106", origin: "novu-cloud", type: "ECHO", controls: { values: {}, }, }; ``` -------------------------------- ### SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllerupdatesubscriberonlineflagresponse.md An example of how to use the SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse object in TypeScript. ```APIDOC ## SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse ### Description Represents the response structure for updating a subscriber's online flag. ### Fields #### `headers` - **Type**: `Record` - **Required**: Yes - **Description**: N/A #### `result` - **Type**: `components.SubscriberResponseDto` - **Required**: Yes - **Description**: N/A ### Example Usage ```typescript import { SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse } from "@novu/api/models/operations"; let value: SubscribersV1ControllerUpdateSubscriberOnlineFlagResponse = { headers: {}, result: { channels: [ { providerId: "expo", credentials: { webhookUrl: "https://example.com/webhook", channel: "general", deviceTokens: [ "token1", "token2", "token3", ], alertUid: "12345-abcde", title: "Critical Alert", imageUrl: "https://example.com/image.png", state: "resolved", externalUrl: "https://example.com/details", }, integrationId: "", }, ], subscriberId: "", organizationId: "", environmentId: "", deleted: false, createdAt: "1725943596323", updatedAt: "1735661089926", }, }; ``` ``` -------------------------------- ### SDK Initialization Source: https://context7.com/novuhq/novu-ts/llms.txt Initialize the Novu client with your secret key and optional server or retry configuration. ```APIDOC ## SDK Initialization Initialize the `Novu` client with your secret key and optional server/retry configuration. ```typescript import { Novu } from "@novu/api"; // Basic initialization const novu = new Novu({ secretKey: "YOUR_SECRET_KEY_HERE", }); // EU region const novuEU = new Novu({ serverIdx: 1, // 0 = https://api.novu.co, 1 = https://eu.api.novu.co secretKey: "YOUR_SECRET_KEY_HERE", }); // Custom server URL const novuCustom = new Novu({ serverURL: "https://eu.api.novu.co", secretKey: "YOUR_SECRET_KEY_HERE", }); // With global retry configuration const novuWithRetry = new Novu({ retryConfig: { strategy: "backoff", backoff: { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 300000, }, retryConnectionErrors: true, }, secretKey: "YOUR_SECRET_KEY_HERE", }); ``` ``` -------------------------------- ### Create Domain DTO Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/createdomaindto.md Demonstrates how to import and instantiate the CreateDomainDto with a required domain name. ```typescript import { CreateDomainDto } from "@novu/api/models/components"; let value: CreateDomainDto = { name: "", }; ``` -------------------------------- ### TopicsControllerDeleteTopicResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/topicscontrollerdeletetopicresponse.md An example of how to use the TopicsControllerDeleteTopicResponse type in TypeScript. ```APIDOC ## TopicsControllerDeleteTopicResponse ### Description Represents the response structure for deleting a topic. ### Fields #### headers - **Type**: `Record` - **Required**: Yes - **Description**: Headers associated with the response. #### result - **Type**: `components.DeleteTopicResponseDto` - **Required**: Yes - **Description**: The result of the delete topic operation. ``` -------------------------------- ### SubscribersV1ControllerModifySubscriberChannelResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllermodifysubscriberchannelresponse.md An example demonstrating how to use the SubscribersV1ControllerModifySubscriberChannelResponse in TypeScript. ```APIDOC ## SubscribersV1ControllerModifySubscriberChannelResponse ### Description Represents the response structure when modifying a subscriber's channel. ### Fields #### `headers` (Record) - Required An object containing headers. #### `result` (components.SubscriberResponseDto) - Required An object containing the result of the operation, typically subscriber details. ### Example Usage ```typescript import { SubscribersV1ControllerModifySubscriberChannelResponse } from "@novu/api/models/operations"; let value: SubscribersV1ControllerModifySubscriberChannelResponse = { headers: { "key": [ "", "", "", ], "key1": [ "", ], }, result: { channels: [ { providerId: "expo", credentials: { webhookUrl: "https://example.com/webhook", channel: "general", deviceTokens: [ "token1", "token2", "token3", ], alertUid: "12345-abcde", title: "Critical Alert", imageUrl: "https://example.com/image.png", state: "resolved", externalUrl: "https://example.com/details", }, integrationId: "", }, ], subscriberId: "", organizationId: "", environmentId: "", deleted: false, createdAt: "1725943596323", updatedAt: "1735661089926", }, }; ``` ``` -------------------------------- ### Initialize TlsOptions Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/tlsoptions.md Demonstrates how to import and initialize an empty TlsOptions object. ```typescript import { TlsOptions } from "@novu/api/models/components"; let value: TlsOptions = {}; ``` -------------------------------- ### SubscribersV1ControllerMarkActionAsSeenResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllermarkactionasseenresponse.md An example of how to use the SubscribersV1ControllerMarkActionAsSeenResponse object in TypeScript. ```APIDOC ## SubscribersV1ControllerMarkActionAsSeenResponse ### Description This is the response object returned when an action for a subscriber is marked as seen. ### Fields #### `headers` (Record) - Required #### `result` (components.MessageResponseDto) - Required ### Example Usage ```typescript import { SubscribersV1ControllerMarkActionAsSeenResponse } from "@novu/api/models/operations"; let value: SubscribersV1ControllerMarkActionAsSeenResponse = { headers: { "key": [], "key1": [ "", "", "", ], }, result: { environmentId: "", organizationId: "", notificationId: "", subscriberId: "", subscriber: { channels: [ { providerId: "expo", credentials: { webhookUrl: "https://example.com/webhook", channel: "general", deviceTokens: [ "token1", "token2", "token3", ], alertUid: "12345-abcde", title: "Critical Alert", imageUrl: "https://example.com/image.png", state: "resolved", externalUrl: "https://example.com/details", }, integrationId: "", }, ], subscriberId: "", organizationId: "", environmentId: "", deleted: false, createdAt: "1705073857759", updatedAt: "1735637622608", }, template: { name: "", description: "fooey tasty aching although", active: true, draft: false, preferenceSettings: { email: true, sms: false, inApp: true, chat: false, push: true, }, critical: true, tags: [ "", "", "", ], steps: [], organizationId: "", creatorId: "", environmentId: "", triggers: [ { type: "event", identifier: "", variables: [ { name: "", }, ], }, ], notificationGroupId: "", deleted: true, deletedAt: "", deletedBy: "", }, createdAt: "1720844674049", transactionId: "", channel: "email", read: false, seen: true, cta: {}, status: "warning", contextKeys: [ "tenant:org-123", "region:us-east-1", ], }, }; ``` ``` -------------------------------- ### SubscribersV1ControllerGetNotificationsFeedResponse Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/operations/subscribersv1controllergetnotificationsfeedresponse.md An example of how to use the SubscribersV1ControllerGetNotificationsFeedResponse model in TypeScript. ```APIDOC ## SubscribersV1ControllerGetNotificationsFeedResponse ### Description Represents the response structure for retrieving a subscriber's notification feed. ### Fields #### `headers` - **Type**: `Record` - **Required**: Yes - **Description**: N/A #### `result` - **Type**: `components.FeedResponseDto` - **Required**: Yes - **Description**: N/A ### Example Usage ```typescript import { SubscribersV1ControllerGetNotificationsFeedResponse } from "@novu/api/models/operations"; let value: SubscribersV1ControllerGetNotificationsFeedResponse = { headers: { "key": [ "", "", ], "key1": [ "", "", ], }, result: { totalCount: 5, hasMore: true, data: [ { id: "615c1f2f9b0c5b001f8e4e3b", templateId: "template_12345", environmentId: "env_67890", messageTemplateId: "message_template_54321", organizationId: "org_98765", notificationId: "notification_123456", subscriberId: "subscriber_112233", feedId: "feed_445566", jobId: "job_778899", createdAt: new Date("2024-12-10T10:10:59.639Z"), updatedAt: new Date("2024-12-10T10:10:59.639Z"), actor: { data: null, type: "system_icon", }, transactionId: "transaction_123456", templateIdentifier: "template_abcdef", providerId: "provider_xyz", content: "This is a test notification content.", subject: "Test Notification Subject", channel: "chat", read: false, seen: true, archived: false, deviceTokens: [ "token1", "token2", ], cta: {}, status: "sent", payload: { "key": "value", }, data: { "key": "value", }, overrides: { "overrideKey": "overrideValue", }, tags: [ "tag1", "tag2", ], }, ], pageSize: 2, page: 1, }, }; ``` ``` -------------------------------- ### SubscriptionsDeleteErrorDto Example Source: https://github.com/novuhq/novu-ts/blob/main/docs/models/components/subscriptionsdeleteerrordto.md Demonstrates how to instantiate and use the SubscriptionsDeleteErrorDto. ```typescript import { SubscriptionsDeleteErrorDto } from "@novu/api/models/components"; let value: SubscriptionsDeleteErrorDto = { subscriberId: "invalid-subscriber-id", code: "SUBSCRIBER_NOT_FOUND", message: "Subscriber with ID invalid-subscriber-id could not be found", }; ```