@xyo-network/diviner-temporal-indexing-memory 2.83.1 → 2.84.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.
- package/dist/browser/index.cjs +1 -1
- package/dist/node/index.cjs +407 -0
- package/dist/node/index.cjs.map +1 -0
- package/dist/node/index.js +92 -125
- package/dist/node/index.js.map +1 -1
- package/package.json +32 -32
- package/dist/node/index.mjs +0 -374
- package/dist/node/index.mjs.map +0 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -61,7 +61,7 @@ var import_payload_builder2 = require("@xyo-network/payload-builder");
|
|
|
61
61
|
var import_payload_model = require("@xyo-network/payload-model");
|
|
62
62
|
|
|
63
63
|
// src/jsonpath/toPayloadTransformer.ts
|
|
64
|
-
var import_jsonpath = __toESM(require("jsonpath"));
|
|
64
|
+
var import_jsonpath = __toESM(require("jsonpath"), 1);
|
|
65
65
|
var toPayloadTransformer = (transformExpression) => {
|
|
66
66
|
const { defaultValue, destinationField, sourcePathExpression } = transformExpression;
|
|
67
67
|
const transformer = (x) => {
|
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
TemporalIndexingDiviner: () => TemporalIndexingDiviner,
|
|
34
|
+
TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner: () => TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner,
|
|
35
|
+
TemporalIndexingDivinerIndexCandidateToIndexDiviner: () => TemporalIndexingDivinerIndexCandidateToIndexDiviner,
|
|
36
|
+
TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner: () => TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner,
|
|
37
|
+
TemporalIndexingDivinerStateToIndexCandidateDiviner: () => TemporalIndexingDivinerStateToIndexCandidateDiviner
|
|
38
|
+
});
|
|
39
|
+
module.exports = __toCommonJS(src_exports);
|
|
40
|
+
|
|
41
|
+
// src/Diviner.ts
|
|
42
|
+
var import_diviner_indexing_memory = require("@xyo-network/diviner-indexing-memory");
|
|
43
|
+
var import_diviner_indexing_model = require("@xyo-network/diviner-indexing-model");
|
|
44
|
+
var import_diviner_model = require("@xyo-network/diviner-model");
|
|
45
|
+
var import_diviner_temporal_indexing_model = require("@xyo-network/diviner-temporal-indexing-model");
|
|
46
|
+
var TemporalIndexingDiviner = class extends import_diviner_indexing_memory.IndexingDiviner {
|
|
47
|
+
static configSchema = import_diviner_temporal_indexing_model.TemporalIndexingDivinerConfigSchema;
|
|
48
|
+
static configSchemas = [import_diviner_temporal_indexing_model.TemporalIndexingDivinerConfigSchema, import_diviner_indexing_model.IndexingDivinerConfigSchema, import_diviner_model.DivinerConfigSchema];
|
|
49
|
+
async startHandler() {
|
|
50
|
+
await super.startHandler();
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// src/DivinerQueryToIndexQueryDiviner/Diviner.ts
|
|
56
|
+
var import_abstract_diviner = require("@xyo-network/abstract-diviner");
|
|
57
|
+
var import_diviner_model2 = require("@xyo-network/diviner-model");
|
|
58
|
+
var import_diviner_payload_model = require("@xyo-network/diviner-payload-model");
|
|
59
|
+
var import_diviner_temporal_indexing_model2 = require("@xyo-network/diviner-temporal-indexing-model");
|
|
60
|
+
var import_payload_builder2 = require("@xyo-network/payload-builder");
|
|
61
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
62
|
+
|
|
63
|
+
// src/jsonpath/toPayloadTransformer.ts
|
|
64
|
+
var import_jsonpath = __toESM(require("jsonpath"), 1);
|
|
65
|
+
var toPayloadTransformer = (transformExpression) => {
|
|
66
|
+
const { defaultValue, destinationField, sourcePathExpression } = transformExpression;
|
|
67
|
+
const transformer = (x) => {
|
|
68
|
+
const source = import_jsonpath.default.value(x, sourcePathExpression);
|
|
69
|
+
const transformed = {};
|
|
70
|
+
const destinationValue = source === void 0 ? defaultValue : source;
|
|
71
|
+
if (destinationValue !== void 0)
|
|
72
|
+
transformed[destinationField] = destinationValue;
|
|
73
|
+
return transformed;
|
|
74
|
+
};
|
|
75
|
+
return transformer;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
// src/jsonpath/jsonPathToTransformersDictionary.ts
|
|
79
|
+
var jsonPathToTransformersDictionary = (schemaTransforms) => {
|
|
80
|
+
return Object.fromEntries(
|
|
81
|
+
Object.entries(schemaTransforms).map(([schema, jsonPathTransformerExpressions]) => {
|
|
82
|
+
const transformers = jsonPathTransformerExpressions.map(toPayloadTransformer);
|
|
83
|
+
return [schema, transformers];
|
|
84
|
+
})
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
// src/jsonpath/reducePayloads.ts
|
|
89
|
+
var import_hash = require("@xyo-network/hash");
|
|
90
|
+
var import_payload_builder = require("@xyo-network/payload-builder");
|
|
91
|
+
var reducePayloads = async (payloads, payloadTransformers, destinationSchema) => {
|
|
92
|
+
const indexFields = payloads.map((payload) => {
|
|
93
|
+
const transformers = payloadTransformers[payload.schema];
|
|
94
|
+
return transformers ? transformers.map((transform) => transform(payload)) : [];
|
|
95
|
+
}).flat();
|
|
96
|
+
const sources = (await import_hash.PayloadHasher.hashPairs([...payloads])).map(([, hash]) => hash);
|
|
97
|
+
return await new import_payload_builder.PayloadBuilder({ schema: destinationSchema }).fields(Object.assign({ sources }, ...indexFields)).build();
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
// src/DivinerQueryToIndexQueryDiviner/Diviner.ts
|
|
101
|
+
var TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner = class extends import_abstract_diviner.AbstractDiviner {
|
|
102
|
+
static configSchema = import_diviner_temporal_indexing_model2.TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema;
|
|
103
|
+
static configSchemas = [import_diviner_model2.DivinerConfigSchema, import_diviner_temporal_indexing_model2.TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema];
|
|
104
|
+
static labels = {
|
|
105
|
+
"network.xyo.diviner.stage": "divinerQueryToIndexQueryDiviner"
|
|
106
|
+
};
|
|
107
|
+
_indexableSchemas;
|
|
108
|
+
_payloadTransformers;
|
|
109
|
+
/**
|
|
110
|
+
* The schema of the diviner query payloads
|
|
111
|
+
*/
|
|
112
|
+
get divinerQuerySchema() {
|
|
113
|
+
return this.config.divinerQuerySchema ?? import_diviner_payload_model.PayloadDivinerQuerySchema;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The schema of the index query payloads
|
|
117
|
+
*/
|
|
118
|
+
get indexQuerySchema() {
|
|
119
|
+
return this.config.indexQuerySchema ?? import_diviner_payload_model.PayloadDivinerQuerySchema;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* The schema of the index payloads
|
|
123
|
+
*/
|
|
124
|
+
get indexSchema() {
|
|
125
|
+
return this.config.indexSchema ?? import_diviner_temporal_indexing_model2.TemporalIndexingDivinerResultIndexSchema;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* List of indexable schemas for this diviner
|
|
129
|
+
*/
|
|
130
|
+
get indexableSchemas() {
|
|
131
|
+
if (!this._indexableSchemas)
|
|
132
|
+
this._indexableSchemas = [...Object.keys(this.schemaTransforms)];
|
|
133
|
+
return this._indexableSchemas;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Dictionary of schemas to payload transformers for creating indexes
|
|
137
|
+
* from the payloads within a Bound Witness
|
|
138
|
+
*/
|
|
139
|
+
get payloadTransformers() {
|
|
140
|
+
if (!this._payloadTransformers)
|
|
141
|
+
this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms);
|
|
142
|
+
return this._payloadTransformers;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* The dictionary of schemas to JSON Path transform expressions for creating indexes
|
|
146
|
+
* from the payloads within a Bound Witness
|
|
147
|
+
*/
|
|
148
|
+
get schemaTransforms() {
|
|
149
|
+
var _a;
|
|
150
|
+
return ((_a = this.config) == null ? void 0 : _a.schemaTransforms) ?? {
|
|
151
|
+
[this.divinerQuerySchema]: [
|
|
152
|
+
{
|
|
153
|
+
defaultValue: 1,
|
|
154
|
+
destinationField: "limit",
|
|
155
|
+
sourcePathExpression: "$.limit"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
defaultValue: 0,
|
|
159
|
+
destinationField: "offset",
|
|
160
|
+
sourcePathExpression: "$.offset"
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
defaultValue: "desc",
|
|
164
|
+
destinationField: "order",
|
|
165
|
+
sourcePathExpression: "$.order"
|
|
166
|
+
}
|
|
167
|
+
]
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
async divineHandler(payloads = []) {
|
|
171
|
+
const queries = payloads.filter((0, import_payload_model.isPayloadOfSchemaType)(this.divinerQuerySchema));
|
|
172
|
+
if (queries.length) {
|
|
173
|
+
const results = await Promise.all(
|
|
174
|
+
queries.map(async (query) => {
|
|
175
|
+
const fields = await reducePayloads(
|
|
176
|
+
[query],
|
|
177
|
+
this.payloadTransformers,
|
|
178
|
+
this.indexQuerySchema
|
|
179
|
+
);
|
|
180
|
+
fields.schemas = [this.indexSchema];
|
|
181
|
+
delete fields.sources;
|
|
182
|
+
return await new import_payload_builder2.PayloadBuilder({ schema: this.indexQuerySchema }).fields(fields).build();
|
|
183
|
+
})
|
|
184
|
+
);
|
|
185
|
+
return results;
|
|
186
|
+
}
|
|
187
|
+
return Promise.resolve([]);
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
// src/IndexCandidateToIndexDiviner/Diviner.ts
|
|
192
|
+
var import_array = require("@xylabs/array");
|
|
193
|
+
var import_assert = require("@xylabs/assert");
|
|
194
|
+
var import_exists = require("@xylabs/exists");
|
|
195
|
+
var import_abstract_diviner2 = require("@xyo-network/abstract-diviner");
|
|
196
|
+
var import_boundwitness_model = require("@xyo-network/boundwitness-model");
|
|
197
|
+
var import_diviner_model3 = require("@xyo-network/diviner-model");
|
|
198
|
+
var import_diviner_temporal_indexing_model3 = require("@xyo-network/diviner-temporal-indexing-model");
|
|
199
|
+
var import_hash2 = require("@xyo-network/hash");
|
|
200
|
+
var import_payload_builder3 = require("@xyo-network/payload-builder");
|
|
201
|
+
var moduleName = "TemporalIndexingDivinerIndexCandidateToIndexDiviner";
|
|
202
|
+
var TemporalIndexingDivinerIndexCandidateToIndexDiviner = class extends import_abstract_diviner2.AbstractDiviner {
|
|
203
|
+
static configSchema = import_diviner_temporal_indexing_model3.TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema;
|
|
204
|
+
static configSchemas = [import_diviner_model3.DivinerConfigSchema, import_diviner_temporal_indexing_model3.TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema];
|
|
205
|
+
static labels = {
|
|
206
|
+
"network.xyo.diviner.stage": "indexCandidateToIndexDiviner"
|
|
207
|
+
};
|
|
208
|
+
_indexableSchemas;
|
|
209
|
+
_payloadTransformers;
|
|
210
|
+
/**
|
|
211
|
+
* List of indexable schemas for this diviner
|
|
212
|
+
*/
|
|
213
|
+
get indexableSchemas() {
|
|
214
|
+
if (!this._indexableSchemas)
|
|
215
|
+
this._indexableSchemas = [...Object.keys(this.schemaTransforms)];
|
|
216
|
+
return this._indexableSchemas;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Dictionary of schemas to payload transformers for creating indexes
|
|
220
|
+
* from the payloads within a Bound Witness
|
|
221
|
+
*/
|
|
222
|
+
get payloadTransformers() {
|
|
223
|
+
if (!this._payloadTransformers)
|
|
224
|
+
this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms);
|
|
225
|
+
return this._payloadTransformers;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* The dictionary of schemas to JSON Path transform expressions for creating indexes
|
|
229
|
+
* from the payloads within a Bound Witness
|
|
230
|
+
*/
|
|
231
|
+
get schemaTransforms() {
|
|
232
|
+
var _a;
|
|
233
|
+
return (0, import_assert.assertEx)((_a = this.config) == null ? void 0 : _a.schemaTransforms, () => `${moduleName}: Missing config.schemaTransforms section`);
|
|
234
|
+
}
|
|
235
|
+
async divineHandler(payloads = []) {
|
|
236
|
+
const bws = payloads.filter(import_boundwitness_model.isBoundWitness);
|
|
237
|
+
const indexablePayloads = payloads.filter((p) => this.isIndexablePayload(p));
|
|
238
|
+
if (bws.length && indexablePayloads.length) {
|
|
239
|
+
const payloadDictionary = await import_hash2.PayloadHasher.toMap(payloads);
|
|
240
|
+
const validIndexableTuples = bws.reduce((indexableTuples, bw) => {
|
|
241
|
+
if (!(0, import_array.containsAll)(bw.payload_schemas, this.indexableSchemas))
|
|
242
|
+
return indexableTuples;
|
|
243
|
+
const indexablePayloadPositions = this.indexableSchemas.map((schema) => bw.payload_schemas.indexOf(schema));
|
|
244
|
+
const indexablePayloadHashes = indexablePayloadPositions.map((index) => {
|
|
245
|
+
var _a;
|
|
246
|
+
return (_a = bw.payload_hashes) == null ? void 0 : _a[index];
|
|
247
|
+
});
|
|
248
|
+
const indexablePayloads2 = indexablePayloadHashes.map((hash) => payloadDictionary[hash]).filter(import_exists.exists);
|
|
249
|
+
if (indexablePayloads2.length === this.indexableSchemas.length)
|
|
250
|
+
indexableTuples.push([bw, ...indexablePayloads2]);
|
|
251
|
+
return indexableTuples;
|
|
252
|
+
}, []);
|
|
253
|
+
const indexes = await Promise.all(
|
|
254
|
+
validIndexableTuples.map(async ([bw, ...sourcePayloads]) => {
|
|
255
|
+
const indexFields = sourcePayloads.map((payload) => {
|
|
256
|
+
const transformers = this.payloadTransformers[payload.schema];
|
|
257
|
+
return transformers ? transformers.map((transform) => transform(payload)) : [];
|
|
258
|
+
}).flat();
|
|
259
|
+
const sources = Object.keys(await import_hash2.PayloadHasher.toMap([bw, ...sourcePayloads]));
|
|
260
|
+
return await new import_payload_builder3.PayloadBuilder({ schema: import_diviner_temporal_indexing_model3.TemporalIndexingDivinerResultIndexSchema }).fields(Object.assign({ sources }, ...indexFields)).build();
|
|
261
|
+
})
|
|
262
|
+
);
|
|
263
|
+
return indexes.flat();
|
|
264
|
+
}
|
|
265
|
+
return Promise.resolve([]);
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* Identifies if a payload is one that is indexed by this diviner
|
|
269
|
+
* @param x The candidate payload
|
|
270
|
+
* @returns True if the payload is one indexed by this diviner, false otherwise
|
|
271
|
+
*/
|
|
272
|
+
isIndexablePayload = (x) => {
|
|
273
|
+
return this.indexableSchemas.includes(x == null ? void 0 : x.schema);
|
|
274
|
+
};
|
|
275
|
+
/**
|
|
276
|
+
* Identifies if a schema is one that is indexed by this diviner
|
|
277
|
+
* @param schema The candidate schema
|
|
278
|
+
* @returns True if this schema is one indexed by this diviner, false otherwise
|
|
279
|
+
*/
|
|
280
|
+
isIndexableSchema = (schema) => {
|
|
281
|
+
return this.indexableSchemas.some((s) => s === schema);
|
|
282
|
+
};
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
// src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts
|
|
286
|
+
var import_abstract_diviner3 = require("@xyo-network/abstract-diviner");
|
|
287
|
+
var import_diviner_model4 = require("@xyo-network/diviner-model");
|
|
288
|
+
var import_diviner_payload_model2 = require("@xyo-network/diviner-payload-model");
|
|
289
|
+
var import_diviner_temporal_indexing_model4 = require("@xyo-network/diviner-temporal-indexing-model");
|
|
290
|
+
var TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner = class extends import_abstract_diviner3.AbstractDiviner {
|
|
291
|
+
static configSchema = import_diviner_temporal_indexing_model4.TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema;
|
|
292
|
+
static configSchemas = [import_diviner_model4.DivinerConfigSchema, import_diviner_temporal_indexing_model4.TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema];
|
|
293
|
+
static labels = {
|
|
294
|
+
"network.xyo.diviner.stage": "indexQueryResponseToDivinerQueryResponseDiviner"
|
|
295
|
+
};
|
|
296
|
+
async divineHandler(payloads = []) {
|
|
297
|
+
const responses = payloads.filter((p) => !(0, import_diviner_payload_model2.isPayloadDivinerQueryPayload)(p));
|
|
298
|
+
return await Promise.resolve(responses);
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
// src/StateToIndexCandidateDiviner/Diviner.ts
|
|
303
|
+
var import_assert2 = require("@xylabs/assert");
|
|
304
|
+
var import_exists2 = require("@xylabs/exists");
|
|
305
|
+
var import_abstract_diviner4 = require("@xyo-network/abstract-diviner");
|
|
306
|
+
var import_archivist_wrapper = require("@xyo-network/archivist-wrapper");
|
|
307
|
+
var import_boundwitness_model2 = require("@xyo-network/boundwitness-model");
|
|
308
|
+
var import_diviner_boundwitness_model = require("@xyo-network/diviner-boundwitness-model");
|
|
309
|
+
var import_diviner_model5 = require("@xyo-network/diviner-model");
|
|
310
|
+
var import_diviner_temporal_indexing_model5 = require("@xyo-network/diviner-temporal-indexing-model");
|
|
311
|
+
var import_diviner_wrapper = require("@xyo-network/diviner-wrapper");
|
|
312
|
+
var import_module_model = require("@xyo-network/module-model");
|
|
313
|
+
var import_payload_builder4 = require("@xyo-network/payload-builder");
|
|
314
|
+
var import_payload_model2 = require("@xyo-network/payload-model");
|
|
315
|
+
var import_witness_timestamp = require("@xyo-network/witness-timestamp");
|
|
316
|
+
var order = "asc";
|
|
317
|
+
var moduleName2 = "TemporalIndexingDivinerStateToIndexCandidateDiviner";
|
|
318
|
+
var TemporalIndexingDivinerStateToIndexCandidateDiviner = class extends import_abstract_diviner4.AbstractDiviner {
|
|
319
|
+
static configSchema = import_diviner_temporal_indexing_model5.TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema;
|
|
320
|
+
static configSchemas = [import_diviner_model5.DivinerConfigSchema, import_diviner_temporal_indexing_model5.TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema];
|
|
321
|
+
static labels = {
|
|
322
|
+
"network.xyo.diviner.stage": "stateToIndexCandidateDiviner"
|
|
323
|
+
};
|
|
324
|
+
get payloadDivinerLimit() {
|
|
325
|
+
return this.config.payloadDivinerLimit ?? 1e3;
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* The required payload_schemas within BoundWitnesses to identify index candidates
|
|
329
|
+
*/
|
|
330
|
+
get payload_schemas() {
|
|
331
|
+
var _a;
|
|
332
|
+
const schemas = (_a = this.config.filter) == null ? void 0 : _a.payload_schemas;
|
|
333
|
+
return [import_witness_timestamp.TimestampSchema, ...schemas ?? []];
|
|
334
|
+
}
|
|
335
|
+
async divineHandler(payloads = []) {
|
|
336
|
+
const lastState = payloads.find(import_module_model.isModuleState);
|
|
337
|
+
if (!lastState)
|
|
338
|
+
return [{ schema: import_module_model.ModuleStateSchema, state: { offset: 0 } }];
|
|
339
|
+
const { offset } = lastState.state;
|
|
340
|
+
const boundWitnessDiviner = await this.getBoundWitnessDivinerForStore();
|
|
341
|
+
if (!boundWitnessDiviner)
|
|
342
|
+
return [lastState];
|
|
343
|
+
const query = await new import_payload_builder4.PayloadBuilder({ schema: import_diviner_boundwitness_model.BoundWitnessDivinerQuerySchema }).fields({ limit: this.payloadDivinerLimit, offset, order, payload_schemas: this.payload_schemas }).build();
|
|
344
|
+
const batch = await boundWitnessDiviner.divine([query]);
|
|
345
|
+
if (batch.length === 0)
|
|
346
|
+
return [lastState];
|
|
347
|
+
const sourceArchivist = await this.getArchivistForStore();
|
|
348
|
+
if (!sourceArchivist)
|
|
349
|
+
return [lastState];
|
|
350
|
+
const indexCandidates = (await Promise.all(batch.filter(import_boundwitness_model2.isBoundWitness).map((bw) => this.getPayloadsInBoundWitness(bw, sourceArchivist)))).filter(import_exists2.exists).flat();
|
|
351
|
+
const nextState = { schema: import_module_model.ModuleStateSchema, state: { ...lastState.state, offset: offset + batch.length } };
|
|
352
|
+
return [nextState, ...indexCandidates];
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Retrieves the archivist for the payloadStore
|
|
356
|
+
* @returns The archivist for the payloadStore or undefined if not resolvable
|
|
357
|
+
*/
|
|
358
|
+
async getArchivistForStore() {
|
|
359
|
+
var _a, _b;
|
|
360
|
+
const name = (0, import_assert2.assertEx)((_b = (_a = this.config) == null ? void 0 : _a.payloadStore) == null ? void 0 : _b.archivist, () => `${moduleName2}: Config for payloadStore.archivist not specified`);
|
|
361
|
+
const mod = await this.resolve(name);
|
|
362
|
+
if (!mod)
|
|
363
|
+
return void 0;
|
|
364
|
+
return import_archivist_wrapper.ArchivistWrapper.wrap(mod, this.account);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Retrieves the BoundWitness Diviner for the payloadStore
|
|
368
|
+
* @returns The BoundWitness Diviner for the payloadStore or undefined if not resolvable
|
|
369
|
+
*/
|
|
370
|
+
async getBoundWitnessDivinerForStore() {
|
|
371
|
+
var _a, _b;
|
|
372
|
+
const name = (0, import_assert2.assertEx)(
|
|
373
|
+
(_b = (_a = this.config) == null ? void 0 : _a.payloadStore) == null ? void 0 : _b.boundWitnessDiviner,
|
|
374
|
+
() => `${moduleName2}: Config for payloadStore.boundWitnessDiviner not specified`
|
|
375
|
+
);
|
|
376
|
+
const mod = await this.resolve(name);
|
|
377
|
+
if (!mod)
|
|
378
|
+
return void 0;
|
|
379
|
+
return import_diviner_wrapper.DivinerWrapper.wrap(mod, this.account);
|
|
380
|
+
}
|
|
381
|
+
async getPayloadsInBoundWitness(bw, archivist) {
|
|
382
|
+
const indexes = this.payload_schemas.map((schema) => {
|
|
383
|
+
var _a;
|
|
384
|
+
return (_a = bw.payload_schemas) == null ? void 0 : _a.findIndex((s) => s === schema);
|
|
385
|
+
});
|
|
386
|
+
const hashes = indexes.map((index) => {
|
|
387
|
+
var _a;
|
|
388
|
+
return (_a = bw.payload_hashes) == null ? void 0 : _a[index];
|
|
389
|
+
});
|
|
390
|
+
const results = await archivist.get(hashes);
|
|
391
|
+
const indexCandidateIdentityFunctions = this.payload_schemas.map(import_payload_model2.isPayloadOfSchemaType);
|
|
392
|
+
const filteredResults = indexCandidateIdentityFunctions.map((is) => results.find(is));
|
|
393
|
+
if (filteredResults.some((f) => f === void 0))
|
|
394
|
+
return void 0;
|
|
395
|
+
const indexCandidates = filteredResults.filter(import_exists2.exists);
|
|
396
|
+
return [bw, ...indexCandidates];
|
|
397
|
+
}
|
|
398
|
+
};
|
|
399
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
400
|
+
0 && (module.exports = {
|
|
401
|
+
TemporalIndexingDiviner,
|
|
402
|
+
TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner,
|
|
403
|
+
TemporalIndexingDivinerIndexCandidateToIndexDiviner,
|
|
404
|
+
TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner,
|
|
405
|
+
TemporalIndexingDivinerStateToIndexCandidateDiviner
|
|
406
|
+
});
|
|
407
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Diviner.ts","../../src/DivinerQueryToIndexQueryDiviner/Diviner.ts","../../src/jsonpath/toPayloadTransformer.ts","../../src/jsonpath/jsonPathToTransformersDictionary.ts","../../src/jsonpath/reducePayloads.ts","../../src/IndexCandidateToIndexDiviner/Diviner.ts","../../src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts","../../src/StateToIndexCandidateDiviner/Diviner.ts"],"sourcesContent":["export * from './Diviner'\nexport * from './DivinerQueryToIndexQueryDiviner'\nexport * from './IndexCandidateToIndexDiviner'\nexport * from './IndexQueryResponseToDivinerQueryResponseDiviner'\nexport * from './StateToIndexCandidateDiviner'\n","import { IndexingDiviner } from '@xyo-network/diviner-indexing-memory'\nimport { IndexingDivinerConfigSchema } from '@xyo-network/diviner-indexing-model'\nimport { DivinerConfigSchema, DivinerModule, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport { TemporalIndexingDivinerConfigSchema, TemporalIndexingDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport { Payload } from '@xyo-network/payload-model'\n\nexport class TemporalIndexingDiviner<\n TParams extends TemporalIndexingDivinerParams = TemporalIndexingDivinerParams,\n TIn extends Payload = Payload,\n TOut extends Payload = Payload,\n TEventData extends DivinerModuleEventData<DivinerModule<TParams>, TIn, TOut> = DivinerModuleEventData<DivinerModule<TParams>, TIn, TOut>,\n> extends IndexingDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchema = TemporalIndexingDivinerConfigSchema\n static override readonly configSchemas: string[] = [TemporalIndexingDivinerConfigSchema, IndexingDivinerConfigSchema, DivinerConfigSchema]\n\n protected override async startHandler(): Promise<boolean> {\n await super.startHandler()\n return true\n }\n}\n","import { AbstractDiviner } from '@xyo-network/abstract-diviner'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport { PayloadDivinerQueryPayload, PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport {\n SchemaToJsonPathTransformExpressionsDictionary,\n SchemaToPayloadTransformersDictionary,\n TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema,\n TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams,\n TemporalIndexingDivinerResultIndexSchema,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport { Labels } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\n\nimport { jsonPathToTransformersDictionary, reducePayloads } from '../jsonpath'\n\n/**\n * A diviner that converts diviner query to index query\n */\nexport class TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner<\n TParams extends TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams = TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams,\n> extends AbstractDiviner<TParams> {\n static override readonly configSchema = TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema\n static override configSchemas = [DivinerConfigSchema, TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema]\n static labels: Labels = {\n 'network.xyo.diviner.stage': 'divinerQueryToIndexQueryDiviner',\n }\n\n private _indexableSchemas: string[] | undefined\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n\n /**\n * The schema of the diviner query payloads\n */\n protected get divinerQuerySchema(): string {\n return this.config.divinerQuerySchema ?? PayloadDivinerQuerySchema\n }\n\n /**\n * The schema of the index query payloads\n */\n protected get indexQuerySchema(): string {\n return this.config.indexQuerySchema ?? PayloadDivinerQuerySchema\n }\n\n /**\n * The schema of the index payloads\n */\n protected get indexSchema(): string {\n return this.config.indexSchema ?? TemporalIndexingDivinerResultIndexSchema\n }\n\n /**\n * List of indexable schemas for this diviner\n */\n protected get indexableSchemas(): string[] {\n if (!this._indexableSchemas) this._indexableSchemas = [...Object.keys(this.schemaTransforms)]\n return this._indexableSchemas\n }\n\n /**\n * Dictionary of schemas to payload transformers for creating indexes\n * from the payloads within a Bound Witness\n */\n protected get payloadTransformers(): SchemaToPayloadTransformersDictionary {\n if (!this._payloadTransformers) this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms)\n return this._payloadTransformers\n }\n\n /**\n * The dictionary of schemas to JSON Path transform expressions for creating indexes\n * from the payloads within a Bound Witness\n */\n protected get schemaTransforms(): SchemaToJsonPathTransformExpressionsDictionary {\n return (\n this.config?.schemaTransforms ?? {\n [this.divinerQuerySchema]: [\n {\n defaultValue: 1,\n destinationField: 'limit',\n sourcePathExpression: '$.limit',\n },\n {\n defaultValue: 0,\n destinationField: 'offset',\n sourcePathExpression: '$.offset',\n },\n {\n defaultValue: 'desc',\n destinationField: 'order',\n sourcePathExpression: '$.order',\n },\n ],\n }\n )\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<Payload[]> {\n const queries = payloads.filter(isPayloadOfSchemaType<PayloadDivinerQueryPayload>(this.divinerQuerySchema))\n if (queries.length) {\n const results = await Promise.all(\n queries.map(async (query) => {\n const fields = await reducePayloads<PayloadDivinerQueryPayload & { sources?: string[] }>(\n [query],\n this.payloadTransformers,\n this.indexQuerySchema,\n )\n // TODO: Make index schema configurable\n fields.schemas = [this.indexSchema]\n // TODO: Make sources not need to be deleted\n delete fields.sources\n // TODO: Add support for additional filters\n return await new PayloadBuilder<Payload>({ schema: this.indexQuerySchema }).fields(fields).build()\n }),\n )\n return results\n }\n return Promise.resolve([])\n }\n}\n","import { JsonPathTransformExpression, PayloadTransformer } from '@xyo-network/diviner-temporal-indexing-model'\nimport { Payload } from '@xyo-network/payload-model'\nimport jsonpath from 'jsonpath'\n\n/**\n * Converts a JSON Path transform expression to a payload transformer\n * @param transformExpression The transform expression to convert\n * @returns The payload transformer for the JSON Path transform expression\n */\nexport const toPayloadTransformer = (transformExpression: JsonPathTransformExpression) => {\n const { defaultValue, destinationField, sourcePathExpression } = transformExpression\n const transformer: PayloadTransformer = (x: Payload) => {\n // eslint-disable-next-line import/no-named-as-default-member\n const source = jsonpath.value(x, sourcePathExpression)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const transformed = {} as { [key: string]: any }\n // Assign the source value to the destination field or the default value if the source is undefined\n const destinationValue = source === undefined ? defaultValue : source\n if (destinationValue !== undefined) transformed[destinationField] = destinationValue\n return transformed\n }\n return transformer\n}\n","import { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-temporal-indexing-model'\n\nimport { toPayloadTransformer } from './toPayloadTransformer'\n\n/**\n * Materializes the JSON-path expressions into memoized functions by converting a\n * dictionary of schema to JSON Path transform expressions to a dictionary\n * of schema to payload transformers\n * @param schemaTransforms The schema transforms to convert\n * @returns A dictionary of schema to payload transformers\n */\nexport const jsonPathToTransformersDictionary = (\n schemaTransforms: SchemaToJsonPathTransformExpressionsDictionary,\n): SchemaToPayloadTransformersDictionary => {\n return Object.fromEntries(\n Object.entries(schemaTransforms).map(([schema, jsonPathTransformerExpressions]) => {\n const transformers = jsonPathTransformerExpressions.map(toPayloadTransformer)\n return [schema, transformers]\n }),\n )\n}\n","import { SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-temporal-indexing-model'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, PayloadFields } from '@xyo-network/payload-model'\n\n/**\n * Reduces the payloads to a single payload using the supplied transformers\n * @param payloads The payloads to reduce\n * @param payloadTransformers The transformers to use to convert the payloads to the destination payload\n * @param destinationSchema The schema of the destination payload\n * @returns The reduced payload\n */\nexport const reducePayloads = async <T extends Payload = Payload>(\n payloads: Payload[],\n payloadTransformers: SchemaToPayloadTransformersDictionary,\n destinationSchema: string,\n): Promise<T> => {\n // Use the payload transformers to convert the fields from the source payloads to the destination fields\n const indexFields = payloads\n .map<PayloadFields[]>((payload) => {\n // Find the transformers for this payload\n const transformers = payloadTransformers[payload.schema]\n // If transformers exist, apply them to the payload otherwise return an empty array\n return transformers ? transformers.map((transform) => transform(payload)) : []\n })\n .flat()\n // Include all the sources for reference\n const sources = (await PayloadHasher.hashPairs([...payloads])).map(([, hash]) => hash)\n // Build and return the index\n return await new PayloadBuilder<T>({ schema: destinationSchema }).fields(Object.assign({ sources }, ...indexFields)).build()\n}\n\n/**\n * Reduces the arrays of payload arrays to an array of payloads using the supplied transformers\n * @param payloadsArray The arrays of payloads to reduce\n * @param payloadTransformers The transformers to use to convert the payloads to the destination payloads\n * @param destinationSchema The schema of the destination payloads\n * @returns The reduced payloads\n */\nexport const reducePayloadsArray = async <T extends Payload = Payload>(\n payloadsArray: Payload[][],\n payloadTransformers: SchemaToPayloadTransformersDictionary,\n destinationSchema: string,\n): Promise<T[]> => {\n return await Promise.all(\n payloadsArray.map(async (payloads) => {\n return await reducePayloads<T>(payloads, payloadTransformers, destinationSchema)\n }),\n )\n}\n","import { containsAll } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { AbstractDiviner } from '@xyo-network/abstract-diviner'\nimport { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport {\n SchemaToJsonPathTransformExpressionsDictionary,\n SchemaToPayloadTransformersDictionary,\n TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema,\n TemporalIndexingDivinerIndexCandidateToIndexDivinerParams,\n TemporalIndexingDivinerResultIndex,\n TemporalIndexingDivinerResultIndexSchema,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport { PayloadHasher } from '@xyo-network/hash'\nimport { Labels } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload, PayloadFields } from '@xyo-network/payload-model'\n\nimport { jsonPathToTransformersDictionary } from '../jsonpath'\n\nexport type IndexablePayloads = [BoundWitness, ...Payload[]]\n\nconst moduleName = 'TemporalIndexingDivinerIndexCandidateToIndexDiviner'\n\n/**\n * Diviner which transforms index candidates to indexes using JSON Path to map\n * source properties in the supplied payloads to destination fields in the\n * resultant index\n */\nexport class TemporalIndexingDivinerIndexCandidateToIndexDiviner<\n TParams extends TemporalIndexingDivinerIndexCandidateToIndexDivinerParams = TemporalIndexingDivinerIndexCandidateToIndexDivinerParams,\n> extends AbstractDiviner<TParams> {\n static override configSchema = TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema\n static override configSchemas = [DivinerConfigSchema, TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema]\n static labels: Labels = {\n 'network.xyo.diviner.stage': 'indexCandidateToIndexDiviner',\n }\n\n private _indexableSchemas: string[] | undefined\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n\n /**\n * List of indexable schemas for this diviner\n */\n protected get indexableSchemas(): string[] {\n if (!this._indexableSchemas) this._indexableSchemas = [...Object.keys(this.schemaTransforms)]\n return this._indexableSchemas\n }\n\n /**\n * Dictionary of schemas to payload transformers for creating indexes\n * from the payloads within a Bound Witness\n */\n protected get payloadTransformers(): SchemaToPayloadTransformersDictionary {\n if (!this._payloadTransformers) this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms)\n return this._payloadTransformers\n }\n\n /**\n * The dictionary of schemas to JSON Path transform expressions for creating indexes\n * from the payloads within a Bound Witness\n */\n protected get schemaTransforms(): SchemaToJsonPathTransformExpressionsDictionary {\n return assertEx(this.config?.schemaTransforms, () => `${moduleName}: Missing config.schemaTransforms section`)\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<Payload[]> {\n const bws: BoundWitness[] = payloads.filter(isBoundWitness)\n const indexablePayloads: Payload[] = payloads.filter((p) => this.isIndexablePayload(p))\n if (bws.length && indexablePayloads.length) {\n const payloadDictionary = await PayloadHasher.toMap(payloads)\n const validIndexableTuples: IndexablePayloads[] = bws.reduce<IndexablePayloads[]>((indexableTuples, bw) => {\n // If this Bound Witness doesn't contain all the required schemas don't index it\n if (!containsAll(bw.payload_schemas, this.indexableSchemas)) return indexableTuples\n // Find the remaining indexable payloads\n const indexablePayloadPositions = this.indexableSchemas.map((schema) => bw.payload_schemas.indexOf(schema))\n const indexablePayloadHashes = indexablePayloadPositions.map((index) => bw.payload_hashes?.[index])\n const indexablePayloads = indexablePayloadHashes.map((hash) => payloadDictionary[hash]).filter(exists)\n // If we found a timestamp and the right amount of indexable payloads (of the\n // correct schema as checked above) in this BW, then index it\n if (indexablePayloads.length === this.indexableSchemas.length) indexableTuples.push([bw, ...indexablePayloads])\n return indexableTuples\n }, [])\n // Create the indexes from the tuples\n const indexes = await Promise.all(\n validIndexableTuples.map<Promise<TemporalIndexingDivinerResultIndex>>(async ([bw, ...sourcePayloads]) => {\n // Use the payload transformers to convert the fields from the source payloads to the destination fields\n const indexFields = sourcePayloads\n .map<PayloadFields[]>((payload) => {\n // Find the transformers for this payload\n const transformers = this.payloadTransformers[payload.schema]\n // If transformers exist, apply them to the payload otherwise return an empty array\n return transformers ? transformers.map((transform) => transform(payload)) : []\n })\n .flat()\n // Include all the sources for reference\n const sources = Object.keys(await PayloadHasher.toMap([bw, ...sourcePayloads]))\n // Build and return the index\n return await new PayloadBuilder<TemporalIndexingDivinerResultIndex>({ schema: TemporalIndexingDivinerResultIndexSchema })\n .fields(Object.assign({ sources }, ...indexFields))\n .build()\n }),\n )\n return indexes.flat()\n }\n return Promise.resolve([])\n }\n\n /**\n * Identifies if a payload is one that is indexed by this diviner\n * @param x The candidate payload\n * @returns True if the payload is one indexed by this diviner, false otherwise\n */\n protected isIndexablePayload = (x: Payload) => {\n return this.indexableSchemas.includes(x?.schema)\n }\n\n /**\n * Identifies if a schema is one that is indexed by this diviner\n * @param schema The candidate schema\n * @returns True if this schema is one indexed by this diviner, false otherwise\n */\n protected isIndexableSchema = (schema?: string | null) => {\n return this.indexableSchemas.some((s) => s === schema)\n }\n}\n","import { AbstractDiviner } from '@xyo-network/abstract-diviner'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport { isPayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport { Labels } from '@xyo-network/module-model'\nimport { Payload } from '@xyo-network/payload-model'\n\n/**\n * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response\n */\nexport class TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner extends AbstractDiviner {\n static override readonly configSchema = TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema\n static override configSchemas = [DivinerConfigSchema, TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema]\n static labels: Labels = {\n 'network.xyo.diviner.stage': 'indexQueryResponseToDivinerQueryResponseDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<Payload[]> {\n // NOTE: We're not doing anything with the query payloads but some diviners\n // might want to use this to transform from the query to the response (for example\n // if we use a plaintext value in the query to generate a hash key in the index)\n // const queries = payloads.filter(isPayloadDivinerQueryPayload)\n const responses = payloads.filter((p) => !isPayloadDivinerQueryPayload(p))\n return await Promise.resolve(responses)\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { AbstractDiviner } from '@xyo-network/abstract-diviner'\nimport { ArchivistInstance } from '@xyo-network/archivist-model'\nimport { ArchivistWrapper } from '@xyo-network/archivist-wrapper'\nimport { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessDivinerQueryPayload, BoundWitnessDivinerQuerySchema } from '@xyo-network/diviner-boundwitness-model'\nimport { IndexingDivinerState } from '@xyo-network/diviner-indexing-model'\nimport { DivinerConfigSchema } from '@xyo-network/diviner-model'\nimport {\n TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema,\n TemporalIndexingDivinerStateToIndexCandidateDivinerParams,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport { DivinerWrapper } from '@xyo-network/diviner-wrapper'\nimport { isModuleState, Labels, ModuleState, ModuleStateSchema } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { isPayloadOfSchemaType, Payload } from '@xyo-network/payload-model'\nimport { TimeStamp, TimestampSchema } from '@xyo-network/witness-timestamp'\n\n/**\n * All Payload types involved in index candidates for indexing\n */\nexport type IndexCandidate = BoundWitness | Payload | TimeStamp\n\n/**\n * The response from the TemporalStateToIndexCandidateDiviner\n */\nexport type TemporalStateToIndexCandidateDivinerResponse = [\n /**\n * The next state of the diviner\n */\n nextState: ModuleState<IndexingDivinerState>,\n /**\n * The index candidates\n */\n ...IndexCandidate[],\n]\n\n/**\n * The default order to search Bound Witnesses to identify index candidates\n */\nconst order = 'asc'\n\n/**\n * The name of the module (for logging purposes)\n */\nconst moduleName = 'TemporalIndexingDivinerStateToIndexCandidateDiviner'\n\n/**\n * Transforms candidates for image thumbnail indexing into their indexed representation\n */\nexport class TemporalIndexingDivinerStateToIndexCandidateDiviner<\n TParams extends TemporalIndexingDivinerStateToIndexCandidateDivinerParams = TemporalIndexingDivinerStateToIndexCandidateDivinerParams,\n> extends AbstractDiviner<TParams> {\n static override readonly configSchema = TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema\n static override configSchemas = [DivinerConfigSchema, TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema]\n static labels: Labels = {\n 'network.xyo.diviner.stage': 'stateToIndexCandidateDiviner',\n }\n\n get payloadDivinerLimit() {\n return this.config.payloadDivinerLimit ?? 1_000\n }\n\n /**\n * The required payload_schemas within BoundWitnesses to identify index candidates\n */\n protected get payload_schemas(): string[] {\n const schemas = this.config.filter?.payload_schemas\n return [TimestampSchema, ...(schemas ?? [])]\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<[ModuleState, ...IndexCandidate[]]> {\n // Retrieve the last state from what was passed in\n const lastState = payloads.find(isModuleState<IndexingDivinerState>)\n // If there is no last state, start from the beginning\n if (!lastState) return [{ schema: ModuleStateSchema, state: { offset: 0 } }]\n // Otherwise, get the last offset\n const { offset } = lastState.state\n // Get next batch of results starting from the offset\n const boundWitnessDiviner = await this.getBoundWitnessDivinerForStore()\n if (!boundWitnessDiviner) return [lastState]\n const query = await new PayloadBuilder<BoundWitnessDivinerQueryPayload>({ schema: BoundWitnessDivinerQuerySchema })\n .fields({ limit: this.payloadDivinerLimit, offset, order, payload_schemas: this.payload_schemas })\n .build()\n const batch = await boundWitnessDiviner.divine([query])\n if (batch.length === 0) return [lastState]\n // Get source data\n const sourceArchivist = await this.getArchivistForStore()\n if (!sourceArchivist) return [lastState]\n const indexCandidates: IndexCandidate[] = (\n await Promise.all(batch.filter(isBoundWitness).map((bw) => this.getPayloadsInBoundWitness(bw, sourceArchivist)))\n )\n .filter(exists)\n .flat()\n const nextState = { schema: ModuleStateSchema, state: { ...lastState.state, offset: offset + batch.length } }\n return [nextState, ...indexCandidates]\n }\n /**\n * Retrieves the archivist for the payloadStore\n * @returns The archivist for the payloadStore or undefined if not resolvable\n */\n protected async getArchivistForStore(): Promise<ArchivistWrapper | undefined> {\n // It should be defined, so we'll error if it's not\n const name: string = assertEx(this.config?.payloadStore?.archivist, () => `${moduleName}: Config for payloadStore.archivist not specified`)\n // It might not be resolvable (yet), so we'll return undefined if it's not\n const mod = await this.resolve(name)\n if (!mod) return undefined\n // Return the wrapped archivist\n return ArchivistWrapper.wrap(mod, this.account)\n }\n\n /**\n * Retrieves the BoundWitness Diviner for the payloadStore\n * @returns The BoundWitness Diviner for the payloadStore or undefined if not resolvable\n */\n protected async getBoundWitnessDivinerForStore(): Promise<DivinerWrapper | undefined> {\n // It should be defined, so we'll error if it's not\n const name: string = assertEx(\n this.config?.payloadStore?.boundWitnessDiviner,\n () => `${moduleName}: Config for payloadStore.boundWitnessDiviner not specified`,\n )\n // It might not be resolvable (yet), so we'll return undefined if it's not\n const mod = await this.resolve(name)\n if (!mod) return undefined\n // Return the wrapped diviner\n return DivinerWrapper.wrap(mod, this.account)\n }\n\n protected async getPayloadsInBoundWitness(bw: BoundWitness, archivist: ArchivistInstance): Promise<IndexCandidate[] | undefined> {\n const indexes = this.payload_schemas.map((schema) => bw.payload_schemas?.findIndex((s) => s === schema))\n const hashes = indexes.map((index) => bw.payload_hashes?.[index])\n const results = await archivist.get(hashes)\n const indexCandidateIdentityFunctions = this.payload_schemas.map(isPayloadOfSchemaType)\n const filteredResults = indexCandidateIdentityFunctions.map((is) => results.find(is))\n if (filteredResults.some((f) => f === undefined)) return undefined\n const indexCandidates: IndexCandidate[] = filteredResults.filter(exists) as IndexCandidate[]\n return [bw, ...indexCandidates]\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,qCAAgC;AAChC,oCAA4C;AAC5C,2BAA2E;AAC3E,6CAAmF;AAG5E,IAAM,0BAAN,cAKG,+CAAgD;AAAA,EACxD,OAAyB,eAAe;AAAA,EACxC,OAAyB,gBAA0B,CAAC,4EAAqC,2DAA6B,wCAAmB;AAAA,EAEzI,MAAyB,eAAiC;AACxD,UAAM,MAAM,aAAa;AACzB,WAAO;AAAA,EACT;AACF;;;ACnBA,8BAAgC;AAChC,IAAAA,wBAAoC;AACpC,mCAAsE;AACtE,IAAAC,0CAMO;AAEP,IAAAC,0BAA+B;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AA,EAChC;AACF;","names":["import_diviner_model","import_diviner_temporal_indexing_model","import_payload_builder","jsonpath","import_abstract_diviner","import_diviner_model","import_diviner_temporal_indexing_model","import_hash","import_payload_builder","indexablePayloads","import_abstract_diviner","import_diviner_model","import_diviner_payload_model","import_diviner_temporal_indexing_model","import_assert","import_exists","import_abstract_diviner","import_boundwitness_model","import_diviner_model","import_diviner_temporal_indexing_model","import_payload_builder","import_payload_model","moduleName"]}
|