@tmlmobilidade/types 20250917.1113.55 → 20250917.1133.15

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.
@@ -2,16 +2,14 @@ import { z } from 'zod';
2
2
  export declare const CommentTypeSchema: z.ZodEnum<["field_changed", "note"]>;
3
3
  export type CommentType = z.infer<typeof CommentTypeSchema>;
4
4
  export declare const NoteCommentSchema: z.ZodObject<{
5
- _id: z.ZodString;
5
+ _id: z.ZodOptional<z.ZodString>;
6
6
  created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
7
7
  created_by: z.ZodOptional<z.ZodString>;
8
8
  updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
9
9
  updated_by: z.ZodOptional<z.ZodString>;
10
- } & {
11
10
  message: z.ZodString;
12
11
  type: z.ZodLiteral<"note">;
13
12
  }, "strip", z.ZodTypeAny, {
14
- _id: string;
15
13
  created_at: number & {
16
14
  __brand: "UnixTimestamp";
17
15
  };
@@ -20,31 +18,30 @@ export declare const NoteCommentSchema: z.ZodObject<{
20
18
  };
21
19
  message: string;
22
20
  type: "note";
21
+ _id?: string | undefined;
23
22
  created_by?: string | undefined;
24
23
  updated_by?: string | undefined;
25
24
  }, {
26
- _id: string;
27
25
  created_at: number;
28
26
  updated_at: number;
29
27
  message: string;
30
28
  type: "note";
29
+ _id?: string | undefined;
31
30
  created_by?: string | undefined;
32
31
  updated_by?: string | undefined;
33
32
  }>;
34
33
  export declare const FieldChangedCommentSchema: z.ZodObject<{
35
- _id: z.ZodString;
34
+ _id: z.ZodOptional<z.ZodString>;
36
35
  created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
37
36
  created_by: z.ZodOptional<z.ZodString>;
38
37
  updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
39
38
  updated_by: z.ZodOptional<z.ZodString>;
40
- } & {
39
+ type: z.ZodLiteral<"field_changed">;
41
40
  curr_value: z.ZodAny;
42
41
  field: z.ZodString;
43
42
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
44
43
  prev_value: z.ZodAny;
45
- type: z.ZodLiteral<"field_changed">;
46
44
  }, "strip", z.ZodTypeAny, {
47
- _id: string;
48
45
  created_at: number & {
49
46
  __brand: "UnixTimestamp";
50
47
  };
@@ -53,17 +50,18 @@ export declare const FieldChangedCommentSchema: z.ZodObject<{
53
50
  };
54
51
  type: "field_changed";
55
52
  field: string;
53
+ _id?: string | undefined;
56
54
  created_by?: string | undefined;
57
55
  updated_by?: string | undefined;
58
56
  curr_value?: any;
59
57
  metadata?: Record<string, unknown> | null | undefined;
60
58
  prev_value?: any;
61
59
  }, {
62
- _id: string;
63
60
  created_at: number;
64
61
  updated_at: number;
65
62
  type: "field_changed";
66
63
  field: string;
64
+ _id?: string | undefined;
67
65
  created_by?: string | undefined;
68
66
  updated_by?: string | undefined;
69
67
  curr_value?: any;
@@ -71,16 +69,14 @@ export declare const FieldChangedCommentSchema: z.ZodObject<{
71
69
  prev_value?: any;
72
70
  }>;
73
71
  export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
74
- _id: z.ZodString;
72
+ _id: z.ZodOptional<z.ZodString>;
75
73
  created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
76
74
  created_by: z.ZodOptional<z.ZodString>;
77
75
  updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
78
76
  updated_by: z.ZodOptional<z.ZodString>;
79
- } & {
80
77
  message: z.ZodString;
81
78
  type: z.ZodLiteral<"note">;
82
79
  }, "strip", z.ZodTypeAny, {
83
- _id: string;
84
80
  created_at: number & {
85
81
  __brand: "UnixTimestamp";
86
82
  };
@@ -89,30 +85,29 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
89
85
  };
90
86
  message: string;
91
87
  type: "note";
88
+ _id?: string | undefined;
92
89
  created_by?: string | undefined;
93
90
  updated_by?: string | undefined;
94
91
  }, {
95
- _id: string;
96
92
  created_at: number;
97
93
  updated_at: number;
98
94
  message: string;
99
95
  type: "note";
96
+ _id?: string | undefined;
100
97
  created_by?: string | undefined;
101
98
  updated_by?: string | undefined;
102
99
  }>, z.ZodObject<{
103
- _id: z.ZodString;
100
+ _id: z.ZodOptional<z.ZodString>;
104
101
  created_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
105
102
  created_by: z.ZodOptional<z.ZodString>;
106
103
  updated_at: z.ZodEffects<z.ZodNumber, import("./unix-timestamp.js").UnixTimestamp, number>;
107
104
  updated_by: z.ZodOptional<z.ZodString>;
108
- } & {
105
+ type: z.ZodLiteral<"field_changed">;
109
106
  curr_value: z.ZodAny;
110
107
  field: z.ZodString;
111
108
  metadata: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
112
109
  prev_value: z.ZodAny;
113
- type: z.ZodLiteral<"field_changed">;
114
110
  }, "strip", z.ZodTypeAny, {
115
- _id: string;
116
111
  created_at: number & {
117
112
  __brand: "UnixTimestamp";
118
113
  };
@@ -121,24 +116,24 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
121
116
  };
122
117
  type: "field_changed";
123
118
  field: string;
119
+ _id?: string | undefined;
124
120
  created_by?: string | undefined;
125
121
  updated_by?: string | undefined;
126
122
  curr_value?: any;
127
123
  metadata?: Record<string, unknown> | null | undefined;
128
124
  prev_value?: any;
129
125
  }, {
130
- _id: string;
131
126
  created_at: number;
132
127
  updated_at: number;
133
128
  type: "field_changed";
134
129
  field: string;
130
+ _id?: string | undefined;
135
131
  created_by?: string | undefined;
136
132
  updated_by?: string | undefined;
137
133
  curr_value?: any;
138
134
  metadata?: Record<string, unknown> | null | undefined;
139
135
  prev_value?: any;
140
136
  }>]>, {
141
- _id: string;
142
137
  created_at: number & {
143
138
  __brand: "UnixTimestamp";
144
139
  };
@@ -147,10 +142,10 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
147
142
  };
148
143
  message: string;
149
144
  type: "note";
145
+ _id?: string | undefined;
150
146
  created_by?: string | undefined;
151
147
  updated_by?: string | undefined;
152
148
  } | {
153
- _id: string;
154
149
  created_at: number & {
155
150
  __brand: "UnixTimestamp";
156
151
  };
@@ -159,25 +154,26 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
159
154
  };
160
155
  type: "field_changed";
161
156
  field: string;
157
+ _id?: string | undefined;
162
158
  created_by?: string | undefined;
163
159
  updated_by?: string | undefined;
164
160
  curr_value?: any;
165
161
  metadata?: Record<string, unknown> | null | undefined;
166
162
  prev_value?: any;
167
163
  }, {
168
- _id: string;
169
164
  created_at: number;
170
165
  updated_at: number;
171
166
  message: string;
172
167
  type: "note";
168
+ _id?: string | undefined;
173
169
  created_by?: string | undefined;
174
170
  updated_by?: string | undefined;
175
171
  } | {
176
- _id: string;
177
172
  created_at: number;
178
173
  updated_at: number;
179
174
  type: "field_changed";
180
175
  field: string;
176
+ _id?: string | undefined;
181
177
  created_by?: string | undefined;
182
178
  updated_by?: string | undefined;
183
179
  curr_value?: any;
@@ -8,14 +8,14 @@ export const CommentTypeSchema = z.enum(COMMENT_TYPE_OPTIONS);
8
8
  export const NoteCommentSchema = DocumentSchema.extend({
9
9
  message: z.string(),
10
10
  type: z.literal(CommentTypeSchema.enum.note),
11
- });
11
+ }).partial({ _id: true });
12
12
  export const FieldChangedCommentSchema = DocumentSchema.extend({
13
13
  curr_value: z.any(),
14
14
  field: z.string(),
15
15
  metadata: z.record(z.unknown()).nullish(),
16
16
  prev_value: z.any(),
17
17
  type: z.literal(CommentTypeSchema.enum.field_changed),
18
- });
18
+ }).partial({ _id: true });
19
19
  /* * */
20
20
  function validateFieldChanged(data, ctx) {
21
21
  if (data.curr_value === data.prev_value) {