@xyo-network/archivist-abstract 4.0.2 → 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.
- package/dist/neutral/index.d.ts +92 -0
- package/package.json +21 -21
- /package/{dist/types → build/neutral}/AbstractArchivist.d.ts +0 -0
- /package/{dist/types → build/neutral}/AbstractArchivist.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/StorageClassLabel.d.ts +0 -0
- /package/{dist/types → build/neutral}/StorageClassLabel.d.ts.map +0 -0
- /package/{dist/types → build/neutral}/index.d.ts +0 -0
- /package/{dist/types → build/neutral}/index.d.ts.map +0 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import * as _opentelemetry_api from '@opentelemetry/api';
|
|
2
|
+
import { Gauge, Meter } from '@opentelemetry/api';
|
|
3
|
+
import { Hash } from '@xylabs/hex';
|
|
4
|
+
import { PromisableArray, Promisable } from '@xylabs/promise';
|
|
5
|
+
import { AccountInstance } from '@xyo-network/account-model';
|
|
6
|
+
import { ArchivistParams, ArchivistModuleEventData, AttachableArchivistInstance, ArchivistNextOptions, ArchivistSnapshotPayload, ArchivistStatsPayload, ReadArchivist, ArchivistInstance } from '@xyo-network/archivist-model';
|
|
7
|
+
import { BoundWitness, QueryBoundWitness } from '@xyo-network/boundwitness-model';
|
|
8
|
+
import { QueryBoundWitnessWrapper } from '@xyo-network/boundwitness-wrapper';
|
|
9
|
+
import { AbstractModuleInstance } from '@xyo-network/module-abstract';
|
|
10
|
+
import { ModuleQueryResult, ModuleIdentifier, ModuleConfig, ModuleQueryHandlerResult } from '@xyo-network/module-model';
|
|
11
|
+
import { Payload, Schema, WithStorageMeta } from '@xyo-network/payload-model';
|
|
12
|
+
|
|
13
|
+
interface ActionConfig {
|
|
14
|
+
emitEvents?: boolean;
|
|
15
|
+
}
|
|
16
|
+
interface InsertConfig extends ActionConfig {
|
|
17
|
+
writeToParents?: boolean;
|
|
18
|
+
}
|
|
19
|
+
interface ArchivistParentInstanceMap {
|
|
20
|
+
commit?: Partial<Record<ModuleIdentifier, ArchivistInstance>>;
|
|
21
|
+
read?: Partial<Record<ModuleIdentifier, ArchivistInstance>>;
|
|
22
|
+
write?: Partial<Record<ModuleIdentifier, ArchivistInstance>>;
|
|
23
|
+
}
|
|
24
|
+
declare abstract class AbstractArchivist<TParams extends ArchivistParams = ArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractModuleInstance<TParams, TEventData> implements AttachableArchivistInstance<TParams, TEventData, Payload> {
|
|
25
|
+
static readonly configSchemas: Schema[];
|
|
26
|
+
static readonly defaultConfigSchema: Schema;
|
|
27
|
+
static readonly labels: {
|
|
28
|
+
"network.xyo.storage.class": string;
|
|
29
|
+
};
|
|
30
|
+
static readonly uniqueName: string;
|
|
31
|
+
protected static defaultNextLimitSetting: number;
|
|
32
|
+
private _getCache?;
|
|
33
|
+
private _parentArchivists?;
|
|
34
|
+
private _payloadCountGauge?;
|
|
35
|
+
private _payloadCountMeter?;
|
|
36
|
+
static get defaultNextLimit(): number;
|
|
37
|
+
get queries(): string[];
|
|
38
|
+
get requireAllParents(): boolean;
|
|
39
|
+
protected get payloadCountGauge(): Gauge<_opentelemetry_api.Attributes> | null | undefined;
|
|
40
|
+
protected get payloadCountMeter(): Meter | null;
|
|
41
|
+
protected get storeParentReads(): boolean;
|
|
42
|
+
/** deprecated use next or snapshot instead */
|
|
43
|
+
all(): Promise<WithStorageMeta<Payload>[]>;
|
|
44
|
+
/** deprecated use nextQuery or snapshotQuery instead */
|
|
45
|
+
allQuery(account: AccountInstance): Promise<ModuleQueryResult>;
|
|
46
|
+
clear(): Promise<void>;
|
|
47
|
+
clearQuery(account: AccountInstance): Promise<ModuleQueryResult>;
|
|
48
|
+
commit(): Promise<BoundWitness[]>;
|
|
49
|
+
commitQuery(account: AccountInstance): Promise<ModuleQueryResult>;
|
|
50
|
+
delete(hashes: Hash[]): Promise<WithStorageMeta<Payload>[]>;
|
|
51
|
+
deleteQuery(hashes: Hash[], account?: AccountInstance): Promise<ModuleQueryResult>;
|
|
52
|
+
get(hashes: Hash[]): Promise<WithStorageMeta<Payload>[]>;
|
|
53
|
+
getQuery(hashes: Hash[], account?: AccountInstance): Promise<ModuleQueryResult>;
|
|
54
|
+
insert(payloads: Payload[]): Promise<WithStorageMeta<Payload>[]>;
|
|
55
|
+
insertQuery(payloads: Payload[], account?: AccountInstance): Promise<ModuleQueryResult>;
|
|
56
|
+
next(options?: ArchivistNextOptions): Promise<WithStorageMeta<Payload>[]>;
|
|
57
|
+
nextQuery(options?: ArchivistNextOptions, account?: AccountInstance): Promise<ModuleQueryResult>;
|
|
58
|
+
snapshot(): Promise<ArchivistSnapshotPayload<WithStorageMeta<Payload>, Hash>[]>;
|
|
59
|
+
snapshotQuery(account?: AccountInstance): Promise<ModuleQueryResult>;
|
|
60
|
+
protected allHandler(): PromisableArray<WithStorageMeta<Payload>>;
|
|
61
|
+
protected clearHandler(): Promisable<void>;
|
|
62
|
+
protected commitHandler(): Promisable<BoundWitness[]>;
|
|
63
|
+
protected deleteHandler(_hashes: Hash[]): PromisableArray<WithStorageMeta<Payload>>;
|
|
64
|
+
protected deleteWithConfig(hashes: Hash[], config?: ActionConfig): Promise<WithStorageMeta<Payload>[]>;
|
|
65
|
+
protected generateStats(): Promisable<ArchivistStatsPayload>;
|
|
66
|
+
protected getFromParent(hashes: Hash[], archivist: ReadArchivist): Promise<[WithStorageMeta<Payload>[], Hash[]]>;
|
|
67
|
+
protected getFromParents(hashes: Hash[]): Promise<[WithStorageMeta<Payload>[], Hash[]]>;
|
|
68
|
+
protected getHandler(_hashes: Hash[]): Promisable<WithStorageMeta<Payload>[]>;
|
|
69
|
+
protected getWithConfig(hashes: Hash[], _config?: InsertConfig): Promise<WithStorageMeta<Payload>[]>;
|
|
70
|
+
protected insertHandler(_payloads: WithStorageMeta<Payload>[]): Promisable<WithStorageMeta<Payload>[]>;
|
|
71
|
+
protected insertQueryHandler<T extends QueryBoundWitnessWrapper = QueryBoundWitnessWrapper>(query: T, payloads?: Payload[]): Promise<WithStorageMeta<Payload>[]>;
|
|
72
|
+
protected insertWithConfig(payloads: Payload[], config?: InsertConfig): Promise<WithStorageMeta<Payload>[]>;
|
|
73
|
+
protected nextHandler(_options?: ArchivistNextOptions): Promisable<WithStorageMeta<Payload>[]>;
|
|
74
|
+
protected nextWithConfig(options?: ArchivistNextOptions, _config?: InsertConfig): Promise<WithStorageMeta<Payload>[]>;
|
|
75
|
+
protected parentArchivists(): Promise<ArchivistParentInstanceMap>;
|
|
76
|
+
protected payloadCountHandler(): number;
|
|
77
|
+
protected queryHandler<T extends QueryBoundWitness = QueryBoundWitness, TConfig extends ModuleConfig = ModuleConfig>(query: T, payloads: Payload[], queryConfig?: TConfig): Promise<ModuleQueryHandlerResult>;
|
|
78
|
+
protected reportPayloadCount(): void;
|
|
79
|
+
protected snapshotHandler(): PromisableArray<ArchivistSnapshotPayload<WithStorageMeta<Payload>, Hash>>;
|
|
80
|
+
protected startHandler(): Promise<void>;
|
|
81
|
+
protected stateHandler(): Promise<Payload[]>;
|
|
82
|
+
protected writeToParent(parent: ArchivistInstance, payloads: Payload[]): Promise<Payload[]>;
|
|
83
|
+
protected writeToParents(payloads: Payload[]): Promise<Payload[]>;
|
|
84
|
+
private omitClientMetaForDataHashes;
|
|
85
|
+
private resolveArchivists;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare const StorageClassLabel = "network.xyo.storage.class";
|
|
89
|
+
type StorageClassLabelValue = 'memory' | 'disk' | 'network' | 'proxy' | 'unknown';
|
|
90
|
+
|
|
91
|
+
export { AbstractArchivist, StorageClassLabel };
|
|
92
|
+
export type { ActionConfig, InsertConfig, StorageClassLabelValue };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/archivist-abstract",
|
|
3
|
-
"version": "4.0
|
|
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,36 +21,36 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"types": "./dist/
|
|
24
|
+
"types": "./dist/neutral/index.d.ts",
|
|
25
25
|
"default": "./dist/neutral/index.mjs"
|
|
26
26
|
},
|
|
27
27
|
"./package.json": "./package.json"
|
|
28
28
|
},
|
|
29
29
|
"module": "dist/neutral/index.mjs",
|
|
30
|
-
"types": "dist/
|
|
30
|
+
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@opentelemetry/api": "^1.9.0",
|
|
33
|
-
"@xylabs/assert": "^4.
|
|
34
|
-
"@xylabs/base": "^4.
|
|
35
|
-
"@xylabs/exists": "^4.
|
|
36
|
-
"@xylabs/hex": "^4.
|
|
37
|
-
"@xylabs/promise": "^4.
|
|
38
|
-
"@xylabs/set": "^4.
|
|
39
|
-
"@xylabs/telemetry": "^4.
|
|
40
|
-
"@xylabs/typeof": "^4.
|
|
41
|
-
"@xyo-network/account-model": "^4.0
|
|
42
|
-
"@xyo-network/archivist-model": "^4.0
|
|
43
|
-
"@xyo-network/boundwitness-model": "^4.0
|
|
44
|
-
"@xyo-network/boundwitness-wrapper": "^4.0
|
|
45
|
-
"@xyo-network/module-abstract": "^4.0
|
|
46
|
-
"@xyo-network/module-model": "^4.0
|
|
47
|
-
"@xyo-network/payload-builder": "^4.0
|
|
48
|
-
"@xyo-network/payload-model": "^4.0
|
|
33
|
+
"@xylabs/assert": "^4.13.15",
|
|
34
|
+
"@xylabs/base": "^4.13.15",
|
|
35
|
+
"@xylabs/exists": "^4.13.15",
|
|
36
|
+
"@xylabs/hex": "^4.13.15",
|
|
37
|
+
"@xylabs/promise": "^4.13.15",
|
|
38
|
+
"@xylabs/set": "^4.13.15",
|
|
39
|
+
"@xylabs/telemetry": "^4.13.15",
|
|
40
|
+
"@xylabs/typeof": "^4.13.15",
|
|
41
|
+
"@xyo-network/account-model": "^4.1.0",
|
|
42
|
+
"@xyo-network/archivist-model": "^4.1.0",
|
|
43
|
+
"@xyo-network/boundwitness-model": "^4.1.0",
|
|
44
|
+
"@xyo-network/boundwitness-wrapper": "^4.1.0",
|
|
45
|
+
"@xyo-network/module-abstract": "^4.1.0",
|
|
46
|
+
"@xyo-network/module-model": "^4.1.0",
|
|
47
|
+
"@xyo-network/payload-builder": "^4.1.0",
|
|
48
|
+
"@xyo-network/payload-model": "^4.1.0",
|
|
49
49
|
"lru-cache": "^11.1.0"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@xylabs/ts-scripts-yarn3": "^
|
|
53
|
-
"@xylabs/tsconfig": "^
|
|
52
|
+
"@xylabs/ts-scripts-yarn3": "^7.0.0-rc.20",
|
|
53
|
+
"@xylabs/tsconfig": "^7.0.0-rc.20",
|
|
54
54
|
"typescript": "^5.8.3"
|
|
55
55
|
},
|
|
56
56
|
"publishConfig": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|