import { RpcMethod } from './commonTypes'; import { ApplicationPlatformsInfo_PlatformInfo as pushwoosh_rpc_v2_applications_info_ApplicationPlatformsInfo_PlatformInfo } from './applications_info'; export type ApplicationsService_Get = RpcMethod; export type ApplicationsService_Create = RpcMethod; export type ApplicationsService_Update = RpcMethod; export type ApplicationsService_List = RpcMethod; export type ApplicationsService_Delete = RpcMethod; export type ApplicationsService_SetShortenerConfiguration = RpcMethod; export type ApplicationsService_ShortenURL = RpcMethod; export type ApplicationsService_UpdateURLParams = RpcMethod; export type ApplicationsService_SendEmailVerification = RpcMethod; export type ApplicationsService_GetAccountGroupPermissions = RpcMethod; export type ApplicationsService_SaveAccountGroupPermissions = RpcMethod; export type ApplicationsService_GetControlGroupSettings = RpcMethod; export type ApplicationsService_UpdateControlGroupPercentage = RpcMethod; export type ApplicationsService_DisableControlGroup = RpcMethod; export type ApplicationsService_ForceUpdateControlGroupCalculation = RpcMethod; export type ApplicationsService_GetControlGroupCalculationStatus = RpcMethod; export type ApplicationsService_GetControlGroupAnalytics = RpcMethod; export type ApplicationsService_GetDOIConfig = RpcMethod; export type ApplicationsService_SetDOIConfig = RpcMethod; export interface ApplicationsService { /** Returns one Pushwoosh application by its code (format XXXXX-XXXXX) with platforms, subscriber counts, languages and permissions. Use to inspect a single app; use list_applications to browse many. */ Get: ApplicationsService_Get; /** Creates a new Pushwoosh application from a title and optional icon, seeding default properties, dashboards, events and frequency capping. Use to add an app to the current account; returns the new application code. */ Create: ApplicationsService_Create; /** Updates a Pushwoosh application (title, icon, website URL, daily-stat opt-in or Bitly shortener token) by code. Use to change app settings; a supplied bitly_configuration is validated against Bitly before saving. */ Update: ApplicationsService_Update; /** Lists the current account's applications (code, title, subscriber counts) with paging, ordering and free-text search. Use to browse apps or find an application code before calling get_application. */ List: ApplicationsService_List; /** Permanently deletes a Pushwoosh application by code, finishing its customer journeys and queuing a background purge of its data. Irreversible; system applications cannot be deleted. */ Delete: ApplicationsService_Delete; /** Stores the Bitly access token used to shorten links for an application, validating the token against Bitly before saving. Use to enable Bitly URL shortening for the app. */ SetShortenerConfiguration: ApplicationsService_SetShortenerConfiguration; /** Shortens a single URL for an application via the Pushwoosh link shortener, returning the original URL when the short link would not be shorter. Use to pre-shorten a link for message content. */ ShortenURL: ApplicationsService_ShortenURL; /** Overwrites the email URL query parameters (UTM-style map) stored for an application. Use to set tracking params appended to email links; sending an empty map clears them. */ UpdateURLParams: ApplicationsService_UpdateURLParams; /** Opens a Zendesk support ticket requesting manual verification to enable the email platform for an application. Use when an account must be approved by support before sending email; posts to Zendesk, not to the end user. */ SendEmailVerification: ApplicationsService_SendEmailVerification; /** Returns each account group's See/Modify/Send rights on an application (format XXXXX-XXXXX). Use to review which account groups can access an app before editing with set_application_account_group_permissions. */ GetAccountGroupPermissions: ApplicationsService_GetAccountGroupPermissions; /** Overwrites the See/Modify/Send rights that account groups have on an application, rebuilding each group's ACE rights. Use to grant or revoke group access to an app; returns the resulting permissions. */ SaveAccountGroupPermissions: ApplicationsService_SaveAccountGroupPermissions; /** Returns the global control-group settings for an application: hold-out percentage, enabled flag, total vs control user counts and calculation status. Use to display control-group config; get_control_group_calculation_status polls just the changing counts. */ GetControlGroupSettings: ApplicationsService_GetControlGroupSettings; /** Sets the global control-group hold-out percentage (1-99) for an application and records who changed it, creating the PW_ControlGroup tag if missing. Use to enable or resize the control group. */ UpdateControlGroupPercentage: ApplicationsService_UpdateControlGroupPercentage; /** Disables the global control group for an application, removing its percentage setting and queuing a background job to strip the PW_ControlGroup tag from all devices. Use to turn the hold-out group off. */ DisableControlGroup: ApplicationsService_DisableControlGroup; /** Kicks off a fresh recalculation of control-group and total user counts for an application, leaving the previously cached numbers in place until it finishes. Use to refresh stale size numbers on demand. */ ForceUpdateControlGroupCalculation: ApplicationsService_ForceUpdateControlGroupCalculation; /** Returns just the control-group counts and calculation status that change while a background size calc runs, for an application. Poll this on a timer instead of re-fetching get_control_group_settings. */ GetControlGroupCalculationStatus: ApplicationsService_GetControlGroupCalculationStatus; /** Returns precomputed control-vs-treatment analytics (conversions, uplift, statistical significance) per event for an application over a 3/7/30-day window. Use to measure the incremental impact of messaging. */ GetControlGroupAnalytics: ApplicationsService_GetControlGroupAnalytics; /** Returns the double opt-in (DOI) configuration for an application: whether DOI is enabled and the confirmation email preset code. Use to check DOI status before toggling with set_doi_config. */ GetDOIConfig: ApplicationsService_GetDOIConfig; /** Enables or disables double opt-in (DOI) for an application; enabling for the first time clones the confirmation email preset into the account. Use to require email confirmation before subscribing. */ SetDOIConfig: ApplicationsService_SetDOIConfig; } export type ControlGroupTaskStatus = 'CONTROL_GROUP_TASK_STATUS_UNSPECIFIED' | 'CONTROL_GROUP_TASK_STATUS_NOT_STARTED' | 'CONTROL_GROUP_TASK_STATUS_IN_PROGRESS' | 'CONTROL_GROUP_TASK_STATUS_COMPLETED'; export type ApplicationPlatformSubscribersCount = { pushEnabled: number; pushDisabled: number; }; export type ApplicationPermissions = { canSee: boolean; canModify: boolean; canDelete: boolean; canSendMessages: boolean; }; export type Application = { code: string; title: string; iconUrl: string; isDemo: boolean; platforms: Record; subscribers: Record; languages: Record; permissions: ApplicationPermissions; properties: Record; counters: Record; allowDailyStat: boolean; }; export type ApplicationSummary = { code: string; title: string; iconUrl: string; isDemo: boolean; subscribers: Record; platforms: Record; }; export type GetApplicationRequest = { /** Application code (format XXXXX-XXXXX) to fetch. */ code?: string; }; export type GetApplicationResponse = { application: Application; }; export type CreateApplicationRequest = { /** Display name for the new application. */ title?: string; /** Optional icon image bytes (PNG/JPEG). */ icon?: string; }; export type CreateApplicationResponse = { application: Application; }; export type UpdateApplicationRequest_BitlyConfiguration = { /** Bitly API access token. */ accessToken: string; }; export type UpdateApplicationRequest = { /** Application code (format XXXXX-XXXXX) to update. */ code?: string; /** New display name; leave empty to keep the current title. */ title?: string; /** New icon image bytes (PNG/JPEG); omit to keep the current icon. */ icon?: string; /** Application website URL; must start with http:// or https://. */ websiteUrl?: string; /** Whether this user receives the daily statistics email for the app. */ allowDailyStat?: boolean; /** Bitly link-shortener credentials; token is validated against Bitly before saving. */ bitlyConfiguration?: UpdateApplicationRequest_BitlyConfiguration; }; export type UpdateApplicationResponse = { application: Application; }; export type ListApplicationsRequest_OrderBy = 'TITLE' | 'SUBSCRIBERS'; export type ListApplicationsRequest_OrderDirection = 'ASC' | 'DESC'; export type ListApplicationsRequest = { orderBy?: ListApplicationsRequest_OrderBy; orderDirection?: ListApplicationsRequest_OrderDirection; page?: number; perPage?: number; /** Free-text search over application title. */ search?: string; }; export type ListApplicationsResponse = { applications: ApplicationSummary[]; page: number; perPage: number; total: number; }; export type DeleteApplicationRequest = { /** Application code (format XXXXX-XXXXX) to permanently delete. */ code?: string; }; export type DeleteApplicationResponse = {}; export type SetShortenerConfigurationRequest = { /** Application code (format XXXXX-XXXXX) to configure. */ code?: string; /** Bitly API access token to validate and store. */ bitlyAccessToken?: string; }; export type SetShortenerConfigurationResponse = {}; export type ShortenURLRequest = { /** Application code (format XXXXX-XXXXX) the link belongs to. */ code?: string; /** Absolute URL (http:// or https://) to shorten. */ url?: string; }; export type ShortenURLResponse = { shortUrl: string; }; export type UpdateURLParamsRequest = { /** Application code (format XXXXX-XXXXX) to configure. */ code?: string; /** Email URL query parameters (key/value) to store; an empty map clears them. */ params?: Record; }; export type UpdateURLParamsResponse = {}; export type SendEmailVerificationRequest = { /** Application code (format XXXXX-XXXXX) requesting email enablement. */ code?: string; /** Website URL the emails will be sent on behalf of. */ website?: string; /** Contact email address for the verification request. */ email?: string; /** Free-text description of the intended email use case. */ description?: string; }; export type SendEmailVerificationResponse = {}; export type AccountGroupPermissions = { groupName: string; /** ace rights */ see: boolean; modify: boolean; send: boolean; }; export type GetAccountGroupPermissionsRequest = { /** application code */ code?: string; }; export type GetAccountGroupPermissionsResponse = { permissions: AccountGroupPermissions[]; }; export type SaveAccountGroupPermissionsRequest = { /** application code */ code?: string; /** Full set of per-group See/Modify/Send rights to apply (replaces existing). */ permissions?: AccountGroupPermissions[]; }; export type SaveAccountGroupPermissionsResponse = { permissions: AccountGroupPermissions[]; }; export type GetControlGroupSettingsRequest = { /** Application code (format XXXXX-XXXXX) whose control-group settings to fetch. */ code?: string; }; export type GetControlGroupSettingsResponse = { percentage: number; enabled: boolean; /** All users in the application */ totalUsers: number; /** Users with PW_ControlGroup = true */ controlGroupUsers: number; calculationStatus: ControlGroupTaskStatus; /** Last time control group settings were modified */ lastModifiedAt: Date; /** Email of user who last modified settings */ lastModifiedBy: string; /** Whether cached size numbers are available (false => never calculated yet) */ hasData: boolean; }; export type UpdateControlGroupPercentageRequest = { /** Application code (format XXXXX-XXXXX) to configure. */ code?: string; /** Control-group hold-out size as a percentage, 1-99. */ percentage?: number; }; export type UpdateControlGroupPercentageResponse = {}; export type DisableControlGroupRequest = { /** Application code (format XXXXX-XXXXX) whose control group to disable. */ code?: string; }; export type DisableControlGroupResponse = {}; export type ForceUpdateControlGroupCalculationRequest = { /** Application code (format XXXXX-XXXXX) to recalculate control-group size for. */ code?: string; }; export type ForceUpdateControlGroupCalculationResponse = {}; export type GetControlGroupCalculationStatusRequest = { /** Application code (format XXXXX-XXXXX) to poll calculation status for. */ code?: string; }; /** * GetControlGroupCalculationStatusResponse is the lightweight subset of the * settings response that changes while a background size calculation runs. * Clients poll this on a timer to refresh numbers in place without re-fetching * the whole settings page. */ export type GetControlGroupCalculationStatusResponse = { /** All users in the application */ totalUsers: number; /** Users with PW_ControlGroup = true */ controlGroupUsers: number; calculationStatus: ControlGroupTaskStatus; /** Whether cached size numbers are available */ hasData: boolean; }; export type ShuffleControlGroupRequest = { code: string; }; export type ShuffleControlGroupResponse = {}; export type GetControlGroupAnalyticsRequest_WindowDays = 'WINDOW_DAYS_UNSPECIFIED' | 'WINDOW_DAYS_3' | 'WINDOW_DAYS_7' | 'WINDOW_DAYS_30'; /** * GetControlGroupAnalyticsRequest asks for the precomputed Control-vs-Treatment * analytics for a window preset (3/7/30 days). */ export type GetControlGroupAnalyticsRequest = { /** Application code (format XXXXX-XXXXX) to report on. */ code?: string; /** Analytics lookback window preset (3, 7 or 30 days). */ windowDays?: GetControlGroupAnalyticsRequest_WindowDays; }; export type ControlGroupAnalyticsGroup = { users: number; conversions: number; conversionRate: number; eventsPerUser: number; }; export type ControlGroupAnalyticsEvent_Significance = 'SIGNIFICANCE_UNSPECIFIED' | 'SIGNIFICANCE_NOT_ENOUGH_DATA' | 'SIGNIFICANCE_NOT_SIGNIFICANT' | 'SIGNIFICANCE_SIGNIFICANT'; export type ControlGroupAnalyticsEvent = { event: string; treatment: ControlGroupAnalyticsGroup; control: ControlGroupAnalyticsGroup; upliftPct: number; incrementalEvents: number; percentOfTreatment: number; zScore: number; pValue: number; confidencePct: number; significance: ControlGroupAnalyticsEvent_Significance; }; export type GetControlGroupAnalyticsResponse = { events: ControlGroupAnalyticsEvent[]; }; export type DoubleOptInConfig = { enabled: boolean; emailPreset: string; }; export type GetDOIConfigRequest = { /** Application code (format XXXXX-XXXXX) whose double opt-in config to fetch. */ code?: string; }; export type GetDOIConfigResponse = { doiConfig: DoubleOptInConfig; }; export type SetDOIConfigRequest = { /** Application code (format XXXXX-XXXXX) to configure. */ code?: string; /** Whether double opt-in is enabled for the application. */ enabled?: boolean; }; export type SetDOIConfigResponse = {};