@columnus/shared 0.1.55 → 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 +1 -1
- 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 +722 -80
- 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.js +2 -2
- 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
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
export declare const assetFamilyValidator: import("convex/values").VUnion<"image" | "vector" | "document" | "audio" | "video" | "other", [import("convex/values").VLiteral<"image", "required">, import("convex/values").VLiteral<"document", "required">, import("convex/values").VLiteral<"audio", "required">, import("convex/values").VLiteral<"video", "required">, import("convex/values").VLiteral<"vector", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
|
|
2
|
+
/**
|
|
3
|
+
* The render queue's two unions. Same reasoning as the family union above —
|
|
4
|
+
* spelled out for `Infer`, then asserted against the tuples in both directions,
|
|
5
|
+
* so neither list can grow alone.
|
|
6
|
+
*
|
|
7
|
+
* They live here rather than in the component schema because the host wraps the
|
|
8
|
+
* queue behind its own deploy-key mutations and cannot import the component.
|
|
9
|
+
*/
|
|
10
|
+
export declare const assetJobKindValidator: import("convex/values").VUnion<"rendition" | "extract", [import("convex/values").VLiteral<"extract", "required">, import("convex/values").VLiteral<"rendition", "required">], "required", never>;
|
|
11
|
+
export declare const assetJobStatusValidator: import("convex/values").VUnion<"pending" | "failed" | "dead_letter" | "claimed" | "done", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"claimed", "required">, import("convex/values").VLiteral<"done", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"dead_letter", "required">], "required", never>;
|
|
12
|
+
export declare const assetSchemaBindingValidator: import("convex/values").VObject<{
|
|
13
|
+
requiredFields?: string[] | undefined;
|
|
14
|
+
defaultValues?: any;
|
|
15
|
+
schemaTable: string;
|
|
16
|
+
}, {
|
|
17
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
18
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
19
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
20
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>;
|
|
21
|
+
export declare const renditionNodeValidator: import("convex/values").VObject<{
|
|
22
|
+
parentId?: string | undefined;
|
|
23
|
+
quality?: number | undefined;
|
|
24
|
+
op: "contain" | "cover";
|
|
25
|
+
id: string;
|
|
26
|
+
maxWidth: number;
|
|
27
|
+
maxHeight: number;
|
|
28
|
+
format: string;
|
|
29
|
+
}, {
|
|
30
|
+
id: import("convex/values").VString<string, "required">;
|
|
31
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
32
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
33
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
34
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
35
|
+
format: import("convex/values").VString<string, "required">;
|
|
36
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
37
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">;
|
|
38
|
+
export declare const assetFamilyGraphsValidator: import("convex/values").VObject<{
|
|
39
|
+
image?: {
|
|
40
|
+
parentId?: string | undefined;
|
|
41
|
+
quality?: number | undefined;
|
|
42
|
+
op: "contain" | "cover";
|
|
43
|
+
id: string;
|
|
44
|
+
maxWidth: number;
|
|
45
|
+
maxHeight: number;
|
|
46
|
+
format: string;
|
|
47
|
+
}[] | undefined;
|
|
48
|
+
vector?: {
|
|
49
|
+
parentId?: string | undefined;
|
|
50
|
+
quality?: number | undefined;
|
|
51
|
+
op: "contain" | "cover";
|
|
52
|
+
id: string;
|
|
53
|
+
maxWidth: number;
|
|
54
|
+
maxHeight: number;
|
|
55
|
+
format: string;
|
|
56
|
+
}[] | undefined;
|
|
57
|
+
document?: {
|
|
58
|
+
parentId?: string | undefined;
|
|
59
|
+
quality?: number | undefined;
|
|
60
|
+
op: "contain" | "cover";
|
|
61
|
+
id: string;
|
|
62
|
+
maxWidth: number;
|
|
63
|
+
maxHeight: number;
|
|
64
|
+
format: string;
|
|
65
|
+
}[] | undefined;
|
|
66
|
+
audio?: {
|
|
67
|
+
parentId?: string | undefined;
|
|
68
|
+
quality?: number | undefined;
|
|
69
|
+
op: "contain" | "cover";
|
|
70
|
+
id: string;
|
|
71
|
+
maxWidth: number;
|
|
72
|
+
maxHeight: number;
|
|
73
|
+
format: string;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
video?: {
|
|
76
|
+
parentId?: string | undefined;
|
|
77
|
+
quality?: number | undefined;
|
|
78
|
+
op: "contain" | "cover";
|
|
79
|
+
id: string;
|
|
80
|
+
maxWidth: number;
|
|
81
|
+
maxHeight: number;
|
|
82
|
+
format: string;
|
|
83
|
+
}[] | undefined;
|
|
84
|
+
other?: {
|
|
85
|
+
parentId?: string | undefined;
|
|
86
|
+
quality?: number | undefined;
|
|
87
|
+
op: "contain" | "cover";
|
|
88
|
+
id: string;
|
|
89
|
+
maxWidth: number;
|
|
90
|
+
maxHeight: number;
|
|
91
|
+
format: string;
|
|
92
|
+
}[] | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
image: import("convex/values").VArray<{
|
|
95
|
+
parentId?: string | undefined;
|
|
96
|
+
quality?: number | undefined;
|
|
97
|
+
op: "contain" | "cover";
|
|
98
|
+
id: string;
|
|
99
|
+
maxWidth: number;
|
|
100
|
+
maxHeight: number;
|
|
101
|
+
format: string;
|
|
102
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
103
|
+
parentId?: string | undefined;
|
|
104
|
+
quality?: number | undefined;
|
|
105
|
+
op: "contain" | "cover";
|
|
106
|
+
id: string;
|
|
107
|
+
maxWidth: number;
|
|
108
|
+
maxHeight: number;
|
|
109
|
+
format: string;
|
|
110
|
+
}, {
|
|
111
|
+
id: import("convex/values").VString<string, "required">;
|
|
112
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
113
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
114
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
115
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
116
|
+
format: import("convex/values").VString<string, "required">;
|
|
117
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
118
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">, "optional">;
|
|
119
|
+
document: import("convex/values").VArray<{
|
|
120
|
+
parentId?: string | undefined;
|
|
121
|
+
quality?: number | undefined;
|
|
122
|
+
op: "contain" | "cover";
|
|
123
|
+
id: string;
|
|
124
|
+
maxWidth: number;
|
|
125
|
+
maxHeight: number;
|
|
126
|
+
format: string;
|
|
127
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
128
|
+
parentId?: string | undefined;
|
|
129
|
+
quality?: number | undefined;
|
|
130
|
+
op: "contain" | "cover";
|
|
131
|
+
id: string;
|
|
132
|
+
maxWidth: number;
|
|
133
|
+
maxHeight: number;
|
|
134
|
+
format: string;
|
|
135
|
+
}, {
|
|
136
|
+
id: import("convex/values").VString<string, "required">;
|
|
137
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
138
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
139
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
140
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
141
|
+
format: import("convex/values").VString<string, "required">;
|
|
142
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
143
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">, "optional">;
|
|
144
|
+
audio: import("convex/values").VArray<{
|
|
145
|
+
parentId?: string | undefined;
|
|
146
|
+
quality?: number | undefined;
|
|
147
|
+
op: "contain" | "cover";
|
|
148
|
+
id: string;
|
|
149
|
+
maxWidth: number;
|
|
150
|
+
maxHeight: number;
|
|
151
|
+
format: string;
|
|
152
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
153
|
+
parentId?: string | undefined;
|
|
154
|
+
quality?: number | undefined;
|
|
155
|
+
op: "contain" | "cover";
|
|
156
|
+
id: string;
|
|
157
|
+
maxWidth: number;
|
|
158
|
+
maxHeight: number;
|
|
159
|
+
format: string;
|
|
160
|
+
}, {
|
|
161
|
+
id: import("convex/values").VString<string, "required">;
|
|
162
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
163
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
164
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
165
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
166
|
+
format: import("convex/values").VString<string, "required">;
|
|
167
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
168
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">, "optional">;
|
|
169
|
+
video: import("convex/values").VArray<{
|
|
170
|
+
parentId?: string | undefined;
|
|
171
|
+
quality?: number | undefined;
|
|
172
|
+
op: "contain" | "cover";
|
|
173
|
+
id: string;
|
|
174
|
+
maxWidth: number;
|
|
175
|
+
maxHeight: number;
|
|
176
|
+
format: string;
|
|
177
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
178
|
+
parentId?: string | undefined;
|
|
179
|
+
quality?: number | undefined;
|
|
180
|
+
op: "contain" | "cover";
|
|
181
|
+
id: string;
|
|
182
|
+
maxWidth: number;
|
|
183
|
+
maxHeight: number;
|
|
184
|
+
format: string;
|
|
185
|
+
}, {
|
|
186
|
+
id: import("convex/values").VString<string, "required">;
|
|
187
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
188
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
189
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
190
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
191
|
+
format: import("convex/values").VString<string, "required">;
|
|
192
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
193
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">, "optional">;
|
|
194
|
+
vector: import("convex/values").VArray<{
|
|
195
|
+
parentId?: string | undefined;
|
|
196
|
+
quality?: number | undefined;
|
|
197
|
+
op: "contain" | "cover";
|
|
198
|
+
id: string;
|
|
199
|
+
maxWidth: number;
|
|
200
|
+
maxHeight: number;
|
|
201
|
+
format: string;
|
|
202
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
203
|
+
parentId?: string | undefined;
|
|
204
|
+
quality?: number | undefined;
|
|
205
|
+
op: "contain" | "cover";
|
|
206
|
+
id: string;
|
|
207
|
+
maxWidth: number;
|
|
208
|
+
maxHeight: number;
|
|
209
|
+
format: string;
|
|
210
|
+
}, {
|
|
211
|
+
id: import("convex/values").VString<string, "required">;
|
|
212
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
213
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
214
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
215
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
216
|
+
format: import("convex/values").VString<string, "required">;
|
|
217
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
218
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">, "optional">;
|
|
219
|
+
other: import("convex/values").VArray<{
|
|
220
|
+
parentId?: string | undefined;
|
|
221
|
+
quality?: number | undefined;
|
|
222
|
+
op: "contain" | "cover";
|
|
223
|
+
id: string;
|
|
224
|
+
maxWidth: number;
|
|
225
|
+
maxHeight: number;
|
|
226
|
+
format: string;
|
|
227
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
228
|
+
parentId?: string | undefined;
|
|
229
|
+
quality?: number | undefined;
|
|
230
|
+
op: "contain" | "cover";
|
|
231
|
+
id: string;
|
|
232
|
+
maxWidth: number;
|
|
233
|
+
maxHeight: number;
|
|
234
|
+
format: string;
|
|
235
|
+
}, {
|
|
236
|
+
id: import("convex/values").VString<string, "required">;
|
|
237
|
+
parentId: import("convex/values").VString<string | undefined, "optional">;
|
|
238
|
+
op: import("convex/values").VUnion<"contain" | "cover", [import("convex/values").VLiteral<"contain", "required">, import("convex/values").VLiteral<"cover", "required">], "required", never>;
|
|
239
|
+
maxWidth: import("convex/values").VFloat64<number, "required">;
|
|
240
|
+
maxHeight: import("convex/values").VFloat64<number, "required">;
|
|
241
|
+
format: import("convex/values").VString<string, "required">;
|
|
242
|
+
quality: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
243
|
+
}, "required", "op" | "id" | "maxWidth" | "maxHeight" | "parentId" | "format" | "quality">, "optional">;
|
|
244
|
+
}, "required", "image" | "vector" | "document" | "audio" | "video" | "other">;
|
|
245
|
+
/** R3: Studio delivery slots → graph node id (seeded image compact/preview). */
|
|
246
|
+
export declare const assetSlotMappingValidator: import("convex/values").VObject<{
|
|
247
|
+
preview?: string | undefined;
|
|
248
|
+
compact?: string | undefined;
|
|
249
|
+
}, {
|
|
250
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
251
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
252
|
+
}, "required", "preview" | "compact">;
|
|
253
|
+
export declare const assetFamilySlotsValidator: import("convex/values").VObject<{
|
|
254
|
+
image?: {
|
|
255
|
+
preview?: string | undefined;
|
|
256
|
+
compact?: string | undefined;
|
|
257
|
+
} | undefined;
|
|
258
|
+
vector?: {
|
|
259
|
+
preview?: string | undefined;
|
|
260
|
+
compact?: string | undefined;
|
|
261
|
+
} | undefined;
|
|
262
|
+
document?: {
|
|
263
|
+
preview?: string | undefined;
|
|
264
|
+
compact?: string | undefined;
|
|
265
|
+
} | undefined;
|
|
266
|
+
audio?: {
|
|
267
|
+
preview?: string | undefined;
|
|
268
|
+
compact?: string | undefined;
|
|
269
|
+
} | undefined;
|
|
270
|
+
video?: {
|
|
271
|
+
preview?: string | undefined;
|
|
272
|
+
compact?: string | undefined;
|
|
273
|
+
} | undefined;
|
|
274
|
+
other?: {
|
|
275
|
+
preview?: string | undefined;
|
|
276
|
+
compact?: string | undefined;
|
|
277
|
+
} | undefined;
|
|
278
|
+
}, {
|
|
279
|
+
image: import("convex/values").VObject<{
|
|
280
|
+
preview?: string | undefined;
|
|
281
|
+
compact?: string | undefined;
|
|
282
|
+
} | undefined, {
|
|
283
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
284
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
285
|
+
}, "optional", "preview" | "compact">;
|
|
286
|
+
document: import("convex/values").VObject<{
|
|
287
|
+
preview?: string | undefined;
|
|
288
|
+
compact?: string | undefined;
|
|
289
|
+
} | undefined, {
|
|
290
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
291
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
292
|
+
}, "optional", "preview" | "compact">;
|
|
293
|
+
audio: import("convex/values").VObject<{
|
|
294
|
+
preview?: string | undefined;
|
|
295
|
+
compact?: string | undefined;
|
|
296
|
+
} | undefined, {
|
|
297
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
298
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
299
|
+
}, "optional", "preview" | "compact">;
|
|
300
|
+
video: import("convex/values").VObject<{
|
|
301
|
+
preview?: string | undefined;
|
|
302
|
+
compact?: string | undefined;
|
|
303
|
+
} | undefined, {
|
|
304
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
305
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
306
|
+
}, "optional", "preview" | "compact">;
|
|
307
|
+
vector: import("convex/values").VObject<{
|
|
308
|
+
preview?: string | undefined;
|
|
309
|
+
compact?: string | undefined;
|
|
310
|
+
} | undefined, {
|
|
311
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
312
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
313
|
+
}, "optional", "preview" | "compact">;
|
|
314
|
+
other: import("convex/values").VObject<{
|
|
315
|
+
preview?: string | undefined;
|
|
316
|
+
compact?: string | undefined;
|
|
317
|
+
} | undefined, {
|
|
318
|
+
compact: import("convex/values").VString<string | undefined, "optional">;
|
|
319
|
+
preview: import("convex/values").VString<string | undefined, "optional">;
|
|
320
|
+
}, "optional", "preview" | "compact">;
|
|
321
|
+
}, "required", "image" | "vector" | "document" | "audio" | "video" | "other" | "image.preview" | "image.compact" | "vector.preview" | "vector.compact" | "document.preview" | "document.compact" | "audio.preview" | "audio.compact" | "video.preview" | "video.compact" | "other.preview" | "other.compact">;
|
|
322
|
+
export declare const assetFamilySchemasValidator: import("convex/values").VObject<{
|
|
323
|
+
image?: {
|
|
324
|
+
requiredFields?: string[] | undefined;
|
|
325
|
+
defaultValues?: any;
|
|
326
|
+
schemaTable: string;
|
|
327
|
+
}[] | undefined;
|
|
328
|
+
vector?: {
|
|
329
|
+
requiredFields?: string[] | undefined;
|
|
330
|
+
defaultValues?: any;
|
|
331
|
+
schemaTable: string;
|
|
332
|
+
}[] | undefined;
|
|
333
|
+
document?: {
|
|
334
|
+
requiredFields?: string[] | undefined;
|
|
335
|
+
defaultValues?: any;
|
|
336
|
+
schemaTable: string;
|
|
337
|
+
}[] | undefined;
|
|
338
|
+
audio?: {
|
|
339
|
+
requiredFields?: string[] | undefined;
|
|
340
|
+
defaultValues?: any;
|
|
341
|
+
schemaTable: string;
|
|
342
|
+
}[] | undefined;
|
|
343
|
+
video?: {
|
|
344
|
+
requiredFields?: string[] | undefined;
|
|
345
|
+
defaultValues?: any;
|
|
346
|
+
schemaTable: string;
|
|
347
|
+
}[] | undefined;
|
|
348
|
+
other?: {
|
|
349
|
+
requiredFields?: string[] | undefined;
|
|
350
|
+
defaultValues?: any;
|
|
351
|
+
schemaTable: string;
|
|
352
|
+
}[] | undefined;
|
|
353
|
+
}, {
|
|
354
|
+
image: import("convex/values").VArray<{
|
|
355
|
+
requiredFields?: string[] | undefined;
|
|
356
|
+
defaultValues?: any;
|
|
357
|
+
schemaTable: string;
|
|
358
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
359
|
+
requiredFields?: string[] | undefined;
|
|
360
|
+
defaultValues?: any;
|
|
361
|
+
schemaTable: string;
|
|
362
|
+
}, {
|
|
363
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
364
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
365
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
366
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>, "optional">;
|
|
367
|
+
document: import("convex/values").VArray<{
|
|
368
|
+
requiredFields?: string[] | undefined;
|
|
369
|
+
defaultValues?: any;
|
|
370
|
+
schemaTable: string;
|
|
371
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
372
|
+
requiredFields?: string[] | undefined;
|
|
373
|
+
defaultValues?: any;
|
|
374
|
+
schemaTable: string;
|
|
375
|
+
}, {
|
|
376
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
377
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
378
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
379
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>, "optional">;
|
|
380
|
+
audio: import("convex/values").VArray<{
|
|
381
|
+
requiredFields?: string[] | undefined;
|
|
382
|
+
defaultValues?: any;
|
|
383
|
+
schemaTable: string;
|
|
384
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
385
|
+
requiredFields?: string[] | undefined;
|
|
386
|
+
defaultValues?: any;
|
|
387
|
+
schemaTable: string;
|
|
388
|
+
}, {
|
|
389
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
390
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
391
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
392
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>, "optional">;
|
|
393
|
+
video: import("convex/values").VArray<{
|
|
394
|
+
requiredFields?: string[] | undefined;
|
|
395
|
+
defaultValues?: any;
|
|
396
|
+
schemaTable: string;
|
|
397
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
398
|
+
requiredFields?: string[] | undefined;
|
|
399
|
+
defaultValues?: any;
|
|
400
|
+
schemaTable: string;
|
|
401
|
+
}, {
|
|
402
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
403
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
404
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
405
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>, "optional">;
|
|
406
|
+
vector: import("convex/values").VArray<{
|
|
407
|
+
requiredFields?: string[] | undefined;
|
|
408
|
+
defaultValues?: any;
|
|
409
|
+
schemaTable: string;
|
|
410
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
411
|
+
requiredFields?: string[] | undefined;
|
|
412
|
+
defaultValues?: any;
|
|
413
|
+
schemaTable: string;
|
|
414
|
+
}, {
|
|
415
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
416
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
417
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
418
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>, "optional">;
|
|
419
|
+
other: import("convex/values").VArray<{
|
|
420
|
+
requiredFields?: string[] | undefined;
|
|
421
|
+
defaultValues?: any;
|
|
422
|
+
schemaTable: string;
|
|
423
|
+
}[] | undefined, import("convex/values").VObject<{
|
|
424
|
+
requiredFields?: string[] | undefined;
|
|
425
|
+
defaultValues?: any;
|
|
426
|
+
schemaTable: string;
|
|
427
|
+
}, {
|
|
428
|
+
schemaTable: import("convex/values").VString<string, "required">;
|
|
429
|
+
requiredFields: import("convex/values").VArray<string[] | undefined, import("convex/values").VString<string, "required">, "optional">;
|
|
430
|
+
defaultValues: import("convex/values").VAny<any, "optional", string>;
|
|
431
|
+
}, "required", "schemaTable" | "requiredFields" | "defaultValues" | `defaultValues.${string}`>, "optional">;
|
|
432
|
+
}, "required", "image" | "vector" | "document" | "audio" | "video" | "other">;
|
|
433
|
+
/**
|
|
434
|
+
* R10: work a graph save signed up for. Drained by a cron rather than by the
|
|
435
|
+
* browser that saved — a rebuild can touch the whole library, and the operator
|
|
436
|
+
* navigating away must not leave it half applied.
|
|
437
|
+
*/
|
|
438
|
+
export declare const assetRebuildStatusValidator: import("convex/values").VObject<{
|
|
439
|
+
cursor?: string | null | undefined;
|
|
440
|
+
pending: {
|
|
441
|
+
family: "image" | "vector" | "document" | "audio" | "video" | "other";
|
|
442
|
+
rebuild: string[];
|
|
443
|
+
removed: string[];
|
|
444
|
+
}[];
|
|
445
|
+
startedAt: number;
|
|
446
|
+
assetsExamined: number;
|
|
447
|
+
enqueued: number;
|
|
448
|
+
}, {
|
|
449
|
+
pending: import("convex/values").VArray<{
|
|
450
|
+
family: "image" | "vector" | "document" | "audio" | "video" | "other";
|
|
451
|
+
rebuild: string[];
|
|
452
|
+
removed: string[];
|
|
453
|
+
}[], import("convex/values").VObject<{
|
|
454
|
+
family: "image" | "vector" | "document" | "audio" | "video" | "other";
|
|
455
|
+
rebuild: string[];
|
|
456
|
+
removed: string[];
|
|
457
|
+
}, {
|
|
458
|
+
family: import("convex/values").VUnion<"image" | "vector" | "document" | "audio" | "video" | "other", [import("convex/values").VLiteral<"image", "required">, import("convex/values").VLiteral<"document", "required">, import("convex/values").VLiteral<"audio", "required">, import("convex/values").VLiteral<"video", "required">, import("convex/values").VLiteral<"vector", "required">, import("convex/values").VLiteral<"other", "required">], "required", never>;
|
|
459
|
+
rebuild: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
|
|
460
|
+
removed: import("convex/values").VArray<string[], import("convex/values").VString<string, "required">, "required">;
|
|
461
|
+
}, "required", "family" | "rebuild" | "removed">, "required">;
|
|
462
|
+
cursor: import("convex/values").VUnion<string | null | undefined, [import("convex/values").VString<string, "required">, import("convex/values").VNull<null, "required">], "optional", never>;
|
|
463
|
+
startedAt: import("convex/values").VFloat64<number, "required">;
|
|
464
|
+
assetsExamined: import("convex/values").VFloat64<number, "required">;
|
|
465
|
+
enqueued: import("convex/values").VFloat64<number, "required">;
|
|
466
|
+
}, "required", "pending" | "cursor" | "startedAt" | "assetsExamined" | "enqueued">;
|
|
467
|
+
export declare const assetMigrateStatusValidator: import("convex/values").VObject<{
|
|
468
|
+
error?: string | undefined;
|
|
469
|
+
cursor?: string | undefined;
|
|
470
|
+
state: "failed" | "done" | "idle" | "running";
|
|
471
|
+
}, {
|
|
472
|
+
state: import("convex/values").VUnion<"failed" | "done" | "idle" | "running", [import("convex/values").VLiteral<"idle", "required">, import("convex/values").VLiteral<"running", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"done", "required">], "required", never>;
|
|
473
|
+
cursor: import("convex/values").VString<string | undefined, "optional">;
|
|
474
|
+
error: import("convex/values").VString<string | undefined, "optional">;
|
|
475
|
+
}, "required", "error" | "cursor" | "state">;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { v } from 'convex/values';
|
|
2
|
+
|
|
3
|
+
// packages/@columnus/shared/src/assetValidators.ts
|
|
4
|
+
var assetFamilyValidator = v.union(
|
|
5
|
+
v.literal("image"),
|
|
6
|
+
v.literal("document"),
|
|
7
|
+
v.literal("audio"),
|
|
8
|
+
v.literal("video"),
|
|
9
|
+
v.literal("vector"),
|
|
10
|
+
v.literal("other")
|
|
11
|
+
);
|
|
12
|
+
var assetJobKindValidator = v.union(v.literal("extract"), v.literal("rendition"));
|
|
13
|
+
var assetJobStatusValidator = v.union(
|
|
14
|
+
v.literal("pending"),
|
|
15
|
+
v.literal("claimed"),
|
|
16
|
+
v.literal("done"),
|
|
17
|
+
v.literal("failed"),
|
|
18
|
+
v.literal("dead_letter")
|
|
19
|
+
);
|
|
20
|
+
var assetSchemaBindingValidator = v.object({
|
|
21
|
+
schemaTable: v.string(),
|
|
22
|
+
requiredFields: v.optional(v.array(v.string())),
|
|
23
|
+
defaultValues: v.optional(v.any())
|
|
24
|
+
});
|
|
25
|
+
var renditionNodeValidator = v.object({
|
|
26
|
+
id: v.string(),
|
|
27
|
+
parentId: v.optional(v.string()),
|
|
28
|
+
op: v.union(v.literal("contain"), v.literal("cover")),
|
|
29
|
+
maxWidth: v.number(),
|
|
30
|
+
maxHeight: v.number(),
|
|
31
|
+
format: v.string(),
|
|
32
|
+
quality: v.optional(v.number())
|
|
33
|
+
});
|
|
34
|
+
var assetFamilyGraphsValidator = v.object({
|
|
35
|
+
image: v.optional(v.array(renditionNodeValidator)),
|
|
36
|
+
document: v.optional(v.array(renditionNodeValidator)),
|
|
37
|
+
audio: v.optional(v.array(renditionNodeValidator)),
|
|
38
|
+
video: v.optional(v.array(renditionNodeValidator)),
|
|
39
|
+
vector: v.optional(v.array(renditionNodeValidator)),
|
|
40
|
+
other: v.optional(v.array(renditionNodeValidator))
|
|
41
|
+
});
|
|
42
|
+
var assetSlotMappingValidator = v.object({
|
|
43
|
+
compact: v.optional(v.string()),
|
|
44
|
+
preview: v.optional(v.string())
|
|
45
|
+
});
|
|
46
|
+
var assetFamilySlotsValidator = v.object({
|
|
47
|
+
image: v.optional(assetSlotMappingValidator),
|
|
48
|
+
document: v.optional(assetSlotMappingValidator),
|
|
49
|
+
audio: v.optional(assetSlotMappingValidator),
|
|
50
|
+
video: v.optional(assetSlotMappingValidator),
|
|
51
|
+
vector: v.optional(assetSlotMappingValidator),
|
|
52
|
+
other: v.optional(assetSlotMappingValidator)
|
|
53
|
+
});
|
|
54
|
+
var assetFamilySchemasValidator = v.object({
|
|
55
|
+
image: v.optional(v.array(assetSchemaBindingValidator)),
|
|
56
|
+
document: v.optional(v.array(assetSchemaBindingValidator)),
|
|
57
|
+
audio: v.optional(v.array(assetSchemaBindingValidator)),
|
|
58
|
+
video: v.optional(v.array(assetSchemaBindingValidator)),
|
|
59
|
+
vector: v.optional(v.array(assetSchemaBindingValidator)),
|
|
60
|
+
other: v.optional(v.array(assetSchemaBindingValidator))
|
|
61
|
+
});
|
|
62
|
+
var assetRebuildStatusValidator = v.object({
|
|
63
|
+
pending: v.array(
|
|
64
|
+
v.object({
|
|
65
|
+
family: assetFamilyValidator,
|
|
66
|
+
rebuild: v.array(v.string()),
|
|
67
|
+
removed: v.array(v.string())
|
|
68
|
+
})
|
|
69
|
+
),
|
|
70
|
+
cursor: v.optional(v.union(v.string(), v.null())),
|
|
71
|
+
startedAt: v.number(),
|
|
72
|
+
assetsExamined: v.number(),
|
|
73
|
+
enqueued: v.number()
|
|
74
|
+
});
|
|
75
|
+
var assetMigrateStatusValidator = v.object({
|
|
76
|
+
state: v.union(v.literal("idle"), v.literal("running"), v.literal("failed"), v.literal("done")),
|
|
77
|
+
cursor: v.optional(v.string()),
|
|
78
|
+
error: v.optional(v.string())
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
export { assetFamilyGraphsValidator, assetFamilySchemasValidator, assetFamilySlotsValidator, assetFamilyValidator, assetJobKindValidator, assetJobStatusValidator, assetMigrateStatusValidator, assetRebuildStatusValidator, assetSchemaBindingValidator, assetSlotMappingValidator, renditionNodeValidator };
|
|
82
|
+
//# sourceMappingURL=assetValidators.js.map
|
|
83
|
+
//# sourceMappingURL=assetValidators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/assetValidators.ts"],"names":[],"mappings":";;;AAaO,IAAM,uBAAuB,CAAA,CAAE,KAAA;AAAA,EACpC,CAAA,CAAE,QAAQ,OAAO,CAAA;AAAA,EACjB,CAAA,CAAE,QAAQ,UAAU,CAAA;AAAA,EACpB,CAAA,CAAE,QAAQ,OAAO,CAAA;AAAA,EACjB,CAAA,CAAE,QAAQ,OAAO,CAAA;AAAA,EACjB,CAAA,CAAE,QAAQ,QAAQ,CAAA;AAAA,EAClB,CAAA,CAAE,QAAQ,OAAO;AACnB;AAsBO,IAAM,qBAAA,GAAwB,CAAA,CAAE,KAAA,CAAM,CAAA,CAAE,OAAA,CAAQ,SAAS,CAAA,EAAG,C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AAS,CAAA,CAAE,QAAQ,CAAA;AAAA,EAC7B,KAAA,EAAO,CAAA,CAAE,QAAA,CAAS,CAAA,CAAE,QAAQ;AAC9B,CAAC","file":"assetValidators.js","sourcesContent":["/**\n * The Media configuration contract, as Convex validators.\n *\n * Lives here rather than in the component because both sides need it: the\n * component validates what it stores, and the host's public mutations validate\n * what a browser sends before forwarding it. The host cannot import the\n * component package, so without a shared home its arguments degrade to\n * `v.any()` plus a cast — which is not a contract, it is a hope.\n */\nimport { type Infer, v } from \"convex/values\";\nimport type { AssetFamily } from \"./assetFamily.ts\";\nimport type { AssetJobKind, AssetJobStatus } from \"./assetJobs.ts\";\n\nexport const assetFamilyValidator = v.union(\n v.literal(\"image\"),\n v.literal(\"document\"),\n v.literal(\"audio\"),\n v.literal(\"video\"),\n v.literal(\"vector\"),\n v.literal(\"other\"),\n);\n\n/**\n * The one place the family union is spelled twice: Convex infers `Infer<>` from\n * the literal arguments, so building this from `ASSET_FAMILIES` with `.map`\n * would collapse it to `string`. This assertion fails to compile if the two\n * ever disagree, in either direction.\n */\ntype MustBeNever<T extends never> = T;\ntype _ValidatorHasNoExtraFamily = MustBeNever<\n Exclude<Infer<typeof assetFamilyValidator>, AssetFamily>\n>;\ntype _TupleHasNoExtraFamily = MustBeNever<Exclude<AssetFamily, Infer<typeof assetFamilyValidator>>>;\n\n/**\n * The render queue's two unions. Same reasoning as the family union above —\n * spelled out for `Infer`, then asserted against the tuples in both directions,\n * so neither list can grow alone.\n *\n * They live here rather than in the component schema because the host wraps the\n * queue behind its own deploy-key mutations and cannot import the component.\n */\nexport const assetJobKindValidator = v.union(v.literal(\"extract\"), v.literal(\"rendition\"));\ntype _ValidatorHasNoExtraJobKind = MustBeNever<\n Exclude<Infer<typeof assetJobKindValidator>, AssetJobKind>\n>;\ntype _TupleHasNoExtraJobKind = MustBeNever<\n Exclude<AssetJobKind, Infer<typeof assetJobKindValidator>>\n>;\n\nexport const assetJobStatusValidator = v.union(\n v.literal(\"pending\"),\n v.literal(\"claimed\"),\n v.literal(\"done\"),\n v.literal(\"failed\"),\n v.literal(\"dead_letter\"),\n);\ntype _ValidatorHasNoExtraJobStatus = MustBeNever<\n Exclude<Infer<typeof assetJobStatusValidator>, AssetJobStatus>\n>;\ntype _TupleHasNoExtraJobStatus = MustBeNever<\n Exclude<AssetJobStatus, Infer<typeof assetJobStatusValidator>>\n>;\n\nexport const assetSchemaBindingValidator = v.object({\n schemaTable: v.string(),\n requiredFields: v.optional(v.array(v.string())),\n defaultValues: v.optional(v.any()),\n});\n\nexport const renditionNodeValidator = v.object({\n id: v.string(),\n parentId: v.optional(v.string()),\n op: v.union(v.literal(\"contain\"), v.literal(\"cover\")),\n maxWidth: v.number(),\n maxHeight: v.number(),\n format: v.string(),\n quality: v.optional(v.number()),\n});\n\n// The per-family objects are spelled out rather than generated: `Infer` needs a\n// literal shape, and a helper that returns `never` buys nothing.\nexport const assetFamilyGraphsValidator = v.object({\n image: v.optional(v.array(renditionNodeValidator)),\n document: v.optional(v.array(renditionNodeValidator)),\n audio: v.optional(v.array(renditionNodeValidator)),\n video: v.optional(v.array(renditionNodeValidator)),\n vector: v.optional(v.array(renditionNodeValidator)),\n other: v.optional(v.array(renditionNodeValidator)),\n});\n\n/** R3: Studio delivery slots → graph node id (seeded image compact/preview). */\nexport const assetSlotMappingValidator = v.object({\n compact: v.optional(v.string()),\n preview: v.optional(v.string()),\n});\n\nexport const assetFamilySlotsValidator = v.object({\n image: v.optional(assetSlotMappingValidator),\n document: v.optional(assetSlotMappingValidator),\n audio: v.optional(assetSlotMappingValidator),\n video: v.optional(assetSlotMappingValidator),\n vector: v.optional(assetSlotMappingValidator),\n other: v.optional(assetSlotMappingValidator),\n});\n\nexport const assetFamilySchemasValidator = v.object({\n image: v.optional(v.array(assetSchemaBindingValidator)),\n document: v.optional(v.array(assetSchemaBindingValidator)),\n audio: v.optional(v.array(assetSchemaBindingValidator)),\n video: v.optional(v.array(assetSchemaBindingValidator)),\n vector: v.optional(v.array(assetSchemaBindingValidator)),\n other: v.optional(v.array(assetSchemaBindingValidator)),\n});\n\n/**\n * R10: work a graph save signed up for. Drained by a cron rather than by the\n * browser that saved — a rebuild can touch the whole library, and the operator\n * navigating away must not leave it half applied.\n */\nexport const assetRebuildStatusValidator = v.object({\n pending: v.array(\n v.object({\n family: assetFamilyValidator,\n rebuild: v.array(v.string()),\n removed: v.array(v.string()),\n }),\n ),\n cursor: v.optional(v.union(v.string(), v.null())),\n startedAt: v.number(),\n assetsExamined: v.number(),\n enqueued: v.number(),\n});\n\nexport const assetMigrateStatusValidator = v.object({\n state: v.union(v.literal(\"idle\"), v.literal(\"running\"), v.literal(\"failed\"), v.literal(\"done\")),\n cursor: v.optional(v.string()),\n error: v.optional(v.string()),\n});\n"]}
|