import { RpcMethod } from './commonTypes'; import { AiBuilderDocument as pushwoosh_aibuilder_v1_AiBuilderDocument } from './pushwoosh_aibuilder_v1'; export type AccountsService_GetEmailStatisticCount = RpcMethod; export type AccountsService_GetActiveDevicesCount = RpcMethod; export type AccountsService_GetSubscribersCount = RpcMethod; export type AccountsService_GetActiveUsersCount = RpcMethod; export type AccountsService_SetDebugMode = RpcMethod; export type AccountsService_GetDebugMode = RpcMethod; export type AccountsService_GetOnboardingInfo = RpcMethod; export type AccountsService_UpdateOnboardingInfo = RpcMethod; export type AccountsService_GetTotalEmailSubscribersCount = RpcMethod; export type AccountsService_GetUnifiedMAUCount = RpcMethod; export type AccountsService_GetAccount = RpcMethod; export type AccountsService_UpdateAccount = RpcMethod; export type AccountsService_GetBillingInfo = RpcMethod; export type AccountsService_UpdateBillingInfo = RpcMethod; export type AccountsService_ListChild = RpcMethod; export type AccountsService_GetAuthHistory = RpcMethod; export interface AccountsService { /** Returns the current account's email send counters and quotas (daily, monthly, billing-month sends plus paid/free quota and limit). Use for billing/usage views; pass a date range only to also get the count for that window. */ GetEmailStatisticCount: AccountsService_GetEmailStatisticCount; /** Returns monthly active device counts for the account (rolling-month, calendar-month and previous-month). Use for device-based MAU/billing views; pass a date range to also get the count for that window. */ GetActiveDevicesCount: AccountsService_GetActiveDevicesCount; /** Returns the account's push subscriber counts split into push-enabled and push-disabled, optionally restricted to given platform IDs. Use to see how many devices can receive push. */ GetSubscribersCount: AccountsService_GetSubscribersCount; /** Returns monthly active user counts for the account (rolling-month, calendar-month and previous-month). Use for user-based MAU/billing views; pass a date range to also get the count for that window. */ GetActiveUsersCount: AccountsService_GetActiveUsersCount; /** Turns the account's API debug mode on or off; enabling grants a one-hour window, disabling clears it. Requires the account to allow debug mode and the user to manage API access. Use get_account_debug_mode to read the current state. */ SetDebugMode: AccountsService_SetDebugMode; /** Returns whether the account's API debug mode is currently enabled and its expiry time. Use before set_account_debug_mode to check state. */ GetDebugMode: AccountsService_GetDebugMode; /** Returns the account's onboarding state: whether onboarding is active, whether to show the survey, and whether the account has a subscription and at least one application. Use to render the onboarding flow. */ GetOnboardingInfo: AccountsService_GetOnboardingInfo; /** Marks an onboarding step complete or records the chosen plan/survey answers for the account, recalculating whether onboarding stays active. Use to advance the onboarding flow one step at a time. */ UpdateOnboardingInfo: AccountsService_UpdateOnboardingInfo; /** Returns the total number of email subscribers across the account. Use for account-wide email audience size; differs from get_account_email_statistics which reports send counts and quotas. */ GetTotalEmailSubscribersCount: AccountsService_GetTotalEmailSubscribersCount; /** Returns the account's unified monthly active users (combined across channels) and the email-only MAU. Use for cross-channel billing/usage; without a valid date range it defaults to the calendar month. */ GetUnifiedMAUCount: AccountsService_GetUnifiedMAUCount; /** Returns the current account's profile (its name). Use to read the account name shown in the console. */ GetAccount: AccountsService_GetAccount; /** Updates the current account's name. Use to rename the account; the name must be non-empty. */ UpdateAccount: AccountsService_UpdateAccount; /** Returns the account's billing address (contact name, company, tax numbers, country, emails). Use to read the invoicing details shown on the billing page. */ GetBillingInfo: AccountsService_GetBillingInfo; /** Creates or overwrites the account's billing address; only the fields present in the request are changed (validates emails and name lengths). Use to save invoicing details. */ UpdateBillingInfo: AccountsService_UpdateBillingInfo; /** Lists the sub-accounts (child accounts) under the current account, paged and sortable, with optional name substring search. Use to browse a managed/parent account's children. */ ListChild: AccountsService_ListChild; /** Returns the account's login attempt history (email, success/failure, IP, timestamp), paged and sortable, with optional email substring search. Use to audit sign-in activity for the account's users. */ GetAuthHistory: AccountsService_GetAuthHistory; } export type GetEmailStatisticCountRequest = { /** only for billing usage, optional */ dateFrom?: Date; dateTo?: Date; }; export type GetEmailStatisticCountResponse = { dailyEmailStat: number; monthlyEmailStat: number; lastEmailStat: number; paidEmailQuota: number; freeEmailQuota: number; freeEmailLimit: number; billingMonthEmailSendsStat: number; /** calculates only if date in request given */ requestDateEmailStat: number; }; export type GetActiveDevicesCountRequest = { /** only for billing usage, optional */ dateFrom?: Date; dateTo?: Date; }; export type GetActiveDevicesCountResponse = { monthlyActiveDevices: number; calendarMonthlyActiveDevices: number; previousMonthActiveDevices: number; /** calculates only if date in request given */ requestDateActiveDevices: number; }; export type GetSubscribersCountRequest = { /** optional platform IDs to restrict the count to; empty = all platforms */ platforms?: number[]; }; export type GetSubscribersCountResponse = { pushEnabled: number; pushDisabled: number; }; export type GetActiveUsersCountRequest = { /** only for billing usage, optional */ dateFrom?: Date; dateTo?: Date; }; export type GetActiveUsersCountResponse = { monthlyActiveUsers: number; calendarMonthlyActiveUsers: number; previousMonthActiveUsers: number; /** calculates only if date in request given */ requestDateActiveUsers: number; }; export type SetDebugModeRequest = { /** true turns debug mode on for one hour; false turns it off */ enabled?: boolean; }; export type SetDebugModeResponse = { enabled: boolean; expireAt: Date; }; export type GetDebugModeRequest = {}; export type GetDebugModeResponse = { enabled: boolean; expireAt: Date; }; export type GetOnboardingInfoRequest = {}; export type GetOnboardingInfoResponse = { isActive: boolean; showSurvey: boolean; hasActiveSubscription: boolean; hasApplication: boolean; }; export type UpdateOnboardingInfoRequest_answer_list = { answers: string[]; }; export type UpdateOnboardingInfoRequest = { /** chosen plan name: free, developer, marketing or custom */ plan?: string; /** onboarding step to complete: IsActive, WelcomeScreen, PaywallPlan, GetStarted or ShowSurvey */ step?: string; /** map[string][]string. survey questions->answers map */ survey?: Record; }; export type UpdateOnboardingInfoResponse = {}; export type GetTotalEmailSubscribersCountRequest = {}; export type GetTotalEmailSubscribersCountResponse = { totalEmailSubscribers: number; }; export type GetUnifiedMAUCountRequest = { /** if date range is not valid or empty - calendar month is the default date range */ dateFrom?: Date; dateTo?: Date; }; export type GetUnifiedMAUCountResponse = { totalUnifiedMau: number; emailsMau: number; }; export type BillingAddress = { firstName: string; lastName: string; phone: string; companyName: string; companyNumber: string; industry: string; department: string; country: string; street: string; zipCode: string; paymentEmail: string; vatNumber: string; countryCode: string; state: string; stateCode: string; secondaryPersonFirstName: string; secondaryPersonLastName: string; secondaryPersonEmail: string; additionalEmails: string[]; city: string; accountCompanyName: string; }; export type Account = { name: string; }; export type GetAccountRequest = {}; export type GetAccountResponse = { account: Account; }; export type UpdateAccountRequest = { account?: Account; }; export type UpdateAccountResponse = { account: Account; }; export type BillingInfo = { firstName: string; lastName: string; phone: string; companyName: string; companyNumber: string; industry: string; department: string; country: string; street: string; zipCode: string; paymentEmail: string; vatNumber: string; countryCode: string; state: string; stateCode: string; secondaryPersonFirstName: string; secondaryPersonLastName: string; secondaryPersonEmail: string; additionalEmails: string[]; city: string; }; export type GetBillingInfoRequest = {}; export type GetBillingInfoResponse = { billingInfo: BillingInfo; }; export type UpdateBillingInfoRequest = { billingInfo?: BillingInfo; }; export type UpdateBillingInfoResponse = { billingInfo: BillingInfo; }; export type ListChildRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED'; export type ListChildRequest_OrderDirection = 'ASC' | 'DESC'; export type ListChildRequest = { orderBy?: ListChildRequest_OrderBy; orderDirection?: ListChildRequest_OrderDirection; page?: number; perPage?: number; /** like %name% */ searchByName?: string; }; export type ListChildResponse_ChildAccount = { code: string; name: string; }; export type ListChildResponse = { accounts: ListChildResponse_ChildAccount[]; page: number; perPage: number; total: number; }; export type GetAuthHistoryRequest_OrderBy = 'DATE'; export type GetAuthHistoryRequest_OrderDirection = 'DESC' | 'ASC'; export type GetAuthHistoryRequest = { orderBy?: GetAuthHistoryRequest_OrderBy; orderDirection?: GetAuthHistoryRequest_OrderDirection; page?: number; perPage?: number; /** like '%email%' */ searchByEmail?: string; }; export type GetAuthHistoryResponse_AuthRecord_AuthStatus = 'SUCCESS' | 'FAILED'; export type GetAuthHistoryResponse_AuthRecord = { email: string; status: GetAuthHistoryResponse_AuthRecord_AuthStatus; ip: string; date: Date; }; export type GetAuthHistoryResponse = { records: GetAuthHistoryResponse_AuthRecord[]; page: number; perPage: number; total: number; }; export type EmailTemplatesService_Create = RpcMethod; export type EmailTemplatesService_Get = RpcMethod; export type EmailTemplatesService_List = RpcMethod; export type EmailTemplatesService_ListLegacyTemplates = RpcMethod; export type EmailTemplatesService_Update = RpcMethod; export type EmailTemplatesService_Delete = RpcMethod; export type EmailTemplatesService_GetEmailTemplateLabels = RpcMethod; export type EmailTemplatesService_Test = RpcMethod; export type EmailTemplatesService_Migrate = RpcMethod; export type EmailTemplatesService_Clone = RpcMethod; export interface EmailTemplatesService { /** Creates a new email template (editor content plus a connected email preset) in an application. Use to author a reusable email; returns the generated template code. */ Create: EmailTemplatesService_Create; /** Returns a single email template by its template code, including sender info, per-locale subjects and the full editor content. Use after list_email_templates to inspect one template's content. Pass include_html false when you only need the structure — it drops the rendered html, which is more than half the response. */ Get: EmailTemplatesService_Get; /** Lists an application's email templates (metadata only, no content) with paging, ordering and filtering by name, label or category. Use to browse templates or find a template code before fetching or editing one. */ List: EmailTemplatesService_List; /** Lists the account's legacy email templates that are not yet connected to a preset in the given application. Use to find legacy templates that can be adopted into an application via connect_legacy_email_template. */ ListLegacyTemplates: EmailTemplatesService_ListLegacyTemplates; /** Updates an existing email template by code, overwriting its name, label, categories, sender info, subjects and editor content. Use to edit a template; supplied fields replace the stored ones. */ Update: EmailTemplatesService_Update; /** Deletes an email template and its connected preset by code, removing the stored content files. Fails if the template is used in a journey; unlike update_email_template this cannot be undone. */ Delete: EmailTemplatesService_Delete; /** Returns the distinct label strings used across an application's email templates. Use to populate a label filter for list_email_templates. */ GetEmailTemplateLabels: EmailTemplatesService_GetEmailTemplateLabels; /** Sends a real test email of a template to one email address, rendering it with optional dynamic-content placeholders. If the app has no configured email platform the address must be a registered test device. Use to preview delivery before broadcasting. */ Test: EmailTemplatesService_Test; /** Connects a legacy email template to an application by creating an email preset for it, so it becomes editable and sendable there. Returns the existing preset code if one already links the template. Use after list_legacy_email_templates to adopt a legacy template. */ Migrate: EmailTemplatesService_Migrate; /** Clones an email template (its content and preset) into a destination application, optionally under a new name. Use to duplicate a template within or across applications; returns the new preset code. */ Clone: EmailTemplatesService_Clone; } export type CloneEmailPresetsRequest = { emailPresetCode?: string; application?: string; name?: string; }; export type CloneEmailPresetsResponse = { emailPresetCode: string; }; export type UpdateEmailTemplateRequest = { code?: string; name?: string; content?: EmailContent; label?: string; categories?: string[]; previewSettings?: object; }; export type UpdateEmailTemplateResponse = { emailTemplate: EmailTemplate; }; export type EmailTemplate = { name: string; content: EmailContent; label: string; code: string; created: Date; updated: Date; categories: string[]; previewSettings: object; }; export type TestEmailTemplateRequest = { application?: string; code?: string; email?: string; dynamicContent?: object; }; export type TestEmailTemplateResponse = {}; export type CreateEmailTemplateRequest = { application?: string; name?: string; content?: EmailContent; label?: string; categories?: string[]; previewSettings?: object; /** System templates are feature internals (e.g. synced-block fragments): hidden from List/labels, still reachable by code. */ system?: boolean; }; export type CreateEmailTemplateResponse = { emailTemplate: EmailTemplate; }; export type EmailContent_SenderInfo_Address = { email: string; name: string; }; export type EmailContent_SenderInfo = { from: EmailContent_SenderInfo_Address; replyTo: EmailContent_SenderInfo_Address; }; export type EmailContent_Unlayer = { /** Raw html */ html: string; /** Localization map {"en": {"variable":"value"}...} */ localizationData: object; /** Unlayer specific config */ editorConfig: object; }; export type EmailContent_Pushwoosh = { /** Raw html */ html: string; /** Localization map {"en": {"variable":"value"}...} */ localizationData: object; }; export type EmailContent_Raw = { /** html map {"en": "html_content"...} */ html: Record; }; export type EmailContent_Smartcards = { /** * Deprecated: ignored on write. The server renders the html from the document * and stores what it rendered; sent values are dropped. Still returned on read. */ html: string; /** Deprecated: ignored on write, derived from the document with the html. */ localizationData: object; /** * The document in the editor dialect (camelCase, tagged oneofs) — what * clients wrote before `document` existed. Accepted on write while stored * templates still hold it; prefer `document`. */ content: object; /** * The document, typed. Same shape the renderer takes, so nothing converts * it on the way in — set this and leave `content` empty. */ document: pushwoosh_aibuilder_v1_AiBuilderDocument; }; export type EmailContent_kind_unlayer = { type: 'unlayer'; data: EmailContent_Unlayer; }; export type EmailContent_kind_pushwoosh = { type: 'pushwoosh'; data: EmailContent_Pushwoosh; }; export type EmailContent_kind_raw = { type: 'raw'; data: EmailContent_Raw; }; export type EmailContent_kind_smartcards = { type: 'smartcards'; data: EmailContent_Smartcards; }; export type EmailContent_kind = EmailContent_kind_unlayer | EmailContent_kind_pushwoosh | EmailContent_kind_raw | EmailContent_kind_smartcards; export type EmailContent = { senderInfo: EmailContent_SenderInfo; /** subject map {"en": "subject_content"...} */ subject: Record; kind: EmailContent_kind; }; export type GetEmailTemplateRequest = { code?: string; /** * Whether to return the rendered html alongside the editor content. Unset means true, so * existing clients are unaffected; set false to skip it — the html is over half the payload * and the editor content already describes the template. */ includeHtml?: boolean; }; export type GetEmailTemplateResponse = { emailTemplate: EmailTemplate; }; export type ListEmailTemplatesRequest_OrderBy = 'NAME' | 'CREATED' | 'UPDATED'; export type ListEmailTemplatesRequest_OrderDirection = 'ASC' | 'DESC'; export type ListEmailTemplatesRequest = { application?: string; orderBy?: ListEmailTemplatesRequest_OrderBy; orderDirection?: ListEmailTemplatesRequest_OrderDirection; page?: number; perPage?: number; /** like %name% */ searchByName?: string; /** like %label% */ searchByLabel?: string; /** uses eq for label search */ strictSearchByLabel?: boolean; /** in ['category'] */ searchByCategory?: string[]; }; export type ListEmailTemplatesResponse = { emailTemplates: EmailTemplate[]; page: number; perPage: number; total: number; }; export type ListLegacyTemplatesRequest = { application?: string; }; export type ListLegacyTemplatesResponse_EmailTemplate = { code: string; name: string; languages: string[]; }; export type ListLegacyTemplatesResponse = { emailTemplates: ListLegacyTemplatesResponse_EmailTemplate[]; }; export type DeleteEmailTemplateRequest = { code?: string; }; export type DeleteEmailTemplateResponse = {}; export type GetEmailTemplateLabelsRequest = { application?: string; }; export type GetEmailTemplateLabelsResponse = { labels: string[]; }; export type MigrateRequest_SenderInfo_Address = { email: string; name: string; }; export type MigrateRequest_SenderInfo = { from: MigrateRequest_SenderInfo_Address; replyTo: MigrateRequest_SenderInfo_Address; }; export type MigrateRequest = { code?: string; application?: string; /** subject map {"en": "subject_content"...} */ subject?: Record; senderInfo?: MigrateRequest_SenderInfo; categories?: string[]; previewSettings?: object; }; export type MigrateResponse = { code: string; }; export type RebakeEmailTemplatesRequest = { /** Template codes to process; empty walks every smartcards template on the share. */ codes: string[]; /** Report what would change and write nothing. */ dryRun: boolean; /** Templates per call. 0 = 100, capped at 500 — a render is a network call. */ limit: number; /** Resume point: only codes strictly greater than this are considered. */ afterCode: string; }; export type RebakeEmailTemplatesResponse = { scanned: number; /** Templates rewritten. A dry run writes nothing and counts into would_change. */ changed: number; failed: number; /** Last code considered; pass it as after_code to continue the walk. */ lastCode: string; /** Candidates left after this page. */ remaining: number; /** Only the templates that changed or failed; unchanged ones are counted, not listed. */ results: RebakeEmailTemplateResult[]; /** Templates a dry run would have rewritten. */ wouldChange: number; }; export type RebakeEmailTemplateResult = { code: string; /** changed | would_change | failed */ status: string; error: string; htmlBytesBefore: number; htmlBytesAfter: number; };