@isardsat/editorial-common 6.7.0 → 6.8.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @isardsat/editorial-common
2
2
 
3
+ ## 6.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5d48cdb: Fix validation issues
8
+
9
+ ## 6.8.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 57be6b3: UI updates
14
+
3
15
  ## 6.7.0
4
16
 
5
17
  ### Minor Changes
package/dist/schemas.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { z } from "@hono/zod-openapi";
2
2
  export declare const EditorialConfigSchema: z.ZodObject<{
3
3
  name: z.ZodString;
4
- publicUrl: z.ZodString;
4
+ publicUrl: z.ZodURL;
5
5
  publicDir: z.ZodDefault<z.ZodString>;
6
6
  publicDeletedDir: z.ZodDefault<z.ZodString>;
7
- filesUrl: z.ZodString;
8
- largeFilesUrl: z.ZodString;
7
+ filesUrl: z.ZodURL;
8
+ largeFilesUrl: z.ZodURL;
9
9
  previewUrl: z.ZodOptional<z.ZodString>;
10
10
  silent: z.ZodOptional<z.ZodBoolean>;
11
11
  firebase: z.ZodOptional<z.ZodObject<{
@@ -16,274 +16,123 @@ export declare const EditorialConfigSchema: z.ZodObject<{
16
16
  storageBucket: z.ZodString;
17
17
  messagingSenderId: z.ZodString;
18
18
  dbUsersPath: z.ZodString;
19
- }, "strip", z.ZodTypeAny, {
20
- apiKey: string;
21
- authDomain: string;
22
- databaseURL: string;
23
- projectId: string;
24
- storageBucket: string;
25
- messagingSenderId: string;
26
- dbUsersPath: string;
27
- }, {
28
- apiKey: string;
29
- authDomain: string;
30
- databaseURL: string;
31
- projectId: string;
32
- storageBucket: string;
33
- messagingSenderId: string;
34
- dbUsersPath: string;
35
- }>>;
36
- }, "strip", z.ZodTypeAny, {
37
- name: string;
38
- publicUrl: string;
39
- publicDir: string;
40
- publicDeletedDir: string;
41
- filesUrl: string;
42
- largeFilesUrl: string;
43
- previewUrl?: string | undefined;
44
- silent?: boolean | undefined;
45
- firebase?: {
46
- apiKey: string;
47
- authDomain: string;
48
- databaseURL: string;
49
- projectId: string;
50
- storageBucket: string;
51
- messagingSenderId: string;
52
- dbUsersPath: string;
53
- } | undefined;
54
- }, {
55
- name: string;
56
- publicUrl: string;
57
- filesUrl: string;
58
- largeFilesUrl: string;
59
- publicDir?: string | undefined;
60
- publicDeletedDir?: string | undefined;
61
- previewUrl?: string | undefined;
62
- silent?: boolean | undefined;
63
- firebase?: {
64
- apiKey: string;
65
- authDomain: string;
66
- databaseURL: string;
67
- projectId: string;
68
- storageBucket: string;
69
- messagingSenderId: string;
70
- dbUsersPath: string;
71
- } | undefined;
72
- }>;
19
+ }, z.core.$strip>>;
20
+ }, z.core.$strip>;
73
21
  export declare const EditorialDataObjectWithTypeSchema: z.ZodObject<{
74
22
  id: z.ZodString;
75
23
  type: z.ZodString;
76
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
77
- id: z.ZodString;
78
- type: z.ZodString;
79
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
80
- id: z.ZodString;
81
- type: z.ZodString;
82
- }, z.ZodTypeAny, "passthrough">>;
24
+ }, z.core.$loose>;
83
25
  export declare const EditorialDataItemSchema: z.ZodObject<{
84
26
  id: z.ZodString;
85
27
  isDraft: z.ZodDefault<z.ZodBoolean>;
86
- createdAt: z.ZodDefault<z.ZodString>;
87
- updatedAt: z.ZodDefault<z.ZodString>;
88
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
89
- id: z.ZodString;
90
- isDraft: z.ZodDefault<z.ZodBoolean>;
91
- createdAt: z.ZodDefault<z.ZodString>;
92
- updatedAt: z.ZodDefault<z.ZodString>;
93
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
94
- id: z.ZodString;
95
- isDraft: z.ZodDefault<z.ZodBoolean>;
96
- createdAt: z.ZodDefault<z.ZodString>;
97
- updatedAt: z.ZodDefault<z.ZodString>;
98
- }, z.ZodTypeAny, "passthrough">>;
28
+ createdAt: z.ZodDefault<z.ZodISODateTime>;
29
+ updatedAt: z.ZodDefault<z.ZodISODateTime>;
30
+ }, z.core.$loose>;
99
31
  export declare const EditorialDataTypeSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
100
32
  id: z.ZodString;
101
33
  isDraft: z.ZodDefault<z.ZodBoolean>;
102
- createdAt: z.ZodDefault<z.ZodString>;
103
- updatedAt: z.ZodDefault<z.ZodString>;
104
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
105
- id: z.ZodString;
106
- isDraft: z.ZodDefault<z.ZodBoolean>;
107
- createdAt: z.ZodDefault<z.ZodString>;
108
- updatedAt: z.ZodDefault<z.ZodString>;
109
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
110
- id: z.ZodString;
111
- isDraft: z.ZodDefault<z.ZodBoolean>;
112
- createdAt: z.ZodDefault<z.ZodString>;
113
- updatedAt: z.ZodDefault<z.ZodString>;
114
- }, z.ZodTypeAny, "passthrough">>>;
34
+ createdAt: z.ZodDefault<z.ZodISODateTime>;
35
+ updatedAt: z.ZodDefault<z.ZodISODateTime>;
36
+ }, z.core.$loose>>;
115
37
  export declare const EditorialDataSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodObject<{
116
38
  id: z.ZodString;
117
39
  isDraft: z.ZodDefault<z.ZodBoolean>;
118
- createdAt: z.ZodDefault<z.ZodString>;
119
- updatedAt: z.ZodDefault<z.ZodString>;
120
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
121
- id: z.ZodString;
122
- isDraft: z.ZodDefault<z.ZodBoolean>;
123
- createdAt: z.ZodDefault<z.ZodString>;
124
- updatedAt: z.ZodDefault<z.ZodString>;
125
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
126
- id: z.ZodString;
127
- isDraft: z.ZodDefault<z.ZodBoolean>;
128
- createdAt: z.ZodDefault<z.ZodString>;
129
- updatedAt: z.ZodDefault<z.ZodString>;
130
- }, z.ZodTypeAny, "passthrough">>>>;
131
- export declare const EditorialSchemaItemFieldType: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
40
+ createdAt: z.ZodDefault<z.ZodISODateTime>;
41
+ updatedAt: z.ZodDefault<z.ZodISODateTime>;
42
+ }, z.core.$loose>>>;
43
+ export declare const EditorialSchemaItemFieldType: z.ZodEnum<{
44
+ string: "string";
45
+ number: "number";
46
+ boolean: "boolean";
47
+ url: "url";
48
+ date: "date";
49
+ datetime: "datetime";
50
+ markdown: "markdown";
51
+ color: "color";
52
+ select: "select";
53
+ }>;
132
54
  export declare const EditorialSchemaItemFieldSchema: z.ZodObject<{
133
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
134
- displayName: z.ZodString;
135
- displayExtra: z.ZodOptional<z.ZodString>;
136
- placeholder: z.ZodOptional<z.ZodString>;
137
- isRequired: z.ZodOptional<z.ZodBoolean>;
138
- showInSummary: z.ZodOptional<z.ZodBoolean>;
139
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
140
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
55
+ type: z.ZodEnum<{
56
+ string: "string";
57
+ number: "number";
58
+ boolean: "boolean";
59
+ url: "url";
60
+ date: "date";
61
+ datetime: "datetime";
62
+ markdown: "markdown";
63
+ color: "color";
64
+ select: "select";
65
+ }>;
141
66
  displayName: z.ZodString;
142
67
  displayExtra: z.ZodOptional<z.ZodString>;
143
68
  placeholder: z.ZodOptional<z.ZodString>;
144
- isRequired: z.ZodOptional<z.ZodBoolean>;
69
+ optional: z.ZodDefault<z.ZodBoolean>;
145
70
  showInSummary: z.ZodOptional<z.ZodBoolean>;
146
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
147
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
148
- displayName: z.ZodString;
149
- displayExtra: z.ZodOptional<z.ZodString>;
150
- placeholder: z.ZodOptional<z.ZodString>;
151
- isRequired: z.ZodOptional<z.ZodBoolean>;
152
- showInSummary: z.ZodOptional<z.ZodBoolean>;
153
- }, z.ZodTypeAny, "passthrough">>;
71
+ }, z.core.$loose>;
154
72
  export declare const EditorialSchemaItemSchema: z.ZodObject<{
155
73
  displayName: z.ZodString;
156
74
  singleton: z.ZodOptional<z.ZodBoolean>;
157
75
  fields: z.ZodRecord<z.ZodString, z.ZodObject<{
158
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
76
+ type: z.ZodEnum<{
77
+ string: "string";
78
+ number: "number";
79
+ boolean: "boolean";
80
+ url: "url";
81
+ date: "date";
82
+ datetime: "datetime";
83
+ markdown: "markdown";
84
+ color: "color";
85
+ select: "select";
86
+ }>;
159
87
  displayName: z.ZodString;
160
88
  displayExtra: z.ZodOptional<z.ZodString>;
161
89
  placeholder: z.ZodOptional<z.ZodString>;
162
- isRequired: z.ZodOptional<z.ZodBoolean>;
90
+ optional: z.ZodDefault<z.ZodBoolean>;
163
91
  showInSummary: z.ZodOptional<z.ZodBoolean>;
164
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
165
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
166
- displayName: z.ZodString;
167
- displayExtra: z.ZodOptional<z.ZodString>;
168
- placeholder: z.ZodOptional<z.ZodString>;
169
- isRequired: z.ZodOptional<z.ZodBoolean>;
170
- showInSummary: z.ZodOptional<z.ZodBoolean>;
171
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
172
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
173
- displayName: z.ZodString;
174
- displayExtra: z.ZodOptional<z.ZodString>;
175
- placeholder: z.ZodOptional<z.ZodString>;
176
- isRequired: z.ZodOptional<z.ZodBoolean>;
177
- showInSummary: z.ZodOptional<z.ZodBoolean>;
178
- }, z.ZodTypeAny, "passthrough">>>;
179
- }, "strip", z.ZodTypeAny, {
180
- displayName: string;
181
- fields: Record<string, z.objectOutputType<{
182
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
183
- displayName: z.ZodString;
184
- displayExtra: z.ZodOptional<z.ZodString>;
185
- placeholder: z.ZodOptional<z.ZodString>;
186
- isRequired: z.ZodOptional<z.ZodBoolean>;
187
- showInSummary: z.ZodOptional<z.ZodBoolean>;
188
- }, z.ZodTypeAny, "passthrough">>;
189
- singleton?: boolean | undefined;
190
- }, {
191
- displayName: string;
192
- fields: Record<string, z.objectInputType<{
193
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
194
- displayName: z.ZodString;
195
- displayExtra: z.ZodOptional<z.ZodString>;
196
- placeholder: z.ZodOptional<z.ZodString>;
197
- isRequired: z.ZodOptional<z.ZodBoolean>;
198
- showInSummary: z.ZodOptional<z.ZodBoolean>;
199
- }, z.ZodTypeAny, "passthrough">>;
200
- singleton?: boolean | undefined;
201
- }>;
92
+ }, z.core.$loose>>;
93
+ }, z.core.$strip>;
202
94
  export declare const EditorialSchemaSchema: z.ZodRecord<z.ZodString, z.ZodObject<{
203
95
  displayName: z.ZodString;
204
96
  singleton: z.ZodOptional<z.ZodBoolean>;
205
97
  fields: z.ZodRecord<z.ZodString, z.ZodObject<{
206
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
207
- displayName: z.ZodString;
208
- displayExtra: z.ZodOptional<z.ZodString>;
209
- placeholder: z.ZodOptional<z.ZodString>;
210
- isRequired: z.ZodOptional<z.ZodBoolean>;
211
- showInSummary: z.ZodOptional<z.ZodBoolean>;
212
- }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
213
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
214
- displayName: z.ZodString;
215
- displayExtra: z.ZodOptional<z.ZodString>;
216
- placeholder: z.ZodOptional<z.ZodString>;
217
- isRequired: z.ZodOptional<z.ZodBoolean>;
218
- showInSummary: z.ZodOptional<z.ZodBoolean>;
219
- }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
220
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
98
+ type: z.ZodEnum<{
99
+ string: "string";
100
+ number: "number";
101
+ boolean: "boolean";
102
+ url: "url";
103
+ date: "date";
104
+ datetime: "datetime";
105
+ markdown: "markdown";
106
+ color: "color";
107
+ select: "select";
108
+ }>;
221
109
  displayName: z.ZodString;
222
110
  displayExtra: z.ZodOptional<z.ZodString>;
223
111
  placeholder: z.ZodOptional<z.ZodString>;
224
- isRequired: z.ZodOptional<z.ZodBoolean>;
112
+ optional: z.ZodDefault<z.ZodBoolean>;
225
113
  showInSummary: z.ZodOptional<z.ZodBoolean>;
226
- }, z.ZodTypeAny, "passthrough">>>;
227
- }, "strip", z.ZodTypeAny, {
228
- displayName: string;
229
- fields: Record<string, z.objectOutputType<{
230
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
231
- displayName: z.ZodString;
232
- displayExtra: z.ZodOptional<z.ZodString>;
233
- placeholder: z.ZodOptional<z.ZodString>;
234
- isRequired: z.ZodOptional<z.ZodBoolean>;
235
- showInSummary: z.ZodOptional<z.ZodBoolean>;
236
- }, z.ZodTypeAny, "passthrough">>;
237
- singleton?: boolean | undefined;
238
- }, {
239
- displayName: string;
240
- fields: Record<string, z.objectInputType<{
241
- type: z.ZodEnum<["string", "boolean", "date", "datetime", "markdown", "number", "color", "select", "url"]>;
242
- displayName: z.ZodString;
243
- displayExtra: z.ZodOptional<z.ZodString>;
244
- placeholder: z.ZodOptional<z.ZodString>;
245
- isRequired: z.ZodOptional<z.ZodBoolean>;
246
- showInSummary: z.ZodOptional<z.ZodBoolean>;
247
- }, z.ZodTypeAny, "passthrough">>;
248
- singleton?: boolean | undefined;
249
- }>>;
114
+ }, z.core.$loose>>;
115
+ }, z.core.$strip>>;
250
116
  export declare const BaseEditorialFileSchema: z.ZodObject<{
251
117
  name: z.ZodString;
252
- type: z.ZodEnum<["file", "directory"]>;
118
+ type: z.ZodEnum<{
119
+ file: "file";
120
+ directory: "directory";
121
+ }>;
253
122
  path: z.ZodString;
254
123
  relativePath: z.ZodString;
255
124
  size: z.ZodNumber;
256
125
  isLarge: z.ZodOptional<z.ZodBoolean>;
257
- }, "strip", z.ZodTypeAny, {
258
- name: string;
259
- path: string;
260
- type: "file" | "directory";
261
- relativePath: string;
262
- size: number;
263
- isLarge?: boolean | undefined;
264
- }, {
265
- name: string;
266
- path: string;
267
- type: "file" | "directory";
268
- relativePath: string;
269
- size: number;
270
- isLarge?: boolean | undefined;
271
- }>;
126
+ }, z.core.$strip>;
272
127
  export type BaseEditorialFile = z.infer<typeof BaseEditorialFileSchema> & {
273
128
  children?: BaseEditorialFile[];
274
129
  };
275
130
  export declare const EditorialFileSchema: z.ZodType<BaseEditorialFile>;
276
131
  export declare const EditorialFilesResponseSchema: z.ZodObject<{
277
- files: z.ZodArray<z.ZodType<BaseEditorialFile, z.ZodTypeDef, BaseEditorialFile>, "many">;
132
+ files: z.ZodArray<z.ZodType<BaseEditorialFile, unknown, z.core.$ZodTypeInternals<BaseEditorialFile, unknown>>>;
278
133
  totalSize: z.ZodNumber;
279
- }, "strip", z.ZodTypeAny, {
280
- files: BaseEditorialFile[];
281
- totalSize: number;
282
- }, {
283
- files: BaseEditorialFile[];
284
- totalSize: number;
285
- }>;
286
- export declare const EditorialFilesSchema: z.ZodArray<z.ZodType<BaseEditorialFile, z.ZodTypeDef, BaseEditorialFile>, "many">;
134
+ }, z.core.$strip>;
135
+ export declare const EditorialFilesSchema: z.ZodArray<z.ZodType<BaseEditorialFile, unknown, z.core.$ZodTypeInternals<BaseEditorialFile, unknown>>>;
287
136
  export type EditorialFile = z.infer<typeof EditorialFileSchema>;
288
137
  export type EditorialFiles = z.infer<typeof EditorialFilesSchema>;
289
138
  export type EditorialFilesResponse = z.infer<typeof EditorialFilesResponseSchema>;
package/dist/schemas.js CHANGED
@@ -4,11 +4,11 @@ exports.EditorialFilesSchema = exports.EditorialFilesResponseSchema = exports.Ed
4
4
  const zod_openapi_1 = require("@hono/zod-openapi");
5
5
  exports.EditorialConfigSchema = zod_openapi_1.z.object({
6
6
  name: zod_openapi_1.z.string(),
7
- publicUrl: zod_openapi_1.z.string().url(),
7
+ publicUrl: zod_openapi_1.z.url(),
8
8
  publicDir: zod_openapi_1.z.string().default("public/files"),
9
9
  publicDeletedDir: zod_openapi_1.z.string().default("public/files/.deleted"),
10
- filesUrl: zod_openapi_1.z.string().url(),
11
- largeFilesUrl: zod_openapi_1.z.string().url(),
10
+ filesUrl: zod_openapi_1.z.url(),
11
+ largeFilesUrl: zod_openapi_1.z.url(),
12
12
  previewUrl: zod_openapi_1.z.string().optional(),
13
13
  silent: zod_openapi_1.z.boolean().optional(),
14
14
  firebase: zod_openapi_1.z
@@ -23,26 +23,16 @@ exports.EditorialConfigSchema = zod_openapi_1.z.object({
23
23
  })
24
24
  .optional(),
25
25
  });
26
- exports.EditorialDataObjectWithTypeSchema = zod_openapi_1.z
27
- .object({
26
+ exports.EditorialDataObjectWithTypeSchema = zod_openapi_1.z.looseObject({
28
27
  id: zod_openapi_1.z.string(),
29
28
  type: zod_openapi_1.z.string(),
30
- })
31
- .passthrough();
32
- exports.EditorialDataItemSchema = zod_openapi_1.z
33
- .object({
29
+ });
30
+ exports.EditorialDataItemSchema = zod_openapi_1.z.looseObject({
34
31
  id: zod_openapi_1.z.string(),
35
32
  isDraft: zod_openapi_1.z.boolean().default(false),
36
- createdAt: zod_openapi_1.z
37
- .string()
38
- .datetime()
39
- .default(() => new Date().toISOString()),
40
- updatedAt: zod_openapi_1.z
41
- .string()
42
- .datetime()
43
- .default(() => new Date().toISOString()),
44
- })
45
- .passthrough();
33
+ createdAt: zod_openapi_1.z.iso.datetime().default(() => new Date().toISOString()),
34
+ updatedAt: zod_openapi_1.z.iso.datetime().default(() => new Date().toISOString()),
35
+ });
46
36
  exports.EditorialDataTypeSchema = zod_openapi_1.z.record(zod_openapi_1.z.string(), exports.EditorialDataItemSchema);
47
37
  exports.EditorialDataSchema = zod_openapi_1.z.record(zod_openapi_1.z.string(), exports.EditorialDataTypeSchema);
48
38
  exports.EditorialSchemaItemFieldType = zod_openapi_1.z.enum([
@@ -56,16 +46,14 @@ exports.EditorialSchemaItemFieldType = zod_openapi_1.z.enum([
56
46
  "select",
57
47
  "url",
58
48
  ]);
59
- exports.EditorialSchemaItemFieldSchema = zod_openapi_1.z
60
- .object({
49
+ exports.EditorialSchemaItemFieldSchema = zod_openapi_1.z.looseObject({
61
50
  type: exports.EditorialSchemaItemFieldType,
62
51
  displayName: zod_openapi_1.z.string(),
63
52
  displayExtra: zod_openapi_1.z.string().optional(),
64
53
  placeholder: zod_openapi_1.z.string().optional(),
65
- isRequired: zod_openapi_1.z.boolean().optional(),
54
+ optional: zod_openapi_1.z.boolean().default(false),
66
55
  showInSummary: zod_openapi_1.z.boolean().optional(),
67
- })
68
- .passthrough();
56
+ });
69
57
  exports.EditorialSchemaItemSchema = zod_openapi_1.z.object({
70
58
  displayName: zod_openapi_1.z.string(),
71
59
  singleton: zod_openapi_1.z.boolean().optional(),
package/dist/types.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { z } from "zod";
1
+ import type { z } from "@hono/zod-openapi";
2
2
  import type { EditorialConfigSchema, EditorialDataItemSchema, EditorialDataObjectWithTypeSchema, EditorialDataSchema, EditorialDataTypeSchema, EditorialSchemaItemFieldSchema, EditorialSchemaItemSchema, EditorialSchemaSchema } from "./schemas.js";
3
3
  export interface LargeFileHandler {
4
4
  list: () => Promise<object[]>;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@isardsat/editorial-common",
3
- "version": "6.7.0",
3
+ "version": "6.8.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
7
- "@hono/zod-openapi": "^0.18.4",
8
- "zod": "^3.24.1"
7
+ "@hono/zod-openapi": "^1.1.3",
8
+ "zod": "^4.1.11"
9
9
  },
10
10
  "devDependencies": {
11
11
  "@tsconfig/node22": "^22.0.0",
package/src/schemas.ts CHANGED
@@ -2,11 +2,11 @@ import { z } from "@hono/zod-openapi";
2
2
 
3
3
  export const EditorialConfigSchema = z.object({
4
4
  name: z.string(),
5
- publicUrl: z.string().url(),
5
+ publicUrl: z.url(),
6
6
  publicDir: z.string().default("public/files"),
7
7
  publicDeletedDir: z.string().default("public/files/.deleted"),
8
- filesUrl: z.string().url(),
9
- largeFilesUrl: z.string().url(),
8
+ filesUrl: z.url(),
9
+ largeFilesUrl: z.url(),
10
10
  previewUrl: z.string().optional(),
11
11
  silent: z.boolean().optional(),
12
12
  firebase: z
@@ -22,27 +22,17 @@ export const EditorialConfigSchema = z.object({
22
22
  .optional(),
23
23
  });
24
24
 
25
- export const EditorialDataObjectWithTypeSchema = z
26
- .object({
27
- id: z.string(),
28
- type: z.string(),
29
- })
30
- .passthrough();
25
+ export const EditorialDataObjectWithTypeSchema = z.looseObject({
26
+ id: z.string(),
27
+ type: z.string(),
28
+ });
31
29
 
32
- export const EditorialDataItemSchema = z
33
- .object({
34
- id: z.string(),
35
- isDraft: z.boolean().default(false),
36
- createdAt: z
37
- .string()
38
- .datetime()
39
- .default(() => new Date().toISOString()),
40
- updatedAt: z
41
- .string()
42
- .datetime()
43
- .default(() => new Date().toISOString()),
44
- })
45
- .passthrough();
30
+ export const EditorialDataItemSchema = z.looseObject({
31
+ id: z.string(),
32
+ isDraft: z.boolean().default(false),
33
+ createdAt: z.iso.datetime().default(() => new Date().toISOString()),
34
+ updatedAt: z.iso.datetime().default(() => new Date().toISOString()),
35
+ });
46
36
 
47
37
  export const EditorialDataTypeSchema = z.record(
48
38
  z.string(),
@@ -66,16 +56,14 @@ export const EditorialSchemaItemFieldType = z.enum([
66
56
  "url",
67
57
  ]);
68
58
 
69
- export const EditorialSchemaItemFieldSchema = z
70
- .object({
71
- type: EditorialSchemaItemFieldType,
72
- displayName: z.string(),
73
- displayExtra: z.string().optional(),
74
- placeholder: z.string().optional(),
75
- isRequired: z.boolean().optional(),
76
- showInSummary: z.boolean().optional(),
77
- })
78
- .passthrough();
59
+ export const EditorialSchemaItemFieldSchema = z.looseObject({
60
+ type: EditorialSchemaItemFieldType,
61
+ displayName: z.string(),
62
+ displayExtra: z.string().optional(),
63
+ placeholder: z.string().optional(),
64
+ optional: z.boolean().default(false),
65
+ showInSummary: z.boolean().optional(),
66
+ });
79
67
 
80
68
  export const EditorialSchemaItemSchema = z.object({
81
69
  displayName: z.string(),
package/src/types.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { z } from "zod";
1
+ import type { z } from "@hono/zod-openapi";
2
2
  import type {
3
3
  EditorialConfigSchema,
4
4
  EditorialDataItemSchema,