twilio 5.0.0 → 5.0.2
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/lib/rest/Oauth.d.ts +4 -0
- package/lib/rest/{Media.js → Oauth.js} +3 -3
- package/lib/rest/{MediaBase.d.ts → OauthBase.d.ts} +4 -4
- package/lib/rest/{MediaBase.js → OauthBase.js} +5 -5
- package/lib/rest/Twilio.d.ts +5 -5
- package/lib/rest/Twilio.js +5 -5
- package/lib/rest/api/v2010/account/call.d.ts +34 -10
- package/lib/rest/api/v2010/account/call.js +8 -0
- package/lib/rest/api/v2010/account/conference/participant.d.ts +6 -0
- package/lib/rest/api/v2010/account/conference/participant.js +2 -0
- package/lib/rest/api/v2010/account/conference.d.ts +24 -0
- package/lib/rest/api/v2010/account/conference.js +8 -0
- package/lib/rest/api/v2010/account/message.d.ts +12 -0
- package/lib/rest/api/v2010/account/message.js +4 -0
- package/lib/rest/content/v1/content/approvalCreate.d.ts +3 -3
- package/lib/rest/content/v1/content/approvalCreate.js +7 -7
- package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
- package/lib/rest/content/v1/content/approvalFetch.js +14 -14
- package/lib/rest/content/v1/content.d.ts +20 -0
- package/lib/rest/content/v1/content.js +10 -1
- package/lib/rest/conversations/v1/service/conversation.d.ts +6 -6
- package/lib/rest/flexApi/v1/plugin.d.ts +4 -0
- package/lib/rest/flexApi/v1/plugin.js +4 -0
- package/lib/rest/numbers/v1/portingPortInFetch.d.ts +6 -0
- package/lib/rest/numbers/v1/portingPortInFetch.js +2 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +12 -0
- package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +4 -0
- package/lib/rest/oauth/V1.d.ts +20 -0
- package/lib/rest/oauth/V1.js +42 -0
- package/lib/rest/oauth/v1/authorize.d.ts +69 -0
- package/lib/rest/oauth/v1/authorize.js +83 -0
- package/lib/rest/oauth/v1/token.d.ts +88 -0
- package/lib/rest/oauth/v1/token.js +98 -0
- package/lib/rest/trusthub/v1/complianceRegistrationInquiries.d.ts +84 -10
- package/lib/rest/trusthub/v1/complianceRegistrationInquiries.js +92 -28
- package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.d.ts +6 -0
- package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js +2 -0
- package/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.d.ts +6 -0
- package/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js +2 -0
- package/lib/rest/trusthub/v1/trustProducts.d.ts +16 -16
- package/lib/twiml/VoiceResponse.d.ts +2 -2
- package/package.json +1 -1
- package/lib/rest/Media.d.ts +0 -4
- package/lib/rest/media/V1.d.ts +0 -25
- package/lib/rest/media/V1.js +0 -51
- package/lib/rest/media/v1/mediaProcessor.d.ts +0 -317
- package/lib/rest/media/v1/mediaProcessor.js +0 -256
- package/lib/rest/media/v1/mediaRecording.d.ts +0 -309
- package/lib/rest/media/v1/mediaRecording.js +0 -226
- package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +0 -151
- package/lib/rest/media/v1/playerStreamer/playbackGrant.js +0 -146
- package/lib/rest/media/v1/playerStreamer.d.ts +0 -327
- package/lib/rest/media/v1/playerStreamer.js +0 -264
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { inspect, InspectOptions } from "util";
|
|
3
|
-
import Page, { TwilioResponsePayload } from "../../../base/Page";
|
|
4
|
-
import Response from "../../../http/response";
|
|
5
|
-
import V1 from "../V1";
|
|
6
|
-
export type MediaRecordingFormat = "mp4" | "webm";
|
|
7
|
-
export type MediaRecordingOrder = "asc" | "desc";
|
|
8
|
-
export type MediaRecordingStatus = "processing" | "completed" | "deleted" | "failed";
|
|
9
|
-
/**
|
|
10
|
-
* Options to pass to each
|
|
11
|
-
*/
|
|
12
|
-
export interface MediaRecordingListInstanceEachOptions {
|
|
13
|
-
/** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */
|
|
14
|
-
order?: MediaRecordingOrder;
|
|
15
|
-
/** Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. */
|
|
16
|
-
status?: MediaRecordingStatus;
|
|
17
|
-
/** SID of a MediaProcessor to filter by. */
|
|
18
|
-
processorSid?: string;
|
|
19
|
-
/** SID of a MediaRecording source to filter by. */
|
|
20
|
-
sourceSid?: string;
|
|
21
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
22
|
-
pageSize?: number;
|
|
23
|
-
/** Function to process each record. If this and a positional callback are passed, this one will be used */
|
|
24
|
-
callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void;
|
|
25
|
-
/** Function to be called upon completion of streaming */
|
|
26
|
-
done?: Function;
|
|
27
|
-
/** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */
|
|
28
|
-
limit?: number;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Options to pass to list
|
|
32
|
-
*/
|
|
33
|
-
export interface MediaRecordingListInstanceOptions {
|
|
34
|
-
/** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */
|
|
35
|
-
order?: MediaRecordingOrder;
|
|
36
|
-
/** Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. */
|
|
37
|
-
status?: MediaRecordingStatus;
|
|
38
|
-
/** SID of a MediaProcessor to filter by. */
|
|
39
|
-
processorSid?: string;
|
|
40
|
-
/** SID of a MediaRecording source to filter by. */
|
|
41
|
-
sourceSid?: string;
|
|
42
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
43
|
-
pageSize?: number;
|
|
44
|
-
/** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
|
|
45
|
-
limit?: number;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Options to pass to page
|
|
49
|
-
*/
|
|
50
|
-
export interface MediaRecordingListInstancePageOptions {
|
|
51
|
-
/** The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. */
|
|
52
|
-
order?: MediaRecordingOrder;
|
|
53
|
-
/** Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. */
|
|
54
|
-
status?: MediaRecordingStatus;
|
|
55
|
-
/** SID of a MediaProcessor to filter by. */
|
|
56
|
-
processorSid?: string;
|
|
57
|
-
/** SID of a MediaRecording source to filter by. */
|
|
58
|
-
sourceSid?: string;
|
|
59
|
-
/** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
|
|
60
|
-
pageSize?: number;
|
|
61
|
-
/** Page Number, this value is simply for client state */
|
|
62
|
-
pageNumber?: number;
|
|
63
|
-
/** PageToken provided by the API */
|
|
64
|
-
pageToken?: string;
|
|
65
|
-
}
|
|
66
|
-
export interface MediaRecordingContext {
|
|
67
|
-
/**
|
|
68
|
-
* Remove a MediaRecordingInstance
|
|
69
|
-
*
|
|
70
|
-
* @param callback - Callback to handle processed record
|
|
71
|
-
*
|
|
72
|
-
* @returns Resolves to processed boolean
|
|
73
|
-
*/
|
|
74
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
75
|
-
/**
|
|
76
|
-
* Fetch a MediaRecordingInstance
|
|
77
|
-
*
|
|
78
|
-
* @param callback - Callback to handle processed record
|
|
79
|
-
*
|
|
80
|
-
* @returns Resolves to processed MediaRecordingInstance
|
|
81
|
-
*/
|
|
82
|
-
fetch(callback?: (error: Error | null, item?: MediaRecordingInstance) => any): Promise<MediaRecordingInstance>;
|
|
83
|
-
/**
|
|
84
|
-
* Provide a user-friendly representation
|
|
85
|
-
*/
|
|
86
|
-
toJSON(): any;
|
|
87
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
88
|
-
}
|
|
89
|
-
export interface MediaRecordingContextSolution {
|
|
90
|
-
sid: string;
|
|
91
|
-
}
|
|
92
|
-
export declare class MediaRecordingContextImpl implements MediaRecordingContext {
|
|
93
|
-
protected _version: V1;
|
|
94
|
-
protected _solution: MediaRecordingContextSolution;
|
|
95
|
-
protected _uri: string;
|
|
96
|
-
constructor(_version: V1, sid: string);
|
|
97
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
98
|
-
fetch(callback?: (error: Error | null, item?: MediaRecordingInstance) => any): Promise<MediaRecordingInstance>;
|
|
99
|
-
/**
|
|
100
|
-
* Provide a user-friendly representation
|
|
101
|
-
*
|
|
102
|
-
* @returns Object
|
|
103
|
-
*/
|
|
104
|
-
toJSON(): MediaRecordingContextSolution;
|
|
105
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
106
|
-
}
|
|
107
|
-
interface MediaRecordingPayload extends TwilioResponsePayload {
|
|
108
|
-
media_recordings: MediaRecordingResource[];
|
|
109
|
-
}
|
|
110
|
-
interface MediaRecordingResource {
|
|
111
|
-
account_sid: string;
|
|
112
|
-
date_created: Date;
|
|
113
|
-
date_updated: Date;
|
|
114
|
-
duration: number;
|
|
115
|
-
format: MediaRecordingFormat;
|
|
116
|
-
links: Record<string, string>;
|
|
117
|
-
processor_sid: string;
|
|
118
|
-
resolution: string;
|
|
119
|
-
source_sid: string;
|
|
120
|
-
sid: string;
|
|
121
|
-
media_size: number;
|
|
122
|
-
status: MediaRecordingStatus;
|
|
123
|
-
status_callback: string;
|
|
124
|
-
status_callback_method: string;
|
|
125
|
-
url: string;
|
|
126
|
-
}
|
|
127
|
-
export declare class MediaRecordingInstance {
|
|
128
|
-
protected _version: V1;
|
|
129
|
-
protected _solution: MediaRecordingContextSolution;
|
|
130
|
-
protected _context?: MediaRecordingContext;
|
|
131
|
-
constructor(_version: V1, payload: MediaRecordingResource, sid?: string);
|
|
132
|
-
/**
|
|
133
|
-
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaRecording resource.
|
|
134
|
-
*/
|
|
135
|
-
accountSid: string;
|
|
136
|
-
/**
|
|
137
|
-
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
138
|
-
*/
|
|
139
|
-
dateCreated: Date;
|
|
140
|
-
/**
|
|
141
|
-
* The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
142
|
-
*/
|
|
143
|
-
dateUpdated: Date;
|
|
144
|
-
/**
|
|
145
|
-
* The duration of the MediaRecording in seconds.
|
|
146
|
-
*/
|
|
147
|
-
duration: number;
|
|
148
|
-
format: MediaRecordingFormat;
|
|
149
|
-
/**
|
|
150
|
-
* The URLs of related resources.
|
|
151
|
-
*/
|
|
152
|
-
links: Record<string, string>;
|
|
153
|
-
/**
|
|
154
|
-
* The SID of the MediaProcessor resource which produced the MediaRecording.
|
|
155
|
-
*/
|
|
156
|
-
processorSid: string;
|
|
157
|
-
/**
|
|
158
|
-
* The dimensions of the video image in pixels expressed as columns (width) and rows (height).
|
|
159
|
-
*/
|
|
160
|
-
resolution: string;
|
|
161
|
-
/**
|
|
162
|
-
* The SID of the resource that generated the original media track(s) of the MediaRecording.
|
|
163
|
-
*/
|
|
164
|
-
sourceSid: string;
|
|
165
|
-
/**
|
|
166
|
-
* The unique string generated to identify the MediaRecording resource.
|
|
167
|
-
*/
|
|
168
|
-
sid: string;
|
|
169
|
-
/**
|
|
170
|
-
* The size of the recording media in bytes.
|
|
171
|
-
*/
|
|
172
|
-
mediaSize: number;
|
|
173
|
-
status: MediaRecordingStatus;
|
|
174
|
-
/**
|
|
175
|
-
* The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details.
|
|
176
|
-
*/
|
|
177
|
-
statusCallback: string;
|
|
178
|
-
/**
|
|
179
|
-
* The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`.
|
|
180
|
-
*/
|
|
181
|
-
statusCallbackMethod: string;
|
|
182
|
-
/**
|
|
183
|
-
* The absolute URL of the resource.
|
|
184
|
-
*/
|
|
185
|
-
url: string;
|
|
186
|
-
private get _proxy();
|
|
187
|
-
/**
|
|
188
|
-
* Remove a MediaRecordingInstance
|
|
189
|
-
*
|
|
190
|
-
* @param callback - Callback to handle processed record
|
|
191
|
-
*
|
|
192
|
-
* @returns Resolves to processed boolean
|
|
193
|
-
*/
|
|
194
|
-
remove(callback?: (error: Error | null, item?: boolean) => any): Promise<boolean>;
|
|
195
|
-
/**
|
|
196
|
-
* Fetch a MediaRecordingInstance
|
|
197
|
-
*
|
|
198
|
-
* @param callback - Callback to handle processed record
|
|
199
|
-
*
|
|
200
|
-
* @returns Resolves to processed MediaRecordingInstance
|
|
201
|
-
*/
|
|
202
|
-
fetch(callback?: (error: Error | null, item?: MediaRecordingInstance) => any): Promise<MediaRecordingInstance>;
|
|
203
|
-
/**
|
|
204
|
-
* Provide a user-friendly representation
|
|
205
|
-
*
|
|
206
|
-
* @returns Object
|
|
207
|
-
*/
|
|
208
|
-
toJSON(): {
|
|
209
|
-
accountSid: string;
|
|
210
|
-
dateCreated: Date;
|
|
211
|
-
dateUpdated: Date;
|
|
212
|
-
duration: number;
|
|
213
|
-
format: MediaRecordingFormat;
|
|
214
|
-
links: Record<string, string>;
|
|
215
|
-
processorSid: string;
|
|
216
|
-
resolution: string;
|
|
217
|
-
sourceSid: string;
|
|
218
|
-
sid: string;
|
|
219
|
-
mediaSize: number;
|
|
220
|
-
status: MediaRecordingStatus;
|
|
221
|
-
statusCallback: string;
|
|
222
|
-
statusCallbackMethod: string;
|
|
223
|
-
url: string;
|
|
224
|
-
};
|
|
225
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
226
|
-
}
|
|
227
|
-
export interface MediaRecordingSolution {
|
|
228
|
-
}
|
|
229
|
-
export interface MediaRecordingListInstance {
|
|
230
|
-
_version: V1;
|
|
231
|
-
_solution: MediaRecordingSolution;
|
|
232
|
-
_uri: string;
|
|
233
|
-
(sid: string): MediaRecordingContext;
|
|
234
|
-
get(sid: string): MediaRecordingContext;
|
|
235
|
-
/**
|
|
236
|
-
* Streams MediaRecordingInstance records from the API.
|
|
237
|
-
*
|
|
238
|
-
* This operation lazily loads records as efficiently as possible until the limit
|
|
239
|
-
* is reached.
|
|
240
|
-
*
|
|
241
|
-
* The results are passed into the callback function, so this operation is memory
|
|
242
|
-
* efficient.
|
|
243
|
-
*
|
|
244
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
245
|
-
* function.
|
|
246
|
-
*
|
|
247
|
-
* @param { MediaRecordingListInstanceEachOptions } [params] - Options for request
|
|
248
|
-
* @param { function } [callback] - Function to process each record
|
|
249
|
-
*/
|
|
250
|
-
each(callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void): void;
|
|
251
|
-
each(params: MediaRecordingListInstanceEachOptions, callback?: (item: MediaRecordingInstance, done: (err?: Error) => void) => void): void;
|
|
252
|
-
/**
|
|
253
|
-
* Retrieve a single target page of MediaRecordingInstance records from the API.
|
|
254
|
-
*
|
|
255
|
-
* The request is executed immediately.
|
|
256
|
-
*
|
|
257
|
-
* @param { string } [targetUrl] - API-generated URL for the requested results page
|
|
258
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
259
|
-
*/
|
|
260
|
-
getPage(targetUrl: string, callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
|
|
261
|
-
/**
|
|
262
|
-
* Lists MediaRecordingInstance records from the API as a list.
|
|
263
|
-
*
|
|
264
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
265
|
-
* function.
|
|
266
|
-
*
|
|
267
|
-
* @param { MediaRecordingListInstanceOptions } [params] - Options for request
|
|
268
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
269
|
-
*/
|
|
270
|
-
list(callback?: (error: Error | null, items: MediaRecordingInstance[]) => any): Promise<MediaRecordingInstance[]>;
|
|
271
|
-
list(params: MediaRecordingListInstanceOptions, callback?: (error: Error | null, items: MediaRecordingInstance[]) => any): Promise<MediaRecordingInstance[]>;
|
|
272
|
-
/**
|
|
273
|
-
* Retrieve a single page of MediaRecordingInstance records from the API.
|
|
274
|
-
*
|
|
275
|
-
* The request is executed immediately.
|
|
276
|
-
*
|
|
277
|
-
* If a function is passed as the first argument, it will be used as the callback
|
|
278
|
-
* function.
|
|
279
|
-
*
|
|
280
|
-
* @param { MediaRecordingListInstancePageOptions } [params] - Options for request
|
|
281
|
-
* @param { function } [callback] - Callback to handle list of records
|
|
282
|
-
*/
|
|
283
|
-
page(callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
|
|
284
|
-
page(params: MediaRecordingListInstancePageOptions, callback?: (error: Error | null, items: MediaRecordingPage) => any): Promise<MediaRecordingPage>;
|
|
285
|
-
/**
|
|
286
|
-
* Provide a user-friendly representation
|
|
287
|
-
*/
|
|
288
|
-
toJSON(): any;
|
|
289
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
290
|
-
}
|
|
291
|
-
export declare function MediaRecordingListInstance(version: V1): MediaRecordingListInstance;
|
|
292
|
-
export declare class MediaRecordingPage extends Page<V1, MediaRecordingPayload, MediaRecordingResource, MediaRecordingInstance> {
|
|
293
|
-
/**
|
|
294
|
-
* Initialize the MediaRecordingPage
|
|
295
|
-
*
|
|
296
|
-
* @param version - Version of the resource
|
|
297
|
-
* @param response - Response from the API
|
|
298
|
-
* @param solution - Path solution
|
|
299
|
-
*/
|
|
300
|
-
constructor(version: V1, response: Response<string>, solution: MediaRecordingSolution);
|
|
301
|
-
/**
|
|
302
|
-
* Build an instance of MediaRecordingInstance
|
|
303
|
-
*
|
|
304
|
-
* @param payload - Payload response from the API
|
|
305
|
-
*/
|
|
306
|
-
getInstance(payload: MediaRecordingResource): MediaRecordingInstance;
|
|
307
|
-
[inspect.custom](depth: any, options: InspectOptions): string;
|
|
308
|
-
}
|
|
309
|
-
export {};
|
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/*
|
|
3
|
-
* This code was generated by
|
|
4
|
-
* ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
|
|
5
|
-
* | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
|
|
6
|
-
* | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
|
|
7
|
-
*
|
|
8
|
-
* Twilio - Media
|
|
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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
16
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17
|
-
};
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.MediaRecordingPage = exports.MediaRecordingListInstance = exports.MediaRecordingInstance = exports.MediaRecordingContextImpl = void 0;
|
|
20
|
-
const util_1 = require("util");
|
|
21
|
-
const Page_1 = __importDefault(require("../../../base/Page"));
|
|
22
|
-
const deserialize = require("../../../base/deserialize");
|
|
23
|
-
const serialize = require("../../../base/serialize");
|
|
24
|
-
const utility_1 = require("../../../base/utility");
|
|
25
|
-
class MediaRecordingContextImpl {
|
|
26
|
-
constructor(_version, sid) {
|
|
27
|
-
this._version = _version;
|
|
28
|
-
if (!(0, utility_1.isValidPathParam)(sid)) {
|
|
29
|
-
throw new Error("Parameter 'sid' is not valid.");
|
|
30
|
-
}
|
|
31
|
-
this._solution = { sid };
|
|
32
|
-
this._uri = `/MediaRecordings/${sid}`;
|
|
33
|
-
}
|
|
34
|
-
remove(callback) {
|
|
35
|
-
const instance = this;
|
|
36
|
-
let operationVersion = instance._version, operationPromise = operationVersion.remove({
|
|
37
|
-
uri: instance._uri,
|
|
38
|
-
method: "delete",
|
|
39
|
-
});
|
|
40
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
41
|
-
return operationPromise;
|
|
42
|
-
}
|
|
43
|
-
fetch(callback) {
|
|
44
|
-
const instance = this;
|
|
45
|
-
let operationVersion = instance._version, operationPromise = operationVersion.fetch({
|
|
46
|
-
uri: instance._uri,
|
|
47
|
-
method: "get",
|
|
48
|
-
});
|
|
49
|
-
operationPromise = operationPromise.then((payload) => new MediaRecordingInstance(operationVersion, payload, instance._solution.sid));
|
|
50
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
51
|
-
return operationPromise;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Provide a user-friendly representation
|
|
55
|
-
*
|
|
56
|
-
* @returns Object
|
|
57
|
-
*/
|
|
58
|
-
toJSON() {
|
|
59
|
-
return this._solution;
|
|
60
|
-
}
|
|
61
|
-
[util_1.inspect.custom](_depth, options) {
|
|
62
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
exports.MediaRecordingContextImpl = MediaRecordingContextImpl;
|
|
66
|
-
class MediaRecordingInstance {
|
|
67
|
-
constructor(_version, payload, sid) {
|
|
68
|
-
this._version = _version;
|
|
69
|
-
this.accountSid = payload.account_sid;
|
|
70
|
-
this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
|
|
71
|
-
this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
|
|
72
|
-
this.duration = deserialize.integer(payload.duration);
|
|
73
|
-
this.format = payload.format;
|
|
74
|
-
this.links = payload.links;
|
|
75
|
-
this.processorSid = payload.processor_sid;
|
|
76
|
-
this.resolution = payload.resolution;
|
|
77
|
-
this.sourceSid = payload.source_sid;
|
|
78
|
-
this.sid = payload.sid;
|
|
79
|
-
this.mediaSize = payload.media_size;
|
|
80
|
-
this.status = payload.status;
|
|
81
|
-
this.statusCallback = payload.status_callback;
|
|
82
|
-
this.statusCallbackMethod = payload.status_callback_method;
|
|
83
|
-
this.url = payload.url;
|
|
84
|
-
this._solution = { sid: sid || this.sid };
|
|
85
|
-
}
|
|
86
|
-
get _proxy() {
|
|
87
|
-
this._context =
|
|
88
|
-
this._context ||
|
|
89
|
-
new MediaRecordingContextImpl(this._version, this._solution.sid);
|
|
90
|
-
return this._context;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Remove a MediaRecordingInstance
|
|
94
|
-
*
|
|
95
|
-
* @param callback - Callback to handle processed record
|
|
96
|
-
*
|
|
97
|
-
* @returns Resolves to processed boolean
|
|
98
|
-
*/
|
|
99
|
-
remove(callback) {
|
|
100
|
-
return this._proxy.remove(callback);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Fetch a MediaRecordingInstance
|
|
104
|
-
*
|
|
105
|
-
* @param callback - Callback to handle processed record
|
|
106
|
-
*
|
|
107
|
-
* @returns Resolves to processed MediaRecordingInstance
|
|
108
|
-
*/
|
|
109
|
-
fetch(callback) {
|
|
110
|
-
return this._proxy.fetch(callback);
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* Provide a user-friendly representation
|
|
114
|
-
*
|
|
115
|
-
* @returns Object
|
|
116
|
-
*/
|
|
117
|
-
toJSON() {
|
|
118
|
-
return {
|
|
119
|
-
accountSid: this.accountSid,
|
|
120
|
-
dateCreated: this.dateCreated,
|
|
121
|
-
dateUpdated: this.dateUpdated,
|
|
122
|
-
duration: this.duration,
|
|
123
|
-
format: this.format,
|
|
124
|
-
links: this.links,
|
|
125
|
-
processorSid: this.processorSid,
|
|
126
|
-
resolution: this.resolution,
|
|
127
|
-
sourceSid: this.sourceSid,
|
|
128
|
-
sid: this.sid,
|
|
129
|
-
mediaSize: this.mediaSize,
|
|
130
|
-
status: this.status,
|
|
131
|
-
statusCallback: this.statusCallback,
|
|
132
|
-
statusCallbackMethod: this.statusCallbackMethod,
|
|
133
|
-
url: this.url,
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
[util_1.inspect.custom](_depth, options) {
|
|
137
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
exports.MediaRecordingInstance = MediaRecordingInstance;
|
|
141
|
-
function MediaRecordingListInstance(version) {
|
|
142
|
-
const instance = ((sid) => instance.get(sid));
|
|
143
|
-
instance.get = function get(sid) {
|
|
144
|
-
return new MediaRecordingContextImpl(version, sid);
|
|
145
|
-
};
|
|
146
|
-
instance._version = version;
|
|
147
|
-
instance._solution = {};
|
|
148
|
-
instance._uri = `/MediaRecordings`;
|
|
149
|
-
instance.page = function page(params, callback) {
|
|
150
|
-
if (params instanceof Function) {
|
|
151
|
-
callback = params;
|
|
152
|
-
params = {};
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
params = params || {};
|
|
156
|
-
}
|
|
157
|
-
let data = {};
|
|
158
|
-
if (params["order"] !== undefined)
|
|
159
|
-
data["Order"] = params["order"];
|
|
160
|
-
if (params["status"] !== undefined)
|
|
161
|
-
data["Status"] = params["status"];
|
|
162
|
-
if (params["processorSid"] !== undefined)
|
|
163
|
-
data["ProcessorSid"] = params["processorSid"];
|
|
164
|
-
if (params["sourceSid"] !== undefined)
|
|
165
|
-
data["SourceSid"] = params["sourceSid"];
|
|
166
|
-
if (params["pageSize"] !== undefined)
|
|
167
|
-
data["PageSize"] = params["pageSize"];
|
|
168
|
-
if (params.pageNumber !== undefined)
|
|
169
|
-
data["Page"] = params.pageNumber;
|
|
170
|
-
if (params.pageToken !== undefined)
|
|
171
|
-
data["PageToken"] = params.pageToken;
|
|
172
|
-
const headers = {};
|
|
173
|
-
let operationVersion = version, operationPromise = operationVersion.page({
|
|
174
|
-
uri: instance._uri,
|
|
175
|
-
method: "get",
|
|
176
|
-
params: data,
|
|
177
|
-
headers,
|
|
178
|
-
});
|
|
179
|
-
operationPromise = operationPromise.then((payload) => new MediaRecordingPage(operationVersion, payload, instance._solution));
|
|
180
|
-
operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
|
|
181
|
-
return operationPromise;
|
|
182
|
-
};
|
|
183
|
-
instance.each = instance._version.each;
|
|
184
|
-
instance.list = instance._version.list;
|
|
185
|
-
instance.getPage = function getPage(targetUrl, callback) {
|
|
186
|
-
const operationPromise = instance._version._domain.twilio.request({
|
|
187
|
-
method: "get",
|
|
188
|
-
uri: targetUrl,
|
|
189
|
-
});
|
|
190
|
-
let pagePromise = operationPromise.then((payload) => new MediaRecordingPage(instance._version, payload, instance._solution));
|
|
191
|
-
pagePromise = instance._version.setPromiseCallback(pagePromise, callback);
|
|
192
|
-
return pagePromise;
|
|
193
|
-
};
|
|
194
|
-
instance.toJSON = function toJSON() {
|
|
195
|
-
return instance._solution;
|
|
196
|
-
};
|
|
197
|
-
instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
|
|
198
|
-
return (0, util_1.inspect)(instance.toJSON(), options);
|
|
199
|
-
};
|
|
200
|
-
return instance;
|
|
201
|
-
}
|
|
202
|
-
exports.MediaRecordingListInstance = MediaRecordingListInstance;
|
|
203
|
-
class MediaRecordingPage extends Page_1.default {
|
|
204
|
-
/**
|
|
205
|
-
* Initialize the MediaRecordingPage
|
|
206
|
-
*
|
|
207
|
-
* @param version - Version of the resource
|
|
208
|
-
* @param response - Response from the API
|
|
209
|
-
* @param solution - Path solution
|
|
210
|
-
*/
|
|
211
|
-
constructor(version, response, solution) {
|
|
212
|
-
super(version, response, solution);
|
|
213
|
-
}
|
|
214
|
-
/**
|
|
215
|
-
* Build an instance of MediaRecordingInstance
|
|
216
|
-
*
|
|
217
|
-
* @param payload - Payload response from the API
|
|
218
|
-
*/
|
|
219
|
-
getInstance(payload) {
|
|
220
|
-
return new MediaRecordingInstance(this._version, payload);
|
|
221
|
-
}
|
|
222
|
-
[util_1.inspect.custom](depth, options) {
|
|
223
|
-
return (0, util_1.inspect)(this.toJSON(), options);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
exports.MediaRecordingPage = MediaRecordingPage;
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { inspect, InspectOptions } from "util";
|
|
3
|
-
import V1 from "../../V1";
|
|
4
|
-
/**
|
|
5
|
-
* Options to pass to create a PlaybackGrantInstance
|
|
6
|
-
*/
|
|
7
|
-
export interface PlaybackGrantContextCreateOptions {
|
|
8
|
-
/** The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. */
|
|
9
|
-
ttl?: number;
|
|
10
|
-
/** The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. */
|
|
11
|
-
accessControlAllowOrigin?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface PlaybackGrantContext {
|
|
14
|
-
/**
|
|
15
|
-
* Create a PlaybackGrantInstance
|
|
16
|
-
*
|
|
17
|
-
* @param callback - Callback to handle processed record
|
|
18
|
-
*
|
|
19
|
-
* @returns Resolves to processed PlaybackGrantInstance
|
|
20
|
-
*/
|
|
21
|
-
create(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
22
|
-
/**
|
|
23
|
-
* Create a PlaybackGrantInstance
|
|
24
|
-
*
|
|
25
|
-
* @param params - Parameter for request
|
|
26
|
-
* @param callback - Callback to handle processed record
|
|
27
|
-
*
|
|
28
|
-
* @returns Resolves to processed PlaybackGrantInstance
|
|
29
|
-
*/
|
|
30
|
-
create(params: PlaybackGrantContextCreateOptions, callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
31
|
-
/**
|
|
32
|
-
* Fetch a PlaybackGrantInstance
|
|
33
|
-
*
|
|
34
|
-
* @param callback - Callback to handle processed record
|
|
35
|
-
*
|
|
36
|
-
* @returns Resolves to processed PlaybackGrantInstance
|
|
37
|
-
*/
|
|
38
|
-
fetch(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
39
|
-
/**
|
|
40
|
-
* Provide a user-friendly representation
|
|
41
|
-
*/
|
|
42
|
-
toJSON(): any;
|
|
43
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
44
|
-
}
|
|
45
|
-
export interface PlaybackGrantContextSolution {
|
|
46
|
-
sid: string;
|
|
47
|
-
}
|
|
48
|
-
export declare class PlaybackGrantContextImpl implements PlaybackGrantContext {
|
|
49
|
-
protected _version: V1;
|
|
50
|
-
protected _solution: PlaybackGrantContextSolution;
|
|
51
|
-
protected _uri: string;
|
|
52
|
-
constructor(_version: V1, sid: string);
|
|
53
|
-
create(params?: PlaybackGrantContextCreateOptions | ((error: Error | null, item?: PlaybackGrantInstance) => any), callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
54
|
-
fetch(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
55
|
-
/**
|
|
56
|
-
* Provide a user-friendly representation
|
|
57
|
-
*
|
|
58
|
-
* @returns Object
|
|
59
|
-
*/
|
|
60
|
-
toJSON(): PlaybackGrantContextSolution;
|
|
61
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
62
|
-
}
|
|
63
|
-
interface PlaybackGrantResource {
|
|
64
|
-
sid: string;
|
|
65
|
-
url: string;
|
|
66
|
-
account_sid: string;
|
|
67
|
-
date_created: Date;
|
|
68
|
-
grant: any;
|
|
69
|
-
}
|
|
70
|
-
export declare class PlaybackGrantInstance {
|
|
71
|
-
protected _version: V1;
|
|
72
|
-
protected _solution: PlaybackGrantContextSolution;
|
|
73
|
-
protected _context?: PlaybackGrantContext;
|
|
74
|
-
constructor(_version: V1, payload: PlaybackGrantResource, sid: string);
|
|
75
|
-
/**
|
|
76
|
-
* The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for.
|
|
77
|
-
*/
|
|
78
|
-
sid: string;
|
|
79
|
-
/**
|
|
80
|
-
* The absolute URL of the resource.
|
|
81
|
-
*/
|
|
82
|
-
url: string;
|
|
83
|
-
/**
|
|
84
|
-
* The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this resource.
|
|
85
|
-
*/
|
|
86
|
-
accountSid: string;
|
|
87
|
-
/**
|
|
88
|
-
* The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
|
|
89
|
-
*/
|
|
90
|
-
dateCreated: Date;
|
|
91
|
-
/**
|
|
92
|
-
* The grant that authorizes the player sdk to connect to the livestream
|
|
93
|
-
*/
|
|
94
|
-
grant: any;
|
|
95
|
-
private get _proxy();
|
|
96
|
-
/**
|
|
97
|
-
* Create a PlaybackGrantInstance
|
|
98
|
-
*
|
|
99
|
-
* @param callback - Callback to handle processed record
|
|
100
|
-
*
|
|
101
|
-
* @returns Resolves to processed PlaybackGrantInstance
|
|
102
|
-
*/
|
|
103
|
-
create(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
104
|
-
/**
|
|
105
|
-
* Create a PlaybackGrantInstance
|
|
106
|
-
*
|
|
107
|
-
* @param params - Parameter for request
|
|
108
|
-
* @param callback - Callback to handle processed record
|
|
109
|
-
*
|
|
110
|
-
* @returns Resolves to processed PlaybackGrantInstance
|
|
111
|
-
*/
|
|
112
|
-
create(params: PlaybackGrantContextCreateOptions, callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
113
|
-
/**
|
|
114
|
-
* Fetch a PlaybackGrantInstance
|
|
115
|
-
*
|
|
116
|
-
* @param callback - Callback to handle processed record
|
|
117
|
-
*
|
|
118
|
-
* @returns Resolves to processed PlaybackGrantInstance
|
|
119
|
-
*/
|
|
120
|
-
fetch(callback?: (error: Error | null, item?: PlaybackGrantInstance) => any): Promise<PlaybackGrantInstance>;
|
|
121
|
-
/**
|
|
122
|
-
* Provide a user-friendly representation
|
|
123
|
-
*
|
|
124
|
-
* @returns Object
|
|
125
|
-
*/
|
|
126
|
-
toJSON(): {
|
|
127
|
-
sid: string;
|
|
128
|
-
url: string;
|
|
129
|
-
accountSid: string;
|
|
130
|
-
dateCreated: Date;
|
|
131
|
-
grant: any;
|
|
132
|
-
};
|
|
133
|
-
[inspect.custom](_depth: any, options: InspectOptions): string;
|
|
134
|
-
}
|
|
135
|
-
export interface PlaybackGrantSolution {
|
|
136
|
-
sid: string;
|
|
137
|
-
}
|
|
138
|
-
export interface PlaybackGrantListInstance {
|
|
139
|
-
_version: V1;
|
|
140
|
-
_solution: PlaybackGrantSolution;
|
|
141
|
-
_uri: string;
|
|
142
|
-
(): PlaybackGrantContext;
|
|
143
|
-
get(): PlaybackGrantContext;
|
|
144
|
-
/**
|
|
145
|
-
* Provide a user-friendly representation
|
|
146
|
-
*/
|
|
147
|
-
toJSON(): any;
|
|
148
|
-
[inspect.custom](_depth: any, options: InspectOptions): any;
|
|
149
|
-
}
|
|
150
|
-
export declare function PlaybackGrantListInstance(version: V1, sid: string): PlaybackGrantListInstance;
|
|
151
|
-
export {};
|