@camstack/types 1.2.379 → 1.2.380

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,399 @@
1
+ import { z } from 'zod';
2
+ import { type InferProvider } from './capability-definition.js';
3
+ /**
4
+ * records - an addon's own facts and documents (D881): ledgers, audit rows,
5
+ * config documents, mirrors. The third storage API next to `ctx.settings`
6
+ * (operator intent, D870) and device-history (numbers over time, D850).
7
+ *
8
+ * Who the OWNER is: `callerAddonId`, stamped by the transport on a call that
9
+ * crossed a process and stated by a hub in-process caller (`ctx.records` does
10
+ * that with the addon id closed over). It is deliberately NOT in any input
11
+ * schema, so a session can never supply it, and a call with no stamp is refused
12
+ * `records/no-caller`. A kind is readable and writable only by its owner; other
13
+ * addons go through the owner's capability.
14
+ *
15
+ * Every read is three-way: a row, `null`, or the call THROWS. A failed read is
16
+ * never `[]`. Secret fields are never on the wire: a read shows the
17
+ * redaction token, `secretRefs` hands the owner's `ctx.secrets` the refs it
18
+ * resolves itself, and a write may carry only a keychain marker bound to the
19
+ * row's own ref.
20
+ *
21
+ * Internal: addons reach it through `ctx.records`, never directly.
22
+ */
23
+ export declare const RecordIdSchema: z.ZodString;
24
+ /** A JSON object body. Size is the engine's check (`maxDataBytes`), not a schema's. */
25
+ export declare const RecordBodySchema: z.ZodRecord<z.ZodString, z.ZodUnknown>;
26
+ export declare const RecordInputSchema: z.ZodObject<{
27
+ id: z.ZodString;
28
+ deviceId: z.ZodOptional<z.ZodNumber>;
29
+ at: z.ZodOptional<z.ZodNumber>;
30
+ expiresAt: z.ZodOptional<z.ZodNumber>;
31
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
32
+ }, z.core.$strip>;
33
+ export type RecordInput = z.infer<typeof RecordInputSchema>;
34
+ export declare const RecordViewSchema: z.ZodObject<{
35
+ id: z.ZodString;
36
+ deviceId: z.ZodNullable<z.ZodNumber>;
37
+ at: z.ZodNullable<z.ZodNumber>;
38
+ expiresAt: z.ZodNullable<z.ZodNumber>;
39
+ rev: z.ZodNumber;
40
+ updatedAt: z.ZodNumber;
41
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
42
+ }, z.core.$strip>;
43
+ export type RecordView = z.infer<typeof RecordViewSchema>;
44
+ /** One predicate on a declared index field: equality, a set, or a range. */
45
+ export declare const RecordWhereValueSchema: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
46
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
49
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
50
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
51
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
52
+ }, z.core.$strip>]>;
53
+ export type RecordWhereValue = z.infer<typeof RecordWhereValueSchema>;
54
+ /** Declared index fields only. Anything else does not compile, by design. */
55
+ export declare const RecordWhereSchema: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
56
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
57
+ }, z.core.$strip>, z.ZodObject<{
58
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
59
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
60
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
61
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
62
+ }, z.core.$strip>]>>;
63
+ export type RecordWhere = z.infer<typeof RecordWhereSchema>;
64
+ export declare const RecordQueryInputSchema: z.ZodObject<{
65
+ kind: z.ZodString;
66
+ deviceId: z.ZodOptional<z.ZodNumber>;
67
+ atFrom: z.ZodOptional<z.ZodNumber>;
68
+ atTo: z.ZodOptional<z.ZodNumber>;
69
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
70
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
71
+ }, z.core.$strip>, z.ZodObject<{
72
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
73
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
74
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
75
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
76
+ }, z.core.$strip>]>>>;
77
+ order: z.ZodOptional<z.ZodEnum<{
78
+ at: "at";
79
+ id: "id";
80
+ }>>;
81
+ desc: z.ZodOptional<z.ZodBoolean>;
82
+ limit: z.ZodDefault<z.ZodNumber>;
83
+ cursor: z.ZodOptional<z.ZodString>;
84
+ }, z.core.$strip>;
85
+ export type RecordQueryInput = z.infer<typeof RecordQueryInputSchema>;
86
+ export declare const RecordQueryResultSchema: z.ZodObject<{
87
+ records: z.ZodArray<z.ZodObject<{
88
+ id: z.ZodString;
89
+ deviceId: z.ZodNullable<z.ZodNumber>;
90
+ at: z.ZodNullable<z.ZodNumber>;
91
+ expiresAt: z.ZodNullable<z.ZodNumber>;
92
+ rev: z.ZodNumber;
93
+ updatedAt: z.ZodNumber;
94
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
95
+ }, z.core.$strip>>;
96
+ nextCursor: z.ZodNullable<z.ZodString>;
97
+ }, z.core.$strip>;
98
+ export type RecordQueryResult = z.infer<typeof RecordQueryResultSchema>;
99
+ export declare const RecordKindStateSchema: z.ZodEnum<{
100
+ created: "created";
101
+ unchanged: "unchanged";
102
+ updated: "updated";
103
+ }>;
104
+ export declare const DeclareKindResultSchema: z.ZodObject<{
105
+ kindId: z.ZodNumber;
106
+ state: z.ZodEnum<{
107
+ created: "created";
108
+ unchanged: "unchanged";
109
+ updated: "updated";
110
+ }>;
111
+ createdIndexes: z.ZodArray<z.ZodString>;
112
+ adoptionPending: z.ZodNullable<z.ZodObject<{
113
+ legacyTable: z.ZodString;
114
+ legacyRows: z.ZodNumber;
115
+ }, z.core.$strip>>;
116
+ }, z.core.$strip>;
117
+ export type DeclareKindResult = z.infer<typeof DeclareKindResultSchema>;
118
+ export declare const RecordSecretRefsSchema: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>;
119
+ export declare const recordsCapability: {
120
+ readonly name: 'records';
121
+ readonly scope: 'system';
122
+ readonly mode: 'singleton';
123
+ readonly internal: true;
124
+ readonly methods: {
125
+ /** Reconcile this addon's kinds: create the catalog rows and the declared indexes. Additive only. */
126
+ readonly declareKinds: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
127
+ kinds: z.ZodRecord<z.ZodString, z.ZodObject<{
128
+ database: z.ZodDefault<z.ZodEnum<{
129
+ events: "events";
130
+ settings: "settings";
131
+ }>>;
132
+ class: z.ZodEnum<{
133
+ audit: "audit";
134
+ config: "config";
135
+ ephemeral: "ephemeral";
136
+ ledger: "ledger";
137
+ mirror: "mirror";
138
+ }>;
139
+ writeTrigger: z.ZodString;
140
+ device: z.ZodDefault<z.ZodEnum<{
141
+ none: "none";
142
+ optional: "optional";
143
+ required: "required";
144
+ }>>;
145
+ at: z.ZodDefault<z.ZodEnum<{
146
+ none: "none";
147
+ required: "required";
148
+ }>>;
149
+ indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
150
+ name: z.ZodString;
151
+ fields: z.ZodArray<z.ZodString>;
152
+ unique: z.ZodOptional<z.ZodBoolean>;
153
+ }, z.core.$strict>>>;
154
+ retention: z.ZodUnion<readonly [z.ZodObject<{
155
+ ttlMs: z.ZodNumber;
156
+ from: z.ZodEnum<{
157
+ at: "at";
158
+ write: "write";
159
+ }>;
160
+ }, z.core.$strict>, z.ZodObject<{
161
+ maxRows: z.ZodOptional<z.ZodNumber>;
162
+ maxRowsPerDevice: z.ZodOptional<z.ZodNumber>;
163
+ }, z.core.$strict>, z.ZodObject<{
164
+ owner: z.ZodString;
165
+ reason: z.ZodString;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ none: z.ZodString;
168
+ }, z.core.$strict>]>;
169
+ deviceRemoval: z.ZodDefault<z.ZodEnum<{
170
+ delete: "delete";
171
+ none: "none";
172
+ }>>;
173
+ maxDataBytes: z.ZodDefault<z.ZodNumber>;
174
+ secretPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
175
+ secretArrayKeys: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
176
+ adoptsFrom: z.ZodOptional<z.ZodString>;
177
+ transactFamily: z.ZodOptional<z.ZodString>;
178
+ entry: z.ZodOptional<z.ZodObject<{
179
+ title: z.ZodString;
180
+ nameField: z.ZodString;
181
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
182
+ }, z.core.$strict>>;
183
+ }, z.core.$strict>>;
184
+ }, z.core.$strip>, z.ZodObject<{
185
+ kinds: z.ZodRecord<z.ZodString, z.ZodObject<{
186
+ kindId: z.ZodNumber;
187
+ state: z.ZodEnum<{
188
+ created: "created";
189
+ unchanged: "unchanged";
190
+ updated: "updated";
191
+ }>;
192
+ createdIndexes: z.ZodArray<z.ZodString>;
193
+ adoptionPending: z.ZodNullable<z.ZodObject<{
194
+ legacyTable: z.ZodString;
195
+ legacyRows: z.ZodNumber;
196
+ }, z.core.$strip>>;
197
+ }, z.core.$strip>>;
198
+ }, z.core.$strip>, "mutation">;
199
+ readonly get: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
200
+ kind: z.ZodString;
201
+ id: z.ZodString;
202
+ }, z.core.$strip>, z.ZodNullable<z.ZodObject<{
203
+ id: z.ZodString;
204
+ deviceId: z.ZodNullable<z.ZodNumber>;
205
+ at: z.ZodNullable<z.ZodNumber>;
206
+ expiresAt: z.ZodNullable<z.ZodNumber>;
207
+ rev: z.ZodNumber;
208
+ updatedAt: z.ZodNumber;
209
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
210
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
211
+ readonly getMany: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
212
+ kind: z.ZodString;
213
+ ids: z.ZodArray<z.ZodString>;
214
+ }, z.core.$strip>, z.ZodArray<z.ZodObject<{
215
+ id: z.ZodString;
216
+ deviceId: z.ZodNullable<z.ZodNumber>;
217
+ at: z.ZodNullable<z.ZodNumber>;
218
+ expiresAt: z.ZodNullable<z.ZodNumber>;
219
+ rev: z.ZodNumber;
220
+ updatedAt: z.ZodNumber;
221
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
222
+ }, z.core.$strip>>, import("./capability-definition.js").CapabilityMethodKind>;
223
+ /** The keychain refs of the rows' secret fields, by id and concrete path. For the owner's `ctx.secrets`. */
224
+ readonly secretRefs: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
225
+ kind: z.ZodString;
226
+ ids: z.ZodArray<z.ZodString>;
227
+ }, z.core.$strip>, z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>>, import("./capability-definition.js").CapabilityMethodKind>;
228
+ readonly put: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
229
+ kind: z.ZodString;
230
+ record: z.ZodObject<{
231
+ id: z.ZodString;
232
+ deviceId: z.ZodOptional<z.ZodNumber>;
233
+ at: z.ZodOptional<z.ZodNumber>;
234
+ expiresAt: z.ZodOptional<z.ZodNumber>;
235
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
236
+ }, z.core.$strip>;
237
+ ifRev: z.ZodOptional<z.ZodNumber>;
238
+ }, z.core.$strip>, z.ZodObject<{
239
+ rev: z.ZodNumber;
240
+ releasedRefs: z.ZodArray<z.ZodString>;
241
+ }, z.core.$strip>, "mutation">;
242
+ readonly putMany: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
243
+ kind: z.ZodString;
244
+ records: z.ZodArray<z.ZodObject<{
245
+ id: z.ZodString;
246
+ deviceId: z.ZodOptional<z.ZodNumber>;
247
+ at: z.ZodOptional<z.ZodNumber>;
248
+ expiresAt: z.ZodOptional<z.ZodNumber>;
249
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
250
+ }, z.core.$strip>>;
251
+ }, z.core.$strip>, z.ZodObject<{
252
+ count: z.ZodNumber;
253
+ releasedRefs: z.ZodArray<z.ZodString>;
254
+ }, z.core.$strip>, "mutation">;
255
+ /** One-statement RFC 7396 merge: `null` removes a field; a merge never reads. */
256
+ readonly patch: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
257
+ kind: z.ZodString;
258
+ id: z.ZodString;
259
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
260
+ at: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
261
+ expiresAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
262
+ ifRev: z.ZodOptional<z.ZodNumber>;
263
+ }, z.core.$strip>, z.ZodObject<{
264
+ rev: z.ZodNumber;
265
+ releasedRefs: z.ZodArray<z.ZodString>;
266
+ }, z.core.$strip>, "mutation">;
267
+ readonly delete: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
268
+ kind: z.ZodString;
269
+ id: z.ZodString;
270
+ }, z.core.$strip>, z.ZodObject<{
271
+ deleted: z.ZodBoolean;
272
+ secretRefs: z.ZodArray<z.ZodString>;
273
+ }, z.core.$strip>, "mutation">;
274
+ readonly deleteMany: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
275
+ kind: z.ZodString;
276
+ ids: z.ZodArray<z.ZodString>;
277
+ }, z.core.$strip>, z.ZodObject<{
278
+ deleted: z.ZodNumber;
279
+ secretRefs: z.ZodArray<z.ZodString>;
280
+ }, z.core.$strip>, "mutation">;
281
+ readonly query: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
282
+ kind: z.ZodString;
283
+ deviceId: z.ZodOptional<z.ZodNumber>;
284
+ atFrom: z.ZodOptional<z.ZodNumber>;
285
+ atTo: z.ZodOptional<z.ZodNumber>;
286
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
287
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
288
+ }, z.core.$strip>, z.ZodObject<{
289
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
290
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
291
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
292
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
293
+ }, z.core.$strip>]>>>;
294
+ order: z.ZodOptional<z.ZodEnum<{
295
+ at: "at";
296
+ id: "id";
297
+ }>>;
298
+ desc: z.ZodOptional<z.ZodBoolean>;
299
+ limit: z.ZodDefault<z.ZodNumber>;
300
+ cursor: z.ZodOptional<z.ZodString>;
301
+ }, z.core.$strip>, z.ZodObject<{
302
+ records: z.ZodArray<z.ZodObject<{
303
+ id: z.ZodString;
304
+ deviceId: z.ZodNullable<z.ZodNumber>;
305
+ at: z.ZodNullable<z.ZodNumber>;
306
+ expiresAt: z.ZodNullable<z.ZodNumber>;
307
+ rev: z.ZodNumber;
308
+ updatedAt: z.ZodNumber;
309
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
310
+ }, z.core.$strip>>;
311
+ nextCursor: z.ZodNullable<z.ZodString>;
312
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
313
+ readonly count: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
314
+ kind: z.ZodString;
315
+ deviceId: z.ZodOptional<z.ZodNumber>;
316
+ atFrom: z.ZodOptional<z.ZodNumber>;
317
+ atTo: z.ZodOptional<z.ZodNumber>;
318
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
319
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
320
+ }, z.core.$strip>, z.ZodObject<{
321
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
322
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
323
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
324
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
325
+ }, z.core.$strip>]>>>;
326
+ }, z.core.$strip>, z.ZodObject<{
327
+ count: z.ZodNumber;
328
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
329
+ readonly histogram: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
330
+ kind: z.ZodString;
331
+ deviceId: z.ZodOptional<z.ZodNumber>;
332
+ from: z.ZodNumber;
333
+ to: z.ZodNumber;
334
+ bucketMs: z.ZodNumber;
335
+ }, z.core.$strip>, z.ZodObject<{
336
+ buckets: z.ZodArray<z.ZodObject<{
337
+ bucketStart: z.ZodNumber;
338
+ count: z.ZodNumber;
339
+ }, z.core.$strip>>;
340
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
341
+ /** Index-served only: every field must belong to ONE declared index. */
342
+ readonly aggregate: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
343
+ kind: z.ZodString;
344
+ op: z.ZodEnum<{
345
+ count: "count";
346
+ max: "max";
347
+ min: "min";
348
+ sum: "sum";
349
+ }>;
350
+ field: z.ZodOptional<z.ZodString>;
351
+ groupBy: z.ZodOptional<z.ZodString>;
352
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
353
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
354
+ }, z.core.$strip>, z.ZodObject<{
355
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
356
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
357
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
358
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
359
+ }, z.core.$strip>]>>>;
360
+ }, z.core.$strip>, z.ZodObject<{
361
+ rows: z.ZodArray<z.ZodObject<{
362
+ group: z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodNull]>;
363
+ value: z.ZodNullable<z.ZodNumber>;
364
+ }, z.core.$strip>>;
365
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
366
+ /** Batched (5 000 rows per statement, yielding between). Needs a predicate: there is no "delete all". */
367
+ readonly deleteWhere: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
368
+ kind: z.ZodString;
369
+ deviceId: z.ZodOptional<z.ZodNumber>;
370
+ atBefore: z.ZodOptional<z.ZodNumber>;
371
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
372
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
373
+ }, z.core.$strip>, z.ZodObject<{
374
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
375
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
376
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
377
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
378
+ }, z.core.$strip>]>>>;
379
+ }, z.core.$strip>, z.ZodObject<{
380
+ deleted: z.ZodNumber;
381
+ secretRefs: z.ZodArray<z.ZodString>;
382
+ }, z.core.$strip>, "mutation">;
383
+ /** The D865 hook body: every kind of this addon declared `deviceRemoval: 'delete'`. */
384
+ readonly deleteDevice: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
385
+ deviceId: z.ZodNumber;
386
+ kinds: z.ZodOptional<z.ZodArray<z.ZodString>>;
387
+ }, z.core.$strip>, z.ZodObject<{
388
+ deleted: z.ZodRecord<z.ZodString, z.ZodNumber>;
389
+ secretRefs: z.ZodArray<z.ZodString>;
390
+ }, z.core.$strip>, "mutation">;
391
+ /** A monotonically increasing integer per kind (replaces "resume from the highest"). */
392
+ readonly allocateId: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
393
+ kind: z.ZodString;
394
+ }, z.core.$strip>, z.ZodObject<{
395
+ id: z.ZodNumber;
396
+ }, z.core.$strip>, "mutation">;
397
+ };
398
+ };
399
+ export type IRecordsProvider = InferProvider<typeof recordsCapability>;
@@ -9,6 +9,98 @@ export declare const StorageTableSchema: z.ZodObject<{
9
9
  declaredThisBoot: z.ZodBoolean;
10
10
  }, z.core.$strip>;
11
11
  export type StorageTable = z.infer<typeof StorageTableSchema>;
12
+ /** One declared record kind (D881) as System -> Data shows it. */
13
+ export declare const StorageKindSchema: z.ZodObject<{
14
+ owner: z.ZodString;
15
+ kind: z.ZodString;
16
+ database: z.ZodEnum<{
17
+ events: "events";
18
+ settings: "settings";
19
+ }>;
20
+ class: z.ZodString;
21
+ state: z.ZodEnum<{
22
+ declared: "declared";
23
+ dropped: "dropped";
24
+ orphaned: "orphaned";
25
+ }>;
26
+ rows: z.ZodNullable<z.ZodNumber>;
27
+ bytesEstimate: z.ZodNullable<z.ZodNumber>;
28
+ writeTrigger: z.ZodString;
29
+ retention: z.ZodUnion<readonly [z.ZodObject<{
30
+ ttlMs: z.ZodNumber;
31
+ from: z.ZodEnum<{
32
+ at: "at";
33
+ write: "write";
34
+ }>;
35
+ }, z.core.$strict>, z.ZodObject<{
36
+ maxRows: z.ZodOptional<z.ZodNumber>;
37
+ maxRowsPerDevice: z.ZodOptional<z.ZodNumber>;
38
+ }, z.core.$strict>, z.ZodObject<{
39
+ owner: z.ZodString;
40
+ reason: z.ZodString;
41
+ }, z.core.$strict>, z.ZodObject<{
42
+ none: z.ZodString;
43
+ }, z.core.$strict>]>;
44
+ entry: z.ZodBoolean;
45
+ declaration: z.ZodObject<{
46
+ database: z.ZodDefault<z.ZodEnum<{
47
+ events: "events";
48
+ settings: "settings";
49
+ }>>;
50
+ class: z.ZodEnum<{
51
+ audit: "audit";
52
+ config: "config";
53
+ ephemeral: "ephemeral";
54
+ ledger: "ledger";
55
+ mirror: "mirror";
56
+ }>;
57
+ writeTrigger: z.ZodString;
58
+ device: z.ZodDefault<z.ZodEnum<{
59
+ none: "none";
60
+ optional: "optional";
61
+ required: "required";
62
+ }>>;
63
+ at: z.ZodDefault<z.ZodEnum<{
64
+ none: "none";
65
+ required: "required";
66
+ }>>;
67
+ indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
68
+ name: z.ZodString;
69
+ fields: z.ZodArray<z.ZodString>;
70
+ unique: z.ZodOptional<z.ZodBoolean>;
71
+ }, z.core.$strict>>>;
72
+ retention: z.ZodUnion<readonly [z.ZodObject<{
73
+ ttlMs: z.ZodNumber;
74
+ from: z.ZodEnum<{
75
+ at: "at";
76
+ write: "write";
77
+ }>;
78
+ }, z.core.$strict>, z.ZodObject<{
79
+ maxRows: z.ZodOptional<z.ZodNumber>;
80
+ maxRowsPerDevice: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strict>, z.ZodObject<{
82
+ owner: z.ZodString;
83
+ reason: z.ZodString;
84
+ }, z.core.$strict>, z.ZodObject<{
85
+ none: z.ZodString;
86
+ }, z.core.$strict>]>;
87
+ deviceRemoval: z.ZodDefault<z.ZodEnum<{
88
+ delete: "delete";
89
+ none: "none";
90
+ }>>;
91
+ maxDataBytes: z.ZodDefault<z.ZodNumber>;
92
+ secretPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
93
+ secretArrayKeys: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
94
+ adoptsFrom: z.ZodOptional<z.ZodString>;
95
+ transactFamily: z.ZodOptional<z.ZodString>;
96
+ entry: z.ZodOptional<z.ZodObject<{
97
+ title: z.ZodString;
98
+ nameField: z.ZodString;
99
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
100
+ }, z.core.$strict>>;
101
+ }, z.core.$strict>;
102
+ }, z.core.$strip>;
103
+ export type StorageKind = z.infer<typeof StorageKindSchema>;
12
104
  /**
13
105
  * The collections retired by exact name: the D870 ones (their data became keys
14
106
  * of the camera's settings) and the three D871 leftovers (the `stats-5m` tables
@@ -71,6 +163,160 @@ export declare const storageAdminCapability: {
71
163
  dropped: z.ZodLiteral<true>;
72
164
  rows: z.ZodNumber;
73
165
  }, z.core.$strip>, "mutation">;
166
+ /** Every record kind of both files with rows, a size estimate, class and retention (D881). */
167
+ readonly listKinds: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
168
+ owner: z.ZodOptional<z.ZodString>;
169
+ counts: z.ZodOptional<z.ZodBoolean>;
170
+ }, z.core.$strip>, z.ZodObject<{
171
+ kinds: z.ZodArray<z.ZodObject<{
172
+ owner: z.ZodString;
173
+ kind: z.ZodString;
174
+ database: z.ZodEnum<{
175
+ events: "events";
176
+ settings: "settings";
177
+ }>;
178
+ class: z.ZodString;
179
+ state: z.ZodEnum<{
180
+ declared: "declared";
181
+ dropped: "dropped";
182
+ orphaned: "orphaned";
183
+ }>;
184
+ rows: z.ZodNullable<z.ZodNumber>;
185
+ bytesEstimate: z.ZodNullable<z.ZodNumber>;
186
+ writeTrigger: z.ZodString;
187
+ retention: z.ZodUnion<readonly [z.ZodObject<{
188
+ ttlMs: z.ZodNumber;
189
+ from: z.ZodEnum<{
190
+ at: "at";
191
+ write: "write";
192
+ }>;
193
+ }, z.core.$strict>, z.ZodObject<{
194
+ maxRows: z.ZodOptional<z.ZodNumber>;
195
+ maxRowsPerDevice: z.ZodOptional<z.ZodNumber>;
196
+ }, z.core.$strict>, z.ZodObject<{
197
+ owner: z.ZodString;
198
+ reason: z.ZodString;
199
+ }, z.core.$strict>, z.ZodObject<{
200
+ none: z.ZodString;
201
+ }, z.core.$strict>]>;
202
+ entry: z.ZodBoolean;
203
+ declaration: z.ZodObject<{
204
+ database: z.ZodDefault<z.ZodEnum<{
205
+ events: "events";
206
+ settings: "settings";
207
+ }>>;
208
+ class: z.ZodEnum<{
209
+ audit: "audit";
210
+ config: "config";
211
+ ephemeral: "ephemeral";
212
+ ledger: "ledger";
213
+ mirror: "mirror";
214
+ }>;
215
+ writeTrigger: z.ZodString;
216
+ device: z.ZodDefault<z.ZodEnum<{
217
+ none: "none";
218
+ optional: "optional";
219
+ required: "required";
220
+ }>>;
221
+ at: z.ZodDefault<z.ZodEnum<{
222
+ none: "none";
223
+ required: "required";
224
+ }>>;
225
+ indexes: z.ZodDefault<z.ZodArray<z.ZodObject<{
226
+ name: z.ZodString;
227
+ fields: z.ZodArray<z.ZodString>;
228
+ unique: z.ZodOptional<z.ZodBoolean>;
229
+ }, z.core.$strict>>>;
230
+ retention: z.ZodUnion<readonly [z.ZodObject<{
231
+ ttlMs: z.ZodNumber;
232
+ from: z.ZodEnum<{
233
+ at: "at";
234
+ write: "write";
235
+ }>;
236
+ }, z.core.$strict>, z.ZodObject<{
237
+ maxRows: z.ZodOptional<z.ZodNumber>;
238
+ maxRowsPerDevice: z.ZodOptional<z.ZodNumber>;
239
+ }, z.core.$strict>, z.ZodObject<{
240
+ owner: z.ZodString;
241
+ reason: z.ZodString;
242
+ }, z.core.$strict>, z.ZodObject<{
243
+ none: z.ZodString;
244
+ }, z.core.$strict>]>;
245
+ deviceRemoval: z.ZodDefault<z.ZodEnum<{
246
+ delete: "delete";
247
+ none: "none";
248
+ }>>;
249
+ maxDataBytes: z.ZodDefault<z.ZodNumber>;
250
+ secretPaths: z.ZodDefault<z.ZodArray<z.ZodString>>;
251
+ secretArrayKeys: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodString>>;
252
+ adoptsFrom: z.ZodOptional<z.ZodString>;
253
+ transactFamily: z.ZodOptional<z.ZodString>;
254
+ entry: z.ZodOptional<z.ZodObject<{
255
+ title: z.ZodString;
256
+ nameField: z.ZodString;
257
+ fields: z.ZodRecord<z.ZodString, z.ZodUnknown>;
258
+ }, z.core.$strict>>;
259
+ }, z.core.$strict>;
260
+ }, z.core.$strip>>;
261
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
262
+ /**
263
+ * Read-only diagnosis of ANY owner's kind: the same indexed query as the
264
+ * owner's, secret fields redacted, audited in the engine log.
265
+ */
266
+ readonly readRecords: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
267
+ deviceId: z.ZodOptional<z.ZodNumber>;
268
+ atFrom: z.ZodOptional<z.ZodNumber>;
269
+ atTo: z.ZodOptional<z.ZodNumber>;
270
+ where: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
271
+ in: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
272
+ }, z.core.$strip>, z.ZodObject<{
273
+ gt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
274
+ gte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
275
+ lt: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
276
+ lte: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>;
277
+ }, z.core.$strip>]>>>;
278
+ order: z.ZodOptional<z.ZodEnum<{
279
+ at: "at";
280
+ id: "id";
281
+ }>>;
282
+ desc: z.ZodOptional<z.ZodBoolean>;
283
+ limit: z.ZodDefault<z.ZodNumber>;
284
+ cursor: z.ZodOptional<z.ZodString>;
285
+ owner: z.ZodString;
286
+ kind: z.ZodString;
287
+ }, z.core.$strip>, z.ZodObject<{
288
+ records: z.ZodArray<z.ZodObject<{
289
+ id: z.ZodString;
290
+ deviceId: z.ZodNullable<z.ZodNumber>;
291
+ at: z.ZodNullable<z.ZodNumber>;
292
+ expiresAt: z.ZodNullable<z.ZodNumber>;
293
+ rev: z.ZodNumber;
294
+ updatedAt: z.ZodNumber;
295
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
296
+ }, z.core.$strip>>;
297
+ nextCursor: z.ZodNullable<z.ZodString>;
298
+ }, z.core.$strip>, import("./capability-definition.js").CapabilityMethodKind>;
299
+ /**
300
+ * The migration copy path (D881): write rows into a kind AS ITS DECLARED
301
+ * OWNER. Refused when that owner's manifest does not declare the kind.
302
+ * Idempotent (a put by id, so a re-run resumes). A secret field carries a
303
+ * keychain marker bound to the row's own ref - the operator script imports
304
+ * the value first - and a plain string there is refused.
305
+ */
306
+ readonly adoptRecords: import("./capability-definition.js").CapabilityMethodSchema<z.ZodObject<{
307
+ owner: z.ZodString;
308
+ kind: z.ZodString;
309
+ records: z.ZodArray<z.ZodObject<{
310
+ id: z.ZodString;
311
+ deviceId: z.ZodOptional<z.ZodNumber>;
312
+ at: z.ZodOptional<z.ZodNumber>;
313
+ expiresAt: z.ZodOptional<z.ZodNumber>;
314
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
315
+ }, z.core.$strip>>;
316
+ complete: z.ZodOptional<z.ZodBoolean>;
317
+ }, z.core.$strip>, z.ZodObject<{
318
+ adopted: z.ZodNumber;
319
+ }, z.core.$strip>, "mutation">;
74
320
  };
75
321
  };
76
322
  export type IStorageAdminProvider = InferProvider<typeof storageAdminCapability>;
package/dist/client.js CHANGED
@@ -28076,6 +28076,12 @@ function createSystemProxy(api) {
28076
28076
  assignPlates: (input) => dispatch("plateGallery", "assignPlates", "mutation", input),
28077
28077
  unassignPlates: (input) => dispatch("plateGallery", "unassignPlates", "mutation", input)
28078
28078
  },
28079
+ recordEntries: {
28080
+ listEntryKinds: (input) => dispatch("recordEntries", "listEntryKinds", "query", input),
28081
+ listEntries: (input) => dispatch("recordEntries", "listEntries", "query", input),
28082
+ putEntry: (input) => dispatch("recordEntries", "putEntry", "mutation", input),
28083
+ deleteEntry: (input) => dispatch("recordEntries", "deleteEntry", "mutation", input)
28084
+ },
28079
28085
  recordingArchive: {
28080
28086
  getAvailabilityBatch: (input) => dispatch("recordingArchive", "getAvailabilityBatch", "query", input),
28081
28087
  getDaysWithRecordingsBatch: (input) => dispatch("recordingArchive", "getDaysWithRecordingsBatch", "query", input),