@xyo-network/diviner-temporal-indexing-memory 6.0.0 → 6.0.1

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.
Files changed (37) hide show
  1. package/dist/browser/Diviner.d.ts +1 -1
  2. package/dist/browser/Diviner.d.ts.map +1 -1
  3. package/dist/browser/DivinerQueryToIndexQueryDiviner/Diviner.d.ts +1 -1
  4. package/dist/browser/DivinerQueryToIndexQueryDiviner/Diviner.d.ts.map +1 -1
  5. package/dist/browser/IndexCandidateToIndexDiviner/Diviner.d.ts +1 -1
  6. package/dist/browser/IndexCandidateToIndexDiviner/Diviner.d.ts.map +1 -1
  7. package/dist/browser/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.d.ts +1 -1
  8. package/dist/browser/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.d.ts.map +1 -1
  9. package/dist/browser/StateToIndexCandidateDiviner/Diviner.d.ts +29 -14
  10. package/dist/browser/StateToIndexCandidateDiviner/Diviner.d.ts.map +1 -1
  11. package/dist/browser/index.mjs +17 -14
  12. package/dist/browser/index.mjs.map +3 -3
  13. package/dist/neutral/Diviner.d.ts +1 -1
  14. package/dist/neutral/Diviner.d.ts.map +1 -1
  15. package/dist/neutral/DivinerQueryToIndexQueryDiviner/Diviner.d.ts +1 -1
  16. package/dist/neutral/DivinerQueryToIndexQueryDiviner/Diviner.d.ts.map +1 -1
  17. package/dist/neutral/IndexCandidateToIndexDiviner/Diviner.d.ts +1 -1
  18. package/dist/neutral/IndexCandidateToIndexDiviner/Diviner.d.ts.map +1 -1
  19. package/dist/neutral/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.d.ts +1 -1
  20. package/dist/neutral/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.d.ts.map +1 -1
  21. package/dist/neutral/StateToIndexCandidateDiviner/Diviner.d.ts +29 -14
  22. package/dist/neutral/StateToIndexCandidateDiviner/Diviner.d.ts.map +1 -1
  23. package/dist/neutral/index.mjs +17 -14
  24. package/dist/neutral/index.mjs.map +3 -3
  25. package/dist/node/Diviner.d.ts +1 -1
  26. package/dist/node/Diviner.d.ts.map +1 -1
  27. package/dist/node/DivinerQueryToIndexQueryDiviner/Diviner.d.ts +1 -1
  28. package/dist/node/DivinerQueryToIndexQueryDiviner/Diviner.d.ts.map +1 -1
  29. package/dist/node/IndexCandidateToIndexDiviner/Diviner.d.ts +1 -1
  30. package/dist/node/IndexCandidateToIndexDiviner/Diviner.d.ts.map +1 -1
  31. package/dist/node/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.d.ts +1 -1
  32. package/dist/node/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.d.ts.map +1 -1
  33. package/dist/node/StateToIndexCandidateDiviner/Diviner.d.ts +29 -14
  34. package/dist/node/StateToIndexCandidateDiviner/Diviner.d.ts.map +1 -1
  35. package/dist/node/index.mjs +17 -14
  36. package/dist/node/index.mjs.map +3 -3
  37. package/package.json +47 -57
@@ -1,7 +1,7 @@
1
1
  import { IndexingDiviner } from '@xyo-network/diviner-indexing-memory';
2
2
  import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
3
3
  import type { TemporalIndexingDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
4
- import type { Payload, Schema } from '@xyo-network/payload-model';
4
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
5
5
  export declare class TemporalIndexingDiviner<TParams extends TemporalIndexingDivinerParams = TemporalIndexingDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends IndexingDiviner<TParams, TIn, TOut, TEventData> {
6
6
  static readonly configSchemas: Schema[];
7
7
  static readonly defaultConfigSchema: Schema;
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"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AO,GAAG,OAAO,EAC9B,UAAU,SAAS,sBAAsB,CAAC,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,sBAAsB,CAChH,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EACnC,GAAG,EACH,IAAI,CACL,CACD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;IACvD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAgE;IAChH,gBAAyB,mBAAmB,EAAE,MAAM,CAAsC;cAEjE,YAAY;CAGtC"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model';
3
3
  import type { TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
4
4
  import type { Labels } from '@xyo-network/module-model';
5
- import type { Payload, Schema } from '@xyo-network/payload-model';
5
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
6
6
  /**
7
7
  * A diviner that converts diviner query to index query
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/DivinerQueryToIndexQueryDiviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,KAAK,EAAE,8CAA8C,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAA;AAGhJ,OAAO,KAAK,EAAE,4DAA4D,EAAE,MAAM,8CAA8C,CAAA;AAKhI,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAGjE;;GAEG;AACH,qBAAa,sDAAs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Aa,WAA+F;IACrI,gBAAyB,mBAAmB;;MAAqE;IACjH,gBAAyB,MAAM,EAAE,MAAM,CAGtC;IAED,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,oBAAoB,CAAmD;IAE/E;;OAEG;IACH,SAAS,KAAK,kBAAkB,IAAI,MAAM,CAEzC;IAED;;OAEG;IACH,SAAS,KAAK,gBAAgB,IAAI,MAAM,CAEvC;IAED;;OAEG;IACH,SAAS,KAAK,WAAW,IAAI,MAAM,CAElC;IAED;;OAEG;IACH,SAAS,KAAK,gBAAgB,IAAI,MAAM,EAAE,CAGzC;IAED;;;OAGG;IACH,SAAS,KAAK,mBAAmB,IAAI,qCAAqC,CAGzE;IAED;;;OAGG;IACH,SAAS,KAAK,gBAAgB,IAAI,8CAA8C,CAsB/E;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAuBrF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model';
3
3
  import type { TemporalIndexingDivinerIndexCandidateToIndexDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
4
4
  import type { Labels } from '@xyo-network/module-model';
5
- import type { Payload, Schema } from '@xyo-network/payload-model';
5
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
6
6
  /**
7
7
  * Diviner which transforms index candidates to indexes using JSON Path to map
8
8
  * source properties in the supplied payloads to destination fields in the
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/IndexCandidateToIndexDiviner/Diviner.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,KAAK,EAAE,8CAA8C,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAA;AAChJ,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M,2BAA2B,CAAA;AACvD,OAAO,KAAK,EACI,OAAO,EAAE,MAAM,EAC9B,MAAM,8BAA8B,CAAA;AASrC;;;;GAIG;AACH,qBAAa,mDAAmD,CAC9D,OAAO,SAAS,yDAAyD,GAAG,yDAAyD,CACrI,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4F;IAC5I,gBAAyB,mBAAmB,EAAE,MAAM,CAAkE;IACtH,gBAAyB,MAAM,EAAE,MAAM,CAGtC;IAED,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,oBAAoB,CAAmD;IAE/E;;OAEG;IACH,SAAS,KAAK,gBAAgB,IAAI,MAAM,EAAE,CAGzC;IAED;;;OAGG;IACH,SAAS,KAAK,mBAAmB,IAAI,qCAAqC,CAGzE;IAED;;;OAGG;IACH,SAAS,KAAK,gBAAgB,IAAI,8CAA8C,CAE/E;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAyDpF;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,GAAI,GAAG,OAAO,aAEzC;IAED;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,GAAI,SAAS,MAAM,GAAG,IAAI,aAEpD;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { Labels } from '@xyo-network/module-model';
3
- import type { Payload, Schema } from '@xyo-network/payload-model';
3
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
4
4
  /**
5
5
  * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE;;GAEG;AACH,qBAAa,sEAAuE,SAAQ,eAAe;IACzG,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAG/C;IAED,gBAAyB,mBAAmB,EAAE,MAAM,CAAqF;IACzI,gBAAyB,MAAM,EAAE,MAAM,CAGtC;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAQrF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAEnE;;GAEG;AACH,qBAAa,sEAAuE,SAAQ,eAAe;IACzG,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAG/C;IAED,gBAAyB,mBAAmB,EAAE,MAAM,CAAqF;IACzI,gBAAyB,MAAM,EAAE,MAAM,CAGtC;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAQrF"}
@@ -1,6 +1,5 @@
1
1
  import type { ArchivistInstance } from '@xyo-network/archivist-model';
2
2
  import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
3
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
4
3
  import { AbstractDiviner } from '@xyo-network/diviner-abstract';
5
4
  import type { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness/abstract';
6
5
  import type { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness/model';
@@ -8,7 +7,7 @@ import type { IndexingDivinerState } from '@xyo-network/diviner-indexing-model';
8
7
  import type { TemporalIndexingDivinerStateToIndexCandidateDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
9
8
  import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
10
9
  import type { Labels, ModuleState } from '@xyo-network/module-model';
11
- import type { Payload, Schema, WithStorageMeta } from '@xyo-network/payload-model';
10
+ import type { BoundWitness, Payload, Schema, WithStorageMeta } from '@xyo-network/sdk-protocol-js';
12
11
  import type { TimeStamp } from '@xyo-network/witness-timestamp';
13
12
  /**
14
13
  * All Payload types involved in index candidates for indexing
@@ -53,13 +52,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
53
52
  schema: "network.xyo.boundwitness" & {
54
53
  readonly __schema: true;
55
54
  };
56
- addresses: (Lowercase<string> & {
55
+ addresses: ((Lowercase<string> & {
57
56
  readonly __hex: true;
58
57
  } & {
59
58
  readonly __address: true;
60
- })[];
59
+ }) | (Lowercase<string> & {
60
+ readonly __hex: true;
61
+ } & {
62
+ readonly __address: true;
63
+ }))[];
61
64
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
62
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
65
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
63
66
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
64
67
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
65
68
  $destination?: (Lowercase<string> & {
@@ -72,13 +75,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
72
75
  schema: "network.xyo.boundwitness" & {
73
76
  readonly __schema: true;
74
77
  };
75
- addresses: (Lowercase<string> & {
78
+ addresses: ((Lowercase<string> & {
79
+ readonly __hex: true;
80
+ } & {
81
+ readonly __address: true;
82
+ }) | (Lowercase<string> & {
76
83
  readonly __hex: true;
77
84
  } & {
78
85
  readonly __address: true;
79
- })[];
86
+ }))[];
80
87
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
81
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
88
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
82
89
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
83
90
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
84
91
  $destination?: (Lowercase<string> & {
@@ -91,13 +98,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
91
98
  schema: "network.xyo.boundwitness" & {
92
99
  readonly __schema: true;
93
100
  };
94
- addresses: (Lowercase<string> & {
101
+ addresses: ((Lowercase<string> & {
95
102
  readonly __hex: true;
96
103
  } & {
97
104
  readonly __address: true;
98
- })[];
105
+ }) | (Lowercase<string> & {
106
+ readonly __hex: true;
107
+ } & {
108
+ readonly __address: true;
109
+ }))[];
99
110
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
100
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
111
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
101
112
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
102
113
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
103
114
  $destination?: (Lowercase<string> & {
@@ -110,13 +121,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
110
121
  schema: "network.xyo.boundwitness" & {
111
122
  readonly __schema: true;
112
123
  };
113
- addresses: (Lowercase<string> & {
124
+ addresses: ((Lowercase<string> & {
125
+ readonly __hex: true;
126
+ } & {
127
+ readonly __address: true;
128
+ }) | (Lowercase<string> & {
114
129
  readonly __hex: true;
115
130
  } & {
116
131
  readonly __address: true;
117
- })[];
132
+ }))[];
118
133
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
119
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
134
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
120
135
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
121
136
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
122
137
  $destination?: (Lowercase<string> & {
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/StateToIndexCandidateDiviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,8BAA8B,CAAA;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAGnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAA;AACzH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,KAAK,EAAE,yDAAyD,EAAE,MAAM,8CAA8C,CAAA;AAE7H,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EACV,MAAM,EAAoB,WAAW,EACtC,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EACV,OAAO,EAAE,MAAM,EACf,eAAe,EAChB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAG/D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD;;OAEG;IACH,SAAS,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAC5C;;OAEG;IACH,GAAG,cAAc,EAAE;CACpB,CAAA;AAYD;;GAEG;AACH,qBAAa,mD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B,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,SAAS,CAAC;CAOjI"}
@@ -17,8 +17,7 @@ import {
17
17
  TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema,
18
18
  TemporalIndexingDivinerResultIndexSchema
19
19
  } from "@xyo-network/diviner-temporal-indexing-model";
20
- import { PayloadBuilder } from "@xyo-network/payload-builder";
21
- import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
20
+ import { isPayloadOfSchemaType, PayloadBuilder } from "@xyo-network/sdk-protocol-js";
22
21
  var TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner = class extends AbstractDiviner {
23
22
  static configSchemas = [...super.configSchemas, TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema];
24
23
  static defaultConfigSchema = TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema;
@@ -50,7 +49,7 @@ var TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner = class extends Abstr
50
49
  * List of indexable schemas for this diviner
51
50
  */
52
51
  get indexableSchemas() {
53
- if (!this._indexableSchemas) this._indexableSchemas = Object.keys(this.schemaTransforms);
52
+ this._indexableSchemas ??= Object.keys(this.schemaTransforms);
54
53
  return this._indexableSchemas;
55
54
  }
56
55
  /**
@@ -58,7 +57,7 @@ var TemporalIndexingDivinerDivinerQueryToIndexQueryDiviner = class extends Abstr
58
57
  * from the payloads within a Bound Witness
59
58
  */
60
59
  get payloadTransformers() {
61
- if (!this._payloadTransformers) this._payloadTransformers = jsonPathToTransformersDictionary(this.schemaTransforms);
60
+ this._payloadTransformers ??= jsonPathToTransformersDictionary(this.schemaTransforms);
62
61
  return this._payloadTransformers;
63
62
  }
64
63
  /**
@@ -113,16 +112,18 @@ import {
113
112
  containsAll,
114
113
  exists
115
114
  } from "@xylabs/sdk-js";
116
- import { intraBoundwitnessSchemaCombinations } from "@xyo-network/boundwitness-builder";
117
- import { isBoundWitness } from "@xyo-network/boundwitness-model";
118
115
  import { AbstractDiviner as AbstractDiviner2 } from "@xyo-network/diviner-abstract";
119
116
  import { jsonPathToTransformersDictionary as jsonPathToTransformersDictionary2 } from "@xyo-network/diviner-jsonpath-aggregate-memory";
120
117
  import {
121
118
  TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema,
122
119
  TemporalIndexingDivinerResultIndexSchema as TemporalIndexingDivinerResultIndexSchema2
123
120
  } from "@xyo-network/diviner-temporal-indexing-model";
124
- import { PayloadBuilder as PayloadBuilder2 } from "@xyo-network/payload-builder";
125
- import { isAnyPayload } from "@xyo-network/payload-model";
121
+ import {
122
+ intraBoundwitnessSchemaCombinations,
123
+ isAnyPayload,
124
+ isBoundWitness,
125
+ PayloadBuilder as PayloadBuilder2
126
+ } from "@xyo-network/sdk-protocol-js";
126
127
  var moduleName = "TemporalIndexingDivinerIndexCandidateToIndexDiviner";
127
128
  var TemporalIndexingDivinerIndexCandidateToIndexDiviner = class extends AbstractDiviner2 {
128
129
  static configSchemas = [...super.configSchemas, TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema];
@@ -137,7 +138,7 @@ var TemporalIndexingDivinerIndexCandidateToIndexDiviner = class extends Abstract
137
138
  * List of indexable schemas for this diviner
138
139
  */
139
140
  get indexableSchemas() {
140
- if (!this._indexableSchemas) this._indexableSchemas = Object.keys(this.schemaTransforms);
141
+ this._indexableSchemas ??= Object.keys(this.schemaTransforms);
141
142
  return this._indexableSchemas;
142
143
  }
143
144
  /**
@@ -145,7 +146,7 @@ var TemporalIndexingDivinerIndexCandidateToIndexDiviner = class extends Abstract
145
146
  * from the payloads within a Bound Witness
146
147
  */
147
148
  get payloadTransformers() {
148
- if (!this._payloadTransformers) this._payloadTransformers = jsonPathToTransformersDictionary2(this.schemaTransforms);
149
+ this._payloadTransformers ??= jsonPathToTransformersDictionary2(this.schemaTransforms);
149
150
  return this._payloadTransformers;
150
151
  }
151
152
  /**
@@ -225,14 +226,16 @@ var TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner = cla
225
226
  // src/StateToIndexCandidateDiviner/Diviner.ts
226
227
  import { assertEx as assertEx2, exists as exists2 } from "@xylabs/sdk-js";
227
228
  import { ArchivistWrapper } from "@xyo-network/archivist-wrapper";
228
- import { intraBoundwitnessSchemaCombinations as intraBoundwitnessSchemaCombinations2 } from "@xyo-network/boundwitness-builder";
229
- import { isBoundWitness as isBoundWitness2 } from "@xyo-network/boundwitness-model";
230
- import { payloadSchemasContainsAll } from "@xyo-network/boundwitness-validator";
231
229
  import { AbstractDiviner as AbstractDiviner4 } from "@xyo-network/diviner-abstract";
232
230
  import { TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema } from "@xyo-network/diviner-temporal-indexing-model";
233
231
  import { DivinerWrapper } from "@xyo-network/diviner-wrapper";
234
232
  import { isModuleState, ModuleStateSchema } from "@xyo-network/module-model";
235
- import { SequenceConstants } from "@xyo-network/payload-model";
233
+ import {
234
+ intraBoundwitnessSchemaCombinations as intraBoundwitnessSchemaCombinations2,
235
+ isBoundWitness as isBoundWitness2,
236
+ payloadSchemasContainsAll,
237
+ SequenceConstants
238
+ } from "@xyo-network/sdk-protocol-js";
236
239
  import { TimestampSchema } from "@xyo-network/witness-timestamp";
237
240
  var order = "asc";
238
241
  var moduleName2 = "TemporalIndexingDivinerStateToIndexCandidateDiviner";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/Diviner.ts", "../../src/DivinerQueryToIndexQueryDiviner/Diviner.ts", "../../src/IndexCandidateToIndexDiviner/Diviner.ts", "../../src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts", "../../src/StateToIndexCandidateDiviner/Diviner.ts"],
4
- "sourcesContent": ["import { IndexingDiviner } from '@xyo-network/diviner-indexing-memory'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { TemporalIndexingDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport { TemporalIndexingDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Payload, Schema } 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<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<\n DivinerInstance<TParams, TIn, TOut>,\n TIn,\n TOut\n >,\n> extends IndexingDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, TemporalIndexingDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerConfigSchema\n\n protected override async startHandler() {\n await super.startHandler()\n }\n}\n", "import type { Hash } from '@xylabs/sdk-js'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { jsonPathToTransformersDictionary, reducePayloads } from '@xyo-network/diviner-jsonpath-aggregate-memory'\nimport type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model'\nimport type { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport type { TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport {\n TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema,\n TemporalIndexingDivinerResultIndexSchema,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Labels } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n// TODO: Inherit from JsonPathAggregateDiviner\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 configSchemas = [...super.configSchemas, TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema]\n static override readonly defaultConfigSchema = TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'divinerQueryToIndexQueryDiviner',\n }\n\n private _indexableSchemas: Schema[] | undefined\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n\n /**\n * The schema of the diviner query payloads\n */\n protected get divinerQuerySchema(): Schema {\n return this.config.divinerQuerySchema ?? PayloadDivinerQuerySchema\n }\n\n /**\n * The schema of the index query payloads\n */\n protected get indexQuerySchema(): Schema {\n return this.config.indexQuerySchema ?? PayloadDivinerQuerySchema\n }\n\n /**\n * The schema of the index payloads\n */\n protected get indexSchema(): Schema {\n return this.config.indexSchema ?? TemporalIndexingDivinerResultIndexSchema\n }\n\n /**\n * List of indexable schemas for this diviner\n */\n protected get indexableSchemas(): Schema[] {\n if (!this._indexableSchemas) this._indexableSchemas = Object.keys(this.schemaTransforms) as Schema[]\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: 'cursor',\n sourcePathExpression: '$.cursor',\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const queries = payloads.filter(isPayloadOfSchemaType<PayloadDivinerQueryPayload>(this.divinerQuerySchema as any))\n if (queries.length > 0) {\n return await Promise.all(\n queries.map(async (query) => {\n const fields = await reducePayloads<PayloadDivinerQueryPayload & { $sources?: Hash[]; sources?: Hash[] }>(\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 delete fields?.$sources\n // TODO: Add support for additional filters\n return new PayloadBuilder<Payload>({ schema: this.indexQuerySchema }).fields(fields).build()\n }),\n )\n }\n return []\n }\n}\n", "import type { Hash } from '@xylabs/sdk-js'\nimport {\n assertEx, containsAll, exists,\n} from '@xylabs/sdk-js'\nimport { intraBoundwitnessSchemaCombinations } from '@xyo-network/boundwitness-builder'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { jsonPathToTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-memory'\nimport type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model'\nimport type {\n TemporalIndexingDivinerIndexCandidateToIndexDivinerParams,\n TemporalIndexingDivinerResultIndex,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport {\n TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema,\n TemporalIndexingDivinerResultIndexSchema,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Labels } from '@xyo-network/module-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { isAnyPayload } from '@xyo-network/payload-model'\n\ntype IndexableHashes = [Hash, ...Hash[]]\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 readonly configSchemas: Schema[] = [...super.configSchemas, TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'indexCandidateToIndexDiviner',\n }\n\n private _indexableSchemas: Schema[] | undefined\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n\n /**\n * List of indexable schemas for this diviner\n */\n protected get indexableSchemas(): Schema[] {\n if (!this._indexableSchemas) this._indexableSchemas = Object.keys(this.schemaTransforms) as Schema[]\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 // If the Bound Witness does not contain all the required schemas do not index it\n const indexableBoundWitnesses = payloads\n .filter(isBoundWitness)\n .filter(bw => containsAll(bw.payload_schemas, this.indexableSchemas))\n // If the Payload is not one of the indexable schemas do not index it\n const indexablePayloads = payloads.filter(p => this.isIndexablePayload(p))\n // If there is nothing to index, return an empty array\n if (indexableBoundWitnesses.length === 0 || indexablePayloads.length === 0) return []\n // Hash all the indexable data once\n const [bwDictionary, payloadDictionary] = await Promise.all([\n PayloadBuilder.toHashMap(indexableBoundWitnesses),\n PayloadBuilder.toAllHashMap(indexablePayloads),\n ])\n\n // Initialize the array for validIndexableTuples outside of the loop\n const validIndexableTuples: IndexableHashes[] = []\n\n // Iterate over each entry in bwDictionary\n for (const [bwHash, bw] of Object.entries(bwDictionary) as [Hash, BoundWitness][]) {\n // Find the combinations of payloads that satisfy the required schemas\n const combinations = intraBoundwitnessSchemaCombinations(bw, this.indexableSchemas)\n\n // Iterate over each combination\n for (const combination of combinations) {\n const indexablePayloads = combination.map(hash => payloadDictionary[hash]).filter(exists)\n\n // If we found the right amount of indexable payloads (of the correct schema as checked\n // above) in this BW, then index it\n if (indexablePayloads.length === this.indexableSchemas.length) {\n validIndexableTuples.push([bwHash, ...combination])\n }\n }\n }\n\n // Create the indexes from the tuples\n const indexes = validIndexableTuples.map<TemporalIndexingDivinerResultIndex>(([bwHash, ...sourcePayloadHashes]) => {\n const sourcePayloads = sourcePayloadHashes.map(hash => payloadDictionary[hash])\n // Use the payload transformers to convert the fields from the source payloads to the destination fields\n const indexFields = sourcePayloads.flatMap((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 // Include all the sources for reference\n const $sources: Hash[] = [bwHash, ...sourcePayloadHashes]\n // Build and return the index\n return new PayloadBuilder<TemporalIndexingDivinerResultIndex>({ schema: TemporalIndexingDivinerResultIndexSchema })\n .fields(Object.assign({}, ...indexFields))\n .meta({ $sources })\n .build()\n })\n return indexes.flat()\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: unknown) => {\n return isAnyPayload(x) && 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?: Schema | null) => {\n return typeof schema === 'string' ? this.indexableSchemas.includes(schema) : false\n }\n}\n", "import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { isPayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Labels } from '@xyo-network/module-model'\nimport type { Payload, Schema } 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 configSchemas: Schema[] = [\n ...super.configSchemas,\n TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema,\n ]\n\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'indexQueryResponseToDivinerQueryResponseDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<Payload[]> {\n // 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, exists } from '@xylabs/sdk-js'\nimport type { ArchivistInstance, ArchivistNextOptions } from '@xyo-network/archivist-model'\nimport { ArchivistWrapper } from '@xyo-network/archivist-wrapper'\nimport { intraBoundwitnessSchemaCombinations } from '@xyo-network/boundwitness-builder'\nimport type { BoundWitness } from '@xyo-network/boundwitness-model'\nimport { isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { payloadSchemasContainsAll } from '@xyo-network/boundwitness-validator'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness/abstract'\nimport type { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness/model'\nimport type { IndexingDivinerState } from '@xyo-network/diviner-indexing-model'\nimport type { TemporalIndexingDivinerStateToIndexCandidateDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport { TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport { DivinerWrapper } from '@xyo-network/diviner-wrapper'\nimport type {\n Labels, ModuleIdentifier, ModuleState,\n} from '@xyo-network/module-model'\nimport { isModuleState, ModuleStateSchema } from '@xyo-network/module-model'\nimport type {\n Payload, Schema,\n WithStorageMeta,\n} from '@xyo-network/payload-model'\nimport { SequenceConstants } from '@xyo-network/payload-model'\nimport type { TimeStamp } from '@xyo-network/witness-timestamp'\nimport { 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, Payload, ModuleState | IndexCandidate> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'stateToIndexCandidateDiviner',\n }\n\n get payloadDivinerLimit() {\n return this.config.payloadDivinerLimit ?? 1000\n }\n\n /**\n * The required payload_schemas within BoundWitnesses to identify index candidates\n */\n protected get payload_schemas(): Schema[] {\n const schemas = this.config.filter?.payload_schemas\n return [TimestampSchema, ...(schemas ?? [])]\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<TemporalStateToIndexCandidateDivinerResponse> {\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 ?? { schema: ModuleStateSchema, state: { cursor: SequenceConstants.minLocalSequence } }\n\n // Get the last cursor\n const cursor = lastState?.state?.cursor\n // Get the archivist for the store\n const sourceArchivist = await this.getArchivistForStore()\n if (!sourceArchivist) return [lastState]\n\n // Get the next batch of results\n const nextOffset: ArchivistNextOptions = { limit: this.payloadDivinerLimit, order }\n // Only use the cursor if it's a valid offset\n if (cursor !== SequenceConstants.minLocalSequence) nextOffset.cursor = cursor\n // Get next batch of results starting from the offset\n const next = await sourceArchivist.next(nextOffset)\n if (next.length === 0) return [lastState]\n\n const batch = next.filter(x => isBoundWitness(x))\n .filter(exists)\n .filter(bw => payloadSchemasContainsAll(bw, this.payload_schemas))\n // Get source data\n const indexCandidates: IndexCandidate[] = (await Promise.all(batch.map(bw => this.getPayloadsInBoundWitness(bw, sourceArchivist))))\n .filter(exists)\n .flat()\n const nextCursor = assertEx(next.at(-1)?._sequence, () => `${moduleName}: Expected next to have a sequence`)\n const nextState: ModuleState<IndexingDivinerState> = { schema: ModuleStateSchema, state: { ...lastState.state, cursor: nextCursor } }\n return [nextState, ...indexCandidates]\n }\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: ModuleIdentifier = assertEx(\n this.config?.payloadStore?.archivist,\n () => `${moduleName}: Config for payloadStore.archivist 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 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() {\n // It should be defined, so we'll error if it's not\n const name: ModuleIdentifier = 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\n // Return the wrapped diviner\n return DivinerWrapper.wrap<\n DivinerWrapper<\n BoundWitnessDiviner<BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload, BoundWitness>,\n BoundWitnessDivinerQueryPayload,\n WithStorageMeta<BoundWitness>\n >\n >(mod, this.account)\n }\n\n protected async getPayloadsInBoundWitness(bw: BoundWitness, archivist: ArchivistInstance): Promise<IndexCandidate[] | undefined> {\n const combinations = intraBoundwitnessSchemaCombinations(bw, this.payload_schemas).flat()\n if (combinations.length === 0) return undefined\n const hashes = new Set(combinations)\n const indexCandidates = await archivist.get([...hashes])\n return [bw, ...indexCandidates]\n }\n}\n"],
5
- "mappings": ";AAAA,SAAS,uBAAuB;AAGhC,SAAS,2CAA2C;AAG7C,IAAM,0BAAN,cASG,gBAAgD;AAAA,EACxD,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,mCAAmC;AAAA,EAC/G,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ACtC,UAAM,SAAS,IAAI,IAAI,YAAY;AACnC,UAAM,kBAAkB,MAAM,UAAU,IAAI,CAAC,GAAG,MAAM,CAAC;AACvD,WAAO,CAAC,IAAI,GAAG,eAAe;AAAA,EAChC;AACF;",
6
- "names": ["AbstractDiviner", "jsonPathToTransformersDictionary", "TemporalIndexingDivinerResultIndexSchema", "PayloadBuilder", "indexablePayloads", "AbstractDiviner", "assertEx", "exists", "intraBoundwitnessSchemaCombinations", "isBoundWitness", "AbstractDiviner", "moduleName"]
4
+ "sourcesContent": ["import { IndexingDiviner } from '@xyo-network/diviner-indexing-memory'\nimport type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model'\nimport type { TemporalIndexingDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport { TemporalIndexingDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Payload, Schema } from '@xyo-network/sdk-protocol-js'\n\nexport class TemporalIndexingDiviner<\n TParams extends TemporalIndexingDivinerParams = TemporalIndexingDivinerParams,\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> extends IndexingDiviner<TParams, TIn, TOut, TEventData> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, TemporalIndexingDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerConfigSchema\n\n protected override async startHandler() {\n await super.startHandler()\n }\n}\n", "import type { Hash } from '@xylabs/sdk-js'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { jsonPathToTransformersDictionary, reducePayloads } from '@xyo-network/diviner-jsonpath-aggregate-memory'\nimport type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model'\nimport type { PayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { PayloadDivinerQuerySchema } from '@xyo-network/diviner-payload-model'\nimport type { TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport {\n TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema,\n TemporalIndexingDivinerResultIndexSchema,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Labels } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/sdk-protocol-js'\nimport { isPayloadOfSchemaType, PayloadBuilder } from '@xyo-network/sdk-protocol-js'\n// TODO: Inherit from JsonPathAggregateDiviner\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 configSchemas = [...super.configSchemas, TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema]\n static override readonly defaultConfigSchema = TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'divinerQueryToIndexQueryDiviner',\n }\n\n private _indexableSchemas: Schema[] | undefined\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n\n /**\n * The schema of the diviner query payloads\n */\n protected get divinerQuerySchema(): Schema {\n return this.config.divinerQuerySchema ?? PayloadDivinerQuerySchema\n }\n\n /**\n * The schema of the index query payloads\n */\n protected get indexQuerySchema(): Schema {\n return this.config.indexQuerySchema ?? PayloadDivinerQuerySchema\n }\n\n /**\n * The schema of the index payloads\n */\n protected get indexSchema(): Schema {\n return this.config.indexSchema ?? TemporalIndexingDivinerResultIndexSchema\n }\n\n /**\n * List of indexable schemas for this diviner\n */\n protected get indexableSchemas(): Schema[] {\n this._indexableSchemas ??= Object.keys(this.schemaTransforms) as Schema[]\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 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: 'cursor',\n sourcePathExpression: '$.cursor',\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 // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-argument\n const queries = payloads.filter(isPayloadOfSchemaType<PayloadDivinerQueryPayload>(this.divinerQuerySchema as any))\n if (queries.length > 0) {\n return await Promise.all(\n queries.map(async (query) => {\n const fields = await reducePayloads<PayloadDivinerQueryPayload & { $sources?: Hash[]; sources?: Hash[] }>(\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 delete fields?.$sources\n // TODO: Add support for additional filters\n return new PayloadBuilder<Payload>({ schema: this.indexQuerySchema }).fields(fields).build()\n }),\n )\n }\n return []\n }\n}\n", "import type { Hash } from '@xylabs/sdk-js'\nimport {\n assertEx, containsAll, exists,\n} from '@xylabs/sdk-js'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { jsonPathToTransformersDictionary } from '@xyo-network/diviner-jsonpath-aggregate-memory'\nimport type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model'\nimport type {\n TemporalIndexingDivinerIndexCandidateToIndexDivinerParams,\n TemporalIndexingDivinerResultIndex,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport {\n TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema,\n TemporalIndexingDivinerResultIndexSchema,\n} from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Labels } from '@xyo-network/module-model'\nimport type {\n BoundWitness, Payload, Schema,\n} from '@xyo-network/sdk-protocol-js'\nimport {\n intraBoundwitnessSchemaCombinations, isAnyPayload, isBoundWitness, PayloadBuilder,\n} from '@xyo-network/sdk-protocol-js'\n\ntype IndexableHashes = [Hash, ...Hash[]]\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 readonly configSchemas: Schema[] = [...super.configSchemas, TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerIndexCandidateToIndexDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'indexCandidateToIndexDiviner',\n }\n\n private _indexableSchemas: Schema[] | undefined\n private _payloadTransformers: SchemaToPayloadTransformersDictionary | undefined\n\n /**\n * List of indexable schemas for this diviner\n */\n protected get indexableSchemas(): Schema[] {\n this._indexableSchemas ??= Object.keys(this.schemaTransforms) as Schema[]\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 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 // If the Bound Witness does not contain all the required schemas do not index it\n const indexableBoundWitnesses = payloads\n .filter(isBoundWitness)\n .filter(bw => containsAll(bw.payload_schemas, this.indexableSchemas))\n // If the Payload is not one of the indexable schemas do not index it\n const indexablePayloads = payloads.filter(p => this.isIndexablePayload(p))\n // If there is nothing to index, return an empty array\n if (indexableBoundWitnesses.length === 0 || indexablePayloads.length === 0) return []\n // Hash all the indexable data once\n const [bwDictionary, payloadDictionary] = await Promise.all([\n PayloadBuilder.toHashMap(indexableBoundWitnesses),\n PayloadBuilder.toAllHashMap(indexablePayloads),\n ])\n\n // Initialize the array for validIndexableTuples outside of the loop\n const validIndexableTuples: IndexableHashes[] = []\n\n // Iterate over each entry in bwDictionary\n for (const [bwHash, bw] of Object.entries(bwDictionary) as [Hash, BoundWitness][]) {\n // Find the combinations of payloads that satisfy the required schemas\n const combinations = intraBoundwitnessSchemaCombinations(bw, this.indexableSchemas)\n\n // Iterate over each combination\n for (const combination of combinations) {\n const indexablePayloads = combination.map(hash => payloadDictionary[hash]).filter(exists)\n\n // If we found the right amount of indexable payloads (of the correct schema as checked\n // above) in this BW, then index it\n if (indexablePayloads.length === this.indexableSchemas.length) {\n validIndexableTuples.push([bwHash, ...combination])\n }\n }\n }\n\n // Create the indexes from the tuples\n const indexes = validIndexableTuples.map<TemporalIndexingDivinerResultIndex>(([bwHash, ...sourcePayloadHashes]) => {\n const sourcePayloads = sourcePayloadHashes.map(hash => payloadDictionary[hash])\n // Use the payload transformers to convert the fields from the source payloads to the destination fields\n const indexFields = sourcePayloads.flatMap((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 // Include all the sources for reference\n const $sources: Hash[] = [bwHash, ...sourcePayloadHashes]\n // Build and return the index\n return new PayloadBuilder<TemporalIndexingDivinerResultIndex>({ schema: TemporalIndexingDivinerResultIndexSchema })\n // eslint-disable-next-line @typescript-eslint/no-unsafe-argument\n .fields(Object.assign({}, ...indexFields))\n .meta({ $sources })\n .build()\n })\n return indexes.flat()\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: unknown) => {\n return isAnyPayload(x) && 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?: Schema | null) => {\n return typeof schema === 'string' ? this.indexableSchemas.includes(schema) : false\n }\n}\n", "import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { isPayloadDivinerQueryPayload } from '@xyo-network/diviner-payload-model'\nimport { TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport type { Labels } from '@xyo-network/module-model'\nimport type { Payload, Schema } from '@xyo-network/sdk-protocol-js'\n\n/**\n * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response\n */\nexport class TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDiviner extends AbstractDiviner {\n static override readonly configSchemas: Schema[] = [\n ...super.configSchemas,\n TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema,\n ]\n\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerIndexQueryResponseToDivinerQueryResponseDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'indexQueryResponseToDivinerQueryResponseDiviner',\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<Payload[]> {\n // 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, exists } from '@xylabs/sdk-js'\nimport type { ArchivistInstance, ArchivistNextOptions } from '@xyo-network/archivist-model'\nimport { ArchivistWrapper } from '@xyo-network/archivist-wrapper'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness/abstract'\nimport type { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness/model'\nimport type { IndexingDivinerState } from '@xyo-network/diviner-indexing-model'\nimport type { TemporalIndexingDivinerStateToIndexCandidateDivinerParams } from '@xyo-network/diviner-temporal-indexing-model'\nimport { TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema } from '@xyo-network/diviner-temporal-indexing-model'\nimport { DivinerWrapper } from '@xyo-network/diviner-wrapper'\nimport type {\n Labels, ModuleIdentifier, ModuleState,\n} from '@xyo-network/module-model'\nimport { isModuleState, ModuleStateSchema } from '@xyo-network/module-model'\nimport type {\n BoundWitness,\n Payload, Schema,\n WithStorageMeta,\n} from '@xyo-network/sdk-protocol-js'\nimport {\n intraBoundwitnessSchemaCombinations, isBoundWitness, payloadSchemasContainsAll, SequenceConstants,\n} from '@xyo-network/sdk-protocol-js'\nimport type { TimeStamp } from '@xyo-network/witness-timestamp'\nimport { 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, Payload, ModuleState | IndexCandidate> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = TemporalIndexingDivinerStateToIndexCandidateDivinerConfigSchema\n static override readonly labels: Labels = {\n ...super.labels,\n 'network.xyo.diviner.stage': 'stateToIndexCandidateDiviner',\n }\n\n get payloadDivinerLimit() {\n return this.config.payloadDivinerLimit ?? 1000\n }\n\n /**\n * The required payload_schemas within BoundWitnesses to identify index candidates\n */\n protected get payload_schemas(): Schema[] {\n const schemas = this.config.filter?.payload_schemas\n return [TimestampSchema, ...(schemas ?? [])]\n }\n\n protected override async divineHandler(payloads: Payload[] = []): Promise<TemporalStateToIndexCandidateDivinerResponse> {\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 ?? { schema: ModuleStateSchema, state: { cursor: SequenceConstants.minLocalSequence } }\n\n // Get the last cursor\n const cursor = lastState?.state?.cursor\n // Get the archivist for the store\n const sourceArchivist = await this.getArchivistForStore()\n if (!sourceArchivist) return [lastState]\n\n // Get the next batch of results\n const nextOffset: ArchivistNextOptions = { limit: this.payloadDivinerLimit, order }\n // Only use the cursor if it's a valid offset\n if (cursor !== SequenceConstants.minLocalSequence) nextOffset.cursor = cursor\n // Get next batch of results starting from the offset\n const next = await sourceArchivist.next(nextOffset)\n if (next.length === 0) return [lastState]\n\n const batch = next.filter(x => isBoundWitness(x))\n .filter(exists)\n .filter(bw => payloadSchemasContainsAll(bw, this.payload_schemas))\n // Get source data\n const indexCandidates: IndexCandidate[] = (await Promise.all(batch.map(bw => this.getPayloadsInBoundWitness(bw, sourceArchivist))))\n .filter(exists)\n .flat()\n const nextCursor = assertEx(next.at(-1)?._sequence, () => `${moduleName}: Expected next to have a sequence`)\n const nextState: ModuleState<IndexingDivinerState> = { schema: ModuleStateSchema, state: { ...lastState.state, cursor: nextCursor } }\n return [nextState, ...indexCandidates]\n }\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: ModuleIdentifier = assertEx(\n this.config?.payloadStore?.archivist,\n () => `${moduleName}: Config for payloadStore.archivist 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 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() {\n // It should be defined, so we'll error if it's not\n const name: ModuleIdentifier = 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\n // Return the wrapped diviner\n return DivinerWrapper.wrap<\n DivinerWrapper<\n BoundWitnessDiviner<BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload, BoundWitness>,\n BoundWitnessDivinerQueryPayload,\n WithStorageMeta<BoundWitness>\n >\n >(mod, this.account)\n }\n\n protected async getPayloadsInBoundWitness(bw: BoundWitness, archivist: ArchivistInstance): Promise<IndexCandidate[] | undefined> {\n const combinations = intraBoundwitnessSchemaCombinations(bw, this.payload_schemas).flat()\n if (combinations.length === 0) return undefined\n const hashes = new Set(combinations)\n const indexCandidates = await archivist.get([...hashes])\n return [bw, ...indexCandidates]\n }\n}\n"],
5
+ "mappings": ";AAAA,SAAS,uBAAuB;AAGhC,SAAS,2CAA2C;AAG7C,IAAM,0BAAN,cASG,gBAAgD;AAAA,EACxD,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,mCAAmC;AAAA,EAC/G,OAAyB,sBAA8B;AAAA,EAEvD,MAAyB,eAAe;AACtC,UAAM,MAAM,aAAa;AAAA,EAC3B;AACF;;;ACrBA,SAAS,uBAAuB;AAChC,SAAS,kCAAkC,sBAAsB;AAGjE,SAAS,iCAAiC;AAE1C;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAGP,SAAS,uBAAuB,sBAAsB;AAK/C,IAAM,yDAAN,cAEG,gBAAyB;AAAA,EACjC,OAAyB,gBAAgB,CAAC,GAAG,MAAM,eAAe,kEAAkE;AAAA,EACpI,OAAyB,sBAAsB;AAAA,EAC/C,OAAyB,SAAiB;AAAA,IACxC,GAAG,MAAM;AAAA,IACT,6BAA6B;AAAA,EAC/B;AAAA,EAEQ;AAAA,EACA;AAAA;AAAA;AAAA;AAAA,EAKR,IAAc,qBAA6B;AACzC,WAAO,KAAK,OAAO,sBAAsB;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA,EAKA,IAAc,mBAA2B;AACvC,WAAO,KAAK,OAAO,oBAAoB;AAAA,EACzC;AAAA;AAAA;AAAA;AAAA,EAKA,IAAc,cAAsB;AAClC,WAAO,KAAK,OAAO,eAAe;AAAA,EACpC;AAAA;AAAA;AAAA;AAAA,EAKA,IAAc,mBAA6B;AACzC,SAAK,sBAAsB,OAAO,KAAK,KAAK,gBAAgB;AAC5D,WAAO,KAAK;AAAA,EACd;AAAA;AAAA;AAAA;AAAA;AAAA,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CAAC,IAAK;AAEV,WAAO,eAAe,KAMpB,KAAK,KAAK,OAAO;AAAA,EACrB;AAAA,EAEA,MAAgB,0BAA0B,IAAkB,WAAqE;AAC/H,UAAM,eAAeF,qCAAoC,IAAI,KAAK,eAAe,EAAE,KAAK;AACxF,QAAI,aAAa,WAAW,EAAG,QAAO;AACtC,UAAM,SAAS,IAAI,IAAI,YAAY;AACnC,UAAM,kBAAkB,MAAM,UAAU,IAAI,CAAC,GAAG,MAAM,CAAC;AACvD,WAAO,CAAC,IAAI,GAAG,eAAe;AAAA,EAChC;AACF;",
6
+ "names": ["AbstractDiviner", "jsonPathToTransformersDictionary", "TemporalIndexingDivinerResultIndexSchema", "PayloadBuilder", "indexablePayloads", "AbstractDiviner", "assertEx", "exists", "AbstractDiviner", "intraBoundwitnessSchemaCombinations", "isBoundWitness", "moduleName"]
7
7
  }
@@ -1,7 +1,7 @@
1
1
  import { IndexingDiviner } from '@xyo-network/diviner-indexing-memory';
2
2
  import type { DivinerInstance, DivinerModuleEventData } from '@xyo-network/diviner-model';
3
3
  import type { TemporalIndexingDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
4
- import type { Payload, Schema } from '@xyo-network/payload-model';
4
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
5
5
  export declare class TemporalIndexingDiviner<TParams extends TemporalIndexingDivinerParams = TemporalIndexingDivinerParams, TIn extends Payload = Payload, TOut extends Payload = Payload, TEventData extends DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut> = DivinerModuleEventData<DivinerInstance<TParams, TIn, TOut>, TIn, TOut>> extends IndexingDiviner<TParams, TIn, TOut, TEventData> {
6
6
  static readonly configSchemas: Schema[];
7
7
  static readonly defaultConfigSchema: Schema;
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAA;AACtE,OAAO,K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AE,GAAG,EAAE,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,sBAAsB,CAChH,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC,EACnC,GAAG,EACH,IAAI,CACL,CACD,SAAQ,eAAe,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,CAAC;IACvD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAAgE;IAChH,gBAAyB,mBAAmB,EAAE,MAAM,CAAsC;cAEjE,YAAY;CAGtC"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model';
3
3
  import type { TemporalIndexingDivinerDivinerQueryToIndexQueryDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
4
4
  import type { Labels } from '@xyo-network/module-model';
5
- import type { Payload, Schema } from '@xyo-network/payload-model';
5
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
6
6
  /**
7
7
  * A diviner that converts diviner query to index query
8
8
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/DivinerQueryToIndexQueryDiviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,KAAK,EAAE,8CAA8C,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAA;AAGhJ,OAAO,KAAK,EAAE,4DAA4D,EAAE,MAAM,8CAA8C,CAAA;AAKhI,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AAEvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAGjE;;GAEG;AACH,qBAAa,sDAAsD,CACjE,OAAO,SAAS,4DAA4D,GAAG,4DAA4D,CAC3I,SAAQ,eAAe,CAAC,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AAM,CAGtC;IAED,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,oBAAoB,CAAmD;IAE/E;;OAEG;IACH,SAAS,KAAK,kBAAkB,IAAI,MAAM,CAEzC;IAED;;OAEG;IACH,SAAS,KAAK,gBAAgB,IAAI,MAAM,CAEvC;IAED;;OAEG;IACH,SAAS,KAAK,WAAW,IAAI,MAAM,CAElC;IAED;;OAEG;IACH,SAAS,KAAK,gBAAgB,IAAI,MAAM,EAAE,CAGzC;IAED;;;OAGG;IACH,SAAS,KAAK,mBAAmB,IAAI,qCAAqC,CAGzE;IAED;;;OAGG;IACH,SAAS,KAAK,gBAAgB,IAAI,8CAA8C,CAsB/E;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAuBrF"}
@@ -2,7 +2,7 @@ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { SchemaToJsonPathTransformExpressionsDictionary, SchemaToPayloadTransformersDictionary } from '@xyo-network/diviner-jsonpath-model';
3
3
  import type { TemporalIndexingDivinerIndexCandidateToIndexDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
4
4
  import type { Labels } from '@xyo-network/module-model';
5
- import type { Payload, Schema } from '@xyo-network/payload-model';
5
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
6
6
  /**
7
7
  * Diviner which transforms index candidates to indexes using JSON Path to map
8
8
  * source properties in the supplied payloads to destination fields in the
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/IndexCandidateToIndexDiviner/Diviner.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,KAAK,EAAE,8CAA8C,EAAE,qCAAqC,EAAE,MAAM,qCAAqC,CAAA;AAChJ,OAAO,KAAK,EACV,yDAAyD,EAE1D,MAAM,8CAA8C,CAAA;AAKrD,OAAO,KAA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,8BAA8B,CAAA;AASrC;;;;GAIG;AACH,qBAAa,mDAAmD,CAC9D,OAAO,SAAS,yDAAyD,GAAG,yDAAyD,CACrI,SAAQ,eAAe,CAAC,OAAO,CAAC;IAChC,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4F;IAC5I,gBAAyB,mBAAmB,EAAE,MAAM,CAAkE;IACtH,gBAAyB,MAAM,EAAE,MAAM,CAGtC;IAED,OAAO,CAAC,iBAAiB,CAAsB;IAC/C,OAAO,CAAC,oBAAoB,CAAmD;IAE/E;;OAEG;IACH,SAAS,KAAK,gBAAgB,IAAI,MAAM,EAAE,CAGzC;IAED;;;OAGG;IACH,SAAS,KAAK,mBAAmB,IAAI,qCAAqC,CAGzE;IAED;;;OAGG;IACH,SAAS,KAAK,gBAAgB,IAAI,8CAA8C,CAE/E;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAyDpF;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,GAAI,GAAG,OAAO,aAEzC;IAED;;;;OAIG;IACH,SAAS,CAAC,iBAAiB,GAAI,SAAS,MAAM,GAAG,IAAI,aAEpD;CACF"}
@@ -1,6 +1,6 @@
1
1
  import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
2
  import type { Labels } from '@xyo-network/module-model';
3
- import type { Payload, Schema } from '@xyo-network/payload-model';
3
+ import type { Payload, Schema } from '@xyo-network/sdk-protocol-js';
4
4
  /**
5
5
  * Transforms an ImageThumbnailIndex response into an ImageThumbnailResponse response
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAEjE;;GAEG;AACH,qBAAa,sEAAuE,SAAQ,eAAe;IACzG,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAG/C;IAED,gBAAyB,mBAAmB,EAAE,MAAM,CAAqF;IACzI,gBAAyB,MAAM,EAAE,MAAM,CAGtC;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAQrF"}
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/IndexQueryResponseToDivinerQueryResponseDiviner/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAG/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAEnE;;GAEG;AACH,qBAAa,sEAAuE,SAAQ,eAAe;IACzG,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAG/C;IAED,gBAAyB,mBAAmB,EAAE,MAAM,CAAqF;IACzI,gBAAyB,MAAM,EAAE,MAAM,CAGtC;cAEwB,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CAQrF"}
@@ -1,6 +1,5 @@
1
1
  import type { ArchivistInstance } from '@xyo-network/archivist-model';
2
2
  import { ArchivistWrapper } from '@xyo-network/archivist-wrapper';
3
- import type { BoundWitness } from '@xyo-network/boundwitness-model';
4
3
  import { AbstractDiviner } from '@xyo-network/diviner-abstract';
5
4
  import type { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness/abstract';
6
5
  import type { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness/model';
@@ -8,7 +7,7 @@ import type { IndexingDivinerState } from '@xyo-network/diviner-indexing-model';
8
7
  import type { TemporalIndexingDivinerStateToIndexCandidateDivinerParams } from '@xyo-network/diviner-temporal-indexing-model';
9
8
  import { DivinerWrapper } from '@xyo-network/diviner-wrapper';
10
9
  import type { Labels, ModuleState } from '@xyo-network/module-model';
11
- import type { Payload, Schema, WithStorageMeta } from '@xyo-network/payload-model';
10
+ import type { BoundWitness, Payload, Schema, WithStorageMeta } from '@xyo-network/sdk-protocol-js';
12
11
  import type { TimeStamp } from '@xyo-network/witness-timestamp';
13
12
  /**
14
13
  * All Payload types involved in index candidates for indexing
@@ -53,13 +52,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
53
52
  schema: "network.xyo.boundwitness" & {
54
53
  readonly __schema: true;
55
54
  };
56
- addresses: (Lowercase<string> & {
55
+ addresses: ((Lowercase<string> & {
57
56
  readonly __hex: true;
58
57
  } & {
59
58
  readonly __address: true;
60
- })[];
59
+ }) | (Lowercase<string> & {
60
+ readonly __hex: true;
61
+ } & {
62
+ readonly __address: true;
63
+ }))[];
61
64
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
62
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
65
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
63
66
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
64
67
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
65
68
  $destination?: (Lowercase<string> & {
@@ -72,13 +75,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
72
75
  schema: "network.xyo.boundwitness" & {
73
76
  readonly __schema: true;
74
77
  };
75
- addresses: (Lowercase<string> & {
78
+ addresses: ((Lowercase<string> & {
79
+ readonly __hex: true;
80
+ } & {
81
+ readonly __address: true;
82
+ }) | (Lowercase<string> & {
76
83
  readonly __hex: true;
77
84
  } & {
78
85
  readonly __address: true;
79
- })[];
86
+ }))[];
80
87
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
81
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
88
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
82
89
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
83
90
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
84
91
  $destination?: (Lowercase<string> & {
@@ -91,13 +98,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
91
98
  schema: "network.xyo.boundwitness" & {
92
99
  readonly __schema: true;
93
100
  };
94
- addresses: (Lowercase<string> & {
101
+ addresses: ((Lowercase<string> & {
95
102
  readonly __hex: true;
96
103
  } & {
97
104
  readonly __address: true;
98
- })[];
105
+ }) | (Lowercase<string> & {
106
+ readonly __hex: true;
107
+ } & {
108
+ readonly __address: true;
109
+ }))[];
99
110
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
100
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
111
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
101
112
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
102
113
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
103
114
  $destination?: (Lowercase<string> & {
@@ -110,13 +121,17 @@ export declare class TemporalIndexingDivinerStateToIndexCandidateDiviner<TParams
110
121
  schema: "network.xyo.boundwitness" & {
111
122
  readonly __schema: true;
112
123
  };
113
- addresses: (Lowercase<string> & {
124
+ addresses: ((Lowercase<string> & {
125
+ readonly __hex: true;
126
+ } & {
127
+ readonly __address: true;
128
+ }) | (Lowercase<string> & {
114
129
  readonly __hex: true;
115
130
  } & {
116
131
  readonly __address: true;
117
- })[];
132
+ }))[];
118
133
  payload_hashes: import("@xylabs/sdk-js").BrandedHash[];
119
- payload_schemas: import("@xyo-network/payload-model").BrandedSchema<string>[];
134
+ payload_schemas: import("@xyo-network/sdk-protocol-js").BrandedSchema<string>[];
120
135
  previous_hashes: (import("@xylabs/sdk-js").BrandedHash | null)[];
121
136
  $signatures: (import("@xylabs/sdk-js").BrandedHex | null)[];
122
137
  $destination?: (Lowercase<string> & {
@@ -1 +1 @@
1
- {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/StateToIndexCandidateDiviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAwB,MAAM,8BAA8B,CAAA;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAA;AAEjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAA;AAGnE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAA;AACzH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAA;AAC/E,OAAO,KAAK,EAAE,yDAAyD,EAAE,MAAM,8CAA8C,CAAA;AAE7H,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EACV,MAAM,EAAoB,WAAW,EACtC,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EACV,OAAO,EAAE,MAAM,EACf,eAAe,EAChB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAG/D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,OAAO,GAAG,SAAS,CAAA;AAE/D;;GAEG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD;;OAEG;IACH,SAAS,EAAE,WAAW,CAAC,oBAAoB,CAAC;IAC5C;;OAEG;IACH,GAAG,cAAc,EAAE;CACpB,CAAA;AAYD;;GAEG;AACH,qBAAa,mDAAmD,CAC9D,OAAO,SAAS,yDAAyD,GAAG,yDAAyD,CACrI,SAAQ,eAAe,CA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