@xyo-network/filesystem-archivist 4.0.3 → 4.1.0

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,44 @@
1
+ import { Hash } from '@xylabs/hex';
2
+ import { PromisableArray } from '@xylabs/promise';
3
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
4
+ import { ArchivistConfig, ArchivistParams, ArchivistInstance } from '@xyo-network/archivist-model';
5
+ import { BoundWitness } from '@xyo-network/boundwitness-model';
6
+ import { AnyConfigSchema } from '@xyo-network/module-model';
7
+ import { Payload, Schema, WithStorageMeta } from '@xyo-network/payload-model';
8
+
9
+ interface FileSystemArchivistData {
10
+ payloads: Payload[];
11
+ }
12
+ declare const FilesystemArchivistConfigSchema: "network.xyo.archivist.filesystem.config";
13
+ type FilesystemArchivistConfigSchema = typeof FilesystemArchivistConfigSchema;
14
+ type FilesystemArchivistConfig = ArchivistConfig<{
15
+ filePath?: string;
16
+ schema: FilesystemArchivistConfigSchema;
17
+ }>;
18
+ type FilesystemArchivistParams = ArchivistParams<AnyConfigSchema<FilesystemArchivistConfig>>;
19
+ /** @description Currently only a read-only archivist that loads payloads from filesystem
20
+ * but allows for future expansion to read/write
21
+ */
22
+ declare class FilesystemArchivist<TParams extends FilesystemArchivistParams = FilesystemArchivistParams> extends AbstractArchivist<TParams> implements ArchivistInstance {
23
+ static readonly configSchemas: Schema[];
24
+ static readonly defaultConfigSchema: Schema;
25
+ static readonly labels: {
26
+ "network.xyo.storage.class": string;
27
+ };
28
+ private _memoryArchivist?;
29
+ get filePath(): string;
30
+ get queries(): string[];
31
+ private get memoryArchivist();
32
+ private static dataFromRawJson;
33
+ protected allHandler(): PromisableArray<WithStorageMeta<Payload>>;
34
+ protected clearHandler(): void | Promise<void>;
35
+ protected commitHandler(): Promise<BoundWitness[]>;
36
+ protected deleteHandler(hashes: Hash[]): PromisableArray<WithStorageMeta<Payload>>;
37
+ protected getHandler(hashes: Hash[]): Promise<WithStorageMeta<Payload>[]>;
38
+ protected insertHandler(payloads: Payload[]): Promise<WithStorageMeta<Payload>[]>;
39
+ protected startHandler(): Promise<void>;
40
+ private rawJsonFromFile;
41
+ }
42
+
43
+ export { FilesystemArchivist, FilesystemArchivistConfigSchema };
44
+ export type { FileSystemArchivistData, FilesystemArchivistConfig, FilesystemArchivistParams };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/filesystem-archivist",
3
- "version": "4.0.3",
3
+ "version": "4.1.0",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -21,30 +21,31 @@
21
21
  "type": "module",
22
22
  "exports": {
23
23
  ".": {
24
- "types": "./dist/types/index.d.ts",
24
+ "types": "./dist/node/index.d.ts",
25
+ "browser": {},
25
26
  "module": "./dist/node/index.mjs"
26
27
  },
27
28
  "./package.json": "./package.json"
28
29
  },
29
30
  "module": "dist/node/index.mjs",
30
- "types": "dist/types/index.d.ts",
31
+ "types": "dist/node/index.d.ts",
31
32
  "dependencies": {
32
- "@xylabs/assert": "^4.13.4",
33
- "@xylabs/error": "^4.13.4",
34
- "@xylabs/hex": "^4.13.4",
35
- "@xylabs/promise": "^4.13.4",
36
- "@xyo-network/archivist-abstract": "^4.0.3",
37
- "@xyo-network/archivist-memory": "^4.0.3",
38
- "@xyo-network/archivist-model": "^4.0.3",
39
- "@xyo-network/boundwitness-model": "^4.0.3",
40
- "@xyo-network/module-model": "^4.0.3",
41
- "@xyo-network/payload-model": "^4.0.3",
42
- "@xyo-network/wallet": "^4.0.3"
33
+ "@xylabs/assert": "^4.13.15",
34
+ "@xylabs/hex": "^4.13.15",
35
+ "@xylabs/promise": "^4.13.15",
36
+ "@xyo-network/archivist-abstract": "^4.1.0",
37
+ "@xyo-network/archivist-memory": "^4.1.0",
38
+ "@xyo-network/archivist-model": "^4.1.0",
39
+ "@xyo-network/boundwitness-model": "^4.1.0",
40
+ "@xyo-network/module-model": "^4.1.0",
41
+ "@xyo-network/payload-model": "^4.1.0",
42
+ "@xyo-network/wallet": "^4.1.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@xylabs/ts-scripts-yarn3": "^6.5.18",
46
- "@xylabs/tsconfig": "^6.5.18",
47
- "@xylabs/vitest-extended": "^4.13.4",
45
+ "@xylabs/error": "^4.13.15",
46
+ "@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
47
+ "@xylabs/tsconfig": "^7.0.0-rc.20",
48
+ "@xylabs/vitest-extended": "^4.13.15",
48
49
  "typescript": "^5.8.3",
49
50
  "vitest": "^3.2.4"
50
51
  },
File without changes
File without changes