@rpcbase/db 0.149.0 → 0.150.0

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.
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ var __exportAll = (all, no_symbols) => {
26
26
  //#endregion
27
27
  //#region src/models/RBUser.ts
28
28
  var ZRBUser = z$1.object({
29
- email: z$1.string().email().optional(),
29
+ email: z$1.string().trim().toLowerCase().email().optional(),
30
30
  password: z$1.string(),
31
31
  name: z$1.string().optional(),
32
32
  phone: z$1.string().optional(),
@@ -34,7 +34,7 @@ var ZRBUser = z$1.object({
34
34
  tenantRoles: z$1.record(z$1.string(), z$1.array(z$1.string())).optional(),
35
35
  oauthProviders: z$1.record(z$1.string(), z$1.object({
36
36
  subject: z$1.string(),
37
- email: z$1.string().email().optional(),
37
+ email: z$1.string().trim().toLowerCase().email().optional(),
38
38
  name: z$1.string().optional(),
39
39
  accessToken: z$1.string().optional(),
40
40
  refreshToken: z$1.string().optional(),
@@ -46,8 +46,10 @@ var ZRBUser = z$1.object({
46
46
  createdAt: z$1.date().optional(),
47
47
  updatedAt: z$1.date().optional()
48
48
  })).optional(),
49
+ registrationStatus: z$1.enum(["pending_verification", "active"]).optional(),
49
50
  emailVerificationCode: z$1.string().length(6).optional(),
50
51
  emailVerificationExpiresAt: z$1.date().optional(),
52
+ emailVerificationSentAt: z$1.date().optional(),
51
53
  passwordResetCode: z$1.string().length(6).optional(),
52
54
  passwordResetCodeExpiresAt: z$1.date().optional(),
53
55
  passwordResetToken: z$1.string().optional(),
@@ -57,7 +59,9 @@ var RBUserSchema = new Schema$1({
57
59
  email: {
58
60
  type: String,
59
61
  unique: true,
60
- sparse: true
62
+ sparse: true,
63
+ trim: true,
64
+ lowercase: true
61
65
  },
62
66
  phone: {
63
67
  type: String,
@@ -89,7 +93,9 @@ var RBUserSchema = new Schema$1({
89
93
  },
90
94
  email: {
91
95
  type: String,
92
- required: false
96
+ required: false,
97
+ trim: true,
98
+ lowercase: true
93
99
  },
94
100
  name: {
95
101
  type: String,
@@ -135,6 +141,11 @@ var RBUserSchema = new Schema$1({
135
141
  default: {},
136
142
  required: false
137
143
  },
144
+ registrationStatus: {
145
+ type: String,
146
+ enum: ["pending_verification", "active"],
147
+ default: "active"
148
+ },
138
149
  emailVerificationCode: {
139
150
  type: String,
140
151
  required: false
@@ -143,6 +154,10 @@ var RBUserSchema = new Schema$1({
143
154
  type: Date,
144
155
  required: false
145
156
  },
157
+ emailVerificationSentAt: {
158
+ type: Date,
159
+ required: false
160
+ },
146
161
  passwordResetCode: {
147
162
  type: String,
148
163
  required: false