@xyo-network/archivist-model 5.1.6 → 5.1.7

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ArchivistSnapshot.ts","../../src/ArchivistStats.ts","../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/All.ts","../../src/Queries/Clear.ts","../../src/Queries/Commit.ts","../../src/Queries/Delete.ts","../../src/Queries/Get.ts","../../src/Queries/Insert.ts","../../src/Queries/Next.ts","../../src/Queries/Snapshot.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts","../../src/lib/getBoundWitness.ts","../../src/lib/hydrateBoundWitness.ts"],"sourcesContent":["import type { Hash } from '@xylabs/hex'\nimport type { Payload, PayloadHashMap } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotPayloadSchema = 'network.xyo.archivist.snapshot' as const\nexport type ArchivistSnapshotPayloadSchema = typeof ArchivistSnapshotPayloadSchema\n\nexport type ArchivistSnapshotPayload<TPayload extends Payload = Payload, TId extends string | number | symbol = Hash>\n = Payload<PayloadHashMap<TPayload, TId>, ArchivistSnapshotPayloadSchema>\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport const ArchivistStatsPayloadSchema = 'network.xyo.archivist.stats' as const\nexport type ArchivistStatsPayloadSchema = typeof ArchivistStatsPayloadSchema\n\nexport type ArchivistStatsPayload\n = Payload<{ payloadCount: number }, ArchivistStatsPayloadSchema>\n","import { AsObjectFactory } from '@xylabs/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 type { TypeCheck } from '@xylabs/object'\nimport { 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: TypeCheck<ArchivistInstance> = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule: TypeCheck<ArchivistModuleInstance> = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all' as const\nexport type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear' as const\nexport type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit' as const\nexport type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/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 { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotQuerySchema = 'network.xyo.query.archivist.snapshot' as const\nexport type ArchivistSnapshotQuerySchema = typeof ArchivistSnapshotQuerySchema\n\nexport type ArchivistSnapshotQuery = Query<{\n schema: ArchivistSnapshotQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/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 interface ArchivistGetCache {\n enabled?: boolean\n maxEntries?: number\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config' as const\nexport type ArchivistConfigSchema = typeof ArchivistConfigSchema\n\nexport type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n /** @field caching configuration for get calls */\n getCache?: ArchivistGetCache\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n /** @field storage configuration */\n storage?: ArchivistStorage\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","/**\n * The index direction (1 for ascending, -1 for descending)\n */\nexport type IndexDirection = -1 | 1\n\n/**\n * Description of index(es) to be created on a store\n */\nexport type IndexDescription = {\n /**\n * The key(s) to index\n */\n key: Record<string, IndexDirection>\n /**\n * Is the indexed value an array\n */\n multiEntry?: boolean\n /**\n * The name of the index\n */\n name?: string\n /**\n * If true, the index must enforce uniqueness on the key\n */\n unique?: boolean\n}\n\nexport const IndexSeparator = '-'\n\n/**\n * Given an index description, this will build the index\n * name in standard form\n * @param index The index description\n * @returns The index name in standard form\n */\nexport const buildStandardIndexName = (index: IndexDescription) => {\n const { key, unique } = index\n const prefix = unique ? 'UX' : 'IX'\n const indexKeys = Object.keys(key)\n return `${prefix}_${indexKeys.join(IndexSeparator)}`\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Hash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport type { IdentityFunction } from './IdentityFunction.ts'\n\nexport const tryGetTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {\n const payload = (await archivist.get([hash])).at(0)\n return identity(payload) ? payload : undefined\n}\n\nexport const getTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T>> => {\n const payload = assertEx((await archivist.get([hash])).at(0), () => `failed to locate bound witness: ${hash}`)\n return assertEx(identity(payload) ? payload : undefined, () => `located payload failed identity check: ${hash}`)\n}\n\nexport const getBoundWitness = (archivist: ReadArchivist, hash: Hash): Promise<WithStorageMeta<BoundWitness>> => {\n return getTypedBoundWitness<BoundWitness>(archivist, hash, isBoundWitnessWithStorageMeta)\n}\n","import { exists } from '@xylabs/exists'\nimport type { Hash } from '@xylabs/hex'\nimport { isHash } from '@xylabs/hex'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport { getTypedBoundWitness, tryGetTypedBoundWitness } from './getBoundWitness.ts'\nimport type { HydratedBoundWitness } from './HydratedBoundWitness.ts'\nimport type { IdentityFunction } from './IdentityFunction.ts'\n\nexport const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {\n const bw = isHash(hashOrBw) ? await tryGetTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n return bw ? [bw, (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)] : undefined\n}\n\nexport const hydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T>> => {\n const bw = isHash(hashOrBw) ? await getTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n const payloads = (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)\n if (payloads.length !== bw.payload_hashes.length) {\n throw new Error(`missing payloads for ${bw._hash}`)\n }\n return [bw, payloads]\n}\n\nexport const hydrateBoundWitness = (\n archivist: ReadArchivist,\n hashOrBw: Hash | WithStorageMeta<BoundWitness>,\n): Promise<HydratedBoundWitness<BoundWitness>> => {\n return hydrateTypedBoundWitness<BoundWitness>(archivist, hashOrBw, isBoundWitnessWithStorageMeta)\n}\n"],"mappings":";AAGO,IAAM,iCAAiC;;;ACDvC,IAAM,8BAA8B;;;AC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","names":["AsObjectFactory","AsObjectFactory","IsObjectFactory","isBoundWitnessWithStorageMeta","isBoundWitnessWithStorageMeta"]}
1
+ {"version":3,"sources":["../../src/ArchivistSnapshot.ts","../../src/ArchivistStats.ts","../../src/attachable/asAttachableInstance.ts","../../src/attachable/isAttachableInstance.ts","../../src/typeChecks.ts","../../src/Queries/All.ts","../../src/Queries/Clear.ts","../../src/Queries/Commit.ts","../../src/Queries/Delete.ts","../../src/Queries/Get.ts","../../src/Queries/Insert.ts","../../src/Queries/Next.ts","../../src/Queries/Snapshot.ts","../../src/attachable/AttachableInstance.ts","../../src/Config.ts","../../src/IndexDescription.ts","../../src/lib/getBoundWitness.ts","../../src/lib/hydrateBoundWitness.ts"],"sourcesContent":["import type { Hash } from '@xylabs/hex'\nimport type { Payload, PayloadHashMap } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotPayloadSchema = 'network.xyo.archivist.snapshot' as const\nexport type ArchivistSnapshotPayloadSchema = typeof ArchivistSnapshotPayloadSchema\n\nexport type ArchivistSnapshotPayload<TPayload extends Payload = Payload, TId extends string | number | symbol = Hash>\n = Payload<PayloadHashMap<TPayload, TId>, ArchivistSnapshotPayloadSchema>\n","import type { Payload } from '@xyo-network/payload-model'\n\nexport const ArchivistStatsPayloadSchema = 'network.xyo.archivist.stats' as const\nexport type ArchivistStatsPayloadSchema = typeof ArchivistStatsPayloadSchema\n\nexport type ArchivistStatsPayload\n = Payload<{ payloadCount: number }, ArchivistStatsPayloadSchema>\n","import { AsObjectFactory } from '@xylabs/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 type { TypeCheck } from '@xylabs/object'\nimport { 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: TypeCheck<ArchivistInstance> = new IsInstanceFactory<ArchivistInstance>().create({ get: 'function' }, [isModuleInstance])\nexport const isArchivistModule: TypeCheck<ArchivistModuleInstance> = new IsModuleFactory<ArchivistModuleInstance>().create([ArchivistGetQuerySchema])\n\nexport const asArchivistModule = AsObjectFactory.create(isArchivistModule)\nexport const asArchivistInstance = AsObjectFactory.create(isArchivistInstance)\nexport const withArchivistModule = WithFactory.create(isArchivistModule)\nexport const withArchivistInstance = WithFactory.create(isArchivistInstance)\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistAllQuerySchema = 'network.xyo.query.archivist.all' as const\nexport type ArchivistAllQuerySchema = typeof ArchivistAllQuerySchema\n\nexport type ArchivistAllQuery = Query<{\n schema: ArchivistAllQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistClearQuerySchema = 'network.xyo.query.archivist.clear' as const\nexport type ArchivistClearQuerySchema = typeof ArchivistClearQuerySchema\n\nexport type ArchivistClearQuery = Query<{\n schema: ArchivistClearQuerySchema\n}>\n","import type { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistCommitQuerySchema = 'network.xyo.query.archivist.commit' as const\nexport type ArchivistCommitQuerySchema = typeof ArchivistCommitQuerySchema\n\nexport type ArchivistCommitQuery = Query<{\n schema: ArchivistCommitQuerySchema\n}>\n","import type { Hash } from '@xylabs/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 { Query } from '@xyo-network/payload-model'\n\nexport const ArchivistSnapshotQuerySchema = 'network.xyo.query.archivist.snapshot' as const\nexport type ArchivistSnapshotQuerySchema = typeof ArchivistSnapshotQuerySchema\n\nexport type ArchivistSnapshotQuery = Query<{\n schema: ArchivistSnapshotQuerySchema\n}>\n","import type { TypeCheck } from '@xylabs/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 interface ArchivistGetCache {\n enabled?: boolean\n maxEntries?: number\n}\n\nexport const ArchivistConfigSchema = 'network.xyo.archivist.config' as const\nexport type ArchivistConfigSchema = typeof ArchivistConfigSchema\n\nexport type ArchivistConfig<TConfig extends Payload | EmptyObject | void = void, TSchema extends string | void = void> = ModuleConfig<\n WithAdditional<\n {\n /** @field caching configuration for get calls */\n getCache?: ArchivistGetCache\n /** @field address of one or more parent archivists to read from */\n parents?: ArchivistParents\n /** @field fail if some parents can not be resolved (true if unspecified) */\n requireAllParents?: boolean\n schema: TConfig extends Payload ? TConfig['schema'] : ArchivistConfigSchema\n /** @field storage configuration */\n storage?: ArchivistStorage\n /** @field should child store all reads from parents? */\n storeParentReads?: boolean\n },\n TConfig\n >,\n TSchema\n>\n","/**\n * The index direction (1 for ascending, -1 for descending)\n */\nexport type IndexDirection = -1 | 1\n\n/**\n * Description of index(es) to be created on a store\n */\nexport type IndexDescription = {\n /**\n * The key(s) to index\n */\n key: Record<string, IndexDirection>\n /**\n * Is the indexed value an array\n */\n multiEntry?: boolean\n /**\n * The name of the index\n */\n name?: string\n /**\n * If true, the index must enforce uniqueness on the key\n */\n unique?: boolean\n}\n\nexport const IndexSeparator = '-'\n\n/**\n * Given an index description, this will build the index\n * name in standard form\n * @param index The index description\n * @returns The index name in standard form\n */\nexport const buildStandardIndexName = (index: IndexDescription) => {\n const { key, unique } = index\n const prefix = unique ? 'UX' : 'IX'\n const indexKeys = Object.keys(key)\n return `${prefix}_${indexKeys.join(IndexSeparator)}`\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { Hash } from '@xylabs/hex'\nimport type { IdentityFunction } from '@xylabs/typeof'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\n\nexport const tryGetTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {\n const payload = (await archivist.get([hash])).at(0)\n return identity(payload) ? payload : undefined\n}\n\nexport const getTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T>> => {\n const payload = assertEx((await archivist.get([hash])).at(0), () => `failed to locate bound witness: ${hash}`)\n return assertEx(identity(payload) ? payload : undefined, () => `located payload failed identity check: ${hash}`)\n}\n\nexport const getBoundWitness = (archivist: ReadArchivist, hash: Hash): Promise<WithStorageMeta<BoundWitness>> => {\n return getTypedBoundWitness<BoundWitness>(archivist, hash, isBoundWitnessWithStorageMeta)\n}\n","import { exists } from '@xylabs/exists'\nimport type { Hash } from '@xylabs/hex'\nimport { isHash } from '@xylabs/hex'\nimport type { IdentityFunction } from '@xylabs/typeof'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\n\nimport type { ReadArchivist } from '../PayloadArchivist.ts'\nimport { getTypedBoundWitness, tryGetTypedBoundWitness } from './getBoundWitness.ts'\nimport type { HydratedBoundWitness } from './HydratedBoundWitness.ts'\n\nexport const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {\n const bw = isHash(hashOrBw) ? await tryGetTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n return bw ? [bw, (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)] : undefined\n}\n\nexport const hydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,\n identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T>> => {\n const bw = isHash(hashOrBw) ? await getTypedBoundWitness(archivist, hashOrBw, identity) : hashOrBw\n const payloads = (await archivist.get(bw?.payload_hashes as Hash[])).filter(exists)\n if (payloads.length !== bw.payload_hashes.length) {\n throw new Error(`missing payloads for ${bw._hash}`)\n }\n return [bw, payloads]\n}\n\nexport const hydrateBoundWitness = (\n archivist: ReadArchivist,\n hashOrBw: Hash | WithStorageMeta<BoundWitness>,\n): Promise<HydratedBoundWitness<BoundWitness>> => {\n return hydrateTypedBoundWitness<BoundWitness>(archivist, hashOrBw, isBoundWitnessWithStorageMeta)\n}\n"],"mappings":";AAGO,IAAM,iCAAiC;;;ACDvC,IAAM,8BAA8B;;;ACF3C,SAAS,mBAAAA,wBAAuB;;;ACChC,SAAS,uBAAuB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StorageMeta","isBoundWitnessWithStorageMeta"]}
@@ -1,8 +1,8 @@
1
1
  import type { Hash } from '@xylabs/hex';
2
+ import type { IdentityFunction } from '@xylabs/typeof';
2
3
  import type { BoundWitness } from '@xyo-network/boundwitness-model';
3
4
  import type { WithStorageMeta } from '@xyo-network/payload-model';
4
5
  import type { ReadArchivist } from '../PayloadArchivist.ts';
5
- import type { IdentityFunction } from './IdentityFunction.ts';
6
6
  export declare const tryGetTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<WithStorageMeta<T> | undefined>;
7
7
  export declare const getTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<WithStorageMeta<T>>;
8
8
  export declare const getBoundWitness: (archivist: ReadArchivist, hash: Hash) => Promise<WithStorageMeta<BoundWitness>>;
@@ -1 +1 @@
1
- {"version":3,"file":"getBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/lib/getBoundWitness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,eAAO,MAAM,uBAAuB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,MAAM,IAAI,EACxG,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAGxF,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,MAAM,IAAI,EACrG,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAG5E,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,WAAW,aAAa,EAAE,MAAM,IAAI,KAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAE3G,CAAA"}
1
+ {"version":3,"file":"getBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/lib/getBoundWitness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AACvC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,eAAO,MAAM,uBAAuB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,MAAM,IAAI,EACxG,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAGxF,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,MAAM,IAAI,EACrG,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAG5E,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,WAAW,aAAa,EAAE,MAAM,IAAI,KAAG,OAAO,CAAC,eAAe,CAAC,YAAY,CAAC,CAE3G,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import type { Hash } from '@xylabs/hex';
2
+ import type { IdentityFunction } from '@xylabs/typeof';
2
3
  import type { BoundWitness } from '@xyo-network/boundwitness-model';
3
4
  import type { WithStorageMeta } from '@xyo-network/payload-model';
4
5
  import type { ReadArchivist } from '../PayloadArchivist.ts';
5
6
  import type { HydratedBoundWitness } from './HydratedBoundWitness.ts';
6
- import type { IdentityFunction } from './IdentityFunction.ts';
7
7
  export declare const tryHydrateTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<HydratedBoundWitness<T> | undefined>;
8
8
  export declare const hydrateTypedBoundWitness: <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>, identity: IdentityFunction<WithStorageMeta<T>>) => Promise<HydratedBoundWitness<T>>;
9
9
  export declare const hydrateBoundWitness: (archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<BoundWitness>) => Promise<HydratedBoundWitness<BoundWitness>>;
@@ -1 +1 @@
1
- {"version":3,"file":"hydrateBoundWitness.d.ts","sourceRoot":"","sources":["../../../src/lib/hydrateBoundWitness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAEvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAEnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAEjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAE3D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AACrE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,eAAO,MAAM,2BAA2B,GAAU,CAAC,SAAS,YAAY,EAAE,WAAW,aAAa,EAAE,UAAU,IAAI,GAAG,eAAe,CAAC,CAAC,CAAC,EACrI,UAAU,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,oBAAoB,CA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,gBAAgB,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAOjF,CAAA;AAED,eAAO,MAAM,mBAAmB,GAC9B,WAAW,aAAa,EACxB,UAAU,IAAI,GAAG,eAAe,CAAC,YAAY,CAAC,KAC7C,OAAO,CAAC,oBAAoB,CAAC,YAAY,CAAC,CAE5C,CAAA"}
@@ -1,5 +1,4 @@
1
1
  export * from './getBoundWitness.ts';
2
2
  export * from './hydrateBoundWitness.ts';
3
3
  export * from './HydratedBoundWitness.ts';
4
- export * from './IdentityFunction.ts';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA;AACxC,cAAc,2BAA2B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/archivist-model",
3
- "version": "5.1.6",
3
+ "version": "5.1.7",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -33,22 +33,22 @@
33
33
  "src"
34
34
  ],
35
35
  "dependencies": {
36
- "@xylabs/assert": "~5.0.11",
37
- "@xylabs/events": "~5.0.11",
38
- "@xylabs/exists": "~5.0.11",
39
- "@xylabs/hex": "~5.0.11",
40
- "@xylabs/object": "~5.0.11",
41
- "@xylabs/promise": "~5.0.11",
42
- "@xylabs/typeof": "~5.0.11",
43
- "@xyo-network/account-model": "~5.1.6",
44
- "@xyo-network/boundwitness-model": "~5.1.6",
45
- "@xyo-network/module-model": "~5.1.6",
46
- "@xyo-network/payload-model": "~5.1.6"
36
+ "@xylabs/assert": "~5.0.13",
37
+ "@xylabs/events": "~5.0.13",
38
+ "@xylabs/exists": "~5.0.13",
39
+ "@xylabs/hex": "~5.0.13",
40
+ "@xylabs/object": "~5.0.13",
41
+ "@xylabs/promise": "~5.0.13",
42
+ "@xylabs/typeof": "~5.0.13",
43
+ "@xyo-network/account-model": "~5.1.7",
44
+ "@xyo-network/boundwitness-model": "~5.1.7",
45
+ "@xyo-network/module-model": "~5.1.7",
46
+ "@xyo-network/payload-model": "~5.1.7"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@xylabs/ts-scripts-yarn3": "~7.1.8",
50
50
  "@xylabs/tsconfig": "~7.1.8",
51
- "typescript": "~5.9.2"
51
+ "typescript": "~5.9.3"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
@@ -1,11 +1,11 @@
1
1
  import { assertEx } from '@xylabs/assert'
2
2
  import type { Hash } from '@xylabs/hex'
3
+ import type { IdentityFunction } from '@xylabs/typeof'
3
4
  import type { BoundWitness } from '@xyo-network/boundwitness-model'
4
5
  import { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'
5
6
  import type { WithStorageMeta } from '@xyo-network/payload-model'
6
7
 
7
8
  import type { ReadArchivist } from '../PayloadArchivist.ts'
8
- import type { IdentityFunction } from './IdentityFunction.ts'
9
9
 
10
10
  export const tryGetTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hash: Hash,
11
11
  identity: IdentityFunction<WithStorageMeta<T>>): Promise<WithStorageMeta<T> | undefined> => {
@@ -1,6 +1,7 @@
1
1
  import { exists } from '@xylabs/exists'
2
2
  import type { Hash } from '@xylabs/hex'
3
3
  import { isHash } from '@xylabs/hex'
4
+ import type { IdentityFunction } from '@xylabs/typeof'
4
5
  import type { BoundWitness } from '@xyo-network/boundwitness-model'
5
6
  import { isBoundWitnessWithStorageMeta } from '@xyo-network/boundwitness-model'
6
7
  import type { WithStorageMeta } from '@xyo-network/payload-model'
@@ -8,7 +9,6 @@ import type { WithStorageMeta } from '@xyo-network/payload-model'
8
9
  import type { ReadArchivist } from '../PayloadArchivist.ts'
9
10
  import { getTypedBoundWitness, tryGetTypedBoundWitness } from './getBoundWitness.ts'
10
11
  import type { HydratedBoundWitness } from './HydratedBoundWitness.ts'
11
- import type { IdentityFunction } from './IdentityFunction.ts'
12
12
 
13
13
  export const tryHydrateTypedBoundWitness = async <T extends BoundWitness>(archivist: ReadArchivist, hashOrBw: Hash | WithStorageMeta<T>,
14
14
  identity: IdentityFunction<WithStorageMeta<T>>): Promise<HydratedBoundWitness<T> | undefined> => {
package/src/lib/index.ts CHANGED
@@ -1,4 +1,3 @@
1
1
  export * from './getBoundWitness.ts'
2
2
  export * from './hydrateBoundWitness.ts'
3
3
  export * from './HydratedBoundWitness.ts'
4
- export * from './IdentityFunction.ts'
@@ -1,2 +0,0 @@
1
- export type IdentityFunction<T> = (value: unknown) => value is T;
2
- //# sourceMappingURL=IdentityFunction.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"IdentityFunction.d.ts","sourceRoot":"","sources":["../../../src/lib/IdentityFunction.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,KAAK,KAAK,IAAI,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- export type IdentityFunction<T> = (value: unknown) => value is T