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