twilio 5.8.2 → 5.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +103 -0
  2. package/lib/index.d.ts +3 -0
  3. package/lib/index.js +2 -0
  4. package/lib/rest/NumbersBase.d.ts +3 -0
  5. package/lib/rest/NumbersBase.js +5 -0
  6. package/lib/rest/OauthBase.d.ts +3 -0
  7. package/lib/rest/OauthBase.js +5 -0
  8. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/local.d.ts +3 -3
  9. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/machineToMachine.d.ts +3 -3
  10. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/mobile.d.ts +3 -3
  11. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/national.d.ts +3 -3
  12. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/sharedCost.d.ts +3 -3
  13. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/tollFree.d.ts +3 -3
  14. package/lib/rest/api/v2010/account/availablePhoneNumberCountry/voip.d.ts +3 -3
  15. package/lib/rest/api/v2010/account/recording.d.ts +1 -1
  16. package/lib/rest/api/v2010/account/usage/record/allTime.d.ts +9 -10
  17. package/lib/rest/api/v2010/account/usage/record/daily.d.ts +9 -10
  18. package/lib/rest/api/v2010/account/usage/record/lastMonth.d.ts +9 -10
  19. package/lib/rest/api/v2010/account/usage/record/monthly.d.ts +9 -10
  20. package/lib/rest/api/v2010/account/usage/record/thisMonth.d.ts +9 -10
  21. package/lib/rest/api/v2010/account/usage/record/today.d.ts +9 -10
  22. package/lib/rest/api/v2010/account/usage/record/yearly.d.ts +9 -10
  23. package/lib/rest/api/v2010/account/usage/record/yesterday.d.ts +9 -10
  24. package/lib/rest/api/v2010/account/usage/record.d.ts +9 -10
  25. package/lib/rest/api/v2010/account/usage/trigger.d.ts +11 -12
  26. package/lib/rest/api/v2010/account/usage.d.ts +0 -4
  27. package/lib/rest/assistants/v1/assistant/feedback.d.ts +2 -2
  28. package/lib/rest/assistants/v1/assistant/message.d.ts +1 -1
  29. package/lib/rest/assistants/v1/assistant.d.ts +20 -20
  30. package/lib/rest/assistants/v1/knowledge.d.ts +6 -6
  31. package/lib/rest/assistants/v1/tool.d.ts +8 -8
  32. package/lib/rest/content/v1/content.d.ts +41 -25
  33. package/lib/rest/content/v1/content.js +7 -1
  34. package/lib/rest/flexApi/v1/interaction/interactionChannel.d.ts +1 -1
  35. package/lib/rest/insights/v1/room/participant.d.ts +1 -1
  36. package/lib/rest/insights/v1/room.d.ts +1 -1
  37. package/lib/rest/intelligence/v2/service.d.ts +10 -0
  38. package/lib/rest/intelligence/v2/service.js +6 -0
  39. package/lib/rest/intelligence/v2/transcript/encryptedOperatorResults.d.ts +113 -0
  40. package/lib/rest/intelligence/v2/transcript/encryptedOperatorResults.js +120 -0
  41. package/lib/rest/intelligence/v2/transcript/encryptedSentences.d.ts +113 -0
  42. package/lib/rest/intelligence/v2/transcript/encryptedSentences.js +120 -0
  43. package/lib/rest/intelligence/v2/transcript.d.ts +22 -0
  44. package/lib/rest/intelligence/v2/transcript.js +28 -0
  45. package/lib/rest/lookups/v2/lookupOverride.d.ts +1 -1
  46. package/lib/rest/lookups/v2/query.d.ts +71 -71
  47. package/lib/rest/marketplace/v1/installedAddOn/installedAddOnUsage.d.ts +2 -2
  48. package/lib/rest/marketplace/v1/referralConversion.d.ts +1 -1
  49. package/lib/rest/messaging/v2/channelsSender.d.ts +71 -71
  50. package/lib/rest/messaging/v2/channelsSender.js +6 -6
  51. package/lib/rest/numbers/V3.d.ts +15 -0
  52. package/lib/rest/numbers/V3.js +37 -0
  53. package/lib/rest/numbers/v1/portingPortIn.d.ts +3 -3
  54. package/lib/rest/numbers/v3/hostedNumberOrder.d.ts +210 -0
  55. package/lib/rest/numbers/v3/hostedNumberOrder.js +154 -0
  56. package/lib/rest/oauth/V2.d.ts +15 -0
  57. package/lib/rest/oauth/V2.js +36 -0
  58. package/lib/rest/oauth/v2/token.d.ts +87 -0
  59. package/lib/rest/oauth/v2/token.js +99 -0
  60. package/lib/rest/previewIam/versionless/organization/roleAssignment.d.ts +1 -1
  61. package/lib/rest/pricing/v1/messaging/country.d.ts +6 -6
  62. package/lib/rest/pricing/v1/phoneNumber/country.d.ts +3 -3
  63. package/lib/rest/pricing/v1/voice/country.d.ts +6 -6
  64. package/lib/rest/pricing/v1/voice/number.d.ts +5 -5
  65. package/lib/rest/pricing/v2/country.d.ts +8 -8
  66. package/lib/rest/pricing/v2/number.d.ts +8 -8
  67. package/lib/rest/pricing/v2/voice/country.d.ts +8 -8
  68. package/lib/rest/pricing/v2/voice/number.d.ts +6 -6
  69. package/lib/rest/verify/V2.d.ts +5 -0
  70. package/lib/rest/verify/V2.js +6 -0
  71. package/lib/rest/verify/v2/newChallenge.d.ts +204 -0
  72. package/lib/rest/verify/v2/newChallenge.js +150 -0
  73. package/lib/rest/verify/v2/service/newFactor.d.ts +154 -0
  74. package/lib/rest/verify/v2/service/newFactor.js +118 -0
  75. package/lib/rest/verify/v2/service.d.ts +8 -0
  76. package/lib/rest/verify/v2/service.js +13 -0
  77. package/lib/twiml/VoiceResponse.d.ts +22 -0
  78. package/lib/twiml/VoiceResponse.js +19 -0
  79. package/lib-esm/index.js +49 -0
  80. package/lib-esm/package.json +3 -0
  81. package/package.json +15 -4
@@ -4,16 +4,16 @@ import V1 from "../../V1";
4
4
  * The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record. If `null`, the Phone Number is not a Twilio number owned by this account.
5
5
  */
6
6
  export declare class PricingV1VoiceVoiceNumberInboundCallPrice {
7
- "base_price"?: number;
8
- "current_price"?: number;
9
- "number_type"?: string;
7
+ "basePrice"?: number;
8
+ "currentPrice"?: number;
9
+ "numberType"?: string;
10
10
  }
11
11
  /**
12
12
  * The OutboundCallPrice record, which includes a list of `origination_prefixes` and the `base_price` and `current_price` for those prefixes.
13
13
  */
14
14
  export declare class PricingV1VoiceVoiceNumberOutboundCallPrice {
15
- "base_price"?: number;
16
- "current_price"?: number;
15
+ "basePrice"?: number;
16
+ "currentPrice"?: number;
17
17
  }
18
18
  export interface NumberContext {
19
19
  /**
@@ -3,16 +3,16 @@ import Page, { TwilioResponsePayload } from "../../../base/Page";
3
3
  import Response from "../../../http/response";
4
4
  import V2 from "../V2";
5
5
  export declare class PricingV2TrunkingCountryInstanceOriginatingCallPrices {
6
- "base_price"?: number;
7
- "current_price"?: number;
8
- "number_type"?: string;
6
+ "basePrice"?: number;
7
+ "currentPrice"?: number;
8
+ "numberType"?: string;
9
9
  }
10
10
  export declare class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices {
11
- "origination_prefixes"?: Array<string>;
12
- "destination_prefixes"?: Array<string>;
13
- "base_price"?: number;
14
- "current_price"?: number;
15
- "friendly_name"?: string;
11
+ "originationPrefixes"?: Array<string>;
12
+ "destinationPrefixes"?: Array<string>;
13
+ "basePrice"?: number;
14
+ "currentPrice"?: number;
15
+ "friendlyName"?: string;
16
16
  }
17
17
  /**
18
18
  * Options to pass to each
@@ -1,19 +1,19 @@
1
1
  import { inspect, InspectOptions } from "util";
2
2
  import V2 from "../V2";
3
3
  export declare class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices {
4
- "origination_prefixes"?: Array<string>;
5
- "destination_prefixes"?: Array<string>;
6
- "base_price"?: number;
7
- "current_price"?: number;
8
- "friendly_name"?: string;
4
+ "originationPrefixes"?: Array<string>;
5
+ "destinationPrefixes"?: Array<string>;
6
+ "basePrice"?: number;
7
+ "currentPrice"?: number;
8
+ "friendlyName"?: string;
9
9
  }
10
10
  /**
11
11
  * The [OriginatingCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record.
12
12
  */
13
13
  export declare class PricingV2TrunkingNumberOriginatingCallPrice {
14
- "base_price"?: number;
15
- "current_price"?: number;
16
- "number_type"?: string;
14
+ "basePrice"?: number;
15
+ "currentPrice"?: number;
16
+ "numberType"?: string;
17
17
  }
18
18
  /**
19
19
  * Options to pass to fetch a NumberInstance
@@ -3,16 +3,16 @@ import Page, { TwilioResponsePayload } from "../../../../base/Page";
3
3
  import Response from "../../../../http/response";
4
4
  import V2 from "../../V2";
5
5
  export declare class PricingV2TrunkingCountryInstanceOriginatingCallPrices {
6
- "base_price"?: number;
7
- "current_price"?: number;
8
- "number_type"?: string;
6
+ "basePrice"?: number;
7
+ "currentPrice"?: number;
8
+ "numberType"?: string;
9
9
  }
10
10
  export declare class PricingV2TrunkingCountryInstanceTerminatingPrefixPrices {
11
- "origination_prefixes"?: Array<string>;
12
- "destination_prefixes"?: Array<string>;
13
- "base_price"?: number;
14
- "current_price"?: number;
15
- "friendly_name"?: string;
11
+ "originationPrefixes"?: Array<string>;
12
+ "destinationPrefixes"?: Array<string>;
13
+ "basePrice"?: number;
14
+ "currentPrice"?: number;
15
+ "friendlyName"?: string;
16
16
  }
17
17
  /**
18
18
  * Options to pass to each
@@ -4,14 +4,14 @@ import V2 from "../../V2";
4
4
  * The [InboundCallPrice](https://www.twilio.com/docs/voice/pricing#inbound-call-price) record.
5
5
  */
6
6
  export declare class PricingV2VoiceVoiceNumberInboundCallPrice {
7
- "base_price"?: number;
8
- "current_price"?: number;
9
- "number_type"?: string;
7
+ "basePrice"?: number;
8
+ "currentPrice"?: number;
9
+ "numberType"?: string;
10
10
  }
11
11
  export declare class PricingV2VoiceVoiceNumberOutboundCallPrices {
12
- "base_price"?: number;
13
- "current_price"?: number;
14
- "origination_prefixes"?: Array<string>;
12
+ "basePrice"?: number;
13
+ "currentPrice"?: number;
14
+ "originationPrefixes"?: Array<string>;
15
15
  }
16
16
  /**
17
17
  * Options to pass to fetch a NumberInstance
@@ -1,6 +1,7 @@
1
1
  import VerifyBase from "../VerifyBase";
2
2
  import Version from "../../base/Version";
3
3
  import { FormListInstance } from "./v2/form";
4
+ import { NewChallengeListInstance } from "./v2/newChallenge";
4
5
  import { SafelistListInstance } from "./v2/safelist";
5
6
  import { ServiceListInstance } from "./v2/service";
6
7
  import { TemplateListInstance } from "./v2/template";
@@ -15,6 +16,8 @@ export default class V2 extends Version {
15
16
  constructor(domain: VerifyBase);
16
17
  /** forms - { Twilio.Verify.V2.FormListInstance } resource */
17
18
  protected _forms?: FormListInstance;
19
+ /** newChallenge - { Twilio.Verify.V2.NewChallengeListInstance } resource */
20
+ protected _newChallenge?: NewChallengeListInstance;
18
21
  /** safelist - { Twilio.Verify.V2.SafelistListInstance } resource */
19
22
  protected _safelist?: SafelistListInstance;
20
23
  /** services - { Twilio.Verify.V2.ServiceListInstance } resource */
@@ -27,6 +30,8 @@ export default class V2 extends Version {
27
30
  protected _verificationAttemptsSummary?: VerificationAttemptsSummaryListInstance;
28
31
  /** Getter for forms resource */
29
32
  get forms(): FormListInstance;
33
+ /** Getter for newChallenge resource */
34
+ get newChallenge(): NewChallengeListInstance;
30
35
  /** Getter for safelist resource */
31
36
  get safelist(): SafelistListInstance;
32
37
  /** Getter for services resource */
@@ -18,6 +18,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
18
18
  Object.defineProperty(exports, "__esModule", { value: true });
19
19
  const Version_1 = __importDefault(require("../../base/Version"));
20
20
  const form_1 = require("./v2/form");
21
+ const newChallenge_1 = require("./v2/newChallenge");
21
22
  const safelist_1 = require("./v2/safelist");
22
23
  const service_1 = require("./v2/service");
23
24
  const template_1 = require("./v2/template");
@@ -37,6 +38,11 @@ class V2 extends Version_1.default {
37
38
  this._forms = this._forms || (0, form_1.FormListInstance)(this);
38
39
  return this._forms;
39
40
  }
41
+ /** Getter for newChallenge resource */
42
+ get newChallenge() {
43
+ this._newChallenge = this._newChallenge || (0, newChallenge_1.NewChallengeListInstance)(this);
44
+ return this._newChallenge;
45
+ }
40
46
  /** Getter for safelist resource */
41
47
  get safelist() {
42
48
  this._safelist = this._safelist || (0, safelist_1.SafelistListInstance)(this);
@@ -0,0 +1,204 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V2 from "../V2";
3
+ export declare class CreatePasskeysChallengeRequest {
4
+ "identity"?: string;
5
+ "factorSid"?: string;
6
+ }
7
+ /**
8
+ * Options to pass to create a NewChallengeInstance
9
+ */
10
+ export interface NewChallengeContextCreateOptions {
11
+ /** */
12
+ createPasskeysChallengeRequest: CreatePasskeysChallengeRequest;
13
+ }
14
+ export interface NewChallengeContext {
15
+ /**
16
+ * Create a NewChallengeInstance
17
+ *
18
+ * @param params - Body for request
19
+ * @param headers - header params for request
20
+ * @param callback - Callback to handle processed record
21
+ *
22
+ * @returns Resolves to processed NewChallengeInstance
23
+ */
24
+ create(params: CreatePasskeysChallengeRequest, headers?: any, callback?: (error: Error | null, item?: NewChallengeInstance) => any): Promise<NewChallengeInstance>;
25
+ /**
26
+ * Provide a user-friendly representation
27
+ */
28
+ toJSON(): any;
29
+ [inspect.custom](_depth: any, options: InspectOptions): any;
30
+ }
31
+ export interface NewChallengeContextSolution {
32
+ serviceSid: string;
33
+ }
34
+ export declare class NewChallengeContextImpl implements NewChallengeContext {
35
+ protected _version: V2;
36
+ protected _solution: NewChallengeContextSolution;
37
+ protected _uri: string;
38
+ constructor(_version: V2, serviceSid: string);
39
+ create(params: CreatePasskeysChallengeRequest, headers?: any, callback?: (error: Error | null, item?: NewChallengeInstance) => any): Promise<NewChallengeInstance>;
40
+ /**
41
+ * Provide a user-friendly representation
42
+ *
43
+ * @returns Object
44
+ */
45
+ toJSON(): NewChallengeContextSolution;
46
+ [inspect.custom](_depth: any, options: InspectOptions): string;
47
+ }
48
+ interface NewChallengeResource {
49
+ options: Record<string, object>;
50
+ sid: string;
51
+ account_sid: string;
52
+ service_sid: string;
53
+ entity_sid: string;
54
+ identity: string;
55
+ factor_sid: string;
56
+ date_created: Date;
57
+ date_updated: Date;
58
+ date_responded: Date;
59
+ expiration_date: Date;
60
+ status: string;
61
+ responded_reason: string;
62
+ details: any;
63
+ hidden_details: any;
64
+ metadata: any;
65
+ factor_type: string;
66
+ url: string;
67
+ links: Record<string, string>;
68
+ }
69
+ export declare class NewChallengeInstance {
70
+ protected _version: V2;
71
+ protected _solution: NewChallengeContextSolution;
72
+ protected _context?: NewChallengeContext;
73
+ constructor(_version: V2, payload: NewChallengeResource, serviceSid?: string);
74
+ /**
75
+ * An object that contains challenge options. Currently only used for `passkeys`.
76
+ */
77
+ options: Record<string, object>;
78
+ /**
79
+ * A 34 character string that uniquely identifies this Challenge.
80
+ */
81
+ sid: string;
82
+ /**
83
+ * The unique SID identifier of the Account.
84
+ */
85
+ accountSid: string;
86
+ /**
87
+ * The unique SID identifier of the Service.
88
+ */
89
+ serviceSid: string;
90
+ /**
91
+ * The unique SID identifier of the Entity.
92
+ */
93
+ entitySid: string;
94
+ /**
95
+ * Customer unique identity for the Entity owner of the Challenge.
96
+ */
97
+ identity: string;
98
+ /**
99
+ * The unique SID identifier of the Factor.
100
+ */
101
+ factorSid: string;
102
+ /**
103
+ * The date that this Challenge was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
104
+ */
105
+ dateCreated: Date;
106
+ /**
107
+ * The date that this Challenge was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
108
+ */
109
+ dateUpdated: Date;
110
+ /**
111
+ * The date that this Challenge was responded, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
112
+ */
113
+ dateResponded: Date;
114
+ /**
115
+ * The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
116
+ */
117
+ expirationDate: Date;
118
+ /**
119
+ * The Status of this Challenge. One of `pending`, `expired`, `approved` or `denied`.
120
+ */
121
+ status: string;
122
+ /**
123
+ * Reason for the Challenge to be in certain `status`. One of `none`, `not_needed` or `not_requested`.
124
+ */
125
+ respondedReason: string;
126
+ /**
127
+ * Details provided to give context about the Challenge.
128
+ */
129
+ details: any;
130
+ /**
131
+ * Details provided to give context about the Challenge.
132
+ */
133
+ hiddenDetails: any;
134
+ /**
135
+ * Custom metadata associated with the challenge.
136
+ */
137
+ metadata: any;
138
+ /**
139
+ * The Factor Type of this Challenge. Currently `push` and `totp` are supported.
140
+ */
141
+ factorType: string;
142
+ /**
143
+ * The URL of this resource.
144
+ */
145
+ url: string;
146
+ /**
147
+ * Contains a dictionary of URL links to nested resources of this Challenge.
148
+ */
149
+ links: Record<string, string>;
150
+ private get _proxy();
151
+ /**
152
+ * Create a NewChallengeInstance
153
+ *
154
+ * @param params - Body for request
155
+ * @param headers - header params for request
156
+ * @param callback - Callback to handle processed record
157
+ *
158
+ * @returns Resolves to processed NewChallengeInstance
159
+ */
160
+ create(params: CreatePasskeysChallengeRequest, headers?: any, callback?: (error: Error | null, item?: NewChallengeInstance) => any): Promise<NewChallengeInstance>;
161
+ /**
162
+ * Provide a user-friendly representation
163
+ *
164
+ * @returns Object
165
+ */
166
+ toJSON(): {
167
+ options: Record<string, object>;
168
+ sid: string;
169
+ accountSid: string;
170
+ serviceSid: string;
171
+ entitySid: string;
172
+ identity: string;
173
+ factorSid: string;
174
+ dateCreated: Date;
175
+ dateUpdated: Date;
176
+ dateResponded: Date;
177
+ expirationDate: Date;
178
+ status: string;
179
+ respondedReason: string;
180
+ details: any;
181
+ hiddenDetails: any;
182
+ metadata: any;
183
+ factorType: string;
184
+ url: string;
185
+ links: Record<string, string>;
186
+ };
187
+ [inspect.custom](_depth: any, options: InspectOptions): string;
188
+ }
189
+ export interface NewChallengeSolution {
190
+ }
191
+ export interface NewChallengeListInstance {
192
+ _version: V2;
193
+ _solution: NewChallengeSolution;
194
+ _uri: string;
195
+ (serviceSid: string): NewChallengeContext;
196
+ get(serviceSid: string): NewChallengeContext;
197
+ /**
198
+ * Provide a user-friendly representation
199
+ */
200
+ toJSON(): any;
201
+ [inspect.custom](_depth: any, options: InspectOptions): any;
202
+ }
203
+ export declare function NewChallengeListInstance(version: V2): NewChallengeListInstance;
204
+ export {};
@@ -0,0 +1,150 @@
1
+ "use strict";
2
+ /*
3
+ * This code was generated by
4
+ * ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __
5
+ * | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/
6
+ * | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \
7
+ *
8
+ * Twilio - Verify
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.NewChallengeInstance = exports.NewChallengeContextImpl = exports.CreatePasskeysChallengeRequest = void 0;
17
+ exports.NewChallengeListInstance = NewChallengeListInstance;
18
+ const util_1 = require("util");
19
+ const deserialize = require("../../../base/deserialize");
20
+ const serialize = require("../../../base/serialize");
21
+ const utility_1 = require("../../../base/utility");
22
+ class CreatePasskeysChallengeRequest {
23
+ }
24
+ exports.CreatePasskeysChallengeRequest = CreatePasskeysChallengeRequest;
25
+ class NewChallengeContextImpl {
26
+ constructor(_version, serviceSid) {
27
+ this._version = _version;
28
+ if (!(0, utility_1.isValidPathParam)(serviceSid)) {
29
+ throw new Error("Parameter 'serviceSid' is not valid.");
30
+ }
31
+ this._solution = { serviceSid };
32
+ this._uri = `/Services/${serviceSid}/Passkeys/Challenges`;
33
+ }
34
+ create(params, headers, callback) {
35
+ if (params === null || params === undefined) {
36
+ throw new Error('Required parameter "params" missing.');
37
+ }
38
+ let data = {};
39
+ data = params;
40
+ if (headers === null || headers === undefined) {
41
+ headers = {};
42
+ }
43
+ headers["Content-Type"] = "application/json";
44
+ headers["Accept"] = "application/json";
45
+ const instance = this;
46
+ let operationVersion = instance._version, operationPromise = operationVersion.create({
47
+ uri: instance._uri,
48
+ method: "post",
49
+ data,
50
+ headers,
51
+ });
52
+ operationPromise = operationPromise.then((payload) => new NewChallengeInstance(operationVersion, payload, instance._solution.serviceSid));
53
+ operationPromise = instance._version.setPromiseCallback(operationPromise, callback);
54
+ return operationPromise;
55
+ }
56
+ /**
57
+ * Provide a user-friendly representation
58
+ *
59
+ * @returns Object
60
+ */
61
+ toJSON() {
62
+ return this._solution;
63
+ }
64
+ [util_1.inspect.custom](_depth, options) {
65
+ return (0, util_1.inspect)(this.toJSON(), options);
66
+ }
67
+ }
68
+ exports.NewChallengeContextImpl = NewChallengeContextImpl;
69
+ class NewChallengeInstance {
70
+ constructor(_version, payload, serviceSid) {
71
+ this._version = _version;
72
+ this.options = payload.options;
73
+ this.sid = payload.sid;
74
+ this.accountSid = payload.account_sid;
75
+ this.serviceSid = payload.service_sid;
76
+ this.entitySid = payload.entity_sid;
77
+ this.identity = payload.identity;
78
+ this.factorSid = payload.factor_sid;
79
+ this.dateCreated = deserialize.iso8601DateTime(payload.date_created);
80
+ this.dateUpdated = deserialize.iso8601DateTime(payload.date_updated);
81
+ this.dateResponded = deserialize.iso8601DateTime(payload.date_responded);
82
+ this.expirationDate = deserialize.iso8601DateTime(payload.expiration_date);
83
+ this.status = payload.status;
84
+ this.respondedReason = payload.responded_reason;
85
+ this.details = payload.details;
86
+ this.hiddenDetails = payload.hidden_details;
87
+ this.metadata = payload.metadata;
88
+ this.factorType = payload.factor_type;
89
+ this.url = payload.url;
90
+ this.links = payload.links;
91
+ this._solution = { serviceSid: serviceSid || this.serviceSid };
92
+ }
93
+ get _proxy() {
94
+ this._context =
95
+ this._context ||
96
+ new NewChallengeContextImpl(this._version, this._solution.serviceSid);
97
+ return this._context;
98
+ }
99
+ create(params, callback) {
100
+ return this._proxy.create(params, callback);
101
+ }
102
+ /**
103
+ * Provide a user-friendly representation
104
+ *
105
+ * @returns Object
106
+ */
107
+ toJSON() {
108
+ return {
109
+ options: this.options,
110
+ sid: this.sid,
111
+ accountSid: this.accountSid,
112
+ serviceSid: this.serviceSid,
113
+ entitySid: this.entitySid,
114
+ identity: this.identity,
115
+ factorSid: this.factorSid,
116
+ dateCreated: this.dateCreated,
117
+ dateUpdated: this.dateUpdated,
118
+ dateResponded: this.dateResponded,
119
+ expirationDate: this.expirationDate,
120
+ status: this.status,
121
+ respondedReason: this.respondedReason,
122
+ details: this.details,
123
+ hiddenDetails: this.hiddenDetails,
124
+ metadata: this.metadata,
125
+ factorType: this.factorType,
126
+ url: this.url,
127
+ links: this.links,
128
+ };
129
+ }
130
+ [util_1.inspect.custom](_depth, options) {
131
+ return (0, util_1.inspect)(this.toJSON(), options);
132
+ }
133
+ }
134
+ exports.NewChallengeInstance = NewChallengeInstance;
135
+ function NewChallengeListInstance(version) {
136
+ const instance = ((serviceSid) => instance.get(serviceSid));
137
+ instance.get = function get(serviceSid) {
138
+ return new NewChallengeContextImpl(version, serviceSid);
139
+ };
140
+ instance._version = version;
141
+ instance._solution = {};
142
+ instance._uri = ``;
143
+ instance.toJSON = function toJSON() {
144
+ return instance._solution;
145
+ };
146
+ instance[util_1.inspect.custom] = function inspectImpl(_depth, options) {
147
+ return (0, util_1.inspect)(instance.toJSON(), options);
148
+ };
149
+ return instance;
150
+ }
@@ -0,0 +1,154 @@
1
+ import { inspect, InspectOptions } from "util";
2
+ import V2 from "../../V2";
3
+ export declare class CreateNewPasskeysFactorRequest {
4
+ "friendlyName": string;
5
+ "identity": string;
6
+ "config"?: CreateNewPasskeysFactorRequestConfig;
7
+ }
8
+ export declare class CreateNewPasskeysFactorRequestConfig {
9
+ "relyingParty"?: CreateNewPasskeysFactorRequestConfigRelyingParty;
10
+ "authenticatorAttachment"?: string;
11
+ "discoverableCredentials"?: string;
12
+ "userVerification"?: string;
13
+ }
14
+ /**
15
+ * Contains the information of the party requesting the user for authentication
16
+ */
17
+ export declare class CreateNewPasskeysFactorRequestConfigRelyingParty {
18
+ "id"?: string;
19
+ "name"?: string;
20
+ "origins"?: Array<string>;
21
+ }
22
+ /**
23
+ * Options to pass to create a NewFactorInstance
24
+ */
25
+ export interface NewFactorListInstanceCreateOptions {
26
+ /** */
27
+ createNewPasskeysFactorRequest: CreateNewPasskeysFactorRequest;
28
+ }
29
+ export interface NewFactorSolution {
30
+ serviceSid: string;
31
+ }
32
+ export interface NewFactorListInstance {
33
+ _version: V2;
34
+ _solution: NewFactorSolution;
35
+ _uri: string;
36
+ /**
37
+ * Create a NewFactorInstance
38
+ *
39
+ * @param params - Body for request
40
+ * @param headers - header params for request
41
+ * @param callback - Callback to handle processed record
42
+ *
43
+ * @returns Resolves to processed NewFactorInstance
44
+ */
45
+ create(params: CreateNewPasskeysFactorRequest, headers?: any, callback?: (error: Error | null, item?: NewFactorInstance) => any): Promise<NewFactorInstance>;
46
+ /**
47
+ * Provide a user-friendly representation
48
+ */
49
+ toJSON(): any;
50
+ [inspect.custom](_depth: any, options: InspectOptions): any;
51
+ }
52
+ export declare function NewFactorListInstance(version: V2, serviceSid: string): NewFactorListInstance;
53
+ interface NewFactorResource {
54
+ sid: string;
55
+ account_sid: string;
56
+ service_sid: string;
57
+ entity_sid: string;
58
+ identity: string;
59
+ binding: any;
60
+ options: any;
61
+ date_created: Date;
62
+ date_updated: Date;
63
+ friendly_name: string;
64
+ status: string;
65
+ factor_type: string;
66
+ config: any;
67
+ metadata: any;
68
+ url: string;
69
+ }
70
+ export declare class NewFactorInstance {
71
+ protected _version: V2;
72
+ constructor(_version: V2, payload: NewFactorResource, serviceSid: string);
73
+ /**
74
+ * A 34 character string that uniquely identifies this Factor.
75
+ */
76
+ sid: string;
77
+ /**
78
+ * The unique SID identifier of the Account.
79
+ */
80
+ accountSid: string;
81
+ /**
82
+ * The unique SID identifier of the Service.
83
+ */
84
+ serviceSid: string;
85
+ /**
86
+ * The unique SID identifier of the Entity.
87
+ */
88
+ entitySid: string;
89
+ /**
90
+ * Customer unique identity for the Entity owner of the Factor.
91
+ */
92
+ identity: string;
93
+ /**
94
+ * Contains the `factor_type` specific secret and metadata. The Binding property is ONLY returned upon Factor creation.
95
+ */
96
+ binding: any;
97
+ options: any;
98
+ /**
99
+ * The date that this Factor was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
100
+ */
101
+ dateCreated: Date;
102
+ /**
103
+ * The date that this Factor was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.
104
+ */
105
+ dateUpdated: Date;
106
+ /**
107
+ * The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors.
108
+ */
109
+ friendlyName: string;
110
+ /**
111
+ * The Status of this Factor. One of `unverified` or `verified`.
112
+ */
113
+ status: string;
114
+ /**
115
+ * The Type of this Factor. Currently `push` and `totp` are supported.
116
+ */
117
+ factorType: string;
118
+ /**
119
+ * An object that contains configurations specific to a `factor_type`.
120
+ */
121
+ config: any;
122
+ /**
123
+ * Custom metadata associated with the factor.
124
+ */
125
+ metadata: any;
126
+ /**
127
+ * The URL of this resource.
128
+ */
129
+ url: string;
130
+ /**
131
+ * Provide a user-friendly representation
132
+ *
133
+ * @returns Object
134
+ */
135
+ toJSON(): {
136
+ sid: string;
137
+ accountSid: string;
138
+ serviceSid: string;
139
+ entitySid: string;
140
+ identity: string;
141
+ binding: any;
142
+ options: any;
143
+ dateCreated: Date;
144
+ dateUpdated: Date;
145
+ friendlyName: string;
146
+ status: string;
147
+ factorType: string;
148
+ config: any;
149
+ metadata: any;
150
+ url: string;
151
+ };
152
+ [inspect.custom](_depth: any, options: InspectOptions): string;
153
+ }
154
+ export {};