@wix/auto_sdk_identity_authentication 1.0.57 → 1.0.59

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.
@@ -1,729 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // index.typings.ts
21
- var index_typings_exports = {};
22
- __export(index_typings_exports, {
23
- AddressTag: () => AddressTag,
24
- DeliveryMethod: () => DeliveryMethod,
25
- EmailTag: () => EmailTag,
26
- FactorStatus: () => FactorStatus,
27
- FactorType: () => FactorType,
28
- MfaReason: () => MfaReason,
29
- PhoneTag: () => PhoneTag,
30
- PrivacyStatus: () => PrivacyStatus,
31
- Reason: () => Reason,
32
- StateType: () => StateType,
33
- Status: () => Status,
34
- StatusName: () => StatusName,
35
- TenantType: () => TenantType,
36
- V1Reason: () => V1Reason,
37
- changePassword: () => changePassword2,
38
- loginV2: () => loginV22,
39
- logout: () => logout2,
40
- registerV2: () => registerV22,
41
- signOn: () => signOn2,
42
- validateEmail: () => validateEmail2
43
- });
44
- module.exports = __toCommonJS(index_typings_exports);
45
-
46
- // src/iam-authentication-v1-authentication-authentication.universal.ts
47
- var import_transform_error = require("@wix/sdk-runtime/transform-error");
48
- var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
49
-
50
- // src/iam-authentication-v1-authentication-authentication.http.ts
51
- var import_rest_modules = require("@wix/sdk-runtime/rest-modules");
52
- var import_float = require("@wix/sdk-runtime/transformations/float");
53
- var import_float2 = require("@wix/sdk-runtime/transformations/float");
54
- var import_bytes = require("@wix/sdk-runtime/transformations/bytes");
55
- var import_timestamp = require("@wix/sdk-runtime/transformations/timestamp");
56
- var import_timestamp2 = require("@wix/sdk-runtime/transformations/timestamp");
57
- var import_transform_paths = require("@wix/sdk-runtime/transformations/transform-paths");
58
- var import_rest_modules2 = require("@wix/sdk-runtime/rest-modules");
59
- function resolveWixIamAuthenticationV1AuthenticationServiceUrl(opts) {
60
- const domainToMappings = {
61
- _: [
62
- {
63
- srcPath: "/_api/iam/authentication",
64
- destPath: ""
65
- }
66
- ],
67
- "users._base_domain_": [
68
- {
69
- srcPath: "/iam/wix/google",
70
- destPath: "/v1/sso/callback/root/0e6a50f5-b523-4e29-990d-f37fa2ffdd69"
71
- },
72
- {
73
- srcPath: "/authentication",
74
- destPath: ""
75
- },
76
- {
77
- srcPath: "/_api/iam/authentication/v1/sso/callback",
78
- destPath: "/v1/sso/callback"
79
- },
80
- {
81
- srcPath: "/_api/iam/authentication",
82
- destPath: ""
83
- },
84
- {
85
- srcPath: "/_api/iam/authentication/v1/sso/login-with-token-params-redirect/",
86
- destPath: "/v1/sso/login-with-token-params-redirect"
87
- }
88
- ],
89
- "www.wixapis.com": [
90
- {
91
- srcPath: "/_api/iam/authentication",
92
- destPath: ""
93
- },
94
- {
95
- srcPath: "/iam/authentication",
96
- destPath: ""
97
- }
98
- ],
99
- "bo._base_domain_": [
100
- {
101
- srcPath: "/_api/iam/authentication",
102
- destPath: ""
103
- }
104
- ],
105
- "wixbo.ai": [
106
- {
107
- srcPath: "/_api/iam/authentication",
108
- destPath: ""
109
- }
110
- ],
111
- "wix-bo.com": [
112
- {
113
- srcPath: "/_api/iam/authentication",
114
- destPath: ""
115
- }
116
- ],
117
- "dev._base_domain_": [
118
- {
119
- srcPath: "/_api/iam/authentication",
120
- destPath: ""
121
- }
122
- ],
123
- "manage._base_domain_": [
124
- {
125
- srcPath: "/_api/authentication",
126
- destPath: ""
127
- },
128
- {
129
- srcPath: "/_api/iam/authentication",
130
- destPath: ""
131
- }
132
- ],
133
- "www._base_domain_": [
134
- {
135
- srcPath: "/_api/iam/authentication",
136
- destPath: ""
137
- }
138
- ],
139
- "*.dev.wix-code.com": [
140
- {
141
- srcPath: "/iam/authentication/v2/sign-on",
142
- destPath: "/v2/sign-on"
143
- },
144
- {
145
- srcPath: "/iam/authentication/v1/logout",
146
- destPath: "/v1/logout"
147
- },
148
- {
149
- srcPath: "/iam/authentication/v2/change-password",
150
- destPath: "/v2/change-password"
151
- },
152
- {
153
- srcPath: "/iam/authentication/v2/verify",
154
- destPath: "/v2/verify"
155
- },
156
- {
157
- srcPath: "/iam/authentication/v2/login",
158
- destPath: "/v2/login"
159
- },
160
- {
161
- srcPath: "/iam/authentication/v2/register",
162
- destPath: "/v2/register"
163
- },
164
- {
165
- srcPath: "/iam/authentication/v2",
166
- destPath: "/v2"
167
- }
168
- ]
169
- };
170
- return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
171
- }
172
- var PACKAGE_NAME = "@wix/auto_sdk_identity_authentication";
173
- function registerV2(payload) {
174
- function __registerV2({ host }) {
175
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
176
- {
177
- transformFn: import_float.transformSDKFloatToRESTFloat,
178
- paths: [{ path: "profile.customFields.value.numValue" }]
179
- },
180
- {
181
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
182
- paths: [{ path: "profile.customFields.value.dateValue" }]
183
- }
184
- ]);
185
- const metadata = {
186
- entityFqdn: "wix.iam.authentication.v1.authentication",
187
- method: "POST",
188
- methodFqn: "wix.iam.authentication.v1.AuthenticationService.RegisterV2",
189
- packageName: PACKAGE_NAME,
190
- migrationOptions: {
191
- optInTransformResponse: true
192
- },
193
- url: resolveWixIamAuthenticationV1AuthenticationServiceUrl({
194
- protoPath: "/v2/register",
195
- data: serializedData,
196
- host
197
- }),
198
- data: serializedData,
199
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
200
- {
201
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
202
- paths: [
203
- { path: "identity.createdDate" },
204
- { path: "identity.updatedDate" },
205
- { path: "identity.identityProfile.customFields.value.dateValue" },
206
- { path: "additionalData.*.dateValue" }
207
- ]
208
- },
209
- {
210
- transformFn: import_float2.transformRESTFloatToSDKFloat,
211
- paths: [
212
- { path: "identity.identityProfile.customFields.value.numValue" },
213
- { path: "additionalData.*.numValue" }
214
- ]
215
- }
216
- ])
217
- };
218
- return metadata;
219
- }
220
- return __registerV2;
221
- }
222
- function validateEmail(payload) {
223
- function __validateEmail({ host }) {
224
- const metadata = {
225
- entityFqdn: "wix.iam.authentication.v1.authentication",
226
- method: "POST",
227
- methodFqn: "wix.iam.authentication.v1.AuthenticationService.ValidateEmail",
228
- packageName: PACKAGE_NAME,
229
- migrationOptions: {
230
- optInTransformResponse: true
231
- },
232
- url: resolveWixIamAuthenticationV1AuthenticationServiceUrl({
233
- protoPath: "/v2/validate-email",
234
- data: payload,
235
- host
236
- }),
237
- data: payload
238
- };
239
- return metadata;
240
- }
241
- return __validateEmail;
242
- }
243
- function loginV2(payload) {
244
- function __loginV2({ host }) {
245
- const metadata = {
246
- entityFqdn: "wix.iam.authentication.v1.authentication",
247
- method: "POST",
248
- methodFqn: "wix.iam.authentication.v1.AuthenticationService.LoginV2",
249
- packageName: PACKAGE_NAME,
250
- migrationOptions: {
251
- optInTransformResponse: true
252
- },
253
- url: resolveWixIamAuthenticationV1AuthenticationServiceUrl({
254
- protoPath: "/v2/login",
255
- data: payload,
256
- host
257
- }),
258
- data: payload,
259
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
260
- {
261
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
262
- paths: [
263
- { path: "identity.createdDate" },
264
- { path: "identity.updatedDate" },
265
- { path: "identity.identityProfile.customFields.value.dateValue" },
266
- { path: "additionalData.*.dateValue" }
267
- ]
268
- },
269
- {
270
- transformFn: import_float2.transformRESTFloatToSDKFloat,
271
- paths: [
272
- { path: "identity.identityProfile.customFields.value.numValue" },
273
- { path: "additionalData.*.numValue" }
274
- ]
275
- }
276
- ])
277
- };
278
- return metadata;
279
- }
280
- return __loginV2;
281
- }
282
- function changePassword(payload) {
283
- function __changePassword({ host }) {
284
- const metadata = {
285
- entityFqdn: "wix.iam.authentication.v1.authentication",
286
- method: "POST",
287
- methodFqn: "wix.iam.authentication.v1.AuthenticationService.ChangePassword",
288
- packageName: PACKAGE_NAME,
289
- migrationOptions: {
290
- optInTransformResponse: true
291
- },
292
- url: resolveWixIamAuthenticationV1AuthenticationServiceUrl({
293
- protoPath: "/v2/change-password",
294
- data: payload,
295
- host
296
- }),
297
- data: payload
298
- };
299
- return metadata;
300
- }
301
- return __changePassword;
302
- }
303
- function signOn(payload) {
304
- function __signOn({ host }) {
305
- const serializedData = (0, import_transform_paths.transformPaths)(payload, [
306
- {
307
- transformFn: import_float.transformSDKFloatToRESTFloat,
308
- paths: [{ path: "profile.customFields.value.numValue" }]
309
- },
310
- {
311
- transformFn: import_timestamp.transformSDKTimestampToRESTTimestamp,
312
- paths: [{ path: "profile.customFields.value.dateValue" }]
313
- }
314
- ]);
315
- const metadata = {
316
- entityFqdn: "wix.iam.authentication.v1.authentication",
317
- method: "POST",
318
- methodFqn: "wix.iam.authentication.v1.AuthenticationService.SignOn",
319
- packageName: PACKAGE_NAME,
320
- migrationOptions: {
321
- optInTransformResponse: true
322
- },
323
- url: resolveWixIamAuthenticationV1AuthenticationServiceUrl({
324
- protoPath: "/v2/sign-on",
325
- data: serializedData,
326
- host
327
- }),
328
- data: serializedData,
329
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
330
- {
331
- transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
332
- paths: [
333
- { path: "identity.createdDate" },
334
- { path: "identity.updatedDate" },
335
- { path: "identity.identityProfile.customFields.value.dateValue" }
336
- ]
337
- },
338
- {
339
- transformFn: import_float2.transformRESTFloatToSDKFloat,
340
- paths: [
341
- { path: "identity.identityProfile.customFields.value.numValue" }
342
- ]
343
- }
344
- ])
345
- };
346
- return metadata;
347
- }
348
- return __signOn;
349
- }
350
- function logout(payload) {
351
- function __logout({ host }) {
352
- const metadata = {
353
- entityFqdn: "wix.iam.authentication.v1.authentication",
354
- method: "GET",
355
- methodFqn: "wix.iam.authentication.v1.AuthenticationService.Logout",
356
- packageName: PACKAGE_NAME,
357
- migrationOptions: {
358
- optInTransformResponse: true
359
- },
360
- url: resolveWixIamAuthenticationV1AuthenticationServiceUrl({
361
- protoPath: "/v1/logout",
362
- data: payload,
363
- host
364
- }),
365
- params: (0, import_rest_modules.toURLSearchParams)(payload),
366
- transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
367
- {
368
- transformFn: import_bytes.transformRESTBytesToSDKBytes,
369
- paths: [{ path: "body" }]
370
- }
371
- ])
372
- };
373
- return metadata;
374
- }
375
- return __logout;
376
- }
377
-
378
- // src/iam-authentication-v1-authentication-authentication.universal.ts
379
- var import_address = require("@wix/sdk-runtime/transformations/address");
380
- var import_address2 = require("@wix/sdk-runtime/transformations/address");
381
- var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
382
- var PrivacyStatus = /* @__PURE__ */ ((PrivacyStatus2) => {
383
- PrivacyStatus2["UNDEFINED"] = "UNDEFINED";
384
- PrivacyStatus2["PUBLIC"] = "PUBLIC";
385
- PrivacyStatus2["PRIVATE"] = "PRIVATE";
386
- return PrivacyStatus2;
387
- })(PrivacyStatus || {});
388
- var EmailTag = /* @__PURE__ */ ((EmailTag2) => {
389
- EmailTag2["UNTAGGED"] = "UNTAGGED";
390
- EmailTag2["MAIN"] = "MAIN";
391
- EmailTag2["HOME"] = "HOME";
392
- EmailTag2["WORK"] = "WORK";
393
- return EmailTag2;
394
- })(EmailTag || {});
395
- var PhoneTag = /* @__PURE__ */ ((PhoneTag2) => {
396
- PhoneTag2["UNTAGGED"] = "UNTAGGED";
397
- PhoneTag2["MAIN"] = "MAIN";
398
- PhoneTag2["HOME"] = "HOME";
399
- PhoneTag2["MOBILE"] = "MOBILE";
400
- PhoneTag2["WORK"] = "WORK";
401
- PhoneTag2["FAX"] = "FAX";
402
- return PhoneTag2;
403
- })(PhoneTag || {});
404
- var AddressTag = /* @__PURE__ */ ((AddressTag2) => {
405
- AddressTag2["UNTAGGED"] = "UNTAGGED";
406
- AddressTag2["HOME"] = "HOME";
407
- AddressTag2["WORK"] = "WORK";
408
- AddressTag2["BILLING"] = "BILLING";
409
- AddressTag2["SHIPPING"] = "SHIPPING";
410
- return AddressTag2;
411
- })(AddressTag || {});
412
- var StateType = /* @__PURE__ */ ((StateType2) => {
413
- StateType2["UNKNOWN_STATE"] = "UNKNOWN_STATE";
414
- StateType2["SUCCESS"] = "SUCCESS";
415
- StateType2["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
416
- StateType2["REQUIRE_EMAIL_VERIFICATION"] = "REQUIRE_EMAIL_VERIFICATION";
417
- StateType2["STATUS_CHECK"] = "STATUS_CHECK";
418
- StateType2["REQUIRE_MFA"] = "REQUIRE_MFA";
419
- StateType2["MFA_CHALLENGE"] = "MFA_CHALLENGE";
420
- StateType2["REQUIRE_FIRST_FACTOR"] = "REQUIRE_FIRST_FACTOR";
421
- StateType2["REQUIRE_MISSING_FIELDS"] = "REQUIRE_MISSING_FIELDS";
422
- return StateType2;
423
- })(StateType || {});
424
- var StatusName = /* @__PURE__ */ ((StatusName2) => {
425
- StatusName2["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
426
- StatusName2["PENDING"] = "PENDING";
427
- StatusName2["ACTIVE"] = "ACTIVE";
428
- StatusName2["DELETED"] = "DELETED";
429
- StatusName2["BLOCKED"] = "BLOCKED";
430
- StatusName2["OFFLINE"] = "OFFLINE";
431
- return StatusName2;
432
- })(StatusName || {});
433
- var V1Reason = /* @__PURE__ */ ((V1Reason2) => {
434
- V1Reason2["UNKNOWN_REASON"] = "UNKNOWN_REASON";
435
- V1Reason2["PENDING_ADMIN_APPROVAL_REQUIRED"] = "PENDING_ADMIN_APPROVAL_REQUIRED";
436
- V1Reason2["PENDING_EMAIL_VERIFICATION_REQUIRED"] = "PENDING_EMAIL_VERIFICATION_REQUIRED";
437
- V1Reason2["PENDING_REQUIRED_FIELDS_MISSING"] = "PENDING_REQUIRED_FIELDS_MISSING";
438
- return V1Reason2;
439
- })(V1Reason || {});
440
- var FactorType = /* @__PURE__ */ ((FactorType2) => {
441
- FactorType2["PASSWORD"] = "PASSWORD";
442
- FactorType2["SMS"] = "SMS";
443
- FactorType2["CALL"] = "CALL";
444
- FactorType2["EMAIL"] = "EMAIL";
445
- FactorType2["TOTP"] = "TOTP";
446
- FactorType2["PUSH"] = "PUSH";
447
- FactorType2["WEBAUTHN"] = "WEBAUTHN";
448
- FactorType2["RECOVERY_CODE"] = "RECOVERY_CODE";
449
- return FactorType2;
450
- })(FactorType || {});
451
- var Status = /* @__PURE__ */ ((Status2) => {
452
- Status2["INACTIVE"] = "INACTIVE";
453
- Status2["ACTIVE"] = "ACTIVE";
454
- Status2["REQUIRE_REENROLL"] = "REQUIRE_REENROLL";
455
- return Status2;
456
- })(Status || {});
457
- var FactorStatus = /* @__PURE__ */ ((FactorStatus2) => {
458
- FactorStatus2["ENABLED"] = "ENABLED";
459
- FactorStatus2["REQUIRE_ACTIVATION"] = "REQUIRE_ACTIVATION";
460
- FactorStatus2["REQUIRE_REENROLL"] = "REQUIRE_REENROLL";
461
- FactorStatus2["ENABLED_BY_RULE"] = "ENABLED_BY_RULE";
462
- FactorStatus2["DISABLED_BY_RULE"] = "DISABLED_BY_RULE";
463
- return FactorStatus2;
464
- })(FactorStatus || {});
465
- var MfaReason = /* @__PURE__ */ ((MfaReason2) => {
466
- MfaReason2["USER_SETTINGS"] = "USER_SETTINGS";
467
- MfaReason2["HIGH_RISK_LOGIN"] = "HIGH_RISK_LOGIN";
468
- return MfaReason2;
469
- })(MfaReason || {});
470
- var Reason = /* @__PURE__ */ ((Reason2) => {
471
- Reason2["UNKNOWN_REASON"] = "UNKNOWN_REASON";
472
- Reason2["EMAIL_ADDRESS_BOUNCED"] = "EMAIL_ADDRESS_BOUNCED";
473
- Reason2["EMAIL_DOMAIN_MISSING_DNS_RECORDS"] = "EMAIL_DOMAIN_MISSING_DNS_RECORDS";
474
- Reason2["EMAIL_DOMAIN_FORMAT_INVALID"] = "EMAIL_DOMAIN_FORMAT_INVALID";
475
- Reason2["EMAIL_DOMAIN_PERMANENTLY_BLACKLISTED"] = "EMAIL_DOMAIN_PERMANENTLY_BLACKLISTED";
476
- return Reason2;
477
- })(Reason || {});
478
- var TenantType = /* @__PURE__ */ ((TenantType2) => {
479
- TenantType2["UNKNOWN_TENANT_TYPE"] = "UNKNOWN_TENANT_TYPE";
480
- TenantType2["ACCOUNT"] = "ACCOUNT";
481
- TenantType2["SITE"] = "SITE";
482
- TenantType2["ROOT"] = "ROOT";
483
- return TenantType2;
484
- })(TenantType || {});
485
- var DeliveryMethod = /* @__PURE__ */ ((DeliveryMethod2) => {
486
- DeliveryMethod2["SMS"] = "SMS";
487
- DeliveryMethod2["WHATSAPP"] = "WHATSAPP";
488
- return DeliveryMethod2;
489
- })(DeliveryMethod || {});
490
- async function registerV22(loginId, options) {
491
- const { httpClient, sideEffects } = arguments[2];
492
- const payload = (0, import_transform_paths2.transformPaths)(
493
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
494
- loginId,
495
- password: options?.password,
496
- profile: options?.profile,
497
- captchaTokens: options?.captchaTokens,
498
- clientMetaData: options?.clientMetaData
499
- }),
500
- [
501
- {
502
- transformFn: import_address.transformSDKAddressToRESTAddress,
503
- paths: [{ path: "profile.addresses.address" }]
504
- }
505
- ]
506
- );
507
- const reqOpts = registerV2(payload);
508
- sideEffects?.onSiteCall?.();
509
- try {
510
- const result = await httpClient.request(reqOpts);
511
- sideEffects?.onSuccess?.(result);
512
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
513
- (0, import_transform_paths2.transformPaths)(result.data, [
514
- {
515
- transformFn: import_address2.transformRESTAddressToSDKAddress,
516
- paths: [{ path: "identity.identityProfile.addresses.address" }]
517
- }
518
- ])
519
- );
520
- } catch (err) {
521
- const transformedError = (0, import_transform_error.transformError)(
522
- err,
523
- {
524
- spreadPathsToArguments: {},
525
- explicitPathsToArguments: {
526
- loginId: "$[0]",
527
- password: "$[1].password",
528
- profile: "$[1].profile",
529
- captchaTokens: "$[1].captchaTokens",
530
- clientMetaData: "$[1].clientMetaData"
531
- },
532
- singleArgumentUnchanged: false
533
- },
534
- ["loginId", "options"]
535
- );
536
- sideEffects?.onError?.(err);
537
- throw transformedError;
538
- }
539
- }
540
- async function validateEmail2(email) {
541
- const { httpClient, sideEffects } = arguments[1];
542
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ email });
543
- const reqOpts = validateEmail(payload);
544
- sideEffects?.onSiteCall?.();
545
- try {
546
- const result = await httpClient.request(reqOpts);
547
- sideEffects?.onSuccess?.(result);
548
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
549
- } catch (err) {
550
- const transformedError = (0, import_transform_error.transformError)(
551
- err,
552
- {
553
- spreadPathsToArguments: {},
554
- explicitPathsToArguments: { email: "$[0]" },
555
- singleArgumentUnchanged: false
556
- },
557
- ["email"]
558
- );
559
- sideEffects?.onError?.(err);
560
- throw transformedError;
561
- }
562
- }
563
- async function loginV22(loginId, options) {
564
- const { httpClient, sideEffects } = arguments[2];
565
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
566
- loginId,
567
- password: options?.password,
568
- captchaTokens: options?.captchaTokens,
569
- clientMetaData: options?.clientMetaData,
570
- stateToken: options?.stateToken
571
- });
572
- const reqOpts = loginV2(payload);
573
- sideEffects?.onSiteCall?.();
574
- try {
575
- const result = await httpClient.request(reqOpts);
576
- sideEffects?.onSuccess?.(result);
577
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
578
- (0, import_transform_paths2.transformPaths)(result.data, [
579
- {
580
- transformFn: import_address2.transformRESTAddressToSDKAddress,
581
- paths: [{ path: "identity.identityProfile.addresses.address" }]
582
- }
583
- ])
584
- );
585
- } catch (err) {
586
- const transformedError = (0, import_transform_error.transformError)(
587
- err,
588
- {
589
- spreadPathsToArguments: {},
590
- explicitPathsToArguments: {
591
- loginId: "$[0]",
592
- password: "$[1].password",
593
- captchaTokens: "$[1].captchaTokens",
594
- clientMetaData: "$[1].clientMetaData",
595
- stateToken: "$[1].stateToken"
596
- },
597
- singleArgumentUnchanged: false
598
- },
599
- ["loginId", "options"]
600
- );
601
- sideEffects?.onError?.(err);
602
- throw transformedError;
603
- }
604
- }
605
- async function changePassword2(newPassword) {
606
- const { httpClient, sideEffects } = arguments[1];
607
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
608
- newPassword
609
- });
610
- const reqOpts = changePassword(payload);
611
- sideEffects?.onSiteCall?.();
612
- try {
613
- const result = await httpClient.request(reqOpts);
614
- sideEffects?.onSuccess?.(result);
615
- } catch (err) {
616
- const transformedError = (0, import_transform_error.transformError)(
617
- err,
618
- {
619
- spreadPathsToArguments: {},
620
- explicitPathsToArguments: { newPassword: "$[0]" },
621
- singleArgumentUnchanged: false
622
- },
623
- ["newPassword"]
624
- );
625
- sideEffects?.onError?.(err);
626
- throw transformedError;
627
- }
628
- }
629
- async function signOn2(loginId, options) {
630
- const { httpClient, sideEffects } = arguments[2];
631
- const payload = (0, import_transform_paths2.transformPaths)(
632
- (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
633
- loginId,
634
- profile: options?.profile,
635
- verifyEmail: options?.verifyEmail,
636
- mergeExistingContact: options?.mergeExistingContact
637
- }),
638
- [
639
- {
640
- transformFn: import_address.transformSDKAddressToRESTAddress,
641
- paths: [{ path: "profile.addresses.address" }]
642
- }
643
- ]
644
- );
645
- const reqOpts = signOn(payload);
646
- sideEffects?.onSiteCall?.();
647
- try {
648
- const result = await httpClient.request(reqOpts);
649
- sideEffects?.onSuccess?.(result);
650
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(
651
- (0, import_transform_paths2.transformPaths)(result.data, [
652
- {
653
- transformFn: import_address2.transformRESTAddressToSDKAddress,
654
- paths: [{ path: "identity.identityProfile.addresses.address" }]
655
- }
656
- ])
657
- );
658
- } catch (err) {
659
- const transformedError = (0, import_transform_error.transformError)(
660
- err,
661
- {
662
- spreadPathsToArguments: {},
663
- explicitPathsToArguments: {
664
- loginId: "$[0]",
665
- profile: "$[1].profile",
666
- verifyEmail: "$[1].verifyEmail",
667
- mergeExistingContact: "$[1].mergeExistingContact"
668
- },
669
- singleArgumentUnchanged: false
670
- },
671
- ["loginId", "options"]
672
- );
673
- sideEffects?.onError?.(err);
674
- throw transformedError;
675
- }
676
- }
677
- async function logout2(options) {
678
- const { httpClient, sideEffects } = arguments[1];
679
- const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
680
- postLogoutRedirectUri: options?.postLogoutRedirectUri,
681
- clientId: options?.clientId
682
- });
683
- const reqOpts = logout(payload);
684
- sideEffects?.onSiteCall?.();
685
- try {
686
- const result = await httpClient.request(reqOpts);
687
- sideEffects?.onSuccess?.(result);
688
- return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
689
- } catch (err) {
690
- const transformedError = (0, import_transform_error.transformError)(
691
- err,
692
- {
693
- spreadPathsToArguments: {},
694
- explicitPathsToArguments: {
695
- postLogoutRedirectUri: "$[0].postLogoutRedirectUri",
696
- clientId: "$[0].clientId"
697
- },
698
- singleArgumentUnchanged: false
699
- },
700
- ["options"]
701
- );
702
- sideEffects?.onError?.(err);
703
- throw transformedError;
704
- }
705
- }
706
- // Annotate the CommonJS export names for ESM import in node:
707
- 0 && (module.exports = {
708
- AddressTag,
709
- DeliveryMethod,
710
- EmailTag,
711
- FactorStatus,
712
- FactorType,
713
- MfaReason,
714
- PhoneTag,
715
- PrivacyStatus,
716
- Reason,
717
- StateType,
718
- Status,
719
- StatusName,
720
- TenantType,
721
- V1Reason,
722
- changePassword,
723
- loginV2,
724
- logout,
725
- registerV2,
726
- signOn,
727
- validateEmail
728
- });
729
- //# sourceMappingURL=index.typings.js.map