@tmlmobilidade/go-types-shared 20260901.1712.35 → 20260901.1955.42
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,10 +2,12 @@ import { z } from 'zod';
|
|
|
2
2
|
export declare const ApiResponseSuccessSchema: z.ZodObject<{
|
|
3
3
|
data: z.ZodUnknown;
|
|
4
4
|
error: z.ZodNull;
|
|
5
|
+
generated_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("../datetime/unix-millis.js").UnixMilliseconds, string | number>>>;
|
|
5
6
|
status_code: z.ZodEnum<["200", "201", "204"]>;
|
|
6
7
|
timestamp: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("../datetime/unix-millis.js").UnixMilliseconds, string | number>;
|
|
7
8
|
}, "strip", z.ZodTypeAny, {
|
|
8
9
|
error: null;
|
|
10
|
+
generated_at: import("../datetime/unix-millis.js").UnixMilliseconds | null;
|
|
9
11
|
status_code: "200" | "201" | "204";
|
|
10
12
|
timestamp: number & {
|
|
11
13
|
__brand: "UnixMilliseconds";
|
|
@@ -16,6 +18,7 @@ export declare const ApiResponseSuccessSchema: z.ZodObject<{
|
|
|
16
18
|
status_code: "200" | "201" | "204";
|
|
17
19
|
timestamp: string | number;
|
|
18
20
|
data?: unknown;
|
|
21
|
+
generated_at?: string | number | null | undefined;
|
|
19
22
|
}>;
|
|
20
23
|
export type ApiResponseSuccess<T> = Omit<z.infer<typeof ApiResponseSuccessSchema>, 'data'> & {
|
|
21
24
|
data: T;
|
|
@@ -42,10 +45,12 @@ export type ApiResponseError = z.infer<typeof ApiResponseErrorSchema>;
|
|
|
42
45
|
export declare const ApiResponseSchema: z.ZodDiscriminatedUnion<"status_code", [z.ZodObject<{
|
|
43
46
|
data: z.ZodUnknown;
|
|
44
47
|
error: z.ZodNull;
|
|
48
|
+
generated_at: z.ZodDefault<z.ZodNullable<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("../datetime/unix-millis.js").UnixMilliseconds, string | number>>>;
|
|
45
49
|
status_code: z.ZodEnum<["200", "201", "204"]>;
|
|
46
50
|
timestamp: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, import("../datetime/unix-millis.js").UnixMilliseconds, string | number>;
|
|
47
51
|
}, "strip", z.ZodTypeAny, {
|
|
48
52
|
error: null;
|
|
53
|
+
generated_at: import("../datetime/unix-millis.js").UnixMilliseconds | null;
|
|
49
54
|
status_code: "200" | "201" | "204";
|
|
50
55
|
timestamp: number & {
|
|
51
56
|
__brand: "UnixMilliseconds";
|
|
@@ -56,6 +61,7 @@ export declare const ApiResponseSchema: z.ZodDiscriminatedUnion<"status_code", [
|
|
|
56
61
|
status_code: "200" | "201" | "204";
|
|
57
62
|
timestamp: string | number;
|
|
58
63
|
data?: unknown;
|
|
64
|
+
generated_at?: string | number | null | undefined;
|
|
59
65
|
}>, z.ZodObject<{
|
|
60
66
|
data: z.ZodNull;
|
|
61
67
|
error: z.ZodString;
|
package/dist/api/api-response.js
CHANGED
|
@@ -6,6 +6,7 @@ import { HttpStatusSchema } from './http-status.js';
|
|
|
6
6
|
export const ApiResponseSuccessSchema = z.object({
|
|
7
7
|
data: z.unknown(),
|
|
8
8
|
error: z.null(),
|
|
9
|
+
generated_at: UnixMillisecondsSchema.nullable().default(null),
|
|
9
10
|
status_code: HttpStatusSchema.extract([
|
|
10
11
|
'200', // OK
|
|
11
12
|
'201', // Created
|