@xyo-network/archivist-view 2.99.1 → 2.99.3

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 { AbstractArchivist } from '@xyo-network/archivist-abstract';
3
+ import { ArchivistConfig, ArchivistInstance, ArchivistModuleEventData, ArchivistNextOptions } from '@xyo-network/archivist-model';
4
+ import { AnyConfigSchema, ModuleIdentifier, ModuleInstance, ModuleParams } from '@xyo-network/module-model';
5
+ import { PayloadWithMeta, Schema } from '@xyo-network/payload-model';
6
+ export declare const ViewArchivistConfigSchema = "network.xyo.archivist.view.config";
7
+ export type ViewArchivistConfigSchema = typeof ViewArchivistConfigSchema;
8
+ export type ViewArchivistConfig = ArchivistConfig<{
9
+ originArchivist?: ModuleIdentifier;
10
+ }, ViewArchivistConfigSchema>;
11
+ export type ViewArchivistParams<TConfig extends AnyConfigSchema<ViewArchivistConfig> = AnyConfigSchema<ViewArchivistConfig>> = ModuleParams<TConfig>;
12
+ export declare class ViewArchivist<TParams extends ViewArchivistParams<AnyConfigSchema<ViewArchivistConfig>> = ViewArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> implements ArchivistInstance, ModuleInstance {
13
+ static readonly configSchemas: Schema[];
14
+ static readonly defaultConfigSchema: Schema;
15
+ static readonly labels: {
16
+ ModuleLimitationLabelName: string;
17
+ };
18
+ private _originArchivistInstance?;
19
+ get originArchivist(): string;
20
+ get queries(): string[];
21
+ originArchivistInstance(): Promise<ArchivistInstance<import("@xylabs/object").BaseParamsFields & {
22
+ account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
23
+ addToResolvers?: boolean | undefined;
24
+ allowNameResolution?: boolean | undefined;
25
+ config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
26
+ parents?: import("@xyo-network/archivist-model").ArchivistParents | undefined;
27
+ requireAllParents?: boolean | undefined;
28
+ schema: "network.xyo.archivist.config";
29
+ storeParentReads?: boolean | undefined;
30
+ }, "schema"> & {
31
+ schema: "network.xyo.archivist.config";
32
+ }, "schema"> & {
33
+ schema: string;
34
+ };
35
+ ephemeralQueryAccountEnabled?: boolean | undefined;
36
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[] | undefined;
37
+ }, ArchivistModuleEventData, {
38
+ schema: string;
39
+ } & import("@xyo-network/payload-model").PayloadFields>>;
40
+ protected allHandler(): Promise<PayloadWithMeta[]>;
41
+ protected getHandler(hashes: Hash[]): Promise<PayloadWithMeta[]>;
42
+ protected nextHandler(options?: ArchivistNextOptions): Promise<PayloadWithMeta[]>;
43
+ }
44
+ //# sourceMappingURL=ViewArchivist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewArchivist.d.ts","sourceRoot":"","sources":["../../src/ViewArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAEL,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EAGrB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EAEf,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEpE,eAAO,MAAM,yBAAyB,sCAAsC,CAAA;AAC5E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAC/C;IACE,eAAe,CAAC,EAAE,gBAAgB,CAAA;CACnC,EACD,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,eAAe,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,mBAAmB,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;AAEpJ,qBACa,aAAa,CACtB,OAAO,SAAS,mBAAmB,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC,GAAG,mBAAmB,EAC/F,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,CAExE,SAAQ,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAC7C,YAAW,iBAAiB,EAAE,cAAc;IAE5C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAsD;IACtG,gBAAyB,mBAAmB,EAAE,MAAM,CAA4B;IAChF,gBAAyB,MAAM;;MAAmC;IAElE,OAAO,CAAC,wBAAwB,CAAC,CAAmB;IAEpD,IAAI,eAAe,WAElB;IAED,IAAa,OAAO,aAEnB;IAEK,uBAAuB;;;;;;;;;;;;;;;;;;;cAMJ,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;cAIxC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;cAItD,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGjG"}
@@ -0,0 +1,44 @@
1
+ import { Hash } from '@xylabs/hex';
2
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
3
+ import { ArchivistConfig, ArchivistInstance, ArchivistModuleEventData, ArchivistNextOptions } from '@xyo-network/archivist-model';
4
+ import { AnyConfigSchema, ModuleIdentifier, ModuleInstance, ModuleParams } from '@xyo-network/module-model';
5
+ import { PayloadWithMeta, Schema } from '@xyo-network/payload-model';
6
+ export declare const ViewArchivistConfigSchema = "network.xyo.archivist.view.config";
7
+ export type ViewArchivistConfigSchema = typeof ViewArchivistConfigSchema;
8
+ export type ViewArchivistConfig = ArchivistConfig<{
9
+ originArchivist?: ModuleIdentifier;
10
+ }, ViewArchivistConfigSchema>;
11
+ export type ViewArchivistParams<TConfig extends AnyConfigSchema<ViewArchivistConfig> = AnyConfigSchema<ViewArchivistConfig>> = ModuleParams<TConfig>;
12
+ export declare class ViewArchivist<TParams extends ViewArchivistParams<AnyConfigSchema<ViewArchivistConfig>> = ViewArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> implements ArchivistInstance, ModuleInstance {
13
+ static readonly configSchemas: Schema[];
14
+ static readonly defaultConfigSchema: Schema;
15
+ static readonly labels: {
16
+ ModuleLimitationLabelName: string;
17
+ };
18
+ private _originArchivistInstance?;
19
+ get originArchivist(): string;
20
+ get queries(): string[];
21
+ originArchivistInstance(): Promise<ArchivistInstance<import("@xylabs/object").BaseParamsFields & {
22
+ account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
23
+ addToResolvers?: boolean | undefined;
24
+ allowNameResolution?: boolean | undefined;
25
+ config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
26
+ parents?: import("@xyo-network/archivist-model").ArchivistParents | undefined;
27
+ requireAllParents?: boolean | undefined;
28
+ schema: "network.xyo.archivist.config";
29
+ storeParentReads?: boolean | undefined;
30
+ }, "schema"> & {
31
+ schema: "network.xyo.archivist.config";
32
+ }, "schema"> & {
33
+ schema: string;
34
+ };
35
+ ephemeralQueryAccountEnabled?: boolean | undefined;
36
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[] | undefined;
37
+ }, ArchivistModuleEventData, {
38
+ schema: string;
39
+ } & import("@xyo-network/payload-model").PayloadFields>>;
40
+ protected allHandler(): Promise<PayloadWithMeta[]>;
41
+ protected getHandler(hashes: Hash[]): Promise<PayloadWithMeta[]>;
42
+ protected nextHandler(options?: ArchivistNextOptions): Promise<PayloadWithMeta[]>;
43
+ }
44
+ //# sourceMappingURL=ViewArchivist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewArchivist.d.ts","sourceRoot":"","sources":["../../src/ViewArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAEL,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EAGrB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EAEf,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEpE,eAAO,MAAM,yBAAyB,sCAAsC,CAAA;AAC5E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAC/C;IACE,eAAe,CAAC,EAAE,gBAAgB,CAAA;CACnC,EACD,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,eAAe,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,mBAAmB,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;AAEpJ,qBACa,aAAa,CACtB,OAAO,SAAS,mBAAmB,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC,GAAG,mBAAmB,EAC/F,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,CAExE,SAAQ,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAC7C,YAAW,iBAAiB,EAAE,cAAc;IAE5C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAsD;IACtG,gBAAyB,mBAAmB,EAAE,MAAM,CAA4B;IAChF,gBAAyB,MAAM;;MAAmC;IAElE,OAAO,CAAC,wBAAwB,CAAC,CAAmB;IAEpD,IAAI,eAAe,WAElB;IAED,IAAa,OAAO,aAEnB;IAEK,uBAAuB;;;;;;;;;;;;;;;;;;;cAMJ,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;cAIxC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;cAItD,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGjG"}
@@ -0,0 +1,44 @@
1
+ import { Hash } from '@xylabs/hex';
2
+ import { AbstractArchivist } from '@xyo-network/archivist-abstract';
3
+ import { ArchivistConfig, ArchivistInstance, ArchivistModuleEventData, ArchivistNextOptions } from '@xyo-network/archivist-model';
4
+ import { AnyConfigSchema, ModuleIdentifier, ModuleInstance, ModuleParams } from '@xyo-network/module-model';
5
+ import { PayloadWithMeta, Schema } from '@xyo-network/payload-model';
6
+ export declare const ViewArchivistConfigSchema = "network.xyo.archivist.view.config";
7
+ export type ViewArchivistConfigSchema = typeof ViewArchivistConfigSchema;
8
+ export type ViewArchivistConfig = ArchivistConfig<{
9
+ originArchivist?: ModuleIdentifier;
10
+ }, ViewArchivistConfigSchema>;
11
+ export type ViewArchivistParams<TConfig extends AnyConfigSchema<ViewArchivistConfig> = AnyConfigSchema<ViewArchivistConfig>> = ModuleParams<TConfig>;
12
+ export declare class ViewArchivist<TParams extends ViewArchivistParams<AnyConfigSchema<ViewArchivistConfig>> = ViewArchivistParams, TEventData extends ArchivistModuleEventData = ArchivistModuleEventData> extends AbstractArchivist<TParams, TEventData> implements ArchivistInstance, ModuleInstance {
13
+ static readonly configSchemas: Schema[];
14
+ static readonly defaultConfigSchema: Schema;
15
+ static readonly labels: {
16
+ ModuleLimitationLabelName: string;
17
+ };
18
+ private _originArchivistInstance?;
19
+ get originArchivist(): string;
20
+ get queries(): string[];
21
+ originArchivistInstance(): Promise<ArchivistInstance<import("@xylabs/object").BaseParamsFields & {
22
+ account?: import("@xyo-network/account-model").AccountInstance | "random" | undefined;
23
+ addToResolvers?: boolean | undefined;
24
+ allowNameResolution?: boolean | undefined;
25
+ config: import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & Omit<import("@xyo-network/module-model").ArchivingModuleConfig & import("@xyo-network/module-model").ModuleConfigFields & {
26
+ parents?: import("@xyo-network/archivist-model").ArchivistParents | undefined;
27
+ requireAllParents?: boolean | undefined;
28
+ schema: "network.xyo.archivist.config";
29
+ storeParentReads?: boolean | undefined;
30
+ }, "schema"> & {
31
+ schema: "network.xyo.archivist.config";
32
+ }, "schema"> & {
33
+ schema: string;
34
+ };
35
+ ephemeralQueryAccountEnabled?: boolean | undefined;
36
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[] | undefined;
37
+ }, ArchivistModuleEventData, {
38
+ schema: string;
39
+ } & import("@xyo-network/payload-model").PayloadFields>>;
40
+ protected allHandler(): Promise<PayloadWithMeta[]>;
41
+ protected getHandler(hashes: Hash[]): Promise<PayloadWithMeta[]>;
42
+ protected nextHandler(options?: ArchivistNextOptions): Promise<PayloadWithMeta[]>;
43
+ }
44
+ //# sourceMappingURL=ViewArchivist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewArchivist.d.ts","sourceRoot":"","sources":["../../src/ViewArchivist.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AACnE,OAAO,EAEL,eAAe,EACf,iBAAiB,EACjB,wBAAwB,EACxB,oBAAoB,EAGrB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EAEf,gBAAgB,EAChB,cAAc,EAEd,YAAY,EACb,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEpE,eAAO,MAAM,yBAAyB,sCAAsC,CAAA;AAC5E,MAAM,MAAM,yBAAyB,GAAG,OAAO,yBAAyB,CAAA;AAExE,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAC/C;IACE,eAAe,CAAC,EAAE,gBAAgB,CAAA;CACnC,EACD,yBAAyB,CAC1B,CAAA;AAED,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,eAAe,CAAC,mBAAmB,CAAC,GAAG,eAAe,CAAC,mBAAmB,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,CAAA;AAEpJ,qBACa,aAAa,CACtB,OAAO,SAAS,mBAAmB,CAAC,eAAe,CAAC,mBAAmB,CAAC,CAAC,GAAG,mBAAmB,EAC/F,UAAU,SAAS,wBAAwB,GAAG,wBAAwB,CAExE,SAAQ,iBAAiB,CAAC,OAAO,EAAE,UAAU,CAC7C,YAAW,iBAAiB,EAAE,cAAc;IAE5C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAsD;IACtG,gBAAyB,mBAAmB,EAAE,MAAM,CAA4B;IAChF,gBAAyB,MAAM;;MAAmC;IAElE,OAAO,CAAC,wBAAwB,CAAC,CAAmB;IAEpD,IAAI,eAAe,WAElB;IAED,IAAa,OAAO,aAEnB;IAEK,uBAAuB;;;;;;;;;;;;;;;;;;;cAMJ,UAAU,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;cAIxC,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;cAItD,WAAW,CAAC,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;CAGjG"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ ViewArchivist: () => ViewArchivist,
25
+ ViewArchivistConfigSchema: () => ViewArchivistConfigSchema
26
+ });
27
+ module.exports = __toCommonJS(src_exports);
28
+
29
+ // src/ViewArchivist.ts
30
+ var import_assert = require("@xylabs/assert");
31
+ var import_archivist_abstract = require("@xyo-network/archivist-abstract");
32
+ var import_archivist_model = require("@xyo-network/archivist-model");
33
+ var import_module_model = require("@xyo-network/module-model");
34
+ function _ts_decorate(decorators, target, key, desc) {
35
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
36
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
37
+ r = Reflect.decorate(decorators, target, key, desc);
38
+ else
39
+ for (var i = decorators.length - 1; i >= 0; i--)
40
+ if (d = decorators[i])
41
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
42
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
43
+ }
44
+ __name(_ts_decorate, "_ts_decorate");
45
+ var ViewArchivistConfigSchema = "network.xyo.archivist.view.config";
46
+ var ViewArchivist = class extends import_archivist_abstract.AbstractArchivist {
47
+ static {
48
+ __name(this, "ViewArchivist");
49
+ }
50
+ static configSchemas = [
51
+ ...super.configSchemas,
52
+ ViewArchivistConfigSchema
53
+ ];
54
+ static defaultConfigSchema = ViewArchivistConfigSchema;
55
+ static labels = {
56
+ ...import_module_model.ModuleLimitationViewLabel
57
+ };
58
+ _originArchivistInstance;
59
+ get originArchivist() {
60
+ return (0, import_assert.assertEx)(this.config.originArchivist, () => "originArchivist not configured");
61
+ }
62
+ get queries() {
63
+ return [
64
+ import_archivist_model.ArchivistAllQuerySchema,
65
+ import_archivist_model.ArchivistNextQuerySchema,
66
+ ...super.queries
67
+ ];
68
+ }
69
+ async originArchivistInstance() {
70
+ this._originArchivistInstance = this._originArchivistInstance ?? (0, import_assert.assertEx)(await this.resolve(this.originArchivist, {
71
+ identity: import_archivist_model.isArchivistInstance,
72
+ required: true
73
+ }));
74
+ return this._originArchivistInstance;
75
+ }
76
+ async allHandler() {
77
+ return await (await this.originArchivistInstance()).all?.() ?? [];
78
+ }
79
+ async getHandler(hashes) {
80
+ return await (await this.originArchivistInstance()).get(hashes);
81
+ }
82
+ async nextHandler(options) {
83
+ return await (await this.originArchivistInstance()).next?.(options) ?? [];
84
+ }
85
+ };
86
+ ViewArchivist = _ts_decorate([
87
+ (0, import_module_model.labeledCreatableModuleFactory)()
88
+ ], ViewArchivist);
89
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/index.ts","../../src/ViewArchivist.ts"],"sourcesContent":["export * from './ViewArchivist'\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { AbstractArchivist } from '@xyo-network/archivist-abstract'\nimport {\n ArchivistAllQuerySchema,\n ArchivistConfig,\n ArchivistInstance,\n ArchivistModuleEventData,\n ArchivistNextOptions,\n ArchivistNextQuerySchema,\n isArchivistInstance,\n} from '@xyo-network/archivist-model'\nimport {\n AnyConfigSchema,\n labeledCreatableModuleFactory,\n ModuleIdentifier,\n ModuleInstance,\n ModuleLimitationViewLabel,\n ModuleParams,\n} from '@xyo-network/module-model'\nimport { PayloadWithMeta, Schema } from '@xyo-network/payload-model'\n\nexport const ViewArchivistConfigSchema = 'network.xyo.archivist.view.config'\nexport type ViewArchivistConfigSchema = typeof ViewArchivistConfigSchema\n\nexport type ViewArchivistConfig = ArchivistConfig<\n {\n originArchivist?: ModuleIdentifier\n },\n ViewArchivistConfigSchema\n>\n\nexport type ViewArchivistParams<TConfig extends AnyConfigSchema<ViewArchivistConfig> = AnyConfigSchema<ViewArchivistConfig>> = ModuleParams<TConfig>\n\n@labeledCreatableModuleFactory()\nexport class ViewArchivist<\n TParams extends ViewArchivistParams<AnyConfigSchema<ViewArchivistConfig>> = ViewArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n >\n extends AbstractArchivist<TParams, TEventData>\n implements ArchivistInstance, ModuleInstance\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ViewArchivistConfigSchema]\n static override readonly defaultConfigSchema: Schema = ViewArchivistConfigSchema\n static override readonly labels = { ...ModuleLimitationViewLabel }\n\n private _originArchivistInstance?: ArchivistInstance\n\n get originArchivist() {\n return assertEx(this.config.originArchivist, () => 'originArchivist not configured')\n }\n\n override get queries() {\n return [ArchivistAllQuerySchema, ArchivistNextQuerySchema, ...super.queries]\n }\n\n async originArchivistInstance() {\n this._originArchivistInstance =\n this._originArchivistInstance ?? assertEx(await this.resolve(this.originArchivist, { identity: isArchivistInstance, required: true }))\n return this._originArchivistInstance\n }\n\n protected override async allHandler(): Promise<PayloadWithMeta[]> {\n return (await (await this.originArchivistInstance()).all?.()) ?? []\n }\n\n protected override async getHandler(hashes: Hash[]): Promise<PayloadWithMeta[]> {\n return await (await this.originArchivistInstance()).get(hashes)\n }\n\n protected override async nextHandler(options?: ArchivistNextOptions): Promise<PayloadWithMeta[]> {\n return (await (await this.originArchivistInstance()).next?.(options)) ?? []\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;ACAA,oBAAyB;AAEzB,gCAAkC;AAClC,6BAQO;AACP,0BAOO;;;;;;;;;;;;AAGA,IAAMA,4BAA4B;AAalC,IAAMC,gBAAN,cAIGC,4CAAAA;SAAAA;;;EAGR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeH;;EAC5E,OAAyBI,sBAA8BJ;EACvD,OAAyBK,SAAS;IAAE,GAAGC;EAA0B;EAEzDC;EAER,IAAIC,kBAAkB;AACpB,eAAOC,wBAAS,KAAKC,OAAOF,iBAAiB,MAAM,gCAAA;EACrD;EAEA,IAAaG,UAAU;AACrB,WAAO;MAACC;MAAyBC;SAA6B,MAAMF;;EACtE;EAEA,MAAMG,0BAA0B;AAC9B,SAAKP,2BACH,KAAKA,gCAA4BE,wBAAS,MAAM,KAAKM,QAAQ,KAAKP,iBAAiB;MAAEQ,UAAUC;MAAqBC,UAAU;IAAK,CAAA,CAAA;AACrI,WAAO,KAAKX;EACd;EAEA,MAAyBY,aAAyC;AAChE,WAAQ,OAAO,MAAM,KAAKL,wBAAuB,GAAIM,MAAG,KAAS,CAAA;EACnE;EAEA,MAAyBC,WAAWC,QAA4C;AAC9E,WAAO,OAAO,MAAM,KAAKR,wBAAuB,GAAIS,IAAID,MAAAA;EAC1D;EAEA,MAAyBE,YAAYC,SAA4D;AAC/F,WAAQ,OAAO,MAAM,KAAKX,wBAAuB,GAAIY,OAAOD,OAAAA,KAAa,CAAA;EAC3E;AACF;AAtCaxB,gBAAAA,aAAAA;MADZ0B,mDAAAA;GACY1B,aAAAA;","names":["ViewArchivistConfigSchema","ViewArchivist","AbstractArchivist","configSchemas","defaultConfigSchema","labels","ModuleLimitationViewLabel","_originArchivistInstance","originArchivist","assertEx","config","queries","ArchivistAllQuerySchema","ArchivistNextQuerySchema","originArchivistInstance","resolve","identity","isArchivistInstance","required","allHandler","all","getHandler","hashes","get","nextHandler","options","next","labeledCreatableModuleFactory"]}
@@ -0,0 +1,2 @@
1
+ export * from './ViewArchivist';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './ViewArchivist';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,2 @@
1
+ export * from './ViewArchivist';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA"}
@@ -0,0 +1,68 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
4
+ // src/ViewArchivist.ts
5
+ import { assertEx } from "@xylabs/assert";
6
+ import { AbstractArchivist } from "@xyo-network/archivist-abstract";
7
+ import { ArchivistAllQuerySchema, ArchivistNextQuerySchema, isArchivistInstance } from "@xyo-network/archivist-model";
8
+ import { labeledCreatableModuleFactory, ModuleLimitationViewLabel } from "@xyo-network/module-model";
9
+ function _ts_decorate(decorators, target, key, desc) {
10
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
11
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
12
+ r = Reflect.decorate(decorators, target, key, desc);
13
+ else
14
+ for (var i = decorators.length - 1; i >= 0; i--)
15
+ if (d = decorators[i])
16
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
17
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
18
+ }
19
+ __name(_ts_decorate, "_ts_decorate");
20
+ var ViewArchivistConfigSchema = "network.xyo.archivist.view.config";
21
+ var ViewArchivist = class extends AbstractArchivist {
22
+ static {
23
+ __name(this, "ViewArchivist");
24
+ }
25
+ static configSchemas = [
26
+ ...super.configSchemas,
27
+ ViewArchivistConfigSchema
28
+ ];
29
+ static defaultConfigSchema = ViewArchivistConfigSchema;
30
+ static labels = {
31
+ ...ModuleLimitationViewLabel
32
+ };
33
+ _originArchivistInstance;
34
+ get originArchivist() {
35
+ return assertEx(this.config.originArchivist, () => "originArchivist not configured");
36
+ }
37
+ get queries() {
38
+ return [
39
+ ArchivistAllQuerySchema,
40
+ ArchivistNextQuerySchema,
41
+ ...super.queries
42
+ ];
43
+ }
44
+ async originArchivistInstance() {
45
+ this._originArchivistInstance = this._originArchivistInstance ?? assertEx(await this.resolve(this.originArchivist, {
46
+ identity: isArchivistInstance,
47
+ required: true
48
+ }));
49
+ return this._originArchivistInstance;
50
+ }
51
+ async allHandler() {
52
+ return await (await this.originArchivistInstance()).all?.() ?? [];
53
+ }
54
+ async getHandler(hashes) {
55
+ return await (await this.originArchivistInstance()).get(hashes);
56
+ }
57
+ async nextHandler(options) {
58
+ return await (await this.originArchivistInstance()).next?.(options) ?? [];
59
+ }
60
+ };
61
+ ViewArchivist = _ts_decorate([
62
+ labeledCreatableModuleFactory()
63
+ ], ViewArchivist);
64
+ export {
65
+ ViewArchivist,
66
+ ViewArchivistConfigSchema
67
+ };
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ViewArchivist.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { AbstractArchivist } from '@xyo-network/archivist-abstract'\nimport {\n ArchivistAllQuerySchema,\n ArchivistConfig,\n ArchivistInstance,\n ArchivistModuleEventData,\n ArchivistNextOptions,\n ArchivistNextQuerySchema,\n isArchivistInstance,\n} from '@xyo-network/archivist-model'\nimport {\n AnyConfigSchema,\n labeledCreatableModuleFactory,\n ModuleIdentifier,\n ModuleInstance,\n ModuleLimitationViewLabel,\n ModuleParams,\n} from '@xyo-network/module-model'\nimport { PayloadWithMeta, Schema } from '@xyo-network/payload-model'\n\nexport const ViewArchivistConfigSchema = 'network.xyo.archivist.view.config'\nexport type ViewArchivistConfigSchema = typeof ViewArchivistConfigSchema\n\nexport type ViewArchivistConfig = ArchivistConfig<\n {\n originArchivist?: ModuleIdentifier\n },\n ViewArchivistConfigSchema\n>\n\nexport type ViewArchivistParams<TConfig extends AnyConfigSchema<ViewArchivistConfig> = AnyConfigSchema<ViewArchivistConfig>> = ModuleParams<TConfig>\n\n@labeledCreatableModuleFactory()\nexport class ViewArchivist<\n TParams extends ViewArchivistParams<AnyConfigSchema<ViewArchivistConfig>> = ViewArchivistParams,\n TEventData extends ArchivistModuleEventData = ArchivistModuleEventData,\n >\n extends AbstractArchivist<TParams, TEventData>\n implements ArchivistInstance, ModuleInstance\n{\n static override readonly configSchemas: Schema[] = [...super.configSchemas, ViewArchivistConfigSchema]\n static override readonly defaultConfigSchema: Schema = ViewArchivistConfigSchema\n static override readonly labels = { ...ModuleLimitationViewLabel }\n\n private _originArchivistInstance?: ArchivistInstance\n\n get originArchivist() {\n return assertEx(this.config.originArchivist, () => 'originArchivist not configured')\n }\n\n override get queries() {\n return [ArchivistAllQuerySchema, ArchivistNextQuerySchema, ...super.queries]\n }\n\n async originArchivistInstance() {\n this._originArchivistInstance =\n this._originArchivistInstance ?? assertEx(await this.resolve(this.originArchivist, { identity: isArchivistInstance, required: true }))\n return this._originArchivistInstance\n }\n\n protected override async allHandler(): Promise<PayloadWithMeta[]> {\n return (await (await this.originArchivistInstance()).all?.()) ?? []\n }\n\n protected override async getHandler(hashes: Hash[]): Promise<PayloadWithMeta[]> {\n return await (await this.originArchivistInstance()).get(hashes)\n }\n\n protected override async nextHandler(options?: ArchivistNextOptions): Promise<PayloadWithMeta[]> {\n return (await (await this.originArchivistInstance()).next?.(options)) ?? []\n }\n}\n"],"mappings":";;;;AAAA,SAASA,gBAAgB;AAEzB,SAASC,yBAAyB;AAClC,SACEC,yBAKAC,0BACAC,2BACK;AACP,SAEEC,+BAGAC,iCAEK;;;;;;;;;;;;AAGA,IAAMC,4BAA4B;AAalC,IAAMC,gBAAN,cAIGC,kBAAAA;SAAAA;;;EAGR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeH;;EAC5E,OAAyBI,sBAA8BJ;EACvD,OAAyBK,SAAS;IAAE,GAAGC;EAA0B;EAEzDC;EAER,IAAIC,kBAAkB;AACpB,WAAOC,SAAS,KAAKC,OAAOF,iBAAiB,MAAM,gCAAA;EACrD;EAEA,IAAaG,UAAU;AACrB,WAAO;MAACC;MAAyBC;SAA6B,MAAMF;;EACtE;EAEA,MAAMG,0BAA0B;AAC9B,SAAKP,2BACH,KAAKA,4BAA4BE,SAAS,MAAM,KAAKM,QAAQ,KAAKP,iBAAiB;MAAEQ,UAAUC;MAAqBC,UAAU;IAAK,CAAA,CAAA;AACrI,WAAO,KAAKX;EACd;EAEA,MAAyBY,aAAyC;AAChE,WAAQ,OAAO,MAAM,KAAKL,wBAAuB,GAAIM,MAAG,KAAS,CAAA;EACnE;EAEA,MAAyBC,WAAWC,QAA4C;AAC9E,WAAO,OAAO,MAAM,KAAKR,wBAAuB,GAAIS,IAAID,MAAAA;EAC1D;EAEA,MAAyBE,YAAYC,SAA4D;AAC/F,WAAQ,OAAO,MAAM,KAAKX,wBAAuB,GAAIY,OAAOD,OAAAA,KAAa,CAAA;EAC3E;AACF;AAtCaxB,gBAAAA,aAAAA;EADZ0B,8BAAAA;GACY1B,aAAAA;","names":["assertEx","AbstractArchivist","ArchivistAllQuerySchema","ArchivistNextQuerySchema","isArchivistInstance","labeledCreatableModuleFactory","ModuleLimitationViewLabel","ViewArchivistConfigSchema","ViewArchivist","AbstractArchivist","configSchemas","defaultConfigSchema","labels","ModuleLimitationViewLabel","_originArchivistInstance","originArchivist","assertEx","config","queries","ArchivistAllQuerySchema","ArchivistNextQuerySchema","originArchivistInstance","resolve","identity","isArchivistInstance","required","allHandler","all","getHandler","hashes","get","nextHandler","options","next","labeledCreatableModuleFactory"]}
package/package.json CHANGED
@@ -10,20 +10,20 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xylabs/assert": "^3.1.11",
14
- "@xylabs/hex": "^3.1.11",
15
- "@xyo-network/archivist-abstract": "~2.99.1",
16
- "@xyo-network/archivist-model": "~2.99.1",
17
- "@xyo-network/module-model": "~2.99.1",
18
- "@xyo-network/payload-model": "~2.99.1"
13
+ "@xylabs/assert": "^3.3.2",
14
+ "@xylabs/hex": "^3.3.2",
15
+ "@xyo-network/archivist-abstract": "~2.99.3",
16
+ "@xyo-network/archivist-model": "~2.99.3",
17
+ "@xyo-network/module-model": "~2.99.3",
18
+ "@xyo-network/payload-model": "~2.99.3"
19
19
  },
20
20
  "devDependencies": {
21
- "@xylabs/ts-scripts-yarn3": "^3.9.1",
22
- "@xylabs/tsconfig": "^3.9.1",
23
- "@xyo-network/account": "~2.99.1",
24
- "@xyo-network/archivist-memory": "~2.99.1",
25
- "@xyo-network/node-memory": "~2.99.1",
26
- "@xyo-network/payload-builder": "~2.99.1",
21
+ "@xylabs/ts-scripts-yarn3": "^3.10.0",
22
+ "@xylabs/tsconfig": "^3.10.0",
23
+ "@xyo-network/account": "~2.99.3",
24
+ "@xyo-network/archivist-memory": "~2.99.3",
25
+ "@xyo-network/node-memory": "~2.99.3",
26
+ "@xyo-network/payload-builder": "~2.99.3",
27
27
  "typescript": "^5.4.5"
28
28
  },
29
29
  "description": "Primary SDK for using XYO Protocol 2.0",
@@ -65,6 +65,6 @@
65
65
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
66
66
  },
67
67
  "sideEffects": false,
68
- "version": "2.99.1",
68
+ "version": "2.99.3",
69
69
  "type": "module"
70
70
  }