import ILogger from '../helpers/ILogger'; import { HttpClient } from './HttpClient'; import IAPICredentials from './IAPICredentails'; import { ILink, IListResource, IListResourceParameters } from './IListResource'; import { TokenManager } from './TokenManager'; export interface ICreateProjectPayload { name: string; mode?: 'live' | 'sandbox'; configuration?: { phone_check: { callback_url: string; redirect_url?: string; }; subscriber_check?: { callback_url?: string; redirect_url?: string; }; }; } export interface IProjectResource { name: string; project_id: string; mode: 'live' | 'sandbox'; disabled: boolean; created_at: string; updated_at: string; configuration?: { phone_check?: { callback_url?: string; redirect_url?: string; }; subscriber_check?: { callback_url?: string; redirect_url?: string; }; }; _links: { self: ILink; my_credentials: ILink; }; [index: string]: any; } export interface IProjectCreateResource extends IProjectResource { _embedded: { credentials: IAPICredentials[]; }; } export interface IUpdateProjectPayload { /** * Update the mode of the Project. */ mode?: 'live' | 'sandbox'; /** * `configuration` can only be added. */ configuration?: { /** * `phone_check` alone cannot be manipulated. If `configuration` is present it `phone_check` must also be present. */ phone_check?: { callback_url?: string; redirect_url?: string; }; subscriber_check?: { callback_url?: string; redirect_url?: string; }; }; } export interface IListProjectsResponse extends IListResource { _embedded: { projects: IProjectResource[]; }; } export type IListProjectsParameters = IListResourceParameters; export declare class ProjectsAPIClient { httpClient: HttpClient; logger: ILogger; constructor(tokenManager: TokenManager, apiBaseUrl: string, logger: ILogger); create(workspaceId: string, params: any): Promise; get(workspaceId: string, projectId: string): Promise; list(workspaceId: string, params?: IListProjectsParameters): Promise; update(workspaceId: string, projectId: string, params: IUpdateProjectPayload): Promise; delete(): void; }