twilio 3.75.0 → 3.75.1

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.
@@ -53,11 +53,13 @@ interface AccessTokenListInstance {
53
53
  * @property factorFriendlyName - The factor friendly name
54
54
  * @property factorType - The Type of this Factor
55
55
  * @property identity - Unique external identifier of the Entity
56
+ * @property ttl - How long, in seconds, the access token is valid.
56
57
  */
57
58
  interface AccessTokenListInstanceCreateOptions {
58
59
  factorFriendlyName?: string;
59
60
  factorType: AccessTokenFactorTypes;
60
61
  identity: string;
62
+ ttl?: number;
61
63
  }
62
64
 
63
65
  interface AccessTokenPayload extends AccessTokenResource, Page.TwilioResponsePayload {
@@ -65,12 +67,14 @@ interface AccessTokenPayload extends AccessTokenResource, Page.TwilioResponsePay
65
67
 
66
68
  interface AccessTokenResource {
67
69
  account_sid: string;
70
+ date_created: Date;
68
71
  entity_identity: string;
69
72
  factor_friendly_name: string;
70
73
  factor_type: AccessTokenFactorTypes;
71
74
  service_sid: string;
72
75
  sid: string;
73
76
  token: string;
77
+ ttl: number;
74
78
  url: string;
75
79
  }
76
80
 
@@ -121,6 +125,7 @@ declare class AccessTokenInstance extends SerializableClass {
121
125
 
122
126
  private _proxy: AccessTokenContext;
123
127
  accountSid: string;
128
+ dateCreated: Date;
124
129
  entityIdentity: string;
125
130
  factorFriendlyName: string;
126
131
  factorType: AccessTokenFactorTypes;
@@ -137,6 +142,7 @@ declare class AccessTokenInstance extends SerializableClass {
137
142
  */
138
143
  toJSON(): any;
139
144
  token: string;
145
+ ttl: number;
140
146
  url: string;
141
147
  }
142
148
 
@@ -13,6 +13,8 @@ var Q = require('q'); /* jshint ignore:line */
13
13
  var _ = require('lodash'); /* jshint ignore:line */
14
14
  var util = require('util'); /* jshint ignore:line */
15
15
  var Page = require('../../../../base/Page'); /* jshint ignore:line */
16
+ var deserialize = require(
17
+ '../../../../base/deserialize'); /* jshint ignore:line */
16
18
  var values = require('../../../../base/values'); /* jshint ignore:line */
17
19
 
18
20
  var AccessTokenList;
@@ -63,6 +65,7 @@ AccessTokenList = function AccessTokenList(version, serviceSid) {
63
65
  * @param {string} opts.identity - Unique external identifier of the Entity
64
66
  * @param {access_token.factor_types} opts.factorType - The Type of this Factor
65
67
  * @param {string} [opts.factorFriendlyName] - The factor friendly name
68
+ * @param {number} [opts.ttl] - How long, in seconds, the access token is valid.
66
69
  * @param {function} [callback] - Callback to handle processed record
67
70
  *
68
71
  * @returns {Promise} Resolves to processed AccessTokenInstance
@@ -83,7 +86,8 @@ AccessTokenList = function AccessTokenList(version, serviceSid) {
83
86
  var data = values.of({
84
87
  'Identity': _.get(opts, 'identity'),
85
88
  'FactorType': _.get(opts, 'factorType'),
86
- 'FactorFriendlyName': _.get(opts, 'factorFriendlyName')
89
+ 'FactorFriendlyName': _.get(opts, 'factorFriendlyName'),
90
+ 'Ttl': _.get(opts, 'ttl')
87
91
  });
88
92
 
89
93
  var promise = this._version.create({uri: this._uri, method: 'POST', data: data});
@@ -233,6 +237,8 @@ AccessTokenPage.prototype[util.inspect.custom] = function inspect(depth,
233
237
  * A human readable description of this factor.
234
238
  * @property {string} token - Generated access token.
235
239
  * @property {string} url - The URL of this resource.
240
+ * @property {number} ttl - How long, in seconds, the access token is valid.
241
+ * @property {Date} dateCreated - The date this access token was created
236
242
  *
237
243
  * @param {V2} version - Version of the resource
238
244
  * @param {AccessTokenPayload} payload - The instance payload
@@ -253,6 +259,8 @@ AccessTokenInstance = function AccessTokenInstance(version, payload, serviceSid,
253
259
  this.factorFriendlyName = payload.factor_friendly_name; // jshint ignore:line
254
260
  this.token = payload.token; // jshint ignore:line
255
261
  this.url = payload.url; // jshint ignore:line
262
+ this.ttl = deserialize.integer(payload.ttl); // jshint ignore:line
263
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created); // jshint ignore:line
256
264
 
257
265
  // Context
258
266
  this._context = undefined;
@@ -36,9 +36,11 @@ declare function ChallengeList(version: V2, serviceSid: string, identity: string
36
36
  * Options to pass to update
37
37
  *
38
38
  * @property authPayload - Optional payload to verify the Challenge
39
+ * @property metadata - Metadata of the challenge.
39
40
  */
40
41
  interface ChallengeInstanceUpdateOptions {
41
42
  authPayload?: string;
43
+ metadata?: object;
42
44
  }
43
45
 
44
46
  interface ChallengeListInstance {
@@ -273,6 +275,7 @@ interface ChallengeResource {
273
275
  hidden_details: object;
274
276
  identity: string;
275
277
  links: string;
278
+ metadata: object;
276
279
  responded_reason: ChallengeChallengeReasons;
277
280
  service_sid: string;
278
281
  sid: string;
@@ -361,6 +364,7 @@ declare class ChallengeInstance extends SerializableClass {
361
364
  hiddenDetails: any;
362
365
  identity: string;
363
366
  links: string;
367
+ metadata: any;
364
368
  /**
365
369
  * Access the notifications
366
370
  */
@@ -518,6 +518,7 @@ ChallengePage.prototype[util.inspect.custom] = function inspect(depth, options)
518
518
  * The Reason of this Challenge `status`
519
519
  * @property {object} details - Details about the Challenge.
520
520
  * @property {object} hiddenDetails - Hidden details about the Challenge
521
+ * @property {object} metadata - Metadata of the challenge.
521
522
  * @property {challenge.factor_types} factorType -
522
523
  * The Factor Type of this Challenge
523
524
  * @property {string} url - The URL of this resource.
@@ -549,6 +550,7 @@ ChallengeInstance = function ChallengeInstance(version, payload, serviceSid,
549
550
  this.respondedReason = payload.responded_reason; // jshint ignore:line
550
551
  this.details = payload.details; // jshint ignore:line
551
552
  this.hiddenDetails = payload.hidden_details; // jshint ignore:line
553
+ this.metadata = payload.metadata; // jshint ignore:line
552
554
  this.factorType = payload.factor_type; // jshint ignore:line
553
555
  this.url = payload.url; // jshint ignore:line
554
556
  this.links = payload.links; // jshint ignore:line
@@ -599,6 +601,7 @@ ChallengeInstance.prototype.fetch = function fetch(callback) {
599
601
  *
600
602
  * @param {object} [opts] - Options for request
601
603
  * @param {string} [opts.authPayload] - Optional payload to verify the Challenge
604
+ * @param {object} [opts.metadata] - Metadata of the challenge.
602
605
  * @param {function} [callback] - Callback to handle processed record
603
606
  *
604
607
  * @returns {Promise} Resolves to processed ChallengeInstance
@@ -724,6 +727,7 @@ ChallengeContext.prototype.fetch = function fetch(callback) {
724
727
  *
725
728
  * @param {object} [opts] - Options for request
726
729
  * @param {string} [opts.authPayload] - Optional payload to verify the Challenge
730
+ * @param {object} [opts.metadata] - Metadata of the challenge.
727
731
  * @param {function} [callback] - Callback to handle processed record
728
732
  *
729
733
  * @returns {Promise} Resolves to processed ChallengeInstance
@@ -737,7 +741,10 @@ ChallengeContext.prototype.update = function update(opts, callback) {
737
741
  opts = opts || {};
738
742
 
739
743
  var deferred = Q.defer();
740
- var data = values.of({'AuthPayload': _.get(opts, 'authPayload')});
744
+ var data = values.of({
745
+ 'AuthPayload': _.get(opts, 'authPayload'),
746
+ 'Metadata': serialize.object(_.get(opts, 'metadata'))
747
+ });
741
748
 
742
749
  var promise = this._version.update({uri: this._uri, method: 'POST', data: data});
743
750
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "twilio",
3
3
  "description": "A Twilio helper library",
4
- "version": "3.75.0",
4
+ "version": "3.75.1",
5
5
  "author": "API Team <api@twilio.com>",
6
6
  "contributors": [
7
7
  {