updated types

This commit is contained in:
huzaif 2021-01-06 00:00:20 +05:30
parent c6f1d00b63
commit 71e0463564
10 changed files with 70 additions and 23 deletions

View file

@ -22,6 +22,30 @@ export class BuyNumberResponse {
}
}
export class SearchNumberResponse {
constructor(params) {
params = params || {};
this.number = params.number;
this.prefix = params.prefix;
this.city = params.city;
this.country = params.country;
this.region = params.region;
this.rate_center = params.rate_center;
this.lata = params.lata;
this.type = params.type;
this.sub_type = params.sub_type;
this.setup_rate = params.setup_rate;
this.monthly_rental_rate = params.monthly_rental_rate;
this.sms_enabled = params.sms_enabled;
this.sms_rate = params.sms_rate;
this.voice_enabled = params.voice_enabled;
this.voice_rate = params.voice_rate;
this.restriction = params.restriction;
this.restriction_text = params.restriction_text;
this.resource_uri = params.resource_uri;
}
}
export class UpdateNumberResponse {
constructor(params) {
params = params || {};

View file

@ -103,7 +103,7 @@ export class SubaccountInterface extends PlivoResourceInterface {
* @promise {Subaccount} return object of subaccount
* @fail {Error} return Error
*/
update(id: string, name: string, enabled: boolean): Promise<any>;
update(id: string, name: string, enabled: boolean): Promise<UpdateSubAccountDetails>;
/**
* delete subaccount
* @method
@ -163,7 +163,7 @@ export class AccountInterface extends PlivoResourceInterface {
name: string;
city: string;
address: string;
}): Promise<any>;
}): Promise<UpdateAccountDetailsResponse>;
[clientKey]: symbol;
}
import { PlivoResource } from "../base";

View file

@ -140,7 +140,7 @@ export class ApplicationInterface extends PlivoResourceInterface {
defaultEndpointApp: boolean;
subaccount: string;
logIncomingMessages: boolean;
}): Promise<any>;
}): Promise<UpdateApplicationResponse>;
/**
* delete Application
* @method

View file

@ -42,7 +42,7 @@ export class MediaInterface extends PlivoResourceInterface {
* @method
* @fail {Error} return Error
*/
upload(files: any): Promise<UploadMediaResponse>;
upload(files: Array): Promise<UploadMediaResponse>;
/**
* Get Media by given id
* @method

View file

@ -88,7 +88,7 @@ export class MessageInterface extends PlivoResourceInterface {
type: string;
url: string;
method: string;
media_urls: any;
media_urls: Array;
log: boolean;
}): Promise < MessageResponse > ;
/**

View file

@ -9,6 +9,29 @@ export class UpdateNumberResponse {
apiId: string;
message: string;
}
export class SearchNumberResponse {
constructor(params: object);
number: string;
prefix: string;
city: string;
country: string;
region: string;
rate_center: string;
lata: number;
type: string;
sub_type: string;
setup_rate: string;
monthly_rental_rate: string;
sms_enabled: boolean;
sms_rate: string;
voice_enabled: boolean;
voice_rate: string;
restriction: any;
restriction_text: any;
resource_uri: string;
}
/**
* Represents a PhoneNumber
* @constructor
@ -44,7 +67,7 @@ export class PhoneNumberInterface extends PlivoResourceInterface {
* @promise {@link PlivoGenericResponse} return PlivoGenericResponse Object if success
* @fail {Error} return Error
*/
buy(number: string, appId: string): Promise < BuyNumberResponse > ;
buy(number: string, appId: string): Promise < any > ;
[clientKey]: symbol;
}
/**
@ -81,7 +104,7 @@ export class NumberInterface extends PlivoResourceInterface {
* @promise {@link PlivoGenericResponse} return PlivoGenericResponse Object if success
* @fail {Error} return Error
*/
buy(number: string, appId: string): Promise < any > ;
buy(number: string, appId: string): Promise < BuyNumberResponse > ;
/**
* Add own number from carrier
* @method
@ -92,7 +115,7 @@ export class NumberInterface extends PlivoResourceInterface {
* @promise {@link PlivoGenericResponse} return PlivoGenericResponse Object if success
* @fail {Error} return Error
*/
addOwnNumber(numbers: string, carrier: string, region: string, optionalParams: object): Promise < any > ;
addOwnNumber(numbers: string, carrier: string, region: string, optionalParams: object): Promise < UpdateNumberResponse > ;
/**
* Add own number from carrier
* @method
@ -101,7 +124,7 @@ export class NumberInterface extends PlivoResourceInterface {
* @promise {@link PhoneNumberInterface} return PhoneNumbers Object if success
* @fail {Error} return Error
*/
search(countryISO: string, optionalParams: object): Promise < any > ;
search(countryISO: string, optionalParams: object): Promise < SearchNumberResponse > ;
/**
* Update Number
* @method
@ -117,7 +140,7 @@ export class NumberInterface extends PlivoResourceInterface {
appId: string;
subAccount: string;
alias: string;
}): Promise < any > ;
}): Promise < UpdateNumberResponse > ;
/**
* Unrent Number
* @method

View file

@ -2,14 +2,14 @@ export class RunPHLOResponse {
constructor(params: object);
apiid: string;
phloid: string;
message: any;
message: string;
}
export class RetrievePHLOResponse {
constructor(params: object);
apiid: string;
phloid: string;
name: any;
createdOn: any;
name: string;
createdOn: string;
}
/**
* Represents a Phlo

View file

@ -16,12 +16,12 @@ export class PhloMultiPartyCall extends PlivoResource {
constructor(client: function, data ? : {});
action: string;
client: function;
member: (memberAddress: any) => PhloMultiPartyCallMember;
call(triggerSource: any, to: any, role: any): Promise < any > ;
warmTransfer(triggerSource: any, to: any, role: any): Promise < UpdateMultipartyCallResponse > ;
coldTransfer(triggerSource: any, to: any, role: any): Promise < UpdateMultipartyCallResponse > ;
abortTransfer(memberAddress: any): Promise<any>;
update(action: any, triggerSource: any, to: any, role: any): Promise<UpdateMultipartyCallResponse>;
member: (memberAddress: string) => PhloMultiPartyCallMember;
call(triggerSource: string, to: string, role: string): Promise < any > ;
warmTransfer(triggerSource: string, to: string, role: string): Promise < UpdateMultipartyCallResponse > ;
coldTransfer(triggerSource: string, to: string, role: string): Promise < UpdateMultipartyCallResponse > ;
abortTransfer(memberAddress: string): Promise<any>;
update(action: string, triggerSource: string, to: string, role: string): Promise<UpdateMultipartyCallResponse>;
[clientKey]: symbol;
}
export class PhloMultiPartyCallInterface extends PlivoResourceInterface {

View file

@ -24,7 +24,7 @@ export class UpdatePowerpackResponse {
applicationType: string;
createdOn: string;
localConnect: string;
name: string;
name: string;
numberPool: string;
stickySender: string;
uuid: string;
@ -44,7 +44,7 @@ export class ListTollFreeResponse {
export class AddNumberResponse {
constructor(params: object);
apiId: string;
accountPhoneNumberResource: string;
accountPhoneNumberResource: string;
addedOn: string;
countryIso2: string;
number: string;

View file

@ -1,5 +1,5 @@
export class Client {
constructor(authid: string, authToken: any, proxy: any);
constructor(authid: string, authToken: string, proxy: string);
calls: CallInterface;
accounts: AccountInterface;
subAccounts: SubaccountInterface;
@ -20,7 +20,7 @@ export class Client {
* You can also pass in additional parameters accepted by the node requests module.
*/
export class PhloClient {
constructor(authid: string, authToken: any, options: any);
constructor(authid: string, authToken: string, options: string);
phlo: (phloid: string) => Phlo;
}
import { CallInterface } from "../resources/call.js";