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.
Files changed (53) hide show
  1. package/lib/rest/Oauth.d.ts +4 -0
  2. package/lib/rest/{Media.js → Oauth.js} +3 -3
  3. package/lib/rest/{MediaBase.d.ts → OauthBase.d.ts} +4 -4
  4. package/lib/rest/{MediaBase.js → OauthBase.js} +5 -5
  5. package/lib/rest/Twilio.d.ts +5 -5
  6. package/lib/rest/Twilio.js +5 -5
  7. package/lib/rest/api/v2010/account/call.d.ts +34 -10
  8. package/lib/rest/api/v2010/account/call.js +8 -0
  9. package/lib/rest/api/v2010/account/conference/participant.d.ts +6 -0
  10. package/lib/rest/api/v2010/account/conference/participant.js +2 -0
  11. package/lib/rest/api/v2010/account/conference.d.ts +24 -0
  12. package/lib/rest/api/v2010/account/conference.js +8 -0
  13. package/lib/rest/api/v2010/account/message.d.ts +12 -0
  14. package/lib/rest/api/v2010/account/message.js +4 -0
  15. package/lib/rest/content/v1/content/approvalCreate.d.ts +3 -3
  16. package/lib/rest/content/v1/content/approvalCreate.js +7 -7
  17. package/lib/rest/content/v1/content/approvalFetch.d.ts +5 -5
  18. package/lib/rest/content/v1/content/approvalFetch.js +14 -14
  19. package/lib/rest/content/v1/content.d.ts +20 -0
  20. package/lib/rest/content/v1/content.js +10 -1
  21. package/lib/rest/conversations/v1/service/conversation.d.ts +6 -6
  22. package/lib/rest/flexApi/v1/plugin.d.ts +4 -0
  23. package/lib/rest/flexApi/v1/plugin.js +4 -0
  24. package/lib/rest/numbers/v1/portingPortInFetch.d.ts +6 -0
  25. package/lib/rest/numbers/v1/portingPortInFetch.js +2 -0
  26. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.d.ts +12 -0
  27. package/lib/rest/numbers/v2/regulatoryCompliance/bundle.js +4 -0
  28. package/lib/rest/oauth/V1.d.ts +20 -0
  29. package/lib/rest/oauth/V1.js +42 -0
  30. package/lib/rest/oauth/v1/authorize.d.ts +69 -0
  31. package/lib/rest/oauth/v1/authorize.js +83 -0
  32. package/lib/rest/oauth/v1/token.d.ts +88 -0
  33. package/lib/rest/oauth/v1/token.js +98 -0
  34. package/lib/rest/trusthub/v1/complianceRegistrationInquiries.d.ts +84 -10
  35. package/lib/rest/trusthub/v1/complianceRegistrationInquiries.js +92 -28
  36. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.d.ts +6 -0
  37. package/lib/rest/trusthub/v1/customerProfiles/customerProfilesEntityAssignments.js +2 -0
  38. package/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.d.ts +6 -0
  39. package/lib/rest/trusthub/v1/trustProducts/trustProductsEntityAssignments.js +2 -0
  40. package/lib/rest/trusthub/v1/trustProducts.d.ts +16 -16
  41. package/lib/twiml/VoiceResponse.d.ts +2 -2
  42. package/package.json +1 -1
  43. package/lib/rest/Media.d.ts +0 -4
  44. package/lib/rest/media/V1.d.ts +0 -25
  45. package/lib/rest/media/V1.js +0 -51
  46. package/lib/rest/media/v1/mediaProcessor.d.ts +0 -317
  47. package/lib/rest/media/v1/mediaProcessor.js +0 -256
  48. package/lib/rest/media/v1/mediaRecording.d.ts +0 -309
  49. package/lib/rest/media/v1/mediaRecording.js +0 -226
  50. package/lib/rest/media/v1/playerStreamer/playbackGrant.d.ts +0 -151
  51. package/lib/rest/media/v1/playerStreamer/playbackGrant.js +0 -146
  52. package/lib/rest/media/v1/playerStreamer.d.ts +0 -327
  53. package/lib/rest/media/v1/playerStreamer.js +0 -264
@@ -26,6 +26,14 @@ export declare class CardAction {
26
26
  "id"?: string;
27
27
  }
28
28
  export type CardActionType = "URL" | "PHONE_NUMBER" | "QUICK_REPLY";
29
+ export declare class CatalogItem {
30
+ "id"?: string;
31
+ "sectionTitle"?: string;
32
+ "name"?: string;
33
+ "mediaUrl"?: string;
34
+ "price"?: number;
35
+ "description"?: string;
36
+ }
29
37
  /**
30
38
  * Content creation request body
31
39
  */
@@ -73,6 +81,17 @@ export declare class TwilioCard {
73
81
  "media"?: Array<string>;
74
82
  "actions"?: Array<CardAction>;
75
83
  }
84
+ /**
85
+ * twilio/catalog type lets recipients view list of catalog products, ask questions about products, order products.
86
+ */
87
+ export declare class TwilioCatalog {
88
+ "title"?: string;
89
+ "body": string;
90
+ "subtitle"?: string;
91
+ "id"?: string;
92
+ "items"?: Array<CatalogItem>;
93
+ "dynamicItems"?: string;
94
+ }
76
95
  /**
77
96
  * twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
78
97
  */
@@ -120,6 +139,7 @@ export declare class Types {
120
139
  "twilioCallToAction"?: TwilioCallToAction | null;
121
140
  "twilioQuickReply"?: TwilioQuickReply | null;
122
141
  "twilioCard"?: TwilioCard | null;
142
+ "twilioCatalog"?: TwilioCatalog | null;
123
143
  "whatsappCard"?: WhatsappCard | null;
124
144
  "whatsappAuthentication"?: WhatsappAuthentication | null;
125
145
  }
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
17
  };
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
- exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.ContentCreateRequest = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
19
+ exports.ContentPage = exports.ContentListInstance = exports.ContentInstance = exports.ContentContextImpl = exports.WhatsappCard = exports.WhatsappAuthentication = exports.Types = exports.TwilioText = exports.TwilioQuickReply = exports.TwilioMedia = exports.TwilioLocation = exports.TwilioListPicker = exports.TwilioCatalog = exports.TwilioCard = exports.TwilioCallToAction = exports.QuickReplyAction = exports.ListItem = exports.ContentCreateRequest = exports.CatalogItem = exports.CardAction = exports.CallToActionAction = exports.AuthenticationAction = void 0;
20
20
  const util_1 = require("util");
21
21
  const Page_1 = __importDefault(require("../../../base/Page"));
22
22
  const deserialize = require("../../../base/deserialize");
@@ -33,6 +33,9 @@ exports.CallToActionAction = CallToActionAction;
33
33
  class CardAction {
34
34
  }
35
35
  exports.CardAction = CardAction;
36
+ class CatalogItem {
37
+ }
38
+ exports.CatalogItem = CatalogItem;
36
39
  /**
37
40
  * Content creation request body
38
41
  */
@@ -57,6 +60,12 @@ exports.TwilioCallToAction = TwilioCallToAction;
57
60
  class TwilioCard {
58
61
  }
59
62
  exports.TwilioCard = TwilioCard;
63
+ /**
64
+ * twilio/catalog type lets recipients view list of catalog products, ask questions about products, order products.
65
+ */
66
+ class TwilioCatalog {
67
+ }
68
+ exports.TwilioCatalog = TwilioCatalog;
60
69
  /**
61
70
  * twilio/list-picker includes a menu of up to 10 options, which offers a simple way for users to make a selection.
62
71
  */
@@ -77,9 +77,9 @@ export interface ConversationListInstanceCreateOptions {
77
77
  * Options to pass to each
78
78
  */
79
79
  export interface ConversationListInstanceEachOptions {
80
- /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
80
+ /** Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. */
81
81
  startDate?: string;
82
- /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
82
+ /** Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. */
83
83
  endDate?: string;
84
84
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
85
85
  state?: ConversationState;
@@ -96,9 +96,9 @@ export interface ConversationListInstanceEachOptions {
96
96
  * Options to pass to list
97
97
  */
98
98
  export interface ConversationListInstanceOptions {
99
- /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
99
+ /** Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. */
100
100
  startDate?: string;
101
- /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
101
+ /** Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. */
102
102
  endDate?: string;
103
103
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
104
104
  state?: ConversationState;
@@ -111,9 +111,9 @@ export interface ConversationListInstanceOptions {
111
111
  * Options to pass to page
112
112
  */
113
113
  export interface ConversationListInstancePageOptions {
114
- /** Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. */
114
+ /** Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. */
115
115
  startDate?: string;
116
- /** End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. */
116
+ /** Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. */
117
117
  endDate?: string;
118
118
  /** State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` */
119
119
  state?: ConversationState;
@@ -34,6 +34,10 @@ export interface PluginListInstanceCreateOptions {
34
34
  friendlyName?: string;
35
35
  /** A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long */
36
36
  description?: string;
37
+ /** The version of Flex Plugins CLI used to create this plugin */
38
+ cliVersion?: string;
39
+ /** The validation status of the plugin, indicating whether it has been validated */
40
+ validateStatus?: string;
37
41
  }
38
42
  /**
39
43
  * Options to pass to each
@@ -179,6 +179,10 @@ function PluginListInstance(version) {
179
179
  data["FriendlyName"] = params["friendlyName"];
180
180
  if (params["description"] !== undefined)
181
181
  data["Description"] = params["description"];
182
+ if (params["cliVersion"] !== undefined)
183
+ data["CliVersion"] = params["cliVersion"];
184
+ if (params["validateStatus"] !== undefined)
185
+ data["ValidateStatus"] = params["validateStatus"];
182
186
  const headers = {};
183
187
  headers["Content-Type"] = "application/x-www-form-urlencoded";
184
188
  if (params["flexMetadata"] !== undefined)
@@ -41,6 +41,7 @@ interface PortingPortInFetchResource {
41
41
  target_port_in_date: Date;
42
42
  target_port_in_time_range_start: string;
43
43
  target_port_in_time_range_end: string;
44
+ port_in_request_status: string;
44
45
  losing_carrier_information: any;
45
46
  phone_numbers: Array<any>;
46
47
  documents: Array<string>;
@@ -78,6 +79,10 @@ export declare class PortingPortInFetchInstance {
78
79
  * Maximum hour in the future needs to be established with the Ops team for validation.
79
80
  */
80
81
  targetPortInTimeRangeEnd: string;
82
+ /**
83
+ * The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled.
84
+ */
85
+ portInRequestStatus: string;
81
86
  /**
82
87
  * The information for the losing carrier.
83
88
  */
@@ -112,6 +117,7 @@ export declare class PortingPortInFetchInstance {
112
117
  targetPortInDate: Date;
113
118
  targetPortInTimeRangeStart: string;
114
119
  targetPortInTimeRangeEnd: string;
120
+ portInRequestStatus: string;
115
121
  losingCarrierInformation: any;
116
122
  phoneNumbers: any[];
117
123
  documents: string[];
@@ -60,6 +60,7 @@ class PortingPortInFetchInstance {
60
60
  this.targetPortInDate = deserialize.iso8601Date(payload.target_port_in_date);
61
61
  this.targetPortInTimeRangeStart = payload.target_port_in_time_range_start;
62
62
  this.targetPortInTimeRangeEnd = payload.target_port_in_time_range_end;
63
+ this.portInRequestStatus = payload.port_in_request_status;
63
64
  this.losingCarrierInformation = payload.losing_carrier_information;
64
65
  this.phoneNumbers = payload.phone_numbers;
65
66
  this.documents = payload.documents;
@@ -97,6 +98,7 @@ class PortingPortInFetchInstance {
97
98
  targetPortInDate: this.targetPortInDate,
98
99
  targetPortInTimeRangeStart: this.targetPortInTimeRangeStart,
99
100
  targetPortInTimeRangeEnd: this.targetPortInTimeRangeEnd,
101
+ portInRequestStatus: this.portInRequestStatus,
100
102
  losingCarrierInformation: this.losingCarrierInformation,
101
103
  phoneNumbers: this.phoneNumbers,
102
104
  documents: this.documents,
@@ -65,6 +65,10 @@ export interface BundleListInstanceEachOptions {
65
65
  sortDirection?: BundleSortDirection;
66
66
  /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
67
67
  validUntilDate?: Date;
68
+ /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
69
+ validUntilDateBefore?: Date;
70
+ /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
71
+ validUntilDateAfter?: Date;
68
72
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
69
73
  pageSize?: number;
70
74
  /** Function to process each record. If this and a positional callback are passed, this one will be used */
@@ -96,6 +100,10 @@ export interface BundleListInstanceOptions {
96
100
  sortDirection?: BundleSortDirection;
97
101
  /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
98
102
  validUntilDate?: Date;
103
+ /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
104
+ validUntilDateBefore?: Date;
105
+ /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
106
+ validUntilDateAfter?: Date;
99
107
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
100
108
  pageSize?: number;
101
109
  /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */
@@ -123,6 +131,10 @@ export interface BundleListInstancePageOptions {
123
131
  sortDirection?: BundleSortDirection;
124
132
  /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
125
133
  validUntilDate?: Date;
134
+ /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
135
+ validUntilDateBefore?: Date;
136
+ /** Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. */
137
+ validUntilDateAfter?: Date;
126
138
  /** How many resources to return in each list page. The default is 50, and the maximum is 1000. */
127
139
  pageSize?: number;
128
140
  /** Page Number, this value is simply for client state */
@@ -287,6 +287,10 @@ function BundleListInstance(version) {
287
287
  data["SortDirection"] = params["sortDirection"];
288
288
  if (params["validUntilDate"] !== undefined)
289
289
  data["ValidUntilDate"] = serialize.iso8601DateTime(params["validUntilDate"]);
290
+ if (params["validUntilDateBefore"] !== undefined)
291
+ data["ValidUntilDate<"] = serialize.iso8601DateTime(params["validUntilDateBefore"]);
292
+ if (params["validUntilDateAfter"] !== undefined)
293
+ data["ValidUntilDate>"] = serialize.iso8601DateTime(params["validUntilDateAfter"]);
290
294
  if (params["pageSize"] !== undefined)
291
295
  data["PageSize"] = params["pageSize"];
292
296
  if (params.pageNumber !== undefined)
@@ -0,0 +1,20 @@
1
+ import OauthBase from "../OauthBase";
2
+ import Version from "../../base/Version";
3
+ import { AuthorizeListInstance } from "./v1/authorize";
4
+ import { TokenListInstance } from "./v1/token";
5
+ export default class V1 extends Version {
6
+ /**
7
+ * Initialize the V1 version of Oauth
8
+ *
9
+ * @param domain - The Twilio (Twilio.Oauth) domain
10
+ */
11
+ constructor(domain: OauthBase);
12
+ /** authorize - { Twilio.Oauth.V1.AuthorizeListInstance } resource */
13
+ protected _authorize?: AuthorizeListInstance;
14
+ /** token - { Twilio.Oauth.V1.TokenListInstance } resource */
15
+ protected _token?: TokenListInstance;
16
+ /** Getter for authorize resource */
17
+ get authorize(): AuthorizeListInstance;
18
+ /** Getter for token resource */
19
+ get token(): TokenListInstance;
20
+ }
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Oauth
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
+ const Version_1 = __importDefault(require("../../base/Version"));
20
+ const authorize_1 = require("./v1/authorize");
21
+ const token_1 = require("./v1/token");
22
+ class V1 extends Version_1.default {
23
+ /**
24
+ * Initialize the V1 version of Oauth
25
+ *
26
+ * @param domain - The Twilio (Twilio.Oauth) domain
27
+ */
28
+ constructor(domain) {
29
+ super(domain, "v1");
30
+ }
31
+ /** Getter for authorize resource */
32
+ get authorize() {
33
+ this._authorize = this._authorize || (0, authorize_1.AuthorizeListInstance)(this);
34
+ return this._authorize;
35
+ }
36
+ /** Getter for token resource */
37
+ get token() {
38
+ this._token = this._token || (0, token_1.TokenListInstance)(this);
39
+ return this._token;
40
+ }
41
+ }
42
+ exports.default = V1;
@@ -0,0 +1,69 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../V1";
4
+ /**
5
+ * Options to pass to fetch a AuthorizeInstance
6
+ */
7
+ export interface AuthorizeListInstanceFetchOptions {
8
+ /** Response Type */
9
+ responseType?: string;
10
+ /** The Client Identifier */
11
+ clientId?: string;
12
+ /** The url to which response will be redirected to */
13
+ redirectUri?: string;
14
+ /** The scope of the access request */
15
+ scope?: string;
16
+ /** An opaque value which can be used to maintain state between the request and callback */
17
+ state?: string;
18
+ }
19
+ export interface AuthorizeSolution {
20
+ }
21
+ export interface AuthorizeListInstance {
22
+ _version: V1;
23
+ _solution: AuthorizeSolution;
24
+ _uri: string;
25
+ /**
26
+ * Fetch a AuthorizeInstance
27
+ *
28
+ * @param callback - Callback to handle processed record
29
+ *
30
+ * @returns Resolves to processed AuthorizeInstance
31
+ */
32
+ fetch(callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
33
+ /**
34
+ * Fetch a AuthorizeInstance
35
+ *
36
+ * @param params - Parameter for request
37
+ * @param callback - Callback to handle processed record
38
+ *
39
+ * @returns Resolves to processed AuthorizeInstance
40
+ */
41
+ fetch(params: AuthorizeListInstanceFetchOptions, callback?: (error: Error | null, item?: AuthorizeInstance) => any): Promise<AuthorizeInstance>;
42
+ /**
43
+ * Provide a user-friendly representation
44
+ */
45
+ toJSON(): any;
46
+ [inspect.custom](_depth: any, options: InspectOptions): any;
47
+ }
48
+ export declare function AuthorizeListInstance(version: V1): AuthorizeListInstance;
49
+ interface AuthorizeResource {
50
+ redirect_to: string;
51
+ }
52
+ export declare class AuthorizeInstance {
53
+ protected _version: V1;
54
+ constructor(_version: V1, payload: AuthorizeResource);
55
+ /**
56
+ * The callback URL
57
+ */
58
+ redirectTo: string;
59
+ /**
60
+ * Provide a user-friendly representation
61
+ *
62
+ * @returns Object
63
+ */
64
+ toJSON(): {
65
+ redirectTo: string;
66
+ };
67
+ [inspect.custom](_depth: any, options: InspectOptions): string;
68
+ }
69
+ export {};
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Oauth
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.AuthorizeInstance = exports.AuthorizeListInstance = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../base/deserialize");
19
+ const serialize = require("../../../base/serialize");
20
+ function AuthorizeListInstance(version) {
21
+ const instance = {};
22
+ instance._version = version;
23
+ instance._solution = {};
24
+ instance._uri = `/authorize`;
25
+ instance.fetch = function fetch(params, callback) {
26
+ if (params instanceof Function) {
27
+ callback = params;
28
+ params = {};
29
+ }
30
+ else {
31
+ params = params || {};
32
+ }
33
+ let data = {};
34
+ if (params["responseType"] !== undefined)
35
+ data["ResponseType"] = params["responseType"];
36
+ if (params["clientId"] !== undefined)
37
+ data["ClientId"] = params["clientId"];
38
+ if (params["redirectUri"] !== undefined)
39
+ data["RedirectUri"] = params["redirectUri"];
40
+ if (params["scope"] !== undefined)
41
+ data["Scope"] = params["scope"];
42
+ if (params["state"] !== undefined)
43
+ data["State"] = params["state"];
44
+ const headers = {};
45
+ let operationVersion = version, operationPromise = operationVersion.fetch({
46
+ uri: instance._uri,
47
+ method: "get",
48
+ params: data,
49
+ headers,
50
+ });
51
+ operationPromise = operationPromise.then((payload) => new AuthorizeInstance(operationVersion, payload));
52
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
53
+ return operationPromise;
54
+ };
55
+ instance.toJSON = function toJSON() {
56
+ return instance._solution;
57
+ };
58
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
59
+ return (0, util_1.inspect)(instance.toJSON(), options);
60
+ };
61
+ return instance;
62
+ }
63
+ exports.AuthorizeListInstance = AuthorizeListInstance;
64
+ class AuthorizeInstance {
65
+ constructor(_version, payload) {
66
+ this._version = _version;
67
+ this.redirectTo = payload.redirect_to;
68
+ }
69
+ /**
70
+ * Provide a user-friendly representation
71
+ *
72
+ * @returns Object
73
+ */
74
+ toJSON() {
75
+ return {
76
+ redirectTo: this.redirectTo,
77
+ };
78
+ }
79
+ [util_1.inspect.custom](_depth, options) {
80
+ return (0, util_1.inspect)(this.toJSON(), options);
81
+ }
82
+ }
83
+ exports.AuthorizeInstance = AuthorizeInstance;
@@ -0,0 +1,88 @@
1
+ /// <reference types="node" />
2
+ import { inspect, InspectOptions } from "util";
3
+ import V1 from "../V1";
4
+ /**
5
+ * Options to pass to create a TokenInstance
6
+ */
7
+ export interface TokenListInstanceCreateOptions {
8
+ /** Grant type is a credential representing resource owner\\\'s authorization which can be used by client to obtain access token. */
9
+ grantType: string;
10
+ /** A 34 character string that uniquely identifies this OAuth App. */
11
+ clientId: string;
12
+ /** The credential for confidential OAuth App. */
13
+ clientSecret?: string;
14
+ /** JWT token related to the authorization code grant type. */
15
+ code?: string;
16
+ /** The redirect uri */
17
+ redirectUri?: string;
18
+ /** The targeted audience uri */
19
+ audience?: string;
20
+ /** JWT token related to refresh access token. */
21
+ refreshToken?: string;
22
+ /** The scope of token */
23
+ scope?: string;
24
+ }
25
+ export interface TokenSolution {
26
+ }
27
+ export interface TokenListInstance {
28
+ _version: V1;
29
+ _solution: TokenSolution;
30
+ _uri: string;
31
+ /**
32
+ * Create a TokenInstance
33
+ *
34
+ * @param params - Parameter for request
35
+ * @param callback - Callback to handle processed record
36
+ *
37
+ * @returns Resolves to processed TokenInstance
38
+ */
39
+ create(params: TokenListInstanceCreateOptions, callback?: (error: Error | null, item?: TokenInstance) => any): Promise<TokenInstance>;
40
+ /**
41
+ * Provide a user-friendly representation
42
+ */
43
+ toJSON(): any;
44
+ [inspect.custom](_depth: any, options: InspectOptions): any;
45
+ }
46
+ export declare function TokenListInstance(version: V1): TokenListInstance;
47
+ interface TokenResource {
48
+ access_token: string;
49
+ refresh_token: string;
50
+ id_token: string;
51
+ token_type: string;
52
+ expires_in: number;
53
+ }
54
+ export declare class TokenInstance {
55
+ protected _version: V1;
56
+ constructor(_version: V1, payload: TokenResource);
57
+ /**
58
+ * Token which carries the necessary information to access a Twilio resource directly.
59
+ */
60
+ accessToken: string;
61
+ /**
62
+ * Token which carries the information necessary to get a new access token.
63
+ */
64
+ refreshToken: string;
65
+ /**
66
+ * Token which carries the information necessary of user profile.
67
+ */
68
+ idToken: string;
69
+ /**
70
+ * Token type
71
+ */
72
+ tokenType: string;
73
+ expiresIn: number;
74
+ /**
75
+ * Provide a user-friendly representation
76
+ *
77
+ * @returns Object
78
+ */
79
+ toJSON(): {
80
+ accessToken: string;
81
+ refreshToken: string;
82
+ idToken: string;
83
+ tokenType: string;
84
+ expiresIn: number;
85
+ };
86
+ [inspect.custom](_depth: any, options: InspectOptions): string;
87
+ }
88
+ export {};
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Oauth
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.TokenInstance = exports.TokenListInstance = void 0;
17
+ const util_1 = require("util");
18
+ const deserialize = require("../../../base/deserialize");
19
+ const serialize = require("../../../base/serialize");
20
+ function TokenListInstance(version) {
21
+ const instance = {};
22
+ instance._version = version;
23
+ instance._solution = {};
24
+ instance._uri = `/token`;
25
+ instance.create = function create(params, callback) {
26
+ if (params === null || params === undefined) {
27
+ throw new Error('Required parameter "params" missing.');
28
+ }
29
+ if (params["grantType"] === null || params["grantType"] === undefined) {
30
+ throw new Error("Required parameter \"params['grantType']\" missing.");
31
+ }
32
+ if (params["clientId"] === null || params["clientId"] === undefined) {
33
+ throw new Error("Required parameter \"params['clientId']\" missing.");
34
+ }
35
+ let data = {};
36
+ data["GrantType"] = params["grantType"];
37
+ data["ClientId"] = params["clientId"];
38
+ if (params["clientSecret"] !== undefined)
39
+ data["ClientSecret"] = params["clientSecret"];
40
+ if (params["code"] !== undefined)
41
+ data["Code"] = params["code"];
42
+ if (params["redirectUri"] !== undefined)
43
+ data["RedirectUri"] = params["redirectUri"];
44
+ if (params["audience"] !== undefined)
45
+ data["Audience"] = params["audience"];
46
+ if (params["refreshToken"] !== undefined)
47
+ data["RefreshToken"] = params["refreshToken"];
48
+ if (params["scope"] !== undefined)
49
+ data["Scope"] = params["scope"];
50
+ const headers = {};
51
+ headers["Content-Type"] = "application/x-www-form-urlencoded";
52
+ let operationVersion = version, operationPromise = operationVersion.create({
53
+ uri: instance._uri,
54
+ method: "post",
55
+ data,
56
+ headers,
57
+ });
58
+ operationPromise = operationPromise.then((payload) => new TokenInstance(operationVersion, payload));
59
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
60
+ return operationPromise;
61
+ };
62
+ instance.toJSON = function toJSON() {
63
+ return instance._solution;
64
+ };
65
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
66
+ return (0, util_1.inspect)(instance.toJSON(), options);
67
+ };
68
+ return instance;
69
+ }
70
+ exports.TokenListInstance = TokenListInstance;
71
+ class TokenInstance {
72
+ constructor(_version, payload) {
73
+ this._version = _version;
74
+ this.accessToken = payload.access_token;
75
+ this.refreshToken = payload.refresh_token;
76
+ this.idToken = payload.id_token;
77
+ this.tokenType = payload.token_type;
78
+ this.expiresIn = payload.expires_in;
79
+ }
80
+ /**
81
+ * Provide a user-friendly representation
82
+ *
83
+ * @returns Object
84
+ */
85
+ toJSON() {
86
+ return {
87
+ accessToken: this.accessToken,
88
+ refreshToken: this.refreshToken,
89
+ idToken: this.idToken,
90
+ tokenType: this.tokenType,
91
+ expiresIn: this.expiresIn,
92
+ };
93
+ }
94
+ [util_1.inspect.custom](_depth, options) {
95
+ return (0, util_1.inspect)(this.toJSON(), options);
96
+ }
97
+ }
98
+ exports.TokenInstance = TokenInstance;