@xyo-network/archivist-model 2.86.1 → 2.87.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1;
5
+ /**
6
+ * Description of index(es) to be created on a store
7
+ */
8
+ export type IndexDescription = {
9
+ /**
10
+ * The key(s) to index
11
+ */
12
+ key: {
13
+ [key: string]: IndexDirection;
14
+ } | Map<string, IndexDirection>;
15
+ /**
16
+ * The name of the index
17
+ */
18
+ name?: string;
19
+ /**
20
+ * If true, the index must enforce uniqueness on the key
21
+ */
22
+ unique?: boolean;
23
+ };
24
+ //# sourceMappingURL=IndexDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexDescription.d.ts","sourceRoot":"","sources":["../../src/IndexDescription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EACC;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAC9B,GACD,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1;
5
+ /**
6
+ * Description of index(es) to be created on a store
7
+ */
8
+ export type IndexDescription = {
9
+ /**
10
+ * The key(s) to index
11
+ */
12
+ key: {
13
+ [key: string]: IndexDirection;
14
+ } | Map<string, IndexDirection>;
15
+ /**
16
+ * The name of the index
17
+ */
18
+ name?: string;
19
+ /**
20
+ * If true, the index must enforce uniqueness on the key
21
+ */
22
+ unique?: boolean;
23
+ };
24
+ //# sourceMappingURL=IndexDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexDescription.d.ts","sourceRoot":"","sources":["../../src/IndexDescription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EACC;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAC9B,GACD,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1;
5
+ /**
6
+ * Description of index(es) to be created on a store
7
+ */
8
+ export type IndexDescription = {
9
+ /**
10
+ * The key(s) to index
11
+ */
12
+ key: {
13
+ [key: string]: IndexDirection;
14
+ } | Map<string, IndexDirection>;
15
+ /**
16
+ * The name of the index
17
+ */
18
+ name?: string;
19
+ /**
20
+ * If true, the index must enforce uniqueness on the key
21
+ */
22
+ unique?: boolean;
23
+ };
24
+ //# sourceMappingURL=IndexDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexDescription.d.ts","sourceRoot":"","sources":["../../src/IndexDescription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EACC;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAC9B,GACD,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Config.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/typeChecks.ts"],"sourcesContent":["export * from './Archivist'\nexport * from './ArchivistInstance'\nexport * from './Config'\nexport * from './Params'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { Address } from '@xylabs/hex'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { EmptyObject, WithAdditional } from '@xyo-network/object'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport interface ArchivistParents {\n commit?: Address[]\n read?: Address[]\n write?: Address[]\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config'\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 should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","import { 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 { 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 { 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 { 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: string[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import { 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: string[]\n schema: ArchivistGetQuerySchema\n}>\n","import { 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 { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { ArchivistModule } from './Archivist'\nimport { ArchivistInstance } from './ArchivistInstance'\nimport { ArchivistGetQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACWO,IAAMA,wBAAwB;;;ACR9B,IAAMC,0BAAmD;;;ACAzD,IAAMC,4BAAuD;;;ACA7D,IAAMC,6BAAyD;;;ACA/D,IAAMC,6BAAyD;;;ACA/D,IAAMC,0BAAmD;;;ACAzD,IAAMC,6BAAyD;;;ACHtE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAMC,sBAAsB,IAAIC,sCAAAA,EAAuCC,OAAO;EAAEC,KAAK;AAAW,GAAG;EAACC;CAAiB;AACrH,IAAMC,oBAAoB,IAAIC,oCAAAA,EAAmCJ,OAAO;EAACK;CAAwB;AAEjG,IAAMC,oBAAoBC,8BAAgBP,OAAOG,iBAAAA;AACjD,IAAMK,sBAAsBD,8BAAgBP,OAAOF,mBAAAA;AACnD,IAAMW,sBAAsBC,gCAAYV,OAAOG,iBAAAA;AAC/C,IAAMQ,wBAAwBD,gCAAYV,OAAOF,mBAAAA;","names":["ArchivistConfigSchema","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistCommitQuerySchema","ArchivistDeleteQuerySchema","ArchivistGetQuerySchema","ArchivistInsertQuerySchema","isArchivistInstance","IsInstanceFactory","create","get","isModuleInstance","isArchivistModule","IsModuleFactory","ArchivistGetQuerySchema","asArchivistModule","AsObjectFactory","asArchivistInstance","withArchivistModule","WithFactory","withArchivistInstance"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Config.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/typeChecks.ts"],"sourcesContent":["export * from './Archivist'\nexport * from './ArchivistInstance'\nexport * from './Config'\nexport * from './IndexDescription'\nexport * from './Params'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { Address } from '@xylabs/hex'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { EmptyObject, WithAdditional } from '@xyo-network/object'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport interface ArchivistParents {\n commit?: Address[]\n read?: Address[]\n write?: Address[]\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config'\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 should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","import { 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 { 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 { 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 { 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: string[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import { 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: string[]\n schema: ArchivistGetQuerySchema\n}>\n","import { 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 { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { ArchivistModule } from './Archivist'\nimport { ArchivistInstance } from './ArchivistInstance'\nimport { ArchivistGetQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACWO,IAAMA,wBAAwB;;;ACR9B,IAAMC,0BAAmD;;;ACAzD,IAAMC,4BAAuD;;;ACA7D,IAAMC,6BAAyD;;;ACA/D,IAAMC,6BAAyD;;;ACA/D,IAAMC,0BAAmD;;;ACAzD,IAAMC,6BAAyD;;;ACHtE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAMC,sBAAsB,IAAIC,sCAAAA,EAAuCC,OAAO;EAAEC,KAAK;AAAW,GAAG;EAACC;CAAiB;AACrH,IAAMC,oBAAoB,IAAIC,oCAAAA,EAAmCJ,OAAO;EAACK;CAAwB;AAEjG,IAAMC,oBAAoBC,8BAAgBP,OAAOG,iBAAAA;AACjD,IAAMK,sBAAsBD,8BAAgBP,OAAOF,mBAAAA;AACnD,IAAMW,sBAAsBC,gCAAYV,OAAOG,iBAAAA;AAC/C,IAAMQ,wBAAwBD,gCAAYV,OAAOF,mBAAAA;","names":["ArchivistConfigSchema","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistCommitQuerySchema","ArchivistDeleteQuerySchema","ArchivistGetQuerySchema","ArchivistInsertQuerySchema","isArchivistInstance","IsInstanceFactory","create","get","isModuleInstance","isArchivistModule","IsModuleFactory","ArchivistGetQuerySchema","asArchivistModule","AsObjectFactory","asArchivistInstance","withArchivistModule","WithFactory","withArchivistInstance"]}
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist';
2
2
  export * from './ArchivistInstance';
3
3
  export * from './Config';
4
+ export * from './IndexDescription';
4
5
  export * from './Params';
5
6
  export * from './Queries';
6
7
  export * from './typeChecks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist';
2
2
  export * from './ArchivistInstance';
3
3
  export * from './Config';
4
+ export * from './IndexDescription';
4
5
  export * from './Params';
5
6
  export * from './Queries';
6
7
  export * from './typeChecks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist';
2
2
  export * from './ArchivistInstance';
3
3
  export * from './Config';
4
+ export * from './IndexDescription';
4
5
  export * from './Params';
5
6
  export * from './Queries';
6
7
  export * from './typeChecks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1;
5
+ /**
6
+ * Description of index(es) to be created on a store
7
+ */
8
+ export type IndexDescription = {
9
+ /**
10
+ * The key(s) to index
11
+ */
12
+ key: {
13
+ [key: string]: IndexDirection;
14
+ } | Map<string, IndexDirection>;
15
+ /**
16
+ * The name of the index
17
+ */
18
+ name?: string;
19
+ /**
20
+ * If true, the index must enforce uniqueness on the key
21
+ */
22
+ unique?: boolean;
23
+ };
24
+ //# sourceMappingURL=IndexDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexDescription.d.ts","sourceRoot":"","sources":["../../src/IndexDescription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EACC;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAC9B,GACD,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1;
5
+ /**
6
+ * Description of index(es) to be created on a store
7
+ */
8
+ export type IndexDescription = {
9
+ /**
10
+ * The key(s) to index
11
+ */
12
+ key: {
13
+ [key: string]: IndexDirection;
14
+ } | Map<string, IndexDirection>;
15
+ /**
16
+ * The name of the index
17
+ */
18
+ name?: string;
19
+ /**
20
+ * If true, the index must enforce uniqueness on the key
21
+ */
22
+ unique?: boolean;
23
+ };
24
+ //# sourceMappingURL=IndexDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexDescription.d.ts","sourceRoot":"","sources":["../../src/IndexDescription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EACC;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAC9B,GACD,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1;
5
+ /**
6
+ * Description of index(es) to be created on a store
7
+ */
8
+ export type IndexDescription = {
9
+ /**
10
+ * The key(s) to index
11
+ */
12
+ key: {
13
+ [key: string]: IndexDirection;
14
+ } | Map<string, IndexDirection>;
15
+ /**
16
+ * The name of the index
17
+ */
18
+ name?: string;
19
+ /**
20
+ * If true, the index must enforce uniqueness on the key
21
+ */
22
+ unique?: boolean;
23
+ };
24
+ //# sourceMappingURL=IndexDescription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IndexDescription.d.ts","sourceRoot":"","sources":["../../src/IndexDescription.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,GAAG,CAAC,CAAA;AAEnC;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,GAAG,EACC;QACE,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,CAAA;KAC9B,GACD,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IAC/B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Config.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/typeChecks.ts"],"sourcesContent":["export * from './Archivist'\nexport * from './ArchivistInstance'\nexport * from './Config'\nexport * from './Params'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { Address } from '@xylabs/hex'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { EmptyObject, WithAdditional } from '@xyo-network/object'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport interface ArchivistParents {\n commit?: Address[]\n read?: Address[]\n write?: Address[]\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config'\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 should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","import { 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 { 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 { 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 { 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: string[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import { 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: string[]\n schema: ArchivistGetQuerySchema\n}>\n","import { 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 { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { ArchivistModule } from './Archivist'\nimport { ArchivistInstance } from './ArchivistInstance'\nimport { ArchivistGetQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACWO,IAAMA,wBAAwB;;;ACR9B,IAAMC,0BAAmD;;;ACAzD,IAAMC,4BAAuD;;;ACA7D,IAAMC,6BAAyD;;;ACA/D,IAAMC,6BAAyD;;;ACA/D,IAAMC,0BAAmD;;;ACAzD,IAAMC,6BAAyD;;;ACHtE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAMC,sBAAsB,IAAIC,sCAAAA,EAAuCC,OAAO;EAAEC,KAAK;AAAW,GAAG;EAACC;CAAiB;AACrH,IAAMC,oBAAoB,IAAIC,oCAAAA,EAAmCJ,OAAO;EAACK;CAAwB;AAEjG,IAAMC,oBAAoBC,8BAAgBP,OAAOG,iBAAAA;AACjD,IAAMK,sBAAsBD,8BAAgBP,OAAOF,mBAAAA;AACnD,IAAMW,sBAAsBC,gCAAYV,OAAOG,iBAAAA;AAC/C,IAAMQ,wBAAwBD,gCAAYV,OAAOF,mBAAAA;","names":["ArchivistConfigSchema","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistCommitQuerySchema","ArchivistDeleteQuerySchema","ArchivistGetQuerySchema","ArchivistInsertQuerySchema","isArchivistInstance","IsInstanceFactory","create","get","isModuleInstance","isArchivistModule","IsModuleFactory","ArchivistGetQuerySchema","asArchivistModule","AsObjectFactory","asArchivistInstance","withArchivistModule","WithFactory","withArchivistInstance"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Config.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/typeChecks.ts"],"sourcesContent":["export * from './Archivist'\nexport * from './ArchivistInstance'\nexport * from './Config'\nexport * from './IndexDescription'\nexport * from './Params'\nexport * from './Queries'\nexport * from './typeChecks'\n","import { Address } from '@xylabs/hex'\nimport { ModuleConfig } from '@xyo-network/module-model'\nimport { EmptyObject, WithAdditional } from '@xyo-network/object'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport interface ArchivistParents {\n commit?: Address[]\n read?: Address[]\n write?: Address[]\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config'\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 should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","import { 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 { 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 { 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 { 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: string[]\n schema: ArchivistDeleteQuerySchema\n}>\n","import { 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: string[]\n schema: ArchivistGetQuerySchema\n}>\n","import { 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 { IsInstanceFactory, IsModuleFactory, isModuleInstance, WithFactory } from '@xyo-network/module-model'\nimport { AsObjectFactory } from '@xyo-network/object'\n\nimport { ArchivistModule } from './Archivist'\nimport { ArchivistInstance } from './ArchivistInstance'\nimport { ArchivistGetQuerySchema } from './Queries'\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;ACWO,IAAMA,wBAAwB;;;ACR9B,IAAMC,0BAAmD;;;ACAzD,IAAMC,4BAAuD;;;ACA7D,IAAMC,6BAAyD;;;ACA/D,IAAMC,6BAAyD;;;ACA/D,IAAMC,0BAAmD;;;ACAzD,IAAMC,6BAAyD;;;ACHtE,0BAAkF;AAClF,oBAAgC;AAMzB,IAAMC,sBAAsB,IAAIC,sCAAAA,EAAuCC,OAAO;EAAEC,KAAK;AAAW,GAAG;EAACC;CAAiB;AACrH,IAAMC,oBAAoB,IAAIC,oCAAAA,EAAmCJ,OAAO;EAACK;CAAwB;AAEjG,IAAMC,oBAAoBC,8BAAgBP,OAAOG,iBAAAA;AACjD,IAAMK,sBAAsBD,8BAAgBP,OAAOF,mBAAAA;AACnD,IAAMW,sBAAsBC,gCAAYV,OAAOG,iBAAAA;AAC/C,IAAMQ,wBAAwBD,gCAAYV,OAAOF,mBAAAA;","names":["ArchivistConfigSchema","ArchivistAllQuerySchema","ArchivistClearQuerySchema","ArchivistCommitQuerySchema","ArchivistDeleteQuerySchema","ArchivistGetQuerySchema","ArchivistInsertQuerySchema","isArchivistInstance","IsInstanceFactory","create","get","isModuleInstance","isArchivistModule","IsModuleFactory","ArchivistGetQuerySchema","asArchivistModule","AsObjectFactory","asArchivistInstance","withArchivistModule","WithFactory","withArchivistInstance"]}
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist';
2
2
  export * from './ArchivistInstance';
3
3
  export * from './Config';
4
+ export * from './IndexDescription';
4
5
  export * from './Params';
5
6
  export * from './Queries';
6
7
  export * from './typeChecks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist';
2
2
  export * from './ArchivistInstance';
3
3
  export * from './Config';
4
+ export * from './IndexDescription';
4
5
  export * from './Params';
5
6
  export * from './Queries';
6
7
  export * from './typeChecks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist';
2
2
  export * from './ArchivistInstance';
3
3
  export * from './Config';
4
+ export * from './IndexDescription';
4
5
  export * from './Params';
5
6
  export * from './Queries';
6
7
  export * from './typeChecks';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,UAAU,CAAA;AACxB,cAAc,oBAAoB,CAAA;AAClC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA"}
package/package.json CHANGED
@@ -12,14 +12,14 @@
12
12
  "dependencies": {
13
13
  "@xylabs/hex": "^2.13.23",
14
14
  "@xylabs/promise": "^2.13.23",
15
- "@xyo-network/module-events": "~2.86.1",
16
- "@xyo-network/module-model": "~2.86.1",
17
- "@xyo-network/object": "~2.86.1",
18
- "@xyo-network/payload-model": "~2.86.1"
15
+ "@xyo-network/module-events": "~2.87.0-rc.1",
16
+ "@xyo-network/module-model": "~2.87.0-rc.1",
17
+ "@xyo-network/object": "~2.87.0-rc.1",
18
+ "@xyo-network/payload-model": "~2.87.0-rc.1"
19
19
  },
20
20
  "devDependencies": {
21
- "@xylabs/ts-scripts-yarn3": "^3.2.28",
22
- "@xylabs/tsconfig": "^3.2.28",
21
+ "@xylabs/ts-scripts-yarn3": "^3.2.29",
22
+ "@xylabs/tsconfig": "^3.2.29",
23
23
  "typescript": "^5.3.3"
24
24
  },
25
25
  "description": "Primary SDK for using XYO Protocol 2.0",
@@ -61,6 +61,7 @@
61
61
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
62
62
  },
63
63
  "sideEffects": false,
64
- "version": "2.86.1",
65
- "type": "module"
64
+ "version": "2.87.0-rc.1",
65
+ "type": "module",
66
+ "stableVersion": "2.86.1"
66
67
  }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The index direction (1 for ascending, -1 for descending)
3
+ */
4
+ export type IndexDirection = -1 | 1
5
+
6
+ /**
7
+ * Description of index(es) to be created on a store
8
+ */
9
+ export type IndexDescription = {
10
+ /**
11
+ * The key(s) to index
12
+ */
13
+ key:
14
+ | {
15
+ [key: string]: IndexDirection
16
+ }
17
+ | Map<string, IndexDirection>
18
+ /**
19
+ * The name of the index
20
+ */
21
+ name?: string
22
+ /**
23
+ * If true, the index must enforce uniqueness on the key
24
+ */
25
+ unique?: boolean
26
+ }
package/src/index.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './Archivist'
2
2
  export * from './ArchivistInstance'
3
3
  export * from './Config'
4
+ export * from './IndexDescription'
4
5
  export * from './Params'
5
6
  export * from './Queries'
6
7
  export * from './typeChecks'