import { RpcMethod } from './commonTypes'; export type TestDevicesService_Create = RpcMethod; export type TestDevicesService_Verify = RpcMethod; export type TestDevicesService_List = RpcMethod; export type TestDevicesService_Delete = RpcMethod; export type TestDevicesService_GetAutoRegistration = RpcMethod; export type TestDevicesService_SetAutoRegistration = RpcMethod; export interface TestDevicesService { /** Registers a test device for an application by push token or HWID; for email, SMS, WhatsApp and LINE platforms it instead sends a verification code to the device and returns needs_verify=true, requiring verify_test_device to finish. Use to add a device that receives test sends. */ Create: TestDevicesService_Create; /** Confirms a pending email, SMS, WhatsApp or LINE test device using the verification code sent by create_test_device, then creates the test device record. Use only after create_test_device returned needs_verify=true. */ Verify: TestDevicesService_Verify; /** Lists all test devices registered for an application (application code XXXXX-XXXXX) with name, push token, HWID and platform. Use to see which devices receive test sends before adding or removing one. */ List: TestDevicesService_List; /** Removes a test device from an application by HWID or push token and clears its PW_TestDevice tag on the device. Use to stop a device from receiving test sends; cannot be undone. */ Delete: TestDevicesService_Delete; /** Reports whether the application currently accepts test devices registered from the app itself (the SDK knock gesture), and when that window expires. Use to render the auto-registration switch and its countdown. */ GetAutoRegistration: TestDevicesService_GetAutoRegistration; /** Opens a one-hour window in which the application accepts test devices registered from the app itself, or closes it immediately. While the window is closed such registrations are dropped; adding a test device from the Control Panel is never affected. */ SetAutoRegistration: TestDevicesService_SetAutoRegistration; } export type TestDevice = { /** test device name */ name: string; /** test device push token */ pushToken: string; /** test device hwid */ hwid: string; /** test device description */ description: string; /** test device platform */ platform: string; /** test device creation time */ createdAt: Date; }; export type CreateRequest = { /** application code */ application?: string; /** push token */ pushToken?: string; /** hwid (if push token provided, hwid will be loaded from database) */ hwid?: string; /** * test device platform. case insensitive. possible values: * ios * android * baidu_android * osx * windows * amazon * safari * chrome * firefox * ie * email * huawei_android * line */ platform?: string; /** test device name. must be non-empty. max length: 32 characters. */ name?: string; /** test device description. max length: 64 characters. */ description?: string; /** * set by the SDK when the device registered itself through the knock gesture * instead of being added on purpose. such registrations are only accepted * while the auto-registration window is open. */ autoCreated?: boolean; }; export type CreateResponse = { needsVerify: boolean; }; export type VerifyRequest = { /** verification code */ code?: string; }; export type VerifyResponse = {}; export type ListRequest = { /** application code */ application?: string; }; export type ListResponse = { /** collection of test devices */ testDevices: TestDevice[]; }; export type DeleteRequest = { /** application code */ application?: string; /** test device hwid */ hwid?: string; /** test device push token */ pushToken?: string; }; export type DeleteResponse = {}; export type GetAutoRegistrationRequest = { /** application code */ application?: string; }; export type GetAutoRegistrationResponse = { /** true while the application accepts test devices registered from the app itself */ enabled: boolean; /** when the window closes. unset when enabled is false */ expireAt: Date; }; export type SetAutoRegistrationRequest = { /** application code */ application?: string; /** true opens the window for an hour, false closes it right away */ enabled?: boolean; }; export type SetAutoRegistrationResponse = { enabled: boolean; /** when the window closes. unset when enabled is false */ expireAt: Date; };