@xyo-network/archivist-model 3.8.0 → 3.8.2
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/index.d.ts +995 -14
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/ArchivistFunctions.ts +22 -0
- package/src/Instance.ts +3 -3
- package/src/Module.ts +10 -8
- package/src/ModuleInstance.ts +11 -0
- package/src/PayloadArchivist.ts +36 -0
- package/src/attachable/AttachableInstance.ts +2 -2
- package/src/index.ts +3 -2
- package/src/typeChecks.ts +2 -2
- package/dist/neutral/Config.d.ts +0 -27
- package/dist/neutral/Config.d.ts.map +0 -1
- package/dist/neutral/EventData.d.ts +0 -5
- package/dist/neutral/EventData.d.ts.map +0 -1
- package/dist/neutral/EventModels/Cleared.d.ts +0 -7
- package/dist/neutral/EventModels/Cleared.d.ts.map +0 -1
- package/dist/neutral/EventModels/Deleted.d.ts +0 -10
- package/dist/neutral/EventModels/Deleted.d.ts.map +0 -1
- package/dist/neutral/EventModels/Inserted.d.ts +0 -10
- package/dist/neutral/EventModels/Inserted.d.ts.map +0 -1
- package/dist/neutral/EventModels/index.d.ts +0 -4
- package/dist/neutral/EventModels/index.d.ts.map +0 -1
- package/dist/neutral/IndexDescription.d.ts +0 -34
- package/dist/neutral/IndexDescription.d.ts.map +0 -1
- package/dist/neutral/Instance.d.ts +0 -10
- package/dist/neutral/Instance.d.ts.map +0 -1
- package/dist/neutral/Labels.d.ts +0 -5
- package/dist/neutral/Labels.d.ts.map +0 -1
- package/dist/neutral/Module.d.ts +0 -6
- package/dist/neutral/Module.d.ts.map +0 -1
- package/dist/neutral/NextOptions.d.ts +0 -10
- package/dist/neutral/NextOptions.d.ts.map +0 -1
- package/dist/neutral/Params.d.ts +0 -5
- package/dist/neutral/Params.d.ts.map +0 -1
- package/dist/neutral/Queries/All.d.ts +0 -7
- package/dist/neutral/Queries/All.d.ts.map +0 -1
- package/dist/neutral/Queries/Clear.d.ts +0 -7
- package/dist/neutral/Queries/Clear.d.ts.map +0 -1
- package/dist/neutral/Queries/Commit.d.ts +0 -7
- package/dist/neutral/Queries/Commit.d.ts.map +0 -1
- package/dist/neutral/Queries/Delete.d.ts +0 -9
- package/dist/neutral/Queries/Delete.d.ts.map +0 -1
- package/dist/neutral/Queries/Get.d.ts +0 -9
- package/dist/neutral/Queries/Get.d.ts.map +0 -1
- package/dist/neutral/Queries/Insert.d.ts +0 -7
- package/dist/neutral/Queries/Insert.d.ts.map +0 -1
- package/dist/neutral/Queries/Next.d.ts +0 -6
- package/dist/neutral/Queries/Next.d.ts.map +0 -1
- package/dist/neutral/Queries/index.d.ts +0 -18
- package/dist/neutral/Queries/index.d.ts.map +0 -1
- package/dist/neutral/QueryFunctions.d.ts +0 -23
- package/dist/neutral/QueryFunctions.d.ts.map +0 -1
- package/dist/neutral/RawQueryFunctions.d.ts +0 -16
- package/dist/neutral/RawQueryFunctions.d.ts.map +0 -1
- package/dist/neutral/attachable/AttachableInstance.d.ts +0 -14
- package/dist/neutral/attachable/AttachableInstance.d.ts.map +0 -1
- package/dist/neutral/attachable/asAttachableInstance.d.ts +0 -191
- package/dist/neutral/attachable/asAttachableInstance.d.ts.map +0 -1
- package/dist/neutral/attachable/index.d.ts +0 -4
- package/dist/neutral/attachable/index.d.ts.map +0 -1
- package/dist/neutral/attachable/isAttachableInstance.d.ts +0 -6
- package/dist/neutral/attachable/isAttachableInstance.d.ts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/neutral/typeChecks.d.ts +0 -625
- package/dist/neutral/typeChecks.d.ts.map +0 -1
- package/src/QueryFunctions.ts +0 -39
|
@@ -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 {
|
|
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 { ArchivistModuleInstance } from './ModuleInstance.ts'\nimport { ArchivistGetQuerySchema } from './Queries/index.ts'\n\nexport const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule = 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/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 { 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/object'\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 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,gBAAyC,EAAE,OAAO,CAAC,uBAAuB,CAAC;AAEzG,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;;;ACH5I,IAAM,wBAAwB;;;ACU9B,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.8.
|
|
3
|
+
"version": "3.8.2",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"@xylabs/object": "^4.5.1",
|
|
34
34
|
"@xylabs/promise": "^4.5.1",
|
|
35
35
|
"@xylabs/typeof": "^4.5.1",
|
|
36
|
-
"@xyo-network/account-model": "^3.8.
|
|
37
|
-
"@xyo-network/module-events": "^3.8.
|
|
38
|
-
"@xyo-network/module-model": "^3.8.
|
|
39
|
-
"@xyo-network/payload-model": "^3.8.
|
|
36
|
+
"@xyo-network/account-model": "^3.8.2",
|
|
37
|
+
"@xyo-network/module-events": "^3.8.2",
|
|
38
|
+
"@xyo-network/module-model": "^3.8.2",
|
|
39
|
+
"@xyo-network/payload-model": "^3.8.2"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
43
|
-
"@xylabs/tsconfig": "^
|
|
42
|
+
"@xylabs/ts-scripts-yarn3": "^5.0.22",
|
|
43
|
+
"@xylabs/tsconfig": "^5.0.22",
|
|
44
44
|
"typescript": "^5.7.3"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Promisable, PromisableArray } from '@xylabs/promise'
|
|
2
|
+
|
|
3
|
+
import type { NextOptions } from './NextOptions.ts'
|
|
4
|
+
|
|
5
|
+
export interface AllArchivistFunctions<TReadResponse> {
|
|
6
|
+
all(): PromisableArray<TReadResponse>
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface ReadArchivistFunctions<TReadResponse, TId = string> {
|
|
10
|
+
get(ids: TId[]): PromisableArray<TReadResponse>
|
|
11
|
+
next(options?: NextOptions<TId>): PromisableArray<TReadResponse>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface WriteArchivistFunctions<TReadResponse, TWriteResponse = TReadResponse, TWrite = TReadResponse, TId = string> {
|
|
15
|
+
clear(): Promisable<void>
|
|
16
|
+
delete(ids: TId[]): PromisableArray<TId>
|
|
17
|
+
insert(item: TWrite[]): PromisableArray<TWriteResponse>
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface StashArchivistFunctions<TWriteResponse> {
|
|
21
|
+
commit(): PromisableArray<TWriteResponse>
|
|
22
|
+
}
|
package/src/Instance.ts
CHANGED
|
@@ -3,15 +3,15 @@ import type { Payload } from '@xyo-network/payload-model'
|
|
|
3
3
|
|
|
4
4
|
import type { ArchivistModuleEventData } from './EventData.ts'
|
|
5
5
|
import type { ArchivistModule } from './Module.ts'
|
|
6
|
+
import type { ArchivistModuleInstance } from './ModuleInstance.ts'
|
|
6
7
|
import type { ArchivistParams } from './Params.ts'
|
|
7
|
-
import type { ArchivistQueryFunctions } from './QueryFunctions.ts'
|
|
8
8
|
import type { ArchivistRawQueryFunctions } from './RawQueryFunctions.ts'
|
|
9
9
|
|
|
10
10
|
export interface ArchivistInstance<
|
|
11
11
|
TParams extends ArchivistParams = ArchivistParams,
|
|
12
12
|
TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,
|
|
13
13
|
TPayload extends Payload = Payload,
|
|
14
|
-
> extends
|
|
15
|
-
|
|
14
|
+
> extends ArchivistModuleInstance<TParams, TEventData>,
|
|
15
|
+
ArchivistModule<TPayload, TPayload>,
|
|
16
16
|
ModuleInstance<TParams, TEventData>,
|
|
17
17
|
ArchivistRawQueryFunctions {}
|
package/src/Module.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
} from '@xyo-network/
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
2
|
+
import type { ModuleQueryFunctions } from '@xyo-network/module-model'
|
|
3
|
+
import type { Payload } from '@xyo-network/payload-model'
|
|
4
4
|
|
|
5
|
-
import type {
|
|
6
|
-
import type { ArchivistModuleEventData } from './EventData.ts'
|
|
5
|
+
import type { Archivist } from './PayloadArchivist.ts'
|
|
7
6
|
|
|
8
7
|
export interface ArchivistModule<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
TReadResponse extends Payload = Payload,
|
|
9
|
+
TWriteResponse extends Payload = Payload,
|
|
10
|
+
TWrite extends Payload = TReadResponse & Payload,
|
|
11
|
+
TId = Hash,
|
|
12
|
+
> extends Archivist<TReadResponse, TWriteResponse, TWrite, TId>,
|
|
13
|
+
ModuleQueryFunctions {}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AnyConfigSchema, Module, ModuleParams,
|
|
3
|
+
} from '@xyo-network/module-model'
|
|
4
|
+
|
|
5
|
+
import type { ArchivistConfig } from './Config.ts'
|
|
6
|
+
import type { ArchivistModuleEventData } from './EventData.ts'
|
|
7
|
+
|
|
8
|
+
export interface ArchivistModuleInstance<
|
|
9
|
+
TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>,
|
|
10
|
+
TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,
|
|
11
|
+
> extends Module<TParams, TEventData> {}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Hash } from '@xylabs/hex'
|
|
2
|
+
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model'
|
|
3
|
+
|
|
4
|
+
import type {
|
|
5
|
+
AllArchivistFunctions, ReadArchivistFunctions, StashArchivistFunctions, WriteArchivistFunctions,
|
|
6
|
+
} from './ArchivistFunctions.ts'
|
|
7
|
+
|
|
8
|
+
export interface AllArchivist<
|
|
9
|
+
TReadResponse extends Payload = Payload,
|
|
10
|
+
> extends AllArchivistFunctions<WithStorageMeta<TReadResponse>> {}
|
|
11
|
+
|
|
12
|
+
export interface ReadArchivist<
|
|
13
|
+
TReadResponse extends Payload = Payload,
|
|
14
|
+
TId = Hash,
|
|
15
|
+
> extends ReadArchivistFunctions<WithStorageMeta<TReadResponse>, TId> {}
|
|
16
|
+
|
|
17
|
+
export interface WriteArchivist<
|
|
18
|
+
TReadResponse extends Payload = Payload,
|
|
19
|
+
TWriteResponse = TReadResponse,
|
|
20
|
+
TWrite = TReadResponse,
|
|
21
|
+
TId = Hash,
|
|
22
|
+
> extends WriteArchivistFunctions<WithStorageMeta<TReadResponse>, TWriteResponse, TWrite, TId> {}
|
|
23
|
+
|
|
24
|
+
export interface StashArchivist<
|
|
25
|
+
TWriteResponse extends Payload = Payload,
|
|
26
|
+
> extends StashArchivistFunctions<WithStorageMeta<TWriteResponse>> {}
|
|
27
|
+
|
|
28
|
+
export interface Archivist<
|
|
29
|
+
TReadResponse extends Payload = Payload,
|
|
30
|
+
TWriteResponse extends Payload = Payload,
|
|
31
|
+
TWrite extends Payload = TReadResponse & Payload,
|
|
32
|
+
TId = Hash,
|
|
33
|
+
> extends ReadArchivist<WithStorageMeta<TReadResponse>, TId>,
|
|
34
|
+
AllArchivist<WithStorageMeta<TReadResponse>>,
|
|
35
|
+
WriteArchivist<WithStorageMeta<TReadResponse>, WithStorageMeta<TWriteResponse>, TWrite, TId>,
|
|
36
|
+
StashArchivistFunctions<TWriteResponse> {}
|
|
@@ -5,14 +5,14 @@ import type { Payload } from '@xyo-network/payload-model'
|
|
|
5
5
|
|
|
6
6
|
import type { ArchivistModuleEventData } from '../EventData.ts'
|
|
7
7
|
import type { ArchivistInstance } from '../Instance.ts'
|
|
8
|
-
import type {
|
|
8
|
+
import type { ArchivistModuleInstance } from '../ModuleInstance.ts'
|
|
9
9
|
import type { ArchivistParams } from '../Params.ts'
|
|
10
10
|
|
|
11
11
|
export interface AttachableArchivistInstance<
|
|
12
12
|
TParams extends ArchivistParams = ArchivistParams,
|
|
13
13
|
TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,
|
|
14
14
|
TPayload extends Payload = Payload,
|
|
15
|
-
> extends
|
|
15
|
+
> extends ArchivistModuleInstance<TParams, TEventData>,
|
|
16
16
|
AttachableModuleInstance<TParams, TEventData>,
|
|
17
17
|
ArchivistInstance<TParams, TEventData, TPayload> {}
|
|
18
18
|
|
package/src/index.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
export * from './ArchivistFunctions.ts'
|
|
1
2
|
export * from './attachable/index.ts'
|
|
2
3
|
export * from './Config.ts'
|
|
3
4
|
export * from './EventData.ts'
|
|
4
5
|
export * from './IndexDescription.ts'
|
|
5
6
|
export * from './Instance.ts'
|
|
6
7
|
export * from './Labels.ts'
|
|
7
|
-
export * from './
|
|
8
|
+
export * from './ModuleInstance.ts'
|
|
8
9
|
export * from './NextOptions.ts'
|
|
9
10
|
export * from './Params.ts'
|
|
11
|
+
export * from './PayloadArchivist.ts'
|
|
10
12
|
export * from './Queries/index.ts'
|
|
11
|
-
export * from './QueryFunctions.ts'
|
|
12
13
|
export * from './RawQueryFunctions.ts'
|
|
13
14
|
export * from './typeChecks.ts'
|
package/src/typeChecks.ts
CHANGED
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from '@xyo-network/module-model'
|
|
5
5
|
|
|
6
6
|
import type { ArchivistInstance } from './Instance.ts'
|
|
7
|
-
import type {
|
|
7
|
+
import type { ArchivistModuleInstance } from './ModuleInstance.ts'
|
|
8
8
|
import { ArchivistGetQuerySchema } from './Queries/index.ts'
|
|
9
9
|
|
|
10
10
|
export const isArchivistInstance = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])
|
|
11
|
-
export const isArchivistModule = new IsModuleFactory<
|
|
11
|
+
export const isArchivistModule = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])
|
|
12
12
|
|
|
13
13
|
export const asArchivistModule = AsObjectFactory.create(isArchivistModule)
|
|
14
14
|
export const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)
|
package/dist/neutral/Config.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { EmptyObject, WithAdditional } from '@xylabs/object';
|
|
2
|
-
import type { ModuleConfig, ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
4
|
-
import type { IndexDescription } from './IndexDescription.ts';
|
|
5
|
-
export interface ArchivistParents {
|
|
6
|
-
commit?: ModuleIdentifier[];
|
|
7
|
-
read?: ModuleIdentifier[];
|
|
8
|
-
write?: ModuleIdentifier[];
|
|
9
|
-
}
|
|
10
|
-
export interface ArchivistStorage {
|
|
11
|
-
/** The indexes to create on the object store */
|
|
12
|
-
indexes?: IndexDescription[];
|
|
13
|
-
}
|
|
14
|
-
export declare const ArchivistConfigSchema: "network.xyo.archivist.config";
|
|
15
|
-
export type ArchivistConfigSchema = typeof ArchivistConfigSchema;
|
|
16
|
-
export type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<WithAdditional<{
|
|
17
|
-
/** @field address of one or more parent archivists to read from */
|
|
18
|
-
parents?: ArchivistParents;
|
|
19
|
-
/** @field fail if some parents can not be resolved (true if unspecified) */
|
|
20
|
-
requireAllParents?: boolean;
|
|
21
|
-
schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema;
|
|
22
|
-
/** @field storage configuration */
|
|
23
|
-
storage?: ArchivistStorage;
|
|
24
|
-
/** @field should child store all reads from parents? */
|
|
25
|
-
storeParentReads?: boolean;
|
|
26
|
-
}, TConfig>, TSchema>;
|
|
27
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,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,eAAO,MAAM,qBAAqB,EAAG,8BAAuC,CAAA;AAC5E,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,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 +0,0 @@
|
|
|
1
|
-
import type { ModuleEventData } from '@xyo-network/module-model';
|
|
2
|
-
import type { ClearedEventData, DeletedEventData, InsertedEventData } from './EventModels/index.ts';
|
|
3
|
-
export interface ArchivistModuleEventData extends InsertedEventData, DeletedEventData, ClearedEventData, ModuleEventData {
|
|
4
|
-
}
|
|
5
|
-
//# sourceMappingURL=EventData.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EventData.d.ts","sourceRoot":"","sources":["../../src/EventData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EACV,gBAAgB,EAAE,gBAAgB,EAAE,iBAAiB,EACtD,MAAM,wBAAwB,CAAA;AAE/B,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe;CAAG"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { EventData } from '@xyo-network/module-events';
|
|
2
|
-
import type { Module, ModuleEventArgs } from '@xyo-network/module-model';
|
|
3
|
-
export type ClearedEventArgs<T extends Module = Module> = ModuleEventArgs<T>;
|
|
4
|
-
export interface ClearedEventData<T extends Module = Module> extends EventData {
|
|
5
|
-
cleared: ClearedEventArgs<T>;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=Cleared.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Cleared.d.ts","sourceRoot":"","sources":["../../../src/EventModels/Cleared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAExE,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,eAAe,CAAC,CAAC,CAAC,CAAA;AAE5E,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS;IAC5E,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAC7B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex';
|
|
2
|
-
import type { EventData } from '@xyo-network/module-events';
|
|
3
|
-
import type { Module, ModuleEventArgs } from '@xyo-network/module-model';
|
|
4
|
-
export type DeletedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
5
|
-
hashes: Hash[];
|
|
6
|
-
}>;
|
|
7
|
-
export interface DeletedEventData<T extends Module = Module> extends EventData {
|
|
8
|
-
deleted: DeletedEventArgs<T>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=Deleted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Deleted.d.ts","sourceRoot":"","sources":["../../../src/EventModels/Deleted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAExE,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,eAAe,CACvE,CAAC,EACD;IACE,MAAM,EAAE,IAAI,EAAE,CAAA;CACf,CACF,CAAA;AAED,MAAM,WAAW,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS;IAC5E,OAAO,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAC7B"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { EventData } from '@xyo-network/module-events';
|
|
2
|
-
import type { Module, ModuleEventArgs } from '@xyo-network/module-model';
|
|
3
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
4
|
-
export type InsertedEventArgs<T extends Module = Module> = ModuleEventArgs<T, {
|
|
5
|
-
payloads: Payload[];
|
|
6
|
-
}>;
|
|
7
|
-
export interface InsertedEventData<T extends Module = Module> extends EventData {
|
|
8
|
-
inserted: InsertedEventArgs<T>;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=Inserted.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Inserted.d.ts","sourceRoot":"","sources":["../../../src/EventModels/Inserted.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IAAI,eAAe,CACxE,CAAC,EACD;IACE,QAAQ,EAAE,OAAO,EAAE,CAAA;CACpB,CACF,CAAA;AAED,MAAM,WAAW,iBAAiB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,CAAE,SAAQ,SAAS;IAC7E,QAAQ,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAA;CAC/B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/EventModels/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA"}
|
|
@@ -1,34 +0,0 @@
|
|
|
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: Record<string, IndexDirection>;
|
|
13
|
-
/**
|
|
14
|
-
* Is the indexed value an array
|
|
15
|
-
*/
|
|
16
|
-
multiEntry?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* The name of the index
|
|
19
|
-
*/
|
|
20
|
-
name?: string;
|
|
21
|
-
/**
|
|
22
|
-
* If true, the index must enforce uniqueness on the key
|
|
23
|
-
*/
|
|
24
|
-
unique?: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare const IndexSeparator = "-";
|
|
27
|
-
/**
|
|
28
|
-
* Given an index description, this will build the index
|
|
29
|
-
* name in standard form
|
|
30
|
-
* @param index The index description
|
|
31
|
-
* @returns The index name in standard form
|
|
32
|
-
*/
|
|
33
|
-
export declare const buildStandardIndexName: (index: IndexDescription) => string;
|
|
34
|
-
//# sourceMappingURL=IndexDescription.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IACb;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,cAAc,MAAM,CAAA;AAEjC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,UAAW,gBAAgB,WAK7D,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ModuleInstance } from '@xyo-network/module-model';
|
|
2
|
-
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import type { ArchivistModuleEventData } from './EventData.ts';
|
|
4
|
-
import type { ArchivistModule } from './Module.ts';
|
|
5
|
-
import type { ArchivistParams } from './Params.ts';
|
|
6
|
-
import type { ArchivistQueryFunctions } from './QueryFunctions.ts';
|
|
7
|
-
import type { ArchivistRawQueryFunctions } from './RawQueryFunctions.ts';
|
|
8
|
-
export interface ArchivistInstance<TParams extends ArchivistParams = ArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData, TPayload extends Payload = Payload> extends ArchivistModule<TParams, TEventData>, ArchivistQueryFunctions<TPayload, TPayload>, ModuleInstance<TParams, TEventData>, ArchivistRawQueryFunctions {
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=Instance.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Instance.d.ts","sourceRoot":"","sources":["../../src/Instance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAClE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAExE,MAAM,WAAW,iBAAiB,CAChC,OAAO,SAAS,eAAe,GAAG,eAAe,EACjD,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,EACtE,QAAQ,SAAS,OAAO,GAAG,OAAO,CAClC,SAAQ,eAAe,CAAC,OAAO,EAAE,UAAU,CAAC,EAC5C,uBAAuB,CAAC,QAAQ,EAAE,QAAQ,CAAC,EAC3C,cAAc,CAAC,OAAO,EAAE,UAAU,CAAC,EACnC,0BAA0B;CAAG"}
|
package/dist/neutral/Labels.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Labels.d.ts","sourceRoot":"","sources":["../../src/Labels.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,MAAM,WAAW,eAAgB,SAAQ,MAAM;IAC7C,yCAAyC,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAA;CAClG"}
|
package/dist/neutral/Module.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { AnyConfigSchema, Module, ModuleParams } from '@xyo-network/module-model';
|
|
2
|
-
import type { ArchivistConfig } from './Config.ts';
|
|
3
|
-
import type { ArchivistModuleEventData } from './EventData.ts';
|
|
4
|
-
export interface ArchivistModule<TParams extends ModuleParams<AnyConfigSchema<ArchivistConfig>> = ModuleParams<AnyConfigSchema<ArchivistConfig>>, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends Module<TParams, TEventData> {
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=Module.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Module.d.ts","sourceRoot":"","sources":["../../src/Module.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAAE,MAAM,EAAE,YAAY,EACtC,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAClD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAA;AAE9D,MAAM,WAAW,eAAe,CAC9B,OAAO,SAAS,YAAY,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,GAAG,YAAY,CAAC,eAAe,CAAC,eAAe,CAAC,CAAC,EAC/G,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,CACtE,SAAQ,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC;CAAG"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Hash, Hex } from '@xylabs/hex';
|
|
2
|
-
export interface NextOptions<TId = Hex> {
|
|
3
|
-
cursor?: TId;
|
|
4
|
-
limit?: number;
|
|
5
|
-
open?: boolean;
|
|
6
|
-
order?: 'asc' | 'desc';
|
|
7
|
-
}
|
|
8
|
-
export interface ArchivistNextOptions extends NextOptions<Hash> {
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=NextOptions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"NextOptions.d.ts","sourceRoot":"","sources":["../../src/NextOptions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,aAAa,CAAA;AAE5C,MAAM,WAAW,WAAW,CAAC,GAAG,GAAG,GAAG;IACpC,MAAM,CAAC,EAAE,GAAG,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,OAAO,CAAA;IACd,KAAK,CAAC,EAAE,KAAK,GAAG,MAAM,CAAA;CACvB;AAED,MAAM,WAAW,oBAAqB,SAAQ,WAAW,CAAC,IAAI,CAAC;CAAG"}
|
package/dist/neutral/Params.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { EmptyObject } from '@xylabs/object';
|
|
2
|
-
import type { AnyConfigSchema, ModuleParams } from '@xyo-network/module-model';
|
|
3
|
-
import type { ArchivistConfig } from './Config.ts';
|
|
4
|
-
export type ArchivistParams<TConfig extends AnyConfigSchema<ArchivistConfig> = AnyConfigSchema<ArchivistConfig>, TAdditionalParams extends EmptyObject | undefined = undefined> = ModuleParams<TConfig, TAdditionalParams>;
|
|
5
|
-
//# sourceMappingURL=Params.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAE9E,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,MAAM,MAAM,eAAe,CACzB,OAAO,SAAS,eAAe,CAAC,eAAe,CAAC,GAAG,eAAe,CAAC,eAAe,CAAC,EACnF,iBAAiB,SAAS,WAAW,GAAG,SAAS,GAAG,SAAS,IAC3D,YAAY,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export declare const ArchivistAllQuerySchema: "network.xyo.query.archivist.all";
|
|
3
|
-
export type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema;
|
|
4
|
-
export type ArchivistAllQuery = Query<{
|
|
5
|
-
schema: ArchivistAllQuerySchema;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=All.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export declare const ArchivistClearQuerySchema: "network.xyo.query.archivist.clear";
|
|
3
|
-
export type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema;
|
|
4
|
-
export type ArchivistClearQuery = Query<{
|
|
5
|
-
schema: ArchivistClearQuerySchema;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=Clear.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export declare const ArchivistCommitQuerySchema: "network.xyo.query.archivist.commit";
|
|
3
|
-
export type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema;
|
|
4
|
-
export type ArchivistCommitQuery = Query<{
|
|
5
|
-
schema: ArchivistCommitQuerySchema;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=Commit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,9 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex';
|
|
2
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
3
|
-
export declare const ArchivistDeleteQuerySchema: "network.xyo.query.archivist.delete";
|
|
4
|
-
export type ArchivistDeleteQuerySchema = typeof ArchivistDeleteQuerySchema;
|
|
5
|
-
export type ArchivistDeleteQuery = Query<{
|
|
6
|
-
hashes: Hash[];
|
|
7
|
-
schema: ArchivistDeleteQuerySchema;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=Delete.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,9 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex';
|
|
2
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
3
|
-
export declare const ArchivistGetQuerySchema: "network.xyo.query.archivist.get";
|
|
4
|
-
export type ArchivistGetQuerySchema = typeof ArchivistGetQuerySchema;
|
|
5
|
-
export type ArchivistGetQuery = Query<{
|
|
6
|
-
hashes: Hash[];
|
|
7
|
-
schema: ArchivistGetQuerySchema;
|
|
8
|
-
}>;
|
|
9
|
-
//# sourceMappingURL=Get.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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,7 +0,0 @@
|
|
|
1
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
export declare const ArchivistInsertQuerySchema: "network.xyo.query.archivist.insert";
|
|
3
|
-
export type ArchivistInsertQuerySchema = typeof ArchivistInsertQuerySchema;
|
|
4
|
-
export type ArchivistInsertQuery = Query<{
|
|
5
|
-
schema: ArchivistInsertQuerySchema;
|
|
6
|
-
}>;
|
|
7
|
-
//# sourceMappingURL=Insert.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import type { Query } from '@xyo-network/payload-model';
|
|
2
|
-
import type { ArchivistNextOptions } from '../NextOptions.ts';
|
|
3
|
-
export declare const ArchivistNextQuerySchema: "network.xyo.query.archivist.next";
|
|
4
|
-
export type ArchivistNextQuerySchema = typeof ArchivistNextQuerySchema;
|
|
5
|
-
export type ArchivistNextQuery = Query<ArchivistNextOptions, ArchivistNextQuerySchema>;
|
|
6
|
-
//# sourceMappingURL=Next.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export * from './All.ts';
|
|
2
|
-
export * from './Clear.ts';
|
|
3
|
-
export * from './Commit.ts';
|
|
4
|
-
export * from './Delete.ts';
|
|
5
|
-
export * from './Get.ts';
|
|
6
|
-
export * from './Insert.ts';
|
|
7
|
-
export * from './Next.ts';
|
|
8
|
-
import type { ModuleQueries } from '@xyo-network/module-model';
|
|
9
|
-
import type { ArchivistAllQuery } from './All.ts';
|
|
10
|
-
import type { ArchivistClearQuery } from './Clear.ts';
|
|
11
|
-
import type { ArchivistCommitQuery } from './Commit.ts';
|
|
12
|
-
import type { ArchivistDeleteQuery } from './Delete.ts';
|
|
13
|
-
import type { ArchivistGetQuery } from './Get.ts';
|
|
14
|
-
import type { ArchivistInsertQuery } from './Insert.ts';
|
|
15
|
-
import type { ArchivistNextQuery } from './Next.ts';
|
|
16
|
-
export type ArchivistQueries = ArchivistAllQuery | ArchivistClearQuery | ArchivistCommitQuery | ArchivistDeleteQuery | ArchivistGetQuery | ArchivistInsertQuery | ArchivistNextQuery;
|
|
17
|
-
export type ArchivistModuleQueries = ModuleQueries | ArchivistQueries;
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Queries/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AAEzB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAEnD,MAAM,MAAM,gBAAgB,GACxB,iBAAiB,GACjB,mBAAmB,GACnB,oBAAoB,GACpB,oBAAoB,GACpB,iBAAiB,GACjB,oBAAoB,GACpB,kBAAkB,CAAA;AAEtB,MAAM,MAAM,sBAAsB,GAAG,aAAa,GAAG,gBAAgB,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { Hash } from '@xylabs/hex';
|
|
2
|
-
import type { Promisable, PromisableArray } from '@xylabs/promise';
|
|
3
|
-
import type { ModuleQueryFunctions } from '@xyo-network/module-model';
|
|
4
|
-
import type { Payload, WithStorageMeta } from '@xyo-network/payload-model';
|
|
5
|
-
import type { NextOptions } from './NextOptions.ts';
|
|
6
|
-
export interface ReadArchivist<TReadResponse, TId = string> {
|
|
7
|
-
all(): PromisableArray<TReadResponse>;
|
|
8
|
-
get(ids: TId[]): PromisableArray<TReadResponse>;
|
|
9
|
-
next(options?: NextOptions<TId>): PromisableArray<TReadResponse>;
|
|
10
|
-
}
|
|
11
|
-
export interface WriteArchivist<TReadResponse, TWriteResponse = TReadResponse, TWrite = TReadResponse, TId = string> {
|
|
12
|
-
clear(): Promisable<void>;
|
|
13
|
-
delete(ids: TId[]): PromisableArray<TId>;
|
|
14
|
-
insert(item: TWrite[]): PromisableArray<TWriteResponse>;
|
|
15
|
-
}
|
|
16
|
-
export interface StashArchivist<TWriteResponse> {
|
|
17
|
-
commit(): PromisableArray<TWriteResponse>;
|
|
18
|
-
}
|
|
19
|
-
export interface Archivist<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = Payload, TWrite extends Payload = TReadResponse & Payload, TId = Hash> extends ReadArchivist<WithStorageMeta<TReadResponse>, TId>, WriteArchivist<WithStorageMeta<TReadResponse>, WithStorageMeta<TWriteResponse>, TWrite, TId>, StashArchivist<TWriteResponse> {
|
|
20
|
-
}
|
|
21
|
-
export interface ArchivistQueryFunctions<TReadResponse extends Payload = Payload, TWriteResponse extends Payload = Payload, TWrite extends Payload = TReadResponse & Payload, TId = Hash> extends Archivist<TReadResponse, TWriteResponse, TWrite, TId>, ModuleQueryFunctions {
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=QueryFunctions.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"QueryFunctions.d.ts","sourceRoot":"","sources":["../../src/QueryFunctions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAClE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAE1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAEnD,MAAM,WAAW,aAAa,CAAC,aAAa,EAAE,GAAG,GAAG,MAAM;IACxD,GAAG,IAAI,eAAe,CAAC,aAAa,CAAC,CAAA;IACrC,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,eAAe,CAAC,aAAa,CAAC,CAAA;IAC/C,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,eAAe,CAAC,aAAa,CAAC,CAAA;CACjE;AAED,MAAM,WAAW,cAAc,CAAC,aAAa,EAAE,cAAc,GAAG,aAAa,EAAE,MAAM,GAAG,aAAa,EAAE,GAAG,GAAG,MAAM;IACjH,KAAK,IAAI,UAAU,CAAC,IAAI,CAAC,CAAA;IACzB,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,eAAe,CAAC,GAAG,CAAC,CAAA;IACxC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC,cAAc,CAAC,CAAA;CACxD;AAED,MAAM,WAAW,cAAc,CAAC,cAAc;IAC5C,MAAM,IAAI,eAAe,CAAC,cAAc,CAAC,CAAA;CAC1C;AAED,MAAM,WAAW,SAAS,CACxB,aAAa,SAAS,OAAO,GAAG,OAAO,EACvC,cAAc,SAAS,OAAO,GAAG,OAAO,EACxC,MAAM,SAAS,OAAO,GAAG,aAAa,GAAG,OAAO,EAChD,GAAG,GAAG,IAAI,CACV,SAAQ,aAAa,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,GAAG,CAAC,EAC1D,cAAc,CAAC,eAAe,CAAC,aAAa,CAAC,EAAE,eAAe,CAAC,cAAc,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAC5F,cAAc,CAAC,cAAc,CAAC;CAAG;AAEnC,MAAM,WAAW,uBAAuB,CACtC,aAAa,SAAS,OAAO,GAAG,OAAO,EACvC,cAAc,SAAS,OAAO,GAAG,OAAO,EACxC,MAAM,SAAS,OAAO,GAAG,aAAa,GAAG,OAAO,EAChD,GAAG,GAAG,IAAI,CACV,SAAQ,SAAS,CAAC,aAAa,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,CAAC,EAC7D,oBAAoB;CAAG"}
|