@tmlmobilidade/types 20251006.1055.51 → 20251006.1126.43

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.
@@ -265,8 +265,67 @@ export interface User extends Omit<z.infer<typeof UserSchema>, 'permissions'> {
265
265
  }
266
266
  export type CreateUserDto = z.infer<typeof CreateUserSchema>;
267
267
  export type UpdateUserDto = z.infer<typeof UpdateUserSchema>;
268
- export type UserDisplay = Pick<User, 'avatar' | 'email' | 'first_name' | 'last_name' | 'phone'>;
269
- export type WithUser<T> = T & {
270
- created_by: Partial<UserDisplay>;
271
- updated_by: Partial<UserDisplay>;
268
+ export declare const UserDisplayFields: {
269
+ readonly _id: true;
270
+ readonly avatar: true;
271
+ readonly email: true;
272
+ readonly first_name: true;
273
+ readonly last_name: true;
274
+ readonly phone: true;
275
+ };
276
+ export declare const UserDisplaySchema: z.ZodObject<Pick<{
277
+ _id: z.ZodString;
278
+ created_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
279
+ created_by: z.ZodOptional<z.ZodString>;
280
+ updated_at: z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>;
281
+ updated_by: z.ZodOptional<z.ZodString>;
282
+ } & {
283
+ active_notifications: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
284
+ avatar: z.ZodOptional<z.ZodNullable<z.ZodString>>;
285
+ bio: z.ZodOptional<z.ZodNullable<z.ZodString>>;
286
+ email: z.ZodString;
287
+ email_verified: z.ZodOptional<z.ZodNullable<z.ZodEffects<z.ZodNumber, import("../_common/unix-timestamp.js").UnixTimestamp, number>>>;
288
+ first_name: z.ZodString;
289
+ last_name: z.ZodString;
290
+ organization_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
291
+ password_hash: z.ZodOptional<z.ZodNullable<z.ZodString>>;
292
+ permissions: z.ZodArray<z.ZodObject<{
293
+ action: z.ZodString;
294
+ resource: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodAny>>>;
295
+ scope: z.ZodString;
296
+ }, "strip", z.ZodTypeAny, {
297
+ action: string;
298
+ scope: string;
299
+ resource?: Record<string, any> | null | undefined;
300
+ }, {
301
+ action: string;
302
+ scope: string;
303
+ resource?: Record<string, any> | null | undefined;
304
+ }>, "many">;
305
+ phone: z.ZodOptional<z.ZodNullable<z.ZodString>>;
306
+ preferences: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodNumber, "many">]>>>>>;
307
+ role_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
308
+ session_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
309
+ subscribed_topics: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
310
+ theme_id: z.ZodOptional<z.ZodNullable<z.ZodString>>;
311
+ verification_token_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
312
+ }, "_id" | "phone" | "email" | "avatar" | "first_name" | "last_name">, "strict", z.ZodTypeAny, {
313
+ _id: string;
314
+ email: string;
315
+ first_name: string;
316
+ last_name: string;
317
+ phone?: string | null | undefined;
318
+ avatar?: string | null | undefined;
319
+ }, {
320
+ _id: string;
321
+ email: string;
322
+ first_name: string;
323
+ last_name: string;
324
+ phone?: string | null | undefined;
325
+ avatar?: string | null | undefined;
326
+ }>;
327
+ export type UserDisplay = z.infer<typeof UserDisplaySchema>;
328
+ export type WithUser<T> = Omit<T, 'created_by' | 'updated_by'> & {
329
+ created_by?: string | UserDisplay;
330
+ updated_by?: string | UserDisplay;
272
331
  };
@@ -33,3 +33,5 @@ export const UserSchema = DocumentSchema.extend({
33
33
  }).strict();
34
34
  export const CreateUserSchema = UserSchema.omit({ _id: true, created_at: true, updated_at: true });
35
35
  export const UpdateUserSchema = CreateUserSchema.omit({ created_by: true }).partial();
36
+ export const UserDisplayFields = { _id: true, avatar: true, email: true, first_name: true, last_name: true, phone: true };
37
+ export const UserDisplaySchema = UserSchema.pick(UserDisplayFields);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20251006.1055.51",
3
+ "version": "20251006.1126.43",
4
4
  "author": "João de Vasconcelos & Jusi Monteiro",
5
5
  "license": "AGPL-3.0-or-later",
6
6
  "homepage": "https://github.com/tmlmobilidade/services#readme",