@wix/identity 1.0.24 → 1.0.26

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 (55) hide show
  1. package/build/cjs/index.d.ts +2 -0
  2. package/build/cjs/index.js +3 -1
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/src/iam-recovery-v1-recovery.http.d.ts +5 -0
  5. package/build/cjs/src/iam-recovery-v1-recovery.http.js +90 -0
  6. package/build/cjs/src/iam-recovery-v1-recovery.http.js.map +1 -0
  7. package/build/cjs/src/iam-recovery-v1-recovery.public.d.ts +9 -0
  8. package/build/cjs/src/iam-recovery-v1-recovery.public.js +25 -0
  9. package/build/cjs/src/iam-recovery-v1-recovery.public.js.map +1 -0
  10. package/build/cjs/src/iam-recovery-v1-recovery.types.d.ts +188 -0
  11. package/build/cjs/src/iam-recovery-v1-recovery.types.js +48 -0
  12. package/build/cjs/src/iam-recovery-v1-recovery.types.js.map +1 -0
  13. package/build/cjs/src/iam-recovery-v1-recovery.universal.d.ts +212 -0
  14. package/build/cjs/src/iam-recovery-v1-recovery.universal.js +214 -0
  15. package/build/cjs/src/iam-recovery-v1-recovery.universal.js.map +1 -0
  16. package/build/cjs/src/iam-verification-v1-start-response.http.d.ts +13 -0
  17. package/build/cjs/src/iam-verification-v1-start-response.http.js +91 -0
  18. package/build/cjs/src/iam-verification-v1-start-response.http.js.map +1 -0
  19. package/build/cjs/src/iam-verification-v1-start-response.public.d.ts +9 -0
  20. package/build/cjs/src/iam-verification-v1-start-response.public.js +25 -0
  21. package/build/cjs/src/iam-verification-v1-start-response.public.js.map +1 -0
  22. package/build/cjs/src/iam-verification-v1-start-response.types.d.ts +173 -0
  23. package/build/cjs/src/iam-verification-v1-start-response.types.js +46 -0
  24. package/build/cjs/src/iam-verification-v1-start-response.types.js.map +1 -0
  25. package/build/cjs/src/iam-verification-v1-start-response.universal.d.ts +211 -0
  26. package/build/cjs/src/iam-verification-v1-start-response.universal.js +217 -0
  27. package/build/cjs/src/iam-verification-v1-start-response.universal.js.map +1 -0
  28. package/build/es/index.d.ts +2 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -1
  31. package/build/es/src/iam-recovery-v1-recovery.http.d.ts +5 -0
  32. package/build/es/src/iam-recovery-v1-recovery.http.js +85 -0
  33. package/build/es/src/iam-recovery-v1-recovery.http.js.map +1 -0
  34. package/build/es/src/iam-recovery-v1-recovery.public.d.ts +9 -0
  35. package/build/es/src/iam-recovery-v1-recovery.public.js +14 -0
  36. package/build/es/src/iam-recovery-v1-recovery.public.js.map +1 -0
  37. package/build/es/src/iam-recovery-v1-recovery.types.d.ts +188 -0
  38. package/build/es/src/iam-recovery-v1-recovery.types.js +45 -0
  39. package/build/es/src/iam-recovery-v1-recovery.types.js.map +1 -0
  40. package/build/es/src/iam-recovery-v1-recovery.universal.d.ts +212 -0
  41. package/build/es/src/iam-recovery-v1-recovery.universal.js +190 -0
  42. package/build/es/src/iam-recovery-v1-recovery.universal.js.map +1 -0
  43. package/build/es/src/iam-verification-v1-start-response.http.d.ts +13 -0
  44. package/build/es/src/iam-verification-v1-start-response.http.js +86 -0
  45. package/build/es/src/iam-verification-v1-start-response.http.js.map +1 -0
  46. package/build/es/src/iam-verification-v1-start-response.public.d.ts +9 -0
  47. package/build/es/src/iam-verification-v1-start-response.public.js +14 -0
  48. package/build/es/src/iam-verification-v1-start-response.public.js.map +1 -0
  49. package/build/es/src/iam-verification-v1-start-response.types.d.ts +173 -0
  50. package/build/es/src/iam-verification-v1-start-response.types.js +43 -0
  51. package/build/es/src/iam-verification-v1-start-response.types.js.map +1 -0
  52. package/build/es/src/iam-verification-v1-start-response.universal.d.ts +211 -0
  53. package/build/es/src/iam-verification-v1-start-response.universal.js +193 -0
  54. package/build/es/src/iam-verification-v1-start-response.universal.js.map +1 -0
  55. package/package.json +2 -2
@@ -0,0 +1,188 @@
1
+ /** Recovery token proto is the saved data on the recovery token. */
2
+ export interface RecoveryToken {
3
+ /**
4
+ * Recovery token ID
5
+ * @readonly
6
+ */
7
+ id?: string | null;
8
+ /**
9
+ * Represents the time this SessionToken was created
10
+ * @readonly
11
+ */
12
+ createdDate?: Date;
13
+ /**
14
+ * tenantId
15
+ * @readonly
16
+ */
17
+ tenantId?: string;
18
+ /**
19
+ * TenantType
20
+ * @readonly
21
+ */
22
+ tenantType?: TenantType;
23
+ /**
24
+ * identity id
25
+ * @readonly
26
+ */
27
+ identityId?: string;
28
+ }
29
+ export declare enum TenantType {
30
+ UNKNOWN_TENANT_TYPE = "UNKNOWN_TENANT_TYPE",
31
+ ACCOUNT = "ACCOUNT",
32
+ SITE = "SITE",
33
+ ROOT = "ROOT"
34
+ }
35
+ export interface SendRecoveryEmailRequest {
36
+ /** email of the identity */
37
+ email: string;
38
+ }
39
+ export interface SendRecoveryEmailResponse {
40
+ }
41
+ export interface RecoverRequest {
42
+ /** recovery token */
43
+ recoveryToken: string;
44
+ /** new password to set for the identity */
45
+ password?: string | null;
46
+ }
47
+ export interface StateMachineResponse {
48
+ state?: StateType;
49
+ sessionToken?: string | null;
50
+ stateToken?: string | null;
51
+ identity?: Identity;
52
+ }
53
+ export declare enum StateType {
54
+ UNKNOWN_STATE = "UNKNOWN_STATE",
55
+ SUCCESS = "SUCCESS",
56
+ REQUIRE_OWNER_APPROVAL = "REQUIRE_OWNER_APPROVAL",
57
+ REQUIRE_EMAIL_VERIFICATION = "REQUIRE_EMAIL_VERIFICATION",
58
+ STATUS_CHECK = "STATUS_CHECK"
59
+ }
60
+ export interface Identity {
61
+ /** Identity ID */
62
+ id?: string | null;
63
+ identifiers?: Identifier[];
64
+ /** @readonly */
65
+ status?: Status;
66
+ /** 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 */
67
+ revision?: string | null;
68
+ /**
69
+ * Represents the time this Identity was created
70
+ * @readonly
71
+ */
72
+ createdDate?: Date;
73
+ /**
74
+ * Represents the time this Identity was last updated
75
+ * @readonly
76
+ */
77
+ updatedDate?: Date;
78
+ /** All the identity configured connections to authenticate with */
79
+ connections?: Connection[];
80
+ identityProfile?: IdentityProfile;
81
+ /** Stores additional information about the identity that can impact user access. This data can't be set by users. */
82
+ metadata?: Metadata;
83
+ email?: Email;
84
+ statusV2?: StatusV2;
85
+ }
86
+ export interface Identifier extends IdentifierValueOneOf {
87
+ email?: string;
88
+ userName?: string;
89
+ }
90
+ /** @oneof */
91
+ export interface IdentifierValueOneOf {
92
+ email?: string;
93
+ userName?: string;
94
+ }
95
+ export declare enum Status {
96
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
97
+ BLOCKED = "BLOCKED",
98
+ ACTIVE = "ACTIVE",
99
+ PROVISIONED = "PROVISIONED",
100
+ DELETED = "DELETED",
101
+ UNPROVISIONED = "UNPROVISIONED"
102
+ }
103
+ export interface Connection extends ConnectionTypeOneOf {
104
+ idpConnection?: IdpConnection;
105
+ authenticatorConnection?: AuthenticatorConnection;
106
+ }
107
+ /** @oneof */
108
+ export interface ConnectionTypeOneOf {
109
+ idpConnection?: IdpConnection;
110
+ authenticatorConnection?: AuthenticatorConnection;
111
+ }
112
+ export interface IdpConnection {
113
+ idpConnectionId?: string;
114
+ idpUserId?: string;
115
+ }
116
+ export interface AuthenticatorConnection {
117
+ authenticatorConnectionId?: string;
118
+ }
119
+ export interface IdentityProfile {
120
+ firstName?: string | null;
121
+ lastName?: string | null;
122
+ nickname?: string | null;
123
+ picture?: string | null;
124
+ emails?: string[];
125
+ phones?: string[];
126
+ labels?: string[];
127
+ language?: string | null;
128
+ privacyStatus?: PrivacyStatus;
129
+ /** custom profile fields */
130
+ customFields?: CustomField[];
131
+ }
132
+ export declare enum PrivacyStatus {
133
+ UNDEFINED = "UNDEFINED",
134
+ PUBLIC = "PUBLIC",
135
+ PRIVATE = "PRIVATE"
136
+ }
137
+ export interface CustomField {
138
+ name?: string;
139
+ value?: CustomValue;
140
+ }
141
+ export interface CustomValue extends CustomValueValueOneOf {
142
+ strValue?: string;
143
+ numValue?: number;
144
+ dateValue?: Date;
145
+ listValue?: ListValue;
146
+ mapValue?: MapValue;
147
+ }
148
+ /** @oneof */
149
+ export interface CustomValueValueOneOf {
150
+ strValue?: string;
151
+ numValue?: number;
152
+ dateValue?: Date;
153
+ listValue?: ListValue;
154
+ mapValue?: MapValue;
155
+ }
156
+ export interface ListValue {
157
+ value?: CustomValue[];
158
+ }
159
+ export interface MapValue {
160
+ value?: Record<string, CustomValue>;
161
+ }
162
+ export interface Metadata {
163
+ /**
164
+ * represents general tags such as "isOwner", "isContributor"
165
+ * @readonly
166
+ */
167
+ tags?: string[];
168
+ }
169
+ export interface Email {
170
+ address?: string;
171
+ isVerified?: boolean;
172
+ }
173
+ export interface StatusV2 {
174
+ name?: StatusName;
175
+ reasons?: Reason[];
176
+ }
177
+ export declare enum StatusName {
178
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
179
+ PENDING = "PENDING",
180
+ ACTIVE = "ACTIVE",
181
+ DELETED = "DELETED",
182
+ BLOCKED = "BLOCKED"
183
+ }
184
+ export declare enum Reason {
185
+ UNKNOWN_REASON = "UNKNOWN_REASON",
186
+ PENDING_ADMIN_APPROVAL_REQUIRED = "PENDING_ADMIN_APPROVAL_REQUIRED",
187
+ PENDING_EMAIL_VERIFICATION_REQUIRED = "PENDING_EMAIL_VERIFICATION_REQUIRED"
188
+ }
@@ -0,0 +1,45 @@
1
+ export var TenantType;
2
+ (function (TenantType) {
3
+ TenantType["UNKNOWN_TENANT_TYPE"] = "UNKNOWN_TENANT_TYPE";
4
+ TenantType["ACCOUNT"] = "ACCOUNT";
5
+ TenantType["SITE"] = "SITE";
6
+ TenantType["ROOT"] = "ROOT";
7
+ })(TenantType || (TenantType = {}));
8
+ export var StateType;
9
+ (function (StateType) {
10
+ StateType["UNKNOWN_STATE"] = "UNKNOWN_STATE";
11
+ StateType["SUCCESS"] = "SUCCESS";
12
+ StateType["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
13
+ StateType["REQUIRE_EMAIL_VERIFICATION"] = "REQUIRE_EMAIL_VERIFICATION";
14
+ StateType["STATUS_CHECK"] = "STATUS_CHECK";
15
+ })(StateType || (StateType = {}));
16
+ export var Status;
17
+ (function (Status) {
18
+ Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
19
+ Status["BLOCKED"] = "BLOCKED";
20
+ Status["ACTIVE"] = "ACTIVE";
21
+ Status["PROVISIONED"] = "PROVISIONED";
22
+ Status["DELETED"] = "DELETED";
23
+ Status["UNPROVISIONED"] = "UNPROVISIONED";
24
+ })(Status || (Status = {}));
25
+ export var PrivacyStatus;
26
+ (function (PrivacyStatus) {
27
+ PrivacyStatus["UNDEFINED"] = "UNDEFINED";
28
+ PrivacyStatus["PUBLIC"] = "PUBLIC";
29
+ PrivacyStatus["PRIVATE"] = "PRIVATE";
30
+ })(PrivacyStatus || (PrivacyStatus = {}));
31
+ export var StatusName;
32
+ (function (StatusName) {
33
+ StatusName["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
34
+ StatusName["PENDING"] = "PENDING";
35
+ StatusName["ACTIVE"] = "ACTIVE";
36
+ StatusName["DELETED"] = "DELETED";
37
+ StatusName["BLOCKED"] = "BLOCKED";
38
+ })(StatusName || (StatusName = {}));
39
+ export var Reason;
40
+ (function (Reason) {
41
+ Reason["UNKNOWN_REASON"] = "UNKNOWN_REASON";
42
+ Reason["PENDING_ADMIN_APPROVAL_REQUIRED"] = "PENDING_ADMIN_APPROVAL_REQUIRED";
43
+ Reason["PENDING_EMAIL_VERIFICATION_REQUIRED"] = "PENDING_EMAIL_VERIFICATION_REQUIRED";
44
+ })(Reason || (Reason = {}));
45
+ //# sourceMappingURL=iam-recovery-v1-recovery.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iam-recovery-v1-recovery.types.js","sourceRoot":"","sources":["../../../src/iam-recovery-v1-recovery.types.ts"],"names":[],"mappings":"AA6BA,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;AAuBD,MAAM,CAAN,IAAY,SAMX;AAND,WAAY,SAAS;IACnB,4CAA+B,CAAA;IAC/B,gCAAmB,CAAA;IACnB,8DAAiD,CAAA;IACjD,sEAAyD,CAAA;IACzD,0CAA6B,CAAA;AAC/B,CAAC,EANW,SAAS,KAAT,SAAS,QAMpB;AAwCD,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;AAkDD,MAAM,CAAN,IAAY,UAMX;AAND,WAAY,UAAU;IACpB,+CAAiC,CAAA;IACjC,iCAAmB,CAAA;IACnB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;AACrB,CAAC,EANW,UAAU,KAAV,UAAU,QAMrB;AAED,MAAM,CAAN,IAAY,MAIX;AAJD,WAAY,MAAM;IAChB,2CAAiC,CAAA;IACjC,6EAAmE,CAAA;IACnE,qFAA2E,CAAA;AAC7E,CAAC,EAJW,MAAM,KAAN,MAAM,QAIjB"}
@@ -0,0 +1,212 @@
1
+ export declare const __debug: {
2
+ verboseLogging: {
3
+ on: () => boolean;
4
+ off: () => boolean;
5
+ };
6
+ };
7
+ /** Recovery token proto is the saved data on the recovery token. */
8
+ export interface RecoveryToken {
9
+ /**
10
+ * Recovery token ID
11
+ * @readonly
12
+ */
13
+ _id?: string | null;
14
+ /**
15
+ * Represents the time this SessionToken was created
16
+ * @readonly
17
+ */
18
+ _createdDate?: Date;
19
+ /**
20
+ * tenantId
21
+ * @readonly
22
+ */
23
+ tenantId?: string;
24
+ /**
25
+ * TenantType
26
+ * @readonly
27
+ */
28
+ tenantType?: TenantType;
29
+ /**
30
+ * identity id
31
+ * @readonly
32
+ */
33
+ identityId?: string;
34
+ }
35
+ export declare enum TenantType {
36
+ UNKNOWN_TENANT_TYPE = "UNKNOWN_TENANT_TYPE",
37
+ ACCOUNT = "ACCOUNT",
38
+ SITE = "SITE",
39
+ ROOT = "ROOT"
40
+ }
41
+ export interface SendRecoveryEmailRequest {
42
+ /** email of the identity */
43
+ email: string;
44
+ }
45
+ export interface SendRecoveryEmailResponse {
46
+ }
47
+ export interface RecoverRequest {
48
+ /** recovery token */
49
+ recoveryToken: string;
50
+ /** new password to set for the identity */
51
+ password?: string | null;
52
+ }
53
+ export interface StateMachineResponse {
54
+ state?: StateType;
55
+ sessionToken?: string | null;
56
+ stateToken?: string | null;
57
+ identity?: Identity;
58
+ }
59
+ export declare enum StateType {
60
+ UNKNOWN_STATE = "UNKNOWN_STATE",
61
+ SUCCESS = "SUCCESS",
62
+ REQUIRE_OWNER_APPROVAL = "REQUIRE_OWNER_APPROVAL",
63
+ REQUIRE_EMAIL_VERIFICATION = "REQUIRE_EMAIL_VERIFICATION",
64
+ STATUS_CHECK = "STATUS_CHECK"
65
+ }
66
+ export interface Identity {
67
+ /** Identity ID */
68
+ _id?: string | null;
69
+ identifiers?: Identifier[];
70
+ /** @readonly */
71
+ status?: Status;
72
+ /** 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 */
73
+ revision?: string | null;
74
+ /**
75
+ * Represents the time this Identity was created
76
+ * @readonly
77
+ */
78
+ _createdDate?: Date;
79
+ /**
80
+ * Represents the time this Identity was last updated
81
+ * @readonly
82
+ */
83
+ _updatedDate?: Date;
84
+ /** All the identity configured connections to authenticate with */
85
+ connections?: Connection[];
86
+ identityProfile?: IdentityProfile;
87
+ /** Stores additional information about the identity that can impact user access. This data can't be set by users. */
88
+ metadata?: Metadata;
89
+ email?: Email;
90
+ statusV2?: StatusV2;
91
+ }
92
+ export interface Identifier extends IdentifierValueOneOf {
93
+ email?: string;
94
+ userName?: string;
95
+ }
96
+ /** @oneof */
97
+ export interface IdentifierValueOneOf {
98
+ email?: string;
99
+ userName?: string;
100
+ }
101
+ export declare enum Status {
102
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
103
+ BLOCKED = "BLOCKED",
104
+ ACTIVE = "ACTIVE",
105
+ PROVISIONED = "PROVISIONED",
106
+ DELETED = "DELETED",
107
+ UNPROVISIONED = "UNPROVISIONED"
108
+ }
109
+ export interface Connection extends ConnectionTypeOneOf {
110
+ idpConnection?: IdpConnection;
111
+ authenticatorConnection?: AuthenticatorConnection;
112
+ }
113
+ /** @oneof */
114
+ export interface ConnectionTypeOneOf {
115
+ idpConnection?: IdpConnection;
116
+ authenticatorConnection?: AuthenticatorConnection;
117
+ }
118
+ export interface IdpConnection {
119
+ idpConnectionId?: string;
120
+ idpUserId?: string;
121
+ }
122
+ export interface AuthenticatorConnection {
123
+ authenticatorConnectionId?: string;
124
+ }
125
+ export interface IdentityProfile {
126
+ firstName?: string | null;
127
+ lastName?: string | null;
128
+ nickname?: string | null;
129
+ picture?: string | null;
130
+ emails?: string[];
131
+ phones?: string[];
132
+ labels?: string[];
133
+ language?: string | null;
134
+ privacyStatus?: PrivacyStatus;
135
+ /** custom profile fields */
136
+ customFields?: CustomField[];
137
+ }
138
+ export declare enum PrivacyStatus {
139
+ UNDEFINED = "UNDEFINED",
140
+ PUBLIC = "PUBLIC",
141
+ PRIVATE = "PRIVATE"
142
+ }
143
+ export interface CustomField {
144
+ name?: string;
145
+ value?: CustomValue;
146
+ }
147
+ export interface CustomValue extends CustomValueValueOneOf {
148
+ strValue?: string;
149
+ numValue?: number;
150
+ dateValue?: Date;
151
+ listValue?: ListValue;
152
+ mapValue?: MapValue;
153
+ }
154
+ /** @oneof */
155
+ export interface CustomValueValueOneOf {
156
+ strValue?: string;
157
+ numValue?: number;
158
+ dateValue?: Date;
159
+ listValue?: ListValue;
160
+ mapValue?: MapValue;
161
+ }
162
+ export interface ListValue {
163
+ value?: CustomValue[];
164
+ }
165
+ export interface MapValue {
166
+ value?: Record<string, CustomValue>;
167
+ }
168
+ export interface Metadata {
169
+ /**
170
+ * represents general tags such as "isOwner", "isContributor"
171
+ * @readonly
172
+ */
173
+ tags?: string[];
174
+ }
175
+ export interface Email {
176
+ address?: string;
177
+ isVerified?: boolean;
178
+ }
179
+ export interface StatusV2 {
180
+ name?: StatusName;
181
+ reasons?: Reason[];
182
+ }
183
+ export declare enum StatusName {
184
+ UNKNOWN_STATUS = "UNKNOWN_STATUS",
185
+ PENDING = "PENDING",
186
+ ACTIVE = "ACTIVE",
187
+ DELETED = "DELETED",
188
+ BLOCKED = "BLOCKED"
189
+ }
190
+ export declare enum Reason {
191
+ UNKNOWN_REASON = "UNKNOWN_REASON",
192
+ PENDING_ADMIN_APPROVAL_REQUIRED = "PENDING_ADMIN_APPROVAL_REQUIRED",
193
+ PENDING_EMAIL_VERIFICATION_REQUIRED = "PENDING_EMAIL_VERIFICATION_REQUIRED"
194
+ }
195
+ /**
196
+ * Sends an recovery email with recovery token
197
+ * @param email - email of the identity
198
+ * @public
199
+ * @documentationMaturity preview
200
+ * @requiredField email
201
+ */
202
+ export declare function sendRecoveryEmail(email: string): Promise<void>;
203
+ /** @param recoveryToken - recovery token
204
+ * @public
205
+ * @documentationMaturity preview
206
+ * @requiredField recoveryToken
207
+ */
208
+ export declare function recover(recoveryToken: string, options?: RecoverOptions): Promise<StateMachineResponse>;
209
+ export interface RecoverOptions {
210
+ /** new password to set for the identity */
211
+ password?: string | null;
212
+ }
@@ -0,0 +1,190 @@
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 ambassadorWixIamRecoveryV1Recovery from './iam-recovery-v1-recovery.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 TenantType;
28
+ (function (TenantType) {
29
+ TenantType["UNKNOWN_TENANT_TYPE"] = "UNKNOWN_TENANT_TYPE";
30
+ TenantType["ACCOUNT"] = "ACCOUNT";
31
+ TenantType["SITE"] = "SITE";
32
+ TenantType["ROOT"] = "ROOT";
33
+ })(TenantType || (TenantType = {}));
34
+ export var StateType;
35
+ (function (StateType) {
36
+ StateType["UNKNOWN_STATE"] = "UNKNOWN_STATE";
37
+ StateType["SUCCESS"] = "SUCCESS";
38
+ StateType["REQUIRE_OWNER_APPROVAL"] = "REQUIRE_OWNER_APPROVAL";
39
+ StateType["REQUIRE_EMAIL_VERIFICATION"] = "REQUIRE_EMAIL_VERIFICATION";
40
+ StateType["STATUS_CHECK"] = "STATUS_CHECK";
41
+ })(StateType || (StateType = {}));
42
+ export var Status;
43
+ (function (Status) {
44
+ Status["UNKNOWN_STATUS"] = "UNKNOWN_STATUS";
45
+ Status["BLOCKED"] = "BLOCKED";
46
+ Status["ACTIVE"] = "ACTIVE";
47
+ Status["PROVISIONED"] = "PROVISIONED";
48
+ Status["DELETED"] = "DELETED";
49
+ Status["UNPROVISIONED"] = "UNPROVISIONED";
50
+ })(Status || (Status = {}));
51
+ export var PrivacyStatus;
52
+ (function (PrivacyStatus) {
53
+ PrivacyStatus["UNDEFINED"] = "UNDEFINED";
54
+ PrivacyStatus["PUBLIC"] = "PUBLIC";
55
+ PrivacyStatus["PRIVATE"] = "PRIVATE";
56
+ })(PrivacyStatus || (PrivacyStatus = {}));
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 || (StatusName = {}));
65
+ export var Reason;
66
+ (function (Reason) {
67
+ Reason["UNKNOWN_REASON"] = "UNKNOWN_REASON";
68
+ Reason["PENDING_ADMIN_APPROVAL_REQUIRED"] = "PENDING_ADMIN_APPROVAL_REQUIRED";
69
+ Reason["PENDING_EMAIL_VERIFICATION_REQUIRED"] = "PENDING_EMAIL_VERIFICATION_REQUIRED";
70
+ })(Reason || (Reason = {}));
71
+ const _customField = { value: '_customValue' };
72
+ const _customValue = { listValue: '_listValue', mapValue: '_mapValue' };
73
+ const _identity = { identityProfile: '_identityProfile' };
74
+ const _identityProfile = { customFields: '_customField' };
75
+ const _listValue = { value: '_customValue' };
76
+ const _mapValue = { value: 'Map#_customValue' };
77
+ const _recoverRequest = {};
78
+ const _sendRecoveryEmailRequest = {};
79
+ const _sendRecoveryEmailResponse = {};
80
+ const _stateMachineResponse = { identity: '_identity' };
81
+ /**
82
+ * Sends an recovery email with recovery token
83
+ * @param email - email of the identity
84
+ * @public
85
+ * @documentationMaturity preview
86
+ * @requiredField email
87
+ */
88
+ export function sendRecoveryEmail(email) {
89
+ var _a, _b, _c;
90
+ return __awaiter(this, arguments, void 0, function* () {
91
+ const requestTransformation = { email: '$[0]' };
92
+ const responseTransformation = '$';
93
+ // @ts-ignore
94
+ const { httpClient, sideEffects } = arguments[1];
95
+ const { toAmbassadorRequest } = serializer({
96
+ rootSchema: _sendRecoveryEmailRequest,
97
+ depSchemas: {},
98
+ fqdnTransformation: {
99
+ paths: [],
100
+ transformation: _fromVeloEntity,
101
+ },
102
+ customTransformation: requestTransformation,
103
+ });
104
+ const { fromJSON } = serializer({
105
+ rootSchema: _sendRecoveryEmailResponse,
106
+ depSchemas: {},
107
+ fqdnTransformation: {
108
+ paths: [],
109
+ transformation: _toVeloEntity,
110
+ },
111
+ customTransformation: responseTransformation,
112
+ });
113
+ const payload = toAmbassadorRequest([email]);
114
+ const reqOpts = ambassadorWixIamRecoveryV1Recovery.sendRecoveryEmail(payload);
115
+ __log(`"SendRecoveryEmail" sending request with: ${__inspect(reqOpts)}`);
116
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
117
+ try {
118
+ const result = yield httpClient.request(reqOpts);
119
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
120
+ return fromJSON(result.data);
121
+ }
122
+ catch (err) {
123
+ const transformedError = transformError(err, requestTransformation, [
124
+ 'email',
125
+ ]);
126
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
127
+ throw transformedError;
128
+ }
129
+ });
130
+ }
131
+ /** @param recoveryToken - recovery token
132
+ * @public
133
+ * @documentationMaturity preview
134
+ * @requiredField recoveryToken
135
+ */
136
+ export function recover(recoveryToken, options) {
137
+ var _a, _b, _c;
138
+ return __awaiter(this, arguments, void 0, function* () {
139
+ const requestTransformation = {
140
+ recoveryToken: '$[0]',
141
+ password: '$[1].password',
142
+ };
143
+ const responseTransformation = '$';
144
+ // @ts-ignore
145
+ const { httpClient, sideEffects } = arguments[2];
146
+ const { toAmbassadorRequest } = serializer({
147
+ rootSchema: _recoverRequest,
148
+ depSchemas: {},
149
+ fqdnTransformation: {
150
+ paths: [],
151
+ transformation: _fromVeloEntity,
152
+ },
153
+ customTransformation: requestTransformation,
154
+ });
155
+ const { fromJSON } = serializer({
156
+ rootSchema: _stateMachineResponse,
157
+ depSchemas: {
158
+ _customField,
159
+ _customValue,
160
+ _identity,
161
+ _identityProfile,
162
+ _listValue,
163
+ _mapValue,
164
+ },
165
+ fqdnTransformation: {
166
+ paths: [],
167
+ transformation: _toVeloEntity,
168
+ },
169
+ customTransformation: responseTransformation,
170
+ });
171
+ const payload = toAmbassadorRequest([recoveryToken, options]);
172
+ const reqOpts = ambassadorWixIamRecoveryV1Recovery.recover(payload);
173
+ __log(`"Recover" sending request with: ${__inspect(reqOpts)}`);
174
+ (_a = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSiteCall) === null || _a === void 0 ? void 0 : _a.call(sideEffects);
175
+ try {
176
+ const result = yield httpClient.request(reqOpts);
177
+ (_b = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onSuccess) === null || _b === void 0 ? void 0 : _b.call(sideEffects, result);
178
+ return fromJSON(result.data);
179
+ }
180
+ catch (err) {
181
+ const transformedError = transformError(err, requestTransformation, [
182
+ 'recoveryToken',
183
+ 'options',
184
+ ]);
185
+ (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
186
+ throw transformedError;
187
+ }
188
+ });
189
+ }
190
+ //# sourceMappingURL=iam-recovery-v1-recovery.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iam-recovery-v1-recovery.universal.js","sourceRoot":"","sources":["../../../src/iam-recovery-v1-recovery.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,kCAAk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AAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,eAAe;gBACf,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
@@ -0,0 +1,13 @@
1
+ import { RequestOptionsFactory } from '@wix/sdk-types';
2
+ import { StateMachineResponse, StartRequest, StartResponse, VerifyDuringAuthenticationRequest } from './iam-verification-v1-start-response.types';
3
+ /**
4
+ * starts a verification process
5
+ * example: sends a code to the identity's email
6
+ */
7
+ export declare function start(payload: StartRequest): RequestOptionsFactory<StartResponse>;
8
+ /**
9
+ * verifies the code in the request.
10
+ * this endpoint is meant to be called during the authentication process only, thus it requires a stateToken.
11
+ * the identity_id and the verification_id are extracted from the stateToken
12
+ */
13
+ export declare function verifyDuringAuthentication(payload: VerifyDuringAuthenticationRequest): RequestOptionsFactory<StateMachineResponse>;