@go-mondo/identity-sdk 0.0.2-beta.65 → 0.0.2-beta.67

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.
@@ -5,7 +5,6 @@ describe('Authentication Settings - Schema', () => {
5
5
  describe('SettingsSchema', () => {
6
6
  test('should accept minimal settings object', () => {
7
7
  const settings = {
8
- createdAt: new Date(),
9
8
  updatedAt: new Date(),
10
9
  metadata: {},
11
10
  };
@@ -13,13 +12,12 @@ describe('Authentication Settings - Schema', () => {
13
12
  // Parse succeeds for valid data
14
13
  expect(result.success).toBe(true);
15
14
  });
16
- test('should reject missing required dates', () => {
15
+ test('should accept settings without dates (all dates are optional)', () => {
17
16
  const settings = {
18
17
  metadata: {},
19
- // missing createdAt, updatedAt
20
18
  };
21
19
  const result = SettingsSchema.safeParse(settings);
22
- expect(result.success).toBe(false);
20
+ expect(result.success).toBe(true);
23
21
  });
24
22
  test('should accept settings with factors', () => {
25
23
  const settings = {
@@ -34,22 +34,24 @@ export declare const UserIdPropertySchema: z.ZodObject<{
34
34
  }, z.core.$strip>;
35
35
  export type UserIdProperty = z.output<typeof UserIdPropertySchema>;
36
36
  export declare const RequiredEmailSchema: z.ZodEmail;
37
- export declare const RequiredPhoneNumberSchema: z.ZodString;
37
+ export declare const RequiredPhoneNumberSchema: z.ZodE164;
38
38
  export declare const VerifiedEmailOrPhonePropertiesSchema: z.ZodObject<{
39
- email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
40
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
41
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
42
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
39
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
40
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
41
+ }, z.core.$strip>;
42
+ export declare const UnverifiedEmailOrPhonePropertiesSchema: z.ZodObject<{
43
+ unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
44
+ unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
43
45
  }, z.core.$strip>;
44
46
  export declare const EmailOrPhonePropertiesSchema: z.ZodObject<{
45
47
  email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
46
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
48
+ phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
47
49
  }, z.core.$strip>;
48
50
  export declare const UserAssociationsSchema: z.ZodObject<{
49
51
  roles: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
50
52
  }, z.core.$strip>;
51
53
  export type UserAssociations = z.output<typeof UserAssociationsSchema>;
52
- export declare const UserSchema: z.ZodObject<{
54
+ export declare const UserSchema: z.ZodPipe<z.ZodObject<{
53
55
  metadata: z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Map<string, string | number | boolean>, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>;
54
56
  deactivatedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
55
57
  deletedAt: z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>;
@@ -65,20 +67,66 @@ export declare const UserSchema: z.ZodObject<{
65
67
  ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
66
68
  count: z.ZodOptional<z.ZodNumber>;
67
69
  }, z.core.$strip>, z.ZodUndefined]>>;
68
- email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
69
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
70
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
71
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
70
+ unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
71
+ unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
72
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
73
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
72
74
  givenName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
73
75
  middleName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
74
76
  familyName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
75
77
  honorificPrefix: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
76
78
  honorificSuffix: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
77
79
  id: z.ZodString;
78
- }, z.core.$strip>;
80
+ }, z.core.$strip>, z.ZodTransform<{
81
+ email: string | undefined;
82
+ phoneNumber: string | undefined;
83
+ metadata: Map<string, string | number | boolean>;
84
+ updatedAt: Date;
85
+ createdAt: Date;
86
+ status: "active" | "suspended" | "unverified";
87
+ id: string;
88
+ deactivatedAt?: Date | undefined;
89
+ deletedAt?: Date | undefined;
90
+ lastLogin?: Date | undefined;
91
+ roles?: {
92
+ ids?: string[] | undefined;
93
+ count?: number | undefined;
94
+ } | undefined;
95
+ unverifiedEmail?: string | undefined;
96
+ unverifiedPhoneNumber?: string | undefined;
97
+ verifiedEmail?: string | undefined;
98
+ verifiedPhoneNumber?: string | undefined;
99
+ givenName?: string | undefined;
100
+ middleName?: string | undefined;
101
+ familyName?: string | undefined;
102
+ honorificPrefix?: string | undefined;
103
+ honorificSuffix?: string | undefined;
104
+ }, {
105
+ metadata: Map<string, string | number | boolean>;
106
+ updatedAt: Date;
107
+ createdAt: Date;
108
+ status: "active" | "suspended" | "unverified";
109
+ id: string;
110
+ deactivatedAt?: Date | undefined;
111
+ deletedAt?: Date | undefined;
112
+ lastLogin?: Date | undefined;
113
+ roles?: {
114
+ ids?: string[] | undefined;
115
+ count?: number | undefined;
116
+ } | undefined;
117
+ unverifiedEmail?: string | undefined;
118
+ unverifiedPhoneNumber?: string | undefined;
119
+ verifiedEmail?: string | undefined;
120
+ verifiedPhoneNumber?: string | undefined;
121
+ givenName?: string | undefined;
122
+ middleName?: string | undefined;
123
+ familyName?: string | undefined;
124
+ honorificPrefix?: string | undefined;
125
+ honorificSuffix?: string | undefined;
126
+ }>>;
79
127
  export type UserProperties = z.input<typeof UserSchema>;
80
128
  export type User = z.output<typeof UserSchema>;
81
- export declare const UserPayloadSchema: z.ZodObject<{
129
+ export declare const UserPayloadSchema: z.ZodPipe<z.ZodObject<{
82
130
  metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
83
131
  deactivatedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
84
132
  deletedAt: z.ZodOptional<z.ZodPipe<z.ZodOptional<z.ZodUnion<readonly [z.ZodDate, z.ZodPipe<z.ZodString, z.ZodTransform<Date, string>>]>>, z.ZodTransform<string | undefined, Date | undefined>>>;
@@ -94,25 +142,71 @@ export declare const UserPayloadSchema: z.ZodObject<{
94
142
  ids: z.ZodOptional<z.ZodArray<z.ZodString>>;
95
143
  count: z.ZodOptional<z.ZodNumber>;
96
144
  }, z.core.$strip>, z.ZodUndefined]>>;
97
- email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
98
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
99
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
100
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
145
+ unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
146
+ unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
147
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
148
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
101
149
  givenName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
102
150
  middleName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
103
151
  familyName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
104
152
  honorificPrefix: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
105
153
  honorificSuffix: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
106
154
  id: z.ZodString;
107
- }, z.core.$strip>;
155
+ }, z.core.$strip>, z.ZodTransform<{
156
+ email: string | undefined;
157
+ phoneNumber: string | undefined;
158
+ updatedAt: string;
159
+ createdAt: string;
160
+ status: "active" | "suspended" | "unverified";
161
+ id: string;
162
+ metadata?: Record<string, string | number | boolean> | undefined;
163
+ deactivatedAt?: string | undefined;
164
+ deletedAt?: string | undefined;
165
+ lastLogin?: string | undefined;
166
+ roles?: {
167
+ ids?: string[] | undefined;
168
+ count?: number | undefined;
169
+ } | undefined;
170
+ unverifiedEmail?: string | undefined;
171
+ unverifiedPhoneNumber?: string | undefined;
172
+ verifiedEmail?: string | undefined;
173
+ verifiedPhoneNumber?: string | undefined;
174
+ givenName?: string | undefined;
175
+ middleName?: string | undefined;
176
+ familyName?: string | undefined;
177
+ honorificPrefix?: string | undefined;
178
+ honorificSuffix?: string | undefined;
179
+ }, {
180
+ updatedAt: string;
181
+ createdAt: string;
182
+ status: "active" | "suspended" | "unverified";
183
+ id: string;
184
+ metadata?: Record<string, string | number | boolean> | undefined;
185
+ deactivatedAt?: string | undefined;
186
+ deletedAt?: string | undefined;
187
+ lastLogin?: string | undefined;
188
+ roles?: {
189
+ ids?: string[] | undefined;
190
+ count?: number | undefined;
191
+ } | undefined;
192
+ unverifiedEmail?: string | undefined;
193
+ unverifiedPhoneNumber?: string | undefined;
194
+ verifiedEmail?: string | undefined;
195
+ verifiedPhoneNumber?: string | undefined;
196
+ givenName?: string | undefined;
197
+ middleName?: string | undefined;
198
+ familyName?: string | undefined;
199
+ honorificPrefix?: string | undefined;
200
+ honorificSuffix?: string | undefined;
201
+ }>>;
108
202
  export type UserPayload = z.output<typeof UserPayloadSchema>;
109
203
  export declare const InsertUserPayloadSchema: z.ZodObject<{
110
204
  metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | null | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
111
205
  roles: z.ZodOptional<z.ZodUnion<readonly [z.ZodUndefined, z.ZodArray<z.ZodString>]>>;
112
- email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
113
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
114
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
115
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
206
+ unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
207
+ unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
208
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
209
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
116
210
  givenName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
117
211
  middleName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
118
212
  familyName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
@@ -129,10 +223,10 @@ export type InsertUserInput = z.input<typeof InsertUserPayloadSchema>;
129
223
  export type InsertUserPayload = z.output<typeof InsertUserPayloadSchema>;
130
224
  export declare const UpdateUserPayloadSchema: z.ZodObject<{
131
225
  metadata: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodUndefined, z.ZodNull, z.ZodCustom<Map<string, string | number | boolean>, Map<string, string | number | boolean>>, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>, z.ZodTransform<Record<string, string | number | boolean> | null | undefined, Record<string, string | number | boolean> | Map<string, string | number | boolean> | null | undefined>>>;
132
- email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
133
- verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
134
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
135
- verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodBoolean, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<boolean | undefined, boolean | null | undefined>>>;
226
+ unverifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
227
+ unverifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
228
+ verifiedEmail: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
229
+ verifiedPhoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
136
230
  givenName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>>;
137
231
  middleName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>>;
138
232
  familyName: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>>;
@@ -153,7 +247,7 @@ export declare const UserAssociationReferenceSchema: z.ZodObject<{
153
247
  }>>;
154
248
  model: z.ZodLiteral<"User">;
155
249
  email: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEmail, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
156
- phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
250
+ phoneNumber: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodE164, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
157
251
  givenName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
158
252
  middleName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
159
253
  familyName: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodNull, z.ZodUndefined]>, z.ZodTransform<string | undefined, string | null | undefined>>>;
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/customer/users/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AA2B5B,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAChC,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAEjE,eAAO,MAAM,UAAU;;;;CAIb,CAAC;AACX,MA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35,14 @@ export const UserIdPropertySchema = z.object({
35
35
  id: UserIdSchema,
36
36
  });
37
37
  export const RequiredEmailSchema = z.email();
38
- export const RequiredPhoneNumberSchema = z.string();
38
+ export const RequiredPhoneNumberSchema = z.e164();
39
39
  export const VerifiedEmailOrPhonePropertiesSchema = z.object({
40
- email: optionallyNullishToUndefined(RequiredEmailSchema),
41
- verifiedEmail: optionallyNullishToUndefined(z.boolean()),
42
- phoneNumber: optionallyNullishToUndefined(RequiredPhoneNumberSchema),
43
- verifiedPhoneNumber: optionallyNullishToUndefined(z.boolean()),
40
+ verifiedEmail: optionallyNullishToUndefined(RequiredEmailSchema),
41
+ verifiedPhoneNumber: optionallyNullishToUndefined(RequiredPhoneNumberSchema),
42
+ });
43
+ export const UnverifiedEmailOrPhonePropertiesSchema = z.object({
44
+ unverifiedEmail: optionallyNullishToUndefined(RequiredEmailSchema),
45
+ unverifiedPhoneNumber: optionallyNullishToUndefined(RequiredPhoneNumberSchema),
44
46
  });
45
47
  export const EmailOrPhonePropertiesSchema = z.object({
46
48
  email: optionallyNullishToUndefined(RequiredEmailSchema),
@@ -53,10 +55,11 @@ const BaseSchema = z.object({
53
55
  ...UserIdPropertySchema.shape,
54
56
  ...UserNamePropertiesSchema.shape,
55
57
  ...VerifiedEmailOrPhonePropertiesSchema.shape,
58
+ ...UnverifiedEmailOrPhonePropertiesSchema.shape,
56
59
  status: UserStatusSchema,
57
60
  roles: optionallyUndefined(AggregateSchema),
58
61
  });
59
- export const UserSchema = z.object({
62
+ const UserSchemaBase = z.object({
60
63
  ...BaseSchema.shape,
61
64
  lastLogin: OptionalDateSchema,
62
65
  ...CreatedAtPropertySchema.shape,
@@ -65,7 +68,12 @@ export const UserSchema = z.object({
65
68
  ...DeactivatedAtPropertySchema.shape,
66
69
  ...MetadataMapPropertySchema.shape,
67
70
  });
68
- export const UserPayloadSchema = z.object({
71
+ export const UserSchema = UserSchemaBase.transform((user) => ({
72
+ ...user,
73
+ email: user.verifiedEmail,
74
+ phoneNumber: user.verifiedPhoneNumber,
75
+ }));
76
+ const UserPayloadSchemaBase = z.object({
69
77
  ...BaseSchema.shape,
70
78
  lastLogin: OptionalDatePayloadSchema,
71
79
  ...CreatedAtPropertyPayloadSchema.shape,
@@ -74,11 +82,17 @@ export const UserPayloadSchema = z.object({
74
82
  ...DeactivatedAtPropertyPayloadSchema.shape,
75
83
  ...MetadataPayloadPropertySchema.shape,
76
84
  });
85
+ export const UserPayloadSchema = UserPayloadSchemaBase.transform((user) => ({
86
+ ...user,
87
+ email: user.verifiedEmail,
88
+ phoneNumber: user.verifiedPhoneNumber,
89
+ }));
77
90
  export const InsertUserPayloadSchema = z.object({
78
91
  id: UserIdSchema.optional(),
79
92
  status: UserStatusSchema.optional(),
80
93
  ...UserNamePropertiesSchema.shape,
81
94
  ...VerifiedEmailOrPhonePropertiesSchema.shape,
95
+ ...UnverifiedEmailOrPhonePropertiesSchema.shape,
82
96
  ...UserAssociationsSchema.shape,
83
97
  ...UpsertMetadataPropertyPayloadSchema.shape,
84
98
  });
@@ -86,6 +100,7 @@ export const UpdateUserPayloadSchema = z.object({
86
100
  suspended: z.boolean().optional(),
87
101
  ...UpdateUserNamePropertiesSchema.shape,
88
102
  ...VerifiedEmailOrPhonePropertiesSchema.shape,
103
+ ...UnverifiedEmailOrPhonePropertiesSchema.shape,
89
104
  ...UpsertMetadataPropertyPayloadSchema.shape,
90
105
  });
91
106
  /**