@wix/identity 1.0.4 → 1.0.5

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 (39) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +2 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/iam-authentication-v1-authentication.http.d.ts +5 -0
  5. package/build/cjs/src/iam-authentication-v1-authentication.http.js +152 -0
  6. package/build/cjs/src/iam-authentication-v1-authentication.http.js.map +1 -0
  7. package/build/cjs/src/iam-authentication-v1-authentication.public.d.ts +7 -0
  8. package/build/cjs/src/iam-authentication-v1-authentication.public.js +28 -0
  9. package/build/cjs/src/iam-authentication-v1-authentication.public.js.map +1 -0
  10. package/build/cjs/src/iam-authentication-v1-authentication.types.d.ts +191 -0
  11. package/build/cjs/src/iam-authentication-v1-authentication.types.js +32 -0
  12. package/build/cjs/src/iam-authentication-v1-authentication.types.js.map +1 -0
  13. package/build/cjs/src/iam-authentication-v1-authentication.universal.d.ts +226 -0
  14. package/build/cjs/src/iam-authentication-v1-authentication.universal.js +273 -0
  15. package/build/cjs/src/iam-authentication-v1-authentication.universal.js.map +1 -0
  16. package/build/cjs/src/identity-oauth-v1-refresh-token.public.d.ts +1 -1
  17. package/build/cjs/src/identity-oauth-v1-refresh-token.types.d.ts +12 -0
  18. package/build/cjs/src/identity-oauth-v1-refresh-token.universal.d.ts +12 -0
  19. package/build/cjs/src/identity-oauth-v1-refresh-token.universal.js.map +1 -1
  20. package/build/es/index.d.ts +1 -0
  21. package/build/es/index.js +1 -0
  22. package/build/es/index.js.map +1 -1
  23. package/build/es/src/iam-authentication-v1-authentication.http.d.ts +5 -0
  24. package/build/es/src/iam-authentication-v1-authentication.http.js +146 -0
  25. package/build/es/src/iam-authentication-v1-authentication.http.js.map +1 -0
  26. package/build/es/src/iam-authentication-v1-authentication.public.d.ts +7 -0
  27. package/build/es/src/iam-authentication-v1-authentication.public.js +18 -0
  28. package/build/es/src/iam-authentication-v1-authentication.public.js.map +1 -0
  29. package/build/es/src/iam-authentication-v1-authentication.types.d.ts +191 -0
  30. package/build/es/src/iam-authentication-v1-authentication.types.js +29 -0
  31. package/build/es/src/iam-authentication-v1-authentication.types.js.map +1 -0
  32. package/build/es/src/iam-authentication-v1-authentication.universal.d.ts +226 -0
  33. package/build/es/src/iam-authentication-v1-authentication.universal.js +248 -0
  34. package/build/es/src/iam-authentication-v1-authentication.universal.js.map +1 -0
  35. package/build/es/src/identity-oauth-v1-refresh-token.public.d.ts +1 -1
  36. package/build/es/src/identity-oauth-v1-refresh-token.types.d.ts +12 -0
  37. package/build/es/src/identity-oauth-v1-refresh-token.universal.d.ts +12 -0
  38. package/build/es/src/identity-oauth-v1-refresh-token.universal.js.map +1 -1
  39. package/package.json +2 -2
@@ -0,0 +1,191 @@
1
+ export interface Authentication {
2
+ }
3
+ export interface RegisterRequest {
4
+ identity: Identity;
5
+ /** TODO: when this becomes required, it will make more sense for it to be a `string` */
6
+ authenticatorId?: string | null;
7
+ inputs?: Record<string, string>;
8
+ captchaTokens?: CaptchaToken[];
9
+ }
10
+ export interface Identity {
11
+ /** Identity ID */
12
+ id?: string | null;
13
+ identifiers?: Identifier[];
14
+ /** @readonly */
15
+ status?: Status;
16
+ /** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision */
17
+ revision?: string | null;
18
+ /**
19
+ * Represents the time this Identity was created
20
+ * @readonly
21
+ */
22
+ createdDate?: Date;
23
+ /**
24
+ * Represents the time this Identity was last updated
25
+ * @readonly
26
+ */
27
+ updatedDate?: Date;
28
+ /** All the identity configured connections to authenticate with */
29
+ connections?: Connection[];
30
+ identityProfile?: IdentityProfile;
31
+ /** Stores additional information about the identity that can impact user access. This data can't be set by users. */
32
+ metadata?: Metadata;
33
+ }
34
+ export interface Identifier extends IdentifierValueOneOf {
35
+ email?: string;
36
+ userName?: string;
37
+ }
38
+ /** @oneof */
39
+ export interface IdentifierValueOneOf {
40
+ email?: string;
41
+ userName?: string;
42
+ }
43
+ export declare enum Status {
44
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
45
+ BLOCKED = "BLOCKED",
46
+ ACTIVE = "ACTIVE",
47
+ PROVISIONED = "PROVISIONED",
48
+ DELETED = "DELETED",
49
+ UNPROVISIONED = "UNPROVISIONED"
50
+ }
51
+ export interface Connection extends ConnectionTypeOneOf {
52
+ idpConnection?: IdpConnection;
53
+ authenticatorConnection?: AuthenticatorConnection;
54
+ }
55
+ /** @oneof */
56
+ export interface ConnectionTypeOneOf {
57
+ idpConnection?: IdpConnection;
58
+ authenticatorConnection?: AuthenticatorConnection;
59
+ }
60
+ export interface IdpConnection {
61
+ idpConnectionId?: string;
62
+ idpUserId?: string;
63
+ }
64
+ export interface AuthenticatorConnection {
65
+ authenticatorConnectionId?: string;
66
+ }
67
+ export interface IdentityProfile {
68
+ firstName?: string | null;
69
+ lastName?: string | null;
70
+ nickname?: string | null;
71
+ picture?: string | null;
72
+ emails?: string[];
73
+ phones?: string[];
74
+ labels?: string[];
75
+ language?: string | null;
76
+ privacyStatus?: PrivacyStatus;
77
+ /** custom profile fields */
78
+ customFields?: CustomField[];
79
+ }
80
+ export declare enum PrivacyStatus {
81
+ UNDEFINED = "UNDEFINED",
82
+ PUBLIC = "PUBLIC",
83
+ PRIVATE = "PRIVATE"
84
+ }
85
+ export interface CustomField {
86
+ name?: string;
87
+ value?: CustomValue;
88
+ }
89
+ export interface CustomValue extends CustomValueValueOneOf {
90
+ strValue?: string;
91
+ numValue?: number;
92
+ dateValue?: Date;
93
+ listValue?: ListValue;
94
+ mapValue?: MapValue;
95
+ }
96
+ /** @oneof */
97
+ export interface CustomValueValueOneOf {
98
+ strValue?: string;
99
+ numValue?: number;
100
+ dateValue?: Date;
101
+ listValue?: ListValue;
102
+ mapValue?: MapValue;
103
+ }
104
+ export interface ListValue {
105
+ value?: CustomValue[];
106
+ }
107
+ export interface MapValue {
108
+ value?: Record<string, CustomValue>;
109
+ }
110
+ export interface Metadata {
111
+ /**
112
+ * represents general tags such as "isOwner", "isContributor"
113
+ * @readonly
114
+ */
115
+ tags?: string[];
116
+ }
117
+ export interface CaptchaToken extends CaptchaTokenTokenOneOf {
118
+ recaptcha?: string;
119
+ invisibleRecaptcha?: string;
120
+ }
121
+ /** @oneof */
122
+ export interface CaptchaTokenTokenOneOf {
123
+ recaptcha?: string;
124
+ invisibleRecaptcha?: string;
125
+ }
126
+ export interface LoginResponse {
127
+ state?: State;
128
+ sessionToken?: string | null;
129
+ identity?: Identity;
130
+ additionalData?: Record<string, CustomValue>;
131
+ }
132
+ export interface State {
133
+ status?: StateStatus;
134
+ stateToken?: string | null;
135
+ }
136
+ export declare enum StateStatus {
137
+ DONE = "DONE",
138
+ REQUIRE_OWNER_APPROVAL = "REQUIRE_OWNER_APPROVAL",
139
+ STATUS_CHECK = "STATUS_CHECK"
140
+ }
141
+ export interface LoginRequest {
142
+ identifier: Identifier;
143
+ /** TODO: when this becomes required, it will make more sense for it to be a `string` */
144
+ authenticatorId?: string | null;
145
+ inputs?: Record<string, string>;
146
+ captchaTokens?: CaptchaToken[];
147
+ }
148
+ export interface SuccessfulLoginEvent {
149
+ identity?: Identity;
150
+ }
151
+ export interface LoginWithIdpConnectionRequest {
152
+ idpConnectionId?: string;
153
+ tenantId?: string;
154
+ tenantType?: TenantType;
155
+ customPayload?: Record<string, string>;
156
+ }
157
+ export declare enum TenantType {
158
+ UNKNOWN_TENANT_TYPE = "UNKNOWN_TENANT_TYPE",
159
+ ACCOUNT = "ACCOUNT",
160
+ SITE = "SITE",
161
+ ROOT = "ROOT"
162
+ }
163
+ export interface RawHttpResponse {
164
+ body?: Uint8Array;
165
+ statusCode?: number | null;
166
+ headers?: HeadersEntry[];
167
+ }
168
+ export interface HeadersEntry {
169
+ key?: string;
170
+ value?: string;
171
+ }
172
+ export interface RawHttpRequest {
173
+ body?: Uint8Array;
174
+ pathParams?: PathParametersEntry[];
175
+ queryParams?: QueryParametersEntry[];
176
+ headers?: HeadersEntry[];
177
+ method?: string;
178
+ rawPath?: string;
179
+ rawQuery?: string;
180
+ }
181
+ export interface PathParametersEntry {
182
+ key?: string;
183
+ value?: string;
184
+ }
185
+ export interface QueryParametersEntry {
186
+ key?: string;
187
+ value?: string;
188
+ }
189
+ export interface ProceedToNextStateRequest {
190
+ stateToken?: string;
191
+ }
@@ -0,0 +1,29 @@
1
+ export var Status;
2
+ (function (Status) {
3
+ Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
4
+ Status["BLOCKED"] = "BLOCKED";
5
+ Status["ACTIVE"] = "ACTIVE";
6
+ Status["PROVISIONED"] = "PROVISIONED";
7
+ Status["DELETED"] = "DELETED";
8
+ Status["UNPROVISIONED"] = "UNPROVISIONED";
9
+ })(Status || (Status = {}));
10
+ export var PrivacyStatus;
11
+ (function (PrivacyStatus) {
12
+ PrivacyStatus["UNDEFINED"] = "UNDEFINED";
13
+ PrivacyStatus["PUBLIC"] = "PUBLIC";
14
+ PrivacyStatus["PRIVATE"] = "PRIVATE";
15
+ })(PrivacyStatus || (PrivacyStatus = {}));
16
+ export var StateStatus;
17
+ (function (StateStatus) {
18
+ StateStatus["DONE"] = "DONE";
19
+ StateStatus["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
20
+ StateStatus["STATUS_CHECK"] = "STATUS_CHECK";
21
+ })(StateStatus || (StateStatus = {}));
22
+ export var TenantType;
23
+ (function (TenantType) {
24
+ TenantType["UNKNOWN_TENANT_TYPE"] = "UNKNOWN_TENANT_TYPE";
25
+ TenantType["ACCOUNT"] = "ACCOUNT";
26
+ TenantType["SITE"] = "SITE";
27
+ TenantType["ROOT"] = "ROOT";
28
+ })(TenantType || (TenantType = {}));
29
+ //# sourceMappingURL=iam-authentication-v1-authentication.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iam-authentication-v1-authentication.types.js","sourceRoot":"","sources":["../../../src/iam-authentication-v1-authentication.types.ts"],"names":[],"mappings":"AA8CA,MAAM,CAAN,IAAY,MAOX;AAPD,WAAY,MAAM;IAChB,2CAAiC,CAAA;IACjC,6BAAmB,CAAA;IACnB,2BAAiB,CAAA;IACjB,qCAA2B,CAAA;IAC3B,6BAAmB,CAAA;IACnB,yCAA+B,CAAA;AACjC,CAAC,EAPW,MAAM,KAAN,MAAM,QAOjB;AAoCD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;AACrB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AA+DD,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,gEAAiD,CAAA;IACjD,4CAA6B,CAAA;AAC/B,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAqBD,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,yDAA2C,CAAA;IAC3C,iCAAmB,CAAA;IACnB,2BAAa,CAAA;IACb,2BAAa,CAAA;AACf,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB"}
@@ -0,0 +1,226 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ export interface Authentication {
8
+ }
9
+ export interface RegisterRequest {
10
+ identity: Identity;
11
+ /** TODO: when this becomes required, it will make more sense for it to be a `string` */
12
+ authenticatorId?: string | null;
13
+ inputs?: Record<string, string>;
14
+ captchaTokens?: CaptchaToken[];
15
+ }
16
+ export interface Identity {
17
+ /** Identity ID */
18
+ _id?: string | null;
19
+ identifiers?: Identifier[];
20
+ /** @readonly */
21
+ status?: Status;
22
+ /** Represents the current state of an item. Each time the item is modified, its `revision` changes. for an update operation to succeed, you MUST pass the latest revision */
23
+ revision?: string | null;
24
+ /**
25
+ * Represents the time this Identity was created
26
+ * @readonly
27
+ */
28
+ _createdDate?: Date;
29
+ /**
30
+ * Represents the time this Identity was last updated
31
+ * @readonly
32
+ */
33
+ _updatedDate?: Date;
34
+ /** All the identity configured connections to authenticate with */
35
+ connections?: Connection[];
36
+ identityProfile?: IdentityProfile;
37
+ /** Stores additional information about the identity that can impact user access. This data can't be set by users. */
38
+ metadata?: Metadata;
39
+ }
40
+ export interface Identifier extends IdentifierValueOneOf {
41
+ email?: string;
42
+ userName?: string;
43
+ }
44
+ /** @oneof */
45
+ export interface IdentifierValueOneOf {
46
+ email?: string;
47
+ userName?: string;
48
+ }
49
+ export declare enum Status {
50
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
51
+ BLOCKED = "BLOCKED",
52
+ ACTIVE = "ACTIVE",
53
+ PROVISIONED = "PROVISIONED",
54
+ DELETED = "DELETED",
55
+ UNPROVISIONED = "UNPROVISIONED"
56
+ }
57
+ export interface Connection extends ConnectionTypeOneOf {
58
+ idpConnection?: IdpConnection;
59
+ authenticatorConnection?: AuthenticatorConnection;
60
+ }
61
+ /** @oneof */
62
+ export interface ConnectionTypeOneOf {
63
+ idpConnection?: IdpConnection;
64
+ authenticatorConnection?: AuthenticatorConnection;
65
+ }
66
+ export interface IdpConnection {
67
+ idpConnectionId?: string;
68
+ idpUserId?: string;
69
+ }
70
+ export interface AuthenticatorConnection {
71
+ authenticatorConnectionId?: string;
72
+ }
73
+ export interface IdentityProfile {
74
+ firstName?: string | null;
75
+ lastName?: string | null;
76
+ nickname?: string | null;
77
+ picture?: string | null;
78
+ emails?: string[];
79
+ phones?: string[];
80
+ labels?: string[];
81
+ language?: string | null;
82
+ privacyStatus?: PrivacyStatus;
83
+ /** custom profile fields */
84
+ customFields?: CustomField[];
85
+ }
86
+ export declare enum PrivacyStatus {
87
+ UNDEFINED = "UNDEFINED",
88
+ PUBLIC = "PUBLIC",
89
+ PRIVATE = "PRIVATE"
90
+ }
91
+ export interface CustomField {
92
+ name?: string;
93
+ value?: CustomValue;
94
+ }
95
+ export interface CustomValue extends CustomValueValueOneOf {
96
+ strValue?: string;
97
+ numValue?: number;
98
+ dateValue?: Date;
99
+ listValue?: ListValue;
100
+ mapValue?: MapValue;
101
+ }
102
+ /** @oneof */
103
+ export interface CustomValueValueOneOf {
104
+ strValue?: string;
105
+ numValue?: number;
106
+ dateValue?: Date;
107
+ listValue?: ListValue;
108
+ mapValue?: MapValue;
109
+ }
110
+ export interface ListValue {
111
+ value?: CustomValue[];
112
+ }
113
+ export interface MapValue {
114
+ value?: Record<string, CustomValue>;
115
+ }
116
+ export interface Metadata {
117
+ /**
118
+ * represents general tags such as "isOwner", "isContributor"
119
+ * @readonly
120
+ */
121
+ tags?: string[];
122
+ }
123
+ export interface CaptchaToken extends CaptchaTokenTokenOneOf {
124
+ recaptcha?: string;
125
+ invisibleRecaptcha?: string;
126
+ }
127
+ /** @oneof */
128
+ export interface CaptchaTokenTokenOneOf {
129
+ recaptcha?: string;
130
+ invisibleRecaptcha?: string;
131
+ }
132
+ export interface LoginResponse {
133
+ state?: State;
134
+ sessionToken?: string | null;
135
+ identity?: Identity;
136
+ additionalData?: Record<string, CustomValue>;
137
+ }
138
+ export interface State {
139
+ status?: StateStatus;
140
+ stateToken?: string | null;
141
+ }
142
+ export declare enum StateStatus {
143
+ DONE = "DONE",
144
+ REQUIRE_OWNER_APPROVAL = "REQUIRE_OWNER_APPROVAL",
145
+ STATUS_CHECK = "STATUS_CHECK"
146
+ }
147
+ export interface LoginRequest {
148
+ identifier: Identifier;
149
+ /** TODO: when this becomes required, it will make more sense for it to be a `string` */
150
+ authenticatorId?: string | null;
151
+ inputs?: Record<string, string>;
152
+ captchaTokens?: CaptchaToken[];
153
+ }
154
+ export interface SuccessfulLoginEvent {
155
+ identity?: Identity;
156
+ }
157
+ export interface LoginWithIdpConnectionRequest {
158
+ idpConnectionId?: string;
159
+ tenantId?: string;
160
+ tenantType?: TenantType;
161
+ customPayload?: Record<string, string>;
162
+ }
163
+ export declare enum TenantType {
164
+ UNKNOWN_TENANT_TYPE = "UNKNOWN_TENANT_TYPE",
165
+ ACCOUNT = "ACCOUNT",
166
+ SITE = "SITE",
167
+ ROOT = "ROOT"
168
+ }
169
+ export interface RawHttpResponse {
170
+ body?: Uint8Array;
171
+ statusCode?: number | null;
172
+ headers?: HeadersEntry[];
173
+ }
174
+ export interface HeadersEntry {
175
+ key?: string;
176
+ value?: string;
177
+ }
178
+ export interface RawHttpRequest {
179
+ body?: Uint8Array;
180
+ pathParams?: PathParametersEntry[];
181
+ queryParams?: QueryParametersEntry[];
182
+ headers?: HeadersEntry[];
183
+ method?: string;
184
+ rawPath?: string;
185
+ rawQuery?: string;
186
+ }
187
+ export interface PathParametersEntry {
188
+ key?: string;
189
+ value?: string;
190
+ }
191
+ export interface QueryParametersEntry {
192
+ key?: string;
193
+ value?: string;
194
+ }
195
+ export interface ProceedToNextStateRequest {
196
+ stateToken?: string;
197
+ }
198
+ /** @public
199
+ * @documentationMaturity preview
200
+ * @requiredField identity
201
+ */
202
+ export declare function register(identity: Identity, options?: RegisterOptions): Promise<LoginResponse>;
203
+ export interface RegisterOptions {
204
+ /** TODO: when this becomes required, it will make more sense for it to be a `string` */
205
+ authenticatorId?: string | null;
206
+ inputs?: Record<string, string>;
207
+ captchaTokens?: CaptchaToken[];
208
+ }
209
+ /** @public
210
+ * @documentationMaturity preview
211
+ * @requiredField identifier
212
+ */
213
+ export declare function login(identifier: Identifier, options?: LoginOptions): Promise<LoginResponse>;
214
+ export interface LoginOptions {
215
+ /** TODO: when this becomes required, it will make more sense for it to be a `string` */
216
+ authenticatorId?: string | null;
217
+ inputs?: Record<string, string>;
218
+ captchaTokens?: CaptchaToken[];
219
+ }
220
+ /** @public
221
+ * @documentationMaturity preview
222
+ */
223
+ export declare function proceedToNextState(options?: ProceedToNextStateOptions): Promise<LoginResponse>;
224
+ export interface ProceedToNextStateOptions {
225
+ stateToken?: string;
226
+ }
@@ -0,0 +1,248 @@
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 Status;
28
+ (function (Status) {
29
+ Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
30
+ Status["BLOCKED"] = "BLOCKED";
31
+ Status["ACTIVE"] = "ACTIVE";
32
+ Status["PROVISIONED"] = "PROVISIONED";
33
+ Status["DELETED"] = "DELETED";
34
+ Status["UNPROVISIONED"] = "UNPROVISIONED";
35
+ })(Status || (Status = {}));
36
+ export var PrivacyStatus;
37
+ (function (PrivacyStatus) {
38
+ PrivacyStatus["UNDEFINED"] = "UNDEFINED";
39
+ PrivacyStatus["PUBLIC"] = "PUBLIC";
40
+ PrivacyStatus["PRIVATE"] = "PRIVATE";
41
+ })(PrivacyStatus || (PrivacyStatus = {}));
42
+ export var StateStatus;
43
+ (function (StateStatus) {
44
+ StateStatus["DONE"] = "DONE";
45
+ StateStatus["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
46
+ StateStatus["STATUS_CHECK"] = "STATUS_CHECK";
47
+ })(StateStatus || (StateStatus = {}));
48
+ export var TenantType;
49
+ (function (TenantType) {
50
+ TenantType["UNKNOWN_TENANT_TYPE"] = "UNKNOWN_TENANT_TYPE";
51
+ TenantType["ACCOUNT"] = "ACCOUNT";
52
+ TenantType["SITE"] = "SITE";
53
+ TenantType["ROOT"] = "ROOT";
54
+ })(TenantType || (TenantType = {}));
55
+ const _customField = { value: '_customValue' };
56
+ const _customValue = { listValue: '_listValue', mapValue: '_mapValue' };
57
+ const _identity = { identityProfile: '_identityProfile' };
58
+ const _identityProfile = { customFields: '_customField' };
59
+ const _listValue = { value: '_customValue' };
60
+ const _loginRequest = {};
61
+ const _loginResponse = {
62
+ identity: '_identity',
63
+ additionalData: 'Map#_customValue',
64
+ };
65
+ const _mapValue = { value: 'Map#_customValue' };
66
+ const _proceedToNextStateRequest = {};
67
+ const _registerRequest = { identity: '_identity' };
68
+ /** @public
69
+ * @documentationMaturity preview
70
+ * @requiredField identity
71
+ */
72
+ export function register(identity, options) {
73
+ var _a, _b, _c;
74
+ return __awaiter(this, arguments, void 0, function* () {
75
+ const requestTransformation = {
76
+ identity: '$[0]',
77
+ authenticatorId: '$[1].authenticatorId',
78
+ inputs: '$[1].inputs',
79
+ captchaTokens: '$[1].captchaTokens',
80
+ };
81
+ const responseTransformation = '$';
82
+ // @ts-ignore
83
+ const { httpClient, sideEffects } = arguments[2];
84
+ const { toAmbassadorRequest } = serializer({
85
+ rootSchema: _registerRequest,
86
+ depSchemas: {
87
+ _customField,
88
+ _customValue,
89
+ _identity,
90
+ _identityProfile,
91
+ _listValue,
92
+ _mapValue,
93
+ },
94
+ fqdnTransformation: {
95
+ paths: [],
96
+ transformation: _fromVeloEntity,
97
+ },
98
+ customTransformation: requestTransformation,
99
+ });
100
+ const { fromJSON } = serializer({
101
+ rootSchema: _loginResponse,
102
+ depSchemas: {
103
+ _customField,
104
+ _customValue,
105
+ _identity,
106
+ _identityProfile,
107
+ _listValue,
108
+ _mapValue,
109
+ },
110
+ fqdnTransformation: {
111
+ paths: [],
112
+ transformation: _toVeloEntity,
113
+ },
114
+ customTransformation: responseTransformation,
115
+ });
116
+ const payload = toAmbassadorRequest([identity, options]);
117
+ const reqOpts = ambassadorWixIamAuthenticationV1Authentication.register(payload);
118
+ __log(`"Register" sending request with: ${__inspect(reqOpts)}`);
119
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
120
+ try {
121
+ const result = yield httpClient.request(reqOpts);
122
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
123
+ return fromJSON(result.data);
124
+ }
125
+ catch (err) {
126
+ const transformedError = transformError(err, requestTransformation, [
127
+ 'identity',
128
+ 'options',
129
+ ]);
130
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
131
+ throw transformedError;
132
+ }
133
+ });
134
+ }
135
+ /** @public
136
+ * @documentationMaturity preview
137
+ * @requiredField identifier
138
+ */
139
+ export function login(identifier, options) {
140
+ var _a, _b, _c;
141
+ return __awaiter(this, arguments, void 0, function* () {
142
+ const requestTransformation = {
143
+ identifier: '$[0]',
144
+ authenticatorId: '$[1].authenticatorId',
145
+ inputs: '$[1].inputs',
146
+ captchaTokens: '$[1].captchaTokens',
147
+ };
148
+ const responseTransformation = '$';
149
+ // @ts-ignore
150
+ const { httpClient, sideEffects } = arguments[2];
151
+ const { toAmbassadorRequest } = serializer({
152
+ rootSchema: _loginRequest,
153
+ depSchemas: {},
154
+ fqdnTransformation: {
155
+ paths: [],
156
+ transformation: _fromVeloEntity,
157
+ },
158
+ customTransformation: requestTransformation,
159
+ });
160
+ const { fromJSON } = serializer({
161
+ rootSchema: _loginResponse,
162
+ depSchemas: {
163
+ _customField,
164
+ _customValue,
165
+ _identity,
166
+ _identityProfile,
167
+ _listValue,
168
+ _mapValue,
169
+ },
170
+ fqdnTransformation: {
171
+ paths: [],
172
+ transformation: _toVeloEntity,
173
+ },
174
+ customTransformation: responseTransformation,
175
+ });
176
+ const payload = toAmbassadorRequest([identifier, options]);
177
+ const reqOpts = ambassadorWixIamAuthenticationV1Authentication.login(payload);
178
+ __log(`"Login" sending request with: ${__inspect(reqOpts)}`);
179
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
180
+ try {
181
+ const result = yield httpClient.request(reqOpts);
182
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
183
+ return fromJSON(result.data);
184
+ }
185
+ catch (err) {
186
+ const transformedError = transformError(err, requestTransformation, [
187
+ 'identifier',
188
+ 'options',
189
+ ]);
190
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
191
+ throw transformedError;
192
+ }
193
+ });
194
+ }
195
+ /** @public
196
+ * @documentationMaturity preview
197
+ */
198
+ export function proceedToNextState(options) {
199
+ var _a, _b, _c;
200
+ return __awaiter(this, arguments, void 0, function* () {
201
+ const requestTransformation = { stateToken: '$[0].stateToken' };
202
+ const responseTransformation = '$';
203
+ // @ts-ignore
204
+ const { httpClient, sideEffects } = arguments[1];
205
+ const { toAmbassadorRequest } = serializer({
206
+ rootSchema: _proceedToNextStateRequest,
207
+ depSchemas: {},
208
+ fqdnTransformation: {
209
+ paths: [],
210
+ transformation: _fromVeloEntity,
211
+ },
212
+ customTransformation: requestTransformation,
213
+ });
214
+ const { fromJSON } = serializer({
215
+ rootSchema: _loginResponse,
216
+ depSchemas: {
217
+ _customField,
218
+ _customValue,
219
+ _identity,
220
+ _identityProfile,
221
+ _listValue,
222
+ _mapValue,
223
+ },
224
+ fqdnTransformation: {
225
+ paths: [],
226
+ transformation: _toVeloEntity,
227
+ },
228
+ customTransformation: responseTransformation,
229
+ });
230
+ const payload = toAmbassadorRequest([options]);
231
+ const reqOpts = ambassadorWixIamAuthenticationV1Authentication.proceedToNextState(payload);
232
+ __log(`"ProceedToNextState" sending request with: ${__inspect(reqOpts)}`);
233
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
234
+ try {
235
+ const result = yield httpClient.request(reqOpts);
236
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
237
+ return fromJSON(result.data);
238
+ }
239
+ catch (err) {
240
+ const transformedError = transformError(err, requestTransformation, [
241
+ 'options',
242
+ ]);
243
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
244
+ throw transformedError;
245
+ }
246
+ });
247
+ }
248
+ //# sourceMappingURL=iam-authentication-v1-authentication.universal.js.map