@columnus/shared 0.1.54 → 0.1.56
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/dist/apiProfile.d.ts +39 -0
- package/dist/apiProfile.js +19 -2
- package/dist/apiProfile.js.map +1 -1
- package/dist/assetFamily.d.ts +36 -0
- package/dist/assetFamily.js +73 -0
- package/dist/assetFamily.js.map +1 -0
- package/dist/assetFieldValues.d.ts +21 -0
- package/dist/{storageFieldValues.js → assetFieldValues.js} +159 -60
- package/dist/assetFieldValues.js.map +1 -0
- package/dist/assetGraph.d.ts +199 -0
- package/dist/assetGraph.js +214 -0
- package/dist/assetGraph.js.map +1 -0
- package/dist/assetJobs.d.ts +95 -0
- package/dist/assetJobs.js +41 -0
- package/dist/assetJobs.js.map +1 -0
- package/dist/assetSettings.d.ts +129 -0
- package/dist/assetSettings.js +87 -0
- package/dist/assetSettings.js.map +1 -0
- package/dist/assetValidators.d.ts +475 -0
- package/dist/assetValidators.js +83 -0
- package/dist/assetValidators.js.map +1 -0
- package/dist/bffProtocol.d.ts +29 -24
- package/dist/bffProtocol.js +5 -1
- package/dist/bffProtocol.js.map +1 -1
- package/dist/ciPreviewEnv.js +20 -3
- package/dist/ciPreviewEnv.js.map +1 -1
- package/dist/clipboardTransfer.js +112 -12
- package/dist/clipboardTransfer.js.map +1 -1
- package/dist/csv.js +118 -18
- package/dist/csv.js.map +1 -1
- package/dist/displayLabel.js +1 -1
- package/dist/displayLabel.js.map +1 -1
- package/dist/dotenv.js +5 -1
- package/dist/dotenv.js.map +1 -1
- package/dist/importMatch.js +118 -18
- package/dist/importMatch.js.map +1 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +741 -82
- package/dist/index.js.map +1 -1
- package/dist/postLoginPath.d.ts +21 -0
- package/dist/postLoginPath.js +24 -0
- package/dist/postLoginPath.js.map +1 -0
- package/dist/previewDeployName.d.ts +0 -7
- package/dist/previewDeployName.js +21 -4
- package/dist/previewDeployName.js.map +1 -1
- package/dist/recordTableColumns.js +112 -12
- package/dist/recordTableColumns.js.map +1 -1
- package/dist/recordTablePreload.js.map +1 -1
- package/dist/refDisplayRequests.js +112 -12
- package/dist/refDisplayRequests.js.map +1 -1
- package/dist/richDoc.d.ts +2 -2
- package/dist/richDoc.js +5 -5
- package/dist/richDoc.js.map +1 -1
- package/dist/schemaGenerator.d.ts +25 -1
- package/dist/schemaGenerator.js +4569 -18
- package/dist/schemaGenerator.js.map +1 -1
- package/dist/schemaShrink.d.ts +3 -1
- package/dist/schemaShrink.js +4451 -1
- package/dist/schemaShrink.js.map +1 -1
- package/dist/schemaShrinkValidators.d.ts +2 -2
- package/dist/schemaTypes.d.ts +123 -0
- package/dist/schemaTypes.js +107 -13
- package/dist/schemaTypes.js.map +1 -1
- package/dist/share.js +6 -1
- package/dist/share.js.map +1 -1
- package/dist/shareApiBridge.js +6 -1
- package/dist/shareApiBridge.js.map +1 -1
- package/dist/shareProposal.js +112 -12
- package/dist/shareProposal.js.map +1 -1
- package/dist/spaceBundle.js +112 -12
- package/dist/spaceBundle.js.map +1 -1
- package/dist/syncChannel.d.ts +15 -0
- package/dist/syncChannel.js +4642 -0
- package/dist/syncChannel.js.map +1 -0
- package/package.json +1 -1
- package/dist/storageFieldValues.d.ts +0 -10
- package/dist/storageFieldValues.js.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
/** Shared Convex validator for paginated schema-shrink cleanup state. */
|
|
2
2
|
export declare const cleanupStateValidator: import("convex/values").VObject<{
|
|
3
|
+
cursor: string | null;
|
|
3
4
|
desiredManifestHash: string;
|
|
4
5
|
targetManifestJson: string;
|
|
5
6
|
beforeManifestJson: string;
|
|
@@ -13,7 +14,6 @@ export declare const cleanupStateValidator: import("convex/values").VObject<{
|
|
|
13
14
|
fieldType: any;
|
|
14
15
|
})[];
|
|
15
16
|
taskIndex: number;
|
|
16
|
-
cursor: string | null;
|
|
17
17
|
stats: {
|
|
18
18
|
rowsDeleted: number;
|
|
19
19
|
fieldsStripped: number;
|
|
@@ -69,4 +69,4 @@ export declare const cleanupStateValidator: import("convex/values").VObject<{
|
|
|
69
69
|
}, "required", "rowsDeleted" | "fieldsStripped" | "storageDeleted">;
|
|
70
70
|
bffOperationId: import("convex/values").VString<string, "required">;
|
|
71
71
|
desiredManifestHash: import("convex/values").VString<string, "required">;
|
|
72
|
-
}, "required", "desiredManifestHash" | "targetManifestJson" | "beforeManifestJson" | "tasks" | "taskIndex" | "
|
|
72
|
+
}, "required", "cursor" | "desiredManifestHash" | "targetManifestJson" | "beforeManifestJson" | "tasks" | "taskIndex" | "stats" | "bffOperationId" | "stats.rowsDeleted" | "stats.fieldsStripped" | "stats.storageDeleted">;
|
package/dist/schemaTypes.d.ts
CHANGED
|
@@ -18,22 +18,55 @@ export declare const displayTemplatesSchema: z.ZodObject<{
|
|
|
18
18
|
export declare const TABLE_COLORS: readonly ["brown", "muted-red", "red", "coral", "orange", "amber", "yellow", "gold", "blue", "light-blue", "cyan", "mint", "green", "dark-green", "lime", "light-green", "charcoal", "gray", "mauve", "pink", "purple", "deep-purple", "periwinkle", "lavender"];
|
|
19
19
|
export type TableColor = (typeof TABLE_COLORS)[number];
|
|
20
20
|
export declare const tableColorSchema: z.ZodEnum<["brown", "muted-red", "red", "coral", "orange", "amber", "yellow", "gold", "blue", "light-blue", "cyan", "mint", "green", "dark-green", "lime", "light-green", "charcoal", "gray", "mauve", "pink", "purple", "deep-purple", "periwinkle", "lavender"]>;
|
|
21
|
+
export declare const TABLE_KINDS: readonly ["record", "asset"];
|
|
22
|
+
export type TableKind = (typeof TABLE_KINDS)[number];
|
|
23
|
+
export declare const tableKindSchema: z.ZodEnum<["record", "asset"]>;
|
|
24
|
+
/** Image/file fields may pin a Media profile; existence is enforced at upload/pick. */
|
|
25
|
+
export declare const assetBindingSchema: z.ZodObject<{
|
|
26
|
+
profile: z.ZodString;
|
|
27
|
+
enforced: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
}, "strip", z.ZodTypeAny, {
|
|
29
|
+
profile: string;
|
|
30
|
+
enforced?: boolean | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
profile: string;
|
|
33
|
+
enforced?: boolean | undefined;
|
|
34
|
+
}>;
|
|
21
35
|
export declare const fieldTypeSchema: z.ZodType<FieldType>;
|
|
22
36
|
export declare const fieldSchema: z.ZodObject<{
|
|
23
37
|
name: z.ZodString;
|
|
24
38
|
label: z.ZodOptional<z.ZodString>;
|
|
25
39
|
type: z.ZodType<FieldType, z.ZodTypeDef, FieldType>;
|
|
26
40
|
optional: z.ZodBoolean;
|
|
41
|
+
/** Image/file fields may pin a Media profile; existence is enforced at upload/pick. */
|
|
42
|
+
asset: z.ZodOptional<z.ZodObject<{
|
|
43
|
+
profile: z.ZodString;
|
|
44
|
+
enforced: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
profile: string;
|
|
47
|
+
enforced?: boolean | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
profile: string;
|
|
50
|
+
enforced?: boolean | undefined;
|
|
51
|
+
}>>;
|
|
27
52
|
}, "strip", z.ZodTypeAny, {
|
|
28
53
|
type: FieldType;
|
|
29
54
|
name: string;
|
|
30
55
|
optional: boolean;
|
|
31
56
|
label?: string | undefined;
|
|
57
|
+
asset?: {
|
|
58
|
+
profile: string;
|
|
59
|
+
enforced?: boolean | undefined;
|
|
60
|
+
} | undefined;
|
|
32
61
|
}, {
|
|
33
62
|
type: FieldType;
|
|
34
63
|
name: string;
|
|
35
64
|
optional: boolean;
|
|
36
65
|
label?: string | undefined;
|
|
66
|
+
asset?: {
|
|
67
|
+
profile: string;
|
|
68
|
+
enforced?: boolean | undefined;
|
|
69
|
+
} | undefined;
|
|
37
70
|
}>;
|
|
38
71
|
export declare const indexSchema: z.ZodObject<{
|
|
39
72
|
name: z.ZodString;
|
|
@@ -62,21 +95,42 @@ export declare const tableSchema: z.ZodObject<{
|
|
|
62
95
|
name: z.ZodEffects<z.ZodString, string, string>;
|
|
63
96
|
label: z.ZodOptional<z.ZodString>;
|
|
64
97
|
color: z.ZodOptional<z.ZodEnum<["brown", "muted-red", "red", "coral", "orange", "amber", "yellow", "gold", "blue", "light-blue", "cyan", "mint", "green", "dark-green", "lime", "light-green", "charcoal", "gray", "mauve", "pink", "purple", "deep-purple", "periwinkle", "lavender"]>>;
|
|
98
|
+
/** Asset metadata tables are typed root tables but never ordinary user records. */
|
|
99
|
+
kind: z.ZodDefault<z.ZodOptional<z.ZodEnum<["record", "asset"]>>>;
|
|
65
100
|
fields: z.ZodArray<z.ZodObject<{
|
|
66
101
|
name: z.ZodString;
|
|
67
102
|
label: z.ZodOptional<z.ZodString>;
|
|
68
103
|
type: z.ZodType<FieldType, z.ZodTypeDef, FieldType>;
|
|
69
104
|
optional: z.ZodBoolean;
|
|
105
|
+
/** Image/file fields may pin a Media profile; existence is enforced at upload/pick. */
|
|
106
|
+
asset: z.ZodOptional<z.ZodObject<{
|
|
107
|
+
profile: z.ZodString;
|
|
108
|
+
enforced: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
profile: string;
|
|
111
|
+
enforced?: boolean | undefined;
|
|
112
|
+
}, {
|
|
113
|
+
profile: string;
|
|
114
|
+
enforced?: boolean | undefined;
|
|
115
|
+
}>>;
|
|
70
116
|
}, "strip", z.ZodTypeAny, {
|
|
71
117
|
type: FieldType;
|
|
72
118
|
name: string;
|
|
73
119
|
optional: boolean;
|
|
74
120
|
label?: string | undefined;
|
|
121
|
+
asset?: {
|
|
122
|
+
profile: string;
|
|
123
|
+
enforced?: boolean | undefined;
|
|
124
|
+
} | undefined;
|
|
75
125
|
}, {
|
|
76
126
|
type: FieldType;
|
|
77
127
|
name: string;
|
|
78
128
|
optional: boolean;
|
|
79
129
|
label?: string | undefined;
|
|
130
|
+
asset?: {
|
|
131
|
+
profile: string;
|
|
132
|
+
enforced?: boolean | undefined;
|
|
133
|
+
} | undefined;
|
|
80
134
|
}>, "many">;
|
|
81
135
|
indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
82
136
|
name: z.ZodString;
|
|
@@ -118,6 +172,10 @@ export declare const tableSchema: z.ZodObject<{
|
|
|
118
172
|
name: string;
|
|
119
173
|
optional: boolean;
|
|
120
174
|
label?: string | undefined;
|
|
175
|
+
asset?: {
|
|
176
|
+
profile: string;
|
|
177
|
+
enforced?: boolean | undefined;
|
|
178
|
+
} | undefined;
|
|
121
179
|
}[];
|
|
122
180
|
indexes: {
|
|
123
181
|
name: string;
|
|
@@ -128,6 +186,7 @@ export declare const tableSchema: z.ZodObject<{
|
|
|
128
186
|
searchField: string;
|
|
129
187
|
filterFields?: string[] | undefined;
|
|
130
188
|
}[];
|
|
189
|
+
kind: "record" | "asset";
|
|
131
190
|
label?: string | undefined;
|
|
132
191
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
133
192
|
displayTemplates?: {
|
|
@@ -141,6 +200,10 @@ export declare const tableSchema: z.ZodObject<{
|
|
|
141
200
|
name: string;
|
|
142
201
|
optional: boolean;
|
|
143
202
|
label?: string | undefined;
|
|
203
|
+
asset?: {
|
|
204
|
+
profile: string;
|
|
205
|
+
enforced?: boolean | undefined;
|
|
206
|
+
} | undefined;
|
|
144
207
|
}[];
|
|
145
208
|
indexes?: {
|
|
146
209
|
name: string;
|
|
@@ -153,6 +216,7 @@ export declare const tableSchema: z.ZodObject<{
|
|
|
153
216
|
}[] | undefined;
|
|
154
217
|
label?: string | undefined;
|
|
155
218
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
219
|
+
kind?: "record" | "asset" | undefined;
|
|
156
220
|
displayTemplates?: {
|
|
157
221
|
id?: string | undefined;
|
|
158
222
|
preview?: string | undefined;
|
|
@@ -163,21 +227,42 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
163
227
|
name: z.ZodEffects<z.ZodString, string, string>;
|
|
164
228
|
label: z.ZodOptional<z.ZodString>;
|
|
165
229
|
color: z.ZodOptional<z.ZodEnum<["brown", "muted-red", "red", "coral", "orange", "amber", "yellow", "gold", "blue", "light-blue", "cyan", "mint", "green", "dark-green", "lime", "light-green", "charcoal", "gray", "mauve", "pink", "purple", "deep-purple", "periwinkle", "lavender"]>>;
|
|
230
|
+
/** Asset metadata tables are typed root tables but never ordinary user records. */
|
|
231
|
+
kind: z.ZodDefault<z.ZodOptional<z.ZodEnum<["record", "asset"]>>>;
|
|
166
232
|
fields: z.ZodArray<z.ZodObject<{
|
|
167
233
|
name: z.ZodString;
|
|
168
234
|
label: z.ZodOptional<z.ZodString>;
|
|
169
235
|
type: z.ZodType<FieldType, z.ZodTypeDef, FieldType>;
|
|
170
236
|
optional: z.ZodBoolean;
|
|
237
|
+
/** Image/file fields may pin a Media profile; existence is enforced at upload/pick. */
|
|
238
|
+
asset: z.ZodOptional<z.ZodObject<{
|
|
239
|
+
profile: z.ZodString;
|
|
240
|
+
enforced: z.ZodOptional<z.ZodBoolean>;
|
|
241
|
+
}, "strip", z.ZodTypeAny, {
|
|
242
|
+
profile: string;
|
|
243
|
+
enforced?: boolean | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
profile: string;
|
|
246
|
+
enforced?: boolean | undefined;
|
|
247
|
+
}>>;
|
|
171
248
|
}, "strip", z.ZodTypeAny, {
|
|
172
249
|
type: FieldType;
|
|
173
250
|
name: string;
|
|
174
251
|
optional: boolean;
|
|
175
252
|
label?: string | undefined;
|
|
253
|
+
asset?: {
|
|
254
|
+
profile: string;
|
|
255
|
+
enforced?: boolean | undefined;
|
|
256
|
+
} | undefined;
|
|
176
257
|
}, {
|
|
177
258
|
type: FieldType;
|
|
178
259
|
name: string;
|
|
179
260
|
optional: boolean;
|
|
180
261
|
label?: string | undefined;
|
|
262
|
+
asset?: {
|
|
263
|
+
profile: string;
|
|
264
|
+
enforced?: boolean | undefined;
|
|
265
|
+
} | undefined;
|
|
181
266
|
}>, "many">;
|
|
182
267
|
indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
183
268
|
name: z.ZodString;
|
|
@@ -219,6 +304,10 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
219
304
|
name: string;
|
|
220
305
|
optional: boolean;
|
|
221
306
|
label?: string | undefined;
|
|
307
|
+
asset?: {
|
|
308
|
+
profile: string;
|
|
309
|
+
enforced?: boolean | undefined;
|
|
310
|
+
} | undefined;
|
|
222
311
|
}[];
|
|
223
312
|
indexes: {
|
|
224
313
|
name: string;
|
|
@@ -229,6 +318,7 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
229
318
|
searchField: string;
|
|
230
319
|
filterFields?: string[] | undefined;
|
|
231
320
|
}[];
|
|
321
|
+
kind: "record" | "asset";
|
|
232
322
|
label?: string | undefined;
|
|
233
323
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
234
324
|
displayTemplates?: {
|
|
@@ -242,6 +332,10 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
242
332
|
name: string;
|
|
243
333
|
optional: boolean;
|
|
244
334
|
label?: string | undefined;
|
|
335
|
+
asset?: {
|
|
336
|
+
profile: string;
|
|
337
|
+
enforced?: boolean | undefined;
|
|
338
|
+
} | undefined;
|
|
245
339
|
}[];
|
|
246
340
|
indexes?: {
|
|
247
341
|
name: string;
|
|
@@ -254,6 +348,7 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
254
348
|
}[] | undefined;
|
|
255
349
|
label?: string | undefined;
|
|
256
350
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
351
|
+
kind?: "record" | "asset" | undefined;
|
|
257
352
|
displayTemplates?: {
|
|
258
353
|
id?: string | undefined;
|
|
259
354
|
preview?: string | undefined;
|
|
@@ -267,6 +362,10 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
267
362
|
name: string;
|
|
268
363
|
optional: boolean;
|
|
269
364
|
label?: string | undefined;
|
|
365
|
+
asset?: {
|
|
366
|
+
profile: string;
|
|
367
|
+
enforced?: boolean | undefined;
|
|
368
|
+
} | undefined;
|
|
270
369
|
}[];
|
|
271
370
|
indexes: {
|
|
272
371
|
name: string;
|
|
@@ -277,6 +376,7 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
277
376
|
searchField: string;
|
|
278
377
|
filterFields?: string[] | undefined;
|
|
279
378
|
}[];
|
|
379
|
+
kind: "record" | "asset";
|
|
280
380
|
label?: string | undefined;
|
|
281
381
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
282
382
|
displayTemplates?: {
|
|
@@ -292,6 +392,10 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
292
392
|
name: string;
|
|
293
393
|
optional: boolean;
|
|
294
394
|
label?: string | undefined;
|
|
395
|
+
asset?: {
|
|
396
|
+
profile: string;
|
|
397
|
+
enforced?: boolean | undefined;
|
|
398
|
+
} | undefined;
|
|
295
399
|
}[];
|
|
296
400
|
indexes?: {
|
|
297
401
|
name: string;
|
|
@@ -304,6 +408,7 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
304
408
|
}[] | undefined;
|
|
305
409
|
label?: string | undefined;
|
|
306
410
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
411
|
+
kind?: "record" | "asset" | undefined;
|
|
307
412
|
displayTemplates?: {
|
|
308
413
|
id?: string | undefined;
|
|
309
414
|
preview?: string | undefined;
|
|
@@ -317,6 +422,10 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
317
422
|
name: string;
|
|
318
423
|
optional: boolean;
|
|
319
424
|
label?: string | undefined;
|
|
425
|
+
asset?: {
|
|
426
|
+
profile: string;
|
|
427
|
+
enforced?: boolean | undefined;
|
|
428
|
+
} | undefined;
|
|
320
429
|
}[];
|
|
321
430
|
indexes: {
|
|
322
431
|
name: string;
|
|
@@ -327,6 +436,7 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
327
436
|
searchField: string;
|
|
328
437
|
filterFields?: string[] | undefined;
|
|
329
438
|
}[];
|
|
439
|
+
kind: "record" | "asset";
|
|
330
440
|
label?: string | undefined;
|
|
331
441
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
332
442
|
displayTemplates?: {
|
|
@@ -342,6 +452,10 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
342
452
|
name: string;
|
|
343
453
|
optional: boolean;
|
|
344
454
|
label?: string | undefined;
|
|
455
|
+
asset?: {
|
|
456
|
+
profile: string;
|
|
457
|
+
enforced?: boolean | undefined;
|
|
458
|
+
} | undefined;
|
|
345
459
|
}[];
|
|
346
460
|
indexes?: {
|
|
347
461
|
name: string;
|
|
@@ -354,6 +468,7 @@ export declare const manifestSchema: z.ZodEffects<z.ZodObject<{
|
|
|
354
468
|
}[] | undefined;
|
|
355
469
|
label?: string | undefined;
|
|
356
470
|
color?: "brown" | "muted-red" | "red" | "coral" | "orange" | "amber" | "yellow" | "gold" | "blue" | "light-blue" | "cyan" | "mint" | "green" | "dark-green" | "lime" | "light-green" | "charcoal" | "gray" | "mauve" | "pink" | "purple" | "deep-purple" | "periwinkle" | "lavender" | undefined;
|
|
471
|
+
kind?: "record" | "asset" | undefined;
|
|
357
472
|
displayTemplates?: {
|
|
358
473
|
id?: string | undefined;
|
|
359
474
|
preview?: string | undefined;
|
|
@@ -405,6 +520,10 @@ export type Field = {
|
|
|
405
520
|
label?: string;
|
|
406
521
|
type: FieldType;
|
|
407
522
|
optional: boolean;
|
|
523
|
+
asset?: {
|
|
524
|
+
profile: string;
|
|
525
|
+
enforced?: boolean;
|
|
526
|
+
};
|
|
408
527
|
};
|
|
409
528
|
export type Index = {
|
|
410
529
|
name: string;
|
|
@@ -424,6 +543,8 @@ export type Table = {
|
|
|
424
543
|
name: string;
|
|
425
544
|
label?: string;
|
|
426
545
|
color?: TableColor;
|
|
546
|
+
/** Omitted manifests retain the original ordinary-record behavior. */
|
|
547
|
+
kind?: TableKind;
|
|
427
548
|
fields: Field[];
|
|
428
549
|
indexes: Index[];
|
|
429
550
|
searchIndexes: SearchIndex[];
|
|
@@ -433,6 +554,8 @@ export type Manifest = {
|
|
|
433
554
|
tables: Table[];
|
|
434
555
|
};
|
|
435
556
|
export declare const EMPTY_MANIFEST: Manifest;
|
|
557
|
+
export declare function tableKind(table: Pick<Table, "kind">): TableKind;
|
|
558
|
+
export declare function isAssetTable(table: Pick<Table, "kind">): boolean;
|
|
436
559
|
export declare function tableDisplayName(t: Table): string;
|
|
437
560
|
export declare function fieldDisplayName(f: Field): string;
|
|
438
561
|
export declare function isSystemField(key: string): boolean;
|
package/dist/schemaTypes.js
CHANGED
|
@@ -4212,7 +4212,13 @@ var RESERVED_TABLE_NAMES = /* @__PURE__ */ new Set([
|
|
|
4212
4212
|
"columnus_api_output_secrets",
|
|
4213
4213
|
"columnus_api_sync_routes",
|
|
4214
4214
|
"columnus_api_outbox",
|
|
4215
|
-
"columnus_api_delivery"
|
|
4215
|
+
"columnus_api_delivery",
|
|
4216
|
+
"columnus_assets",
|
|
4217
|
+
"columnus_asset_versions",
|
|
4218
|
+
"columnus_asset_refs",
|
|
4219
|
+
"columnus_asset_profiles",
|
|
4220
|
+
"columnus_asset_settings",
|
|
4221
|
+
"columnus_asset_jobs"
|
|
4216
4222
|
]);
|
|
4217
4223
|
var displayTemplatesSchema = external_exports.object({
|
|
4218
4224
|
id: external_exports.string().optional(),
|
|
@@ -4245,6 +4251,12 @@ var TABLE_COLORS = [
|
|
|
4245
4251
|
"lavender"
|
|
4246
4252
|
];
|
|
4247
4253
|
var tableColorSchema = external_exports.enum(TABLE_COLORS);
|
|
4254
|
+
var TABLE_KINDS = ["record", "asset"];
|
|
4255
|
+
var tableKindSchema = external_exports.enum(TABLE_KINDS);
|
|
4256
|
+
var assetBindingSchema = external_exports.object({
|
|
4257
|
+
profile: external_exports.string().min(1),
|
|
4258
|
+
enforced: external_exports.boolean().optional()
|
|
4259
|
+
});
|
|
4248
4260
|
var fieldTypeSchema = external_exports.lazy(
|
|
4249
4261
|
() => external_exports.discriminatedUnion("kind", [
|
|
4250
4262
|
external_exports.object({ kind: external_exports.literal("string") }),
|
|
@@ -4272,7 +4284,9 @@ var fieldTypeSchema = external_exports.lazy(
|
|
|
4272
4284
|
name: external_exports.string().regex(IDENT),
|
|
4273
4285
|
label: external_exports.string().optional(),
|
|
4274
4286
|
type: fieldTypeSchema,
|
|
4275
|
-
optional: external_exports.boolean()
|
|
4287
|
+
optional: external_exports.boolean(),
|
|
4288
|
+
/** Nested image/file placements bind a Media profile like top-level ones. */
|
|
4289
|
+
asset: assetBindingSchema.optional()
|
|
4276
4290
|
})
|
|
4277
4291
|
)
|
|
4278
4292
|
}),
|
|
@@ -4286,7 +4300,9 @@ var fieldSchema = external_exports.object({
|
|
|
4286
4300
|
name: external_exports.string().regex(IDENT, "must be a valid identifier"),
|
|
4287
4301
|
label: external_exports.string().optional(),
|
|
4288
4302
|
type: fieldTypeSchema,
|
|
4289
|
-
optional: external_exports.boolean()
|
|
4303
|
+
optional: external_exports.boolean(),
|
|
4304
|
+
/** Image/file fields may pin a Media profile; existence is enforced at upload/pick. */
|
|
4305
|
+
asset: assetBindingSchema.optional()
|
|
4290
4306
|
});
|
|
4291
4307
|
var indexSchema = external_exports.object({
|
|
4292
4308
|
name: external_exports.string().regex(IDENT),
|
|
@@ -4303,6 +4319,8 @@ var tableSchema = external_exports.object({
|
|
|
4303
4319
|
}),
|
|
4304
4320
|
label: external_exports.string().optional(),
|
|
4305
4321
|
color: tableColorSchema.optional(),
|
|
4322
|
+
/** Asset metadata tables are typed root tables but never ordinary user records. */
|
|
4323
|
+
kind: tableKindSchema.optional().default("record"),
|
|
4306
4324
|
fields: external_exports.array(fieldSchema),
|
|
4307
4325
|
indexes: external_exports.array(indexSchema).default([]),
|
|
4308
4326
|
searchIndexes: external_exports.array(searchIndexSchema).default([]),
|
|
@@ -4312,6 +4330,7 @@ var manifestSchema = external_exports.object({
|
|
|
4312
4330
|
tables: external_exports.array(tableSchema)
|
|
4313
4331
|
}).superRefine((manifest, ctx) => {
|
|
4314
4332
|
const tableNames = /* @__PURE__ */ new Set();
|
|
4333
|
+
const tablesByName = /* @__PURE__ */ new Map();
|
|
4315
4334
|
for (const t of manifest.tables) {
|
|
4316
4335
|
if (tableNames.has(t.name)) {
|
|
4317
4336
|
ctx.addIssue({
|
|
@@ -4321,6 +4340,37 @@ var manifestSchema = external_exports.object({
|
|
|
4321
4340
|
});
|
|
4322
4341
|
}
|
|
4323
4342
|
tableNames.add(t.name);
|
|
4343
|
+
tablesByName.set(t.name, t);
|
|
4344
|
+
if (tableKind(t) === "asset") {
|
|
4345
|
+
if (t.indexes.length > 0) {
|
|
4346
|
+
ctx.addIssue({
|
|
4347
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4348
|
+
message: `${t.name} is an asset metadata table and cannot define indexes`,
|
|
4349
|
+
path: ["tables"]
|
|
4350
|
+
});
|
|
4351
|
+
}
|
|
4352
|
+
if (t.searchIndexes.length > 0) {
|
|
4353
|
+
ctx.addIssue({
|
|
4354
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4355
|
+
message: `${t.name} is an asset metadata table and cannot define search indexes`,
|
|
4356
|
+
path: ["tables"]
|
|
4357
|
+
});
|
|
4358
|
+
}
|
|
4359
|
+
if (t.displayTemplates !== void 0) {
|
|
4360
|
+
ctx.addIssue({
|
|
4361
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4362
|
+
message: `${t.name} is an asset metadata table and cannot define display templates`,
|
|
4363
|
+
path: ["tables"]
|
|
4364
|
+
});
|
|
4365
|
+
}
|
|
4366
|
+
if (t.color !== void 0) {
|
|
4367
|
+
ctx.addIssue({
|
|
4368
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4369
|
+
message: `${t.name} is an asset metadata table and cannot define a color`,
|
|
4370
|
+
path: ["tables"]
|
|
4371
|
+
});
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4324
4374
|
const fieldNames = /* @__PURE__ */ new Set();
|
|
4325
4375
|
for (const f of t.fields) {
|
|
4326
4376
|
if (fieldNames.has(f.name)) {
|
|
@@ -4331,36 +4381,43 @@ var manifestSchema = external_exports.object({
|
|
|
4331
4381
|
});
|
|
4332
4382
|
}
|
|
4333
4383
|
fieldNames.add(f.name);
|
|
4384
|
+
assertAssetBindingAllowed(ctx, t, f);
|
|
4334
4385
|
}
|
|
4335
4386
|
}
|
|
4336
4387
|
for (const t of manifest.tables) {
|
|
4337
4388
|
for (const f of t.fields) {
|
|
4338
|
-
const
|
|
4339
|
-
if (
|
|
4389
|
+
const invalidRef = findInvalidReference(f.type, tablesByName);
|
|
4390
|
+
if (invalidRef) {
|
|
4340
4391
|
ctx.addIssue({
|
|
4341
4392
|
code: external_exports.ZodIssueCode.custom,
|
|
4342
|
-
message: `${t.name}.${f.name}
|
|
4393
|
+
message: `${t.name}.${f.name} ${invalidRef}`,
|
|
4343
4394
|
path: ["tables"]
|
|
4344
4395
|
});
|
|
4345
4396
|
}
|
|
4346
4397
|
}
|
|
4347
4398
|
}
|
|
4348
4399
|
});
|
|
4349
|
-
function
|
|
4400
|
+
function findInvalidReference(t, tablesByName) {
|
|
4350
4401
|
switch (t.kind) {
|
|
4351
|
-
case "id":
|
|
4352
|
-
|
|
4402
|
+
case "id": {
|
|
4403
|
+
const target = tablesByName.get(t.table);
|
|
4404
|
+
if (!target) return `references unknown table: ${t.table}`;
|
|
4405
|
+
if (tableKind(target) === "asset") {
|
|
4406
|
+
return `cannot reference asset metadata table: ${t.table}`;
|
|
4407
|
+
}
|
|
4408
|
+
return null;
|
|
4409
|
+
}
|
|
4353
4410
|
case "array":
|
|
4354
|
-
return
|
|
4411
|
+
return findInvalidReference(t.element, tablesByName);
|
|
4355
4412
|
case "object":
|
|
4356
4413
|
for (const f of t.fields) {
|
|
4357
|
-
const r =
|
|
4414
|
+
const r = findInvalidReference(f.type, tablesByName);
|
|
4358
4415
|
if (r) return r;
|
|
4359
4416
|
}
|
|
4360
4417
|
return null;
|
|
4361
4418
|
case "union":
|
|
4362
4419
|
for (const o of t.options) {
|
|
4363
|
-
const r =
|
|
4420
|
+
const r = findInvalidReference(o, tablesByName);
|
|
4364
4421
|
if (r) return r;
|
|
4365
4422
|
}
|
|
4366
4423
|
return null;
|
|
@@ -4369,6 +4426,12 @@ function findDanglingRef(t, known) {
|
|
|
4369
4426
|
}
|
|
4370
4427
|
}
|
|
4371
4428
|
var EMPTY_MANIFEST = { tables: [] };
|
|
4429
|
+
function tableKind(table) {
|
|
4430
|
+
return table.kind ?? "record";
|
|
4431
|
+
}
|
|
4432
|
+
function isAssetTable(table) {
|
|
4433
|
+
return tableKind(table) === "asset";
|
|
4434
|
+
}
|
|
4372
4435
|
function trimmedLabel(label) {
|
|
4373
4436
|
const t = label?.trim();
|
|
4374
4437
|
return t ? t : void 0;
|
|
@@ -4437,6 +4500,37 @@ function isImageFieldType(t) {
|
|
|
4437
4500
|
function isStorageFieldType(t) {
|
|
4438
4501
|
return isFileFieldType(t) || isFileArrayFieldType(t);
|
|
4439
4502
|
}
|
|
4503
|
+
function assertAssetBindingAllowed(ctx, table, field) {
|
|
4504
|
+
if (field.asset && tableKind(table) === "asset") {
|
|
4505
|
+
ctx.addIssue({
|
|
4506
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4507
|
+
message: `${table.name}.${field.name} asset metadata fields cannot define a Media profile`,
|
|
4508
|
+
path: ["tables"]
|
|
4509
|
+
});
|
|
4510
|
+
} else if (field.asset && !isStorageFieldType(field.type)) {
|
|
4511
|
+
ctx.addIssue({
|
|
4512
|
+
code: external_exports.ZodIssueCode.custom,
|
|
4513
|
+
message: `${table.name}.${field.name} asset profile can only be set on image/file fields`,
|
|
4514
|
+
path: ["tables"]
|
|
4515
|
+
});
|
|
4516
|
+
}
|
|
4517
|
+
assertAssetBindingsInType(ctx, table, field.type);
|
|
4518
|
+
}
|
|
4519
|
+
function assertAssetBindingsInType(ctx, table, type) {
|
|
4520
|
+
switch (type.kind) {
|
|
4521
|
+
case "array":
|
|
4522
|
+
assertAssetBindingsInType(ctx, table, type.element);
|
|
4523
|
+
return;
|
|
4524
|
+
case "object":
|
|
4525
|
+
for (const field of type.fields) assertAssetBindingAllowed(ctx, table, field);
|
|
4526
|
+
return;
|
|
4527
|
+
case "union":
|
|
4528
|
+
for (const option of type.options) assertAssetBindingsInType(ctx, table, option);
|
|
4529
|
+
return;
|
|
4530
|
+
default:
|
|
4531
|
+
return;
|
|
4532
|
+
}
|
|
4533
|
+
}
|
|
4440
4534
|
function isTextScalarKind(t) {
|
|
4441
4535
|
return t.kind === "string" || t.kind === "number" || t.kind === "bigint" || t.kind === "id";
|
|
4442
4536
|
}
|
|
@@ -4552,6 +4646,6 @@ function defaultValueForType(t) {
|
|
|
4552
4646
|
}
|
|
4553
4647
|
}
|
|
4554
4648
|
|
|
4555
|
-
export { EMPTY_MANIFEST, EMPTY_MARKDOWN_DOC, RESERVED_TABLE_NAMES, TABLE_COLORS, defaultValueForType, describeFieldType, displayTemplatesSchema, fieldDisplayName, fieldSchema, fieldTypeSchema, indexSchema, isEditableKind, isFileArrayFieldType, isFileFieldType, isImageFieldType, isInlinePrimitive, isMarkdownField, isPrimitiveKind, isReferenceFieldType, isStorageFieldType, isSystemField, isTextScalarKind, manifestSchema, searchIndexSchema, stripSystemFields, tableColorSchema, tableDisplayName, tableSchema, validateFieldValue, validatePatch };
|
|
4649
|
+
export { EMPTY_MANIFEST, EMPTY_MARKDOWN_DOC, RESERVED_TABLE_NAMES, TABLE_COLORS, TABLE_KINDS, assetBindingSchema, defaultValueForType, describeFieldType, displayTemplatesSchema, fieldDisplayName, fieldSchema, fieldTypeSchema, indexSchema, isAssetTable, isEditableKind, isFileArrayFieldType, isFileFieldType, isImageFieldType, isInlinePrimitive, isMarkdownField, isPrimitiveKind, isReferenceFieldType, isStorageFieldType, isSystemField, isTextScalarKind, manifestSchema, searchIndexSchema, stripSystemFields, tableColorSchema, tableDisplayName, tableKind, tableKindSchema, tableSchema, validateFieldValue, validatePatch };
|
|
4556
4650
|
//# sourceMappingURL=schemaTypes.js.map
|
|
4557
4651
|
//# sourceMappingURL=schemaTypes.js.map
|