UNPKG

@novu/framework

Version:

The Code-First Notifications Workflow SDK.

1,277 lines (1,263 loc) 277 kB
import { JSONSchema, FromSchema as FromSchema$1 } from 'json-schema-to-ts'; import zod from 'zod'; type CodeResult = { code: string; }; type ClientOptions = { /** * Use Novu Cloud US (https://api.novu.co) or EU deployment (https://eu.api.novu.co). Defaults to US. */ apiUrl?: string; /** * Specify your Novu secret key, to secure the Bridge Endpoint, and Novu API communication. * Novu communicates securely with your endpoint using a signed HMAC header, * ensuring that only trusted requests from Novu are actioned by your Bridge API. * The secret key is used to sign the HMAC header. */ secretKey?: string; /** * Explicitly use HMAC signature verification. * Setting this to `false` will enable Novu to communicate with your Bridge API * without requiring a valid HMAC signature. * This is useful for local development and testing. * * In production you must specify an `secretKey` and set this to `true`. * * Defaults to true. */ strictAuthentication?: boolean; }; declare enum ChannelTypeEnum { IN_APP = "in_app", EMAIL = "email", SMS = "sms", CHAT = "chat", PUSH = "push" } interface IAttachmentOptions { mime: string; file: Buffer; name?: string; channels?: ChannelTypeEnum[]; cid?: string; disposition?: string; } interface ITriggerPayload { attachments?: IAttachmentOptions[]; [key: string]: string | string[] | boolean | number | undefined | IAttachmentOptions | IAttachmentOptions[] | Record<string, unknown>; } interface ISubscriberPayload { subscriberId: string; firstName?: string; lastName?: string; email?: string; phone?: string; avatar?: string; locale?: string; data?: Record<string, unknown>; channels?: ISubscriberChannel[]; } interface ISubscriberChannel { providerId: ChatProviderIdEnum | PushProviderIdEnum; integrationIdentifier?: string; credentials: IChannelCredentials; } interface IChannelCredentials { webhookUrl?: string; deviceTokens?: string[]; } interface ITopic { type: 'topic'; topicKey: string; } type TriggerRecipientsPayload = string | ISubscriberPayload | ITopic | ISubscriberPayload[] | ITopic[]; declare enum TriggerEventStatusEnum { ERROR = "error", NOT_ACTIVE = "trigger_not_active", NO_WORKFLOW_ACTIVE_STEPS = "no_workflow_active_steps_defined", NO_WORKFLOW_STEPS = "no_workflow_steps_defined", PROCESSED = "processed", SUBSCRIBER_MISSING = "subscriber_id_missing", TENANT_MISSING = "no_tenant_found" } declare enum ChatProviderIdEnum { Slack = "slack", Discord = "discord", MsTeams = "msteams", Mattermost = "mattermost", Ryver = "ryver", Zulip = "zulip", GrafanaOnCall = "grafana-on-call", GetStream = "getstream", RocketChat = "rocket-chat", WhatsAppBusiness = "whatsapp-business" } declare enum PushProviderIdEnum { FCM = "fcm", APNS = "apns", EXPO = "expo", OneSignal = "one-signal", Pushpad = "pushpad", PushWebhook = "push-webhook", PusherBeams = "pusher-beams" } /** * A preference for a notification delivery workflow. * * This provides a shortcut to setting all channels to the same preference. */ type WorkflowPreference$1 = { /** * A flag specifying if notification delivery is enabled for the workflow. * * If `true`, notification delivery is enabled by default for all channels. * * This setting can be overridden by the channel preferences. * * @default true */ enabled: boolean; /** * A flag specifying if the preference is read-only. * * If `true`, the preference cannot be changed by the Subscriber. * * @default false */ readOnly: boolean; }; /** A preference for a notification delivery channel. */ type ChannelPreference$1 = { /** * A flag specifying if notification delivery is enabled for the channel. * * If `true`, notification delivery is enabled. * * @default true */ enabled: boolean; }; type WorkflowPreferences$1 = { /** * A preference for the workflow. * * The values specified here will be used if no preference is specified for a channel. */ all: WorkflowPreference$1; /** * A preference for each notification delivery channel. * * If no preference is specified for a channel, the `all` preference will be used. */ channels: Record<ChannelTypeEnum, ChannelPreference$1>; }; /** * Recursively make all properties of type `T` optional. */ type DeepPartial$1<T> = T extends object ? { [P in keyof T]?: DeepPartial$1<T[P]>; } : T; /** A partial set of workflow preferences. */ type WorkflowPreferencesPartial = DeepPartial$1<WorkflowPreferences$1>; declare enum PostActionEnum { TRIGGER = "trigger", EXECUTE = "execute", PREVIEW = "preview" } declare enum GetActionEnum { DISCOVER = "discover", HEALTH_CHECK = "health-check", CODE = "code" } /** * Cron expression helper. */ declare enum CronExpression { EVERY_SECOND = "* * * * * *", EVERY_5_SECONDS = "*/5 * * * * *", EVERY_10_SECONDS = "*/10 * * * * *", EVERY_30_SECONDS = "*/30 * * * * *", EVERY_MINUTE = "*/1 * * * *", EVERY_5_MINUTES = "0 */5 * * * *", EVERY_10_MINUTES = "0 */10 * * * *", EVERY_30_MINUTES = "0 */30 * * * *", EVERY_HOUR = "0 0-23/1 * * *", EVERY_2_HOURS = "0 0-23/2 * * *", EVERY_3_HOURS = "0 0-23/3 * * *", EVERY_4_HOURS = "0 0-23/4 * * *", EVERY_5_HOURS = "0 0-23/5 * * *", EVERY_6_HOURS = "0 0-23/6 * * *", EVERY_7_HOURS = "0 0-23/7 * * *", EVERY_8_HOURS = "0 0-23/8 * * *", EVERY_9_HOURS = "0 0-23/9 * * *", EVERY_10_HOURS = "0 0-23/10 * * *", EVERY_11_HOURS = "0 0-23/11 * * *", EVERY_12_HOURS = "0 0-23/12 * * *", EVERY_DAY_AT_1AM = "0 01 * * *", EVERY_DAY_AT_2AM = "0 02 * * *", EVERY_DAY_AT_3AM = "0 03 * * *", EVERY_DAY_AT_4AM = "0 04 * * *", EVERY_DAY_AT_5AM = "0 05 * * *", EVERY_DAY_AT_6AM = "0 06 * * *", EVERY_DAY_AT_7AM = "0 07 * * *", EVERY_DAY_AT_8AM = "0 08 * * *", EVERY_DAY_AT_9AM = "0 09 * * *", EVERY_DAY_AT_10AM = "0 10 * * *", EVERY_DAY_AT_11AM = "0 11 * * *", EVERY_DAY_AT_NOON = "0 12 * * *", EVERY_DAY_AT_1PM = "0 13 * * *", EVERY_DAY_AT_2PM = "0 14 * * *", EVERY_DAY_AT_3PM = "0 15 * * *", EVERY_DAY_AT_4PM = "0 16 * * *", EVERY_DAY_AT_5PM = "0 17 * * *", EVERY_DAY_AT_6PM = "0 18 * * *", EVERY_DAY_AT_7PM = "0 19 * * *", EVERY_DAY_AT_8PM = "0 20 * * *", EVERY_DAY_AT_9PM = "0 21 * * *", EVERY_DAY_AT_10PM = "0 22 * * *", EVERY_DAY_AT_11PM = "0 23 * * *", EVERY_DAY_AT_MIDNIGHT = "0 0 * * *", EVERY_WEEK = "0 0 * * 0", EVERY_WEEKDAY = "0 0 * * 1-5", EVERY_WEEKEND = "0 0 * * 6,0", EVERY_1ST_DAY_OF_MONTH_AT_MIDNIGHT = "0 0 1 * *", EVERY_1ST_DAY_OF_MONTH_AT_NOON = "0 12 1 * *", EVERY_2ND_HOUR = "0 */2 * * *", EVERY_2ND_HOUR_FROM_1AM_THROUGH_11PM = "0 1-23/2 * * *", EVERY_2ND_MONTH = "0 0 1 */2 *", EVERY_QUARTER = "0 0 1 */3 *", EVERY_6_MONTHS = "0 0 1 */6 *", EVERY_YEAR = "0 0 1 0 *", EVERY_30_MINUTES_BETWEEN_9AM_AND_5PM = "0 */30 9-17 * * *", EVERY_30_MINUTES_BETWEEN_9AM_AND_6PM = "0 */30 9-18 * * *", EVERY_30_MINUTES_BETWEEN_10AM_AND_7PM = "0 */30 10-19 * * *", MONDAY_TO_FRIDAY_AT_1AM = "0 0 01 * * 1-5", MONDAY_TO_FRIDAY_AT_2AM = "0 0 02 * * 1-5", MONDAY_TO_FRIDAY_AT_3AM = "0 0 03 * * 1-5", MONDAY_TO_FRIDAY_AT_4AM = "0 0 04 * * 1-5", MONDAY_TO_FRIDAY_AT_5AM = "0 0 05 * * 1-5", MONDAY_TO_FRIDAY_AT_6AM = "0 0 06 * * 1-5", MONDAY_TO_FRIDAY_AT_7AM = "0 0 07 * * 1-5", MONDAY_TO_FRIDAY_AT_8AM = "0 0 08 * * 1-5", MONDAY_TO_FRIDAY_AT_9AM = "0 0 09 * * 1-5", MONDAY_TO_FRIDAY_AT_09_30AM = "0 30 09 * * 1-5", MONDAY_TO_FRIDAY_AT_10AM = "0 0 10 * * 1-5", MONDAY_TO_FRIDAY_AT_11AM = "0 0 11 * * 1-5", MONDAY_TO_FRIDAY_AT_11_30AM = "0 30 11 * * 1-5", MONDAY_TO_FRIDAY_AT_12PM = "0 0 12 * * 1-5", MONDAY_TO_FRIDAY_AT_1PM = "0 0 13 * * 1-5", MONDAY_TO_FRIDAY_AT_2PM = "0 0 14 * * 1-5", MONDAY_TO_FRIDAY_AT_3PM = "0 0 15 * * 1-5", MONDAY_TO_FRIDAY_AT_4PM = "0 0 16 * * 1-5", MONDAY_TO_FRIDAY_AT_5PM = "0 0 17 * * 1-5", MONDAY_TO_FRIDAY_AT_6PM = "0 0 18 * * 1-5", MONDAY_TO_FRIDAY_AT_7PM = "0 0 19 * * 1-5", MONDAY_TO_FRIDAY_AT_8PM = "0 0 20 * * 1-5", MONDAY_TO_FRIDAY_AT_9PM = "0 0 21 * * 1-5", MONDAY_TO_FRIDAY_AT_10PM = "0 0 22 * * 1-5", MONDAY_TO_FRIDAY_AT_11PM = "0 0 23 * * 1-5" } declare enum ChannelStepEnum { EMAIL = "email", SMS = "sms", PUSH = "push", CHAT = "chat", IN_APP = "in_app" } declare enum ActionStepEnum { DIGEST = "digest", DELAY = "delay", CUSTOM = "custom" } /** * A developer-friendly variant of ChannelTypeEnum, utilizing camelCase instead of snake_case * to use consistent casing throughout the Framework. */ declare enum WorkflowChannelEnum { EMAIL = "email", SMS = "sms", PUSH = "push", CHAT = "chat", /** Differs from ChannelTypeEnum in capitalization / snake_case */ IN_APP = "inApp" } /** * A minimal JSON schema type. * * This type is used to narrow the type of a JSON schema to a minimal type * that is compatible with the `json-schema-to-ts` library. */ type JsonSchemaMinimal = { type: 'object'; } | { anyOf: unknown[]; } | { allOf: unknown[]; } | { oneOf: unknown[]; }; /** * A JSON schema */ type JsonSchema = Exclude<JSONSchema, boolean> & JsonSchemaMinimal; /** * Infer the data type of a JsonSchema. * * @param T - The `JsonSchema` to infer the data type of. * @param Options - Configuration options for the type inference. The `validated` flag determines whether the schema has been validated. If `validated` is true, all properties are required unless specified otherwise. If false, properties with default values are optional. * * @returns The inferred type. * * @example * ```ts * const mySchema = { * type: 'object', * properties: { * name: { type: 'string' }, * email: { type: 'string' }, * }, * required: ['name'], * additionalProperties: false, * } as const satisfies JsonSchema; * * // has type { name: string, email?: string } * type MySchema = InferJsonSchema<typeof mySchema, { validated: true }>; * ``` */ type InferJsonSchema<T, Options extends { validated: boolean; }> = T extends JsonSchemaMinimal ? T extends JSONSchema ? Options['validated'] extends true ? FromSchema$1<T> : FromSchema$1<T, { keepDefaultedPropertiesOptional: true; }> : never : never; /** * A ZodSchema used to validate a JSON object. */ type ZodSchema = zod.ZodType<Record<string, unknown>, zod.ZodTypeDef, Record<string, unknown>>; /** * A minimal ZodSchema type. * * It is necessary to define a minimal ZodSchema type to enable correct inference * when Zod is not available, as Typescript doesn't support detection of module * availability via `typeof import('zod')`. */ type ZodSchemaMinimal = { readonly safeParseAsync: unknown; }; /** * Infer the data type of a ZodSchema. * * @param T - The ZodSchema to infer the data type of. * @param Options - Configuration options for the type inference. The `validated` flag determines whether the schema has been validated. If `validated` is true, all properties are required unless specified otherwise. If false, properties with default values are optional. * * @example * ```ts * const mySchema = z.object({ * name: z.string(), * email: z.string().optional(), * }); * * // has type { name: string, email?: string } * type MySchema = InferZodSchema<typeof mySchema>; * ``` */ type InferZodSchema<T, Options extends { validated: boolean; }> = T extends ZodSchemaMinimal ? T extends ZodSchema ? Options['validated'] extends true ? zod.infer<T> : zod.input<T> : never : never; /** * A schema used to validate a JSON object. */ type Schema = JsonSchemaMinimal | ZodSchemaMinimal; /** * Main utility type for schema inference * * @param T - The Schema to infer the type of. * @param Options - Configuration options for the type inference. The `validated` flag determines whether the schema has been validated. If `validated` is true, all properties are required unless specified otherwise. If false, properties with default values are optional. */ type InferSchema<T extends Schema, Options extends { validated: boolean; }> = InferJsonSchema<T, Options> | InferZodSchema<T, Options>; /** * Infer the type of a Schema for unvalidated data. * * The resulting type has default properties set to optional, * reflecting the fact that the data is unvalidated and has * not had default properties set. * * @example * ```ts * type MySchema = FromSchemaUnvalidated<typeof mySchema>; * ``` */ type FromSchemaUnvalidated<T extends Schema> = InferSchema<T, { validated: false; }>; /** * Infer the type of a Schema for validated data. * * The resulting type has default properties set to required, * reflecting the fact that the data has been validated and * default properties have been set. * * @example * ```ts * type MySchema = FromSchema<typeof mySchema>; * ``` */ type FromSchema<T extends Schema> = InferSchema<T, { validated: true; }>; declare const actionStepSchemas: { delay: { output: { readonly type: "object"; readonly properties: { readonly type: { readonly enum: readonly ["regular"]; readonly default: "regular"; }; readonly amount: { readonly type: "number"; }; readonly unit: { readonly type: "string"; readonly enum: readonly ["seconds", "minutes", "hours", "days", "weeks", "months"]; }; }; readonly required: readonly ["amount", "unit"]; readonly additionalProperties: false; }; result: { readonly type: "object"; readonly properties: { readonly duration: { readonly type: "number"; }; }; readonly required: readonly ["duration"]; readonly additionalProperties: false; }; }; digest: { output: { readonly oneOf: [{ readonly type: "object"; readonly properties: { readonly amount: { readonly type: "number"; }; readonly unit: { readonly type: "string"; readonly enum: readonly ["seconds", "minutes", "hours", "days", "weeks", "months"]; }; readonly digestKey: { readonly type: "string"; }; readonly lookBackWindow: { readonly type: "object"; readonly properties: { readonly amount: { readonly type: "number"; }; readonly unit: { readonly type: "string"; readonly enum: readonly ["seconds", "minutes", "hours", "days", "weeks", "months"]; }; }; readonly required: readonly ["amount", "unit"]; readonly additionalProperties: false; }; }; readonly required: readonly ["amount", "unit"]; readonly additionalProperties: false; }, { readonly type: "object"; readonly properties: { readonly cron: { readonly type: "string"; }; readonly digestKey: { readonly type: "string"; }; }; readonly required: readonly ["cron"]; readonly additionalProperties: false; }]; }; result: { readonly type: "object"; readonly properties: { readonly events: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly id: { readonly type: "string"; }; readonly time: { readonly type: "string"; }; readonly payload: { readonly type: "object"; }; }; readonly required: readonly ["id", "time", "payload"]; readonly additionalProperties: false; }; }; }; readonly required: readonly ["events"]; readonly additionalProperties: false; }; }; }; declare const digestRegularOutputSchema: { readonly type: "object"; readonly properties: { readonly amount: { readonly type: "number"; }; readonly unit: { readonly type: "string"; readonly enum: readonly ["seconds", "minutes", "hours", "days", "weeks", "months"]; }; readonly digestKey: { readonly type: "string"; }; readonly lookBackWindow: { readonly type: "object"; readonly properties: { readonly amount: { readonly type: "number"; }; readonly unit: { readonly type: "string"; readonly enum: readonly ["seconds", "minutes", "hours", "days", "weeks", "months"]; }; }; readonly required: readonly ["amount", "unit"]; readonly additionalProperties: false; }; }; readonly required: readonly ["amount", "unit"]; readonly additionalProperties: false; }; declare const digestTimedOutputSchema: { readonly type: "object"; readonly properties: { readonly cron: { readonly type: "string"; }; readonly digestKey: { readonly type: "string"; }; }; readonly required: readonly ["cron"]; readonly additionalProperties: false; }; declare const channelStepSchemas: { readonly chat: { output: { readonly type: "object"; readonly properties: { readonly body: { readonly type: "string"; }; }; readonly required: readonly ["body"]; readonly additionalProperties: false; }; result: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: false; }; }; readonly sms: { output: { readonly type: "object"; readonly properties: { readonly body: { readonly type: "string"; }; }; readonly required: readonly ["body"]; readonly additionalProperties: false; }; result: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: false; }; }; readonly push: { output: { readonly type: "object"; readonly properties: { readonly subject: { readonly type: "string"; }; readonly body: { readonly type: "string"; }; }; readonly required: readonly ["subject", "body"]; readonly additionalProperties: false; }; result: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: false; }; }; readonly email: { output: { readonly type: "object"; readonly properties: { readonly subject: { readonly type: "string"; }; readonly body: { readonly type: "string"; }; }; readonly required: readonly ["subject", "body"]; readonly additionalProperties: false; }; result: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: false; }; }; readonly in_app: { output: { readonly type: "object"; readonly properties: { readonly subject: { readonly type: "string"; }; readonly body: { readonly type: "string"; }; readonly avatar: { readonly type: "string"; readonly format: "uri"; }; readonly primaryAction: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; }; readonly redirect: { readonly type: "object"; readonly properties: { readonly url: { readonly type: "string"; readonly pattern: "^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$"; }; readonly target: { readonly type: "string"; readonly enum: readonly ["_self", "_blank", "_parent", "_top", "_unfencedTop"]; readonly default: "_blank"; }; }; readonly if: { readonly properties: { readonly url: { readonly type: "string"; readonly pattern: "^/"; }; }; }; readonly then: { readonly properties: { readonly target: { readonly default: "_self"; }; }; }; readonly else: { readonly properties: { readonly target: { readonly default: "_blank"; }; }; }; readonly required: readonly ["url"]; readonly additionalProperties: false; }; }; readonly required: readonly ["label"]; readonly additionalProperties: false; }; readonly secondaryAction: { readonly type: "object"; readonly properties: { readonly label: { readonly type: "string"; }; readonly redirect: { readonly type: "object"; readonly properties: { readonly url: { readonly type: "string"; readonly pattern: "^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$"; }; readonly target: { readonly type: "string"; readonly enum: readonly ["_self", "_blank", "_parent", "_top", "_unfencedTop"]; readonly default: "_blank"; }; }; readonly if: { readonly properties: { readonly url: { readonly type: "string"; readonly pattern: "^/"; }; }; }; readonly then: { readonly properties: { readonly target: { readonly default: "_self"; }; }; }; readonly else: { readonly properties: { readonly target: { readonly default: "_blank"; }; }; }; readonly required: readonly ["url"]; readonly additionalProperties: false; }; }; readonly required: readonly ["label"]; readonly additionalProperties: false; }; readonly data: { readonly type: "object"; readonly additionalProperties: true; }; readonly redirect: { readonly type: "object"; readonly properties: { readonly url: { readonly type: "string"; readonly pattern: "^(?!mailto:)(?:(https?):\\/\\/[^\\s/$.?#].[^\\s]*)|^(\\/[^\\s]*)$"; }; readonly target: { readonly type: "string"; readonly enum: readonly ["_self", "_blank", "_parent", "_top", "_unfencedTop"]; readonly default: "_blank"; }; }; readonly if: { readonly properties: { readonly url: { readonly type: "string"; readonly pattern: "^/"; }; }; }; readonly then: { readonly properties: { readonly target: { readonly default: "_self"; }; }; }; readonly else: { readonly properties: { readonly target: { readonly default: "_blank"; }; }; }; readonly required: readonly ["url"]; readonly additionalProperties: false; }; }; readonly required: readonly ["body"]; readonly additionalProperties: false; }; result: { readonly type: "object"; readonly properties: { readonly seen: { readonly type: "boolean"; }; readonly read: { readonly type: "boolean"; }; readonly lastSeenDate: { readonly type: "string"; readonly format: "date-time"; readonly nullable: true; }; readonly lastReadDate: { readonly type: "string"; readonly format: "date-time"; readonly nullable: true; }; }; readonly required: readonly ["seen", "read", "lastSeenDate", "lastReadDate"]; readonly additionalProperties: false; }; }; }; declare const providerSchemas: { readonly chat: { readonly discord: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly getstream: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'grafana-on-call': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly mattermost: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly msteams: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'rocket-chat': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly ryver: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly slack: { output: { readonly type: "object"; readonly properties: { readonly webhookUrl: { readonly type: "string"; readonly format: "uri"; }; readonly text: { readonly type: "string"; }; readonly blocks: { readonly type: "array"; readonly items: { readonly type: "object"; readonly properties: { readonly type: { readonly enum: readonly ["image", "context", "actions", "divider", "section", "input", "file", "header", "video", "rich_text"]; }; }; readonly required: readonly ["type"]; readonly additionalProperties: true; }; }; }; readonly additionalProperties: true; }; }; readonly 'whatsapp-business': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly zulip: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; }; readonly sms: { readonly 'africas-talking': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'azure-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly bandwidth: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'brevo-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'bulk-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'burst-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly clickatell: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly clicksend: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'eazy-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly firetext: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'forty-six-elks': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'generic-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly gupshup: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'infobip-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'isend-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly kannel: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly maqsam: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly messagebird: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly mobishastra: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly nexmo: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'novu-sms': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: false; }; }; readonly plivo: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'ring-central': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly sendchamp: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly simpletexting: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly sms77: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly 'sms-central': { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly sns: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly telnyx: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly termii: { output: { readonly type: "object"; readonly properties: {}; readonly required: readonly []; readonly additionalProperties: true; }; }; readonly twilio: { output: { readonly type: "object"; readonly properties: { readonly to: { readonly type: "string"; readonly pattern: "^\\+[1-9]\\d{1,14}$"; readonly description: "The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`."; }; readonly statusCallback: { readonly type: "string"; readonly format: "uri"; readonly description: "The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messagingServiceSid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). "; }; readonly applicationSid: { readonly type: "string"; readonly minLength: 34; readonly maxLength: 34; readonly pattern: "^AP[0-9a-fA-F]{32}$"; readonly description: "The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `statusCallback` URL. Note that the `statusCallback` parameter of a request takes priority over the `applicationSid` parameter; if both are included `applicationSid` is ignored."; }; readonly maxPrice: { readonly type: "number"; readonly description: "[OBSOLETE] This parameter will no longer have any effect as of 2024-06-03."; }; readonly provideFeedback: { readonly type: "boolean"; readonly description: "Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`."; }; readonly attempt: { readonly type: "integer"; readonly description: "Total number of attempts made (including this request) to send the message regardless of the provider used"; }; readonly validityPeriod: { readonly type: "integer"; readonly description: "The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validityPeriod`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validityPeriod` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html)"; }; readonly forceDelivery: { readonly type: "boolean"; readonly description: "Reserved"; }; readonly contentRetention: { readonly type: "string"; readonly enum: readonly ["retain", "discard"]; readonly description: "Determines if the message content can be stored or redacted based on privacy settings"; }; readonly addressRetention: { readonly type: "string"; readonly enum: readonly ["retain", "obfuscate"]; readonly description: "Determines if the address can be stored or obfuscated based on privacy settings"; }; readonly smartEncoded: { readonly type: "boolean"; readonly description: "Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`."; }; readonly persistentAction: { readonly type: "array"; readonly items: { readonly type: "string"; }; readonly description: "Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp)."; }; readonly shortenUrls: { readonly type: "boolean"; readonly description: "For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messagingServiceSid` parameter must also be provided."; }; readonly scheduleType: { readonly type: "string"; readonly enum: readonly ["fixed"]; readonly description: "For Messaging Services only: Include this parameter with a value of `fixed` in conjunction with the `sendAt` parameter in order to [schedule a Message](https://www.twilio.com/docs/messaging/features/message-scheduling)."; }; readonly sendAt: { readonly type: "string"; readonly format: "date-time"; readonly description: "The time that Twilio will send the message. Must be in ISO 8601 format."; }; readonly sendAsMms: { readonly type: "boolean"; readonly description: "If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media."; }; readonly contentVariables: { readonly type: "string"; readonly description: "For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `contentSid` parameter must also be provided. If values are not defined in the `contentVariables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used."; }; readonly riskCheck: { readonly type: "string"; readonly enum: readonly ["enable", "disable"]; readonly description: "Include this parameter with a value of `disable` to skip any kind of risk check on the respective message request."; }; readonly from: { readonly type: "string"; readonly pattern: "^\\+[1-9]\\d{1,14}$"; readonly description: "The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messagingServiceSid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool."; }; readonly messagingServiceSid: { readonly type: "string"; readonly minLength: 34; readonly maxLength: 34; readonly pattern: "^MG[0-9a-fA-F]{32}$"; readonly description: "The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool."; }; readonl