@xyo-network/diviner-indexing-memory 3.9.18 → 3.9.19

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,109 @@
1
+ import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
2
+ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
3
+ import { IndexingDivinerConfig, IndexingDivinerParams, IndexingDivinerStage, IndexingDivinerState } from '@xyo-network/diviner-indexing-model';
4
+ import { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
5
+ import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
6
+ import { ModuleState } from '@xyo-network/module-model';
7
+ import { Payload, Schema } from '@xyo-network/payload-model';
8
+ export type ConfigStoreKey = 'indexStore' | 'stateStore';
9
+ export type ConfigStore = Extract<keyof IndexingDivinerConfig, ConfigStoreKey>;
10
+ export declare class IndexingDiviner<TParams extends IndexingDivinerParams = IndexingDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
11
+ static readonly allowRandomAccount = false;
12
+ static readonly configSchemas: Schema[];
13
+ static readonly defaultConfigSchema: Schema;
14
+ private _lastState?;
15
+ private _pollId?;
16
+ get payloadDivinerLimit(): number;
17
+ get pollFrequency(): number;
18
+ /**
19
+ * Works via batched iteration of the source archivist to populate the index.
20
+ * @returns A promise that resolves when the background process is complete
21
+ */
22
+ protected backgroundDivine: () => Promise<void>;
23
+ /**
24
+ * Commit the internal state of the Diviner process. This is similar
25
+ * to a transaction completion in a database and should only be called
26
+ * when results have been successfully persisted to the appropriate
27
+ * external stores.
28
+ * @param nextState The state to commit
29
+ */
30
+ protected commitState(nextState: ModuleState<IndexingDivinerState>): Promise<void>;
31
+ protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
32
+ /**
33
+ * Retrieves the archivist for the specified store
34
+ * @param store The store to retrieve the archivist for
35
+ * @returns The archivist for the specified store
36
+ */
37
+ protected getArchivistForStore(store: ConfigStore): Promise<ArchivistWrapper<import("@xyo-network/archivist-model").ArchivistModuleInstance<import("@xylabs/object").BaseParamsFields & {
38
+ account?: import("@xyo-network/account-model").AccountInstance | "random";
39
+ addToResolvers?: boolean;
40
+ additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
41
+ allowNameResolution?: boolean;
42
+ config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/archivist-model").ArchivistConfig>;
43
+ ephemeralQueryAccountEnabled?: boolean;
44
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
45
+ privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
46
+ publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
47
+ }, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
48
+ /**
49
+ * Retrieves the BoundWitness Diviner for the specified store
50
+ * @param store The store to retrieve the BoundWitness Diviner for
51
+ * @returns The BoundWitness Diviner for the specified store
52
+ */
53
+ protected getBoundWitnessDivinerForStore(store: ConfigStore): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
54
+ account?: import("@xyo-network/account-model").AccountInstance | "random";
55
+ addToResolvers?: boolean;
56
+ additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
57
+ allowNameResolution?: boolean;
58
+ config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/diviner-model").DivinerConfig>;
59
+ ephemeralQueryAccountEnabled?: boolean;
60
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
61
+ privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
62
+ publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
63
+ }, DivinerModuleEventData>, Payload, Payload>>;
64
+ /**
65
+ * Gets the Diviner for the supplied Indexing Diviner stage
66
+ * @param transform The Indexing Diviner stage
67
+ * @returns The diviner corresponding to the Indexing Diviner stage
68
+ */
69
+ protected getIndexingDivinerStage(transform: IndexingDivinerStage): Promise<DivinerInstance<import("@xylabs/object").BaseParamsFields & {
70
+ account?: import("@xyo-network/account-model").AccountInstance | "random";
71
+ addToResolvers?: boolean;
72
+ additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
73
+ allowNameResolution?: boolean;
74
+ config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/diviner-model").DivinerConfig>;
75
+ ephemeralQueryAccountEnabled?: boolean;
76
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
77
+ privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
78
+ publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
79
+ }, Payload, Payload, DivinerModuleEventData>>;
80
+ /**
81
+ * Retrieves the Payload Diviner for the specified store
82
+ * @param store The store to retrieve the Payload Diviner for
83
+ * @returns The Payload Diviner for the specified store
84
+ */
85
+ protected getPayloadDivinerForStore(store: ConfigStore): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
86
+ account?: import("@xyo-network/account-model").AccountInstance | "random";
87
+ addToResolvers?: boolean;
88
+ additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
89
+ allowNameResolution?: boolean;
90
+ config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/diviner-model").DivinerConfig>;
91
+ ephemeralQueryAccountEnabled?: boolean;
92
+ moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
93
+ privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
94
+ publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
95
+ }, DivinerModuleEventData>, Payload, Payload>>;
96
+ /**
97
+ * Retrieves the last state of the Diviner process. Used to recover state after
98
+ * preemptions, reboots, etc.
99
+ */
100
+ protected retrieveState(): Promise<ModuleState<IndexingDivinerState> | undefined>;
101
+ protected startHandler(): Promise<boolean>;
102
+ protected stopHandler(_timeout?: number | undefined): Promise<boolean>;
103
+ /**
104
+ * Runs the background divine process on a loop with a delay
105
+ * specified by the `config.pollFrequency`
106
+ */
107
+ private poll;
108
+ }
109
+ //# sourceMappingURL=Diviner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EACL,qBAAqB,EAErB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EACc,eAAe,EAAE,sBAAsB,EAC3D,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAC2B,WAAW,EAC5C,MAAM,2BAA2B,CAAA;AAElC,OAAO,EACL,OAAO,EAAE,MAAM,EAChB,MAAM,4BAA4B,CAAA;AAEnC,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,YAAY,CAAA;AAExD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,qBAAqB,EAAE,cAAc,CAAC,CAAA;AAI9E,qBACa,eAAe,CAC1B,OAAO,SAAS,qBAAqB,GAAG,qBAAqB,EAC7D,GAAG,SAAS,OAAO,GAAG,OAAO,EAC7B,IAAI,SAAS,OAAO,GAAG,OAAO,EAC9B,UAAU,SAAS,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,sBAAsB,CAChH,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EACnC,GAAG,EACH,IAAI,CACL,CACD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;IACvD,gBAAyB,kBAAkB,SAAQ;IACnD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAwD;IACxG,gBAAyB,mBAAmB,EAAE,MAAM,CAA8B;IAElF,OAAO,CAAC,UAAU,CAAC,CAAmC;IACtD,OAAO,CAAC,OAAO,CAAC,CAAQ;IAExB,IAAI,mBAAmB,WAEtB;IAED,IAAI,aAAa,WAEhB;IAED;;;OAGG;IACH,SAAS,CAAC,gBAAgB,QAAa,OAAO,CAAC,IAAI,CAAC,CAmBnD;IAED;;;;;;OAMG;cACa,WAAW,CAAC,SAAS,EAAE,WAAW,CAAC,oBAAoB,CAAC;cAS/C,aAAa,CAAC,QAAQ,GAAE,GAAG,EAAO,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC;IAsB7E;;;;OAIG;cACa,oBAAoB,CAAC,KAAK,EAAE,WAAW;;;;;;;;;;;IAMvD;;;;OAIG;cACa,8BAA8B,CAAC,KAAK,EAAE,WAAW;;;;;;;;;;;IAMjE;;;;OAIG;cACa,uBAAuB,CAAC,SAAS,EAAE,oBAAoB;;;;;;;;;;;IASvE;;;;OAIG;cACa,yBAAyB,CAAC,KAAK,EAAE,WAAW;;;;;;;;;;;IAM5D;;;OAGG;cACa,aAAa,IAAI,OAAO,CAAC,WAAW,CAAC,oBAAoB,CAAC,GAAG,SAAS,CAAC;cA0C9D,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC;cAMhC,WAAW,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC;IAQrF;;;OAGG;IACH,OAAO,CAAC,IAAI;CAcb"}
@@ -1,107 +1,2 @@
1
- import * as _xyo_network_diviner_model from '@xyo-network/diviner-model';
2
- import { DivinerModuleEventData, DivinerInstance } from '@xyo-network/diviner-model';
3
- import * as _xyo_network_module_model from '@xyo-network/module-model';
4
- import { ModuleState } from '@xyo-network/module-model';
5
- import * as _xyo_network_archivist_model from '@xyo-network/archivist-model';
6
- import * as _xyo_network_account_model from '@xyo-network/account-model';
7
- import * as _xylabs_object from '@xylabs/object';
8
- import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
9
- import { AbstractDiviner } from '@xyo-network/diviner-abstract';
10
- import { IndexingDivinerConfig, IndexingDivinerParams, IndexingDivinerState, IndexingDivinerStage } from '@xyo-network/diviner-indexing-model';
11
- import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
12
- import { Payload, Schema } from '@xyo-network/payload-model';
13
-
14
- type ConfigStoreKey = 'indexStore' | 'stateStore';
15
- type ConfigStore = Extract<keyof IndexingDivinerConfig, ConfigStoreKey>;
16
- declare class IndexingDiviner<TParams extends IndexingDivinerParams = IndexingDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
17
- static readonly allowRandomAccount = false;
18
- static readonly configSchemas: Schema[];
19
- static readonly defaultConfigSchema: Schema;
20
- private _lastState?;
21
- private _pollId?;
22
- get payloadDivinerLimit(): number;
23
- get pollFrequency(): number;
24
- protected backgroundDivine: () => Promise<void>;
25
- protected commitState(nextState: ModuleState<IndexingDivinerState>): Promise<void>;
26
- protected divineHandler(payloads?: TIn[]): Promise<TOut[]>;
27
- protected getArchivistForStore(store: ConfigStore): Promise<ArchivistWrapper<_xyo_network_archivist_model.ArchivistModuleInstance<_xylabs_object.BaseParamsFields & {
28
- account?: _xyo_network_account_model.AccountInstance | "random";
29
- addToResolvers?: boolean;
30
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
31
- allowNameResolution?: boolean;
32
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_archivist_model.ArchivistConfig<void, void>>;
33
- ephemeralQueryAccountEnabled?: boolean;
34
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
35
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
36
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
37
- }, _xyo_network_archivist_model.ArchivistModuleEventData>>>;
38
- protected getBoundWitnessDivinerForStore(store: ConfigStore): Promise<DivinerWrapper<_xyo_network_diviner_model.DivinerModule<_xylabs_object.BaseParamsFields & {
39
- account?: _xyo_network_account_model.AccountInstance | "random";
40
- addToResolvers?: boolean;
41
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
42
- allowNameResolution?: boolean;
43
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_diviner_model.DivinerConfig<void, void>>;
44
- ephemeralQueryAccountEnabled?: boolean;
45
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
46
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
47
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
48
- }, DivinerModuleEventData<_xyo_network_module_model.ModuleInstance<_xylabs_object.BaseParamsFields & {
49
- account?: _xyo_network_account_model.AccountInstance | "random";
50
- addToResolvers?: boolean;
51
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
52
- allowNameResolution?: boolean;
53
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig<void, void>>;
54
- ephemeralQueryAccountEnabled?: boolean;
55
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
56
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
57
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
58
- }, _xyo_network_module_model.ModuleEventData<object>>, Payload, Payload>>, Payload, Payload>>;
59
- protected getIndexingDivinerStage(transform: IndexingDivinerStage): Promise<DivinerInstance<_xylabs_object.BaseParamsFields & {
60
- account?: _xyo_network_account_model.AccountInstance | "random";
61
- addToResolvers?: boolean;
62
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
63
- allowNameResolution?: boolean;
64
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_diviner_model.DivinerConfig<void, void>>;
65
- ephemeralQueryAccountEnabled?: boolean;
66
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
67
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
68
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
69
- }, Payload, Payload, DivinerModuleEventData<_xyo_network_module_model.ModuleInstance<_xylabs_object.BaseParamsFields & {
70
- account?: _xyo_network_account_model.AccountInstance | "random";
71
- addToResolvers?: boolean;
72
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
73
- allowNameResolution?: boolean;
74
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig<void, void>>;
75
- ephemeralQueryAccountEnabled?: boolean;
76
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
77
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
78
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
79
- }, _xyo_network_module_model.ModuleEventData<object>>, Payload, Payload>>>;
80
- protected getPayloadDivinerForStore(store: ConfigStore): Promise<DivinerWrapper<_xyo_network_diviner_model.DivinerModule<_xylabs_object.BaseParamsFields & {
81
- account?: _xyo_network_account_model.AccountInstance | "random";
82
- addToResolvers?: boolean;
83
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
84
- allowNameResolution?: boolean;
85
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_diviner_model.DivinerConfig<void, void>>;
86
- ephemeralQueryAccountEnabled?: boolean;
87
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
88
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
89
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
90
- }, DivinerModuleEventData<_xyo_network_module_model.ModuleInstance<_xylabs_object.BaseParamsFields & {
91
- account?: _xyo_network_account_model.AccountInstance | "random";
92
- addToResolvers?: boolean;
93
- additionalSigners?: _xyo_network_account_model.AccountInstance[];
94
- allowNameResolution?: boolean;
95
- config: _xyo_network_module_model.AnyConfigSchema<_xyo_network_module_model.ModuleConfig<void, void>>;
96
- ephemeralQueryAccountEnabled?: boolean;
97
- moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
98
- privateChildren?: _xyo_network_module_model.ModuleInstance[];
99
- publicChildren?: _xyo_network_module_model.ModuleInstance[];
100
- }, _xyo_network_module_model.ModuleEventData<object>>, Payload, Payload>>, Payload, Payload>>;
101
- protected retrieveState(): Promise<ModuleState<IndexingDivinerState> | undefined>;
102
- protected startHandler(): Promise<boolean>;
103
- protected stopHandler(_timeout?: number | undefined): Promise<boolean>;
104
- private poll;
105
- }
106
-
107
- export { type ConfigStore, type ConfigStoreKey, IndexingDiviner };
1
+ export * from './Diviner.ts';
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,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/diviner-indexing-memory",
3
- "version": "3.9.18",
3
+ "version": "3.9.19",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -32,22 +32,22 @@
32
32
  "@xylabs/assert": "^4.5.1",
33
33
  "@xylabs/hex": "^4.5.1",
34
34
  "@xylabs/timer": "^4.5.1",
35
- "@xyo-network/archivist-wrapper": "^3.9.18",
36
- "@xyo-network/boundwitness-builder": "^3.9.18",
37
- "@xyo-network/boundwitness-model": "^3.9.18",
38
- "@xyo-network/diviner-abstract": "^3.9.18",
39
- "@xyo-network/diviner-boundwitness-model": "^3.9.18",
40
- "@xyo-network/diviner-indexing-model": "^3.9.18",
41
- "@xyo-network/diviner-model": "^3.9.18",
42
- "@xyo-network/diviner-wrapper": "^3.9.18",
43
- "@xyo-network/module-model": "^3.9.18",
44
- "@xyo-network/payload-builder": "^3.9.18",
45
- "@xyo-network/payload-model": "^3.9.18"
35
+ "@xyo-network/archivist-wrapper": "^3.9.19",
36
+ "@xyo-network/boundwitness-builder": "^3.9.19",
37
+ "@xyo-network/boundwitness-model": "^3.9.19",
38
+ "@xyo-network/diviner-abstract": "^3.9.19",
39
+ "@xyo-network/diviner-boundwitness-model": "^3.9.19",
40
+ "@xyo-network/diviner-indexing-model": "^3.9.19",
41
+ "@xyo-network/diviner-model": "^3.9.19",
42
+ "@xyo-network/diviner-wrapper": "^3.9.19",
43
+ "@xyo-network/module-model": "^3.9.19",
44
+ "@xyo-network/payload-builder": "^3.9.19",
45
+ "@xyo-network/payload-model": "^3.9.19"
46
46
  },
47
47
  "devDependencies": {
48
- "@xylabs/ts-scripts-yarn3": "^5.0.25",
49
- "@xylabs/tsconfig": "^5.0.25",
50
- "typescript": "^5.7.3"
48
+ "@xylabs/ts-scripts-yarn3": "^5.0.39",
49
+ "@xylabs/tsconfig": "^5.0.39",
50
+ "typescript": "^5.8.2"
51
51
  },
52
52
  "publishConfig": {
53
53
  "access": "public"