@geonosis/document 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -0
- package/README.md +23 -15
- package/dist/index.cjs +111 -67
- package/dist/index.d.cts +50 -39
- package/dist/index.d.ts +50 -39
- package/dist/index.js +109 -67
- package/migrations/0001_documents.sql +21 -13
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
export { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
|
-
import { EntityColumns, EntityName, SessionSettings, EntityMigration,
|
|
3
|
+
import { EntityColumns, EntityName, FreezeRegister, TenantPolicyNames, SessionSettings, EntityMigration, Executor, Projection, Query, EntityListing, EntityPage, EntityUndo, SessionSeam } from '@geonosis/db';
|
|
4
4
|
export { ENTITY_PLACEHOLDERS as DOCUMENT_MIGRATION_PLACEHOLDERS } from '@geonosis/db';
|
|
5
5
|
|
|
6
6
|
declare const BODY_VERSION_KEY = "_v";
|
|
@@ -259,17 +259,29 @@ type LinkVerifierPort = {
|
|
|
259
259
|
declare const DEFAULT_DOCUMENT_TABLE = "documents";
|
|
260
260
|
declare const DEFAULT_REVISIONS_TABLE = "document_revisions";
|
|
261
261
|
declare const DEFAULT_REVISION_KIND_COLUMN = "revision_kind";
|
|
262
|
+
type HeadField = keyof DocumentHead;
|
|
263
|
+
declare const HEAD_FIELDS: HeadField[];
|
|
262
264
|
type DocumentColumns = EntityColumns & {
|
|
263
265
|
entity?: string;
|
|
266
|
+
heads?: Partial<Record<HeadField, EntityName>>;
|
|
264
267
|
revisionKind?: string;
|
|
265
268
|
total?: EntityName;
|
|
266
269
|
};
|
|
270
|
+
type DocumentPhysicalColumns = Readonly<Record<HeadField, string>> & {
|
|
271
|
+
createdAt: string;
|
|
272
|
+
entity: string;
|
|
273
|
+
tenant: string;
|
|
274
|
+
updatedAt: string;
|
|
275
|
+
};
|
|
276
|
+
declare const physicalColumnsOf: (columns: DocumentColumns | undefined) => DocumentPhysicalColumns;
|
|
267
277
|
type DocumentRevisionsOptions = {
|
|
268
278
|
table?: string;
|
|
269
279
|
};
|
|
270
280
|
type DocumentMigrationsOptions = {
|
|
271
281
|
appRole?: string;
|
|
272
282
|
columns?: DocumentColumns;
|
|
283
|
+
freeze?: FreezeRegister;
|
|
284
|
+
names?: TenantPolicyNames;
|
|
273
285
|
revisions?: DocumentRevisionsOptions | false;
|
|
274
286
|
schema?: string;
|
|
275
287
|
settings: SessionSettings;
|
|
@@ -292,42 +304,41 @@ type StorableDocumentEntity = AnyDocumentEntity & {
|
|
|
292
304
|
prepare: (body: never) => unknown;
|
|
293
305
|
};
|
|
294
306
|
type Registry$1<Map extends Readonly<Record<string, StorableDocumentEntity>>> = ReturnType<typeof documentEntities<Map>>;
|
|
295
|
-
type DocumentStoreOptions<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string> = {
|
|
307
|
+
type DocumentStoreOptions<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string, Handle = Executor> = {
|
|
296
308
|
archive?: ArchivePort;
|
|
297
309
|
columns?: DocumentColumns;
|
|
298
310
|
registry: Registry$1<Map>;
|
|
299
311
|
revisions?: DocumentRevisionsOptions | false;
|
|
300
312
|
schema?: string;
|
|
301
|
-
seam: SessionSeam<Key,
|
|
313
|
+
seam: SessionSeam<Key, Handle>;
|
|
302
314
|
table?: string;
|
|
303
315
|
};
|
|
304
|
-
type HeadColumn =
|
|
316
|
+
type HeadColumn = HeadField | 'entity' | 'number';
|
|
317
|
+
type DocumentSortColumn = HeadField | 'createdAt' | 'number' | 'updatedAt';
|
|
305
318
|
type HeadsOrder = {
|
|
306
|
-
column:
|
|
319
|
+
column: DocumentSortColumn | 'entity';
|
|
307
320
|
direction?: 'asc' | 'desc';
|
|
308
321
|
};
|
|
309
|
-
type HeadsWhere = {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
type
|
|
314
|
-
|
|
322
|
+
type HeadsWhere = Readonly<Partial<Record<HeadField | 'createdAt' | 'updatedAt', unknown | readonly unknown[] | {
|
|
323
|
+
from: unknown;
|
|
324
|
+
to: unknown;
|
|
325
|
+
}>>>;
|
|
326
|
+
type HeadRow<Columns extends readonly HeadColumn[]> = Pick<DocumentHead & {
|
|
327
|
+
entity: string;
|
|
328
|
+
number: string;
|
|
329
|
+
}, Columns[number]>;
|
|
330
|
+
type HeadsArgs<Columns extends readonly HeadColumn[] = readonly HeadColumn[]> = {
|
|
331
|
+
columns: Columns;
|
|
315
332
|
entity?: string | readonly string[];
|
|
316
333
|
order: readonly HeadsOrder[];
|
|
317
334
|
where?: HeadsWhere;
|
|
318
335
|
};
|
|
319
336
|
type AggregateMeasure = 'count' | 'sum:total';
|
|
320
|
-
type AggregateBy =
|
|
337
|
+
type AggregateBy = HeadField | 'entity' | {
|
|
321
338
|
bucket: 'day' | 'month' | 'week';
|
|
322
|
-
of: 'issueDate';
|
|
339
|
+
of: 'dueDate' | 'issueDate';
|
|
323
340
|
};
|
|
324
|
-
type AggregateWhere =
|
|
325
|
-
status?: string;
|
|
326
|
-
} & ({
|
|
327
|
-
createdAt: readonly [number, number];
|
|
328
|
-
} | {
|
|
329
|
-
issueDate: readonly [string, string];
|
|
330
|
-
} | Record<string, never>);
|
|
341
|
+
type AggregateWhere = HeadsWhere;
|
|
331
342
|
type AggregateRow = {
|
|
332
343
|
by?: string;
|
|
333
344
|
count?: number;
|
|
@@ -340,7 +351,6 @@ type AggregateArgs = {
|
|
|
340
351
|
measures: readonly AggregateMeasure[];
|
|
341
352
|
where?: AggregateWhere;
|
|
342
353
|
};
|
|
343
|
-
type SortableHeadColumn = keyof DocumentHead;
|
|
344
354
|
type Item = DocumentInstance<string, unknown>;
|
|
345
355
|
type DocumentKind = 'committed' | 'reinstated' | 'retired';
|
|
346
356
|
type CommitOutput = {
|
|
@@ -393,62 +403,63 @@ type VerifyResult = {
|
|
|
393
403
|
ok: true;
|
|
394
404
|
versions: number;
|
|
395
405
|
};
|
|
396
|
-
type DocumentEntityStore<Key extends string> = Pick<Projection<unknown, Item, Key, 'ref',
|
|
406
|
+
type DocumentEntityStore<Key extends string, Handle> = Pick<Projection<unknown, Item, Key, 'ref', Handle, string, string>, 'get' | 'listAll'> & {
|
|
397
407
|
asOf: Query<Readonly<Record<Key, string>> & {
|
|
398
408
|
at: number;
|
|
399
409
|
ref: string;
|
|
400
|
-
}, Item | null,
|
|
410
|
+
}, Item | null, Handle>;
|
|
401
411
|
at: Query<Readonly<Record<Key, string>> & {
|
|
402
412
|
ref: string;
|
|
403
413
|
version: number;
|
|
404
|
-
}, Item | null,
|
|
414
|
+
}, Item | null, Handle>;
|
|
405
415
|
commit: Query<Readonly<Record<Key, string>> & {
|
|
406
416
|
actor: string;
|
|
407
417
|
body: unknown;
|
|
408
418
|
reason?: string;
|
|
409
419
|
ref: string;
|
|
410
|
-
}, CommitOutput,
|
|
420
|
+
}, CommitOutput, Handle>;
|
|
411
421
|
history: Query<Readonly<Record<Key, string>> & {
|
|
412
422
|
lineage?: number;
|
|
413
423
|
ref: string;
|
|
414
|
-
}, HistoryEntry[],
|
|
424
|
+
}, HistoryEntry[], Handle>;
|
|
425
|
+
list: Query<Readonly<Record<Key, string>> & EntityListing<DocumentSortColumn, HeadField>, EntityPage<Item>, Handle>;
|
|
415
426
|
reinstate: Query<Readonly<Record<Key, string>> & {
|
|
416
427
|
actor: string;
|
|
417
428
|
reason?: string;
|
|
418
429
|
ref: string;
|
|
419
|
-
}, ReinstateOutput,
|
|
430
|
+
}, ReinstateOutput, Handle>;
|
|
420
431
|
retire: Query<Readonly<Record<Key, string>> & {
|
|
421
432
|
actor: string;
|
|
422
433
|
reason?: string;
|
|
423
434
|
ref: string;
|
|
424
|
-
}, RetireOutput,
|
|
435
|
+
}, RetireOutput, Handle>;
|
|
425
436
|
succeed: Query<Readonly<Record<Key, string>> & {
|
|
426
437
|
actor: string;
|
|
427
438
|
body: unknown;
|
|
428
439
|
reason?: string;
|
|
429
440
|
ref: string;
|
|
430
|
-
}, CommitOutput,
|
|
441
|
+
}, CommitOutput, Handle>;
|
|
431
442
|
undos: {
|
|
432
|
-
commit: EntityUndo<CommitOutput,
|
|
433
|
-
retire: EntityUndo<RetireOutput,
|
|
443
|
+
commit: EntityUndo<CommitOutput, Handle>;
|
|
444
|
+
retire: EntityUndo<RetireOutput, Handle>;
|
|
434
445
|
};
|
|
435
446
|
verify: Query<Readonly<Record<Key, string>> & {
|
|
436
447
|
lineage?: number;
|
|
437
448
|
ref: string;
|
|
438
|
-
}, VerifyResult,
|
|
449
|
+
}, VerifyResult, Handle>;
|
|
439
450
|
};
|
|
440
|
-
type DocumentStore<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string> = {
|
|
441
|
-
[Name in keyof Map & string]: DocumentEntityStore<Key>;
|
|
451
|
+
type DocumentStore<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string, Handle = Executor> = {
|
|
452
|
+
[Name in keyof Map & string]: DocumentEntityStore<Key, Handle>;
|
|
442
453
|
} & {
|
|
443
|
-
aggregate: Query<Readonly<Record<Key, string>> & AggregateArgs, AggregateRow[],
|
|
444
|
-
heads:
|
|
454
|
+
aggregate: Query<Readonly<Record<Key, string>> & AggregateArgs, AggregateRow[], Handle>;
|
|
455
|
+
heads: <Columns extends readonly HeadColumn[]>(handle: Handle, params: Readonly<Record<Key, string>> & HeadsArgs<Columns>) => Promise<HeadRow<Columns>[]>;
|
|
445
456
|
rebuild: Query<Readonly<Record<Key, string>> & {
|
|
446
457
|
entity?: string;
|
|
447
458
|
}, {
|
|
448
459
|
rows: number;
|
|
449
|
-
},
|
|
460
|
+
}, Handle>;
|
|
450
461
|
};
|
|
451
|
-
declare const documentStore: <Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string>(options: DocumentStoreOptions<Map, Key>) => DocumentStore<Map, Key>;
|
|
462
|
+
declare const documentStore: <Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string, Handle = Executor>(options: DocumentStoreOptions<Map, Key, Handle>) => DocumentStore<Map, Key, Handle>;
|
|
452
463
|
|
|
453
464
|
type SurfaceVerb = 'query' | 'mutation';
|
|
454
465
|
type SurfaceScope = 'org' | 'public' | 'token';
|
|
@@ -521,4 +532,4 @@ type DocumentSurfaceOptions<Map extends Readonly<Record<string, SurfaceDocumentE
|
|
|
521
532
|
*/
|
|
522
533
|
declare const documentSurface: <Map extends Readonly<Record<string, SurfaceDocumentEntity>>, Key extends string>(options: DocumentSurfaceOptions<Map, Key>) => SurfaceRow[];
|
|
523
534
|
|
|
524
|
-
export { type AggregateArgs, type AggregateBy, type AggregateMeasure, type AggregateRow, type AggregateWhere, type AnyDocumentEntity, type AppendOnlyTablesOptions, type ArchivePort, BODY_VERSION_KEY, type BodyOf, type CardOf, type CommitOutput, DEFAULT_DOCUMENT_TABLE, DEFAULT_REVISIONS_TABLE, DEFAULT_REVISION_KIND_COLUMN, Document, type DocumentBodyMigrations, type DocumentBodyVersion, type DocumentColumns, type DocumentDefinition, type DocumentEntity, type DocumentHead, type DocumentInstance, type DocumentKind, type DocumentMigrationsOptions, type DocumentNumbering, type DocumentRecord, type DocumentRevisionsOptions, type DocumentStatusMachine, type DocumentStore, type DocumentStoreOptions, type DocumentSurfaceOptions, type DraftOf, type FieldKind, type HeadColumn, type HeadsArgs, type HeadsOrder, type HeadsWhere, type HistoryEntry, type IncomingOf, type InstanceOf, type LinkVerifierPort, type NameOf, type PendingCall, type ReinstateOutput, type RetireOutput, type StatusOf, type SurfaceCall, type SurfaceRow, type SurfaceSchemaAdapter, type SurfaceScope, type SurfaceVerb, type TimestampPort, type VerifyResult, type ViewOf, appendOnlyTables, canTransition, canonicalOf, documentBodyVersioning, documentEntities, documentIdentifiers, documentMigrations, documentRoleStatements, documentStore, documentSurface, fieldPatterns, hashOf, isSystemActor, isTerminalStatus, migrateBody, stampBody, systemActor, validatorOf };
|
|
535
|
+
export { type AggregateArgs, type AggregateBy, type AggregateMeasure, type AggregateRow, type AggregateWhere, type AnyDocumentEntity, type AppendOnlyTablesOptions, type ArchivePort, BODY_VERSION_KEY, type BodyOf, type CardOf, type CommitOutput, DEFAULT_DOCUMENT_TABLE, DEFAULT_REVISIONS_TABLE, DEFAULT_REVISION_KIND_COLUMN, Document, type DocumentBodyMigrations, type DocumentBodyVersion, type DocumentColumns, type DocumentDefinition, type DocumentEntity, type DocumentHead, type DocumentInstance, type DocumentKind, type DocumentMigrationsOptions, type DocumentNumbering, type DocumentPhysicalColumns, type DocumentRecord, type DocumentRevisionsOptions, type DocumentSortColumn, type DocumentStatusMachine, type DocumentStore, type DocumentStoreOptions, type DocumentSurfaceOptions, type DraftOf, type FieldKind, HEAD_FIELDS, type HeadColumn, type HeadField, type HeadRow, type HeadsArgs, type HeadsOrder, type HeadsWhere, type HistoryEntry, type IncomingOf, type InstanceOf, type LinkVerifierPort, type NameOf, type PendingCall, type ReinstateOutput, type RetireOutput, type StatusOf, type SurfaceCall, type SurfaceRow, type SurfaceSchemaAdapter, type SurfaceScope, type SurfaceVerb, type TimestampPort, type VerifyResult, type ViewOf, appendOnlyTables, canTransition, canonicalOf, documentBodyVersioning, documentEntities, documentIdentifiers, documentMigrations, documentRoleStatements, documentStore, documentSurface, fieldPatterns, hashOf, isSystemActor, isTerminalStatus, migrateBody, physicalColumnsOf, stampBody, systemActor, validatorOf };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
export { StandardSchemaV1 } from '@standard-schema/spec';
|
|
3
|
-
import { EntityColumns, EntityName, SessionSettings, EntityMigration,
|
|
3
|
+
import { EntityColumns, EntityName, FreezeRegister, TenantPolicyNames, SessionSettings, EntityMigration, Executor, Projection, Query, EntityListing, EntityPage, EntityUndo, SessionSeam } from '@geonosis/db';
|
|
4
4
|
export { ENTITY_PLACEHOLDERS as DOCUMENT_MIGRATION_PLACEHOLDERS } from '@geonosis/db';
|
|
5
5
|
|
|
6
6
|
declare const BODY_VERSION_KEY = "_v";
|
|
@@ -259,17 +259,29 @@ type LinkVerifierPort = {
|
|
|
259
259
|
declare const DEFAULT_DOCUMENT_TABLE = "documents";
|
|
260
260
|
declare const DEFAULT_REVISIONS_TABLE = "document_revisions";
|
|
261
261
|
declare const DEFAULT_REVISION_KIND_COLUMN = "revision_kind";
|
|
262
|
+
type HeadField = keyof DocumentHead;
|
|
263
|
+
declare const HEAD_FIELDS: HeadField[];
|
|
262
264
|
type DocumentColumns = EntityColumns & {
|
|
263
265
|
entity?: string;
|
|
266
|
+
heads?: Partial<Record<HeadField, EntityName>>;
|
|
264
267
|
revisionKind?: string;
|
|
265
268
|
total?: EntityName;
|
|
266
269
|
};
|
|
270
|
+
type DocumentPhysicalColumns = Readonly<Record<HeadField, string>> & {
|
|
271
|
+
createdAt: string;
|
|
272
|
+
entity: string;
|
|
273
|
+
tenant: string;
|
|
274
|
+
updatedAt: string;
|
|
275
|
+
};
|
|
276
|
+
declare const physicalColumnsOf: (columns: DocumentColumns | undefined) => DocumentPhysicalColumns;
|
|
267
277
|
type DocumentRevisionsOptions = {
|
|
268
278
|
table?: string;
|
|
269
279
|
};
|
|
270
280
|
type DocumentMigrationsOptions = {
|
|
271
281
|
appRole?: string;
|
|
272
282
|
columns?: DocumentColumns;
|
|
283
|
+
freeze?: FreezeRegister;
|
|
284
|
+
names?: TenantPolicyNames;
|
|
273
285
|
revisions?: DocumentRevisionsOptions | false;
|
|
274
286
|
schema?: string;
|
|
275
287
|
settings: SessionSettings;
|
|
@@ -292,42 +304,41 @@ type StorableDocumentEntity = AnyDocumentEntity & {
|
|
|
292
304
|
prepare: (body: never) => unknown;
|
|
293
305
|
};
|
|
294
306
|
type Registry$1<Map extends Readonly<Record<string, StorableDocumentEntity>>> = ReturnType<typeof documentEntities<Map>>;
|
|
295
|
-
type DocumentStoreOptions<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string> = {
|
|
307
|
+
type DocumentStoreOptions<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string, Handle = Executor> = {
|
|
296
308
|
archive?: ArchivePort;
|
|
297
309
|
columns?: DocumentColumns;
|
|
298
310
|
registry: Registry$1<Map>;
|
|
299
311
|
revisions?: DocumentRevisionsOptions | false;
|
|
300
312
|
schema?: string;
|
|
301
|
-
seam: SessionSeam<Key,
|
|
313
|
+
seam: SessionSeam<Key, Handle>;
|
|
302
314
|
table?: string;
|
|
303
315
|
};
|
|
304
|
-
type HeadColumn =
|
|
316
|
+
type HeadColumn = HeadField | 'entity' | 'number';
|
|
317
|
+
type DocumentSortColumn = HeadField | 'createdAt' | 'number' | 'updatedAt';
|
|
305
318
|
type HeadsOrder = {
|
|
306
|
-
column:
|
|
319
|
+
column: DocumentSortColumn | 'entity';
|
|
307
320
|
direction?: 'asc' | 'desc';
|
|
308
321
|
};
|
|
309
|
-
type HeadsWhere = {
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}
|
|
313
|
-
type
|
|
314
|
-
|
|
322
|
+
type HeadsWhere = Readonly<Partial<Record<HeadField | 'createdAt' | 'updatedAt', unknown | readonly unknown[] | {
|
|
323
|
+
from: unknown;
|
|
324
|
+
to: unknown;
|
|
325
|
+
}>>>;
|
|
326
|
+
type HeadRow<Columns extends readonly HeadColumn[]> = Pick<DocumentHead & {
|
|
327
|
+
entity: string;
|
|
328
|
+
number: string;
|
|
329
|
+
}, Columns[number]>;
|
|
330
|
+
type HeadsArgs<Columns extends readonly HeadColumn[] = readonly HeadColumn[]> = {
|
|
331
|
+
columns: Columns;
|
|
315
332
|
entity?: string | readonly string[];
|
|
316
333
|
order: readonly HeadsOrder[];
|
|
317
334
|
where?: HeadsWhere;
|
|
318
335
|
};
|
|
319
336
|
type AggregateMeasure = 'count' | 'sum:total';
|
|
320
|
-
type AggregateBy =
|
|
337
|
+
type AggregateBy = HeadField | 'entity' | {
|
|
321
338
|
bucket: 'day' | 'month' | 'week';
|
|
322
|
-
of: 'issueDate';
|
|
339
|
+
of: 'dueDate' | 'issueDate';
|
|
323
340
|
};
|
|
324
|
-
type AggregateWhere =
|
|
325
|
-
status?: string;
|
|
326
|
-
} & ({
|
|
327
|
-
createdAt: readonly [number, number];
|
|
328
|
-
} | {
|
|
329
|
-
issueDate: readonly [string, string];
|
|
330
|
-
} | Record<string, never>);
|
|
341
|
+
type AggregateWhere = HeadsWhere;
|
|
331
342
|
type AggregateRow = {
|
|
332
343
|
by?: string;
|
|
333
344
|
count?: number;
|
|
@@ -340,7 +351,6 @@ type AggregateArgs = {
|
|
|
340
351
|
measures: readonly AggregateMeasure[];
|
|
341
352
|
where?: AggregateWhere;
|
|
342
353
|
};
|
|
343
|
-
type SortableHeadColumn = keyof DocumentHead;
|
|
344
354
|
type Item = DocumentInstance<string, unknown>;
|
|
345
355
|
type DocumentKind = 'committed' | 'reinstated' | 'retired';
|
|
346
356
|
type CommitOutput = {
|
|
@@ -393,62 +403,63 @@ type VerifyResult = {
|
|
|
393
403
|
ok: true;
|
|
394
404
|
versions: number;
|
|
395
405
|
};
|
|
396
|
-
type DocumentEntityStore<Key extends string> = Pick<Projection<unknown, Item, Key, 'ref',
|
|
406
|
+
type DocumentEntityStore<Key extends string, Handle> = Pick<Projection<unknown, Item, Key, 'ref', Handle, string, string>, 'get' | 'listAll'> & {
|
|
397
407
|
asOf: Query<Readonly<Record<Key, string>> & {
|
|
398
408
|
at: number;
|
|
399
409
|
ref: string;
|
|
400
|
-
}, Item | null,
|
|
410
|
+
}, Item | null, Handle>;
|
|
401
411
|
at: Query<Readonly<Record<Key, string>> & {
|
|
402
412
|
ref: string;
|
|
403
413
|
version: number;
|
|
404
|
-
}, Item | null,
|
|
414
|
+
}, Item | null, Handle>;
|
|
405
415
|
commit: Query<Readonly<Record<Key, string>> & {
|
|
406
416
|
actor: string;
|
|
407
417
|
body: unknown;
|
|
408
418
|
reason?: string;
|
|
409
419
|
ref: string;
|
|
410
|
-
}, CommitOutput,
|
|
420
|
+
}, CommitOutput, Handle>;
|
|
411
421
|
history: Query<Readonly<Record<Key, string>> & {
|
|
412
422
|
lineage?: number;
|
|
413
423
|
ref: string;
|
|
414
|
-
}, HistoryEntry[],
|
|
424
|
+
}, HistoryEntry[], Handle>;
|
|
425
|
+
list: Query<Readonly<Record<Key, string>> & EntityListing<DocumentSortColumn, HeadField>, EntityPage<Item>, Handle>;
|
|
415
426
|
reinstate: Query<Readonly<Record<Key, string>> & {
|
|
416
427
|
actor: string;
|
|
417
428
|
reason?: string;
|
|
418
429
|
ref: string;
|
|
419
|
-
}, ReinstateOutput,
|
|
430
|
+
}, ReinstateOutput, Handle>;
|
|
420
431
|
retire: Query<Readonly<Record<Key, string>> & {
|
|
421
432
|
actor: string;
|
|
422
433
|
reason?: string;
|
|
423
434
|
ref: string;
|
|
424
|
-
}, RetireOutput,
|
|
435
|
+
}, RetireOutput, Handle>;
|
|
425
436
|
succeed: Query<Readonly<Record<Key, string>> & {
|
|
426
437
|
actor: string;
|
|
427
438
|
body: unknown;
|
|
428
439
|
reason?: string;
|
|
429
440
|
ref: string;
|
|
430
|
-
}, CommitOutput,
|
|
441
|
+
}, CommitOutput, Handle>;
|
|
431
442
|
undos: {
|
|
432
|
-
commit: EntityUndo<CommitOutput,
|
|
433
|
-
retire: EntityUndo<RetireOutput,
|
|
443
|
+
commit: EntityUndo<CommitOutput, Handle>;
|
|
444
|
+
retire: EntityUndo<RetireOutput, Handle>;
|
|
434
445
|
};
|
|
435
446
|
verify: Query<Readonly<Record<Key, string>> & {
|
|
436
447
|
lineage?: number;
|
|
437
448
|
ref: string;
|
|
438
|
-
}, VerifyResult,
|
|
449
|
+
}, VerifyResult, Handle>;
|
|
439
450
|
};
|
|
440
|
-
type DocumentStore<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string> = {
|
|
441
|
-
[Name in keyof Map & string]: DocumentEntityStore<Key>;
|
|
451
|
+
type DocumentStore<Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string, Handle = Executor> = {
|
|
452
|
+
[Name in keyof Map & string]: DocumentEntityStore<Key, Handle>;
|
|
442
453
|
} & {
|
|
443
|
-
aggregate: Query<Readonly<Record<Key, string>> & AggregateArgs, AggregateRow[],
|
|
444
|
-
heads:
|
|
454
|
+
aggregate: Query<Readonly<Record<Key, string>> & AggregateArgs, AggregateRow[], Handle>;
|
|
455
|
+
heads: <Columns extends readonly HeadColumn[]>(handle: Handle, params: Readonly<Record<Key, string>> & HeadsArgs<Columns>) => Promise<HeadRow<Columns>[]>;
|
|
445
456
|
rebuild: Query<Readonly<Record<Key, string>> & {
|
|
446
457
|
entity?: string;
|
|
447
458
|
}, {
|
|
448
459
|
rows: number;
|
|
449
|
-
},
|
|
460
|
+
}, Handle>;
|
|
450
461
|
};
|
|
451
|
-
declare const documentStore: <Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string>(options: DocumentStoreOptions<Map, Key>) => DocumentStore<Map, Key>;
|
|
462
|
+
declare const documentStore: <Map extends Readonly<Record<string, StorableDocumentEntity>>, Key extends string, Handle = Executor>(options: DocumentStoreOptions<Map, Key, Handle>) => DocumentStore<Map, Key, Handle>;
|
|
452
463
|
|
|
453
464
|
type SurfaceVerb = 'query' | 'mutation';
|
|
454
465
|
type SurfaceScope = 'org' | 'public' | 'token';
|
|
@@ -521,4 +532,4 @@ type DocumentSurfaceOptions<Map extends Readonly<Record<string, SurfaceDocumentE
|
|
|
521
532
|
*/
|
|
522
533
|
declare const documentSurface: <Map extends Readonly<Record<string, SurfaceDocumentEntity>>, Key extends string>(options: DocumentSurfaceOptions<Map, Key>) => SurfaceRow[];
|
|
523
534
|
|
|
524
|
-
export { type AggregateArgs, type AggregateBy, type AggregateMeasure, type AggregateRow, type AggregateWhere, type AnyDocumentEntity, type AppendOnlyTablesOptions, type ArchivePort, BODY_VERSION_KEY, type BodyOf, type CardOf, type CommitOutput, DEFAULT_DOCUMENT_TABLE, DEFAULT_REVISIONS_TABLE, DEFAULT_REVISION_KIND_COLUMN, Document, type DocumentBodyMigrations, type DocumentBodyVersion, type DocumentColumns, type DocumentDefinition, type DocumentEntity, type DocumentHead, type DocumentInstance, type DocumentKind, type DocumentMigrationsOptions, type DocumentNumbering, type DocumentRecord, type DocumentRevisionsOptions, type DocumentStatusMachine, type DocumentStore, type DocumentStoreOptions, type DocumentSurfaceOptions, type DraftOf, type FieldKind, type HeadColumn, type HeadsArgs, type HeadsOrder, type HeadsWhere, type HistoryEntry, type IncomingOf, type InstanceOf, type LinkVerifierPort, type NameOf, type PendingCall, type ReinstateOutput, type RetireOutput, type StatusOf, type SurfaceCall, type SurfaceRow, type SurfaceSchemaAdapter, type SurfaceScope, type SurfaceVerb, type TimestampPort, type VerifyResult, type ViewOf, appendOnlyTables, canTransition, canonicalOf, documentBodyVersioning, documentEntities, documentIdentifiers, documentMigrations, documentRoleStatements, documentStore, documentSurface, fieldPatterns, hashOf, isSystemActor, isTerminalStatus, migrateBody, stampBody, systemActor, validatorOf };
|
|
535
|
+
export { type AggregateArgs, type AggregateBy, type AggregateMeasure, type AggregateRow, type AggregateWhere, type AnyDocumentEntity, type AppendOnlyTablesOptions, type ArchivePort, BODY_VERSION_KEY, type BodyOf, type CardOf, type CommitOutput, DEFAULT_DOCUMENT_TABLE, DEFAULT_REVISIONS_TABLE, DEFAULT_REVISION_KIND_COLUMN, Document, type DocumentBodyMigrations, type DocumentBodyVersion, type DocumentColumns, type DocumentDefinition, type DocumentEntity, type DocumentHead, type DocumentInstance, type DocumentKind, type DocumentMigrationsOptions, type DocumentNumbering, type DocumentPhysicalColumns, type DocumentRecord, type DocumentRevisionsOptions, type DocumentSortColumn, type DocumentStatusMachine, type DocumentStore, type DocumentStoreOptions, type DocumentSurfaceOptions, type DraftOf, type FieldKind, HEAD_FIELDS, type HeadColumn, type HeadField, type HeadRow, type HeadsArgs, type HeadsOrder, type HeadsWhere, type HistoryEntry, type IncomingOf, type InstanceOf, type LinkVerifierPort, type NameOf, type PendingCall, type ReinstateOutput, type RetireOutput, type StatusOf, type SurfaceCall, type SurfaceRow, type SurfaceSchemaAdapter, type SurfaceScope, type SurfaceVerb, type TimestampPort, type VerifyResult, type ViewOf, appendOnlyTables, canTransition, canonicalOf, documentBodyVersioning, documentEntities, documentIdentifiers, documentMigrations, documentRoleStatements, documentStore, documentSurface, fieldPatterns, hashOf, isSystemActor, isTerminalStatus, migrateBody, physicalColumnsOf, stampBody, systemActor, validatorOf };
|