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