@xyo-network/archivist-view 7.0.9 → 7.0.10
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
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '@xyo-network/sdk/archivist-view';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,iCAAiC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,83 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
4
|
-
var __reflectGet = Reflect.get;
|
|
5
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
7
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
8
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
9
|
-
if (decorator = decorators[i])
|
|
10
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
11
|
-
if (kind && result) __defProp(target, key, result);
|
|
12
|
-
return result;
|
|
13
|
-
};
|
|
14
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
15
|
-
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
16
|
-
|
|
17
|
-
// src/ViewArchivist.ts
|
|
18
|
-
import {
|
|
19
|
-
assertEx,
|
|
20
|
-
zodAsFactory,
|
|
21
|
-
zodIsFactory,
|
|
22
|
-
zodToFactory
|
|
23
|
-
} from "@ariestools/sdk";
|
|
24
|
-
import { AbstractArchivist, StorageClassLabel } from "@xyo-network/archivist-abstract";
|
|
25
|
-
import {
|
|
26
|
-
ArchivistAllQuerySchema,
|
|
27
|
-
ArchivistConfigZod,
|
|
28
|
-
ArchivistGetQuerySchema,
|
|
29
|
-
ArchivistNextQuerySchema,
|
|
30
|
-
isArchivistInstance
|
|
31
|
-
} from "@xyo-network/archivist-model";
|
|
32
|
-
import {
|
|
33
|
-
labeledCreatableModule,
|
|
34
|
-
ModuleLimitationViewLabel
|
|
35
|
-
} from "@xyo-network/module-model";
|
|
36
|
-
import { asSchema } from "@xyo-network/sdk-protocol";
|
|
37
|
-
import * as z from "zod/mini";
|
|
38
|
-
var ViewArchivistConfigSchema = asSchema("network.xyo.archivist.view.config", true);
|
|
39
|
-
var ViewArchivistConfigZod = z.extend(ArchivistConfigZod, {
|
|
40
|
-
originArchivist: z.optional(z.custom()),
|
|
41
|
-
schema: z.literal(ViewArchivistConfigSchema)
|
|
42
|
-
});
|
|
43
|
-
var isViewArchivistConfig = zodIsFactory(ViewArchivistConfigZod);
|
|
44
|
-
var asViewArchivistConfig = zodAsFactory(ViewArchivistConfigZod, "asViewArchivistConfig");
|
|
45
|
-
var toViewArchivistConfig = zodToFactory(ViewArchivistConfigZod, "toViewArchivistConfig");
|
|
46
|
-
var ViewArchivist = class extends AbstractArchivist {
|
|
47
|
-
_originArchivistInstance;
|
|
48
|
-
get originArchivist() {
|
|
49
|
-
return assertEx(this.config.originArchivist, () => "originArchivist not configured");
|
|
50
|
-
}
|
|
51
|
-
get queries() {
|
|
52
|
-
return [ArchivistGetQuerySchema, ArchivistAllQuerySchema, ArchivistNextQuerySchema, ...super.queries];
|
|
53
|
-
}
|
|
54
|
-
async originArchivistInstance() {
|
|
55
|
-
this._originArchivistInstance = this._originArchivistInstance ?? assertEx(await this.resolve(this.originArchivist, { identity: isArchivistInstance, required: true }));
|
|
56
|
-
return this._originArchivistInstance;
|
|
57
|
-
}
|
|
58
|
-
/** @deprecated use next instead */
|
|
59
|
-
allHandler() {
|
|
60
|
-
throw new Error("allHandler is deprecated, use nextHandler instead");
|
|
61
|
-
}
|
|
62
|
-
async getHandler(hashes) {
|
|
63
|
-
return await (await this.originArchivistInstance()).get(hashes);
|
|
64
|
-
}
|
|
65
|
-
async nextHandler(options) {
|
|
66
|
-
return await (await this.originArchivistInstance()).next?.(options) ?? [];
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
__publicField(ViewArchivist, "configSchemas", [...__superGet(ViewArchivist, ViewArchivist, "configSchemas"), ViewArchivistConfigSchema]);
|
|
70
|
-
__publicField(ViewArchivist, "defaultConfigSchema", ViewArchivistConfigSchema);
|
|
71
|
-
__publicField(ViewArchivist, "labels", { ...ModuleLimitationViewLabel, [StorageClassLabel]: "proxy" });
|
|
72
|
-
ViewArchivist = __decorateClass([
|
|
73
|
-
labeledCreatableModule()
|
|
74
|
-
], ViewArchivist);
|
|
75
|
-
export {
|
|
76
|
-
ViewArchivist,
|
|
77
|
-
ViewArchivistConfigSchema,
|
|
78
|
-
ViewArchivistConfigZod,
|
|
79
|
-
asViewArchivistConfig,
|
|
80
|
-
isViewArchivistConfig,
|
|
81
|
-
toViewArchivistConfig
|
|
82
|
-
};
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@xyo-network/sdk/archivist-view";
|
|
83
3
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../src/
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
3
|
+
"sources": ["../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Compatibility shim: this package re-exports from @xyo-network/sdk.\nexport * from '@xyo-network/sdk/archivist-view'\n"],
|
|
5
|
+
"mappings": ";AACA,cAAc;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/archivist-view",
|
|
3
|
-
"version": "7.0.
|
|
3
|
+
"version": "7.0.10",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -34,9 +34,7 @@
|
|
|
34
34
|
"README.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@xyo-network/
|
|
38
|
-
"@xyo-network/module-model": "~7.0.9",
|
|
39
|
-
"@xyo-network/archivist-abstract": "~7.0.9"
|
|
37
|
+
"@xyo-network/sdk": "~7.0.10"
|
|
40
38
|
},
|
|
41
39
|
"devDependencies": {
|
|
42
40
|
"@ariestools/sdk": "~8.0.2",
|
|
@@ -48,9 +46,9 @@
|
|
|
48
46
|
"@opentelemetry/sdk-trace-base": "~2.9.0",
|
|
49
47
|
"@scure/base": "~2.2.0",
|
|
50
48
|
"@scure/bip39": "~2.2.0",
|
|
51
|
-
"@xylabs/toolchain": "~8.6.
|
|
52
|
-
"@xylabs/tsconfig": "~8.6.
|
|
53
|
-
"@xyo-network/sdk-protocol": "~7.0.
|
|
49
|
+
"@xylabs/toolchain": "~8.6.8",
|
|
50
|
+
"@xylabs/tsconfig": "~8.6.8",
|
|
51
|
+
"@xyo-network/sdk-protocol": "~7.0.15",
|
|
54
52
|
"ajv": "~8.20.0",
|
|
55
53
|
"async-mutex": "~0.5.0",
|
|
56
54
|
"debug": "~4.4.3",
|
|
@@ -61,14 +59,9 @@
|
|
|
61
59
|
"idb": "~8.0.3",
|
|
62
60
|
"lru-cache": "~11.5.1",
|
|
63
61
|
"observable-fns": "~0.6.1",
|
|
64
|
-
"tslib": "~2.8.1",
|
|
65
62
|
"typescript": "~6.0.3",
|
|
66
|
-
"vite": "~8.1.3",
|
|
67
|
-
"vitest": "~4.1.9",
|
|
68
63
|
"webextension-polyfill": "~0.12.0",
|
|
69
|
-
"zod": "~4.4.3"
|
|
70
|
-
"@xyo-network/archivist-memory": "~7.0.9",
|
|
71
|
-
"@xyo-network/node-memory": "~7.0.9"
|
|
64
|
+
"zod": "~4.4.3"
|
|
72
65
|
},
|
|
73
66
|
"peerDependencies": {
|
|
74
67
|
"@ariestools/sdk": "^8.0.2",
|
|
@@ -80,7 +73,7 @@
|
|
|
80
73
|
"@opentelemetry/sdk-trace-base": "^2.9.0",
|
|
81
74
|
"@scure/base": "^2.2.0",
|
|
82
75
|
"@scure/bip39": "^2.2.0",
|
|
83
|
-
"@xyo-network/sdk-protocol": "^7.0.
|
|
76
|
+
"@xyo-network/sdk-protocol": "^7.0.15",
|
|
84
77
|
"ajv": "^8.20.0",
|
|
85
78
|
"async-mutex": "^0.5.0",
|
|
86
79
|
"debug": "^4.4.3",
|
|
@@ -97,5 +90,6 @@
|
|
|
97
90
|
},
|
|
98
91
|
"publishConfig": {
|
|
99
92
|
"access": "public"
|
|
100
|
-
}
|
|
93
|
+
},
|
|
94
|
+
"deprecated": "Use @xyo-network/sdk/archivist-view instead. Replace @xyo-network/archivist-view with @xyo-network/sdk/archivist-view. This package is a compatibility shim only and will not receive further updates."
|
|
101
95
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Hash, Promisable } from '@ariestools/sdk';
|
|
2
|
-
import { zodAsFactory, zodIsFactory, zodToFactory } from '@ariestools/sdk';
|
|
3
|
-
import { AbstractArchivist } from '@xyo-network/archivist-abstract';
|
|
4
|
-
import type { ArchivistConfig, ArchivistInstance, ArchivistModuleEventData, ArchivistNextOptions, ArchivistParams } from '@xyo-network/archivist-model';
|
|
5
|
-
import { ArchivistConfigZod } from '@xyo-network/archivist-model';
|
|
6
|
-
import type { AnyConfigSchema, ModuleIdentifier, ModuleInstance } from '@xyo-network/module-model';
|
|
7
|
-
import type { Payload, Schema, WithStorageMeta } from '@xyo-network/sdk-protocol';
|
|
8
|
-
import * as z from 'zod/mini';
|
|
9
|
-
export declare const ViewArchivistConfigSchema: 'network.xyo.archivist.view.config' & {
|
|
10
|
-
readonly __schema: true;
|
|
11
|
-
};
|
|
12
|
-
export type ViewArchivistConfigSchema = typeof ViewArchivistConfigSchema;
|
|
13
|
-
export declare const ViewArchivistConfigZod: z.ZodMiniObject<Omit<(typeof ArchivistConfigZod)['shape'], 'schema'> & {
|
|
14
|
-
originArchivist: z.ZodMiniOptional<z.ZodMiniCustom<ModuleIdentifier, ModuleIdentifier>>;
|
|
15
|
-
schema: z.ZodMiniLiteral<ViewArchivistConfigSchema>;
|
|
16
|
-
}, z.core.$strip>;
|
|
17
|
-
export type ViewArchivistConfigBase = z.infer<typeof ViewArchivistConfigZod>;
|
|
18
|
-
export declare const isViewArchivistConfig: ReturnType<typeof zodIsFactory<ViewArchivistConfigBase>>;
|
|
19
|
-
export declare const asViewArchivistConfig: ReturnType<typeof zodAsFactory<ViewArchivistConfigBase>>;
|
|
20
|
-
export declare const toViewArchivistConfig: ReturnType<typeof zodToFactory<ViewArchivistConfigBase>>;
|
|
21
|
-
export type ViewArchivistConfig = ArchivistConfig<{
|
|
22
|
-
originArchivist?: ModuleIdentifier;
|
|
23
|
-
}, ViewArchivistConfigSchema>;
|
|
24
|
-
export type ViewArchivistParams<TConfig extends AnyConfigSchema<ViewArchivistConfig> = AnyConfigSchema<ViewArchivistConfig>> = ArchivistParams<TConfig>;
|
|
25
|
-
export declare class ViewArchivist<TParams extends ViewArchivistParams<AnyConfigSchema<ViewArchivistConfig>> = ViewArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> implements ArchivistInstance, ModuleInstance {
|
|
26
|
-
static readonly configSchemas: Schema[];
|
|
27
|
-
static readonly defaultConfigSchema: Schema;
|
|
28
|
-
static readonly labels: {
|
|
29
|
-
'ModuleLimitationLabelName': string;
|
|
30
|
-
'network.xyo.storage.class': string;
|
|
31
|
-
};
|
|
32
|
-
private _originArchivistInstance?;
|
|
33
|
-
get originArchivist(): string | (Lowercase<string> & {
|
|
34
|
-
readonly __hex: true;
|
|
35
|
-
} & {
|
|
36
|
-
readonly __address: true;
|
|
37
|
-
});
|
|
38
|
-
get queries(): Schema[];
|
|
39
|
-
originArchivistInstance(): Promise<ArchivistInstance<ArchivistParams<AnyConfigSchema<ArchivistConfig>>, ArchivistModuleEventData, Payload>>;
|
|
40
|
-
/** @deprecated use next instead */
|
|
41
|
-
protected allHandler(): Promisable<WithStorageMeta<Payload>[]>;
|
|
42
|
-
protected getHandler(hashes: Hash[]): Promise<WithStorageMeta<Payload>[]>;
|
|
43
|
-
protected nextHandler(options?: ArchivistNextOptions): Promise<WithStorageMeta<Payload>[]>;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=ViewArchivist.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ViewArchivist.d.ts","sourceRoot":"","sources":["../../src/ViewArchivist.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAEL,YAAY,EAAE,YAAY,EAAE,YAAY,EACzC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,iBAAiB,EAAqB,MAAM,iCAAiC,CAAA;AACtF,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EACpB,eAAe,EAChB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAEL,kBAAkB,EAInB,MAAM,8BAA8B,CAAA;AACrC,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACf,MAAM,2BAA2B,CAAA;AAKlC,OAAO,KAAK,EACV,OAAO,EAAE,MAAM,EAAE,eAAe,EACjC,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,CAAC,MAAM,UAAU,CAAA;AAE7B,eAAO,MAAM,yBAAyB,EAAE,mCAAmC,GAAG;IAC5E,QAAQ,CAAC,QA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