@wix/identity 1.0.73 → 1.0.75

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