@xyo-network/archivist-model 5.2.27 → 5.3.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.
- package/dist/neutral/ArchivistSnapshot.d.ts +4 -2
- package/dist/neutral/ArchivistSnapshot.d.ts.map +1 -1
- package/dist/neutral/ArchivistStats.d.ts +4 -2
- package/dist/neutral/ArchivistStats.d.ts.map +1 -1
- package/dist/neutral/Config.d.ts +5 -3
- package/dist/neutral/Config.d.ts.map +1 -1
- package/dist/neutral/Queries/All.d.ts +4 -2
- package/dist/neutral/Queries/All.d.ts.map +1 -1
- package/dist/neutral/Queries/Clear.d.ts +4 -2
- package/dist/neutral/Queries/Clear.d.ts.map +1 -1
- package/dist/neutral/Queries/Commit.d.ts +4 -2
- package/dist/neutral/Queries/Commit.d.ts.map +1 -1
- package/dist/neutral/Queries/Delete.d.ts +4 -2
- package/dist/neutral/Queries/Delete.d.ts.map +1 -1
- package/dist/neutral/Queries/Get.d.ts +4 -2
- package/dist/neutral/Queries/Get.d.ts.map +1 -1
- package/dist/neutral/Queries/Insert.d.ts +4 -2
- package/dist/neutral/Queries/Insert.d.ts.map +1 -1
- package/dist/neutral/Queries/Next.d.ts +4 -2
- package/dist/neutral/Queries/Next.d.ts.map +1 -1
- package/dist/neutral/Queries/Snapshot.d.ts +4 -2
- package/dist/neutral/Queries/Snapshot.d.ts.map +1 -1
- package/dist/neutral/index.mjs +24 -11
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +5 -5
- package/src/ArchivistSnapshot.ts +4 -2
- package/src/ArchivistStats.ts +2 -2
- package/src/Config.ts +7 -3
- package/src/Queries/All.ts +2 -2
- package/src/Queries/Clear.ts +2 -2
- package/src/Queries/Commit.ts +2 -2
- package/src/Queries/Delete.ts +2 -2
- package/src/Queries/Get.ts +2 -2
- package/src/Queries/Insert.ts +2 -2
- package/src/Queries/Next.ts +2 -2
- package/src/Queries/Snapshot.ts +2 -2
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
-
import type
|
|
3
|
-
export declare const ArchivistSnapshotPayloadSchema: "network.xyo.archivist.snapshot"
|
|
2
|
+
import { type Payload, type PayloadHashMap } from '@xyo-network/payload-model';
|
|
3
|
+
export declare const ArchivistSnapshotPayloadSchema: "network.xyo.archivist.snapshot" & {
|
|
4
|
+
readonly __schema: true;
|
|
5
|
+
};
|
|
4
6
|
export type ArchivistSnapshotPayloadSchema = typeof ArchivistSnapshotPayloadSchema;
|
|
5
7
|
export type ArchivistSnapshotPayload<TPayload extends Payload = Payload, TId extends string | number | symbol = Hash> = Payload<PayloadHashMap<TPayload, TId>, ArchivistSnapshotPayloadSchema>;
|
|
6
8
|
//# sourceMappingURL=ArchivistSnapshot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArchivistSnapshot.d.ts","sourceRoot":"","sources":["../../src/ArchivistSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ArchivistSnapshot.d.ts","sourceRoot":"","sources":["../../src/ArchivistSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EACK,KAAK,OAAO,EAAE,KAAK,cAAc,EAC5C,MAAM,4BAA4B,CAAA;AAEnC,eAAO,MAAM,8BAA8B;;CAAmD,CAAA;AAC9F,MAAM,MAAM,8BAA8B,GAAG,OAAO,8BAA8B,CAAA;AAElF,MAAM,MAAM,wBAAwB,CAAC,QAAQ,SAAS,OAAO,GAAG,OAAO,EAAE,GAAG,SAAS,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,IAChH,OAAO,CAAC,cAAc,CAAC,QAAQ,EAAE,GAAG,CAAC,EAAE,8BAA8B,CAAC,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const ArchivistStatsPayloadSchema: "network.xyo.archivist.stats"
|
|
1
|
+
import { type Payload } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const ArchivistStatsPayloadSchema: "network.xyo.archivist.stats" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
3
5
|
export type ArchivistStatsPayloadSchema = typeof ArchivistStatsPayloadSchema;
|
|
4
6
|
export type ArchivistStatsPayload = Payload<{
|
|
5
7
|
payloadCount: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArchivistStats.d.ts","sourceRoot":"","sources":["../../src/ArchivistStats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"ArchivistStats.d.ts","sourceRoot":"","sources":["../../src/ArchivistStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEnE,eAAO,MAAM,2BAA2B;;CAAgD,CAAA;AACxF,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAE5E,MAAM,MAAM,qBAAqB,GAC7B,OAAO,CAAC;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,EAAE,2BAA2B,CAAC,CAAA"}
|
package/dist/neutral/Config.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js';
|
|
2
2
|
import type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
+
import type { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
4
|
import type { IndexDescription } from './IndexDescription.ts';
|
|
5
5
|
export interface ArchivistParents {
|
|
6
6
|
commit?: ModuleIdentifier[];
|
|
@@ -15,9 +15,11 @@ export interface ArchivistGetCache {
|
|
|
15
15
|
enabled?: boolean;
|
|
16
16
|
maxEntries?: number;
|
|
17
17
|
}
|
|
18
|
-
export declare const ArchivistConfigSchema: "network.xyo.archivist.config"
|
|
18
|
+
export declare const ArchivistConfigSchema: "network.xyo.archivist.config" & {
|
|
19
|
+
readonly __schema: true;
|
|
20
|
+
};
|
|
19
21
|
export type ArchivistConfigSchema = typeof ArchivistConfigSchema;
|
|
20
|
-
export type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends
|
|
22
|
+
export type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<WithAdditional<{
|
|
21
23
|
/** @field caching configuration for get calls */
|
|
22
24
|
getCache?: ArchivistGetCache;
|
|
23
25
|
/** @field address of one or more parent archivists to read from */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC/E,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACP,MAAM,4BAA4B,CAAA;AAGnC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,EAAE,gBAAgB,EAAE,CAAA;IAC3B,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC3B;AAED,MAAM,WAAW,gBAAgB;IAC/B,gDAAgD;IAChD,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAA;CAC7B;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAED,eAAO,MAAM,qBAAqB;;CAAiD,CAAA;AACnF,MAAM,MAAM,qBAAqB,GAAG,OAAO,qBAAqB,CAAA;AAEhE,MAAM,MAAM,eAAe,CAAC,OAAO,SAAS,OAAO,GAAG,WAAW,GAAG,IAAI,GAAG,IAAI,EAAE,OAAO,SAAS,MAAM,GAAG,IAAI,GAAG,IAAI,IAAI,YAAY,CACnI,cAAc,CACZ;IACE,iDAAiD;IACjD,QAAQ,CAAC,EAAE,iBAAiB,CAAA;IAC5B,mEAAmE;IACnE,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,MAAM,EAAE,OAAO,SAAS,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,qBAAqB,CAAA;IAC3E,mCAAmC;IACnC,OAAO,CAAC,EAAE,gBAAgB,CAAA;IAC1B,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,EACD,OAAO,CACR,EACD,OAAO,CACR,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const ArchivistAllQuerySchema: "network.xyo.query.archivist.all"
|
|
1
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const ArchivistAllQuerySchema: "network.xyo.query.archivist.all" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
3
5
|
export type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema;
|
|
4
6
|
export type ArchivistAllQuery = Query<{
|
|
5
7
|
schema: ArchivistAllQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"All.d.ts","sourceRoot":"","sources":["../../../src/Queries/All.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"All.d.ts","sourceRoot":"","sources":["../../../src/Queries/All.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,uBAAuB;;CAAoD,CAAA;AACxF,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAC,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const ArchivistClearQuerySchema: "network.xyo.query.archivist.clear"
|
|
1
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const ArchivistClearQuerySchema: "network.xyo.query.archivist.clear" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
3
5
|
export type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema;
|
|
4
6
|
export type ArchivistClearQuery = Query<{
|
|
5
7
|
schema: ArchivistClearQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clear.d.ts","sourceRoot":"","sources":["../../../src/Queries/Clear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Clear.d.ts","sourceRoot":"","sources":["../../../src/Queries/Clear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,yBAAyB;;CAAsD,CAAA;AAC5F,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAC,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const ArchivistCommitQuerySchema: "network.xyo.query.archivist.commit"
|
|
1
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const ArchivistCommitQuerySchema: "network.xyo.query.archivist.commit" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
3
5
|
export type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema;
|
|
4
6
|
export type ArchivistCommitQuery = Query<{
|
|
5
7
|
schema: ArchivistCommitQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Commit.d.ts","sourceRoot":"","sources":["../../../src/Queries/Commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Commit.d.ts","sourceRoot":"","sources":["../../../src/Queries/Commit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,0BAA0B;;CAAuD,CAAA;AAC9F,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC;IACvC,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAC,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
-
import type
|
|
3
|
-
export declare const ArchivistDeleteQuerySchema: "network.xyo.query.archivist.delete"
|
|
2
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
3
|
+
export declare const ArchivistDeleteQuerySchema: "network.xyo.query.archivist.delete" & {
|
|
4
|
+
readonly __schema: true;
|
|
5
|
+
};
|
|
4
6
|
export type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema;
|
|
5
7
|
export type ArchivistDeleteQuery = Query<{
|
|
6
8
|
hashes: Hash[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../src/Queries/Delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../src/Queries/Delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,0BAA0B;;CAAuD,CAAA;AAC9F,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC;IACvC,MAAM,EAAE,IAAI,EAAE,CAAA;IACd,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAC,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
|
-
import type
|
|
3
|
-
export declare const ArchivistGetQuerySchema: "network.xyo.query.archivist.get"
|
|
2
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
3
|
+
export declare const ArchivistGetQuerySchema: "network.xyo.query.archivist.get" & {
|
|
4
|
+
readonly __schema: true;
|
|
5
|
+
};
|
|
4
6
|
export type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema;
|
|
5
7
|
export type ArchivistGetQuery = Query<{
|
|
6
8
|
hashes: Hash[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Get.d.ts","sourceRoot":"","sources":["../../../src/Queries/Get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Get.d.ts","sourceRoot":"","sources":["../../../src/Queries/Get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,uBAAuB;;CAAoD,CAAA;AACxF,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,MAAM,EAAE,IAAI,EAAE,CAAA;IACd,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAC,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const ArchivistInsertQuerySchema: "network.xyo.query.archivist.insert"
|
|
1
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const ArchivistInsertQuerySchema: "network.xyo.query.archivist.insert" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
3
5
|
export type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema;
|
|
4
6
|
export type ArchivistInsertQuery = Query<{
|
|
5
7
|
schema: ArchivistInsertQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insert.d.ts","sourceRoot":"","sources":["../../../src/Queries/Insert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Insert.d.ts","sourceRoot":"","sources":["../../../src/Queries/Insert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,0BAA0B;;CAAuD,CAAA;AAC9F,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC;IACvC,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAC,CAAA"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
2
2
|
import type { ArchivistNextOptions } from '../NextOptions.ts';
|
|
3
|
-
export declare const ArchivistNextQuerySchema: "network.xyo.query.archivist.next"
|
|
3
|
+
export declare const ArchivistNextQuerySchema: "network.xyo.query.archivist.next" & {
|
|
4
|
+
readonly __schema: true;
|
|
5
|
+
};
|
|
4
6
|
export type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema;
|
|
5
7
|
export type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>;
|
|
6
8
|
//# sourceMappingURL=Next.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Next.d.ts","sourceRoot":"","sources":["../../../src/Queries/Next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Next.d.ts","sourceRoot":"","sources":["../../../src/Queries/Next.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,eAAO,MAAM,wBAAwB;;CAAqD,CAAA;AAC1F,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAA"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export declare const ArchivistSnapshotQuerySchema: "network.xyo.query.archivist.snapshot"
|
|
1
|
+
import { type Query } from '@xyo-network/payload-model';
|
|
2
|
+
export declare const ArchivistSnapshotQuerySchema: "network.xyo.query.archivist.snapshot" & {
|
|
3
|
+
readonly __schema: true;
|
|
4
|
+
};
|
|
3
5
|
export type ArchivistSnapshotQuerySchema = typeof ArchivistSnapshotQuerySchema;
|
|
4
6
|
export type ArchivistSnapshotQuery = Query<{
|
|
5
7
|
schema: ArchivistSnapshotQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Snapshot.d.ts","sourceRoot":"","sources":["../../../src/Queries/Snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"Snapshot.d.ts","sourceRoot":"","sources":["../../../src/Queries/Snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEjE,eAAO,MAAM,4BAA4B;;CAAyD,CAAA;AAClG,MAAM,MAAM,4BAA4B,GAAG,OAAO,4BAA4B,CAAA;AAE9E,MAAM,MAAM,sBAAsB,GAAG,KAAK,CAAC;IACzC,MAAM,EAAE,4BAA4B,CAAA;CACrC,CAAC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
// src/ArchivistSnapshot.ts
|
|
2
|
-
|
|
2
|
+
import {
|
|
3
|
+
asSchema
|
|
4
|
+
} from "@xyo-network/payload-model";
|
|
5
|
+
var ArchivistSnapshotPayloadSchema = asSchema("network.xyo.archivist.snapshot", true);
|
|
3
6
|
|
|
4
7
|
// src/ArchivistStats.ts
|
|
5
|
-
|
|
8
|
+
import { asSchema as asSchema2 } from "@xyo-network/payload-model";
|
|
9
|
+
var ArchivistStatsPayloadSchema = asSchema2("network.xyo.archivist.stats", true);
|
|
6
10
|
|
|
7
11
|
// src/attachable/asAttachableInstance.ts
|
|
8
12
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/sdk-js";
|
|
@@ -21,28 +25,36 @@ import {
|
|
|
21
25
|
} from "@xyo-network/module-model";
|
|
22
26
|
|
|
23
27
|
// src/Queries/All.ts
|
|
24
|
-
|
|
28
|
+
import { asSchema as asSchema3 } from "@xyo-network/payload-model";
|
|
29
|
+
var ArchivistAllQuerySchema = asSchema3("network.xyo.query.archivist.all", true);
|
|
25
30
|
|
|
26
31
|
// src/Queries/Clear.ts
|
|
27
|
-
|
|
32
|
+
import { asSchema as asSchema4 } from "@xyo-network/payload-model";
|
|
33
|
+
var ArchivistClearQuerySchema = asSchema4("network.xyo.query.archivist.clear", true);
|
|
28
34
|
|
|
29
35
|
// src/Queries/Commit.ts
|
|
30
|
-
|
|
36
|
+
import { asSchema as asSchema5 } from "@xyo-network/payload-model";
|
|
37
|
+
var ArchivistCommitQuerySchema = asSchema5("network.xyo.query.archivist.commit", true);
|
|
31
38
|
|
|
32
39
|
// src/Queries/Delete.ts
|
|
33
|
-
|
|
40
|
+
import { asSchema as asSchema6 } from "@xyo-network/payload-model";
|
|
41
|
+
var ArchivistDeleteQuerySchema = asSchema6("network.xyo.query.archivist.delete", true);
|
|
34
42
|
|
|
35
43
|
// src/Queries/Get.ts
|
|
36
|
-
|
|
44
|
+
import { asSchema as asSchema7 } from "@xyo-network/payload-model";
|
|
45
|
+
var ArchivistGetQuerySchema = asSchema7("network.xyo.query.archivist.get", true);
|
|
37
46
|
|
|
38
47
|
// src/Queries/Insert.ts
|
|
39
|
-
|
|
48
|
+
import { asSchema as asSchema8 } from "@xyo-network/payload-model";
|
|
49
|
+
var ArchivistInsertQuerySchema = asSchema8("network.xyo.query.archivist.insert", true);
|
|
40
50
|
|
|
41
51
|
// src/Queries/Next.ts
|
|
42
|
-
|
|
52
|
+
import { asSchema as asSchema9 } from "@xyo-network/payload-model";
|
|
53
|
+
var ArchivistNextQuerySchema = asSchema9("network.xyo.query.archivist.next", true);
|
|
43
54
|
|
|
44
55
|
// src/Queries/Snapshot.ts
|
|
45
|
-
|
|
56
|
+
import { asSchema as asSchema10 } from "@xyo-network/payload-model";
|
|
57
|
+
var ArchivistSnapshotQuerySchema = asSchema10("network.xyo.query.archivist.snapshot", true);
|
|
46
58
|
|
|
47
59
|
// src/typeChecks.ts
|
|
48
60
|
var isArchivistInstance = new IsInstanceFactory().create({ get: "function" }, [isModuleInstance]);
|
|
@@ -69,7 +81,8 @@ var IsAttachableArchivistInstanceFactory = class extends IsObjectFactory2 {
|
|
|
69
81
|
};
|
|
70
82
|
|
|
71
83
|
// src/Config.ts
|
|
72
|
-
|
|
84
|
+
import { asSchema as asSchema11 } from "@xyo-network/payload-model";
|
|
85
|
+
var ArchivistConfigSchema = asSchema11("network.xyo.archivist.config", true);
|
|
73
86
|
|
|
74
87
|
// src/IndexDescription.ts
|
|
75
88
|
var IndexSeparator = "-";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/ArchivistSnapshot.ts","../../src/ArchivistStats.ts","../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/All.ts","../../src/Queries/Clear.ts","../../src/Queries/Commit.ts","../../src/Queries/Delete.ts","../../src/Queries/Get.ts","../../src/Queries/Insert.ts","../../src/Queries/Next.ts","../../src/Queries/Snapshot.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts","../../src/lib/getBoundWitness.ts","../../src/lib/hydrateBoundWitness.ts"],"sourcesContent":["import type { Hash } from '@xylabs/sdk-js'\nimport type { Payload, PayloadHashMap } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotPayloadSchema = 'network.xyo.archivist.snapshot' as const\nexport type ArchivistSnapshotPayloadSchema = typeof ArchivistSnapshotPayloadSchema\n\nexport type ArchivistSnapshotPayload<TPayload extends Payload = Payload, TId extends string | number | symbol = Hash>\n = Payload<PayloadHashMap<TPayload, TId>, ArchivistSnapshotPayloadSchema>\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport const ArchivistStatsPayloadSchema = 'network.xyo.archivist.stats' as const\nexport type ArchivistStatsPayloadSchema = typeof ArchivistStatsPayloadSchema\n\nexport type ArchivistStatsPayload\n = Payload<{ payloadCount: number }, ArchivistStatsPayloadSchema>\n","import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport { isAttachableArchivistInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableArchivistInstance = AsObjectFactory.create(isAttachableArchivistInstance)\n","import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isArchivistInstance } from '../typeChecks.ts'\nimport type { AttachableArchivistInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableArchivistInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableArchivistInstance>()\n\nexport const isAttachableArchivistInstance: TypeCheck<AttachableArchivistInstance> = factory.create(requiredAttachableArchivistInstanceFunctions, [\n isArchivistInstance,\n isAttachableModuleInstance,\n])\n","import type { TypeCheck } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { ArchivistInstance } from './Instance.ts'\nimport type { ArchivistModuleInstance } from './ModuleInstance.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance: TypeCheck<ArchivistInstance> = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule: TypeCheck<ArchivistModuleInstance> = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all' as const\nexport type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear' as const\nexport type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit' as const\nexport type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete' as const\nexport type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: Hash[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistGetQuerySchema = 'network.xyo.query.archivist.get' as const\nexport type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema\n\nexport type ArchivistGetQuery = Query<{\n hashes: Hash[]\n schema: ArchivistGetQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert' as const\nexport type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema\n\nexport type ArchivistInsertQuery = Query<{\n schema: ArchivistInsertQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nimport type { ArchivistNextOptions } from '../NextOptions.ts'\n\nexport const ArchivistNextQuerySchema = 'network.xyo.query.archivist.next' as const\nexport type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema\n\nexport type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotQuerySchema = 'network.xyo.query.archivist.snapshot' as const\nexport type ArchivistSnapshotQuerySchema = typeof ArchivistSnapshotQuerySchema\n\nexport type ArchivistSnapshotQuery = Query<{\n schema: ArchivistSnapshotQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { ArchivistModuleEventData } from '../EventData.ts'\nimport type { ArchivistInstance } from '../Instance.ts'\nimport type { ArchivistModuleInstance } from '../ModuleInstance.ts'\nimport type { ArchivistParams } from '../Params.ts'\n\nexport interface AttachableArchivistInstance<\n TParams extends ArchivistParams = ArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n TPayload extends Payload = Payload,\n> extends ArchivistModuleInstance<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n ArchivistInstance<TParams, TEventData, TPayload> {}\n\nexport type AttachableArchivistInstanceTypeCheck<T extends AttachableArchivistInstance = AttachableArchivistInstance> = TypeCheck<T>\n\nexport class IsAttachableArchivistInstanceFactory<T extends AttachableArchivistInstance = AttachableArchivistInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { IndexDescription } from './IndexDescription.ts'\n\nexport interface ArchivistParents {\n commit?: ModuleIdentifier[]\n read?: ModuleIdentifier[]\n write?: ModuleIdentifier[]\n}\n\nexport interface ArchivistStorage {\n /** The indexes to create on the object store */\n indexes?: IndexDescription[]\n}\n\nexport interface ArchivistGetCache {\n enabled?: boolean\n maxEntries?: number\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config' as const\nexport type ArchivistConfigSchema = typeof ArchivistConfigSchema\n\nexport type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n /** @field caching configuration for get calls */\n getCache?: ArchivistGetCache\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n /** @field storage configuration */\n storage?: ArchivistStorage\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","/**\n * The index direction (1 for ascending, -1 for descending)\n */\nexport type IndexDirection = -1 | 1\n\n/**\n * Description of index(es) to be created on a store\n */\nexport type IndexDescription = {\n /**\n * The key(s) to index\n */\n key: Record<string, IndexDirection>\n /**\n * Is the indexed value an array\n */\n multiEntry?: boolean\n /**\n * The name of the index\n */\n name?: string\n /**\n * If true, the index must enforce uniqueness on the key\n */\n unique?: boolean\n}\n\nexport const IndexSeparator = '-'\n\n/**\n * Given an index description, this will build the index\n * name in standard form\n * @param index The index description\n * @returns The index name in standard form\n */\nexport const buildStandardIndexName = (index: IndexDescription) => {\n const { key, unique } = index\n const prefix = unique ? 'UX' : 'IX'\n const indexKeys = Object.keys(key)\n return `${prefix}_${indexKeys.join(IndexSeparator)}`\n}\n","import type { Hash, IdentityFunction } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport { type BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isStorageMeta, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\n\nexport const tryGetTypedBoundWitnessWithStorageMeta = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {\n const payload = (await archivist.get([hash])).at(0)\n return identity(payload) ? payload : undefined\n}\n\nexport const getTypedBoundWitnessWithStorageMeta = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T>> => {\n const payload = assertEx((await archivist.get([hash])).at(0), () => `failed to locate bound witness: ${hash}`)\n return assertEx(identity(payload) ? payload : undefined, () => `located payload failed identity check: ${hash}`)\n}\n\nexport const getBoundWitnessWithStorageMeta = (archivist: ReadArchivist, hash: Hash): Promise<WithStorageMeta<BoundWitness>> => {\n return getTypedBoundWitnessWithStorageMeta<BoundWitness>(archivist, hash, x => isStorageMeta(x) && isBoundWitness(x))\n}\n","import type { Hash, IdentityFunction } from '@xylabs/sdk-js'\nimport { exists, isHash } from '@xylabs/sdk-js'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isStorageMeta, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport { getTypedBoundWitnessWithStorageMeta, tryGetTypedBoundWitnessWithStorageMeta } from './getBoundWitness.ts'\nimport type { HydratedBoundWitness } from './HydratedBoundWitness.ts'\n\nexport const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {\n const bw = isHash(hashOrBw) ? await tryGetTypedBoundWitnessWithStorageMeta(archivist, hashOrBw, identity) : hashOrBw\n return bw ? [bw, (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)] : undefined\n}\n\nexport const hydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T>> => {\n const bw = isHash(hashOrBw) ? await getTypedBoundWitnessWithStorageMeta(archivist, hashOrBw, identity) : hashOrBw\n const payloads = (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)\n if (payloads.length !== bw.payload_hashes.length) {\n throw new Error(`missing payloads for ${bw._hash}`)\n }\n return [bw, payloads]\n}\n\nexport const hydrateBoundWitness = (\n archivist: ReadArchivist,\n hashOrBw: Hash | WithStorageMeta<BoundWitness>,\n): Promise<HydratedBoundWitness<BoundWitness>> => {\n const idFunction: IdentityFunction<WithStorageMeta<BoundWitness>> = x => isBoundWitness(x) && isStorageMeta(x)\n return hydrateTypedBoundWitness<BoundWitness>(archivist, hashOrBw, idFunction)\n}\n"],"mappings":"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","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory","isBoundWitness","isStorageMeta","isBoundWitness","isStorageMeta"]}
|
|
1
|
+
{"version":3,"sources":["../../src/ArchivistSnapshot.ts","../../src/ArchivistStats.ts","../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/All.ts","../../src/Queries/Clear.ts","../../src/Queries/Commit.ts","../../src/Queries/Delete.ts","../../src/Queries/Get.ts","../../src/Queries/Insert.ts","../../src/Queries/Next.ts","../../src/Queries/Snapshot.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts","../../src/lib/getBoundWitness.ts","../../src/lib/hydrateBoundWitness.ts"],"sourcesContent":["import type { Hash } from '@xylabs/sdk-js'\nimport {\n asSchema, type Payload, type PayloadHashMap,\n} from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotPayloadSchema = asSchema('network.xyo.archivist.snapshot', true)\nexport type ArchivistSnapshotPayloadSchema = typeof ArchivistSnapshotPayloadSchema\n\nexport type ArchivistSnapshotPayload<TPayload extends Payload = Payload, TId extends string | number | symbol = Hash>\n = Payload<PayloadHashMap<TPayload, TId>, ArchivistSnapshotPayloadSchema>\n","import { asSchema, type Payload } from '@xyo-network/payload-model'\n\nexport const ArchivistStatsPayloadSchema = asSchema('network.xyo.archivist.stats', true)\nexport type ArchivistStatsPayloadSchema = typeof ArchivistStatsPayloadSchema\n\nexport type ArchivistStatsPayload\n = Payload<{ payloadCount: number }, ArchivistStatsPayloadSchema>\n","import { AsObjectFactory } from '@xylabs/sdk-js'\n\nimport { isAttachableArchivistInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableArchivistInstance = AsObjectFactory.create(isAttachableArchivistInstance)\n","import type { ObjectTypeShape, TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport { isAttachableModuleInstance } from '@xyo-network/module-model'\n\nimport { isArchivistInstance } from '../typeChecks.ts'\nimport type { AttachableArchivistInstance } from './AttachableInstance.ts'\n\nexport const requiredAttachableArchivistInstanceFunctions: ObjectTypeShape = {}\n\n// we do not use IsInstanceFactory here to prevent a cycle\nconst factory = new IsObjectFactory<AttachableArchivistInstance>()\n\nexport const isAttachableArchivistInstance: TypeCheck<AttachableArchivistInstance> = factory.create(requiredAttachableArchivistInstanceFunctions, [\n isArchivistInstance,\n isAttachableModuleInstance,\n])\n","import type { TypeCheck } from '@xylabs/sdk-js'\nimport { AsObjectFactory } from '@xylabs/sdk-js'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { ArchivistInstance } from './Instance.ts'\nimport type { ArchivistModuleInstance } from './ModuleInstance.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance: TypeCheck<ArchivistInstance> = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule: TypeCheck<ArchivistModuleInstance> = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n","import { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistAllQuerySchema = asSchema('network.xyo.query.archivist.all', true)\nexport type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistClearQuerySchema = asSchema('network.xyo.query.archivist.clear', true)\nexport type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistCommitQuerySchema = asSchema('network.xyo.query.archivist.commit', true)\nexport type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/sdk-js'\nimport { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistDeleteQuerySchema = asSchema('network.xyo.query.archivist.delete', true)\nexport type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: Hash[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import type { Hash } from '@xylabs/sdk-js'\nimport { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistGetQuerySchema = asSchema('network.xyo.query.archivist.get', true)\nexport type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema\n\nexport type ArchivistGetQuery = Query<{\n hashes: Hash[]\n schema: ArchivistGetQuerySchema\n}>\n","import { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistInsertQuerySchema = asSchema('network.xyo.query.archivist.insert', true)\nexport type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema\n\nexport type ArchivistInsertQuery = Query<{\n schema: ArchivistInsertQuerySchema\n}>\n","import { asSchema, type Query } from '@xyo-network/payload-model'\n\nimport type { ArchivistNextOptions } from '../NextOptions.ts'\n\nexport const ArchivistNextQuerySchema = asSchema('network.xyo.query.archivist.next', true)\nexport type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema\n\nexport type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>\n","import { asSchema, type Query } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotQuerySchema = asSchema('network.xyo.query.archivist.snapshot', true)\nexport type ArchivistSnapshotQuerySchema = typeof ArchivistSnapshotQuerySchema\n\nexport type ArchivistSnapshotQuery = Query<{\n schema: ArchivistSnapshotQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/sdk-js'\nimport { IsObjectFactory } from '@xylabs/sdk-js'\nimport type { AttachableModuleInstance } from '@xyo-network/module-model'\nimport type { Payload } from '@xyo-network/payload-model'\n\nimport type { ArchivistModuleEventData } from '../EventData.ts'\nimport type { ArchivistInstance } from '../Instance.ts'\nimport type { ArchivistModuleInstance } from '../ModuleInstance.ts'\nimport type { ArchivistParams } from '../Params.ts'\n\nexport interface AttachableArchivistInstance<\n TParams extends ArchivistParams = ArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n TPayload extends Payload = Payload,\n> extends ArchivistModuleInstance<TParams, TEventData>,\n AttachableModuleInstance<TParams, TEventData>,\n ArchivistInstance<TParams, TEventData, TPayload> {}\n\nexport type AttachableArchivistInstanceTypeCheck<T extends AttachableArchivistInstance = AttachableArchivistInstance> = TypeCheck<T>\n\nexport class IsAttachableArchivistInstanceFactory<T extends AttachableArchivistInstance = AttachableArchivistInstance> extends IsObjectFactory<T> {}\n","import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js'\nimport type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'\nimport type {\n Payload,\n Schema,\n} from '@xyo-network/payload-model'\nimport { asSchema } from '@xyo-network/payload-model'\n\nimport type { IndexDescription } from './IndexDescription.ts'\n\nexport interface ArchivistParents {\n commit?: ModuleIdentifier[]\n read?: ModuleIdentifier[]\n write?: ModuleIdentifier[]\n}\n\nexport interface ArchivistStorage {\n /** The indexes to create on the object store */\n indexes?: IndexDescription[]\n}\n\nexport interface ArchivistGetCache {\n enabled?: boolean\n maxEntries?: number\n}\n\nexport const ArchivistConfigSchema = asSchema('network.xyo.archivist.config', true)\nexport type ArchivistConfigSchema = typeof ArchivistConfigSchema\n\nexport type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<\n WithAdditional<\n {\n /** @field caching configuration for get calls */\n getCache?: ArchivistGetCache\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n /** @field storage configuration */\n storage?: ArchivistStorage\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","/**\n * The index direction (1 for ascending, -1 for descending)\n */\nexport type IndexDirection = -1 | 1\n\n/**\n * Description of index(es) to be created on a store\n */\nexport type IndexDescription = {\n /**\n * The key(s) to index\n */\n key: Record<string, IndexDirection>\n /**\n * Is the indexed value an array\n */\n multiEntry?: boolean\n /**\n * The name of the index\n */\n name?: string\n /**\n * If true, the index must enforce uniqueness on the key\n */\n unique?: boolean\n}\n\nexport const IndexSeparator = '-'\n\n/**\n * Given an index description, this will build the index\n * name in standard form\n * @param index The index description\n * @returns The index name in standard form\n */\nexport const buildStandardIndexName = (index: IndexDescription) => {\n const { key, unique } = index\n const prefix = unique ? 'UX' : 'IX'\n const indexKeys = Object.keys(key)\n return `${prefix}_${indexKeys.join(IndexSeparator)}`\n}\n","import type { Hash, IdentityFunction } from '@xylabs/sdk-js'\nimport { assertEx } from '@xylabs/sdk-js'\nimport { type BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isStorageMeta, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\n\nexport const tryGetTypedBoundWitnessWithStorageMeta = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {\n const payload = (await archivist.get([hash])).at(0)\n return identity(payload) ? payload : undefined\n}\n\nexport const getTypedBoundWitnessWithStorageMeta = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T>> => {\n const payload = assertEx((await archivist.get([hash])).at(0), () => `failed to locate bound witness: ${hash}`)\n return assertEx(identity(payload) ? payload : undefined, () => `located payload failed identity check: ${hash}`)\n}\n\nexport const getBoundWitnessWithStorageMeta = (archivist: ReadArchivist, hash: Hash): Promise<WithStorageMeta<BoundWitness>> => {\n return getTypedBoundWitnessWithStorageMeta<BoundWitness>(archivist, hash, x => isStorageMeta(x) && isBoundWitness(x))\n}\n","import type { Hash, IdentityFunction } from '@xylabs/sdk-js'\nimport { exists, isHash } from '@xylabs/sdk-js'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { isStorageMeta, type WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport { getTypedBoundWitnessWithStorageMeta, tryGetTypedBoundWitnessWithStorageMeta } from './getBoundWitness.ts'\nimport type { HydratedBoundWitness } from './HydratedBoundWitness.ts'\n\nexport const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {\n const bw = isHash(hashOrBw) ? await tryGetTypedBoundWitnessWithStorageMeta(archivist, hashOrBw, identity) : hashOrBw\n return bw ? [bw, (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)] : undefined\n}\n\nexport const hydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T>> => {\n const bw = isHash(hashOrBw) ? await getTypedBoundWitnessWithStorageMeta(archivist, hashOrBw, identity) : hashOrBw\n const payloads = (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)\n if (payloads.length !== bw.payload_hashes.length) {\n throw new Error(`missing payloads for ${bw._hash}`)\n }\n return [bw, payloads]\n}\n\nexport const hydrateBoundWitness = (\n archivist: ReadArchivist,\n hashOrBw: Hash | WithStorageMeta<BoundWitness>,\n): Promise<HydratedBoundWitness<BoundWitness>> => {\n const idFunction: IdentityFunction<WithStorageMeta<BoundWitness>> = x => isBoundWitness(x) && isStorageMeta(x)\n return hydrateTypedBoundWitness<BoundWitness>(archivist, hashOrBw, idFunction)\n}\n"],"mappings":"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","names":["asSchema","AsObjectFactory","asSchema","asSchema","asSchema","asSchema","asSchema","asSchema","asSchema","asSchema","AsObjectFactory","IsObjectFactory","asSchema","isBoundWitness","isStorageMeta","isBoundWitness","isStorageMeta"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/archivist-model",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -37,10 +37,10 @@
|
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@xylabs/sdk-js": "~5.0.64",
|
|
40
|
-
"@xyo-network/account-model": "~5.
|
|
41
|
-
"@xyo-network/boundwitness-model": "~5.
|
|
42
|
-
"@xyo-network/module-model": "~5.
|
|
43
|
-
"@xyo-network/payload-model": "~5.
|
|
40
|
+
"@xyo-network/account-model": "~5.3.0",
|
|
41
|
+
"@xyo-network/boundwitness-model": "~5.3.0",
|
|
42
|
+
"@xyo-network/module-model": "~5.3.0",
|
|
43
|
+
"@xyo-network/payload-model": "~5.3.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
package/src/ArchivistSnapshot.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import
|
|
2
|
+
import {
|
|
3
|
+
asSchema, type Payload, type PayloadHashMap,
|
|
4
|
+
} from '@xyo-network/payload-model'
|
|
3
5
|
|
|
4
|
-
export const ArchivistSnapshotPayloadSchema = 'network.xyo.archivist.snapshot'
|
|
6
|
+
export const ArchivistSnapshotPayloadSchema = asSchema('network.xyo.archivist.snapshot', true)
|
|
5
7
|
export type ArchivistSnapshotPayloadSchema = typeof ArchivistSnapshotPayloadSchema
|
|
6
8
|
|
|
7
9
|
export type ArchivistSnapshotPayload<TPayload extends Payload = Payload, TId extends string | number | symbol = Hash>
|
package/src/ArchivistStats.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Payload } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export const ArchivistStatsPayloadSchema = 'network.xyo.archivist.stats'
|
|
3
|
+
export const ArchivistStatsPayloadSchema = asSchema('network.xyo.archivist.stats', true)
|
|
4
4
|
export type ArchivistStatsPayloadSchema = typeof ArchivistStatsPayloadSchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistStatsPayload
|
package/src/Config.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { EmptyObject, WithAdditional } from '@xylabs/sdk-js'
|
|
2
2
|
import type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model'
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
Payload,
|
|
5
|
+
Schema,
|
|
6
|
+
} from '@xyo-network/payload-model'
|
|
7
|
+
import { asSchema } from '@xyo-network/payload-model'
|
|
4
8
|
|
|
5
9
|
import type { IndexDescription } from './IndexDescription.ts'
|
|
6
10
|
|
|
@@ -20,10 +24,10 @@ export interface ArchivistGetCache {
|
|
|
20
24
|
maxEntries?: number
|
|
21
25
|
}
|
|
22
26
|
|
|
23
|
-
export const ArchivistConfigSchema = 'network.xyo.archivist.config'
|
|
27
|
+
export const ArchivistConfigSchema = asSchema('network.xyo.archivist.config', true)
|
|
24
28
|
export type ArchivistConfigSchema = typeof ArchivistConfigSchema
|
|
25
29
|
|
|
26
|
-
export type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends
|
|
30
|
+
export type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends Schema | void = void> = ModuleConfig<
|
|
27
31
|
WithAdditional<
|
|
28
32
|
{
|
|
29
33
|
/** @field caching configuration for get calls */
|
package/src/Queries/All.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'
|
|
3
|
+
export const ArchivistAllQuerySchema = asSchema('network.xyo.query.archivist.all', true)
|
|
4
4
|
export type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistAllQuery = Query<{
|
package/src/Queries/Clear.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'
|
|
3
|
+
export const ArchivistClearQuerySchema = asSchema('network.xyo.query.archivist.clear', true)
|
|
4
4
|
export type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistClearQuery = Query<{
|
package/src/Queries/Commit.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'
|
|
3
|
+
export const ArchivistCommitQuerySchema = asSchema('network.xyo.query.archivist.commit', true)
|
|
4
4
|
export type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistCommitQuery = Query<{
|
package/src/Queries/Delete.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import type
|
|
2
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'
|
|
4
|
+
export const ArchivistDeleteQuerySchema = asSchema('network.xyo.query.archivist.delete', true)
|
|
5
5
|
export type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema
|
|
6
6
|
|
|
7
7
|
export type ArchivistDeleteQuery = Query<{
|
package/src/Queries/Get.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js'
|
|
2
|
-
import type
|
|
2
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export const ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'
|
|
4
|
+
export const ArchivistGetQuerySchema = asSchema('network.xyo.query.archivist.get', true)
|
|
5
5
|
export type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema
|
|
6
6
|
|
|
7
7
|
export type ArchivistGetQuery = Query<{
|
package/src/Queries/Insert.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export const ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'
|
|
3
|
+
export const ArchivistInsertQuerySchema = asSchema('network.xyo.query.archivist.insert', true)
|
|
4
4
|
export type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistInsertQuery = Query<{
|
package/src/Queries/Next.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
3
|
import type { ArchivistNextOptions } from '../NextOptions.ts'
|
|
4
4
|
|
|
5
|
-
export const ArchivistNextQuerySchema = 'network.xyo.query.archivist.next'
|
|
5
|
+
export const ArchivistNextQuerySchema = asSchema('network.xyo.query.archivist.next', true)
|
|
6
6
|
export type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema
|
|
7
7
|
|
|
8
8
|
export type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>
|
package/src/Queries/Snapshot.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { asSchema, type Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export const ArchivistSnapshotQuerySchema = 'network.xyo.query.archivist.snapshot'
|
|
3
|
+
export const ArchivistSnapshotQuerySchema = asSchema('network.xyo.query.archivist.snapshot', true)
|
|
4
4
|
export type ArchivistSnapshotQuerySchema = typeof ArchivistSnapshotQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistSnapshotQuery = Query<{
|