@xyo-network/archivist-leveldb 4.1.2 → 4.1.4

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,82 +1,5 @@
1
- import { Hash, Hex } from '@xylabs/hex';
2
- import { Promisable } from '@xylabs/promise';
3
- import { AbstractArchivist } from '@xyo-network/archivist-abstract';
4
- import { ArchivistConfig, ArchivistParams, ArchivistModuleEventData, ArchivistNextOptions } from '@xyo-network/archivist-model';
5
- import { BoundWitness } from '@xyo-network/boundwitness-model';
6
- import { WithStorageMeta, Payload, Schema } from '@xyo-network/payload-model';
7
- import { AbstractLevel, AbstractSublevel } from 'abstract-level-2';
8
- import { AnyConfigSchema } from '@xyo-network/module-model';
9
-
10
- declare const LevelDbArchivistSchema: "network.xyo.archivist.leveldb";
11
- type LevelDbArchivistSchema = typeof LevelDbArchivistSchema;
12
-
13
- type LevelDbArchivistConfigSchema = `${LevelDbArchivistSchema}.config`;
14
- declare const LevelDbArchivistConfigSchema: LevelDbArchivistConfigSchema;
15
- type LevelDbArchivistConfig<TStoreName extends string = string> = ArchivistConfig<{
16
- /**
17
- * If true, the store will be cleared on start
18
- */
19
- clearStoreOnStart?: boolean;
20
- /**
21
- * The database name - also used as the filename for the db
22
- */
23
- dbName?: string;
24
- /**
25
- * The location where the folder for the db will be created
26
- */
27
- location?: string;
28
- schema: LevelDbArchivistConfigSchema;
29
- /**
30
- * The name of the object store - becomes a sub-level
31
- */
32
- storeName?: TStoreName;
33
- }>;
34
-
35
- interface LevelDbArchivistParams extends ArchivistParams<AnyConfigSchema<LevelDbArchivistConfig>> {
36
- }
37
-
38
- /** Note: We have indexes as top level sublevels since making them a sublevel of a store, getting all the values of that store includes the sublevels */
39
- interface PayloadStore {
40
- [s: string]: WithStorageMeta;
41
- }
42
- type AbstractPayloadLevel = AbstractLevel<string | Buffer | Uint8Array, Hash, WithStorageMeta<Payload>>;
43
- type AbstractPayloadSubLevel = AbstractSublevel<AbstractPayloadLevel, string | Buffer | Uint8Array, Hash, WithStorageMeta<Payload>>;
44
- type AbstractIndexSubLevel<T> = AbstractSublevel<AbstractPayloadLevel, string | Buffer | Uint8Array, T, Hash>;
45
- declare abstract class AbstractLevelDbArchivist<TParams extends LevelDbArchivistParams = LevelDbArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> {
46
- static readonly configSchemas: Schema[];
47
- static readonly defaultConfigSchema: Schema;
48
- static readonly labels: {
49
- "network.xyo.storage.class": string;
50
- };
51
- private static readonly dataHashIndex;
52
- private static readonly sequenceIndex;
53
- static readonly dataHashIndexName: string;
54
- static readonly sequenceIndexName: string;
55
- get dbName(): string;
56
- get folderPath(): string;
57
- get location(): string;
58
- get queries(): string[];
59
- get storeName(): string;
60
- private static findIndexFromCursor;
61
- protected allHandler(): Promise<WithStorageMeta<Payload>[]>;
62
- protected clearHandler(): Promise<void>;
63
- protected commitHandler(): Promise<BoundWitness[]>;
64
- protected deleteHandler(hashes: Hash[]): Promise<WithStorageMeta<Payload>[]>;
65
- protected getHandler(hashes: Hash[]): Promise<WithStorageMeta<Payload>[]>;
66
- protected insertHandler(payloads: WithStorageMeta<Payload>[]): Promise<WithStorageMeta<Payload>[]>;
67
- protected nextHandler(options?: ArchivistNextOptions): Promise<WithStorageMeta<Payload>[]>;
68
- protected startHandler(): Promise<void>;
69
- protected withDataHashIndex<T>(func: (index: AbstractIndexSubLevel<string>) => Promisable<T>): Promisable<T>;
70
- protected withSequenceIndex<T>(func: (index: AbstractIndexSubLevel<Hex>) => Promisable<T>): Promisable<T>;
71
- protected withStore<T>(func: (store: AbstractPayloadSubLevel) => Promisable<T>): Promise<T>;
72
- protected abstract withDb<T>(func: (db: AbstractPayloadLevel) => Promisable<T>): Promisable<T>;
73
- }
74
- declare class LevelDbArchivist extends AbstractLevelDbArchivist {
75
- private _db;
76
- private _dbMutex;
77
- protected stopHandler(): Promise<void>;
78
- protected withDb<T>(func: (db: AbstractPayloadLevel) => Promisable<T>): Promise<T>;
79
- }
80
-
81
- export { AbstractLevelDbArchivist, LevelDbArchivist, LevelDbArchivistConfigSchema, LevelDbArchivistSchema };
82
- export type { AbstractIndexSubLevel, AbstractPayloadLevel, AbstractPayloadSubLevel, LevelDbArchivistConfig, LevelDbArchivistParams, PayloadStore };
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/archivist-leveldb",
3
- "version": "4.1.2",
3
+ "version": "4.1.4",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,33 +29,33 @@
29
29
  "module": "dist/browser/index.mjs",
30
30
  "types": "dist/browser/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.13.15",
33
- "@xylabs/exists": "^4.13.15",
34
- "@xylabs/hex": "^4.13.15",
35
- "@xylabs/promise": "^4.13.15",
36
- "@xylabs/typeof": "^4.13.15",
37
- "@xyo-network/archivist-abstract": "^4.1.2",
38
- "@xyo-network/archivist-model": "^4.1.2",
39
- "@xyo-network/boundwitness-model": "^4.1.2",
40
- "@xyo-network/module-model": "^4.1.2",
41
- "@xyo-network/payload-builder": "^4.1.2",
42
- "@xyo-network/payload-model": "^4.1.2",
32
+ "@xylabs/assert": "^4.13.16",
33
+ "@xylabs/exists": "^4.13.16",
34
+ "@xylabs/hex": "^4.13.16",
35
+ "@xylabs/promise": "^4.13.16",
36
+ "@xylabs/typeof": "^4.13.16",
37
+ "@xyo-network/archivist-abstract": "^4.1.4",
38
+ "@xyo-network/archivist-model": "^4.1.4",
39
+ "@xyo-network/boundwitness-model": "^4.1.4",
40
+ "@xyo-network/module-model": "^4.1.4",
41
+ "@xyo-network/payload-builder": "^4.1.4",
42
+ "@xyo-network/payload-model": "^4.1.4",
43
43
  "abstract-level-2": "npm:abstract-level@^2",
44
44
  "async-mutex": "^0.5.0",
45
45
  "level": "^9.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@xylabs/delay": "^4.13.15",
49
- "@xylabs/object": "^4.13.15",
50
- "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.23",
51
- "@xylabs/tsconfig": "^7.0.0-rc.23",
52
- "@xylabs/vitest-extended": "^4.13.15",
53
- "@xyo-network/account": "^4.1.2",
54
- "@xyo-network/account-model": "^4.1.2",
55
- "@xyo-network/archivist-acceptance-tests": "^4.1.2",
56
- "@xyo-network/id-payload-plugin": "^4.1.2",
57
- "@xyo-network/payload-wrapper": "^4.1.2",
58
- "@xyo-network/wallet": "^4.1.2",
48
+ "@xylabs/delay": "^4.13.16",
49
+ "@xylabs/object": "^4.13.16",
50
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.27",
51
+ "@xylabs/tsconfig": "^7.0.0-rc.27",
52
+ "@xylabs/vitest-extended": "^4.13.16",
53
+ "@xyo-network/account": "^4.1.4",
54
+ "@xyo-network/account-model": "^4.1.4",
55
+ "@xyo-network/archivist-acceptance-tests": "^4.1.4",
56
+ "@xyo-network/id-payload-plugin": "^4.1.4",
57
+ "@xyo-network/payload-wrapper": "^4.1.4",
58
+ "@xyo-network/wallet": "^4.1.4",
59
59
  "typescript": "^5.8.3",
60
60
  "uuid": "^11.1.0",
61
61
  "vitest": "^3.2.4"