@xyo-network/archivist-lmdb 3.9.18 → 3.9.20

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,31 @@
1
+ import { Hash, Hex } from '@xylabs/hex';
2
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
3
+ import { ArchivistModuleEventData, ArchivistNextOptions, IndexDescription } from '@xyo-network/archivist-model';
4
+ import { BoundWitness } from '@xyo-network/boundwitness-model';
5
+ import { Payload, Schema, WithStorageMeta } from '@xyo-network/payload-model';
6
+ import { Database, RootDatabase } from 'lmdb';
7
+ import { LmdbArchivistParams } from './Params.ts';
8
+ export declare class LmdbArchivist<TParams extends LmdbArchivistParams = LmdbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
9
+ static readonly configSchemas: Schema[];
10
+ static readonly defaultConfigSchema: Schema;
11
+ protected static readonly dataHashIndex: IndexDescription;
12
+ protected static readonly sequenceIndex: IndexDescription;
13
+ protected dataHashIndex: Database<Hash, string>;
14
+ protected db: RootDatabase;
15
+ protected hashIndex: Database<WithStorageMeta<Payload>, Hash>;
16
+ protected sequenceIndex: Database<Hash, Hex>;
17
+ get dbName(): string;
18
+ get folderPath(): string;
19
+ get location(): string;
20
+ get queries(): string[];
21
+ get storeName(): string;
22
+ startHandler(): Promise<boolean>;
23
+ protected allHandler(): WithStorageMeta<Payload>[];
24
+ protected clearHandler(): Promise<void>;
25
+ protected commitHandler(): Promise<BoundWitness[]>;
26
+ protected deleteHandler(hashes: Hash[]): Promise<Hash[]>;
27
+ protected getHandler(hashes: Hash[]): WithStorageMeta<Payload>[];
28
+ protected insertHandler(payloads: WithStorageMeta<Payload>[]): Promise<WithStorageMeta<Payload>[]>;
29
+ protected nextHandler(options?: ArchivistNextOptions): WithStorageMeta<Payload>[];
30
+ }
31
+ //# sourceMappingURL=Archivist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":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ED,IAAa,OAAO,aAUnB;IAED,IAAI,SAAS,WAEZ;IAEc,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;cAoB5B,UAAU,IAAI,eAAe,CAAC,OAAO,CAAC,EAAE;cAIlC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAU7B,aAAa,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;cAaxC,aAAa,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;cAcpD,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,eAAe,CAAC,OAAO,CAAC,EAAE;cAShD,aAAa,CAAC,QAAQ,EAAE,eAAe,CAAC,OAAO,CAAC,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,OAAO,CAAC,EAAE,CAAC;cAW9F,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,eAAe,CAAC,OAAO,CAAC,EAAE;CAmB3F"}
@@ -0,0 +1,24 @@
1
+ import type { ArchivistConfig } from '@xyo-network/archivist-model';
2
+ import { LmdbArchivistSchema } from './Schema.ts';
3
+ export type LmdbArchivistConfigSchema = `${LmdbArchivistSchema}.config`;
4
+ export declare const LmdbArchivistConfigSchema: LmdbArchivistConfigSchema;
5
+ export type LmdbArchivistConfig<TStoreName extends string = string> = ArchivistConfig<{
6
+ /**
7
+ * If true, the store will be cleared on start
8
+ */
9
+ clearStoreOnStart?: boolean;
10
+ /**
11
+ * The database name - also used as the filename for the db
12
+ */
13
+ dbName?: string;
14
+ /**
15
+ * The location where the folder for the db will be created
16
+ */
17
+ location?: string;
18
+ schema: LmdbArchivistConfigSchema;
19
+ /**
20
+ * The name of the object store - becomes a sub-level
21
+ */
22
+ storeName?: TStoreName;
23
+ }>;
24
+ //# sourceMappingURL=Config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AAEnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,MAAM,yBAAyB,GAAG,GAAG,mBAAmB,SAAS,CAAA;AACvE,eAAO,MAAM,yBAAyB,EAAE,yBAA2D,CAAA;AAEnG,MAAM,MAAM,mBAAmB,CAAC,UAAU,SAAS,MAAM,GAAG,MAAM,IAAI,eAAe,CAAC;IACpF;;OAEG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,yBAAyB,CAAA;IACjC;;OAEG;IACH,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ import type { ArchivistParams } from '@xyo-network/archivist-model';
2
+ import type { AnyConfigSchema } from '@xyo-network/module-model';
3
+ import type { LmdbArchivistConfig } from './Config.ts';
4
+ export type LmdbArchivistParams = ArchivistParams<AnyConfigSchema<LmdbArchivistConfig>, {}>;
5
+ //# sourceMappingURL=Params.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Params.d.ts","sourceRoot":"","sources":["../../src/Params.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAEhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAEtD,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAE,EAEvF,CAAC,CAAA"}
@@ -0,0 +1,3 @@
1
+ export declare const LmdbArchivistSchema: "network.xyo.archivist.lmdb";
2
+ export type LmdbArchivistSchema = typeof LmdbArchivistSchema;
3
+ //# sourceMappingURL=Schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,EAAG,4BAAqC,CAAA;AACxE,MAAM,MAAM,mBAAmB,GAAG,OAAO,mBAAmB,CAAA"}
@@ -1,48 +1,5 @@
1
- import { Hash, Hex } from '@xylabs/hex';
2
- import { AbstractArchivist } from '@xyo-network/archivist-abstract';
3
- import { ArchivistConfig, ArchivistParams, ArchivistModuleEventData, IndexDescription, ArchivistNextOptions } from '@xyo-network/archivist-model';
4
- import { BoundWitness } from '@xyo-network/boundwitness-model';
5
- import { Schema, WithStorageMeta, Payload } from '@xyo-network/payload-model';
6
- import { Database, RootDatabase } from 'lmdb';
7
- import { AnyConfigSchema } from '@xyo-network/module-model';
8
-
9
- declare const LmdbArchivistSchema: "network.xyo.archivist.lmdb";
10
- type LmdbArchivistSchema = typeof LmdbArchivistSchema;
11
-
12
- type LmdbArchivistConfigSchema = `${LmdbArchivistSchema}.config`;
13
- declare const LmdbArchivistConfigSchema: LmdbArchivistConfigSchema;
14
- type LmdbArchivistConfig<TStoreName extends string = string> = ArchivistConfig<{
15
- clearStoreOnStart?: boolean;
16
- dbName?: string;
17
- location?: string;
18
- schema: LmdbArchivistConfigSchema;
19
- storeName?: TStoreName;
20
- }>;
21
-
22
- type LmdbArchivistParams = ArchivistParams<AnyConfigSchema<LmdbArchivistConfig>, {}>;
23
-
24
- declare class LmdbArchivist<TParams extends LmdbArchivistParams = LmdbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
25
- static readonly configSchemas: Schema[];
26
- static readonly defaultConfigSchema: Schema;
27
- protected static readonly dataHashIndex: IndexDescription;
28
- protected static readonly sequenceIndex: IndexDescription;
29
- protected dataHashIndex: Database<Hash, string>;
30
- protected db: RootDatabase;
31
- protected hashIndex: Database<WithStorageMeta<Payload>, Hash>;
32
- protected sequenceIndex: Database<Hash, Hex>;
33
- get dbName(): string;
34
- get folderPath(): string;
35
- get location(): string;
36
- get queries(): string[];
37
- get storeName(): string;
38
- startHandler(): Promise<boolean>;
39
- protected allHandler(): WithStorageMeta<Payload>[];
40
- protected clearHandler(): Promise<void>;
41
- protected commitHandler(): Promise<BoundWitness[]>;
42
- protected deleteHandler(hashes: Hash[]): Promise<Hash[]>;
43
- protected getHandler(hashes: Hash[]): WithStorageMeta<Payload>[];
44
- protected insertHandler(payloads: WithStorageMeta<Payload>[]): Promise<WithStorageMeta<Payload>[]>;
45
- protected nextHandler(options?: ArchivistNextOptions): WithStorageMeta<Payload>[];
46
- }
47
-
48
- export { LmdbArchivist, type LmdbArchivistConfig, LmdbArchivistConfigSchema, type LmdbArchivistParams, LmdbArchivistSchema };
1
+ export * from './Archivist.ts';
2
+ export * from './Config.ts';
3
+ export * from './Params.ts';
4
+ export * from './Schema.ts';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/archivist-lmdb",
3
- "version": "3.9.18",
3
+ "version": "3.9.20",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -33,25 +33,25 @@
33
33
  "@xylabs/exists": "^4.5.1",
34
34
  "@xylabs/hex": "^4.5.1",
35
35
  "@xylabs/promise": "^4.5.1",
36
- "@xyo-network/archivist-abstract": "^3.9.18",
37
- "@xyo-network/archivist-model": "^3.9.18",
38
- "@xyo-network/boundwitness-model": "^3.9.18",
39
- "@xyo-network/module-model": "^3.9.18",
40
- "@xyo-network/payload-builder": "^3.9.18",
41
- "@xyo-network/payload-model": "^3.9.18",
36
+ "@xyo-network/archivist-abstract": "^3.9.20",
37
+ "@xyo-network/archivist-model": "^3.9.20",
38
+ "@xyo-network/boundwitness-model": "^3.9.20",
39
+ "@xyo-network/module-model": "^3.9.20",
40
+ "@xyo-network/payload-builder": "^3.9.20",
41
+ "@xyo-network/payload-model": "^3.9.20",
42
42
  "lmdb": "^3.2.6"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@xylabs/delay": "^4.5.1",
46
46
  "@xylabs/object": "^4.5.1",
47
- "@xylabs/ts-scripts-yarn3": "^5.0.25",
48
- "@xylabs/tsconfig": "^5.0.25",
47
+ "@xylabs/ts-scripts-yarn3": "^5.0.39",
48
+ "@xylabs/tsconfig": "^5.0.39",
49
49
  "@xylabs/vitest-extended": "^4.5.1",
50
- "@xyo-network/account": "^3.9.18",
51
- "@xyo-network/archivist-acceptance-tests": "^3.9.18",
52
- "@xyo-network/id-payload-plugin": "^3.9.18",
53
- "@xyo-network/payload-wrapper": "^3.9.18",
54
- "typescript": "^5.7.3",
50
+ "@xyo-network/account": "^3.9.20",
51
+ "@xyo-network/archivist-acceptance-tests": "^3.9.20",
52
+ "@xyo-network/id-payload-plugin": "^3.9.20",
53
+ "@xyo-network/payload-wrapper": "^3.9.20",
54
+ "typescript": "^5.8.2",
55
55
  "uuid": "^11.1.0",
56
56
  "vitest": "^3.0.7"
57
57
  },