import { RpcMethod } from './commonTypes'; export type CloudPagesService_List = RpcMethod; export type CloudPagesService_Get = RpcMethod; export type CloudPagesService_Create = RpcMethod; export type CloudPagesService_Update = RpcMethod; export type CloudPagesService_Delete = RpcMethod; export type CloudPagesService_GetConfig = RpcMethod; export interface CloudPagesService { /** Lists Cloud Pages (hosted landing/subscription pages) for an application, newest-first by default, with paging, name/code search and a category filter. Use to browse pages or find a page code before get/update/delete. */ List: CloudPagesService_List; /** Returns a single Cloud Page by its page code, including HTML content, slug, redirect URL, categories and editor JSON. Use after list_cloud_pages to inspect one page. */ Get: CloudPagesService_Get; /** Creates a new Cloud Page under an application from name, content, slug and categories, returning the generated page code. Use to add a hosted page; update_cloud_page edits an existing one. */ Create: CloudPagesService_Create; /** Overwrites an existing Cloud Page (by page code) with new name, content, slug, redirect URL, categories and existing-user behavior. Use to edit a page; create_cloud_page adds a new one. */ Update: CloudPagesService_Update; /** Permanently deletes a Cloud Page by page code and detaches it from its categories. Cannot be undone; a second call for the same code returns not-found. */ Delete: CloudPagesService_Delete; /** Returns Cloud Pages configuration for an application: whether custom slugs are allowed and the slug domain. Use before create/update to know if a slug can be set. */ GetConfig: CloudPagesService_GetConfig; } export type ListCloudPagesRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED'; export type ListCloudPagesRequest_OrderDirection = 'ASC' | 'DESC'; export type ListCloudPagesRequest = { /** Application code (XXXXX-XXXXX) whose Cloud Pages to list. */ application?: string; orderBy?: ListCloudPagesRequest_OrderBy; orderDirection?: ListCloudPagesRequest_OrderDirection; page?: number; perPage?: number; /** Free-text filter matched against both page name and page code (case-insensitive substring). */ searchByName?: string; /** Keep only pages that belong to any of these categories. */ searchByCategory?: string[]; }; export type ExistingUserBehavior = 'UPDATE' | 'SKIP' | 'ERROR'; export type CloudPage = { name: string; code: string; categories: string[]; slug: string; content: string; redirectUrl: string; pushwooshJson: string; created: Date; updated: Date; existingUserBehavior: ExistingUserBehavior; }; export type ListCloudPagesResponse = { presets: CloudPage[]; page: number; perPage: number; total: number; }; export type GetCloudPageRequest = { /** Cloud Page code identifying the page to fetch. */ code?: string; }; export type GetCloudPageResponse = { preset: CloudPage; }; export type CreateCloudPageRequest = { /** Application code (XXXXX-XXXXX) the new page belongs to. */ application?: string; name?: string; categories?: string[]; /** Custom URL slug; applied only when slugs are allowed for the application (see get_cloud_page_config). */ slug?: string; /** Rendered HTML content of the page. */ content?: string; /** URL to redirect to instead of rendering content. */ redirectUrl?: string; /** Editor state JSON used to rebuild the page in the visual editor. */ pushwooshJson?: string; /** How to treat a submission from a user who already exists: UPDATE, SKIP or ERROR. */ existingUserBehavior?: ExistingUserBehavior; }; export type CreateCloudPageResponse = { preset: CloudPage; }; export type UpdateCloudPageRequest = { /** Cloud Page code identifying the page to overwrite. */ code?: string; name?: string; categories?: string[]; /** Custom URL slug; applied only when slugs are allowed for the application (see get_cloud_page_config). */ slug?: string; /** Rendered HTML content of the page. */ content?: string; /** URL to redirect to instead of rendering content. */ redirectUrl?: string; /** Editor state JSON used to rebuild the page in the visual editor. */ pushwooshJson?: string; /** How to treat a submission from a user who already exists: UPDATE, SKIP or ERROR. */ existingUserBehavior?: ExistingUserBehavior; }; export type UpdateCloudPageResponse = { preset: CloudPage; }; export type DeleteCloudPageRequest = { /** Cloud Page code identifying the page to delete. */ code?: string; }; export type DeleteCloudPageResponse = {}; export type GetCloudPageConfigRequest = { /** Application code (XXXXX-XXXXX) whose Cloud Pages configuration to fetch. */ application?: string; }; export type GetCloudPageConfigResponse = { slugAllowed: boolean; slugDomain: string; };