import { RpcMethod } from './commonTypes'; export type smsPresetsService_List = RpcMethod; export type smsPresetsService_Get = RpcMethod; export type smsPresetsService_Create = RpcMethod; export type smsPresetsService_Update = RpcMethod; export type smsPresetsService_Delete = RpcMethod; export interface smsPresetsService { /** Lists SMS presets (reusable SMS message templates) for an application, with paging, ordering and optional name/category filters. Use to browse presets or find an SMS preset code before fetching, updating or deleting one. */ List: smsPresetsService_List; /** Returns a single SMS preset by its preset code, including name, categories, per-locale content and the per-locale MMS part (subject and attachments). Use after list_sms_presets to inspect one template. */ Get: smsPresetsService_Get; /** Creates a new SMS preset (reusable SMS template) in an application from a name, categories, per-locale content and an optional per-locale MMS part, returning the generated preset code. Additive — each call creates a distinct preset. */ Create: smsPresetsService_Create; /** Updates an existing SMS preset identified by its preset code, overwriting name, categories, per-locale content and the per-locale MMS part. Use to edit a template found via list_sms_presets. */ Update: smsPresetsService_Update; /** Permanently deletes an SMS preset by its preset code. Fails if the preset is used by a running or paused journey; deletion cannot be undone. */ Delete: smsPresetsService_Delete; } export type ListSmsPresetsRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED'; export type ListSmsPresetsRequest_OrderDirection = 'ASC' | 'DESC'; export type ListSmsPresetsRequest = { /** Application code (XXXXX-XXXXX) whose SMS presets to list. */ application?: string; orderBy?: ListSmsPresetsRequest_OrderBy; orderDirection?: ListSmsPresetsRequest_OrderDirection; page?: number; perPage?: number; /** Free-text filter matched (case-insensitive substring) against preset name and code. */ searchByName?: string; /** Keep only presets tagged with one of these category names. */ searchByCategory?: string[]; }; /** * MMS part of one locale. Attachments are public https urls (jpg/jpeg/png/gif, at most 3) — * the provider downloads them itself, so links behind auth or without an extension are rejected. */ export type SmsPresetMms = { /** Shown above the attachments; 40 ASCII or 13 non-ASCII characters max. */ subject: string; fileUrls: string[]; /** Index of the attachment the body is shown after. */ messageAt: number; }; export type SmsProductsSource_Rule = { /** Catalog category to pick from; empty = any category. */ category: string; /** One of: newest, price_asc, price_desc, title. */ sort: string; /** How many products the message carries, and the feed limit. */ items: number; /** * How the feed RANKS the products, in the feed's own vocabulary (hence not an enum); * `sort` stays the fallback order an unknown value degrades to. */ strategy: string; /** Device tag holding the anchor product id of "also_bought"; empty = unset. */ anchorTag: string; }; /** * One hand-picked product row, frozen as the editor saw it. The fields are exactly * the tokens an item template can spend; catalog_id backs the panel's Refresh. */ export type SmsProductsSource_Picked = { catalogId: string; title: string; price: string; category: string; url: string; }; /** * Catalog-driven body: the rule that picks products and the per-locale parts wrapped * around them. Absent means the body was written by hand. */ export type SmsProductsSource = { rule: SmsProductsSource_Rule; /** * Repeated per product; localized_content holds the assembled body, so the authored * intro travels in `intro` rather than there. */ itemTemplate: Record; /** Follows the list, sent once. */ outro: Record; /** Sent when the feed returns nothing, and only when fallback_mode asks for it. */ fallbackText: Record; /** Inserted between products, e.g. ", " — must stay inside GSM-7 to keep the segment size. */ separator: string; /** Caps the product title in characters; 0 = no cap. */ trimTitle: number; /** One of: skip (do not send to this recipient), text (send fallback_text). */ fallbackMode: string; /** Opens the message, sent once, before the product list. */ intro: Record; /** * Where the rows come from: "manual" reads `picked`, anything else (including "") * reads `rule`, which is what presets written before hand-picking existed carry. */ mode: string; /** The hand-picked rows. A send fetches nothing for them, so the segment count is exact. */ picked: SmsProductsSource_Picked[]; }; export type SmsPreset = { name: string; code: string; categories: string[]; /** content map {"en": "content"...} */ localizedContent: Record; created: Date; updated: Date; /** mms map {"en": {...}...}; locales absent here are sent as plain SMS */ localizedMms: Record; /** Set when localized_content was assembled from a catalog rule. */ productsSource: SmsProductsSource; }; export type ListSmsPresetsResponse = { presets: SmsPreset[]; page: number; perPage: number; total: number; }; export type GetSmsPresetRequest = { /** SMS preset code identifying the preset to fetch. */ code?: string; }; export type GetSmsPresetResponse = { preset: SmsPreset; }; export type CreateSmsPresetRequest = { /** Application code (XXXXX-XXXXX) the new preset belongs to. */ application?: string; name?: string; categories?: string[]; /** content map {"en": "content"...} */ localizedContent?: Record; /** mms map {"en": {...}...}; omit for a plain SMS preset */ localizedMms?: Record; /** * Recipe localized_content was assembled from; omit it, or send it with rule.items = 0, * for a hand-written body. */ productsSource?: SmsProductsSource; }; export type CreateSmsPresetResponse = { preset: SmsPreset; }; export type UpdateSmsPresetRequest = { /** SMS preset code identifying the preset to update. */ code?: string; name?: string; categories?: string[]; /** content map {"en": "content"...} */ localizedContent?: Record; /** mms map {"en": {...}...}; omitted leaves the stored MMS untouched, an empty map drops it */ localizedMms?: Record; /** * Recipe localized_content was assembled from. Omitted leaves the stored recipe untouched; * send it with rule.items = 0 to drop it. Independent of localized_mms: each field replaces * only its own part of the preset's properties. */ productsSource?: SmsProductsSource; }; export type UpdateSmsPresetResponse = { preset: SmsPreset; }; export type DeleteSmsPresetRequest = { /** SMS preset code identifying the preset to delete. */ code?: string; }; export type DeleteSmsPresetResponse = {};