vpn.email.client
Version:
Vpn.Email client IMAP core
226 lines (218 loc) • 4.95 kB
TypeScript
interface Inetwork {
ip_address: string;
netmask: string;
gateway: string;
type: string;
}
interface INetworks {
v4: Inetwork[];
v6: Inetwork[];
}
interface IPages {
last:string;
next:string;
}
interface ILink {
pages:IPages
}
interface iMeta {
total:number;
}
interface IPageResult {
links:ILink;
meta:iMeta;
}
interface IAccount {
droplet_limit: number;
email: string;
uuid: string;
email_verified: boolean;
status: string;
status_message:string;
}
interface IAccounts {
account:IAccount
}
interface IRegion {
name:string;
slug:string;
sizes:Array<string>;
features:Array<string>;
available:boolean;
}
interface IUrl {
protocol:string;
slashes:boolean;
auth:any;
host:string;
port:number;
hostname:string;
hash:string;
search:string;
query:string;
pathname:string;
path:string;
href:string;
}
interface IHttpHeader {
authorization:string;
content_type:string;
accept:string;
"content-type":string;
"content-length":number;
}
interface Irequest {
uri:IUrl;
method:string;
headers:IHttpHeader;
}
interface IHeader {
server:string;
date:Date;
"content-type":string;
"transfer-encoding":string;
connection:string;
"set-cookie":string[];
status:string;
"x-frame-options":string;
"x-xss-protection":string;
"x-content-type-options":string;
"ratelimit-limit":string;
"ratelimit-remaining":string;
"ratelimit-reset":string;
"cache-control":string;
"x-request-id":string;
"x-runtime":string;
"cf-ray":string;
}
interface IResult {
statusCode:string;
headers:IHeader;
request:Irequest
}
interface IAccountResult extends Irequest{
body:IAccount
}
interface ICallBackAccount {
(err:Error, res:IAccountResult, data:IAccounts):void
}
interface ICallBackDroplets {
( err:Error, res: IAccountResult, data: IDropletsResult):void
}
interface ICallBackImages {
(err:Error, res:IAccountResult, data:IImagesResult):void
}
interface ICallBackImage {
(err:Error, res:IAccountResult, data:IImageResult):void
}
interface IQueryOption {
per_page?:string;
page?:number;
includeAll?:boolean;
private?: boolean;
}
interface IImage {
id:number;
name:string;
distribution:string;
slug:string;
public:boolean;
regions:Array<string>;
created_at:Date;
min_disk_size:number;
type:string;
}
interface IDroplet {
id:number;
name:string;
memory:number;
vcpus:number;
disk:number;
locked:boolean;
status:string;
kernel:string;
created_at: string;
features:Array<string>;
backup_ids:Array<Object>;
next_backup_window:any;
snapshot_ids:Array<any>;
image:IImage;
size:Array<Object>;
size_slug:string;
networks:INetworks;
region:Array<Object>;
}
interface IAction {
id: number;
status: string;
type: string;
started_at: string;
completed_at: any;
resource_id: number;
resource_type: string;
region: IRegion
}
interface IDropletsResult extends IPageResult {
action?: IAction;
droplet?: IDroplet;
droplets?: IDroplet[]
}
interface IImagesResult extends IPageResult {
images:IImage[];
image?:IImage
}
interface IImageResult {
image:IImage;
}
interface IDropletConfig {
name:string;
region:string;
size:string;
image:string;
ssh_keys?:string[];
backups?:string;
ipv6?:boolean;
private_networking?:boolean;
user_data?:string;
}
interface ICallBackDropletsCreate {
(err:Error, res:IAccountResult, data:IDropletsCreateResult):void
}
interface IDropletsCreateResult {
id?:string;
message?:string;
droplet:IDroplet;
}
interface ssh_key {
id:string;
fingerprint:string;
public_key:string;
name:string;
}
interface ICallBackAccountGetKeys {
(err:Error, res:IAccountResult, data:ssh_key[]):void
}
interface IAllRegions extends Irequest{
regions:IRegion[]
}
interface ICallBackAccountGetRegions {
(err:Error, res:IAccountResult, data:IAllRegions):void
}
interface DigitalOcean {
new ( appKey:string, pageSize:string ): DigitalOcean;
account ( cb: ICallBackAccount ): void;
dropletsGetAll ( query: IQueryOption, callback: ICallBackDroplets ): void;
imagesGetById ( id: string, callback: ICallBackImages): void;
imagesGetAll ( query: IQueryOption, callback:ICallBackImages ): void;
imagesGetBySlug ( sulg: string, callback: ICallBackImage ): void;
dropletsCreate ( config: IDropletConfig, callback: ICallBackDropletsCreate):void;
accountGetKeys(query:IQueryOption, callback:ICallBackAccountGetKeys):void;
regionsGetAll(query:IQueryOption,callback:ICallBackAccountGetRegions):void;
dropletsDelete(id:number,callback:ICallBackDroplets):void;
dropletsGetById(id:number,callback:ICallBackDroplets):void;
dropletsRequestAction(id:string, action: any, callback: ICallBackDroplets): void
}
declare var DigitalOcean : DigitalOcean
declare module "do-wrapper" {
export = DigitalOcean
}