twilio 3.83.0 → 3.83.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.
Files changed (34) hide show
  1. package/lib/rest/FlexApi.d.ts +4 -0
  2. package/lib/rest/FlexApi.js +16 -0
  3. package/lib/rest/api/v2010/account/call/userDefinedMessage.d.ts +107 -0
  4. package/lib/rest/api/v2010/account/call/userDefinedMessage.js +258 -0
  5. package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.d.ts +153 -0
  6. package/lib/rest/api/v2010/account/call/userDefinedMessageSubscription.js +407 -0
  7. package/lib/rest/api/v2010/account/call.d.ts +14 -0
  8. package/lib/rest/api/v2010/account/call.js +67 -0
  9. package/lib/rest/api/v2010/account/message.d.ts +4 -0
  10. package/lib/rest/api/v2010/account/message.js +7 -1
  11. package/lib/rest/flexApi/V1.d.ts +6 -0
  12. package/lib/rest/flexApi/V1.js +22 -0
  13. package/lib/rest/flexApi/v1/goodData.d.ts +142 -0
  14. package/lib/rest/flexApi/v1/goodData.js +316 -0
  15. package/lib/rest/flexApi/v1/userRoles.d.ts +138 -0
  16. package/lib/rest/flexApi/v1/userRoles.js +313 -0
  17. package/lib/rest/messaging/v1/service/usAppToPerson.d.ts +28 -0
  18. package/lib/rest/messaging/v1/service/usAppToPerson.js +29 -1
  19. package/lib/rest/proxy/v1/service/session/participant.d.ts +0 -2
  20. package/lib/rest/proxy/v1/service/session/participant.js +1 -6
  21. package/lib/rest/proxy/v1/service/session.d.ts +0 -4
  22. package/lib/rest/proxy/v1/service/session.js +2 -10
  23. package/lib/rest/taskrouter/v1/workspace/task/reservation.d.ts +6 -0
  24. package/lib/rest/taskrouter/v1/workspace/task/reservation.js +7 -0
  25. package/lib/rest/taskrouter/v1/workspace/taskQueue.d.ts +6 -0
  26. package/lib/rest/taskrouter/v1/workspace/taskQueue.js +4 -0
  27. package/lib/rest/taskrouter/v1/workspace/worker.d.ts +6 -0
  28. package/lib/rest/taskrouter/v1/workspace/worker.js +4 -0
  29. package/lib/rest/verify/v2/service/verification.d.ts +1 -1
  30. package/lib/rest/verify/v2/service/verification.js +2 -1
  31. package/lib/rest/verify/v2/template.js +1 -1
  32. package/lib/twiml/VoiceResponse.d.ts +5 -1
  33. package/lib/twiml/VoiceResponse.js +2 -0
  34. package/package.json +1 -1
@@ -0,0 +1,142 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Page = require('../../../base/Page');
9
+ import Response = require('../../../http/response');
10
+ import V1 = require('../V1');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ /**
14
+ * Initialize the GoodDataList
15
+ *
16
+ * @param version - Version of the resource
17
+ */
18
+ declare function GoodDataList(version: V1): GoodDataListInstance;
19
+
20
+ /**
21
+ * Options to pass to create
22
+ *
23
+ * @property token - The Token HTTP request header
24
+ */
25
+ interface GoodDataInstanceCreateOptions {
26
+ token?: string;
27
+ }
28
+
29
+ interface GoodDataListInstance {
30
+ /**
31
+ * @param sid - sid of instance
32
+ */
33
+ (sid: string): GoodDataContext;
34
+ /**
35
+ * Constructs a good_data
36
+ */
37
+ get(): GoodDataContext;
38
+ /**
39
+ * Provide a user-friendly representation
40
+ */
41
+ toJSON(): any;
42
+ }
43
+
44
+ interface GoodDataPayload extends GoodDataResource, Page.TwilioResponsePayload {
45
+ }
46
+
47
+ interface GoodDataResource {
48
+ session_expiry: string;
49
+ session_id: string;
50
+ url: string;
51
+ workspace_id: string;
52
+ }
53
+
54
+ interface GoodDataSolution {
55
+ }
56
+
57
+
58
+ declare class GoodDataContext {
59
+ /**
60
+ * Initialize the GoodDataContext
61
+ *
62
+ * @param version - Version of the resource
63
+ */
64
+ constructor(version: V1);
65
+
66
+ /**
67
+ * create a GoodDataInstance
68
+ *
69
+ * @param callback - Callback to handle processed record
70
+ */
71
+ create(callback?: (error: Error | null, item: GoodDataInstance) => any): Promise<GoodDataInstance>;
72
+ /**
73
+ * create a GoodDataInstance
74
+ *
75
+ * @param opts - Options for request
76
+ * @param callback - Callback to handle processed record
77
+ */
78
+ create(opts?: GoodDataInstanceCreateOptions, callback?: (error: Error | null, item: GoodDataInstance) => any): Promise<GoodDataInstance>;
79
+ /**
80
+ * Provide a user-friendly representation
81
+ */
82
+ toJSON(): any;
83
+ }
84
+
85
+
86
+ declare class GoodDataInstance extends SerializableClass {
87
+ /**
88
+ * Initialize the GoodDataContext
89
+ *
90
+ * @param version - Version of the resource
91
+ * @param payload - The instance payload
92
+ */
93
+ constructor(version: V1, payload: GoodDataPayload);
94
+
95
+ private _proxy: GoodDataContext;
96
+ /**
97
+ * create a GoodDataInstance
98
+ *
99
+ * @param callback - Callback to handle processed record
100
+ */
101
+ create(callback?: (error: Error | null, items: GoodDataInstance) => any): Promise<GoodDataInstance>;
102
+ /**
103
+ * create a GoodDataInstance
104
+ *
105
+ * @param opts - Options for request
106
+ * @param callback - Callback to handle processed record
107
+ */
108
+ create(opts?: GoodDataInstanceCreateOptions, callback?: (error: Error | null, items: GoodDataInstance) => any): Promise<GoodDataInstance>;
109
+ sessionExpiry: string;
110
+ sessionId: string;
111
+ /**
112
+ * Provide a user-friendly representation
113
+ */
114
+ toJSON(): any;
115
+ url: string;
116
+ workspaceId: string;
117
+ }
118
+
119
+
120
+ declare class GoodDataPage extends Page<V1, GoodDataPayload, GoodDataResource, GoodDataInstance> {
121
+ /**
122
+ * Initialize the GoodDataPage
123
+ *
124
+ * @param version - Version of the resource
125
+ * @param response - Response from the API
126
+ * @param solution - Path solution
127
+ */
128
+ constructor(version: V1, response: Response<string>, solution: GoodDataSolution);
129
+
130
+ /**
131
+ * Build an instance of GoodDataInstance
132
+ *
133
+ * @param payload - Payload response from the API
134
+ */
135
+ getInstance(payload: GoodDataPayload): GoodDataInstance;
136
+ /**
137
+ * Provide a user-friendly representation
138
+ */
139
+ toJSON(): any;
140
+ }
141
+
142
+ export { GoodDataContext, GoodDataInstance, GoodDataInstanceCreateOptions, GoodDataList, GoodDataListInstance, GoodDataPage, GoodDataPayload, GoodDataResource, GoodDataSolution }
@@ -0,0 +1,316 @@
1
+ 'use strict';
2
+
3
+ /* jshint ignore:start */
4
+ /**
5
+ * This code was generated by
6
+ * \ / _ _ _| _ _
7
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
8
+ * / /
9
+ */
10
+ /* jshint ignore:end */
11
+
12
+ var Q = require('q'); /* jshint ignore:line */
13
+ var _ = require('lodash'); /* jshint ignore:line */
14
+ var util = require('util'); /* jshint ignore:line */
15
+ var Page = require('../../../base/Page'); /* jshint ignore:line */
16
+ var values = require('../../../base/values'); /* jshint ignore:line */
17
+
18
+ var GoodDataList;
19
+ var GoodDataPage;
20
+ var GoodDataInstance;
21
+ var GoodDataContext;
22
+
23
+ /* jshint ignore:start */
24
+ /**
25
+ * Initialize the GoodDataList
26
+ *
27
+ * @constructor Twilio.FlexApi.V1.GoodDataList
28
+ *
29
+ * @param {Twilio.FlexApi.V1} version - Version of the resource
30
+ */
31
+ /* jshint ignore:end */
32
+ GoodDataList = function GoodDataList(version) {
33
+ /* jshint ignore:start */
34
+ /**
35
+ * @function goodData
36
+ * @memberof Twilio.FlexApi.V1#
37
+ *
38
+ * @param {string} sid - sid of instance
39
+ *
40
+ * @returns {Twilio.FlexApi.V1.GoodDataContext}
41
+ */
42
+ /* jshint ignore:end */
43
+ function GoodDataListInstance(sid) {
44
+ return GoodDataListInstance.get(sid);
45
+ }
46
+
47
+ GoodDataListInstance._version = version;
48
+ // Path Solution
49
+ GoodDataListInstance._solution = {};
50
+ /* jshint ignore:start */
51
+ /**
52
+ * Constructs a good_data
53
+ *
54
+ * @function get
55
+ * @memberof Twilio.FlexApi.V1.GoodDataList#
56
+ *
57
+ * @returns {Twilio.FlexApi.V1.GoodDataContext}
58
+ */
59
+ /* jshint ignore:end */
60
+ GoodDataListInstance.get = function get() {
61
+ return new GoodDataContext(this._version);
62
+ };
63
+
64
+ /* jshint ignore:start */
65
+ /**
66
+ * Provide a user-friendly representation
67
+ *
68
+ * @function toJSON
69
+ * @memberof Twilio.FlexApi.V1.GoodDataList#
70
+ *
71
+ * @returns Object
72
+ */
73
+ /* jshint ignore:end */
74
+ GoodDataListInstance.toJSON = function toJSON() {
75
+ return this._solution;
76
+ };
77
+
78
+ GoodDataListInstance[util.inspect.custom] = function inspect(depth, options) {
79
+ return util.inspect(this.toJSON(), options);
80
+ };
81
+
82
+ return GoodDataListInstance;
83
+ };
84
+
85
+
86
+ /* jshint ignore:start */
87
+ /**
88
+ * Initialize the GoodDataPage
89
+ *
90
+ * @constructor Twilio.FlexApi.V1.GoodDataPage
91
+ *
92
+ * @param {V1} version - Version of the resource
93
+ * @param {Response<string>} response - Response from the API
94
+ * @param {GoodDataSolution} solution - Path solution
95
+ *
96
+ * @returns GoodDataPage
97
+ */
98
+ /* jshint ignore:end */
99
+ GoodDataPage = function GoodDataPage(version, response, solution) {
100
+ // Path Solution
101
+ this._solution = solution;
102
+
103
+ Page.prototype.constructor.call(this, version, response, this._solution);
104
+ };
105
+
106
+ _.extend(GoodDataPage.prototype, Page.prototype);
107
+ GoodDataPage.prototype.constructor = GoodDataPage;
108
+
109
+ /* jshint ignore:start */
110
+ /**
111
+ * Build an instance of GoodDataInstance
112
+ *
113
+ * @function getInstance
114
+ * @memberof Twilio.FlexApi.V1.GoodDataPage#
115
+ *
116
+ * @param {GoodDataPayload} payload - Payload response from the API
117
+ *
118
+ * @returns GoodDataInstance
119
+ */
120
+ /* jshint ignore:end */
121
+ GoodDataPage.prototype.getInstance = function getInstance(payload) {
122
+ return new GoodDataInstance(this._version, payload);
123
+ };
124
+
125
+ /* jshint ignore:start */
126
+ /**
127
+ * Provide a user-friendly representation
128
+ *
129
+ * @function toJSON
130
+ * @memberof Twilio.FlexApi.V1.GoodDataPage#
131
+ *
132
+ * @returns Object
133
+ */
134
+ /* jshint ignore:end */
135
+ GoodDataPage.prototype.toJSON = function toJSON() {
136
+ let clone = {};
137
+ _.forOwn(this, function(value, key) {
138
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
139
+ clone[key] = value;
140
+ }
141
+ });
142
+ return clone;
143
+ };
144
+
145
+ GoodDataPage.prototype[util.inspect.custom] = function inspect(depth, options) {
146
+ return util.inspect(this.toJSON(), options);
147
+ };
148
+
149
+
150
+ /* jshint ignore:start */
151
+ /**
152
+ * Initialize the GoodDataContext
153
+ *
154
+ * @constructor Twilio.FlexApi.V1.GoodDataInstance
155
+ *
156
+ * @property {string} workspaceId - Unique workspace ID in gooddata
157
+ * @property {string} sessionExpiry - The session expiry date and time
158
+ * @property {string} sessionId - Unique session ID
159
+ * @property {string} url - The URL of this resource.
160
+ *
161
+ * @param {V1} version - Version of the resource
162
+ * @param {GoodDataPayload} payload - The instance payload
163
+ */
164
+ /* jshint ignore:end */
165
+ GoodDataInstance = function GoodDataInstance(version, payload) {
166
+ this._version = version;
167
+
168
+ // Marshaled Properties
169
+ this.workspaceId = payload.workspace_id; // jshint ignore:line
170
+ this.sessionExpiry = payload.session_expiry; // jshint ignore:line
171
+ this.sessionId = payload.session_id; // jshint ignore:line
172
+ this.url = payload.url; // jshint ignore:line
173
+
174
+ // Context
175
+ this._context = undefined;
176
+ this._solution = {};
177
+ };
178
+
179
+ Object.defineProperty(GoodDataInstance.prototype,
180
+ '_proxy', {
181
+ get: function() {
182
+ if (!this._context) {
183
+ this._context = new GoodDataContext(this._version);
184
+ }
185
+
186
+ return this._context;
187
+ }
188
+ });
189
+
190
+ /* jshint ignore:start */
191
+ /**
192
+ * create a GoodDataInstance
193
+ *
194
+ * @function create
195
+ * @memberof Twilio.FlexApi.V1.GoodDataInstance#
196
+ *
197
+ * @param {object} [opts] - Options for request
198
+ * @param {string} [opts.token] - The Token HTTP request header
199
+ * @param {function} [callback] - Callback to handle processed record
200
+ *
201
+ * @returns {Promise} Resolves to processed GoodDataInstance
202
+ */
203
+ /* jshint ignore:end */
204
+ GoodDataInstance.prototype.create = function create(opts, callback) {
205
+ return this._proxy.create(opts, callback);
206
+ };
207
+
208
+ /* jshint ignore:start */
209
+ /**
210
+ * Provide a user-friendly representation
211
+ *
212
+ * @function toJSON
213
+ * @memberof Twilio.FlexApi.V1.GoodDataInstance#
214
+ *
215
+ * @returns Object
216
+ */
217
+ /* jshint ignore:end */
218
+ GoodDataInstance.prototype.toJSON = function toJSON() {
219
+ let clone = {};
220
+ _.forOwn(this, function(value, key) {
221
+ if (!_.startsWith(key, '_') && ! _.isFunction(value)) {
222
+ clone[key] = value;
223
+ }
224
+ });
225
+ return clone;
226
+ };
227
+
228
+ GoodDataInstance.prototype[util.inspect.custom] = function inspect(depth,
229
+ options) {
230
+ return util.inspect(this.toJSON(), options);
231
+ };
232
+
233
+
234
+ /* jshint ignore:start */
235
+ /**
236
+ * Initialize the GoodDataContext
237
+ *
238
+ * @constructor Twilio.FlexApi.V1.GoodDataContext
239
+ *
240
+ * @param {V1} version - Version of the resource
241
+ */
242
+ /* jshint ignore:end */
243
+ GoodDataContext = function GoodDataContext(version) {
244
+ this._version = version;
245
+
246
+ // Path Solution
247
+ this._solution = {};
248
+ this._uri = `/Accounts/GoodData`;
249
+ };
250
+
251
+ /* jshint ignore:start */
252
+ /**
253
+ * create a GoodDataInstance
254
+ *
255
+ * @function create
256
+ * @memberof Twilio.FlexApi.V1.GoodDataContext#
257
+ *
258
+ * @param {object} [opts] - Options for request
259
+ * @param {string} [opts.token] - The Token HTTP request header
260
+ * @param {function} [callback] - Callback to handle processed record
261
+ *
262
+ * @returns {Promise} Resolves to processed GoodDataInstance
263
+ */
264
+ /* jshint ignore:end */
265
+ GoodDataContext.prototype.create = function create(opts, callback) {
266
+ if (_.isFunction(opts)) {
267
+ callback = opts;
268
+ opts = {};
269
+ }
270
+ opts = opts || {};
271
+
272
+ var deferred = Q.defer();
273
+ var headers = values.of({'Token': _.get(opts, 'token')});
274
+
275
+ var promise = this._version.create({uri: this._uri, method: 'POST', headers: headers});
276
+
277
+ promise = promise.then(function(payload) {
278
+ deferred.resolve(new GoodDataInstance(this._version, payload));
279
+ }.bind(this));
280
+
281
+ promise.catch(function(error) {
282
+ deferred.reject(error);
283
+ });
284
+
285
+ if (_.isFunction(callback)) {
286
+ deferred.promise.nodeify(callback);
287
+ }
288
+
289
+ return deferred.promise;
290
+ };
291
+
292
+ /* jshint ignore:start */
293
+ /**
294
+ * Provide a user-friendly representation
295
+ *
296
+ * @function toJSON
297
+ * @memberof Twilio.FlexApi.V1.GoodDataContext#
298
+ *
299
+ * @returns Object
300
+ */
301
+ /* jshint ignore:end */
302
+ GoodDataContext.prototype.toJSON = function toJSON() {
303
+ return this._solution;
304
+ };
305
+
306
+ GoodDataContext.prototype[util.inspect.custom] = function inspect(depth,
307
+ options) {
308
+ return util.inspect(this.toJSON(), options);
309
+ };
310
+
311
+ module.exports = {
312
+ GoodDataList: GoodDataList,
313
+ GoodDataPage: GoodDataPage,
314
+ GoodDataInstance: GoodDataInstance,
315
+ GoodDataContext: GoodDataContext
316
+ };
@@ -0,0 +1,138 @@
1
+ /**
2
+ * This code was generated by
3
+ * \ / _ _ _| _ _
4
+ * | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ * / /
6
+ */
7
+
8
+ import Page = require('../../../base/Page');
9
+ import Response = require('../../../http/response');
10
+ import V1 = require('../V1');
11
+ import { SerializableClass } from '../../../interfaces';
12
+
13
+ /**
14
+ * Initialize the UserRolesList
15
+ *
16
+ * @param version - Version of the resource
17
+ */
18
+ declare function UserRolesList(version: V1): UserRolesListInstance;
19
+
20
+ /**
21
+ * Options to pass to fetch
22
+ *
23
+ * @property token - The Token HTTP request header
24
+ */
25
+ interface UserRolesInstanceFetchOptions {
26
+ token?: string;
27
+ }
28
+
29
+ interface UserRolesListInstance {
30
+ /**
31
+ * @param sid - sid of instance
32
+ */
33
+ (sid: string): UserRolesContext;
34
+ /**
35
+ * Constructs a user_roles
36
+ */
37
+ get(): UserRolesContext;
38
+ /**
39
+ * Provide a user-friendly representation
40
+ */
41
+ toJSON(): any;
42
+ }
43
+
44
+ interface UserRolesPayload extends UserRolesResource, Page.TwilioResponsePayload {
45
+ }
46
+
47
+ interface UserRolesResource {
48
+ roles: string[];
49
+ url: string;
50
+ }
51
+
52
+ interface UserRolesSolution {
53
+ }
54
+
55
+
56
+ declare class UserRolesContext {
57
+ /**
58
+ * Initialize the UserRolesContext
59
+ *
60
+ * @param version - Version of the resource
61
+ */
62
+ constructor(version: V1);
63
+
64
+ /**
65
+ * fetch a UserRolesInstance
66
+ *
67
+ * @param callback - Callback to handle processed record
68
+ */
69
+ fetch(callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
70
+ /**
71
+ * fetch a UserRolesInstance
72
+ *
73
+ * @param opts - Options for request
74
+ * @param callback - Callback to handle processed record
75
+ */
76
+ fetch(opts?: UserRolesInstanceFetchOptions, callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
77
+ /**
78
+ * Provide a user-friendly representation
79
+ */
80
+ toJSON(): any;
81
+ }
82
+
83
+
84
+ declare class UserRolesInstance extends SerializableClass {
85
+ /**
86
+ * Initialize the UserRolesContext
87
+ *
88
+ * @param version - Version of the resource
89
+ * @param payload - The instance payload
90
+ */
91
+ constructor(version: V1, payload: UserRolesPayload);
92
+
93
+ private _proxy: UserRolesContext;
94
+ /**
95
+ * fetch a UserRolesInstance
96
+ *
97
+ * @param callback - Callback to handle processed record
98
+ */
99
+ fetch(callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
100
+ /**
101
+ * fetch a UserRolesInstance
102
+ *
103
+ * @param opts - Options for request
104
+ * @param callback - Callback to handle processed record
105
+ */
106
+ fetch(opts?: UserRolesInstanceFetchOptions, callback?: (error: Error | null, items: UserRolesInstance) => any): Promise<UserRolesInstance>;
107
+ roles: string[];
108
+ /**
109
+ * Provide a user-friendly representation
110
+ */
111
+ toJSON(): any;
112
+ url: string;
113
+ }
114
+
115
+
116
+ declare class UserRolesPage extends Page<V1, UserRolesPayload, UserRolesResource, UserRolesInstance> {
117
+ /**
118
+ * Initialize the UserRolesPage
119
+ *
120
+ * @param version - Version of the resource
121
+ * @param response - Response from the API
122
+ * @param solution - Path solution
123
+ */
124
+ constructor(version: V1, response: Response<string>, solution: UserRolesSolution);
125
+
126
+ /**
127
+ * Build an instance of UserRolesInstance
128
+ *
129
+ * @param payload - Payload response from the API
130
+ */
131
+ getInstance(payload: UserRolesPayload): UserRolesInstance;
132
+ /**
133
+ * Provide a user-friendly representation
134
+ */
135
+ toJSON(): any;
136
+ }
137
+
138
+ export { UserRolesContext, UserRolesInstance, UserRolesInstanceFetchOptions, UserRolesList, UserRolesListInstance, UserRolesPage, UserRolesPayload, UserRolesResource, UserRolesSolution }