@xyo-network/diviner-stateful 2.111.2 → 3.0.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 +514 -6
- package/package.json +27 -46
- package/xy.config.ts +12 -0
- package/dist/browser/Config.d.cts +0 -13
- package/dist/browser/Config.d.cts.map +0 -1
- package/dist/browser/Config.d.mts +0 -13
- package/dist/browser/Config.d.mts.map +0 -1
- package/dist/browser/Config.d.ts +0 -13
- package/dist/browser/Config.d.ts.map +0 -1
- package/dist/browser/Diviner.d.cts +0 -72
- package/dist/browser/Diviner.d.cts.map +0 -1
- package/dist/browser/Diviner.d.mts +0 -72
- package/dist/browser/Diviner.d.mts.map +0 -1
- package/dist/browser/Diviner.d.ts +0 -72
- package/dist/browser/Diviner.d.ts.map +0 -1
- package/dist/browser/DivinerMixin.d.cts +0 -385
- package/dist/browser/DivinerMixin.d.cts.map +0 -1
- package/dist/browser/DivinerMixin.d.mts +0 -385
- package/dist/browser/DivinerMixin.d.mts.map +0 -1
- package/dist/browser/DivinerMixin.d.ts +0 -385
- package/dist/browser/DivinerMixin.d.ts.map +0 -1
- package/dist/browser/Params.d.cts +0 -5
- package/dist/browser/Params.d.cts.map +0 -1
- package/dist/browser/Params.d.mts +0 -5
- package/dist/browser/Params.d.mts.map +0 -1
- package/dist/browser/Params.d.ts +0 -5
- package/dist/browser/Params.d.ts.map +0 -1
- package/dist/browser/Schema.d.cts +0 -3
- package/dist/browser/Schema.d.cts.map +0 -1
- package/dist/browser/Schema.d.mts +0 -3
- package/dist/browser/Schema.d.mts.map +0 -1
- package/dist/browser/Schema.d.ts +0 -3
- package/dist/browser/Schema.d.ts.map +0 -1
- package/dist/browser/index.cjs +0 -263
- package/dist/browser/index.cjs.map +0 -1
- package/dist/browser/index.d.cts +0 -6
- package/dist/browser/index.d.cts.map +0 -1
- package/dist/browser/index.d.mts +0 -6
- package/dist/browser/index.d.mts.map +0 -1
- package/dist/browser/index.d.ts +0 -6
- package/dist/browser/index.d.ts.map +0 -1
- package/dist/browser/index.mjs +0 -242
- package/dist/browser/index.mjs.map +0 -1
- package/dist/neutral/Config.d.cts +0 -13
- package/dist/neutral/Config.d.cts.map +0 -1
- package/dist/neutral/Config.d.mts +0 -13
- package/dist/neutral/Config.d.mts.map +0 -1
- package/dist/neutral/Config.d.ts +0 -13
- package/dist/neutral/Config.d.ts.map +0 -1
- package/dist/neutral/Diviner.d.cts +0 -72
- package/dist/neutral/Diviner.d.cts.map +0 -1
- package/dist/neutral/Diviner.d.mts +0 -72
- package/dist/neutral/Diviner.d.mts.map +0 -1
- package/dist/neutral/Diviner.d.ts +0 -72
- package/dist/neutral/Diviner.d.ts.map +0 -1
- package/dist/neutral/DivinerMixin.d.cts +0 -385
- package/dist/neutral/DivinerMixin.d.cts.map +0 -1
- package/dist/neutral/DivinerMixin.d.mts +0 -385
- package/dist/neutral/DivinerMixin.d.mts.map +0 -1
- package/dist/neutral/DivinerMixin.d.ts +0 -385
- package/dist/neutral/DivinerMixin.d.ts.map +0 -1
- package/dist/neutral/Params.d.cts +0 -5
- package/dist/neutral/Params.d.cts.map +0 -1
- package/dist/neutral/Params.d.mts +0 -5
- package/dist/neutral/Params.d.mts.map +0 -1
- package/dist/neutral/Params.d.ts +0 -5
- package/dist/neutral/Params.d.ts.map +0 -1
- package/dist/neutral/Schema.d.cts +0 -3
- package/dist/neutral/Schema.d.cts.map +0 -1
- package/dist/neutral/Schema.d.mts +0 -3
- package/dist/neutral/Schema.d.mts.map +0 -1
- package/dist/neutral/Schema.d.ts +0 -3
- package/dist/neutral/Schema.d.ts.map +0 -1
- package/dist/neutral/index.cjs +0 -263
- package/dist/neutral/index.cjs.map +0 -1
- package/dist/neutral/index.d.cts +0 -6
- package/dist/neutral/index.d.cts.map +0 -1
- package/dist/neutral/index.d.mts +0 -6
- package/dist/neutral/index.d.mts.map +0 -1
- package/dist/neutral/index.d.ts.map +0 -1
- package/dist/node/Config.d.cts +0 -13
- package/dist/node/Config.d.cts.map +0 -1
- package/dist/node/Config.d.mts +0 -13
- package/dist/node/Config.d.mts.map +0 -1
- package/dist/node/Config.d.ts +0 -13
- package/dist/node/Config.d.ts.map +0 -1
- package/dist/node/Diviner.d.cts +0 -72
- package/dist/node/Diviner.d.cts.map +0 -1
- package/dist/node/Diviner.d.mts +0 -72
- package/dist/node/Diviner.d.mts.map +0 -1
- package/dist/node/Diviner.d.ts +0 -72
- package/dist/node/Diviner.d.ts.map +0 -1
- package/dist/node/DivinerMixin.d.cts +0 -385
- package/dist/node/DivinerMixin.d.cts.map +0 -1
- package/dist/node/DivinerMixin.d.mts +0 -385
- package/dist/node/DivinerMixin.d.mts.map +0 -1
- package/dist/node/DivinerMixin.d.ts +0 -385
- package/dist/node/DivinerMixin.d.ts.map +0 -1
- package/dist/node/Params.d.cts +0 -5
- package/dist/node/Params.d.cts.map +0 -1
- package/dist/node/Params.d.mts +0 -5
- package/dist/node/Params.d.mts.map +0 -1
- package/dist/node/Params.d.ts +0 -5
- package/dist/node/Params.d.ts.map +0 -1
- package/dist/node/Schema.d.cts +0 -3
- package/dist/node/Schema.d.cts.map +0 -1
- package/dist/node/Schema.d.mts +0 -3
- package/dist/node/Schema.d.mts.map +0 -1
- package/dist/node/Schema.d.ts +0 -3
- package/dist/node/Schema.d.ts.map +0 -1
- package/dist/node/index.cjs +0 -286
- package/dist/node/index.cjs.map +0 -1
- package/dist/node/index.d.cts +0 -6
- package/dist/node/index.d.cts.map +0 -1
- package/dist/node/index.d.mts +0 -6
- package/dist/node/index.d.mts.map +0 -1
- package/dist/node/index.d.ts +0 -6
- package/dist/node/index.d.ts.map +0 -1
- package/dist/node/index.mjs +0 -258
- package/dist/node/index.mjs.map +0 -1
package/dist/neutral/index.cjs
DELETED
|
@@ -1,263 +0,0 @@
|
|
|
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
|
-
StatefulDiviner: () => StatefulDiviner,
|
|
25
|
-
StatefulDivinerConfigSchema: () => StatefulDivinerConfigSchema,
|
|
26
|
-
StatefulDivinerSchema: () => StatefulDivinerSchema,
|
|
27
|
-
StatefulModuleMixin: () => StatefulModuleMixin
|
|
28
|
-
});
|
|
29
|
-
module.exports = __toCommonJS(src_exports);
|
|
30
|
-
|
|
31
|
-
// src/Schema.ts
|
|
32
|
-
var StatefulDivinerSchema = "network.xyo.diviner.stateful";
|
|
33
|
-
|
|
34
|
-
// src/Config.ts
|
|
35
|
-
var StatefulDivinerConfigSchema = `${StatefulDivinerSchema}.config`;
|
|
36
|
-
|
|
37
|
-
// src/Diviner.ts
|
|
38
|
-
var import_assert = require("@xylabs/assert");
|
|
39
|
-
var import_archivist_wrapper = require("@xyo-network/archivist-wrapper");
|
|
40
|
-
var import_boundwitness_builder = require("@xyo-network/boundwitness-builder");
|
|
41
|
-
var import_boundwitness_model = require("@xyo-network/boundwitness-model");
|
|
42
|
-
var import_diviner_abstract = require("@xyo-network/diviner-abstract");
|
|
43
|
-
var import_diviner_boundwitness_model = require("@xyo-network/diviner-boundwitness-model");
|
|
44
|
-
var import_diviner_wrapper = require("@xyo-network/diviner-wrapper");
|
|
45
|
-
var import_module_model = require("@xyo-network/module-model");
|
|
46
|
-
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
47
|
-
var moduleName = "StatefulDiviner";
|
|
48
|
-
var StatefulDiviner = class extends import_diviner_abstract.AbstractDiviner {
|
|
49
|
-
static {
|
|
50
|
-
__name(this, "StatefulDiviner");
|
|
51
|
-
}
|
|
52
|
-
static configSchemas = [
|
|
53
|
-
...super.configSchemas,
|
|
54
|
-
StatefulDivinerConfigSchema
|
|
55
|
-
];
|
|
56
|
-
static defaultConfigSchema = StatefulDivinerConfigSchema;
|
|
57
|
-
/**
|
|
58
|
-
* The last state
|
|
59
|
-
*/
|
|
60
|
-
_lastState;
|
|
61
|
-
/**
|
|
62
|
-
* Commit the internal state of the Diviner process. This is similar
|
|
63
|
-
* to a transaction completion in a database and should only be called
|
|
64
|
-
* when results have been successfully persisted to the appropriate
|
|
65
|
-
* external stores.
|
|
66
|
-
* @param nextState The state to commit
|
|
67
|
-
*/
|
|
68
|
-
async commitState(nextState) {
|
|
69
|
-
if (nextState.state.offset === this._lastState?.state.offset) return;
|
|
70
|
-
this._lastState = nextState;
|
|
71
|
-
const archivist = await this.getArchivistForStateStore();
|
|
72
|
-
const [bw] = await new import_boundwitness_builder.BoundWitnessBuilder().payload(nextState).signer(this.account).build();
|
|
73
|
-
await archivist.insert([
|
|
74
|
-
bw,
|
|
75
|
-
nextState
|
|
76
|
-
]);
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Retrieves the archivist for the specified store
|
|
80
|
-
* @param store The store to retrieve the archivist for
|
|
81
|
-
* @returns The archivist for the specified store
|
|
82
|
-
*/
|
|
83
|
-
async getArchivistForStateStore() {
|
|
84
|
-
const name = (0, import_assert.assertEx)(this.config?.stateStore.archivist, () => `${moduleName}: Config for stateStore.archivist not specified`);
|
|
85
|
-
const mod = (0, import_assert.assertEx)(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.archivist`);
|
|
86
|
-
return import_archivist_wrapper.ArchivistWrapper.wrap(mod, this.account);
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Retrieves the BoundWitness Diviner for the specified store
|
|
90
|
-
* @param store The store to retrieve the BoundWitness Diviner for
|
|
91
|
-
* @returns The BoundWitness Diviner for the specified store
|
|
92
|
-
*/
|
|
93
|
-
async getBoundWitnessDivinerForStateStore() {
|
|
94
|
-
const name = (0, import_assert.assertEx)(this.config?.stateStore.boundWitnessDiviner, () => `${moduleName}: Config for stateStore.boundWitnessDiviner not specified`);
|
|
95
|
-
const mod = (0, import_assert.assertEx)(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.boundWitnessDiviner`);
|
|
96
|
-
return import_diviner_wrapper.DivinerWrapper.wrap(mod, this.account);
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Retrieves the Payload Diviner for the specified store
|
|
100
|
-
* @param store The store to retrieve the Payload Diviner for
|
|
101
|
-
* @returns The Payload Diviner for the specified store
|
|
102
|
-
*/
|
|
103
|
-
async getPayloadDivinerForStateStore() {
|
|
104
|
-
const name = (0, import_assert.assertEx)(this.config?.stateStore?.payloadDiviner, () => `${moduleName}: Config for stateStore.payloadDiviner not specified`);
|
|
105
|
-
const mod = (0, import_assert.assertEx)(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.payloadDiviner`);
|
|
106
|
-
return import_diviner_wrapper.DivinerWrapper.wrap(mod, this.account);
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Retrieves the last state of the Diviner process. Used to recover state after
|
|
110
|
-
* preemptions, reboots, etc.
|
|
111
|
-
*/
|
|
112
|
-
async retrieveState() {
|
|
113
|
-
if (this._lastState) return this._lastState;
|
|
114
|
-
let hash = "";
|
|
115
|
-
const diviner = await this.getBoundWitnessDivinerForStateStore();
|
|
116
|
-
const query = await new import_payload_builder.PayloadBuilder({
|
|
117
|
-
schema: import_diviner_boundwitness_model.BoundWitnessDivinerQuerySchema
|
|
118
|
-
}).fields({
|
|
119
|
-
address: this.account.address,
|
|
120
|
-
limit: 1,
|
|
121
|
-
offset: 0,
|
|
122
|
-
order: "desc",
|
|
123
|
-
payload_schemas: [
|
|
124
|
-
import_module_model.ModuleStateSchema
|
|
125
|
-
]
|
|
126
|
-
}).build();
|
|
127
|
-
const boundWitnesses = await diviner.divine([
|
|
128
|
-
query
|
|
129
|
-
]);
|
|
130
|
-
if (boundWitnesses.length > 0) {
|
|
131
|
-
const boundWitness = boundWitnesses[0];
|
|
132
|
-
if ((0, import_boundwitness_model.isBoundWitness)(boundWitness)) {
|
|
133
|
-
hash = boundWitness.addresses.map((address, index) => ({
|
|
134
|
-
address,
|
|
135
|
-
index
|
|
136
|
-
})).filter(({ address }) => address === this.account.address).reduce((prev, curr) => boundWitness.payload_schemas?.[curr?.index] === import_module_model.ModuleStateSchema ? boundWitness.payload_hashes[curr?.index] : prev, "");
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (hash) {
|
|
140
|
-
const archivist = await this.getArchivistForStateStore();
|
|
141
|
-
const payload = (await archivist.get([
|
|
142
|
-
hash
|
|
143
|
-
])).find(import_module_model.isModuleState);
|
|
144
|
-
if (payload) {
|
|
145
|
-
return payload;
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
return void 0;
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
// src/DivinerMixin.ts
|
|
153
|
-
var import_assert2 = require("@xylabs/assert");
|
|
154
|
-
var import_archivist_model = require("@xyo-network/archivist-model");
|
|
155
|
-
var import_boundwitness_builder2 = require("@xyo-network/boundwitness-builder");
|
|
156
|
-
var import_boundwitness_model2 = require("@xyo-network/boundwitness-model");
|
|
157
|
-
var import_diviner_boundwitness_model2 = require("@xyo-network/diviner-boundwitness-model");
|
|
158
|
-
var import_diviner_model = require("@xyo-network/diviner-model");
|
|
159
|
-
var import_module_model2 = require("@xyo-network/module-model");
|
|
160
|
-
var import_payload_builder2 = require("@xyo-network/payload-builder");
|
|
161
|
-
var moduleName2 = "StatefulModuleMixin";
|
|
162
|
-
var StatefulModuleMixin = /* @__PURE__ */ __name((ModuleBase) => {
|
|
163
|
-
let StatefulModuleBase = class StatefulModuleBase extends ModuleBase {
|
|
164
|
-
static {
|
|
165
|
-
__name(this, "StatefulModuleBase");
|
|
166
|
-
}
|
|
167
|
-
_lastState;
|
|
168
|
-
/**
|
|
169
|
-
* Commit the internal state of the Diviner process. This is similar
|
|
170
|
-
* to a transaction completion in a database and should only be called
|
|
171
|
-
* when results have been successfully persisted to the appropriate
|
|
172
|
-
* external stores.
|
|
173
|
-
* @param nextState The state to commit
|
|
174
|
-
*/
|
|
175
|
-
async commitState(nextState) {
|
|
176
|
-
if (nextState.state.offset === this._lastState?.state.offset) return;
|
|
177
|
-
this._lastState = nextState;
|
|
178
|
-
const archivist = await this.getArchivistForStore();
|
|
179
|
-
const [bw] = await (await new import_boundwitness_builder2.BoundWitnessBuilder().payload(nextState)).build();
|
|
180
|
-
await archivist.insert([
|
|
181
|
-
bw,
|
|
182
|
-
nextState
|
|
183
|
-
]);
|
|
184
|
-
}
|
|
185
|
-
/**
|
|
186
|
-
* Retrieves the archivist for the specified store
|
|
187
|
-
* @param store The store to retrieve the archivist for
|
|
188
|
-
* @returns The archivist for the specified store
|
|
189
|
-
*/
|
|
190
|
-
async getArchivistForStore() {
|
|
191
|
-
const name = (0, import_assert2.assertEx)(this.config?.stateStore?.archivist, () => `${moduleName2}: Config for stateStore.archivist not specified`);
|
|
192
|
-
const mod = (0, import_assert2.assertEx)(await this.resolve(name), () => `${moduleName2}: Failed to resolve stateStore.archivist`);
|
|
193
|
-
const instance = (0, import_archivist_model.asArchivistInstance)(mod);
|
|
194
|
-
return (0, import_assert2.assertEx)(instance, () => `${moduleName2}: Failed to wrap archivist instance`);
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Retrieves the BoundWitness Diviner for the specified store
|
|
198
|
-
* @param store The store to retrieve the BoundWitness Diviner for
|
|
199
|
-
* @returns The BoundWitness Diviner for the specified store
|
|
200
|
-
*/
|
|
201
|
-
async getBoundWitnessDivinerForStore() {
|
|
202
|
-
const name = (0, import_assert2.assertEx)(this.config?.stateStore?.boundWitnessDiviner, () => `${moduleName2}: Config for stateStore.boundWitnessDiviner not specified`);
|
|
203
|
-
const mod = (0, import_assert2.assertEx)(await this.resolve(name), () => `${moduleName2}: Failed to resolve stateStore.boundWitnessDiviner`);
|
|
204
|
-
const instance = (0, import_diviner_model.asDivinerInstance)(mod);
|
|
205
|
-
return (0, import_assert2.assertEx)(instance, () => `${moduleName2}: Failed to wrap diviner instance`);
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Retrieves the Payload Diviner for the specified store
|
|
209
|
-
* @param store The store to retrieve the Payload Diviner for
|
|
210
|
-
* @returns The Payload Diviner for the specified store
|
|
211
|
-
*/
|
|
212
|
-
async getPayloadDivinerForStateStore() {
|
|
213
|
-
const name = (0, import_assert2.assertEx)(this.config?.stateStore?.payloadDiviner, () => `${moduleName2}: Config for stateStore.payloadDiviner not specified`);
|
|
214
|
-
const mod = (0, import_assert2.assertEx)(await this.resolve(name), () => `${moduleName2}: Failed to resolve stateStore.payloadDiviner`);
|
|
215
|
-
const instance = (0, import_diviner_model.asDivinerInstance)(mod);
|
|
216
|
-
return (0, import_assert2.assertEx)(instance, () => `${moduleName2}: Failed to wrap diviner instance`);
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Retrieves the last state of the Diviner process. Used to recover state after
|
|
220
|
-
* preemptions, reboots, etc.
|
|
221
|
-
*/
|
|
222
|
-
async retrieveState() {
|
|
223
|
-
if (this._lastState) return this._lastState;
|
|
224
|
-
let hash = "";
|
|
225
|
-
const diviner = await this.getBoundWitnessDivinerForStore();
|
|
226
|
-
const query = await new import_payload_builder2.PayloadBuilder({
|
|
227
|
-
schema: import_diviner_boundwitness_model2.BoundWitnessDivinerQuerySchema
|
|
228
|
-
}).fields({
|
|
229
|
-
// address: this.account.address,
|
|
230
|
-
limit: 1,
|
|
231
|
-
offset: 0,
|
|
232
|
-
order: "desc",
|
|
233
|
-
payload_schemas: [
|
|
234
|
-
import_module_model2.ModuleStateSchema
|
|
235
|
-
]
|
|
236
|
-
}).build();
|
|
237
|
-
const boundWitnesses = await diviner.divine([
|
|
238
|
-
query
|
|
239
|
-
]);
|
|
240
|
-
if (boundWitnesses.length > 0) {
|
|
241
|
-
const boundWitness = boundWitnesses[0];
|
|
242
|
-
if ((0, import_boundwitness_model2.isBoundWitness)(boundWitness)) {
|
|
243
|
-
hash = boundWitness.addresses.map((address, index) => ({
|
|
244
|
-
address,
|
|
245
|
-
index
|
|
246
|
-
})).reduce((prev, curr) => boundWitness.payload_schemas?.[curr?.index] === import_module_model2.ModuleStateSchema ? boundWitness.payload_hashes[curr?.index] : prev, "");
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
if (hash) {
|
|
250
|
-
const archivist = await this.getArchivistForStore();
|
|
251
|
-
const payload = (await archivist.get([
|
|
252
|
-
hash
|
|
253
|
-
])).find(import_module_model2.isModuleState);
|
|
254
|
-
if (payload) {
|
|
255
|
-
return payload;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
return void 0;
|
|
259
|
-
}
|
|
260
|
-
};
|
|
261
|
-
return StatefulModuleBase;
|
|
262
|
-
}, "StatefulModuleMixin");
|
|
263
|
-
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts","../../src/DivinerMixin.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './Diviner.ts'\nexport * from './DivinerMixin.ts'\nexport * from './Params.ts'\nexport * from './Schema.ts'\n","export const StatefulDivinerSchema = 'network.xyo.diviner.stateful' as const\nexport type StatefulDivinerSchema = typeof StatefulDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\nimport { ModuleIdentifier } from '@xyo-network/module-model'\n\nimport { StatefulDivinerSchema } from './Schema.ts'\n\n/**\n * The schema for a Stateful Diviner config\n */\nexport const StatefulDivinerConfigSchema = `${StatefulDivinerSchema}.config` as const\n/**\n * The schema for a Stateful Diviner config\n */\nexport type StatefulDivinerConfigSchema = typeof StatefulDivinerConfigSchema\n\n/**\n * The config for a Stateful Diviner\n */\nexport type StatefulDivinerConfig = DivinerConfig<{\n schema: StatefulDivinerConfigSchema\n stateStore: {\n archivist: ModuleIdentifier\n boundWitnessDiviner: ModuleIdentifier\n payloadDiviner: ModuleIdentifier\n }\n}>\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { ArchivistWrapper } from '@xyo-network/archivist-wrapper'\nimport { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { BoundWitnessDivinerQueryPayload, BoundWitnessDivinerQuerySchema } from '@xyo-network/diviner-boundwitness-model'\nimport { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport { DivinerWrapper } from '@xyo-network/diviner-wrapper'\nimport { isModuleState, ModuleState, ModuleStateSchema, StateDictionary } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, Schema, WithMeta } from '@xyo-network/payload-model'\n\nimport { StatefulDivinerConfigSchema } from './Config.ts'\nimport { StatefulDivinerParams } from './Params.ts'\n\nconst moduleName = 'StatefulDiviner'\n\n/**\n * A Diviner that maintains state\n */\nexport abstract class StatefulDiviner<\n TParams extends StatefulDivinerParams = StatefulDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n TState extends StateDictionary = StateDictionary,\n> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, StatefulDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = StatefulDivinerConfigSchema\n\n /**\n * The last state\n */\n protected _lastState?: WithMeta<ModuleState<TState>>\n\n /**\n * Commit the internal state of the Diviner process. This is similar\n * to a transaction completion in a database and should only be called\n * when results have been successfully persisted to the appropriate\n * external stores.\n * @param nextState The state to commit\n */\n protected async commitState(nextState: WithMeta<ModuleState<TState>>) {\n // Don't commit state if no state has changed\n if (nextState.state.offset === this._lastState?.state.offset) return\n this._lastState = nextState\n const archivist = await this.getArchivistForStateStore()\n const [bw] = await new BoundWitnessBuilder().payload(nextState).signer(this.account).build()\n await archivist.insert([bw, nextState])\n }\n\n /**\n * Retrieves the archivist for the specified store\n * @param store The store to retrieve the archivist for\n * @returns The archivist for the specified store\n */\n protected async getArchivistForStateStore() {\n const name = assertEx(this.config?.stateStore.archivist, () => `${moduleName}: Config for stateStore.archivist not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.archivist`)\n return ArchivistWrapper.wrap(mod, this.account)\n }\n\n /**\n * Retrieves the BoundWitness Diviner for the specified store\n * @param store The store to retrieve the BoundWitness Diviner for\n * @returns The BoundWitness Diviner for the specified store\n */\n protected async getBoundWitnessDivinerForStateStore() {\n const name = assertEx(this.config?.stateStore.boundWitnessDiviner, () => `${moduleName}: Config for stateStore.boundWitnessDiviner not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.boundWitnessDiviner`)\n return DivinerWrapper.wrap(mod, this.account)\n }\n\n /**\n * Retrieves the Payload Diviner for the specified store\n * @param store The store to retrieve the Payload Diviner for\n * @returns The Payload Diviner for the specified store\n */\n protected async getPayloadDivinerForStateStore() {\n const name = assertEx(this.config?.stateStore?.payloadDiviner, () => `${moduleName}: Config for stateStore.payloadDiviner not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.payloadDiviner`)\n return DivinerWrapper.wrap(mod, this.account)\n }\n\n /**\n * Retrieves the last state of the Diviner process. Used to recover state after\n * preemptions, reboots, etc.\n */\n protected async retrieveState(): Promise<WithMeta<ModuleState<TState>> | undefined> {\n if (this._lastState) return this._lastState\n let hash: Hash = ''\n const diviner = await this.getBoundWitnessDivinerForStateStore()\n const query = await new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })\n .fields({\n address: this.account.address,\n limit: 1,\n offset: 0,\n order: 'desc',\n payload_schemas: [ModuleStateSchema],\n })\n .build()\n const boundWitnesses = await diviner.divine([query])\n if (boundWitnesses.length > 0) {\n const boundWitness = boundWitnesses[0]\n if (isBoundWitness(boundWitness)) {\n // Find the index for this address in the BoundWitness that is a ModuleState\n hash = boundWitness.addresses\n .map((address, index) => ({ address, index }))\n .filter(({ address }) => address === this.account.address)\n // eslint-disable-next-line unicorn/no-array-reduce\n .reduce(\n (prev, curr) => (boundWitness.payload_schemas?.[curr?.index] === ModuleStateSchema ? boundWitness.payload_hashes[curr?.index] : prev),\n '' as Hash,\n )\n }\n }\n\n // If we able to located the last state\n if (hash) {\n // Get last state\n const archivist = await this.getArchivistForStateStore()\n const payload = (await archivist.get([hash])).find(isModuleState<TState>)\n if (payload) {\n return payload as WithMeta<ModuleState<TState>>\n }\n }\n return undefined\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { Hash } from '@xylabs/hex'\nimport { asArchivistInstance } from '@xyo-network/archivist-model'\nimport { BoundWitnessBuilder } from '@xyo-network/boundwitness-builder'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessDivinerQueryPayload, BoundWitnessDivinerQuerySchema } from '@xyo-network/diviner-boundwitness-model'\nimport { asDivinerInstance } from '@xyo-network/diviner-model'\nimport {\n AnyConfigSchema,\n isModuleState,\n ModuleInstance,\n ModuleParams,\n ModuleState,\n ModuleStateSchema,\n StateDictionary,\n} from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { StatefulDivinerConfig } from './Config.ts'\n\nexport type StatefulModuleParams = ModuleParams<AnyConfigSchema<StatefulDivinerConfig>>\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type AnyModule<TParams extends StatefulModuleParams = StatefulModuleParams> = new (...args: any[]) => ModuleInstance<TParams>\n\nconst moduleName = 'StatefulModuleMixin'\n\n/**\n * @ignore Inherit from StatefulDiviner instead\n * @param ModuleBase\n * @returns\n */\nexport const StatefulModuleMixin = <\n TParams extends StatefulModuleParams = StatefulModuleParams,\n TModule extends AnyModule<TParams> = AnyModule<TParams>,\n TState extends StateDictionary = StateDictionary,\n>(\n ModuleBase: TModule,\n) => {\n abstract class StatefulModuleBase extends ModuleBase {\n _lastState?: WithMeta<ModuleState<TState>>\n\n /**\n * Commit the internal state of the Diviner process. This is similar\n * to a transaction completion in a database and should only be called\n * when results have been successfully persisted to the appropriate\n * external stores.\n * @param nextState The state to commit\n */\n async commitState(nextState: WithMeta<ModuleState<TState>>) {\n // Don't commit state if no state has changed\n if (nextState.state.offset === this._lastState?.state.offset) return\n this._lastState = nextState\n const archivist = await this.getArchivistForStore()\n // const [bw] = await new BoundWitnessBuilder().payload(nextState).signer(this.account).build()\n const [bw] = await (await new BoundWitnessBuilder().payload(nextState)).build()\n await archivist.insert([bw, nextState])\n }\n\n /**\n * Retrieves the archivist for the specified store\n * @param store The store to retrieve the archivist for\n * @returns The archivist for the specified store\n */\n async getArchivistForStore() {\n const name = assertEx(this.config?.stateStore?.archivist, () => `${moduleName}: Config for stateStore.archivist not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.archivist`)\n // return ArchivistWrapper.wrap(mod, this.account)\n const instance = asArchivistInstance(mod)\n return assertEx(instance, () => `${moduleName}: Failed to wrap archivist instance`)\n }\n\n /**\n * Retrieves the BoundWitness Diviner for the specified store\n * @param store The store to retrieve the BoundWitness Diviner for\n * @returns The BoundWitness Diviner for the specified store\n */\n async getBoundWitnessDivinerForStore() {\n const name = assertEx(\n this.config?.stateStore?.boundWitnessDiviner,\n () => `${moduleName}: Config for stateStore.boundWitnessDiviner not specified`,\n )\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.boundWitnessDiviner`)\n // return DivinerWrapper.wrap(mod, this.account)\n const instance = asDivinerInstance(mod)\n return assertEx(instance, () => `${moduleName}: Failed to wrap diviner instance`)\n }\n\n /**\n * Retrieves the Payload Diviner for the specified store\n * @param store The store to retrieve the Payload Diviner for\n * @returns The Payload Diviner for the specified store\n */\n async getPayloadDivinerForStateStore() {\n const name = assertEx(this.config?.stateStore?.payloadDiviner, () => `${moduleName}: Config for stateStore.payloadDiviner not specified`)\n const mod = assertEx(await this.resolve(name), () => `${moduleName}: Failed to resolve stateStore.payloadDiviner`)\n // return DivinerWrapper.wrap(mod, this.account)\n const instance = asDivinerInstance(mod)\n return assertEx(instance, () => `${moduleName}: Failed to wrap diviner instance`)\n }\n\n /**\n * Retrieves the last state of the Diviner process. Used to recover state after\n * preemptions, reboots, etc.\n */\n async retrieveState(): Promise<WithMeta<ModuleState<TState>> | undefined> {\n if (this._lastState) return this._lastState\n let hash: Hash = ''\n const diviner = await this.getBoundWitnessDivinerForStore()\n const query = await new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })\n .fields({\n // address: this.account.address,\n limit: 1,\n offset: 0,\n order: 'desc',\n payload_schemas: [ModuleStateSchema],\n })\n .build()\n const boundWitnesses = await diviner.divine([query])\n if (boundWitnesses.length > 0) {\n const boundWitness = boundWitnesses[0]\n if (isBoundWitness(boundWitness)) {\n // Find the index for this address in the BoundWitness that is a ModuleState\n hash = boundWitness.addresses\n .map((address, index) => ({ address, index }))\n // .filter(({ address }) => address === this.account.address)\n // eslint-disable-next-line unicorn/no-array-reduce\n .reduce(\n (prev, curr) => (boundWitness.payload_schemas?.[curr?.index] === ModuleStateSchema ? boundWitness.payload_hashes[curr?.index] : prev),\n '' as Hash,\n )\n }\n }\n\n // If we able to located the last state\n if (hash) {\n // Get last state\n const archivist = await this.getArchivistForStore()\n const payload = (await archivist.get([hash])).find(isModuleState<TState>)\n if (payload) {\n return payload as WithMeta<ModuleState<TState>>\n }\n }\n return undefined\n }\n }\n return StatefulModuleBase\n}\n"],"mappings":"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","names":["StatefulDivinerSchema","StatefulDivinerConfigSchema","StatefulDivinerSchema","moduleName","StatefulDiviner","AbstractDiviner","configSchemas","StatefulDivinerConfigSchema","defaultConfigSchema","_lastState","commitState","nextState","state","offset","archivist","getArchivistForStateStore","bw","BoundWitnessBuilder","payload","signer","account","build","insert","name","assertEx","config","stateStore","mod","resolve","ArchivistWrapper","wrap","getBoundWitnessDivinerForStateStore","boundWitnessDiviner","DivinerWrapper","getPayloadDivinerForStateStore","payloadDiviner","retrieveState","hash","diviner","query","PayloadBuilder","schema","BoundWitnessDivinerQuerySchema","fields","address","limit","order","payload_schemas","ModuleStateSchema","boundWitnesses","divine","length","boundWitness","isBoundWitness","addresses","map","index","filter","reduce","prev","curr","payload_hashes","get","find","isModuleState","undefined","import_assert","import_boundwitness_builder","import_boundwitness_model","import_diviner_boundwitness_model","import_module_model","import_payload_builder","moduleName","StatefulModuleMixin","ModuleBase","StatefulModuleBase","_lastState","commitState","nextState","state","offset","archivist","getArchivistForStore","bw","BoundWitnessBuilder","payload","build","insert","name","assertEx","config","stateStore","mod","resolve","instance","asArchivistInstance","getBoundWitnessDivinerForStore","boundWitnessDiviner","asDivinerInstance","getPayloadDivinerForStateStore","payloadDiviner","retrieveState","hash","diviner","query","PayloadBuilder","schema","BoundWitnessDivinerQuerySchema","fields","limit","order","payload_schemas","ModuleStateSchema","boundWitnesses","divine","length","boundWitness","isBoundWitness","addresses","map","address","index","reduce","prev","curr","payload_hashes","get","find","isModuleState","undefined"]}
|
package/dist/neutral/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
package/dist/neutral/index.d.mts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA"}
|
package/dist/node/Config.d.cts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DivinerConfig } from '@xyo-network/diviner-model';
|
|
2
|
-
import { ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
export declare const StatefulDivinerConfigSchema: "network.xyo.diviner.stateful.config";
|
|
4
|
-
export type StatefulDivinerConfigSchema = typeof StatefulDivinerConfigSchema;
|
|
5
|
-
export type StatefulDivinerConfig = DivinerConfig<{
|
|
6
|
-
schema: StatefulDivinerConfigSchema;
|
|
7
|
-
stateStore: {
|
|
8
|
-
archivist: ModuleIdentifier;
|
|
9
|
-
boundWitnessDiviner: ModuleIdentifier;
|
|
10
|
-
payloadDiviner: ModuleIdentifier;
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAO5D,eAAO,MAAM,2BAA2B,uCAA6C,CAAA;AAIrF,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAK5E,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC;IAChD,MAAM,EAAE,2BAA2B,CAAA;IACnC,UAAU,EAAE;QACV,SAAS,EAAE,gBAAgB,CAAA;QAC3B,mBAAmB,EAAE,gBAAgB,CAAA;QACrC,cAAc,EAAE,gBAAgB,CAAA;KACjC,CAAA;CACF,CAAC,CAAA"}
|
package/dist/node/Config.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DivinerConfig } from '@xyo-network/diviner-model';
|
|
2
|
-
import { ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
export declare const StatefulDivinerConfigSchema: "network.xyo.diviner.stateful.config";
|
|
4
|
-
export type StatefulDivinerConfigSchema = typeof StatefulDivinerConfigSchema;
|
|
5
|
-
export type StatefulDivinerConfig = DivinerConfig<{
|
|
6
|
-
schema: StatefulDivinerConfigSchema;
|
|
7
|
-
stateStore: {
|
|
8
|
-
archivist: ModuleIdentifier;
|
|
9
|
-
boundWitnessDiviner: ModuleIdentifier;
|
|
10
|
-
payloadDiviner: ModuleIdentifier;
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAO5D,eAAO,MAAM,2BAA2B,uCAA6C,CAAA;AAIrF,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAK5E,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC;IAChD,MAAM,EAAE,2BAA2B,CAAA;IACnC,UAAU,EAAE;QACV,SAAS,EAAE,gBAAgB,CAAA;QAC3B,mBAAmB,EAAE,gBAAgB,CAAA;QACrC,cAAc,EAAE,gBAAgB,CAAA;KACjC,CAAA;CACF,CAAC,CAAA"}
|
package/dist/node/Config.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DivinerConfig } from '@xyo-network/diviner-model';
|
|
2
|
-
import { ModuleIdentifier } from '@xyo-network/module-model';
|
|
3
|
-
export declare const StatefulDivinerConfigSchema: "network.xyo.diviner.stateful.config";
|
|
4
|
-
export type StatefulDivinerConfigSchema = typeof StatefulDivinerConfigSchema;
|
|
5
|
-
export type StatefulDivinerConfig = DivinerConfig<{
|
|
6
|
-
schema: StatefulDivinerConfigSchema;
|
|
7
|
-
stateStore: {
|
|
8
|
-
archivist: ModuleIdentifier;
|
|
9
|
-
boundWitnessDiviner: ModuleIdentifier;
|
|
10
|
-
payloadDiviner: ModuleIdentifier;
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
//# sourceMappingURL=Config.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAO5D,eAAO,MAAM,2BAA2B,uCAA6C,CAAA;AAIrF,MAAM,MAAM,2BAA2B,GAAG,OAAO,2BAA2B,CAAA;AAK5E,MAAM,MAAM,qBAAqB,GAAG,aAAa,CAAC;IAChD,MAAM,EAAE,2BAA2B,CAAA;IACnC,UAAU,EAAE;QACV,SAAS,EAAE,gBAAgB,CAAA;QAC3B,mBAAmB,EAAE,gBAAgB,CAAA;QACrC,cAAc,EAAE,gBAAgB,CAAA;KACjC,CAAA;CACF,CAAC,CAAA"}
|
package/dist/node/Diviner.d.cts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
|
|
2
|
-
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
3
|
-
import { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
|
|
4
|
-
import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
|
|
5
|
-
import { ModuleState, StateDictionary } from '@xyo-network/module-model';
|
|
6
|
-
import { Payload, Schema, WithMeta } from '@xyo-network/payload-model';
|
|
7
|
-
import { StatefulDivinerParams } from './Params.ts';
|
|
8
|
-
export declare abstract class StatefulDiviner<TParams extends StatefulDivinerParams = StatefulDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>, TState extends StateDictionary = StateDictionary> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
|
|
9
|
-
static readonly configSchemas: Schema[];
|
|
10
|
-
static readonly defaultConfigSchema: Schema;
|
|
11
|
-
protected _lastState?: WithMeta<ModuleState<TState>>;
|
|
12
|
-
protected commitState(nextState: WithMeta<ModuleState<TState>>): Promise<void>;
|
|
13
|
-
protected getArchivistForStateStore(): Promise<ArchivistWrapper<import("@xyo-network/archivist-model").ArchivistModule<import("@xylabs/object").BaseParamsFields & {
|
|
14
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
15
|
-
addToResolvers?: boolean;
|
|
16
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
17
|
-
allowNameResolution?: boolean;
|
|
18
|
-
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 & {
|
|
19
|
-
parents?: import("@xyo-network/archivist-model").ArchivistParents;
|
|
20
|
-
requireAllParents?: boolean;
|
|
21
|
-
schema: "network.xyo.archivist.config";
|
|
22
|
-
storage?: import("@xyo-network/archivist-model").ArchivistStorage;
|
|
23
|
-
storeParentReads?: boolean;
|
|
24
|
-
}, "schema"> & {
|
|
25
|
-
schema: "network.xyo.archivist.config";
|
|
26
|
-
}, "schema"> & {
|
|
27
|
-
schema: string;
|
|
28
|
-
};
|
|
29
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
30
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
31
|
-
}, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
|
|
32
|
-
protected getBoundWitnessDivinerForStateStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
|
|
33
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
34
|
-
addToResolvers?: boolean;
|
|
35
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
36
|
-
allowNameResolution?: boolean;
|
|
37
|
-
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 & {
|
|
38
|
-
schema: "network.xyo.diviner.config";
|
|
39
|
-
}, "schema"> & {
|
|
40
|
-
schema: "network.xyo.diviner.config";
|
|
41
|
-
}, "schema"> & {
|
|
42
|
-
schema: string;
|
|
43
|
-
};
|
|
44
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
45
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
46
|
-
}, DivinerModuleEventData>, {
|
|
47
|
-
schema: string;
|
|
48
|
-
} & import("@xyo-network/payload-model").PayloadFields, {
|
|
49
|
-
schema: string;
|
|
50
|
-
} & import("@xyo-network/payload-model").PayloadFields>>;
|
|
51
|
-
protected getPayloadDivinerForStateStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
|
|
52
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
53
|
-
addToResolvers?: boolean;
|
|
54
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
55
|
-
allowNameResolution?: boolean;
|
|
56
|
-
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 & {
|
|
57
|
-
schema: "network.xyo.diviner.config";
|
|
58
|
-
}, "schema"> & {
|
|
59
|
-
schema: "network.xyo.diviner.config";
|
|
60
|
-
}, "schema"> & {
|
|
61
|
-
schema: string;
|
|
62
|
-
};
|
|
63
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
64
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
65
|
-
}, DivinerModuleEventData>, {
|
|
66
|
-
schema: string;
|
|
67
|
-
} & import("@xyo-network/payload-model").PayloadFields, {
|
|
68
|
-
schema: string;
|
|
69
|
-
} & import("@xyo-network/payload-model").PayloadFields>>;
|
|
70
|
-
protected retrieveState(): Promise<WithMeta<ModuleState<TState>> | undefined>;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=Diviner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAiB,WAAW,EAAqB,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE1G,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAOnD,8BAAsB,eAAe,CACnC,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,EACD,MAAM,SAAS,eAAe,GAAG,eAAe,CAChD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;IACvD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAwD;IACxG,gBAAyB,mBAAmB,EAAE,MAAM,CAA8B;IAKlF,SAAS,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;cASpC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;cAcpD,yBAAyB;;;;;;;;;;;;;;;;;;;cAWzB,mCAAmC;;;;;;;;;;;;;;;;;;;cAWnC,8BAA8B;;;;;;;;;;;;;;;;;;;cAU9B,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CAwCpF"}
|
package/dist/node/Diviner.d.mts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
|
|
2
|
-
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
3
|
-
import { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
|
|
4
|
-
import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
|
|
5
|
-
import { ModuleState, StateDictionary } from '@xyo-network/module-model';
|
|
6
|
-
import { Payload, Schema, WithMeta } from '@xyo-network/payload-model';
|
|
7
|
-
import { StatefulDivinerParams } from './Params.ts';
|
|
8
|
-
export declare abstract class StatefulDiviner<TParams extends StatefulDivinerParams = StatefulDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>, TState extends StateDictionary = StateDictionary> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
|
|
9
|
-
static readonly configSchemas: Schema[];
|
|
10
|
-
static readonly defaultConfigSchema: Schema;
|
|
11
|
-
protected _lastState?: WithMeta<ModuleState<TState>>;
|
|
12
|
-
protected commitState(nextState: WithMeta<ModuleState<TState>>): Promise<void>;
|
|
13
|
-
protected getArchivistForStateStore(): Promise<ArchivistWrapper<import("@xyo-network/archivist-model").ArchivistModule<import("@xylabs/object").BaseParamsFields & {
|
|
14
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
15
|
-
addToResolvers?: boolean;
|
|
16
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
17
|
-
allowNameResolution?: boolean;
|
|
18
|
-
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 & {
|
|
19
|
-
parents?: import("@xyo-network/archivist-model").ArchivistParents;
|
|
20
|
-
requireAllParents?: boolean;
|
|
21
|
-
schema: "network.xyo.archivist.config";
|
|
22
|
-
storage?: import("@xyo-network/archivist-model").ArchivistStorage;
|
|
23
|
-
storeParentReads?: boolean;
|
|
24
|
-
}, "schema"> & {
|
|
25
|
-
schema: "network.xyo.archivist.config";
|
|
26
|
-
}, "schema"> & {
|
|
27
|
-
schema: string;
|
|
28
|
-
};
|
|
29
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
30
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
31
|
-
}, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
|
|
32
|
-
protected getBoundWitnessDivinerForStateStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
|
|
33
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
34
|
-
addToResolvers?: boolean;
|
|
35
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
36
|
-
allowNameResolution?: boolean;
|
|
37
|
-
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 & {
|
|
38
|
-
schema: "network.xyo.diviner.config";
|
|
39
|
-
}, "schema"> & {
|
|
40
|
-
schema: "network.xyo.diviner.config";
|
|
41
|
-
}, "schema"> & {
|
|
42
|
-
schema: string;
|
|
43
|
-
};
|
|
44
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
45
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
46
|
-
}, DivinerModuleEventData>, {
|
|
47
|
-
schema: string;
|
|
48
|
-
} & import("@xyo-network/payload-model").PayloadFields, {
|
|
49
|
-
schema: string;
|
|
50
|
-
} & import("@xyo-network/payload-model").PayloadFields>>;
|
|
51
|
-
protected getPayloadDivinerForStateStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
|
|
52
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
53
|
-
addToResolvers?: boolean;
|
|
54
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
55
|
-
allowNameResolution?: boolean;
|
|
56
|
-
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 & {
|
|
57
|
-
schema: "network.xyo.diviner.config";
|
|
58
|
-
}, "schema"> & {
|
|
59
|
-
schema: "network.xyo.diviner.config";
|
|
60
|
-
}, "schema"> & {
|
|
61
|
-
schema: string;
|
|
62
|
-
};
|
|
63
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
64
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
65
|
-
}, DivinerModuleEventData>, {
|
|
66
|
-
schema: string;
|
|
67
|
-
} & import("@xyo-network/payload-model").PayloadFields, {
|
|
68
|
-
schema: string;
|
|
69
|
-
} & import("@xyo-network/payload-model").PayloadFields>>;
|
|
70
|
-
protected retrieveState(): Promise<WithMeta<ModuleState<TState>> | undefined>;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=Diviner.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAGjE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,EAAiB,WAAW,EAAqB,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE1G,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAGtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAOnD,8BAAsB,eAAe,CACnC,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,EACD,MAAM,SAAS,eAAe,GAAG,eAAe,CAChD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;IACvD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAwD;IACxG,gBAAyB,mBAAmB,EAAE,MAAM,CAA8B;IAKlF,SAAS,CAAC,UAAU,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAA;cASpC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC;cAcpD,yBAAyB;;;;;;;;;;;;;;;;;;;cAWzB,mCAAmC;;;;;;;;;;;;;;;;;;;cAWnC,8BAA8B;;;;;;;;;;;;;;;;;;;cAU9B,aAAa,IAAI,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAAC;CAwCpF"}
|
package/dist/node/Diviner.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
|
|
2
|
-
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
3
|
-
import { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
|
|
4
|
-
import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
|
|
5
|
-
import { ModuleState, StateDictionary } from '@xyo-network/module-model';
|
|
6
|
-
import { Payload, Schema, WithMeta } from '@xyo-network/payload-model';
|
|
7
|
-
import { StatefulDivinerParams } from './Params.ts';
|
|
8
|
-
export declare abstract class StatefulDiviner<TParams extends StatefulDivinerParams = StatefulDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>, TState extends StateDictionary = StateDictionary> extends AbstractDiviner<TParams, TIn, TOut, TEventData> {
|
|
9
|
-
static readonly configSchemas: Schema[];
|
|
10
|
-
static readonly defaultConfigSchema: Schema;
|
|
11
|
-
protected _lastState?: WithMeta<ModuleState<TState>>;
|
|
12
|
-
protected commitState(nextState: WithMeta<ModuleState<TState>>): Promise<void>;
|
|
13
|
-
protected getArchivistForStateStore(): Promise<ArchivistWrapper<import("@xyo-network/archivist-model").ArchivistModule<import("@xylabs/object").BaseParamsFields & {
|
|
14
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
15
|
-
addToResolvers?: boolean;
|
|
16
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
17
|
-
allowNameResolution?: boolean;
|
|
18
|
-
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 & {
|
|
19
|
-
parents?: import("@xyo-network/archivist-model").ArchivistParents;
|
|
20
|
-
requireAllParents?: boolean;
|
|
21
|
-
schema: "network.xyo.archivist.config";
|
|
22
|
-
storage?: import("@xyo-network/archivist-model").ArchivistStorage;
|
|
23
|
-
storeParentReads?: boolean;
|
|
24
|
-
}, "schema"> & {
|
|
25
|
-
schema: "network.xyo.archivist.config";
|
|
26
|
-
}, "schema"> & {
|
|
27
|
-
schema: string;
|
|
28
|
-
};
|
|
29
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
30
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
31
|
-
}, import("@xyo-network/archivist-model").ArchivistModuleEventData>>>;
|
|
32
|
-
protected getBoundWitnessDivinerForStateStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
|
|
33
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
34
|
-
addToResolvers?: boolean;
|
|
35
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
36
|
-
allowNameResolution?: boolean;
|
|
37
|
-
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 & {
|
|
38
|
-
schema: "network.xyo.diviner.config";
|
|
39
|
-
}, "schema"> & {
|
|
40
|
-
schema: "network.xyo.diviner.config";
|
|
41
|
-
}, "schema"> & {
|
|
42
|
-
schema: string;
|
|
43
|
-
};
|
|
44
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
45
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
46
|
-
}, DivinerModuleEventData>, {
|
|
47
|
-
schema: string;
|
|
48
|
-
} & import("@xyo-network/payload-model").PayloadFields, {
|
|
49
|
-
schema: string;
|
|
50
|
-
} & import("@xyo-network/payload-model").PayloadFields>>;
|
|
51
|
-
protected getPayloadDivinerForStateStore(): Promise<DivinerWrapper<import("@xyo-network/diviner-model").DivinerModule<import("@xylabs/object").BaseParamsFields & {
|
|
52
|
-
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
53
|
-
addToResolvers?: boolean;
|
|
54
|
-
additionalSigners?: import("@xyo-network/account-model").AccountInstance[];
|
|
55
|
-
allowNameResolution?: boolean;
|
|
56
|
-
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 & {
|
|
57
|
-
schema: "network.xyo.diviner.config";
|
|
58
|
-
}, "schema"> & {
|
|
59
|
-
schema: "network.xyo.diviner.config";
|
|
60
|
-
}, "schema"> & {
|
|
61
|
-
schema: string;
|
|
62
|
-
};
|
|
63
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
64
|
-
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
65
|
-
}, DivinerModuleEventData>, {
|
|
66
|
-
schema: string;
|
|
67
|
-
} & import("@xyo-network/payload-model").PayloadFields, {
|
|
68
|
-
schema: string;
|
|
69
|
-
} & import("@xyo-network/payload-model").PayloadFields>>;
|
|
70
|
-
protected retrieveState(): Promise<WithMeta<ModuleState<TState>> | undefined>;
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=Diviner.d.ts.map
|