@tmlmobilidade/types 20250918.1816.45 → 20250919.1454.47

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.
@@ -1,6 +1,21 @@
1
1
  import { z } from 'zod';
2
- export declare const OrganizationValueSchema: z.ZodUnion<[z.ZodString, z.ZodString, z.ZodBoolean, z.ZodArray<z.ZodString, "many">, z.ZodArray<z.ZodString, "many">, z.ZodString]>;
3
- export type OrganizationValue = z.infer<typeof OrganizationValueSchema>;
2
+ export declare const HomeLinkSchema: z.ZodObject<{
3
+ href: z.ZodString;
4
+ icon: z.ZodString;
5
+ order: z.ZodNumber;
6
+ title: z.ZodString;
7
+ }, "strict", z.ZodTypeAny, {
8
+ title: string;
9
+ href: string;
10
+ icon: string;
11
+ order: number;
12
+ }, {
13
+ title: string;
14
+ href: string;
15
+ icon: string;
16
+ order: number;
17
+ }>;
18
+ export type HomeLink = z.infer<typeof HomeLinkSchema>;
4
19
  export declare const OrganizationSchema: z.ZodObject<{
5
20
  _id: z.ZodString;
6
21
  created_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
@@ -8,11 +23,27 @@ export declare const OrganizationSchema: z.ZodObject<{
8
23
  updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
9
24
  updated_by: z.ZodOptional<z.ZodString>;
10
25
  } & {
11
- home_links: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
26
+ home_links: z.ZodDefault<z.ZodArray<z.ZodObject<{
27
+ href: z.ZodString;
28
+ icon: z.ZodString;
29
+ order: z.ZodNumber;
30
+ title: z.ZodString;
31
+ }, "strict", z.ZodTypeAny, {
32
+ title: string;
33
+ href: string;
34
+ icon: string;
35
+ order: number;
36
+ }, {
37
+ title: string;
38
+ href: string;
39
+ icon: string;
40
+ order: number;
41
+ }>, "many">>;
12
42
  home_wikis: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
13
- logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
14
- longname: z.ZodString;
15
- shortname: z.ZodString;
43
+ logo_dark: z.ZodOptional<z.ZodNullable<z.ZodString>>;
44
+ logo_light: z.ZodOptional<z.ZodNullable<z.ZodString>>;
45
+ long_name: z.ZodString;
46
+ short_name: z.ZodString;
16
47
  theme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
17
48
  }, "strict", z.ZodTypeAny, {
18
49
  _id: string;
@@ -22,25 +53,37 @@ export declare const OrganizationSchema: z.ZodObject<{
22
53
  updated_at: number & {
23
54
  __brand: "UnixTimestamp";
24
55
  };
25
- home_links: string[];
56
+ short_name: string;
57
+ home_links: {
58
+ title: string;
59
+ href: string;
60
+ icon: string;
61
+ order: number;
62
+ }[];
26
63
  home_wikis: string[];
27
- longname: string;
28
- shortname: string;
64
+ long_name: string;
29
65
  created_by?: string | undefined;
30
66
  updated_by?: string | undefined;
31
- logo?: string | null | undefined;
67
+ logo_dark?: string | null | undefined;
68
+ logo_light?: string | null | undefined;
32
69
  theme?: string | null | undefined;
33
70
  }, {
34
71
  _id: string;
35
72
  created_at: number;
36
73
  updated_at: number;
37
- longname: string;
38
- shortname: string;
74
+ short_name: string;
75
+ long_name: string;
39
76
  created_by?: string | undefined;
40
77
  updated_by?: string | undefined;
41
- home_links?: string[] | undefined;
78
+ home_links?: {
79
+ title: string;
80
+ href: string;
81
+ icon: string;
82
+ order: number;
83
+ }[] | undefined;
42
84
  home_wikis?: string[] | undefined;
43
- logo?: string | null | undefined;
85
+ logo_dark?: string | null | undefined;
86
+ logo_light?: string | null | undefined;
44
87
  theme?: string | null | undefined;
45
88
  }>;
46
89
  export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
@@ -50,54 +93,110 @@ export declare const CreateOrganizationSchema: z.ZodObject<Omit<{
50
93
  updated_at: z.ZodEffects<z.ZodNumber, import("./_common/unix-timestamp.js").UnixTimestamp, number>;
51
94
  updated_by: z.ZodOptional<z.ZodString>;
52
95
  } & {
53
- home_links: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
96
+ home_links: z.ZodDefault<z.ZodArray<z.ZodObject<{
97
+ href: z.ZodString;
98
+ icon: z.ZodString;
99
+ order: z.ZodNumber;
100
+ title: z.ZodString;
101
+ }, "strict", z.ZodTypeAny, {
102
+ title: string;
103
+ href: string;
104
+ icon: string;
105
+ order: number;
106
+ }, {
107
+ title: string;
108
+ href: string;
109
+ icon: string;
110
+ order: number;
111
+ }>, "many">>;
54
112
  home_wikis: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
55
- logo: z.ZodOptional<z.ZodNullable<z.ZodString>>;
56
- longname: z.ZodString;
57
- shortname: z.ZodString;
113
+ logo_dark: z.ZodOptional<z.ZodNullable<z.ZodString>>;
114
+ logo_light: z.ZodOptional<z.ZodNullable<z.ZodString>>;
115
+ long_name: z.ZodString;
116
+ short_name: z.ZodString;
58
117
  theme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
59
118
  }, "_id" | "created_at" | "updated_at">, "strict", z.ZodTypeAny, {
60
- home_links: string[];
119
+ short_name: string;
120
+ home_links: {
121
+ title: string;
122
+ href: string;
123
+ icon: string;
124
+ order: number;
125
+ }[];
61
126
  home_wikis: string[];
62
- longname: string;
63
- shortname: string;
127
+ long_name: string;
64
128
  created_by?: string | undefined;
65
129
  updated_by?: string | undefined;
66
- logo?: string | null | undefined;
130
+ logo_dark?: string | null | undefined;
131
+ logo_light?: string | null | undefined;
67
132
  theme?: string | null | undefined;
68
133
  }, {
69
- longname: string;
70
- shortname: string;
134
+ short_name: string;
135
+ long_name: string;
71
136
  created_by?: string | undefined;
72
137
  updated_by?: string | undefined;
73
- home_links?: string[] | undefined;
138
+ home_links?: {
139
+ title: string;
140
+ href: string;
141
+ icon: string;
142
+ order: number;
143
+ }[] | undefined;
74
144
  home_wikis?: string[] | undefined;
75
- logo?: string | null | undefined;
145
+ logo_dark?: string | null | undefined;
146
+ logo_light?: string | null | undefined;
76
147
  theme?: string | null | undefined;
77
148
  }>;
78
149
  export declare const UpdateOrganizationSchema: z.ZodObject<{
79
150
  updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>;
80
- home_links: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
151
+ short_name: z.ZodOptional<z.ZodString>;
152
+ home_links: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodObject<{
153
+ href: z.ZodString;
154
+ icon: z.ZodString;
155
+ order: z.ZodNumber;
156
+ title: z.ZodString;
157
+ }, "strict", z.ZodTypeAny, {
158
+ title: string;
159
+ href: string;
160
+ icon: string;
161
+ order: number;
162
+ }, {
163
+ title: string;
164
+ href: string;
165
+ icon: string;
166
+ order: number;
167
+ }>, "many">>>;
81
168
  home_wikis: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
82
- logo: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
83
- longname: z.ZodOptional<z.ZodString>;
84
- shortname: z.ZodOptional<z.ZodString>;
169
+ logo_dark: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
170
+ logo_light: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
171
+ long_name: z.ZodOptional<z.ZodString>;
85
172
  theme: z.ZodOptional<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
86
173
  }, "strict", z.ZodTypeAny, {
87
174
  updated_by?: string | undefined;
88
- home_links?: string[] | undefined;
175
+ short_name?: string | undefined;
176
+ home_links?: {
177
+ title: string;
178
+ href: string;
179
+ icon: string;
180
+ order: number;
181
+ }[] | undefined;
89
182
  home_wikis?: string[] | undefined;
90
- logo?: string | null | undefined;
91
- longname?: string | undefined;
92
- shortname?: string | undefined;
183
+ logo_dark?: string | null | undefined;
184
+ logo_light?: string | null | undefined;
185
+ long_name?: string | undefined;
93
186
  theme?: string | null | undefined;
94
187
  }, {
95
188
  updated_by?: string | undefined;
96
- home_links?: string[] | undefined;
189
+ short_name?: string | undefined;
190
+ home_links?: {
191
+ title: string;
192
+ href: string;
193
+ icon: string;
194
+ order: number;
195
+ }[] | undefined;
97
196
  home_wikis?: string[] | undefined;
98
- logo?: string | null | undefined;
99
- longname?: string | undefined;
100
- shortname?: string | undefined;
197
+ logo_dark?: string | null | undefined;
198
+ logo_light?: string | null | undefined;
199
+ long_name?: string | undefined;
101
200
  theme?: string | null | undefined;
102
201
  }>;
103
202
  export type Organization = z.infer<typeof OrganizationSchema>;
@@ -2,21 +2,20 @@
2
2
  import { DocumentSchema } from './_common/document.js';
3
3
  import { z } from 'zod';
4
4
  /* * */
5
- export const OrganizationValueSchema = z.union([
6
- z.string(),
7
- z.string(),
8
- z.boolean(),
9
- z.array(z.string()),
10
- z.array(z.string()),
11
- z.string(),
12
- ]);
5
+ export const HomeLinkSchema = z.object({
6
+ href: z.string().url(),
7
+ icon: z.string(),
8
+ order: z.number().min(0),
9
+ title: z.string(),
10
+ }).strict();
13
11
  /* * */
14
12
  export const OrganizationSchema = DocumentSchema.extend({
15
- home_links: z.array(z.string()).default([]),
13
+ home_links: z.array(HomeLinkSchema).default([]),
16
14
  home_wikis: z.array(z.string()).default([]),
17
- logo: z.string().nullish(),
18
- longname: z.string().nonempty(),
19
- shortname: z.string().nonempty(),
15
+ logo_dark: z.string().nullish(),
16
+ logo_light: z.string().nullish(),
17
+ long_name: z.string().nonempty(),
18
+ short_name: z.string().nonempty(),
20
19
  theme: z.string().nullish(),
21
20
  }).strict();
22
21
  export const CreateOrganizationSchema = OrganizationSchema.omit({ _id: true, created_at: true, updated_at: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmlmobilidade/types",
3
- "version": "20250918.1816.45",
3
+ "version": "20250919.1454.47",
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",