@wix/auto_sdk_identity_authentication 1.0.56 → 1.0.58

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