@fireproof/core-svc-protocol 0.24.0-dev-multi-clerks-0

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.
@@ -0,0 +1,338 @@
1
+ import { z } from "zod";
2
+ import { ProxyDocWithId } from "./doc-base.zod.js";
3
+ export declare const MsgBaseSchemaBase: z.ZodObject<{
4
+ tid: z.ZodString;
5
+ type: z.ZodString;
6
+ src: z.ZodString;
7
+ dst: z.ZodString;
8
+ }, z.core.$strip>;
9
+ export declare const MsgBaseSchema: z.ZodReadonly<z.ZodObject<{
10
+ tid: z.ZodString;
11
+ type: z.ZodString;
12
+ src: z.ZodString;
13
+ dst: z.ZodString;
14
+ }, z.core.$strip>>;
15
+ export type MsgBase = z.infer<typeof MsgBaseSchema>;
16
+ export declare const ErrorMsgSchema: z.ZodReadonly<z.ZodObject<{
17
+ tid: z.ZodString;
18
+ src: z.ZodString;
19
+ dst: z.ZodString;
20
+ type: z.ZodLiteral<"error">;
21
+ error: z.ZodString;
22
+ code: z.ZodOptional<z.ZodNumber>;
23
+ stack: z.ZodOptional<z.ZodArray<z.ZodString>>;
24
+ }, z.core.$strip>>;
25
+ export type ErrorMsg = z.infer<typeof ErrorMsgSchema>;
26
+ export declare const DbInstanceSchemaBase: z.ZodObject<{
27
+ tid: z.ZodString;
28
+ type: z.ZodString;
29
+ src: z.ZodString;
30
+ dst: z.ZodString;
31
+ dbName: z.ZodString;
32
+ dbId: z.ZodString;
33
+ }, z.core.$strip>;
34
+ export declare const DbInstanceSchema: z.ZodReadonly<z.ZodObject<{
35
+ tid: z.ZodString;
36
+ type: z.ZodString;
37
+ src: z.ZodString;
38
+ dst: z.ZodString;
39
+ dbName: z.ZodString;
40
+ dbId: z.ZodString;
41
+ }, z.core.$strip>>;
42
+ export type DbInstance = z.infer<typeof DbInstanceSchema>;
43
+ export declare const ReqDBGetSchema: z.ZodReadonly<z.ZodObject<{
44
+ tid: z.ZodString;
45
+ src: z.ZodString;
46
+ dst: z.ZodString;
47
+ dbName: z.ZodString;
48
+ dbId: z.ZodString;
49
+ type: z.ZodLiteral<"reqDBGet">;
50
+ docIds: z.ZodArray<z.ZodString>;
51
+ }, z.core.$strip>>;
52
+ export type ReqDBGet = z.infer<typeof ReqDBGetSchema>;
53
+ export declare function isResDBGet(msg: MsgType): msg is ResDBGet;
54
+ export declare const ResDBGetSchema: z.ZodReadonly<z.ZodObject<{
55
+ tid: z.ZodString;
56
+ src: z.ZodString;
57
+ dst: z.ZodString;
58
+ dbName: z.ZodString;
59
+ dbId: z.ZodString;
60
+ type: z.ZodLiteral<"resDBGet">;
61
+ docId: z.ZodString;
62
+ results: z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
63
+ _id: z.ZodString;
64
+ _files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
65
+ type: z.ZodString;
66
+ size: z.ZodNumber;
67
+ cid: z.ZodAny;
68
+ car: z.ZodOptional<z.ZodAny>;
69
+ lastModified: z.ZodOptional<z.ZodNumber>;
70
+ url: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
72
+ _publicFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
73
+ type: z.ZodString;
74
+ size: z.ZodNumber;
75
+ cid: z.ZodAny;
76
+ car: z.ZodOptional<z.ZodAny>;
77
+ lastModified: z.ZodOptional<z.ZodNumber>;
78
+ url: z.ZodOptional<z.ZodString>;
79
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
80
+ _deleted: z.ZodOptional<z.ZodBoolean>;
81
+ }, z.core.$strip>>, z.ZodAny]>>;
82
+ }, z.core.$strip>>;
83
+ export type ResDBGet<T = unknown> = z.infer<typeof ResDBGetSchema> & {
84
+ results: ProxyDocWithId<T>[];
85
+ };
86
+ export declare const ReqDBGetFileContentSchema: z.ZodReadonly<z.ZodObject<{
87
+ tid: z.ZodString;
88
+ src: z.ZodString;
89
+ dst: z.ZodString;
90
+ dbName: z.ZodString;
91
+ dbId: z.ZodString;
92
+ type: z.ZodLiteral<"reqDBGetFile">;
93
+ docId: z.ZodString;
94
+ fileData: z.ZodReadonly<z.ZodObject<{
95
+ type: z.ZodString;
96
+ size: z.ZodNumber;
97
+ cid: z.ZodAny;
98
+ car: z.ZodOptional<z.ZodAny>;
99
+ lastModified: z.ZodOptional<z.ZodNumber>;
100
+ url: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$strip>>;
102
+ }, z.core.$strip>>;
103
+ export type ReqDBGetFileContent = z.infer<typeof ReqDBGetFileContentSchema>;
104
+ export declare const ResDBGetFileContentSchema: z.ZodReadonly<z.ZodObject<{
105
+ tid: z.ZodString;
106
+ src: z.ZodString;
107
+ dst: z.ZodString;
108
+ dbName: z.ZodString;
109
+ dbId: z.ZodString;
110
+ type: z.ZodLiteral<"resDBGetFile">;
111
+ docId: z.ZodString;
112
+ fileData: z.ZodReadonly<z.ZodObject<{
113
+ type: z.ZodString;
114
+ size: z.ZodNumber;
115
+ cid: z.ZodAny;
116
+ car: z.ZodOptional<z.ZodAny>;
117
+ lastModified: z.ZodOptional<z.ZodNumber>;
118
+ url: z.ZodOptional<z.ZodString>;
119
+ }, z.core.$strip>>;
120
+ content: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
121
+ }, z.core.$strip>>;
122
+ export type ResDBGetFileContent = z.infer<typeof ResDBGetFileContentSchema>;
123
+ export declare const ReqApplyDatabaseConfigSchema: z.ZodObject<{
124
+ tid: z.ZodString;
125
+ src: z.ZodString;
126
+ dst: z.ZodString;
127
+ type: z.ZodLiteral<"reqApplyDatabaseConfig">;
128
+ config: z.ZodObject<{
129
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
130
+ ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
131
+ writeQueue: z.ZodOptional<z.ZodObject<{
132
+ chunkSize: z.ZodNumber;
133
+ }, z.core.$strip>>;
134
+ autoCompact: z.ZodOptional<z.ZodNumber>;
135
+ compactStrategy: z.ZodOptional<z.ZodString>;
136
+ storeUrls: z.ZodOptional<z.ZodOptional<z.ZodReadonly<z.ZodObject<{
137
+ base: z.ZodOptional<z.ZodString>;
138
+ data: z.ZodObject<{
139
+ meta: z.ZodOptional<z.ZodString>;
140
+ car: z.ZodOptional<z.ZodString>;
141
+ file: z.ZodOptional<z.ZodString>;
142
+ wal: z.ZodOptional<z.ZodString>;
143
+ }, z.core.$strip>;
144
+ idx: z.ZodObject<{
145
+ meta: z.ZodOptional<z.ZodString>;
146
+ car: z.ZodOptional<z.ZodString>;
147
+ file: z.ZodOptional<z.ZodString>;
148
+ wal: z.ZodOptional<z.ZodString>;
149
+ }, z.core.$strip>;
150
+ }, z.core.$strip>>>>;
151
+ threshold: z.ZodOptional<z.ZodNumber>;
152
+ name: z.ZodString;
153
+ refId: z.ZodString;
154
+ }, z.core.$strip>;
155
+ }, z.core.$strip>;
156
+ export type ReqApplyDatabaseConfig = z.infer<typeof ReqApplyDatabaseConfigSchema>;
157
+ export declare const ResApplyDatabaseConfigSchema: z.ZodReadonly<z.ZodObject<{
158
+ tid: z.ZodString;
159
+ src: z.ZodString;
160
+ dst: z.ZodString;
161
+ type: z.ZodLiteral<"resApplyDatabaseConfig">;
162
+ dbName: z.ZodString;
163
+ dbId: z.ZodString;
164
+ }, z.core.$strip>>;
165
+ export type ResApplyDatabaseConfig = z.infer<typeof ResApplyDatabaseConfigSchema>;
166
+ export declare function isResApplyDatabaseConfig(msg: MsgType): msg is ResApplyDatabaseConfig;
167
+ export declare const ProxyBulkResponseSchema: z.ZodReadonly<z.ZodObject<{
168
+ ids: z.ZodArray<z.ZodString>;
169
+ clock: z.ZodString;
170
+ name: z.ZodOptional<z.ZodString>;
171
+ }, z.core.$strip>>;
172
+ export type ProxyBulkResponse = z.infer<typeof ProxyBulkResponseSchema>;
173
+ export declare const ReqDBBulkSchema: z.ZodReadonly<z.ZodObject<{
174
+ tid: z.ZodString;
175
+ src: z.ZodString;
176
+ dst: z.ZodString;
177
+ dbName: z.ZodString;
178
+ dbId: z.ZodString;
179
+ type: z.ZodLiteral<"reqDBBulk">;
180
+ docs: z.ZodArray<z.ZodAny>;
181
+ }, z.core.$strip>>;
182
+ export type ReqDBBulk = z.infer<typeof ReqDBBulkSchema>;
183
+ export declare const ResDBBulkSchema: z.ZodReadonly<z.ZodObject<{
184
+ tid: z.ZodString;
185
+ src: z.ZodString;
186
+ dst: z.ZodString;
187
+ dbName: z.ZodString;
188
+ dbId: z.ZodString;
189
+ type: z.ZodLiteral<"resDBBulk">;
190
+ results: z.ZodReadonly<z.ZodObject<{
191
+ ids: z.ZodArray<z.ZodString>;
192
+ clock: z.ZodString;
193
+ name: z.ZodOptional<z.ZodString>;
194
+ }, z.core.$strip>>;
195
+ }, z.core.$strip>>;
196
+ export type ResDBBulk = z.infer<typeof ResDBBulkSchema>;
197
+ export declare const MsgTypeSchema: z.ZodUnion<readonly [z.ZodObject<{
198
+ tid: z.ZodString;
199
+ src: z.ZodString;
200
+ dst: z.ZodString;
201
+ type: z.ZodLiteral<"reqApplyDatabaseConfig">;
202
+ config: z.ZodObject<{
203
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
204
+ ctx: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
205
+ writeQueue: z.ZodOptional<z.ZodObject<{
206
+ chunkSize: z.ZodNumber;
207
+ }, z.core.$strip>>;
208
+ autoCompact: z.ZodOptional<z.ZodNumber>;
209
+ compactStrategy: z.ZodOptional<z.ZodString>;
210
+ storeUrls: z.ZodOptional<z.ZodOptional<z.ZodReadonly<z.ZodObject<{
211
+ base: z.ZodOptional<z.ZodString>;
212
+ data: z.ZodObject<{
213
+ meta: z.ZodOptional<z.ZodString>;
214
+ car: z.ZodOptional<z.ZodString>;
215
+ file: z.ZodOptional<z.ZodString>;
216
+ wal: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strip>;
218
+ idx: z.ZodObject<{
219
+ meta: z.ZodOptional<z.ZodString>;
220
+ car: z.ZodOptional<z.ZodString>;
221
+ file: z.ZodOptional<z.ZodString>;
222
+ wal: z.ZodOptional<z.ZodString>;
223
+ }, z.core.$strip>;
224
+ }, z.core.$strip>>>>;
225
+ threshold: z.ZodOptional<z.ZodNumber>;
226
+ name: z.ZodString;
227
+ refId: z.ZodString;
228
+ }, z.core.$strip>;
229
+ }, z.core.$strip>, z.ZodReadonly<z.ZodObject<{
230
+ tid: z.ZodString;
231
+ src: z.ZodString;
232
+ dst: z.ZodString;
233
+ type: z.ZodLiteral<"resApplyDatabaseConfig">;
234
+ dbName: z.ZodString;
235
+ dbId: z.ZodString;
236
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
237
+ tid: z.ZodString;
238
+ src: z.ZodString;
239
+ dst: z.ZodString;
240
+ type: z.ZodLiteral<"error">;
241
+ error: z.ZodString;
242
+ code: z.ZodOptional<z.ZodNumber>;
243
+ stack: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
245
+ tid: z.ZodString;
246
+ src: z.ZodString;
247
+ dst: z.ZodString;
248
+ dbName: z.ZodString;
249
+ dbId: z.ZodString;
250
+ type: z.ZodLiteral<"reqDBGet">;
251
+ docIds: z.ZodArray<z.ZodString>;
252
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
253
+ tid: z.ZodString;
254
+ src: z.ZodString;
255
+ dst: z.ZodString;
256
+ dbName: z.ZodString;
257
+ dbId: z.ZodString;
258
+ type: z.ZodLiteral<"resDBGet">;
259
+ docId: z.ZodString;
260
+ results: z.ZodArray<z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
261
+ _id: z.ZodString;
262
+ _files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
263
+ type: z.ZodString;
264
+ size: z.ZodNumber;
265
+ cid: z.ZodAny;
266
+ car: z.ZodOptional<z.ZodAny>;
267
+ lastModified: z.ZodOptional<z.ZodNumber>;
268
+ url: z.ZodOptional<z.ZodString>;
269
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
270
+ _publicFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
271
+ type: z.ZodString;
272
+ size: z.ZodNumber;
273
+ cid: z.ZodAny;
274
+ car: z.ZodOptional<z.ZodAny>;
275
+ lastModified: z.ZodOptional<z.ZodNumber>;
276
+ url: z.ZodOptional<z.ZodString>;
277
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
278
+ _deleted: z.ZodOptional<z.ZodBoolean>;
279
+ }, z.core.$strip>>, z.ZodAny]>>;
280
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
281
+ tid: z.ZodString;
282
+ src: z.ZodString;
283
+ dst: z.ZodString;
284
+ dbName: z.ZodString;
285
+ dbId: z.ZodString;
286
+ type: z.ZodLiteral<"reqDBGetFile">;
287
+ docId: z.ZodString;
288
+ fileData: z.ZodReadonly<z.ZodObject<{
289
+ type: z.ZodString;
290
+ size: z.ZodNumber;
291
+ cid: z.ZodAny;
292
+ car: z.ZodOptional<z.ZodAny>;
293
+ lastModified: z.ZodOptional<z.ZodNumber>;
294
+ url: z.ZodOptional<z.ZodString>;
295
+ }, z.core.$strip>>;
296
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
297
+ tid: z.ZodString;
298
+ src: z.ZodString;
299
+ dst: z.ZodString;
300
+ dbName: z.ZodString;
301
+ dbId: z.ZodString;
302
+ type: z.ZodLiteral<"resDBGetFile">;
303
+ docId: z.ZodString;
304
+ fileData: z.ZodReadonly<z.ZodObject<{
305
+ type: z.ZodString;
306
+ size: z.ZodNumber;
307
+ cid: z.ZodAny;
308
+ car: z.ZodOptional<z.ZodAny>;
309
+ lastModified: z.ZodOptional<z.ZodNumber>;
310
+ url: z.ZodOptional<z.ZodString>;
311
+ }, z.core.$strip>>;
312
+ content: z.ZodCustom<Uint8Array<ArrayBuffer>, Uint8Array<ArrayBuffer>>;
313
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
314
+ tid: z.ZodString;
315
+ src: z.ZodString;
316
+ dst: z.ZodString;
317
+ dbName: z.ZodString;
318
+ dbId: z.ZodString;
319
+ type: z.ZodLiteral<"reqDBBulk">;
320
+ docs: z.ZodArray<z.ZodAny>;
321
+ }, z.core.$strip>>, z.ZodReadonly<z.ZodObject<{
322
+ tid: z.ZodString;
323
+ src: z.ZodString;
324
+ dst: z.ZodString;
325
+ dbName: z.ZodString;
326
+ dbId: z.ZodString;
327
+ type: z.ZodLiteral<"resDBBulk">;
328
+ results: z.ZodReadonly<z.ZodObject<{
329
+ ids: z.ZodArray<z.ZodString>;
330
+ clock: z.ZodString;
331
+ name: z.ZodOptional<z.ZodString>;
332
+ }, z.core.$strip>>;
333
+ }, z.core.$strip>>]>;
334
+ export type MsgType = z.infer<typeof MsgTypeSchema>;
335
+ export type DBSend<Req extends MsgType> = Omit<Req, "tid" | "src"> & Partial<{
336
+ readonly tid: string;
337
+ readonly src: string;
338
+ }>;
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ import { ProxyDocFileMetaSchema, ProxyDocWithIdSchema } from "./doc-base.zod.js";
3
+ import { DatabaseConfigWithNameSchema } from "@fireproof/core-types-base";
4
+ export const MsgBaseSchemaBase = z.object({
5
+ tid: z.string(),
6
+ type: z.string(),
7
+ src: z.string(),
8
+ dst: z.string(),
9
+ });
10
+ export const MsgBaseSchema = MsgBaseSchemaBase.readonly();
11
+ export const ErrorMsgSchema = MsgBaseSchemaBase.extend({
12
+ type: z.literal("error"),
13
+ error: z.string(),
14
+ code: z.number().optional(),
15
+ stack: z.array(z.string()).optional(),
16
+ }).readonly();
17
+ export const DbInstanceSchemaBase = MsgBaseSchemaBase.extend({
18
+ dbName: z.string(),
19
+ dbId: z.string(),
20
+ });
21
+ export const DbInstanceSchema = DbInstanceSchemaBase.readonly();
22
+ export const ReqDBGetSchema = DbInstanceSchemaBase.extend({
23
+ type: z.literal("reqDBGet"),
24
+ docIds: z.array(z.string()),
25
+ }).readonly();
26
+ export function isResDBGet(msg) {
27
+ return msg.type === "resDBGet";
28
+ }
29
+ export const ResDBGetSchema = DbInstanceSchemaBase.extend({
30
+ type: z.literal("resDBGet"),
31
+ docId: z.string(),
32
+ results: ProxyDocWithIdSchema.array(),
33
+ }).readonly();
34
+ export const ReqDBGetFileContentSchema = DbInstanceSchemaBase.extend({
35
+ type: z.literal("reqDBGetFile"),
36
+ docId: z.string(),
37
+ fileData: ProxyDocFileMetaSchema,
38
+ }).readonly();
39
+ export const ResDBGetFileContentSchema = DbInstanceSchemaBase.extend({
40
+ type: z.literal("resDBGetFile"),
41
+ docId: z.string(),
42
+ fileData: ProxyDocFileMetaSchema,
43
+ content: z.instanceof(Uint8Array),
44
+ }).readonly();
45
+ export const ReqApplyDatabaseConfigSchema = z.object({
46
+ ...MsgBaseSchemaBase.shape,
47
+ type: z.literal("reqApplyDatabaseConfig"),
48
+ config: DatabaseConfigWithNameSchema,
49
+ });
50
+ export const ResApplyDatabaseConfigSchema = z
51
+ .object({
52
+ ...MsgBaseSchemaBase.shape,
53
+ type: z.literal("resApplyDatabaseConfig"),
54
+ dbName: z.string(),
55
+ dbId: z.string(),
56
+ })
57
+ .readonly();
58
+ export function isResApplyDatabaseConfig(msg) {
59
+ return msg.type === "resApplyDatabaseConfig";
60
+ }
61
+ export const ProxyBulkResponseSchema = z
62
+ .object({
63
+ ids: z.array(z.string()),
64
+ clock: z.string(),
65
+ name: z.string().optional(),
66
+ })
67
+ .readonly();
68
+ export const ReqDBBulkSchema = DbInstanceSchemaBase.extend({
69
+ type: z.literal("reqDBBulk"),
70
+ docs: z.array(z.any()),
71
+ }).readonly();
72
+ export const ResDBBulkSchema = DbInstanceSchemaBase.extend({
73
+ type: z.literal("resDBBulk"),
74
+ results: ProxyBulkResponseSchema,
75
+ }).readonly();
76
+ export const MsgTypeSchema = z.union([
77
+ ReqApplyDatabaseConfigSchema,
78
+ ResApplyDatabaseConfigSchema,
79
+ ErrorMsgSchema,
80
+ ReqDBGetSchema,
81
+ ResDBGetSchema,
82
+ ReqDBGetFileContentSchema,
83
+ ResDBGetFileContentSchema,
84
+ ReqDBBulkSchema,
85
+ ResDBBulkSchema,
86
+ ]);
87
+ //# sourceMappingURL=database-protocol.zod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database-protocol.zod.js","sourceRoot":"","sources":["../jsr/database-protocol.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAkB,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACjG,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;IACf,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;CAChB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,EAAE,CAAC;AAI1D,MAAM,CAAC,MAAM,cAAc,GAAG,iBAAiB,CAAC,MAAM,CAAC;IACrD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC;IACxB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC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,CAAC,MAAM,eAAe,GAAG,oBAAoB,CAAC,MAAM,CAAC;IACzD,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC5B,OAAO,EAAE,uBAAuB;CACjC,CAAC,CAAC,QAAQ,EAAE,CAAC;AAId,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC;IACnC,4BAA4B;IAC5B,4BAA4B;IAC5B,cAAc;IACd,cAAc;IACd,cAAc;IACd,yBAAyB;IACzB,yBAAyB;IACzB,eAAe;IACf,eAAe;CAChB,CAAC,CAAC"}
@@ -0,0 +1,102 @@
1
+ import { z } from "zod";
2
+ export declare const ProxyDocFileMetaSchema: z.ZodReadonly<z.ZodObject<{
3
+ type: z.ZodString;
4
+ size: z.ZodNumber;
5
+ cid: z.ZodAny;
6
+ car: z.ZodOptional<z.ZodAny>;
7
+ lastModified: z.ZodOptional<z.ZodNumber>;
8
+ url: z.ZodOptional<z.ZodString>;
9
+ }, z.core.$strip>>;
10
+ export type ProxyDocFileMeta = z.infer<typeof ProxyDocFileMetaSchema>;
11
+ export declare const ProxyDocFilesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
12
+ type: z.ZodString;
13
+ size: z.ZodNumber;
14
+ cid: z.ZodAny;
15
+ car: z.ZodOptional<z.ZodAny>;
16
+ lastModified: z.ZodOptional<z.ZodNumber>;
17
+ url: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>;
19
+ export type ProxyDocFiles = z.infer<typeof ProxyDocFilesSchema>;
20
+ export declare const ProxyDocBaseSchema: z.ZodObject<{
21
+ _id: z.ZodString;
22
+ _files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
23
+ type: z.ZodString;
24
+ size: z.ZodNumber;
25
+ cid: z.ZodAny;
26
+ car: z.ZodOptional<z.ZodAny>;
27
+ lastModified: z.ZodOptional<z.ZodNumber>;
28
+ url: z.ZodOptional<z.ZodString>;
29
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
30
+ _publicFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
31
+ type: z.ZodString;
32
+ size: z.ZodNumber;
33
+ cid: z.ZodAny;
34
+ car: z.ZodOptional<z.ZodAny>;
35
+ lastModified: z.ZodOptional<z.ZodNumber>;
36
+ url: z.ZodOptional<z.ZodString>;
37
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
38
+ _deleted: z.ZodOptional<z.ZodBoolean>;
39
+ }, z.core.$strip>;
40
+ export declare const readonlyDocBaseSchema: z.ZodReadonly<z.ZodObject<{
41
+ _id: z.ZodString;
42
+ _files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
43
+ type: z.ZodString;
44
+ size: z.ZodNumber;
45
+ cid: z.ZodAny;
46
+ car: z.ZodOptional<z.ZodAny>;
47
+ lastModified: z.ZodOptional<z.ZodNumber>;
48
+ url: z.ZodOptional<z.ZodString>;
49
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
50
+ _publicFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
51
+ type: z.ZodString;
52
+ size: z.ZodNumber;
53
+ cid: z.ZodAny;
54
+ car: z.ZodOptional<z.ZodAny>;
55
+ lastModified: z.ZodOptional<z.ZodNumber>;
56
+ url: z.ZodOptional<z.ZodString>;
57
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
58
+ _deleted: z.ZodOptional<z.ZodBoolean>;
59
+ }, z.core.$strip>>;
60
+ export type DocBase = z.infer<typeof readonlyDocBaseSchema>;
61
+ export declare const ProxyDocWithIdSchema: z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
62
+ _id: z.ZodString;
63
+ _files: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
64
+ type: z.ZodString;
65
+ size: z.ZodNumber;
66
+ cid: z.ZodAny;
67
+ car: z.ZodOptional<z.ZodAny>;
68
+ lastModified: z.ZodOptional<z.ZodNumber>;
69
+ url: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
71
+ _publicFiles: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
72
+ type: z.ZodString;
73
+ size: z.ZodNumber;
74
+ cid: z.ZodAny;
75
+ car: z.ZodOptional<z.ZodAny>;
76
+ lastModified: z.ZodOptional<z.ZodNumber>;
77
+ url: z.ZodOptional<z.ZodString>;
78
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>;
79
+ _deleted: z.ZodOptional<z.ZodBoolean>;
80
+ }, z.core.$strip>>, z.ZodAny]>;
81
+ export type ProxyDocWithId<T> = z.infer<typeof ProxyDocWithIdSchema> & T;
82
+ export declare function DocSetSchema<T extends z.ZodTypeAny>(docSchema: T): z.ZodIntersection<z.ZodReadonly<z.ZodObject<{
83
+ _id: z.ZodOptional<z.ZodString>;
84
+ _files: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
85
+ type: z.ZodString;
86
+ size: z.ZodNumber;
87
+ cid: z.ZodAny;
88
+ car: z.ZodOptional<z.ZodAny>;
89
+ lastModified: z.ZodOptional<z.ZodNumber>;
90
+ url: z.ZodOptional<z.ZodString>;
91
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>>;
92
+ _publicFiles: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodReadonly<z.ZodObject<{
93
+ type: z.ZodString;
94
+ size: z.ZodNumber;
95
+ cid: z.ZodAny;
96
+ car: z.ZodOptional<z.ZodAny>;
97
+ lastModified: z.ZodOptional<z.ZodNumber>;
98
+ url: z.ZodOptional<z.ZodString>;
99
+ }, z.core.$strip>>, z.ZodCustom<File, File>]>>>>;
100
+ _deleted: z.ZodOptional<z.ZodOptional<z.ZodBoolean>>;
101
+ }, z.core.$strip>>, T>;
102
+ export type DocSet<T> = z.infer<ReturnType<typeof DocSetSchema<z.ZodType<T>>>>;
@@ -0,0 +1,33 @@
1
+ import { z } from "zod";
2
+ export const ProxyDocFileMetaSchema = z
3
+ .object({
4
+ type: z.string(),
5
+ size: z.number(),
6
+ cid: z.any(), // AnyLink type - would need proper schema if AnyLink has a specific structure
7
+ car: z.any().optional(), // AnyLink type
8
+ lastModified: z.number().optional(),
9
+ url: z.string().optional(),
10
+ })
11
+ .readonly();
12
+ export const ProxyDocFilesSchema = z.record(z.string(), z.union([ProxyDocFileMetaSchema, z.instanceof(File)]));
13
+ export const ProxyDocBaseSchema = z.object({
14
+ _id: z.string(),
15
+ _files: ProxyDocFilesSchema.optional(),
16
+ _publicFiles: ProxyDocFilesSchema.optional(),
17
+ _deleted: z.boolean().optional(),
18
+ });
19
+ export const readonlyDocBaseSchema = z.readonly(ProxyDocBaseSchema);
20
+ const PartialDocBaseSchema = z
21
+ .object({
22
+ _id: z.string(),
23
+ _files: ProxyDocFilesSchema.optional(),
24
+ _publicFiles: ProxyDocFilesSchema.optional(),
25
+ _deleted: z.boolean().optional(),
26
+ })
27
+ .partial()
28
+ .readonly();
29
+ export const ProxyDocWithIdSchema = z.union([readonlyDocBaseSchema, z.any()]);
30
+ export function DocSetSchema(docSchema) {
31
+ return PartialDocBaseSchema.and(docSchema);
32
+ }
33
+ //# sourceMappingURL=doc-base.zod.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc-base.zod.js","sourceRoot":"","sources":["../jsr/doc-base.zod.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC;KACpC,MA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EAAE,CAAC;AAgBd,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;AAc9E,MAAM,UAAU,YAAY,CAAyB,SAAY,EAAE;IACjE,OAAO,oBAAoB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;AAAA,CAC5C"}
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./transport.js";
2
+ export * from "./database-protocol.zod.js";
package/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from "./transport.js";
2
+ export * from "./database-protocol.zod.js";
3
+ //# sourceMappingURL=index.js.map
package/index.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../jsr/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC"}
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "@fireproof/core-svc-protocol",
3
+ "version": "0.24.0-dev-multi-clerks-0",
4
+ "description": "Fireproof service layer protocols and interfaces.",
5
+ "type": "module",
6
+ "main": "./index.js",
7
+ "keywords": [
8
+ "ledger",
9
+ "JSON",
10
+ "document",
11
+ "IPLD",
12
+ "CID",
13
+ "IPFS"
14
+ ],
15
+ "contributors": [
16
+ "J Chris Anderson",
17
+ "Alan Shaw",
18
+ "Travis Vachon",
19
+ "Mikeal Rogers",
20
+ "Meno Abels"
21
+ ],
22
+ "author": "J Chris Anderson",
23
+ "license": "AFL-2.0",
24
+ "homepage": "https://use-fireproof.com",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "git+https://github.com/fireproof-storage/fireproof.git"
28
+ },
29
+ "bugs": {
30
+ "url": "https://github.com/fireproof-storage/fireproof/issues"
31
+ },
32
+ "dependencies": {
33
+ "@adviser/cement": "^0.5.1",
34
+ "@fireproof/core-runtime": "0.24.0-dev-multi-clerks-0",
35
+ "@fireproof/core-types-base": "0.24.0-dev-multi-clerks-0",
36
+ "@fireproof/core-types-blockstore": "0.24.0-dev-multi-clerks-0",
37
+ "cborg": "^4.3.0",
38
+ "zod": "^4.1.13"
39
+ },
40
+ "scripts": {
41
+ "build": "core-cli tsc"
42
+ }
43
+ }