@wix/identity 1.0.74 → 1.0.76
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.
- package/build/cjs/context.d.ts +4 -0
- package/build/cjs/{index.typings.js → context.js} +5 -5
- package/build/cjs/context.js.map +1 -0
- package/build/cjs/index.d.ts +4 -4
- package/build/cjs/index.js +4 -4
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +4 -4
- package/build/cjs/meta.js +4 -4
- package/build/cjs/meta.js.map +1 -1
- package/build/es/context.d.ts +4 -0
- package/build/es/context.js +5 -0
- package/build/es/context.js.map +1 -0
- package/build/es/index.d.ts +4 -4
- package/build/es/index.js +4 -4
- package/build/es/index.js.map +1 -1
- package/build/es/meta.d.ts +4 -4
- package/build/es/meta.js +4 -4
- package/build/es/meta.js.map +1 -1
- package/context/package.json +6 -0
- package/package.json +15 -8
- package/build/cjs/index.typings.d.ts +0 -4
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/src/iam-authentication-v1-authentication.http.d.ts +0 -28
- package/build/cjs/src/iam-authentication-v1-authentication.http.js +0 -408
- package/build/cjs/src/iam-authentication-v1-authentication.http.js.map +0 -1
- package/build/cjs/src/iam-authentication-v1-authentication.meta.d.ts +0 -21
- package/build/cjs/src/iam-authentication-v1-authentication.meta.js +0 -199
- package/build/cjs/src/iam-authentication-v1-authentication.meta.js.map +0 -1
- package/build/cjs/src/iam-authentication-v1-authentication.public.d.ts +0 -16
- package/build/cjs/src/iam-authentication-v1-authentication.public.js +0 -70
- package/build/cjs/src/iam-authentication-v1-authentication.public.js.map +0 -1
- package/build/cjs/src/iam-authentication-v1-authentication.types.d.ts +0 -669
- package/build/cjs/src/iam-authentication-v1-authentication.types.js +0 -78
- package/build/cjs/src/iam-authentication-v1-authentication.types.js.map +0 -1
- package/build/cjs/src/iam-authentication-v1-authentication.universal.d.ts +0 -790
- package/build/cjs/src/iam-authentication-v1-authentication.universal.js +0 -780
- package/build/cjs/src/iam-authentication-v1-authentication.universal.js.map +0 -1
- package/build/cjs/src/iam-recovery-v1-recovery.http.d.ts +0 -13
- package/build/cjs/src/iam-recovery-v1-recovery.http.js +0 -109
- package/build/cjs/src/iam-recovery-v1-recovery.http.js.map +0 -1
- package/build/cjs/src/iam-recovery-v1-recovery.meta.d.ts +0 -15
- package/build/cjs/src/iam-recovery-v1-recovery.meta.js +0 -85
- package/build/cjs/src/iam-recovery-v1-recovery.meta.js.map +0 -1
- package/build/cjs/src/iam-recovery-v1-recovery.public.d.ts +0 -10
- package/build/cjs/src/iam-recovery-v1-recovery.public.js +0 -33
- package/build/cjs/src/iam-recovery-v1-recovery.public.js.map +0 -1
- package/build/cjs/src/iam-recovery-v1-recovery.types.d.ts +0 -431
- package/build/cjs/src/iam-recovery-v1-recovery.types.js +0 -72
- package/build/cjs/src/iam-recovery-v1-recovery.types.js.map +0 -1
- package/build/cjs/src/iam-recovery-v1-recovery.universal.d.ts +0 -475
- package/build/cjs/src/iam-recovery-v1-recovery.universal.js +0 -335
- package/build/cjs/src/iam-recovery-v1-recovery.universal.js.map +0 -1
- package/build/cjs/src/iam-verification-v1-start-response.http.d.ts +0 -22
- package/build/cjs/src/iam-verification-v1-start-response.http.js +0 -132
- package/build/cjs/src/iam-verification-v1-start-response.http.js.map +0 -1
- package/build/cjs/src/iam-verification-v1-start-response.meta.d.ts +0 -15
- package/build/cjs/src/iam-verification-v1-start-response.meta.js +0 -85
- package/build/cjs/src/iam-verification-v1-start-response.meta.js.map +0 -1
- package/build/cjs/src/iam-verification-v1-start-response.public.d.ts +0 -10
- package/build/cjs/src/iam-verification-v1-start-response.public.js +0 -33
- package/build/cjs/src/iam-verification-v1-start-response.public.js.map +0 -1
- package/build/cjs/src/iam-verification-v1-start-response.types.d.ts +0 -398
- package/build/cjs/src/iam-verification-v1-start-response.types.js +0 -70
- package/build/cjs/src/iam-verification-v1-start-response.types.js.map +0 -1
- package/build/cjs/src/iam-verification-v1-start-response.universal.d.ts +0 -448
- package/build/cjs/src/iam-verification-v1-start-response.universal.js +0 -341
- package/build/cjs/src/iam-verification-v1-start-response.universal.js.map +0 -1
- package/build/cjs/src/identity-oauth-v1-refresh-token.http.d.ts +0 -14
- package/build/cjs/src/identity-oauth-v1-refresh-token.http.js +0 -154
- package/build/cjs/src/identity-oauth-v1-refresh-token.http.js.map +0 -1
- package/build/cjs/src/identity-oauth-v1-refresh-token.meta.d.ts +0 -17
- package/build/cjs/src/identity-oauth-v1-refresh-token.meta.js +0 -123
- package/build/cjs/src/identity-oauth-v1-refresh-token.meta.js.map +0 -1
- package/build/cjs/src/identity-oauth-v1-refresh-token.public.d.ts +0 -11
- package/build/cjs/src/identity-oauth-v1-refresh-token.public.js +0 -36
- package/build/cjs/src/identity-oauth-v1-refresh-token.public.js.map +0 -1
- package/build/cjs/src/identity-oauth-v1-refresh-token.types.d.ts +0 -206
- package/build/cjs/src/identity-oauth-v1-refresh-token.types.js +0 -3
- package/build/cjs/src/identity-oauth-v1-refresh-token.types.js.map +0 -1
- package/build/cjs/src/identity-oauth-v1-refresh-token.universal.d.ts +0 -319
- package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js +0 -357
- package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -4
- package/build/es/index.typings.js +0 -5
- package/build/es/index.typings.js.map +0 -1
- package/build/es/src/iam-authentication-v1-authentication.http.d.ts +0 -28
- package/build/es/src/iam-authentication-v1-authentication.http.js +0 -396
- package/build/es/src/iam-authentication-v1-authentication.http.js.map +0 -1
- package/build/es/src/iam-authentication-v1-authentication.meta.d.ts +0 -21
- package/build/es/src/iam-authentication-v1-authentication.meta.js +0 -164
- package/build/es/src/iam-authentication-v1-authentication.meta.js.map +0 -1
- package/build/es/src/iam-authentication-v1-authentication.public.d.ts +0 -16
- package/build/es/src/iam-authentication-v1-authentication.public.js +0 -49
- package/build/es/src/iam-authentication-v1-authentication.public.js.map +0 -1
- package/build/es/src/iam-authentication-v1-authentication.types.d.ts +0 -669
- package/build/es/src/iam-authentication-v1-authentication.types.js +0 -75
- package/build/es/src/iam-authentication-v1-authentication.types.js.map +0 -1
- package/build/es/src/iam-authentication-v1-authentication.universal.d.ts +0 -790
- package/build/es/src/iam-authentication-v1-authentication.universal.js +0 -745
- package/build/es/src/iam-authentication-v1-authentication.universal.js.map +0 -1
- package/build/es/src/iam-recovery-v1-recovery.http.d.ts +0 -13
- package/build/es/src/iam-recovery-v1-recovery.http.js +0 -103
- package/build/es/src/iam-recovery-v1-recovery.http.js.map +0 -1
- package/build/es/src/iam-recovery-v1-recovery.meta.d.ts +0 -15
- package/build/es/src/iam-recovery-v1-recovery.meta.js +0 -56
- package/build/es/src/iam-recovery-v1-recovery.meta.js.map +0 -1
- package/build/es/src/iam-recovery-v1-recovery.public.d.ts +0 -10
- package/build/es/src/iam-recovery-v1-recovery.public.js +0 -19
- package/build/es/src/iam-recovery-v1-recovery.public.js.map +0 -1
- package/build/es/src/iam-recovery-v1-recovery.types.d.ts +0 -431
- package/build/es/src/iam-recovery-v1-recovery.types.js +0 -69
- package/build/es/src/iam-recovery-v1-recovery.types.js.map +0 -1
- package/build/es/src/iam-recovery-v1-recovery.universal.d.ts +0 -475
- package/build/es/src/iam-recovery-v1-recovery.universal.js +0 -306
- package/build/es/src/iam-recovery-v1-recovery.universal.js.map +0 -1
- package/build/es/src/iam-verification-v1-start-response.http.d.ts +0 -22
- package/build/es/src/iam-verification-v1-start-response.http.js +0 -126
- package/build/es/src/iam-verification-v1-start-response.http.js.map +0 -1
- package/build/es/src/iam-verification-v1-start-response.meta.d.ts +0 -15
- package/build/es/src/iam-verification-v1-start-response.meta.js +0 -56
- package/build/es/src/iam-verification-v1-start-response.meta.js.map +0 -1
- package/build/es/src/iam-verification-v1-start-response.public.d.ts +0 -10
- package/build/es/src/iam-verification-v1-start-response.public.js +0 -19
- package/build/es/src/iam-verification-v1-start-response.public.js.map +0 -1
- package/build/es/src/iam-verification-v1-start-response.types.d.ts +0 -398
- package/build/es/src/iam-verification-v1-start-response.types.js +0 -67
- package/build/es/src/iam-verification-v1-start-response.types.js.map +0 -1
- package/build/es/src/iam-verification-v1-start-response.universal.d.ts +0 -448
- package/build/es/src/iam-verification-v1-start-response.universal.js +0 -312
- package/build/es/src/iam-verification-v1-start-response.universal.js.map +0 -1
- package/build/es/src/identity-oauth-v1-refresh-token.http.d.ts +0 -14
- package/build/es/src/identity-oauth-v1-refresh-token.http.js +0 -146
- package/build/es/src/identity-oauth-v1-refresh-token.http.js.map +0 -1
- package/build/es/src/identity-oauth-v1-refresh-token.meta.d.ts +0 -17
- package/build/es/src/identity-oauth-v1-refresh-token.meta.js +0 -92
- package/build/es/src/identity-oauth-v1-refresh-token.meta.js.map +0 -1
- package/build/es/src/identity-oauth-v1-refresh-token.public.d.ts +0 -11
- package/build/es/src/identity-oauth-v1-refresh-token.public.js +0 -28
- package/build/es/src/identity-oauth-v1-refresh-token.public.js.map +0 -1
- package/build/es/src/identity-oauth-v1-refresh-token.types.d.ts +0 -206
- package/build/es/src/identity-oauth-v1-refresh-token.types.js +0 -2
- package/build/es/src/identity-oauth-v1-refresh-token.types.js.map +0 -1
- package/build/es/src/identity-oauth-v1-refresh-token.universal.d.ts +0 -319
- package/build/es/src/identity-oauth-v1-refresh-token.universal.js +0 -326
- package/build/es/src/identity-oauth-v1-refresh-token.universal.js.map +0 -1
|
@@ -1,780 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.logout = exports.signOn = exports.proceedToNextState = exports.loginWithIdpConnectionTokenParams = exports.changePassword = exports.loginV2 = exports.registerV2 = exports.login = exports.register = exports.TenantType = exports.StateType = exports.StateStatus = exports.Reason = exports.StatusName = exports.AddressTag = exports.PhoneTag = exports.EmailTag = exports.PrivacyStatus = exports.__debug = void 0;
|
|
36
|
-
const velo_1 = require("@wix/metro-runtime/velo");
|
|
37
|
-
const transform_error_1 = require("@wix/sdk-runtime/transform-error");
|
|
38
|
-
const ambassadorWixIamAuthenticationV1Authentication = __importStar(require("./iam-authentication-v1-authentication.http"));
|
|
39
|
-
let __verbose = false;
|
|
40
|
-
function __log(...args) {
|
|
41
|
-
__verbose && console.log(...args);
|
|
42
|
-
}
|
|
43
|
-
function __inspect(obj) {
|
|
44
|
-
return obj;
|
|
45
|
-
}
|
|
46
|
-
exports.__debug = {
|
|
47
|
-
verboseLogging: {
|
|
48
|
-
on: () => (__verbose = true),
|
|
49
|
-
off: () => (__verbose = false),
|
|
50
|
-
},
|
|
51
|
-
};
|
|
52
|
-
const _toVeloEntity = '$';
|
|
53
|
-
const _fromVeloEntity = '$';
|
|
54
|
-
var PrivacyStatus;
|
|
55
|
-
(function (PrivacyStatus) {
|
|
56
|
-
PrivacyStatus["UNDEFINED"] = "UNDEFINED";
|
|
57
|
-
PrivacyStatus["PUBLIC"] = "PUBLIC";
|
|
58
|
-
PrivacyStatus["PRIVATE"] = "PRIVATE";
|
|
59
|
-
})(PrivacyStatus || (exports.PrivacyStatus = PrivacyStatus = {}));
|
|
60
|
-
var EmailTag;
|
|
61
|
-
(function (EmailTag) {
|
|
62
|
-
EmailTag["UNTAGGED"] = "UNTAGGED";
|
|
63
|
-
EmailTag["MAIN"] = "MAIN";
|
|
64
|
-
EmailTag["HOME"] = "HOME";
|
|
65
|
-
EmailTag["WORK"] = "WORK";
|
|
66
|
-
})(EmailTag || (exports.EmailTag = EmailTag = {}));
|
|
67
|
-
var PhoneTag;
|
|
68
|
-
(function (PhoneTag) {
|
|
69
|
-
PhoneTag["UNTAGGED"] = "UNTAGGED";
|
|
70
|
-
PhoneTag["MAIN"] = "MAIN";
|
|
71
|
-
PhoneTag["HOME"] = "HOME";
|
|
72
|
-
PhoneTag["MOBILE"] = "MOBILE";
|
|
73
|
-
PhoneTag["WORK"] = "WORK";
|
|
74
|
-
PhoneTag["FAX"] = "FAX";
|
|
75
|
-
})(PhoneTag || (exports.PhoneTag = PhoneTag = {}));
|
|
76
|
-
var AddressTag;
|
|
77
|
-
(function (AddressTag) {
|
|
78
|
-
AddressTag["UNTAGGED"] = "UNTAGGED";
|
|
79
|
-
AddressTag["HOME"] = "HOME";
|
|
80
|
-
AddressTag["WORK"] = "WORK";
|
|
81
|
-
AddressTag["BILLING"] = "BILLING";
|
|
82
|
-
AddressTag["SHIPPING"] = "SHIPPING";
|
|
83
|
-
})(AddressTag || (exports.AddressTag = AddressTag = {}));
|
|
84
|
-
var StatusName;
|
|
85
|
-
(function (StatusName) {
|
|
86
|
-
StatusName["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
|
|
87
|
-
StatusName["PENDING"] = "PENDING";
|
|
88
|
-
StatusName["ACTIVE"] = "ACTIVE";
|
|
89
|
-
StatusName["DELETED"] = "DELETED";
|
|
90
|
-
StatusName["BLOCKED"] = "BLOCKED";
|
|
91
|
-
StatusName["OFFLINE"] = "OFFLINE";
|
|
92
|
-
})(StatusName || (exports.StatusName = StatusName = {}));
|
|
93
|
-
var Reason;
|
|
94
|
-
(function (Reason) {
|
|
95
|
-
Reason["UNKNOWN_REASON"] = "UNKNOWN_REASON";
|
|
96
|
-
Reason["PENDING_ADMIN_APPROVAL_REQUIRED"] = "PENDING_ADMIN_APPROVAL_REQUIRED";
|
|
97
|
-
Reason["PENDING_EMAIL_VERIFICATION_REQUIRED"] = "PENDING_EMAIL_VERIFICATION_REQUIRED";
|
|
98
|
-
})(Reason || (exports.Reason = Reason = {}));
|
|
99
|
-
var StateStatus;
|
|
100
|
-
(function (StateStatus) {
|
|
101
|
-
StateStatus["DONE"] = "DONE";
|
|
102
|
-
StateStatus["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
|
|
103
|
-
StateStatus["STATUS_CHECK"] = "STATUS_CHECK";
|
|
104
|
-
})(StateStatus || (exports.StateStatus = StateStatus = {}));
|
|
105
|
-
var StateType;
|
|
106
|
-
(function (StateType) {
|
|
107
|
-
/** Initial unknown state. */
|
|
108
|
-
StateType["UNKNOWN_STATE"] = "UNKNOWN_STATE";
|
|
109
|
-
/** The operation completed successfully. */
|
|
110
|
-
StateType["SUCCESS"] = "SUCCESS";
|
|
111
|
-
/** State that indicates that the member needs owner approval to proceed, available action in: OwnerApprovalStateHandler */
|
|
112
|
-
StateType["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
|
|
113
|
-
/**
|
|
114
|
-
* State that indicates a member waiting for verification, available action are: verifyDuringAuthentication or resendDuringAuthentication
|
|
115
|
-
* https://dev.wix.com/docs/rest/api-reference/auth-management/verification-v1/verify-during-authentication
|
|
116
|
-
*/
|
|
117
|
-
StateType["REQUIRE_EMAIL_VERIFICATION"] = "REQUIRE_EMAIL_VERIFICATION";
|
|
118
|
-
/** State that indicates checking that the status is not one of the `invalidStates` before proceeding. */
|
|
119
|
-
StateType["STATUS_CHECK"] = "STATUS_CHECK";
|
|
120
|
-
})(StateType || (exports.StateType = StateType = {}));
|
|
121
|
-
var TenantType;
|
|
122
|
-
(function (TenantType) {
|
|
123
|
-
TenantType["UNKNOWN_TENANT_TYPE"] = "UNKNOWN_TENANT_TYPE";
|
|
124
|
-
TenantType["ACCOUNT"] = "ACCOUNT";
|
|
125
|
-
TenantType["SITE"] = "SITE";
|
|
126
|
-
TenantType["ROOT"] = "ROOT";
|
|
127
|
-
})(TenantType || (exports.TenantType = TenantType = {}));
|
|
128
|
-
const _addressWrapper = { address: 'wix.common.Address' };
|
|
129
|
-
const _changePasswordRequest = {};
|
|
130
|
-
const _changePasswordResponse = {};
|
|
131
|
-
const _commonCustomValue = {
|
|
132
|
-
listValue: '_commonListValue',
|
|
133
|
-
mapValue: '_commonMapValue',
|
|
134
|
-
};
|
|
135
|
-
const _commonListValue = { value: '_commonCustomValue' };
|
|
136
|
-
const _commonMapValue = { value: 'Map#_commonCustomValue' };
|
|
137
|
-
const _customField = { value: '_customValue' };
|
|
138
|
-
const _customValue = { listValue: '_listValue', mapValue: '_mapValue' };
|
|
139
|
-
const _identity = { identityProfile: '_identityProfile' };
|
|
140
|
-
const _identityProfile = {
|
|
141
|
-
customFields: '_customField',
|
|
142
|
-
addresses: '_addressWrapper',
|
|
143
|
-
};
|
|
144
|
-
const _listValue = { value: '_customValue' };
|
|
145
|
-
const _loginRequest = {};
|
|
146
|
-
const _loginResponse = {
|
|
147
|
-
identity: '_identity',
|
|
148
|
-
additionalData: 'Map#_customValue',
|
|
149
|
-
};
|
|
150
|
-
const _loginV2Request = {};
|
|
151
|
-
const _loginWithIdpConnectionTokenParamsRequest = {};
|
|
152
|
-
const _logoutRequest = {};
|
|
153
|
-
const _mapValue = { value: 'Map#_customValue' };
|
|
154
|
-
const _proceedToNextStateRequest = {};
|
|
155
|
-
const _rawHttpResponse = {};
|
|
156
|
-
const _registerRequest = { identity: '_identity' };
|
|
157
|
-
const _registerV2Request = { profile: '_identityProfile' };
|
|
158
|
-
const _signOnRequest = { profile: '_identityProfile' };
|
|
159
|
-
const _signOnResponse = { identity: '_identity' };
|
|
160
|
-
const _stateMachineResponse = {
|
|
161
|
-
identity: '_identity',
|
|
162
|
-
additionalData: 'Map#_commonCustomValue',
|
|
163
|
-
};
|
|
164
|
-
/** @public
|
|
165
|
-
* @documentationMaturity preview
|
|
166
|
-
* @requiredField identity
|
|
167
|
-
*/
|
|
168
|
-
function register(identity, options) {
|
|
169
|
-
var _a, _b, _c;
|
|
170
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
171
|
-
const requestTransformation = {
|
|
172
|
-
identity: '$[0]',
|
|
173
|
-
authenticatorId: '$[1].authenticatorId',
|
|
174
|
-
inputs: '$[1].inputs',
|
|
175
|
-
captchaTokens: '$[1].captchaTokens',
|
|
176
|
-
};
|
|
177
|
-
const responseTransformation = '$';
|
|
178
|
-
// @ts-ignore
|
|
179
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
180
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
181
|
-
rootSchema: _registerRequest,
|
|
182
|
-
depSchemas: {
|
|
183
|
-
_addressWrapper,
|
|
184
|
-
_customField,
|
|
185
|
-
_customValue,
|
|
186
|
-
_identity,
|
|
187
|
-
_identityProfile,
|
|
188
|
-
_listValue,
|
|
189
|
-
_mapValue,
|
|
190
|
-
},
|
|
191
|
-
fqdnTransformation: {
|
|
192
|
-
paths: [],
|
|
193
|
-
transformation: _fromVeloEntity,
|
|
194
|
-
},
|
|
195
|
-
customTransformation: requestTransformation,
|
|
196
|
-
});
|
|
197
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
198
|
-
rootSchema: _loginResponse,
|
|
199
|
-
depSchemas: {
|
|
200
|
-
_addressWrapper,
|
|
201
|
-
_customField,
|
|
202
|
-
_customValue,
|
|
203
|
-
_identity,
|
|
204
|
-
_identityProfile,
|
|
205
|
-
_listValue,
|
|
206
|
-
_mapValue,
|
|
207
|
-
},
|
|
208
|
-
fqdnTransformation: {
|
|
209
|
-
paths: [],
|
|
210
|
-
transformation: _toVeloEntity,
|
|
211
|
-
},
|
|
212
|
-
customTransformation: responseTransformation,
|
|
213
|
-
});
|
|
214
|
-
const payload = toAmbassadorRequest([identity, options]);
|
|
215
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.register(payload);
|
|
216
|
-
__log(`"Register" sending request with: ${__inspect(reqOpts)}`);
|
|
217
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
218
|
-
try {
|
|
219
|
-
const result = yield httpClient.request(reqOpts);
|
|
220
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
221
|
-
return fromJSON(result.data);
|
|
222
|
-
}
|
|
223
|
-
catch (err) {
|
|
224
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
225
|
-
spreadPathsToArguments: {},
|
|
226
|
-
explicitPathsToArguments: {
|
|
227
|
-
identity: '$[0]',
|
|
228
|
-
authenticatorId: '$[1].authenticatorId',
|
|
229
|
-
inputs: '$[1].inputs',
|
|
230
|
-
captchaTokens: '$[1].captchaTokens',
|
|
231
|
-
},
|
|
232
|
-
singleArgumentUnchanged: false,
|
|
233
|
-
}, ['identity', 'options']);
|
|
234
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
235
|
-
throw transformedError;
|
|
236
|
-
}
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
exports.register = register;
|
|
240
|
-
/** @public
|
|
241
|
-
* @documentationMaturity preview
|
|
242
|
-
* @requiredField identifier
|
|
243
|
-
*/
|
|
244
|
-
function login(identifier, options) {
|
|
245
|
-
var _a, _b, _c;
|
|
246
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
247
|
-
const requestTransformation = {
|
|
248
|
-
identifier: '$[0]',
|
|
249
|
-
authenticatorId: '$[1].authenticatorId',
|
|
250
|
-
inputs: '$[1].inputs',
|
|
251
|
-
captchaTokens: '$[1].captchaTokens',
|
|
252
|
-
loginId: '$[1].loginId',
|
|
253
|
-
};
|
|
254
|
-
const responseTransformation = '$';
|
|
255
|
-
// @ts-ignore
|
|
256
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
257
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
258
|
-
rootSchema: _loginRequest,
|
|
259
|
-
depSchemas: {},
|
|
260
|
-
fqdnTransformation: {
|
|
261
|
-
paths: [],
|
|
262
|
-
transformation: _fromVeloEntity,
|
|
263
|
-
},
|
|
264
|
-
customTransformation: requestTransformation,
|
|
265
|
-
});
|
|
266
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
267
|
-
rootSchema: _loginResponse,
|
|
268
|
-
depSchemas: {
|
|
269
|
-
_addressWrapper,
|
|
270
|
-
_customField,
|
|
271
|
-
_customValue,
|
|
272
|
-
_identity,
|
|
273
|
-
_identityProfile,
|
|
274
|
-
_listValue,
|
|
275
|
-
_mapValue,
|
|
276
|
-
},
|
|
277
|
-
fqdnTransformation: {
|
|
278
|
-
paths: [],
|
|
279
|
-
transformation: _toVeloEntity,
|
|
280
|
-
},
|
|
281
|
-
customTransformation: responseTransformation,
|
|
282
|
-
});
|
|
283
|
-
const payload = toAmbassadorRequest([identifier, options]);
|
|
284
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.login(payload);
|
|
285
|
-
__log(`"Login" sending request with: ${__inspect(reqOpts)}`);
|
|
286
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
287
|
-
try {
|
|
288
|
-
const result = yield httpClient.request(reqOpts);
|
|
289
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
290
|
-
return fromJSON(result.data);
|
|
291
|
-
}
|
|
292
|
-
catch (err) {
|
|
293
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
294
|
-
spreadPathsToArguments: {},
|
|
295
|
-
explicitPathsToArguments: {
|
|
296
|
-
identifier: '$[0]',
|
|
297
|
-
authenticatorId: '$[1].authenticatorId',
|
|
298
|
-
inputs: '$[1].inputs',
|
|
299
|
-
captchaTokens: '$[1].captchaTokens',
|
|
300
|
-
loginId: '$[1].loginId',
|
|
301
|
-
},
|
|
302
|
-
singleArgumentUnchanged: false,
|
|
303
|
-
}, ['identifier', 'options']);
|
|
304
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
305
|
-
throw transformedError;
|
|
306
|
-
}
|
|
307
|
-
});
|
|
308
|
-
}
|
|
309
|
-
exports.login = login;
|
|
310
|
-
/**
|
|
311
|
-
* Registers a new member.
|
|
312
|
-
*
|
|
313
|
-
* Typically, after a sucessful registration, you generate and use member tokens for the
|
|
314
|
-
* registered member so that subsequent API calls are called as part of a member session.
|
|
315
|
-
*
|
|
316
|
-
* If the email used to register the member already exists as a contact email, the registering
|
|
317
|
-
* member need to verify the email address using a code that is sent to the address.
|
|
318
|
-
* @param loginId - Identifier of registering member.
|
|
319
|
-
* @public
|
|
320
|
-
* @documentationMaturity preview
|
|
321
|
-
* @requiredField loginId
|
|
322
|
-
*/
|
|
323
|
-
function registerV2(loginId, options) {
|
|
324
|
-
var _a, _b, _c;
|
|
325
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
326
|
-
const requestTransformation = {
|
|
327
|
-
loginId: '$[0]',
|
|
328
|
-
password: '$[1].password',
|
|
329
|
-
profile: '$[1].profile',
|
|
330
|
-
captchaTokens: '$[1].captchaTokens',
|
|
331
|
-
};
|
|
332
|
-
const responseTransformation = '$';
|
|
333
|
-
// @ts-ignore
|
|
334
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
335
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
336
|
-
rootSchema: _registerV2Request,
|
|
337
|
-
depSchemas: {
|
|
338
|
-
_addressWrapper,
|
|
339
|
-
_customField,
|
|
340
|
-
_customValue,
|
|
341
|
-
_identityProfile,
|
|
342
|
-
_listValue,
|
|
343
|
-
_mapValue,
|
|
344
|
-
},
|
|
345
|
-
fqdnTransformation: {
|
|
346
|
-
paths: [],
|
|
347
|
-
transformation: _fromVeloEntity,
|
|
348
|
-
},
|
|
349
|
-
customTransformation: requestTransformation,
|
|
350
|
-
});
|
|
351
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
352
|
-
rootSchema: _stateMachineResponse,
|
|
353
|
-
depSchemas: {
|
|
354
|
-
_addressWrapper,
|
|
355
|
-
_commonCustomValue,
|
|
356
|
-
_commonListValue,
|
|
357
|
-
_commonMapValue,
|
|
358
|
-
_customField,
|
|
359
|
-
_customValue,
|
|
360
|
-
_identity,
|
|
361
|
-
_identityProfile,
|
|
362
|
-
_listValue,
|
|
363
|
-
_mapValue,
|
|
364
|
-
},
|
|
365
|
-
fqdnTransformation: {
|
|
366
|
-
paths: [],
|
|
367
|
-
transformation: _toVeloEntity,
|
|
368
|
-
},
|
|
369
|
-
customTransformation: responseTransformation,
|
|
370
|
-
});
|
|
371
|
-
const payload = toAmbassadorRequest([loginId, options]);
|
|
372
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.registerV2(payload);
|
|
373
|
-
__log(`"RegisterV2" sending request with: ${__inspect(reqOpts)}`);
|
|
374
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
375
|
-
try {
|
|
376
|
-
const result = yield httpClient.request(reqOpts);
|
|
377
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
378
|
-
return fromJSON(result.data);
|
|
379
|
-
}
|
|
380
|
-
catch (err) {
|
|
381
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
382
|
-
spreadPathsToArguments: {},
|
|
383
|
-
explicitPathsToArguments: {
|
|
384
|
-
loginId: '$[0]',
|
|
385
|
-
password: '$[1].password',
|
|
386
|
-
profile: '$[1].profile',
|
|
387
|
-
captchaTokens: '$[1].captchaTokens',
|
|
388
|
-
},
|
|
389
|
-
singleArgumentUnchanged: false,
|
|
390
|
-
}, ['loginId', 'options']);
|
|
391
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
392
|
-
throw transformedError;
|
|
393
|
-
}
|
|
394
|
-
});
|
|
395
|
-
}
|
|
396
|
-
exports.registerV2 = registerV2;
|
|
397
|
-
/**
|
|
398
|
-
* Logs in an existing user.
|
|
399
|
-
*
|
|
400
|
-
* Typically, after a sucessful login, you generate and use member tokens for the
|
|
401
|
-
* logged-in member so that subsequent API calls are called as part of a member session.
|
|
402
|
-
* @param loginId - Identifier of member logging in.
|
|
403
|
-
* @public
|
|
404
|
-
* @documentationMaturity preview
|
|
405
|
-
* @requiredField loginId
|
|
406
|
-
*/
|
|
407
|
-
function loginV2(loginId, options) {
|
|
408
|
-
var _a, _b, _c;
|
|
409
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
410
|
-
const requestTransformation = {
|
|
411
|
-
loginId: '$[0]',
|
|
412
|
-
password: '$[1].password',
|
|
413
|
-
captchaTokens: '$[1].captchaTokens',
|
|
414
|
-
};
|
|
415
|
-
const responseTransformation = '$';
|
|
416
|
-
// @ts-ignore
|
|
417
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
418
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
419
|
-
rootSchema: _loginV2Request,
|
|
420
|
-
depSchemas: {},
|
|
421
|
-
fqdnTransformation: {
|
|
422
|
-
paths: [],
|
|
423
|
-
transformation: _fromVeloEntity,
|
|
424
|
-
},
|
|
425
|
-
customTransformation: requestTransformation,
|
|
426
|
-
});
|
|
427
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
428
|
-
rootSchema: _stateMachineResponse,
|
|
429
|
-
depSchemas: {
|
|
430
|
-
_addressWrapper,
|
|
431
|
-
_commonCustomValue,
|
|
432
|
-
_commonListValue,
|
|
433
|
-
_commonMapValue,
|
|
434
|
-
_customField,
|
|
435
|
-
_customValue,
|
|
436
|
-
_identity,
|
|
437
|
-
_identityProfile,
|
|
438
|
-
_listValue,
|
|
439
|
-
_mapValue,
|
|
440
|
-
},
|
|
441
|
-
fqdnTransformation: {
|
|
442
|
-
paths: [],
|
|
443
|
-
transformation: _toVeloEntity,
|
|
444
|
-
},
|
|
445
|
-
customTransformation: responseTransformation,
|
|
446
|
-
});
|
|
447
|
-
const payload = toAmbassadorRequest([loginId, options]);
|
|
448
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginV2(payload);
|
|
449
|
-
__log(`"LoginV2" sending request with: ${__inspect(reqOpts)}`);
|
|
450
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
451
|
-
try {
|
|
452
|
-
const result = yield httpClient.request(reqOpts);
|
|
453
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
454
|
-
return fromJSON(result.data);
|
|
455
|
-
}
|
|
456
|
-
catch (err) {
|
|
457
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
458
|
-
spreadPathsToArguments: {},
|
|
459
|
-
explicitPathsToArguments: {
|
|
460
|
-
loginId: '$[0]',
|
|
461
|
-
password: '$[1].password',
|
|
462
|
-
captchaTokens: '$[1].captchaTokens',
|
|
463
|
-
},
|
|
464
|
-
singleArgumentUnchanged: false,
|
|
465
|
-
}, ['loginId', 'options']);
|
|
466
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
467
|
-
throw transformedError;
|
|
468
|
-
}
|
|
469
|
-
});
|
|
470
|
-
}
|
|
471
|
-
exports.loginV2 = loginV2;
|
|
472
|
-
/**
|
|
473
|
-
* Changes the password of a logged in user.
|
|
474
|
-
* @param newPassword - The new password to set for the logged in user
|
|
475
|
-
* @public
|
|
476
|
-
* @documentationMaturity preview
|
|
477
|
-
* @requiredField newPassword
|
|
478
|
-
*/
|
|
479
|
-
function changePassword(newPassword) {
|
|
480
|
-
var _a, _b, _c;
|
|
481
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
482
|
-
const requestTransformation = { newPassword: '$[0]' };
|
|
483
|
-
const responseTransformation = '$';
|
|
484
|
-
// @ts-ignore
|
|
485
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
486
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
487
|
-
rootSchema: _changePasswordRequest,
|
|
488
|
-
depSchemas: {},
|
|
489
|
-
fqdnTransformation: {
|
|
490
|
-
paths: [],
|
|
491
|
-
transformation: _fromVeloEntity,
|
|
492
|
-
},
|
|
493
|
-
customTransformation: requestTransformation,
|
|
494
|
-
});
|
|
495
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
496
|
-
rootSchema: _changePasswordResponse,
|
|
497
|
-
depSchemas: {},
|
|
498
|
-
fqdnTransformation: {
|
|
499
|
-
paths: [],
|
|
500
|
-
transformation: _toVeloEntity,
|
|
501
|
-
},
|
|
502
|
-
customTransformation: responseTransformation,
|
|
503
|
-
});
|
|
504
|
-
const payload = toAmbassadorRequest([newPassword]);
|
|
505
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.changePassword(payload);
|
|
506
|
-
__log(`"ChangePassword" sending request with: ${__inspect(reqOpts)}`);
|
|
507
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
508
|
-
try {
|
|
509
|
-
const result = yield httpClient.request(reqOpts);
|
|
510
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
511
|
-
}
|
|
512
|
-
catch (err) {
|
|
513
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
514
|
-
spreadPathsToArguments: {},
|
|
515
|
-
explicitPathsToArguments: { newPassword: '$[0]' },
|
|
516
|
-
singleArgumentUnchanged: false,
|
|
517
|
-
}, ['newPassword']);
|
|
518
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
519
|
-
throw transformedError;
|
|
520
|
-
}
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
exports.changePassword = changePassword;
|
|
524
|
-
/** @public
|
|
525
|
-
* @documentationMaturity preview
|
|
526
|
-
*/
|
|
527
|
-
function loginWithIdpConnectionTokenParams(options) {
|
|
528
|
-
var _a, _b, _c;
|
|
529
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
530
|
-
const requestTransformation = {
|
|
531
|
-
idpConnectionId: '$[0].idpConnectionId',
|
|
532
|
-
tokenParams: '$[0].tokenParams',
|
|
533
|
-
};
|
|
534
|
-
const responseTransformation = '$';
|
|
535
|
-
// @ts-ignore
|
|
536
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
537
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
538
|
-
rootSchema: _loginWithIdpConnectionTokenParamsRequest,
|
|
539
|
-
depSchemas: {},
|
|
540
|
-
fqdnTransformation: {
|
|
541
|
-
paths: [],
|
|
542
|
-
transformation: _fromVeloEntity,
|
|
543
|
-
},
|
|
544
|
-
customTransformation: requestTransformation,
|
|
545
|
-
});
|
|
546
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
547
|
-
rootSchema: _stateMachineResponse,
|
|
548
|
-
depSchemas: {
|
|
549
|
-
_addressWrapper,
|
|
550
|
-
_commonCustomValue,
|
|
551
|
-
_commonListValue,
|
|
552
|
-
_commonMapValue,
|
|
553
|
-
_customField,
|
|
554
|
-
_customValue,
|
|
555
|
-
_identity,
|
|
556
|
-
_identityProfile,
|
|
557
|
-
_listValue,
|
|
558
|
-
_mapValue,
|
|
559
|
-
},
|
|
560
|
-
fqdnTransformation: {
|
|
561
|
-
paths: [],
|
|
562
|
-
transformation: _toVeloEntity,
|
|
563
|
-
},
|
|
564
|
-
customTransformation: responseTransformation,
|
|
565
|
-
});
|
|
566
|
-
const payload = toAmbassadorRequest([options]);
|
|
567
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.loginWithIdpConnectionTokenParams(payload);
|
|
568
|
-
__log(`"LoginWithIdpConnectionTokenParams" sending request with: ${__inspect(reqOpts)}`);
|
|
569
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
570
|
-
try {
|
|
571
|
-
const result = yield httpClient.request(reqOpts);
|
|
572
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
573
|
-
return fromJSON(result.data);
|
|
574
|
-
}
|
|
575
|
-
catch (err) {
|
|
576
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
577
|
-
spreadPathsToArguments: {},
|
|
578
|
-
explicitPathsToArguments: {
|
|
579
|
-
idpConnectionId: '$[0].idpConnectionId',
|
|
580
|
-
tokenParams: '$[0].tokenParams',
|
|
581
|
-
},
|
|
582
|
-
singleArgumentUnchanged: false,
|
|
583
|
-
}, ['options']);
|
|
584
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
585
|
-
throw transformedError;
|
|
586
|
-
}
|
|
587
|
-
});
|
|
588
|
-
}
|
|
589
|
-
exports.loginWithIdpConnectionTokenParams = loginWithIdpConnectionTokenParams;
|
|
590
|
-
/** @public
|
|
591
|
-
* @documentationMaturity preview
|
|
592
|
-
*/
|
|
593
|
-
function proceedToNextState(options) {
|
|
594
|
-
var _a, _b, _c;
|
|
595
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
596
|
-
const requestTransformation = { stateToken: '$[0].stateToken' };
|
|
597
|
-
const responseTransformation = '$';
|
|
598
|
-
// @ts-ignore
|
|
599
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
600
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
601
|
-
rootSchema: _proceedToNextStateRequest,
|
|
602
|
-
depSchemas: {},
|
|
603
|
-
fqdnTransformation: {
|
|
604
|
-
paths: [],
|
|
605
|
-
transformation: _fromVeloEntity,
|
|
606
|
-
},
|
|
607
|
-
customTransformation: requestTransformation,
|
|
608
|
-
});
|
|
609
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
610
|
-
rootSchema: _loginResponse,
|
|
611
|
-
depSchemas: {
|
|
612
|
-
_addressWrapper,
|
|
613
|
-
_customField,
|
|
614
|
-
_customValue,
|
|
615
|
-
_identity,
|
|
616
|
-
_identityProfile,
|
|
617
|
-
_listValue,
|
|
618
|
-
_mapValue,
|
|
619
|
-
},
|
|
620
|
-
fqdnTransformation: {
|
|
621
|
-
paths: [],
|
|
622
|
-
transformation: _toVeloEntity,
|
|
623
|
-
},
|
|
624
|
-
customTransformation: responseTransformation,
|
|
625
|
-
});
|
|
626
|
-
const payload = toAmbassadorRequest([options]);
|
|
627
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.proceedToNextState(payload);
|
|
628
|
-
__log(`"ProceedToNextState" sending request with: ${__inspect(reqOpts)}`);
|
|
629
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
630
|
-
try {
|
|
631
|
-
const result = yield httpClient.request(reqOpts);
|
|
632
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
633
|
-
return fromJSON(result.data);
|
|
634
|
-
}
|
|
635
|
-
catch (err) {
|
|
636
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
637
|
-
spreadPathsToArguments: {},
|
|
638
|
-
explicitPathsToArguments: { stateToken: '$[0].stateToken' },
|
|
639
|
-
singleArgumentUnchanged: false,
|
|
640
|
-
}, ['options']);
|
|
641
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
642
|
-
throw transformedError;
|
|
643
|
-
}
|
|
644
|
-
});
|
|
645
|
-
}
|
|
646
|
-
exports.proceedToNextState = proceedToNextState;
|
|
647
|
-
/** @param loginId - the identifier of the identity
|
|
648
|
-
* @public
|
|
649
|
-
* @documentationMaturity preview
|
|
650
|
-
* @requiredField loginId
|
|
651
|
-
*/
|
|
652
|
-
function signOn(loginId, options) {
|
|
653
|
-
var _a, _b, _c;
|
|
654
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
655
|
-
const requestTransformation = {
|
|
656
|
-
loginId: '$[0]',
|
|
657
|
-
profile: '$[1].profile',
|
|
658
|
-
verifyEmail: '$[1].verifyEmail',
|
|
659
|
-
mergeExistingContact: '$[1].mergeExistingContact',
|
|
660
|
-
};
|
|
661
|
-
const responseTransformation = '$';
|
|
662
|
-
// @ts-ignore
|
|
663
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
664
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
665
|
-
rootSchema: _signOnRequest,
|
|
666
|
-
depSchemas: {
|
|
667
|
-
_addressWrapper,
|
|
668
|
-
_customField,
|
|
669
|
-
_customValue,
|
|
670
|
-
_identityProfile,
|
|
671
|
-
_listValue,
|
|
672
|
-
_mapValue,
|
|
673
|
-
},
|
|
674
|
-
fqdnTransformation: {
|
|
675
|
-
paths: [],
|
|
676
|
-
transformation: _fromVeloEntity,
|
|
677
|
-
},
|
|
678
|
-
customTransformation: requestTransformation,
|
|
679
|
-
});
|
|
680
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
681
|
-
rootSchema: _signOnResponse,
|
|
682
|
-
depSchemas: {
|
|
683
|
-
_addressWrapper,
|
|
684
|
-
_customField,
|
|
685
|
-
_customValue,
|
|
686
|
-
_identity,
|
|
687
|
-
_identityProfile,
|
|
688
|
-
_listValue,
|
|
689
|
-
_mapValue,
|
|
690
|
-
},
|
|
691
|
-
fqdnTransformation: {
|
|
692
|
-
paths: [],
|
|
693
|
-
transformation: _toVeloEntity,
|
|
694
|
-
},
|
|
695
|
-
customTransformation: responseTransformation,
|
|
696
|
-
});
|
|
697
|
-
const payload = toAmbassadorRequest([loginId, options]);
|
|
698
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.signOn(payload);
|
|
699
|
-
__log(`"SignOn" sending request with: ${__inspect(reqOpts)}`);
|
|
700
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
701
|
-
try {
|
|
702
|
-
const result = yield httpClient.request(reqOpts);
|
|
703
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
704
|
-
return fromJSON(result.data);
|
|
705
|
-
}
|
|
706
|
-
catch (err) {
|
|
707
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
708
|
-
spreadPathsToArguments: {},
|
|
709
|
-
explicitPathsToArguments: {
|
|
710
|
-
loginId: '$[0]',
|
|
711
|
-
profile: '$[1].profile',
|
|
712
|
-
verifyEmail: '$[1].verifyEmail',
|
|
713
|
-
mergeExistingContact: '$[1].mergeExistingContact',
|
|
714
|
-
},
|
|
715
|
-
singleArgumentUnchanged: false,
|
|
716
|
-
}, ['loginId', 'options']);
|
|
717
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
718
|
-
throw transformedError;
|
|
719
|
-
}
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
exports.signOn = signOn;
|
|
723
|
-
/**
|
|
724
|
-
* Logs out a member.
|
|
725
|
-
* @public
|
|
726
|
-
* @documentationMaturity preview
|
|
727
|
-
*/
|
|
728
|
-
function logout(options) {
|
|
729
|
-
var _a, _b, _c;
|
|
730
|
-
return __awaiter(this, arguments, void 0, function* () {
|
|
731
|
-
const requestTransformation = {
|
|
732
|
-
postLogoutRedirectUri: '$[0].postLogoutRedirectUri',
|
|
733
|
-
clientId: '$[0].clientId',
|
|
734
|
-
};
|
|
735
|
-
const responseTransformation = '$';
|
|
736
|
-
// @ts-ignore
|
|
737
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
738
|
-
const { toAmbassadorRequest } = (0, velo_1.serializer)({
|
|
739
|
-
rootSchema: _logoutRequest,
|
|
740
|
-
depSchemas: {},
|
|
741
|
-
fqdnTransformation: {
|
|
742
|
-
paths: [],
|
|
743
|
-
transformation: _fromVeloEntity,
|
|
744
|
-
},
|
|
745
|
-
customTransformation: requestTransformation,
|
|
746
|
-
});
|
|
747
|
-
const { fromJSON } = (0, velo_1.serializer)({
|
|
748
|
-
rootSchema: _rawHttpResponse,
|
|
749
|
-
depSchemas: {},
|
|
750
|
-
fqdnTransformation: {
|
|
751
|
-
paths: [],
|
|
752
|
-
transformation: _toVeloEntity,
|
|
753
|
-
},
|
|
754
|
-
customTransformation: responseTransformation,
|
|
755
|
-
});
|
|
756
|
-
const payload = toAmbassadorRequest([options]);
|
|
757
|
-
const reqOpts = ambassadorWixIamAuthenticationV1Authentication.logout(payload);
|
|
758
|
-
__log(`"Logout" sending request with: ${__inspect(reqOpts)}`);
|
|
759
|
-
(_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
|
|
760
|
-
try {
|
|
761
|
-
const result = yield httpClient.request(reqOpts);
|
|
762
|
-
(_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
|
|
763
|
-
return fromJSON(result.data);
|
|
764
|
-
}
|
|
765
|
-
catch (err) {
|
|
766
|
-
const transformedError = (0, transform_error_1.transformError)(err, {
|
|
767
|
-
spreadPathsToArguments: {},
|
|
768
|
-
explicitPathsToArguments: {
|
|
769
|
-
postLogoutRedirectUri: '$[0].postLogoutRedirectUri',
|
|
770
|
-
clientId: '$[0].clientId',
|
|
771
|
-
},
|
|
772
|
-
singleArgumentUnchanged: false,
|
|
773
|
-
}, ['options']);
|
|
774
|
-
(_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
|
|
775
|
-
throw transformedError;
|
|
776
|
-
}
|
|
777
|
-
});
|
|
778
|
-
}
|
|
779
|
-
exports.logout = logout;
|
|
780
|
-
//# sourceMappingURL=iam-authentication-v1-authentication.universal.js.map
|