@xyo-network/archivist-model 3.6.9 → 3.6.11
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/Queries/All.d.ts +2 -2
- package/dist/neutral/Queries/All.d.ts.map +1 -1
- package/dist/neutral/Queries/Clear.d.ts +2 -2
- package/dist/neutral/Queries/Clear.d.ts.map +1 -1
- package/dist/neutral/Queries/Commit.d.ts +2 -2
- package/dist/neutral/Queries/Commit.d.ts.map +1 -1
- package/dist/neutral/Queries/Delete.d.ts +2 -2
- package/dist/neutral/Queries/Delete.d.ts.map +1 -1
- package/dist/neutral/Queries/Get.d.ts +2 -2
- package/dist/neutral/Queries/Get.d.ts.map +1 -1
- package/dist/neutral/Queries/Insert.d.ts +2 -2
- package/dist/neutral/Queries/Insert.d.ts.map +1 -1
- package/dist/neutral/Queries/Next.d.ts +2 -2
- package/dist/neutral/Queries/Next.d.ts.map +1 -1
- package/dist/neutral/index.mjs +10 -17
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +10 -10
- 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/dist/neutral/StorageMeta.d.ts +0 -18
- package/dist/neutral/StorageMeta.d.ts.map +0 -1
- package/src/StorageMeta.ts +0 -37
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export declare const ArchivistAllQuerySchema: "network.xyo.query.archivist.all";
|
|
3
|
+
export type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema;
|
|
4
4
|
export type ArchivistAllQuery = Query<{
|
|
5
5
|
schema: ArchivistAllQuerySchema;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"All.d.ts","sourceRoot":"","sources":["../../../src/Queries/All.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,
|
|
1
|
+
{"version":3,"file":"All.d.ts","sourceRoot":"","sources":["../../../src/Queries/All.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,eAAO,MAAM,uBAAuB,EAAG,iCAA0C,CAAA;AACjF,MAAM,MAAM,uBAAuB,GAAG,OAAO,uBAAuB,CAAA;AAEpE,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC;IACpC,MAAM,EAAE,uBAAuB,CAAA;CAChC,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export declare const ArchivistClearQuerySchema: "network.xyo.query.archivist.clear";
|
|
3
|
+
export type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema;
|
|
4
4
|
export type ArchivistClearQuery = Query<{
|
|
5
5
|
schema: ArchivistClearQuerySchema;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Clear.d.ts","sourceRoot":"","sources":["../../../src/Queries/Clear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,
|
|
1
|
+
{"version":3,"file":"Clear.d.ts","sourceRoot":"","sources":["../../../src/Queries/Clear.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,eAAO,MAAM,yBAAyB,EAAG,mCAA4C,CAAA;AACrF,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,yBAAyB,CAAA;CAClC,CAAC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export declare const ArchivistCommitQuerySchema: "network.xyo.query.archivist.commit";
|
|
3
|
+
export type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema;
|
|
4
4
|
export type ArchivistCommitQuery = Query<{
|
|
5
5
|
schema: ArchivistCommitQuerySchema;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Commit.d.ts","sourceRoot":"","sources":["../../../src/Queries/Commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,
|
|
1
|
+
{"version":3,"file":"Commit.d.ts","sourceRoot":"","sources":["../../../src/Queries/Commit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,eAAO,MAAM,0BAA0B,EAAG,oCAA6C,CAAA;AACvF,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAA;AAE1E,MAAM,MAAM,oBAAoB,GAAG,KAAK,CAAC;IACvC,MAAM,EAAE,0BAA0B,CAAA;CACnC,CAAC,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex';
|
|
2
2
|
import type { Query } from '@xyo-network/payload-model';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export declare const ArchivistDeleteQuerySchema: "network.xyo.query.archivist.delete";
|
|
4
|
+
export type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema;
|
|
5
5
|
export type ArchivistDeleteQuery = Query<{
|
|
6
6
|
hashes: Hash[];
|
|
7
7
|
schema: ArchivistDeleteQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../src/Queries/Delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,
|
|
1
|
+
{"version":3,"file":"Delete.d.ts","sourceRoot":"","sources":["../../../src/Queries/Delete.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,eAAO,MAAM,0BAA0B,EAAG,oCAA6C,CAAA;AACvF,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,7 +1,7 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex';
|
|
2
2
|
import type { Query } from '@xyo-network/payload-model';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export declare const ArchivistGetQuerySchema: "network.xyo.query.archivist.get";
|
|
4
|
+
export type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema;
|
|
5
5
|
export type ArchivistGetQuery = Query<{
|
|
6
6
|
hashes: Hash[];
|
|
7
7
|
schema: ArchivistGetQuerySchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Get.d.ts","sourceRoot":"","sources":["../../../src/Queries/Get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,
|
|
1
|
+
{"version":3,"file":"Get.d.ts","sourceRoot":"","sources":["../../../src/Queries/Get.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,eAAO,MAAM,uBAAuB,EAAG,iCAA0C,CAAA;AACjF,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,6 +1,6 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
2
|
+
export declare const ArchivistInsertQuerySchema: "network.xyo.query.archivist.insert";
|
|
3
|
+
export type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema;
|
|
4
4
|
export type ArchivistInsertQuery = Query<{
|
|
5
5
|
schema: ArchivistInsertQuerySchema;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Insert.d.ts","sourceRoot":"","sources":["../../../src/Queries/Insert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,
|
|
1
|
+
{"version":3,"file":"Insert.d.ts","sourceRoot":"","sources":["../../../src/Queries/Insert.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,eAAO,MAAM,0BAA0B,EAAG,oCAA6C,CAAA;AACvF,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,6 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model';
|
|
2
2
|
import type { ArchivistNextOptions } from '../NextOptions.ts';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export declare const ArchivistNextQuerySchema: "network.xyo.query.archivist.next";
|
|
4
|
+
export type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema;
|
|
5
5
|
export type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>;
|
|
6
6
|
//# 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,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,
|
|
1
|
+
{"version":3,"file":"Next.d.ts","sourceRoot":"","sources":["../../../src/Queries/Next.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AAEvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAE7D,eAAO,MAAM,wBAAwB,EAAG,kCAA2C,CAAA;AACnF,MAAM,MAAM,wBAAwB,GAAG,OAAO,wBAAwB,CAAA;AAEtE,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,oBAAoB,EAAE,wBAAwB,CAAC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
1
|
// src/attachable/asAttachableInstance.ts
|
|
5
2
|
import { AsObjectFactory as AsObjectFactory2 } from "@xylabs/object";
|
|
6
3
|
|
|
@@ -10,7 +7,12 @@ import { isAttachableModuleInstance } from "@xyo-network/module-model";
|
|
|
10
7
|
|
|
11
8
|
// src/typeChecks.ts
|
|
12
9
|
import { AsObjectFactory } from "@xylabs/object";
|
|
13
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
IsInstanceFactory,
|
|
12
|
+
IsModuleFactory,
|
|
13
|
+
isModuleInstance,
|
|
14
|
+
WithFactory
|
|
15
|
+
} from "@xyo-network/module-model";
|
|
14
16
|
|
|
15
17
|
// src/Queries/All.ts
|
|
16
18
|
var ArchivistAllQuerySchema = "network.xyo.query.archivist.all";
|
|
@@ -34,14 +36,8 @@ var ArchivistInsertQuerySchema = "network.xyo.query.archivist.insert";
|
|
|
34
36
|
var ArchivistNextQuerySchema = "network.xyo.query.archivist.next";
|
|
35
37
|
|
|
36
38
|
// src/typeChecks.ts
|
|
37
|
-
var isArchivistInstance = new IsInstanceFactory().create({
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
isModuleInstance
|
|
41
|
-
]);
|
|
42
|
-
var isArchivistModule = new IsModuleFactory().create([
|
|
43
|
-
ArchivistGetQuerySchema
|
|
44
|
-
]);
|
|
39
|
+
var isArchivistInstance = new IsInstanceFactory().create({ get: "function" }, [isModuleInstance]);
|
|
40
|
+
var isArchivistModule = new IsModuleFactory().create([ArchivistGetQuerySchema]);
|
|
45
41
|
var asArchivistModule = AsObjectFactory.create(isArchivistModule);
|
|
46
42
|
var asArchivistInstance = AsObjectFactory.create(isArchivistInstance);
|
|
47
43
|
var withArchivistModule = WithFactory.create(isArchivistModule);
|
|
@@ -61,9 +57,6 @@ var asAttachableArchivistInstance = AsObjectFactory2.create(isAttachableArchivis
|
|
|
61
57
|
// src/attachable/AttachableInstance.ts
|
|
62
58
|
import { IsObjectFactory as IsObjectFactory2 } from "@xylabs/object";
|
|
63
59
|
var IsAttachableArchivistInstanceFactory = class extends IsObjectFactory2 {
|
|
64
|
-
static {
|
|
65
|
-
__name(this, "IsAttachableArchivistInstanceFactory");
|
|
66
|
-
}
|
|
67
60
|
};
|
|
68
61
|
|
|
69
62
|
// src/Config.ts
|
|
@@ -71,12 +64,12 @@ var ArchivistConfigSchema = "network.xyo.archivist.config";
|
|
|
71
64
|
|
|
72
65
|
// src/IndexDescription.ts
|
|
73
66
|
var IndexSeparator = "-";
|
|
74
|
-
var buildStandardIndexName =
|
|
67
|
+
var buildStandardIndexName = (index) => {
|
|
75
68
|
const { key, unique } = index;
|
|
76
69
|
const prefix = unique ? "UX" : "IX";
|
|
77
70
|
const indexKeys = Object.keys(key);
|
|
78
71
|
return `${prefix}_${indexKeys.join(IndexSeparator)}`;
|
|
79
|
-
}
|
|
72
|
+
};
|
|
80
73
|
export {
|
|
81
74
|
ArchivistAllQuerySchema,
|
|
82
75
|
ArchivistClearQuerySchema,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../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/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableArchivistInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableArchivistInstance = AsObjectFactory.create(isAttachableArchivistInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\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 { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { ArchivistInstance } from './Instance.ts'\nimport type { ArchivistModule } from './Module.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = new IsModuleFactory<ArchivistModule>().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 type ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'\nexport const ArchivistAllQuerySchema: ArchivistAllQuerySchema = 'network.xyo.query.archivist.all'\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'\nexport const ArchivistClearQuerySchema: ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear'\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'\nexport const ArchivistCommitQuerySchema: ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit'\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/hex'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'\nexport const ArchivistDeleteQuerySchema: ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete'\n\nexport type ArchivistDeleteQuery = Query<{\n hashes: Hash[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import type { Hash } from '@xylabs/hex'\nimport type { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'\nexport const ArchivistGetQuerySchema: ArchivistGetQuerySchema = 'network.xyo.query.archivist.get'\n\nexport type ArchivistGetQuery = Query<{\n hashes: Hash[]\n schema: ArchivistGetQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport type ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'\nexport const ArchivistInsertQuerySchema: ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert'\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 type ArchivistNextQuerySchema = 'network.xyo.query.archivist.next'\nexport const ArchivistNextQuerySchema: ArchivistNextQuerySchema = 'network.xyo.query.archivist.next'\n\nexport type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\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 { ArchivistModule } from '../Module.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 ArchivistModule<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 { Address } from '@xylabs/hex'\nimport type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig } 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?: Address[]\n read?: Address[]\n write?: Address[]\n}\n\nexport interface ArchivistStorage {\n /** The indexes to create on the object store */\n indexes?: IndexDescription[]\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 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"],"mappings":";;;;AAAA,SAASA,mBAAAA,wBAAuB;;;ACChC,SAASC,uBAAuB;AAEhC,SAASC,kCAAkC;;;ACH3C,SAASC,uBAAuB;AAChC,SACEC,mBAAmBC,iBAAiBC,kBAAkBC,mBACjD;;;ACAA,IAAMC,0BAAmD;;;ACAzD,IAAMC,4BAAuD;;;ACA7D,IAAMC,6BAAyD;;;ACC/D,IAAMC,6BAAyD;;;ACA/D,IAAMC,0BAAmD;;;ACDzD,IAAMC,6BAAyD;;;ACE/D,IAAMC,2BAAqD;;;API3D,IAAMC,sBAAsB,IAAIC,kBAAAA,EAAuCC,OAAO;EAAEC,KAAK;AAAW,GAAG;EAACC;CAAiB;AACrH,IAAMC,oBAAoB,IAAIC,gBAAAA,EAAmCJ,OAAO;EAACK;CAAwB;AAEjG,IAAMC,oBAAoBC,gBAAgBP,OAAOG,iBAAAA;AACjD,IAAMK,sBAAsBD,gBAAgBP,OAAOF,mBAAAA;AACnD,IAAMW,sBAAsBC,YAAYV,OAAOG,iBAAAA;AAC/C,IAAMQ,wBAAwBD,YAAYV,OAAOF,mBAAAA;;;ADPjD,IAAMc,+CAAgE,CAAC;AAG9E,IAAMC,UAAU,IAAIC,gBAAAA;AAEb,IAAMC,gCAAwEF,QAAQG,OAAOJ,8CAA8C;EAChJK;EACAC;CACD;;;ADZM,IAAMC,gCAAgCC,iBAAgBC,OAAOC,6BAAAA;;;AUHpE,SAASC,mBAAAA,wBAAuB;AAmBzB,IAAMC,uCAAN,cAAwHC,iBAAAA;EAnB/H,OAmB+HA;;;AAAoB;;;ACF5I,IAAMC,wBAAwB;;;ACS9B,IAAMC,iBAAiB;AAQvB,IAAMC,yBAAyB,wBAACC,UAAAA;AACrC,QAAM,EAAEC,KAAKC,OAAM,IAAKF;AACxB,QAAMG,SAASD,SAAS,OAAO;AAC/B,QAAME,YAAYC,OAAOC,KAAKL,GAAAA;AAC9B,SAAO,GAAGE,MAAAA,IAAUC,UAAUG,KAAKT,cAAAA,CAAAA;AACrC,GALsC;","names":["AsObjectFactory","IsObjectFactory","isAttachableModuleInstance","AsObjectFactory","IsInstanceFactory","IsModuleFactory","isModuleInstance","WithFactory","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistCommitQuerySchema","ArchivistDeleteQuerySchema","ArchivistGetQuerySchema","ArchivistInsertQuerySchema","ArchivistNextQuerySchema","isArchivistInstance","IsInstanceFactory","create","get","isModuleInstance","isArchivistModule","IsModuleFactory","ArchivistGetQuerySchema","asArchivistModule","AsObjectFactory","asArchivistInstance","withArchivistModule","WithFactory","withArchivistInstance","requiredAttachableArchivistInstanceFunctions","factory","IsObjectFactory","isAttachableArchivistInstance","create","isArchivistInstance","isAttachableModuleInstance","asAttachableArchivistInstance","AsObjectFactory","create","isAttachableArchivistInstance","IsObjectFactory","IsAttachableArchivistInstanceFactory","IsObjectFactory","ArchivistConfigSchema","IndexSeparator","buildStandardIndexName","index","key","unique","prefix","indexKeys","Object","keys","join"]}
|
|
1
|
+
{"version":3,"sources":["../../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/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts"],"sourcesContent":["import { AsObjectFactory } from '@xylabs/object'\n\nimport { isAttachableArchivistInstance } from './isAttachableInstance.ts'\n\nexport const asAttachableArchivistInstance = AsObjectFactory.create(isAttachableArchivistInstance)\n","import type { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\nimport type { ObjectTypeShape } from '@xylabs/typeof'\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 { AsObjectFactory } from '@xylabs/object'\nimport {\n IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory,\n} from '@xyo-network/module-model'\n\nimport type { ArchivistInstance } from './Instance.ts'\nimport type { ArchivistModule } from './Module.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = new IsModuleFactory<ArchivistModule>().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/hex'\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/hex'\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 { TypeCheck } from '@xylabs/object'\nimport { IsObjectFactory } from '@xylabs/object'\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 { ArchivistModule } from '../Module.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 ArchivistModule<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 { Address } from '@xylabs/hex'\nimport type { EmptyObject, WithAdditional } from '@xylabs/object'\nimport type { ModuleConfig } 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?: Address[]\n read?: Address[]\n write?: Address[]\n}\n\nexport interface ArchivistStorage {\n /** The indexes to create on the object store */\n indexes?: IndexDescription[]\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 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"],"mappings":";AAAA,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB;AAEhC,SAAS,kCAAkC;;;ACH3C,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,EAAmB;AAAA,EAAiB;AAAA,EAAkB;AAAA,OACjD;;;ACDA,IAAM,0BAA0B;;;ACAhC,IAAM,4BAA4B;;;ACAlC,IAAM,6BAA6B;;;ACCnC,IAAM,6BAA6B;;;ACAnC,IAAM,0BAA0B;;;ACDhC,IAAM,6BAA6B;;;ACEnC,IAAM,2BAA2B;;;APKjC,IAAM,sBAAsB,IAAI,kBAAqC,EAAE,OAAO,EAAE,KAAK,WAAW,GAAG,CAAC,gBAAgB,CAAC;AACrH,IAAM,oBAAoB,IAAI,gBAAiC,EAAE,OAAO,CAAC,uBAAuB,CAAC;AAEjG,IAAM,oBAAoB,gBAAgB,OAAO,iBAAiB;AAClE,IAAM,sBAAsB,gBAAgB,OAAO,mBAAmB;AACtE,IAAM,sBAAsB,YAAY,OAAO,iBAAiB;AAChE,IAAM,wBAAwB,YAAY,OAAO,mBAAmB;;;ADPpE,IAAM,+CAAgE,CAAC;AAG9E,IAAM,UAAU,IAAI,gBAA6C;AAE1D,IAAM,gCAAwE,QAAQ,OAAO,8CAA8C;AAAA,EAChJ;AAAA,EACA;AACF,CAAC;;;ADZM,IAAM,gCAAgCC,iBAAgB,OAAO,6BAA6B;;;AUHjG,SAAS,mBAAAC,wBAAuB;AAmBzB,IAAM,uCAAN,cAAwHA,iBAAmB;AAAC;;;ACF5I,IAAM,wBAAwB;;;ACS9B,IAAM,iBAAiB;AAQvB,IAAM,yBAAyB,CAAC,UAA4B;AACjE,QAAM,EAAE,KAAK,OAAO,IAAI;AACxB,QAAM,SAAS,SAAS,OAAO;AAC/B,QAAM,YAAY,OAAO,KAAK,GAAG;AACjC,SAAO,GAAG,MAAM,IAAI,UAAU,KAAK,cAAc,CAAC;AACpD;","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/archivist-model",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.11",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -29,19 +29,19 @@
|
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@xylabs/hex": "^4.
|
|
33
|
-
"@xylabs/object": "^4.
|
|
34
|
-
"@xylabs/promise": "^4.
|
|
35
|
-
"@xylabs/typeof": "^4.
|
|
36
|
-
"@xyo-network/account-model": "^3.6.
|
|
37
|
-
"@xyo-network/module-events": "^3.6.
|
|
38
|
-
"@xyo-network/module-model": "^3.6.
|
|
39
|
-
"@xyo-network/payload-model": "^3.6.
|
|
32
|
+
"@xylabs/hex": "^4.5.1",
|
|
33
|
+
"@xylabs/object": "^4.5.1",
|
|
34
|
+
"@xylabs/promise": "^4.5.1",
|
|
35
|
+
"@xylabs/typeof": "^4.5.1",
|
|
36
|
+
"@xyo-network/account-model": "^3.6.11",
|
|
37
|
+
"@xyo-network/module-events": "^3.6.11",
|
|
38
|
+
"@xyo-network/module-model": "^3.6.11",
|
|
39
|
+
"@xyo-network/payload-model": "^3.6.11"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@xylabs/ts-scripts-yarn3": "^4.2.6",
|
|
43
43
|
"@xylabs/tsconfig": "^4.2.6",
|
|
44
|
-
"typescript": "^5.7.
|
|
44
|
+
"typescript": "^5.7.3"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
package/src/Queries/All.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all' as const
|
|
4
|
+
export type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistAllQuery = Query<{
|
|
7
7
|
schema: ArchivistAllQuerySchema
|
package/src/Queries/Clear.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear' as const
|
|
4
|
+
export type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistClearQuery = Query<{
|
|
7
7
|
schema: ArchivistClearQuerySchema
|
package/src/Queries/Commit.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit' as const
|
|
4
|
+
export type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistCommitQuery = Query<{
|
|
7
7
|
schema: ArchivistCommitQuerySchema
|
package/src/Queries/Delete.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex'
|
|
2
2
|
import type { Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export const ArchivistDeleteQuerySchema = 'network.xyo.query.archivist.delete' as const
|
|
5
|
+
export type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema
|
|
6
6
|
|
|
7
7
|
export type ArchivistDeleteQuery = Query<{
|
|
8
8
|
hashes: Hash[]
|
package/src/Queries/Get.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/hex'
|
|
2
2
|
import type { Query } from '@xyo-network/payload-model'
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
export
|
|
4
|
+
export const ArchivistGetQuerySchema = 'network.xyo.query.archivist.get' as const
|
|
5
|
+
export type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema
|
|
6
6
|
|
|
7
7
|
export type ArchivistGetQuery = Query<{
|
|
8
8
|
hashes: Hash[]
|
package/src/Queries/Insert.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Query } from '@xyo-network/payload-model'
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
export
|
|
3
|
+
export const ArchivistInsertQuerySchema = 'network.xyo.query.archivist.insert' as const
|
|
4
|
+
export type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema
|
|
5
5
|
|
|
6
6
|
export type ArchivistInsertQuery = Query<{
|
|
7
7
|
schema: ArchivistInsertQuerySchema
|
package/src/Queries/Next.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Query } from '@xyo-network/payload-model'
|
|
|
2
2
|
|
|
3
3
|
import type { ArchivistNextOptions } from '../NextOptions.ts'
|
|
4
4
|
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export const ArchivistNextQuerySchema = 'network.xyo.query.archivist.next' as const
|
|
6
|
+
export type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema
|
|
7
7
|
|
|
8
8
|
export type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Hash, Hex } from '@xylabs/hex';
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
export interface StorageMeta {
|
|
4
|
-
_dataHash: Hash;
|
|
5
|
-
_hash: Hash;
|
|
6
|
-
_sequence: Hex;
|
|
7
|
-
}
|
|
8
|
-
export type WithPartialStorageMeta<T extends Payload = Payload> = Partial<WithStorageMeta<T>>;
|
|
9
|
-
export type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta;
|
|
10
|
-
export declare const SequenceConstants: {
|
|
11
|
-
epochBytes: number;
|
|
12
|
-
nonceBytes: number;
|
|
13
|
-
addressBytes: number;
|
|
14
|
-
maxEpoch: number;
|
|
15
|
-
localSequenceBytes: number;
|
|
16
|
-
qualifiedSequenceBytes: number;
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=StorageMeta.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"StorageMeta.d.ts","sourceRoot":"","sources":["../../src/StorageMeta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE,IAAI,CAAA;IACf,KAAK,EAAE,IAAI,CAAA;IAEX,SAAS,EAAE,GAAG,CAAA;CACf;AAED,MAAM,MAAM,sBAAsB,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAA;AAE7F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,OAAO,GAAG,OAAO,IAAI,CAAC,GAAG,WAAW,CAAA;AAc1E,eAAO,MAAM,iBAAiB;;;;;;;CAG7B,CAAA"}
|
package/src/StorageMeta.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Hash, Hex } from '@xylabs/hex'
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model'
|
|
3
|
-
|
|
4
|
-
export interface StorageMeta {
|
|
5
|
-
_dataHash: Hash
|
|
6
|
-
_hash: Hash
|
|
7
|
-
// this sequence number must be a 0 padded string representation of a 18 byte sequence number
|
|
8
|
-
_sequence: Hex // zero padded epoch/index (when returned, has address as suffix) - to be used as a universal cursor
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type WithPartialStorageMeta<T extends Payload = Payload> = Partial<WithStorageMeta<T>>
|
|
12
|
-
|
|
13
|
-
export type WithStorageMeta<T extends Payload = Payload> = T & StorageMeta
|
|
14
|
-
|
|
15
|
-
const StorageMetaComponentConstants = {
|
|
16
|
-
epochBytes: 8,
|
|
17
|
-
nonceBytes: 8,
|
|
18
|
-
addressBytes: 20,
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const StorageMetaLocalConstants = {
|
|
22
|
-
maxEpoch: Math.pow(256, StorageMetaComponentConstants.epochBytes) - 1,
|
|
23
|
-
localSequenceBytes: StorageMetaComponentConstants.epochBytes + StorageMetaComponentConstants.nonceBytes,
|
|
24
|
-
...StorageMetaComponentConstants,
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export const SequenceConstants = {
|
|
28
|
-
qualifiedSequenceBytes: StorageMetaLocalConstants.localSequenceBytes + StorageMetaComponentConstants.addressBytes,
|
|
29
|
-
...StorageMetaLocalConstants,
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// "00005a7f354762f3ac1bc5ddc6cfd08d14" is and example of a local sequence string
|
|
33
|
-
|
|
34
|
-
// "00005a7f354762f3ac1bc5ddc6cfd08d14a123456789abcdef0123" is and example of a local sequence string
|
|
35
|
-
// epoch = "00005a7f354762f3ac"
|
|
36
|
-
// nonce = "1bc5ddc6cfd08d14"
|
|
37
|
-
// address = "a123456789abcdef0123"
|