twilio 5.8.2 → 5.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +103 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +2 -0
- package/lib/rest/NumbersBase.d.ts +3 -0
- package/lib/rest/NumbersBase.js +5 -0
- package/lib/rest/OauthBase.d.ts +3 -0
- package/lib/rest/OauthBase.js +5 -0
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts +3 -3
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts +3 -3
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts +3 -3
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts +3 -3
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts +3 -3
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts +3 -3
- package/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts +3 -3
- package/lib/rest/api/v2010/account/recording.d.ts +1 -1
- package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/daily.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/today.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/record.d.ts +9 -10
- package/lib/rest/api/v2010/account/usage/trigger.d.ts +11 -12
- package/lib/rest/api/v2010/account/usage.d.ts +0 -4
- package/lib/rest/assistants/v1/assistant/feedback.d.ts +2 -2
- package/lib/rest/assistants/v1/assistant/message.d.ts +1 -1
- package/lib/rest/assistants/v1/assistant.d.ts +20 -20
- package/lib/rest/assistants/v1/knowledge.d.ts +6 -6
- package/lib/rest/assistants/v1/tool.d.ts +8 -8
- package/lib/rest/content/v1/content.d.ts +41 -25
- package/lib/rest/content/v1/content.js +7 -1
- package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +1 -1
- package/lib/rest/insights/v1/room/participant.d.ts +1 -1
- package/lib/rest/insights/v1/room.d.ts +1 -1
- package/lib/rest/intelligence/v2/service.d.ts +10 -0
- package/lib/rest/intelligence/v2/service.js +6 -0
- package/lib/rest/intelligence/v2/transcript/encryptedOperatorResults.d.ts +113 -0
- package/lib/rest/intelligence/v2/transcript/encryptedOperatorResults.js +120 -0
- package/lib/rest/intelligence/v2/transcript/encryptedSentences.d.ts +113 -0
- package/lib/rest/intelligence/v2/transcript/encryptedSentences.js +120 -0
- package/lib/rest/intelligence/v2/transcript.d.ts +22 -0
- package/lib/rest/intelligence/v2/transcript.js +28 -0
- package/lib/rest/lookups/v2/lookupOverride.d.ts +1 -1
- package/lib/rest/lookups/v2/query.d.ts +71 -71
- package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +2 -2
- package/lib/rest/marketplace/v1/referralConversion.d.ts +1 -1
- package/lib/rest/messaging/v2/channelsSender.d.ts +71 -71
- package/lib/rest/messaging/v2/channelsSender.js +6 -6
- package/lib/rest/numbers/V3.d.ts +15 -0
- package/lib/rest/numbers/V3.js +37 -0
- package/lib/rest/numbers/v1/portingPortIn.d.ts +3 -3
- package/lib/rest/numbers/v3/hostedNumberOrder.d.ts +210 -0
- package/lib/rest/numbers/v3/hostedNumberOrder.js +154 -0
- package/lib/rest/oauth/V2.d.ts +15 -0
- package/lib/rest/oauth/V2.js +36 -0
- package/lib/rest/oauth/v2/token.d.ts +87 -0
- package/lib/rest/oauth/v2/token.js +99 -0
- package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +1 -1
- package/lib/rest/pricing/v1/messaging/country.d.ts +6 -6
- package/lib/rest/pricing/v1/phoneNumber/country.d.ts +3 -3
- package/lib/rest/pricing/v1/voice/country.d.ts +6 -6
- package/lib/rest/pricing/v1/voice/number.d.ts +5 -5
- package/lib/rest/pricing/v2/country.d.ts +8 -8
- package/lib/rest/pricing/v2/number.d.ts +8 -8
- package/lib/rest/pricing/v2/voice/country.d.ts +8 -8
- package/lib/rest/pricing/v2/voice/number.d.ts +6 -6
- package/lib/rest/verify/V2.d.ts +5 -0
- package/lib/rest/verify/V2.js +6 -0
- package/lib/rest/verify/v2/newChallenge.d.ts +204 -0
- package/lib/rest/verify/v2/newChallenge.js +150 -0
- package/lib/rest/verify/v2/service/newFactor.d.ts +154 -0
- package/lib/rest/verify/v2/service/newFactor.js +118 -0
- package/lib/rest/verify/v2/service.d.ts +8 -0
- package/lib/rest/verify/v2/service.js +13 -0
- package/lib/twiml/VoiceResponse.d.ts +22 -0
- package/lib/twiml/VoiceResponse.js +19 -0
- package/lib-esm/index.js +49 -0
- package/lib-esm/package.json +3 -0
- package/package.json +15 -4
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V3 from "../V3";
|
|
3
|
+
import { PhoneNumberCapabilities } from "../../../interfaces";
|
|
4
|
+
export type HostedNumberOrderStatus = "twilio-processing" | "received" | "pending-verification" | "verified" | "pending-loa" | "carrier-processing" | "testing" | "completed" | "failed" | "action-required";
|
|
5
|
+
export type HostedNumberOrderVerificationType = "phone-call" | "phone-bill";
|
|
6
|
+
/**
|
|
7
|
+
* Options to pass to create a HostedNumberOrderInstance
|
|
8
|
+
*/
|
|
9
|
+
export interface HostedNumberOrderListInstanceCreateOptions {
|
|
10
|
+
/** The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format */
|
|
11
|
+
phoneNumber: string;
|
|
12
|
+
/** Used to specify that the SMS capability will be hosted on Twilio\\\'s platform. */
|
|
13
|
+
smsCapability: boolean;
|
|
14
|
+
/** This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. */
|
|
15
|
+
accountSid?: string;
|
|
16
|
+
/** A 64 character string that is a human readable text that describes this resource. */
|
|
17
|
+
friendlyName?: string;
|
|
18
|
+
/** Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. */
|
|
19
|
+
uniqueName?: string;
|
|
20
|
+
/** Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. */
|
|
21
|
+
ccEmails?: Array<string>;
|
|
22
|
+
/** The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. */
|
|
23
|
+
smsUrl?: string;
|
|
24
|
+
/** The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */
|
|
25
|
+
smsMethod?: string;
|
|
26
|
+
/** A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. */
|
|
27
|
+
smsFallbackUrl?: string;
|
|
28
|
+
/** The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. */
|
|
29
|
+
smsFallbackMethod?: string;
|
|
30
|
+
/** Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. */
|
|
31
|
+
statusCallbackUrl?: string;
|
|
32
|
+
/** Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. */
|
|
33
|
+
statusCallbackMethod?: string;
|
|
34
|
+
/** Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. */
|
|
35
|
+
smsApplicationSid?: string;
|
|
36
|
+
/** Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. */
|
|
37
|
+
addressSid?: string;
|
|
38
|
+
/** Optional. Email of the owner of this phone number that is being hosted. */
|
|
39
|
+
email?: string;
|
|
40
|
+
/** */
|
|
41
|
+
verificationType?: HostedNumberOrderVerificationType;
|
|
42
|
+
/** Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. */
|
|
43
|
+
verificationDocumentSid?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface HostedNumberOrderSolution {
|
|
46
|
+
}
|
|
47
|
+
export interface HostedNumberOrderListInstance {
|
|
48
|
+
_version: V3;
|
|
49
|
+
_solution: HostedNumberOrderSolution;
|
|
50
|
+
_uri: string;
|
|
51
|
+
/**
|
|
52
|
+
* Create a HostedNumberOrderInstance
|
|
53
|
+
*
|
|
54
|
+
* @param params - Parameter for request
|
|
55
|
+
* @param callback - Callback to handle processed record
|
|
56
|
+
*
|
|
57
|
+
* @returns Resolves to processed HostedNumberOrderInstance
|
|
58
|
+
*/
|
|
59
|
+
create(params: HostedNumberOrderListInstanceCreateOptions, callback?: (error: Error | null, item?: HostedNumberOrderInstance) => any): Promise<HostedNumberOrderInstance>;
|
|
60
|
+
/**
|
|
61
|
+
* Provide a user-friendly representation
|
|
62
|
+
*/
|
|
63
|
+
toJSON(): any;
|
|
64
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
65
|
+
}
|
|
66
|
+
export declare function HostedNumberOrderListInstance(version: V3): HostedNumberOrderListInstance;
|
|
67
|
+
interface HostedNumberOrderResource {
|
|
68
|
+
sid: string;
|
|
69
|
+
accountSid: string;
|
|
70
|
+
incomingPhoneNumberSid: string;
|
|
71
|
+
addressSid: string;
|
|
72
|
+
signingDocumentSid: string;
|
|
73
|
+
phoneNumber: string;
|
|
74
|
+
capabilities: PhoneNumberCapabilities;
|
|
75
|
+
friendlyName: string;
|
|
76
|
+
uniqueName: string;
|
|
77
|
+
status: HostedNumberOrderStatus;
|
|
78
|
+
failureReason: string;
|
|
79
|
+
dateCreated: Date;
|
|
80
|
+
dateUpdated: Date;
|
|
81
|
+
verificationAttempts: number;
|
|
82
|
+
email: string;
|
|
83
|
+
ccEmails: Array<string>;
|
|
84
|
+
url: string;
|
|
85
|
+
verificationType: HostedNumberOrderVerificationType;
|
|
86
|
+
verificationDocumentSid: string;
|
|
87
|
+
extension: string;
|
|
88
|
+
callDelay: number;
|
|
89
|
+
verificationCode: string;
|
|
90
|
+
verificationCallSids: Array<string>;
|
|
91
|
+
}
|
|
92
|
+
export declare class HostedNumberOrderInstance {
|
|
93
|
+
protected _version: V3;
|
|
94
|
+
constructor(_version: V3, payload: HostedNumberOrderResource);
|
|
95
|
+
/**
|
|
96
|
+
* A 34 character string that uniquely identifies this HostedNumberOrder.
|
|
97
|
+
*/
|
|
98
|
+
sid: string;
|
|
99
|
+
/**
|
|
100
|
+
* A 34 character string that uniquely identifies the account.
|
|
101
|
+
*/
|
|
102
|
+
accountSid: string;
|
|
103
|
+
/**
|
|
104
|
+
* A 34 character string that uniquely identifies the [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the phone number being hosted.
|
|
105
|
+
*/
|
|
106
|
+
incomingPhoneNumberSid: string;
|
|
107
|
+
/**
|
|
108
|
+
* A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number.
|
|
109
|
+
*/
|
|
110
|
+
addressSid: string;
|
|
111
|
+
/**
|
|
112
|
+
* A 34 character string that uniquely identifies the [Authorization Document](https://www.twilio.com/docs/phone-numbers/hosted-numbers/hosted-numbers-api/authorization-document-resource) the user needs to sign.
|
|
113
|
+
*/
|
|
114
|
+
signingDocumentSid: string;
|
|
115
|
+
/**
|
|
116
|
+
* Phone number to be hosted. This must be in [E.164](https://en.wikipedia.org/wiki/E.164) format, e.g., +16175551212
|
|
117
|
+
*/
|
|
118
|
+
phoneNumber: string;
|
|
119
|
+
capabilities: PhoneNumberCapabilities;
|
|
120
|
+
/**
|
|
121
|
+
* A 64 character string that is a human-readable text that describes this resource.
|
|
122
|
+
*/
|
|
123
|
+
friendlyName: string;
|
|
124
|
+
/**
|
|
125
|
+
* Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID.
|
|
126
|
+
*/
|
|
127
|
+
uniqueName: string;
|
|
128
|
+
status: HostedNumberOrderStatus;
|
|
129
|
+
/**
|
|
130
|
+
* A message that explains why a hosted_number_order went to status \"action-required\"
|
|
131
|
+
*/
|
|
132
|
+
failureReason: string;
|
|
133
|
+
/**
|
|
134
|
+
* The date this resource was created, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
|
135
|
+
*/
|
|
136
|
+
dateCreated: Date;
|
|
137
|
+
/**
|
|
138
|
+
* The date that this resource was updated, given as [GMT RFC 2822](http://www.ietf.org/rfc/rfc2822.txt) format.
|
|
139
|
+
*/
|
|
140
|
+
dateUpdated: Date;
|
|
141
|
+
/**
|
|
142
|
+
* The number of attempts made to verify ownership of the phone number that is being hosted.
|
|
143
|
+
*/
|
|
144
|
+
verificationAttempts: number;
|
|
145
|
+
/**
|
|
146
|
+
* Email of the owner of this phone number that is being hosted.
|
|
147
|
+
*/
|
|
148
|
+
email: string;
|
|
149
|
+
/**
|
|
150
|
+
* A list of emails that LOA document for this HostedNumberOrder will be carbon copied to.
|
|
151
|
+
*/
|
|
152
|
+
ccEmails: Array<string>;
|
|
153
|
+
/**
|
|
154
|
+
* The URL of this HostedNumberOrder.
|
|
155
|
+
*/
|
|
156
|
+
url: string;
|
|
157
|
+
verificationType: HostedNumberOrderVerificationType;
|
|
158
|
+
/**
|
|
159
|
+
* A 34 character string that uniquely identifies the Identity Document resource that represents the document for verifying ownership of the number to be hosted.
|
|
160
|
+
*/
|
|
161
|
+
verificationDocumentSid: string;
|
|
162
|
+
/**
|
|
163
|
+
* A numerical extension to be used when making the ownership verification call.
|
|
164
|
+
*/
|
|
165
|
+
extension: string;
|
|
166
|
+
/**
|
|
167
|
+
* A value between 0-30 specifying the number of seconds to delay initiating the ownership verification call.
|
|
168
|
+
*/
|
|
169
|
+
callDelay: number;
|
|
170
|
+
/**
|
|
171
|
+
* A verification code provided in the response for a user to enter when they pick up the phone call.
|
|
172
|
+
*/
|
|
173
|
+
verificationCode: string;
|
|
174
|
+
/**
|
|
175
|
+
* A list of 34 character strings that are unique identifiers for the calls placed as part of ownership verification.
|
|
176
|
+
*/
|
|
177
|
+
verificationCallSids: Array<string>;
|
|
178
|
+
/**
|
|
179
|
+
* Provide a user-friendly representation
|
|
180
|
+
*
|
|
181
|
+
* @returns Object
|
|
182
|
+
*/
|
|
183
|
+
toJSON(): {
|
|
184
|
+
sid: string;
|
|
185
|
+
accountSid: string;
|
|
186
|
+
incomingPhoneNumberSid: string;
|
|
187
|
+
addressSid: string;
|
|
188
|
+
signingDocumentSid: string;
|
|
189
|
+
phoneNumber: string;
|
|
190
|
+
capabilities: PhoneNumberCapabilities;
|
|
191
|
+
friendlyName: string;
|
|
192
|
+
uniqueName: string;
|
|
193
|
+
status: HostedNumberOrderStatus;
|
|
194
|
+
failureReason: string;
|
|
195
|
+
dateCreated: Date;
|
|
196
|
+
dateUpdated: Date;
|
|
197
|
+
verificationAttempts: number;
|
|
198
|
+
email: string;
|
|
199
|
+
ccEmails: string[];
|
|
200
|
+
url: string;
|
|
201
|
+
verificationType: HostedNumberOrderVerificationType;
|
|
202
|
+
verificationDocumentSid: string;
|
|
203
|
+
extension: string;
|
|
204
|
+
callDelay: number;
|
|
205
|
+
verificationCode: string;
|
|
206
|
+
verificationCallSids: string[];
|
|
207
|
+
};
|
|
208
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
209
|
+
}
|
|
210
|
+
export {};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* Twilio - Numbers
|
|
9
|
+
* This is the public Twilio REST API.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.HostedNumberOrderInstance = void 0;
|
|
17
|
+
exports.HostedNumberOrderListInstance = HostedNumberOrderListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
function HostedNumberOrderListInstance(version) {
|
|
22
|
+
const instance = {};
|
|
23
|
+
instance._version = version;
|
|
24
|
+
instance._solution = {};
|
|
25
|
+
instance._uri = `/HostedNumbers/HostedNumberOrders`;
|
|
26
|
+
instance.create = function create(params, callback) {
|
|
27
|
+
if (params === null || params === undefined) {
|
|
28
|
+
throw new Error('Required parameter "params" missing.');
|
|
29
|
+
}
|
|
30
|
+
if (params["phoneNumber"] === null || params["phoneNumber"] === undefined) {
|
|
31
|
+
throw new Error("Required parameter \"params['phoneNumber']\" missing.");
|
|
32
|
+
}
|
|
33
|
+
if (params["smsCapability"] === null ||
|
|
34
|
+
params["smsCapability"] === undefined) {
|
|
35
|
+
throw new Error("Required parameter \"params['smsCapability']\" missing.");
|
|
36
|
+
}
|
|
37
|
+
let data = {};
|
|
38
|
+
data["phoneNumber"] = params["phoneNumber"];
|
|
39
|
+
data["smsCapability"] = serialize.bool(params["smsCapability"]);
|
|
40
|
+
if (params["accountSid"] !== undefined)
|
|
41
|
+
data["accountSid"] = params["accountSid"];
|
|
42
|
+
if (params["friendlyName"] !== undefined)
|
|
43
|
+
data["friendlyName"] = params["friendlyName"];
|
|
44
|
+
if (params["uniqueName"] !== undefined)
|
|
45
|
+
data["uniqueName"] = params["uniqueName"];
|
|
46
|
+
if (params["ccEmails"] !== undefined)
|
|
47
|
+
data["ccEmails"] = serialize.map(params["ccEmails"], (e) => e);
|
|
48
|
+
if (params["smsUrl"] !== undefined)
|
|
49
|
+
data["smsUrl"] = params["smsUrl"];
|
|
50
|
+
if (params["smsMethod"] !== undefined)
|
|
51
|
+
data["smsMethod"] = params["smsMethod"];
|
|
52
|
+
if (params["smsFallbackUrl"] !== undefined)
|
|
53
|
+
data["smsFallbackUrl"] = params["smsFallbackUrl"];
|
|
54
|
+
if (params["smsFallbackMethod"] !== undefined)
|
|
55
|
+
data["smsFallbackMethod"] = params["smsFallbackMethod"];
|
|
56
|
+
if (params["statusCallbackUrl"] !== undefined)
|
|
57
|
+
data["statusCallbackUrl"] = params["statusCallbackUrl"];
|
|
58
|
+
if (params["statusCallbackMethod"] !== undefined)
|
|
59
|
+
data["statusCallbackMethod"] = params["statusCallbackMethod"];
|
|
60
|
+
if (params["smsApplicationSid"] !== undefined)
|
|
61
|
+
data["smsApplicationSid"] = params["smsApplicationSid"];
|
|
62
|
+
if (params["addressSid"] !== undefined)
|
|
63
|
+
data["addressSid"] = params["addressSid"];
|
|
64
|
+
if (params["email"] !== undefined)
|
|
65
|
+
data["email"] = params["email"];
|
|
66
|
+
if (params["verificationType"] !== undefined)
|
|
67
|
+
data["verificationType"] = params["verificationType"];
|
|
68
|
+
if (params["verificationDocumentSid"] !== undefined)
|
|
69
|
+
data["verificationDocumentSid"] = params["verificationDocumentSid"];
|
|
70
|
+
const headers = {};
|
|
71
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
72
|
+
headers["Accept"] = "application/json";
|
|
73
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
74
|
+
uri: instance._uri,
|
|
75
|
+
method: "post",
|
|
76
|
+
data,
|
|
77
|
+
headers,
|
|
78
|
+
});
|
|
79
|
+
operationPromise = operationPromise.then((payload) => new HostedNumberOrderInstance(operationVersion, payload));
|
|
80
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
81
|
+
return operationPromise;
|
|
82
|
+
};
|
|
83
|
+
instance.toJSON = function toJSON() {
|
|
84
|
+
return instance._solution;
|
|
85
|
+
};
|
|
86
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
87
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
88
|
+
};
|
|
89
|
+
return instance;
|
|
90
|
+
}
|
|
91
|
+
class HostedNumberOrderInstance {
|
|
92
|
+
constructor(_version, payload) {
|
|
93
|
+
this._version = _version;
|
|
94
|
+
this.sid = payload.sid;
|
|
95
|
+
this.accountSid = payload.accountSid;
|
|
96
|
+
this.incomingPhoneNumberSid = payload.incomingPhoneNumberSid;
|
|
97
|
+
this.addressSid = payload.addressSid;
|
|
98
|
+
this.signingDocumentSid = payload.signingDocumentSid;
|
|
99
|
+
this.phoneNumber = payload.phoneNumber;
|
|
100
|
+
this.capabilities = payload.capabilities;
|
|
101
|
+
this.friendlyName = payload.friendlyName;
|
|
102
|
+
this.uniqueName = payload.uniqueName;
|
|
103
|
+
this.status = payload.status;
|
|
104
|
+
this.failureReason = payload.failureReason;
|
|
105
|
+
this.dateCreated = deserialize.iso8601DateTime(payload.dateCreated);
|
|
106
|
+
this.dateUpdated = deserialize.iso8601DateTime(payload.dateUpdated);
|
|
107
|
+
this.verificationAttempts = deserialize.integer(payload.verificationAttempts);
|
|
108
|
+
this.email = payload.email;
|
|
109
|
+
this.ccEmails = payload.ccEmails;
|
|
110
|
+
this.url = payload.url;
|
|
111
|
+
this.verificationType = payload.verificationType;
|
|
112
|
+
this.verificationDocumentSid = payload.verificationDocumentSid;
|
|
113
|
+
this.extension = payload.extension;
|
|
114
|
+
this.callDelay = deserialize.integer(payload.callDelay);
|
|
115
|
+
this.verificationCode = payload.verificationCode;
|
|
116
|
+
this.verificationCallSids = payload.verificationCallSids;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Provide a user-friendly representation
|
|
120
|
+
*
|
|
121
|
+
* @returns Object
|
|
122
|
+
*/
|
|
123
|
+
toJSON() {
|
|
124
|
+
return {
|
|
125
|
+
sid: this.sid,
|
|
126
|
+
accountSid: this.accountSid,
|
|
127
|
+
incomingPhoneNumberSid: this.incomingPhoneNumberSid,
|
|
128
|
+
addressSid: this.addressSid,
|
|
129
|
+
signingDocumentSid: this.signingDocumentSid,
|
|
130
|
+
phoneNumber: this.phoneNumber,
|
|
131
|
+
capabilities: this.capabilities,
|
|
132
|
+
friendlyName: this.friendlyName,
|
|
133
|
+
uniqueName: this.uniqueName,
|
|
134
|
+
status: this.status,
|
|
135
|
+
failureReason: this.failureReason,
|
|
136
|
+
dateCreated: this.dateCreated,
|
|
137
|
+
dateUpdated: this.dateUpdated,
|
|
138
|
+
verificationAttempts: this.verificationAttempts,
|
|
139
|
+
email: this.email,
|
|
140
|
+
ccEmails: this.ccEmails,
|
|
141
|
+
url: this.url,
|
|
142
|
+
verificationType: this.verificationType,
|
|
143
|
+
verificationDocumentSid: this.verificationDocumentSid,
|
|
144
|
+
extension: this.extension,
|
|
145
|
+
callDelay: this.callDelay,
|
|
146
|
+
verificationCode: this.verificationCode,
|
|
147
|
+
verificationCallSids: this.verificationCallSids,
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
[util_1.inspect.custom](_depth, options) {
|
|
151
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
exports.HostedNumberOrderInstance = HostedNumberOrderInstance;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import OauthBase from "../OauthBase";
|
|
2
|
+
import Version from "../../base/Version";
|
|
3
|
+
import { TokenListInstance } from "./v2/token";
|
|
4
|
+
export default class V2 extends Version {
|
|
5
|
+
/**
|
|
6
|
+
* Initialize the V2 version of Oauth
|
|
7
|
+
*
|
|
8
|
+
* @param domain - The Twilio (Twilio.Oauth) domain
|
|
9
|
+
*/
|
|
10
|
+
constructor(domain: OauthBase);
|
|
11
|
+
/** token - { Twilio.Oauth.V2.TokenListInstance } resource */
|
|
12
|
+
protected _token?: TokenListInstance;
|
|
13
|
+
/** Getter for token resource */
|
|
14
|
+
get token(): TokenListInstance;
|
|
15
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* User OAuth API
|
|
9
|
+
* User OAuth API
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
+
};
|
|
18
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
+
const Version_1 = __importDefault(require("../../base/Version"));
|
|
20
|
+
const token_1 = require("./v2/token");
|
|
21
|
+
class V2 extends Version_1.default {
|
|
22
|
+
/**
|
|
23
|
+
* Initialize the V2 version of Oauth
|
|
24
|
+
*
|
|
25
|
+
* @param domain - The Twilio (Twilio.Oauth) domain
|
|
26
|
+
*/
|
|
27
|
+
constructor(domain) {
|
|
28
|
+
super(domain, "v2");
|
|
29
|
+
}
|
|
30
|
+
/** Getter for token resource */
|
|
31
|
+
get token() {
|
|
32
|
+
this._token = this._token || (0, token_1.TokenListInstance)(this);
|
|
33
|
+
return this._token;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = V2;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { inspect, InspectOptions } from "util";
|
|
2
|
+
import V2 from "../V2";
|
|
3
|
+
/**
|
|
4
|
+
* Options to pass to create a TokenInstance
|
|
5
|
+
*/
|
|
6
|
+
export interface TokenListInstanceCreateOptions {
|
|
7
|
+
/** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */
|
|
8
|
+
grantType: string;
|
|
9
|
+
/** A 34 character string that uniquely identifies this OAuth App. */
|
|
10
|
+
clientId: string;
|
|
11
|
+
/** The credential for confidential OAuth App. */
|
|
12
|
+
clientSecret?: string;
|
|
13
|
+
/** JWT token related to the authorization code grant type. */
|
|
14
|
+
code?: string;
|
|
15
|
+
/** The redirect uri */
|
|
16
|
+
redirectUri?: string;
|
|
17
|
+
/** The targeted audience uri */
|
|
18
|
+
audience?: string;
|
|
19
|
+
/** JWT token related to refresh access token. */
|
|
20
|
+
refreshToken?: string;
|
|
21
|
+
/** The scope of token */
|
|
22
|
+
scope?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface TokenSolution {
|
|
25
|
+
}
|
|
26
|
+
export interface TokenListInstance {
|
|
27
|
+
_version: V2;
|
|
28
|
+
_solution: TokenSolution;
|
|
29
|
+
_uri: string;
|
|
30
|
+
/**
|
|
31
|
+
* Create a TokenInstance
|
|
32
|
+
*
|
|
33
|
+
* @param params - Parameter for request
|
|
34
|
+
* @param callback - Callback to handle processed record
|
|
35
|
+
*
|
|
36
|
+
* @returns Resolves to processed TokenInstance
|
|
37
|
+
*/
|
|
38
|
+
create(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: TokenInstance) => any): Promise<TokenInstance>;
|
|
39
|
+
/**
|
|
40
|
+
* Provide a user-friendly representation
|
|
41
|
+
*/
|
|
42
|
+
toJSON(): any;
|
|
43
|
+
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
44
|
+
}
|
|
45
|
+
export declare function TokenListInstance(version: V2): TokenListInstance;
|
|
46
|
+
interface TokenResource {
|
|
47
|
+
access_token: string;
|
|
48
|
+
refresh_token: string;
|
|
49
|
+
id_token: string;
|
|
50
|
+
token_type: string;
|
|
51
|
+
expires_in: number;
|
|
52
|
+
}
|
|
53
|
+
export declare class TokenInstance {
|
|
54
|
+
protected _version: V2;
|
|
55
|
+
constructor(_version: V2, payload: TokenResource);
|
|
56
|
+
/**
|
|
57
|
+
* Token which carries the necessary information to access a Twilio resource directly.
|
|
58
|
+
*/
|
|
59
|
+
accessToken: string;
|
|
60
|
+
/**
|
|
61
|
+
* Token which carries the information necessary to get a new access token.
|
|
62
|
+
*/
|
|
63
|
+
refreshToken: string;
|
|
64
|
+
/**
|
|
65
|
+
* Token which carries the information necessary of user profile.
|
|
66
|
+
*/
|
|
67
|
+
idToken: string;
|
|
68
|
+
/**
|
|
69
|
+
* Token type
|
|
70
|
+
*/
|
|
71
|
+
tokenType: string;
|
|
72
|
+
expiresIn: number;
|
|
73
|
+
/**
|
|
74
|
+
* Provide a user-friendly representation
|
|
75
|
+
*
|
|
76
|
+
* @returns Object
|
|
77
|
+
*/
|
|
78
|
+
toJSON(): {
|
|
79
|
+
accessToken: string;
|
|
80
|
+
refreshToken: string;
|
|
81
|
+
idToken: string;
|
|
82
|
+
tokenType: string;
|
|
83
|
+
expiresIn: number;
|
|
84
|
+
};
|
|
85
|
+
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* This code was generated by
|
|
4
|
+
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
+
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
+
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
+
*
|
|
8
|
+
* User OAuth API
|
|
9
|
+
* User OAuth API
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator.
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.TokenInstance = void 0;
|
|
17
|
+
exports.TokenListInstance = TokenListInstance;
|
|
18
|
+
const util_1 = require("util");
|
|
19
|
+
const deserialize = require("../../../base/deserialize");
|
|
20
|
+
const serialize = require("../../../base/serialize");
|
|
21
|
+
function TokenListInstance(version) {
|
|
22
|
+
const instance = {};
|
|
23
|
+
instance._version = version;
|
|
24
|
+
instance._solution = {};
|
|
25
|
+
instance._uri = `/token`;
|
|
26
|
+
instance.create = function create(params, callback) {
|
|
27
|
+
if (params === null || params === undefined) {
|
|
28
|
+
throw new Error('Required parameter "params" missing.');
|
|
29
|
+
}
|
|
30
|
+
if (params["grantType"] === null || params["grantType"] === undefined) {
|
|
31
|
+
throw new Error("Required parameter \"params['grantType']\" missing.");
|
|
32
|
+
}
|
|
33
|
+
if (params["clientId"] === null || params["clientId"] === undefined) {
|
|
34
|
+
throw new Error("Required parameter \"params['clientId']\" missing.");
|
|
35
|
+
}
|
|
36
|
+
let data = {};
|
|
37
|
+
data["grant_type"] = params["grantType"];
|
|
38
|
+
data["client_id"] = params["clientId"];
|
|
39
|
+
if (params["clientSecret"] !== undefined)
|
|
40
|
+
data["client_secret"] = params["clientSecret"];
|
|
41
|
+
if (params["code"] !== undefined)
|
|
42
|
+
data["code"] = params["code"];
|
|
43
|
+
if (params["redirectUri"] !== undefined)
|
|
44
|
+
data["redirect_uri"] = params["redirectUri"];
|
|
45
|
+
if (params["audience"] !== undefined)
|
|
46
|
+
data["audience"] = params["audience"];
|
|
47
|
+
if (params["refreshToken"] !== undefined)
|
|
48
|
+
data["refresh_token"] = params["refreshToken"];
|
|
49
|
+
if (params["scope"] !== undefined)
|
|
50
|
+
data["scope"] = params["scope"];
|
|
51
|
+
const headers = {};
|
|
52
|
+
headers["Content-Type"] = "application/x-www-form-urlencoded";
|
|
53
|
+
headers["Accept"] = "application/json";
|
|
54
|
+
let operationVersion = version, operationPromise = operationVersion.create({
|
|
55
|
+
uri: instance._uri,
|
|
56
|
+
method: "post",
|
|
57
|
+
data,
|
|
58
|
+
headers,
|
|
59
|
+
});
|
|
60
|
+
operationPromise = operationPromise.then((payload) => new TokenInstance(operationVersion, payload));
|
|
61
|
+
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
62
|
+
return operationPromise;
|
|
63
|
+
};
|
|
64
|
+
instance.toJSON = function toJSON() {
|
|
65
|
+
return instance._solution;
|
|
66
|
+
};
|
|
67
|
+
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
68
|
+
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
69
|
+
};
|
|
70
|
+
return instance;
|
|
71
|
+
}
|
|
72
|
+
class TokenInstance {
|
|
73
|
+
constructor(_version, payload) {
|
|
74
|
+
this._version = _version;
|
|
75
|
+
this.accessToken = payload.access_token;
|
|
76
|
+
this.refreshToken = payload.refresh_token;
|
|
77
|
+
this.idToken = payload.id_token;
|
|
78
|
+
this.tokenType = payload.token_type;
|
|
79
|
+
this.expiresIn = payload.expires_in;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Provide a user-friendly representation
|
|
83
|
+
*
|
|
84
|
+
* @returns Object
|
|
85
|
+
*/
|
|
86
|
+
toJSON() {
|
|
87
|
+
return {
|
|
88
|
+
accessToken: this.accessToken,
|
|
89
|
+
refreshToken: this.refreshToken,
|
|
90
|
+
idToken: this.idToken,
|
|
91
|
+
tokenType: this.tokenType,
|
|
92
|
+
expiresIn: this.expiresIn,
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
[util_1.inspect.custom](_depth, options) {
|
|
96
|
+
return (0, util_1.inspect)(this.toJSON(), options);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
exports.TokenInstance = TokenInstance;
|
|
@@ -3,9 +3,9 @@ import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
|
|
3
3
|
import Response from "../../../../http/response";
|
|
4
4
|
import V1 from "../../V1";
|
|
5
5
|
export declare class PricingV1MessagingMessagingCountryInstanceInboundSmsPrices {
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"basePrice"?: number;
|
|
7
|
+
"currentPrice"?: number;
|
|
8
|
+
"numberType"?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices {
|
|
11
11
|
"carrier"?: string;
|
|
@@ -14,9 +14,9 @@ export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPrices
|
|
|
14
14
|
"prices"?: Array<PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices>;
|
|
15
15
|
}
|
|
16
16
|
export declare class PricingV1MessagingMessagingCountryInstanceOutboundSmsPricesPrices {
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
17
|
+
"basePrice"?: number;
|
|
18
|
+
"currentPrice"?: number;
|
|
19
|
+
"numberType"?: string;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* Options to pass to each
|
|
@@ -3,9 +3,9 @@ import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
|
|
3
3
|
import Response from "../../../../http/response";
|
|
4
4
|
import V1 from "../../V1";
|
|
5
5
|
export declare class PricingV1PhoneNumberPhoneNumberCountryInstancePhoneNumberPrices {
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"basePrice"?: number;
|
|
7
|
+
"currentPrice"?: number;
|
|
8
|
+
"numberType"?: string;
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* Options to pass to each
|
|
@@ -3,15 +3,15 @@ import Page, { TwilioResponsePayload } from "../../../../base/Page";
|
|
|
3
3
|
import Response from "../../../../http/response";
|
|
4
4
|
import V1 from "../../V1";
|
|
5
5
|
export declare class PricingV1VoiceVoiceCountryInstanceInboundCallPrices {
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
6
|
+
"basePrice"?: number;
|
|
7
|
+
"currentPrice"?: number;
|
|
8
|
+
"numberType"?: string;
|
|
9
9
|
}
|
|
10
10
|
export declare class PricingV1VoiceVoiceCountryInstanceOutboundPrefixPrices {
|
|
11
11
|
"prefixes"?: Array<string>;
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
12
|
+
"basePrice"?: number;
|
|
13
|
+
"currentPrice"?: number;
|
|
14
|
+
"friendlyName"?: string;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Options to pass to each
|