@xyo-network/diviner-boundwitness-memory 2.106.0 → 2.107.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.
- package/dist/browser/MemoryBoundWitnessDiviner.d.cts +0 -36
- package/dist/browser/MemoryBoundWitnessDiviner.d.cts.map +1 -1
- package/dist/browser/MemoryBoundWitnessDiviner.d.mts +0 -36
- package/dist/browser/MemoryBoundWitnessDiviner.d.mts.map +1 -1
- package/dist/browser/MemoryBoundWitnessDiviner.d.ts +0 -36
- package/dist/browser/MemoryBoundWitnessDiviner.d.ts.map +1 -1
- package/dist/browser/index.cjs +1 -75
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +1 -54
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/MemoryBoundWitnessDiviner.d.cts +0 -36
- package/dist/neutral/MemoryBoundWitnessDiviner.d.cts.map +1 -1
- package/dist/neutral/MemoryBoundWitnessDiviner.d.mts +0 -36
- package/dist/neutral/MemoryBoundWitnessDiviner.d.mts.map +1 -1
- package/dist/neutral/MemoryBoundWitnessDiviner.d.ts +0 -36
- package/dist/neutral/MemoryBoundWitnessDiviner.d.ts.map +1 -1
- package/dist/neutral/index.cjs +1 -75
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +1 -54
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/MemoryBoundWitnessDiviner.d.cts +0 -36
- package/dist/node/MemoryBoundWitnessDiviner.d.cts.map +1 -1
- package/dist/node/MemoryBoundWitnessDiviner.d.mts +0 -36
- package/dist/node/MemoryBoundWitnessDiviner.d.mts.map +1 -1
- package/dist/node/MemoryBoundWitnessDiviner.d.ts +0 -36
- package/dist/node/MemoryBoundWitnessDiviner.d.ts.map +1 -1
- package/dist/node/index.cjs +1 -88
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +1 -63
- package/dist/node/index.js.map +1 -1
- package/package.json +13 -13
- package/src/MemoryBoundWitnessDiviner.ts +1 -0
|
@@ -3,47 +3,11 @@ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'
|
|
|
3
3
|
import { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
|
|
4
4
|
import { Schema, WithMeta } from '@xyo-network/payload-model';
|
|
5
5
|
export interface EqualityComparisonOperators {
|
|
6
|
-
/**
|
|
7
|
-
* 'Not Equal To' comparison operator.
|
|
8
|
-
* Compares the field with the specified string value,
|
|
9
|
-
* selecting records where the field value does not match the provided string.
|
|
10
|
-
* Example: field != 'value'
|
|
11
|
-
*/
|
|
12
6
|
'!=': string;
|
|
13
|
-
/**
|
|
14
|
-
* 'Less Than' comparison operator.
|
|
15
|
-
* Compares the field with the specified string value,
|
|
16
|
-
* selecting records where the field value is lexicographically less than the provided string.
|
|
17
|
-
* Example: field < 'value'
|
|
18
|
-
*/
|
|
19
7
|
'<': string;
|
|
20
|
-
/**
|
|
21
|
-
* 'Less Than or Equal To' comparison operator.
|
|
22
|
-
* Compares the field with the specified string value,
|
|
23
|
-
* selecting records where the field value is lexicographically less than or equal to the provided string.
|
|
24
|
-
* Example: field <= 'value'
|
|
25
|
-
*/
|
|
26
8
|
'<=': string;
|
|
27
|
-
/**
|
|
28
|
-
* 'Equal To' comparison operator.
|
|
29
|
-
* Compares the field with the specified string value,
|
|
30
|
-
* selecting records where the field value matches the provided string exactly.
|
|
31
|
-
* Example: field = 'value'
|
|
32
|
-
*/
|
|
33
9
|
'=': string;
|
|
34
|
-
/**
|
|
35
|
-
* 'Greater Than' comparison operator.
|
|
36
|
-
* Compares the field with the specified string value,
|
|
37
|
-
* selecting records where the field value is lexicographically greater than the provided string.
|
|
38
|
-
* Example: field > 'value'
|
|
39
|
-
*/
|
|
40
10
|
'>': string;
|
|
41
|
-
/**
|
|
42
|
-
* 'Greater Than or Equal To' comparison operator.
|
|
43
|
-
* Compares the field with the specified string value,
|
|
44
|
-
* selecting records where the field value is lexicographically greater than or equal to the provided string.
|
|
45
|
-
* Example: field >= 'value'
|
|
46
|
-
*/
|
|
47
11
|
'>=': string;
|
|
48
12
|
}
|
|
49
13
|
export declare class MemoryBoundWitnessDiviner<TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;
|
|
1
|
+
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;IAO1C,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;CACb;AAKD,qBAAa,yBAAyB,CACpC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAG7D,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE;CAoCxD"}
|
|
@@ -3,47 +3,11 @@ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'
|
|
|
3
3
|
import { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
|
|
4
4
|
import { Schema, WithMeta } from '@xyo-network/payload-model';
|
|
5
5
|
export interface EqualityComparisonOperators {
|
|
6
|
-
/**
|
|
7
|
-
* 'Not Equal To' comparison operator.
|
|
8
|
-
* Compares the field with the specified string value,
|
|
9
|
-
* selecting records where the field value does not match the provided string.
|
|
10
|
-
* Example: field != 'value'
|
|
11
|
-
*/
|
|
12
6
|
'!=': string;
|
|
13
|
-
/**
|
|
14
|
-
* 'Less Than' comparison operator.
|
|
15
|
-
* Compares the field with the specified string value,
|
|
16
|
-
* selecting records where the field value is lexicographically less than the provided string.
|
|
17
|
-
* Example: field < 'value'
|
|
18
|
-
*/
|
|
19
7
|
'<': string;
|
|
20
|
-
/**
|
|
21
|
-
* 'Less Than or Equal To' comparison operator.
|
|
22
|
-
* Compares the field with the specified string value,
|
|
23
|
-
* selecting records where the field value is lexicographically less than or equal to the provided string.
|
|
24
|
-
* Example: field <= 'value'
|
|
25
|
-
*/
|
|
26
8
|
'<=': string;
|
|
27
|
-
/**
|
|
28
|
-
* 'Equal To' comparison operator.
|
|
29
|
-
* Compares the field with the specified string value,
|
|
30
|
-
* selecting records where the field value matches the provided string exactly.
|
|
31
|
-
* Example: field = 'value'
|
|
32
|
-
*/
|
|
33
9
|
'=': string;
|
|
34
|
-
/**
|
|
35
|
-
* 'Greater Than' comparison operator.
|
|
36
|
-
* Compares the field with the specified string value,
|
|
37
|
-
* selecting records where the field value is lexicographically greater than the provided string.
|
|
38
|
-
* Example: field > 'value'
|
|
39
|
-
*/
|
|
40
10
|
'>': string;
|
|
41
|
-
/**
|
|
42
|
-
* 'Greater Than or Equal To' comparison operator.
|
|
43
|
-
* Compares the field with the specified string value,
|
|
44
|
-
* selecting records where the field value is lexicographically greater than or equal to the provided string.
|
|
45
|
-
* Example: field >= 'value'
|
|
46
|
-
*/
|
|
47
11
|
'>=': string;
|
|
48
12
|
}
|
|
49
13
|
export declare class MemoryBoundWitnessDiviner<TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;
|
|
1
|
+
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;IAO1C,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;CACb;AAKD,qBAAa,yBAAyB,CACpC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAG7D,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE;CAoCxD"}
|
|
@@ -3,47 +3,11 @@ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'
|
|
|
3
3
|
import { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
|
|
4
4
|
import { Schema, WithMeta } from '@xyo-network/payload-model';
|
|
5
5
|
export interface EqualityComparisonOperators {
|
|
6
|
-
/**
|
|
7
|
-
* 'Not Equal To' comparison operator.
|
|
8
|
-
* Compares the field with the specified string value,
|
|
9
|
-
* selecting records where the field value does not match the provided string.
|
|
10
|
-
* Example: field != 'value'
|
|
11
|
-
*/
|
|
12
6
|
'!=': string;
|
|
13
|
-
/**
|
|
14
|
-
* 'Less Than' comparison operator.
|
|
15
|
-
* Compares the field with the specified string value,
|
|
16
|
-
* selecting records where the field value is lexicographically less than the provided string.
|
|
17
|
-
* Example: field < 'value'
|
|
18
|
-
*/
|
|
19
7
|
'<': string;
|
|
20
|
-
/**
|
|
21
|
-
* 'Less Than or Equal To' comparison operator.
|
|
22
|
-
* Compares the field with the specified string value,
|
|
23
|
-
* selecting records where the field value is lexicographically less than or equal to the provided string.
|
|
24
|
-
* Example: field <= 'value'
|
|
25
|
-
*/
|
|
26
8
|
'<=': string;
|
|
27
|
-
/**
|
|
28
|
-
* 'Equal To' comparison operator.
|
|
29
|
-
* Compares the field with the specified string value,
|
|
30
|
-
* selecting records where the field value matches the provided string exactly.
|
|
31
|
-
* Example: field = 'value'
|
|
32
|
-
*/
|
|
33
9
|
'=': string;
|
|
34
|
-
/**
|
|
35
|
-
* 'Greater Than' comparison operator.
|
|
36
|
-
* Compares the field with the specified string value,
|
|
37
|
-
* selecting records where the field value is lexicographically greater than the provided string.
|
|
38
|
-
* Example: field > 'value'
|
|
39
|
-
*/
|
|
40
10
|
'>': string;
|
|
41
|
-
/**
|
|
42
|
-
* 'Greater Than or Equal To' comparison operator.
|
|
43
|
-
* Compares the field with the specified string value,
|
|
44
|
-
* selecting records where the field value is lexicographically greater than or equal to the provided string.
|
|
45
|
-
* Example: field >= 'value'
|
|
46
|
-
*/
|
|
47
11
|
'>=': string;
|
|
48
12
|
}
|
|
49
13
|
export declare class MemoryBoundWitnessDiviner<TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;
|
|
1
|
+
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;IAO1C,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;CACb;AAKD,qBAAa,yBAAyB,CACpC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAG7D,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE;CAoCxD"}
|
package/dist/browser/index.cjs
CHANGED
|
@@ -1,76 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
7
|
-
var __export = (target, all) => {
|
|
8
|
-
for (var name in all)
|
|
9
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var src_exports = {};
|
|
23
|
-
__export(src_exports, {
|
|
24
|
-
MemoryBoundWitnessDiviner: () => MemoryBoundWitnessDiviner
|
|
25
|
-
});
|
|
26
|
-
module.exports = __toCommonJS(src_exports);
|
|
27
|
-
|
|
28
|
-
// src/MemoryBoundWitnessDiviner.ts
|
|
29
|
-
var import_array = require("@xylabs/array");
|
|
30
|
-
var import_assert = require("@xylabs/assert");
|
|
31
|
-
var import_exists = require("@xylabs/exists");
|
|
32
|
-
var import_hex = require("@xylabs/hex");
|
|
33
|
-
var import_boundwitness_model = require("@xyo-network/boundwitness-model");
|
|
34
|
-
var import_diviner_boundwitness_abstract = require("@xyo-network/diviner-boundwitness-abstract");
|
|
35
|
-
var import_diviner_boundwitness_model = require("@xyo-network/diviner-boundwitness-model");
|
|
36
|
-
var hasTimestamp = /* @__PURE__ */ __name((bw) => bw.timestamp !== void 0, "hasTimestamp");
|
|
37
|
-
var MemoryBoundWitnessDiviner = class extends import_diviner_boundwitness_abstract.BoundWitnessDiviner {
|
|
38
|
-
static {
|
|
39
|
-
__name(this, "MemoryBoundWitnessDiviner");
|
|
40
|
-
}
|
|
41
|
-
static configSchemas = [
|
|
42
|
-
...super.configSchemas,
|
|
43
|
-
import_diviner_boundwitness_model.BoundWitnessDivinerConfigSchema
|
|
44
|
-
];
|
|
45
|
-
static defaultConfigSchema = import_diviner_boundwitness_model.BoundWitnessDivinerConfigSchema;
|
|
46
|
-
async divineHandler(payloads) {
|
|
47
|
-
const filter = (0, import_assert.assertEx)(payloads?.filter(import_diviner_boundwitness_model.isBoundWitnessDivinerQueryPayload)?.pop(), () => "Missing query payload");
|
|
48
|
-
if (!filter) return [];
|
|
49
|
-
const archivist = (0, import_assert.assertEx)(await this.archivistInstance(), () => "Unable to resolve archivist");
|
|
50
|
-
const { addresses, payload_hashes, payload_schemas, limit, offset, order = "desc", sourceQuery, destination, timestamp } = filter;
|
|
51
|
-
let bws = (await archivist?.all?.() ?? []).filter(import_boundwitness_model.isBoundWitness);
|
|
52
|
-
if (order === "desc") bws = bws.reverse();
|
|
53
|
-
const allAddresses = addresses?.map((address) => (0, import_hex.hexFromHexString)(address)).filter(import_exists.exists);
|
|
54
|
-
if (allAddresses?.length) bws = bws.filter((bw) => (0, import_array.containsAll)(bw.addresses, allAddresses));
|
|
55
|
-
if (payload_hashes?.length) bws = bws.filter((bw) => (0, import_array.containsAll)(bw.payload_hashes, payload_hashes));
|
|
56
|
-
if (payload_schemas?.length) bws = bws.filter((bw) => (0, import_array.containsAll)(bw.payload_schemas, payload_schemas));
|
|
57
|
-
if (sourceQuery) bws = bws.filter((bw) => bw?.$meta?.sourceQuery === sourceQuery);
|
|
58
|
-
if (destination && Array.isArray(destination) && destination?.length > 0) {
|
|
59
|
-
const targetFilter = (0, import_assert.assertEx)(destination, () => "Missing destination");
|
|
60
|
-
bws = bws.filter((bw) => {
|
|
61
|
-
const targetDestinationField = bw?.$meta?.destination;
|
|
62
|
-
return targetDestinationField !== void 0 && Array.isArray(targetDestinationField) && targetDestinationField.length > 0 ? (
|
|
63
|
-
// Check that the targetDestinationField contains all the elements in the targetFilter
|
|
64
|
-
(0, import_array.containsAll)(targetFilter, targetDestinationField ?? [])
|
|
65
|
-
) : false;
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
if (timestamp !== void 0) {
|
|
69
|
-
bws = order === "desc" ? bws.filter(hasTimestamp).filter((bw) => bw.timestamp <= timestamp) : bws.filter(hasTimestamp).filter((bw) => bw.timestamp >= timestamp);
|
|
70
|
-
}
|
|
71
|
-
const parsedLimit = limit ?? bws.length;
|
|
72
|
-
const parsedOffset = offset ?? 0;
|
|
73
|
-
return bws.slice(parsedOffset, parsedLimit);
|
|
74
|
-
}
|
|
75
|
-
};
|
|
1
|
+
"use strict";var d=Object.defineProperty;var H=Object.getOwnPropertyDescriptor;var $=Object.getOwnPropertyNames;var q=Object.prototype.hasOwnProperty;var h=(s,i)=>d(s,"name",{value:i,configurable:!0});var E=(s,i)=>{for(var r in i)d(s,r,{get:i[r],enumerable:!0})},I=(s,i,r,f)=>{if(i&&typeof i=="object"||typeof i=="function")for(let a of $(i))!q.call(s,a)&&a!==r&&d(s,a,{get:()=>i[a],enumerable:!(f=H(i,a))||f.enumerable});return s};var L=s=>I(d({},"__esModule",{value:!0}),s);var M={};E(M,{MemoryBoundWitnessDiviner:()=>u});module.exports=L(M);var n=require("@xylabs/array"),c=require("@xylabs/assert"),_=require("@xylabs/exists"),w=require("@xylabs/hex"),B=require("@xyo-network/boundwitness-model"),D=require("@xyo-network/diviner-boundwitness-abstract"),o=require("@xyo-network/diviner-boundwitness-model");var S=h(s=>s.timestamp!==void 0,"hasTimestamp"),u=class extends D.BoundWitnessDiviner{static{h(this,"MemoryBoundWitnessDiviner")}static configSchemas=[...super.configSchemas,o.BoundWitnessDivinerConfigSchema];static defaultConfigSchema=o.BoundWitnessDivinerConfigSchema;async divineHandler(i){let r=(0,c.assertEx)(i?.filter(o.isBoundWitnessDivinerQueryPayload)?.pop(),()=>"Missing query payload");if(!r)return[];let f=(0,c.assertEx)(await this.archivistInstance(),()=>"Unable to resolve archivist"),{addresses:a,payload_hashes:g,payload_schemas:y,limit:F,offset:Q,order:v="desc",sourceQuery:x,destination:l,timestamp:p}=r,e=(await f?.all?.()??[]).filter(B.isBoundWitness);v==="desc"&&(e=e.reverse());let A=a?.map(t=>(0,w.hexFromHexString)(t)).filter(_.exists);if(A?.length&&(e=e.filter(t=>(0,n.containsAll)(t.addresses,A))),g?.length&&(e=e.filter(t=>(0,n.containsAll)(t.payload_hashes,g))),y?.length&&(e=e.filter(t=>(0,n.containsAll)(t.payload_schemas,y))),x&&(e=e.filter(t=>t?.$meta?.sourceQuery===x)),l&&Array.isArray(l)&&l?.length>0){let t=(0,c.assertEx)(l,()=>"Missing destination");e=e.filter(C=>{let m=C?.$meta?.destination;return m!==void 0&&Array.isArray(m)&&m.length>0?(0,n.containsAll)(t,m??[]):!1})}p!==void 0&&(e=v==="desc"?e.filter(S).filter(t=>t.timestamp<=p):e.filter(S).filter(t=>t.timestamp>=p));let W=F??e.length,b=Q??0;return e.slice(b,W)}};
|
|
76
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/MemoryBoundWitnessDiviner.ts"],"sourcesContent":["export * from './MemoryBoundWitnessDiviner'\n","import { containsAll } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { hexFromHexString } from '@xylabs/hex'\nimport { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'\nimport {\n BoundWitnessDivinerConfigSchema,\n BoundWitnessDivinerParams,\n BoundWitnessDivinerQueryPayload,\n isBoundWitnessDivinerQueryPayload,\n} from '@xyo-network/diviner-boundwitness-model'\nimport { Schema, WithMeta } from '@xyo-network/payload-model'\n\nexport interface EqualityComparisonOperators {\n /**\n * 'Not Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value does not match the provided string.\n * Example: field != 'value'\n */\n '!=': string\n\n /**\n * 'Less Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than the provided string.\n * Example: field < 'value'\n */\n '<': string\n\n /**\n * 'Less Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than or equal to the provided string.\n * Example: field <= 'value'\n */\n '<=': string\n\n /**\n * 'Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value matches the provided string exactly.\n * Example: field = 'value'\n */\n '=': string\n\n /**\n * 'Greater Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than the provided string.\n * Example: field > 'value'\n */\n '>': string\n\n /**\n * 'Greater Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than or equal to the provided string.\n * Example: field >= 'value'\n */\n '>=': string\n}\n\ntype WithTimestamp = BoundWitness & { timestamp: number }\nconst hasTimestamp = (bw: BoundWitness): bw is WithTimestamp => bw.timestamp !== undefined\n\nexport class MemoryBoundWitnessDiviner<\n TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams,\n TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload,\n TOut extends BoundWitness = BoundWitness,\n> extends BoundWitnessDiviner<TParams, TIn, TOut> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, BoundWitnessDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = BoundWitnessDivinerConfigSchema\n\n protected override async divineHandler(payloads?: TIn[]) {\n const filter = assertEx(payloads?.filter(isBoundWitnessDivinerQueryPayload)?.pop(), () => 'Missing query payload')\n if (!filter) return []\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const { addresses, payload_hashes, payload_schemas, limit, offset, order = 'desc', sourceQuery, destination, timestamp } = filter\n let bws = ((await archivist?.all?.()) ?? []).filter(isBoundWitness) as WithMeta<BoundWitness>[]\n if (order === 'desc') bws = bws.reverse()\n const allAddresses = addresses?.map((address) => hexFromHexString(address)).filter(exists)\n if (allAddresses?.length) bws = bws.filter((bw) => containsAll(bw.addresses, allAddresses))\n if (payload_hashes?.length) bws = bws.filter((bw) => containsAll(bw.payload_hashes, payload_hashes))\n if (payload_schemas?.length) bws = bws.filter((bw) => containsAll(bw.payload_schemas, payload_schemas))\n if (sourceQuery) bws = bws.filter((bw) => (bw?.$meta as { sourceQuery?: string })?.sourceQuery === sourceQuery)\n // If there's a destination filter of the right kind\n if (destination && Array.isArray(destination) && destination?.length > 0) {\n const targetFilter = assertEx(destination, () => 'Missing destination')\n // Find all BWs that satisfy the destination constraint\n bws = bws.filter((bw) => {\n const targetDestinationField = (bw?.$meta as { destination?: string[] })?.destination\n // If the destination field is an array and contains at least one element\n return targetDestinationField !== undefined && Array.isArray(targetDestinationField) && targetDestinationField.length > 0 ?\n // Check that the targetDestinationField contains all the elements in the targetFilter\n containsAll(targetFilter, targetDestinationField ?? [])\n // Otherwise, filter it out\n : false\n })\n }\n if (timestamp !== undefined) {\n bws =\n order === 'desc' ?\n bws.filter(hasTimestamp).filter((bw) => bw.timestamp <= timestamp)\n : bws.filter(hasTimestamp).filter((bw) => bw.timestamp >= timestamp)\n }\n const parsedLimit = limit ?? bws.length\n const parsedOffset = offset ?? 0\n return bws.slice(parsedOffset, parsedLimit) as WithMeta<TOut>[]\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/MemoryBoundWitnessDiviner.ts"],"sourcesContent":["export * from './MemoryBoundWitnessDiviner'\n","import { containsAll } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { hexFromHexString } from '@xylabs/hex'\nimport { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'\nimport {\n BoundWitnessDivinerConfigSchema,\n BoundWitnessDivinerParams,\n BoundWitnessDivinerQueryPayload,\n isBoundWitnessDivinerQueryPayload,\n} from '@xyo-network/diviner-boundwitness-model'\nimport { Schema, WithMeta } from '@xyo-network/payload-model'\n\nexport interface EqualityComparisonOperators {\n /**\n * 'Not Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value does not match the provided string.\n * Example: field != 'value'\n */\n '!=': string\n\n /**\n * 'Less Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than the provided string.\n * Example: field < 'value'\n */\n '<': string\n\n /**\n * 'Less Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than or equal to the provided string.\n * Example: field <= 'value'\n */\n '<=': string\n\n /**\n * 'Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value matches the provided string exactly.\n * Example: field = 'value'\n */\n '=': string\n\n /**\n * 'Greater Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than the provided string.\n * Example: field > 'value'\n */\n '>': string\n\n /**\n * 'Greater Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than or equal to the provided string.\n * Example: field >= 'value'\n */\n '>=': string\n}\n\ntype WithTimestamp = BoundWitness & { timestamp: number }\nconst hasTimestamp = (bw: BoundWitness): bw is WithTimestamp => bw.timestamp !== undefined\n\nexport class MemoryBoundWitnessDiviner<\n TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams,\n TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload,\n TOut extends BoundWitness = BoundWitness,\n> extends BoundWitnessDiviner<TParams, TIn, TOut> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, BoundWitnessDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = BoundWitnessDivinerConfigSchema\n\n // eslint-disable-next-line complexity\n protected override async divineHandler(payloads?: TIn[]) {\n const filter = assertEx(payloads?.filter(isBoundWitnessDivinerQueryPayload)?.pop(), () => 'Missing query payload')\n if (!filter) return []\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const { addresses, payload_hashes, payload_schemas, limit, offset, order = 'desc', sourceQuery, destination, timestamp } = filter\n let bws = ((await archivist?.all?.()) ?? []).filter(isBoundWitness) as WithMeta<BoundWitness>[]\n if (order === 'desc') bws = bws.reverse()\n const allAddresses = addresses?.map((address) => hexFromHexString(address)).filter(exists)\n if (allAddresses?.length) bws = bws.filter((bw) => containsAll(bw.addresses, allAddresses))\n if (payload_hashes?.length) bws = bws.filter((bw) => containsAll(bw.payload_hashes, payload_hashes))\n if (payload_schemas?.length) bws = bws.filter((bw) => containsAll(bw.payload_schemas, payload_schemas))\n if (sourceQuery) bws = bws.filter((bw) => (bw?.$meta as { sourceQuery?: string })?.sourceQuery === sourceQuery)\n // If there's a destination filter of the right kind\n if (destination && Array.isArray(destination) && destination?.length > 0) {\n const targetFilter = assertEx(destination, () => 'Missing destination')\n // Find all BWs that satisfy the destination constraint\n bws = bws.filter((bw) => {\n const targetDestinationField = (bw?.$meta as { destination?: string[] })?.destination\n // If the destination field is an array and contains at least one element\n return targetDestinationField !== undefined && Array.isArray(targetDestinationField) && targetDestinationField.length > 0 ?\n // Check that the targetDestinationField contains all the elements in the targetFilter\n containsAll(targetFilter, targetDestinationField ?? [])\n // Otherwise, filter it out\n : false\n })\n }\n if (timestamp !== undefined) {\n bws =\n order === 'desc' ?\n bws.filter(hasTimestamp).filter((bw) => bw.timestamp <= timestamp)\n : bws.filter(hasTimestamp).filter((bw) => bw.timestamp >= timestamp)\n }\n const parsedLimit = limit ?? bws.length\n const parsedOffset = offset ?? 0\n return bws.slice(parsedOffset, parsedLimit) as WithMeta<TOut>[]\n }\n}\n"],"mappings":"4dAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GCAA,IAAAI,EAA4B,yBAC5BC,EAAyB,0BACzBC,EAAuB,0BACvBC,EAAiC,uBACjCC,EAA6C,2CAC7CC,EAAoC,sDACpCC,EAKO,mDAsDP,IAAMC,EAAeC,EAACC,GAA0CA,EAAGC,YAAcC,OAA5D,gBAERC,EAAN,cAIGC,qBAAAA,CAvEV,MAuEUA,CAAAA,EAAAA,kCACR,OAAyBC,cAA0B,IAAI,MAAMA,cAAeC,mCAC5E,OAAyBC,oBAA8BD,kCAGvD,MAAyBE,cAAcC,EAAkB,CACvD,IAAMC,KAASC,YAASF,GAAUC,OAAOE,mCAAAA,GAAoCC,IAAAA,EAAO,IAAM,uBAAA,EAC1F,GAAI,CAACH,EAAQ,MAAO,CAAA,EACpB,IAAMI,KAAYH,YAAS,MAAM,KAAKI,kBAAiB,EAAI,IAAM,6BAAA,EAC3D,CAAEC,UAAAA,EAAWC,eAAAA,EAAgBC,gBAAAA,EAAiBC,MAAAA,EAAOC,OAAAA,EAAQC,MAAAA,EAAQ,OAAQC,YAAAA,EAAaC,YAAAA,EAAatB,UAAAA,CAAS,EAAKS,EACvHc,GAAQ,MAAMV,GAAWW,MAAAA,GAAY,CAAA,GAAIf,OAAOgB,gBAAAA,EAChDL,IAAU,SAAQG,EAAMA,EAAIG,QAAO,GACvC,IAAMC,EAAeZ,GAAWa,IAAKC,MAAYC,oBAAiBD,CAAAA,CAAAA,EAAUpB,OAAOsB,QAAAA,EAMnF,GALIJ,GAAcK,SAAQT,EAAMA,EAAId,OAAQV,MAAOkC,eAAYlC,EAAGgB,UAAWY,CAAAA,CAAAA,GACzEX,GAAgBgB,SAAQT,EAAMA,EAAId,OAAQV,MAAOkC,eAAYlC,EAAGiB,eAAgBA,CAAAA,CAAAA,GAChFC,GAAiBe,SAAQT,EAAMA,EAAId,OAAQV,MAAOkC,eAAYlC,EAAGkB,gBAAiBA,CAAAA,CAAAA,GAClFI,IAAaE,EAAMA,EAAId,OAAQV,GAAQA,GAAImC,OAAoCb,cAAgBA,CAAAA,GAE/FC,GAAea,MAAMC,QAAQd,CAAAA,GAAgBA,GAAaU,OAAS,EAAG,CACxE,IAAMK,KAAe3B,YAASY,EAAa,IAAM,qBAAA,EAEjDC,EAAMA,EAAId,OAAQV,GAAAA,CAChB,IAAMuC,EAA0BvC,GAAImC,OAAsCZ,YAE1E,OAAOgB,IAA2BrC,QAAakC,MAAMC,QAAQE,CAAAA,GAA2BA,EAAuBN,OAAS,KAEpHC,eAAYI,EAAcC,GAA0B,CAAA,CAAE,EAEtD,EACN,CAAA,CACF,CACItC,IAAcC,SAChBsB,EACEH,IAAU,OACRG,EAAId,OAAOZ,CAAAA,EAAcY,OAAQV,GAAOA,EAAGC,WAAaA,CAAAA,EACxDuB,EAAId,OAAOZ,CAAAA,EAAcY,OAAQV,GAAOA,EAAGC,WAAaA,CAAAA,GAE9D,IAAMuC,EAAcrB,GAASK,EAAIS,OAC3BQ,EAAerB,GAAU,EAC/B,OAAOI,EAAIkB,MAAMD,EAAcD,CAAAA,CACjC,CACF","names":["src_exports","__export","MemoryBoundWitnessDiviner","__toCommonJS","import_array","import_assert","import_exists","import_hex","import_boundwitness_model","import_diviner_boundwitness_abstract","import_diviner_boundwitness_model","hasTimestamp","__name","bw","timestamp","undefined","MemoryBoundWitnessDiviner","BoundWitnessDiviner","configSchemas","BoundWitnessDivinerConfigSchema","defaultConfigSchema","divineHandler","payloads","filter","assertEx","isBoundWitnessDivinerQueryPayload","pop","archivist","archivistInstance","addresses","payload_hashes","payload_schemas","limit","offset","order","sourceQuery","destination","bws","all","isBoundWitness","reverse","allAddresses","map","address","hexFromHexString","exists","length","containsAll","$meta","Array","isArray","targetFilter","targetDestinationField","parsedLimit","parsedOffset","slice"]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,55 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
-
|
|
4
|
-
// src/MemoryBoundWitnessDiviner.ts
|
|
5
|
-
import { containsAll } from "@xylabs/array";
|
|
6
|
-
import { assertEx } from "@xylabs/assert";
|
|
7
|
-
import { exists } from "@xylabs/exists";
|
|
8
|
-
import { hexFromHexString } from "@xylabs/hex";
|
|
9
|
-
import { isBoundWitness } from "@xyo-network/boundwitness-model";
|
|
10
|
-
import { BoundWitnessDiviner } from "@xyo-network/diviner-boundwitness-abstract";
|
|
11
|
-
import { BoundWitnessDivinerConfigSchema, isBoundWitnessDivinerQueryPayload } from "@xyo-network/diviner-boundwitness-model";
|
|
12
|
-
var hasTimestamp = /* @__PURE__ */ __name((bw) => bw.timestamp !== void 0, "hasTimestamp");
|
|
13
|
-
var MemoryBoundWitnessDiviner = class extends BoundWitnessDiviner {
|
|
14
|
-
static {
|
|
15
|
-
__name(this, "MemoryBoundWitnessDiviner");
|
|
16
|
-
}
|
|
17
|
-
static configSchemas = [
|
|
18
|
-
...super.configSchemas,
|
|
19
|
-
BoundWitnessDivinerConfigSchema
|
|
20
|
-
];
|
|
21
|
-
static defaultConfigSchema = BoundWitnessDivinerConfigSchema;
|
|
22
|
-
async divineHandler(payloads) {
|
|
23
|
-
const filter = assertEx(payloads?.filter(isBoundWitnessDivinerQueryPayload)?.pop(), () => "Missing query payload");
|
|
24
|
-
if (!filter) return [];
|
|
25
|
-
const archivist = assertEx(await this.archivistInstance(), () => "Unable to resolve archivist");
|
|
26
|
-
const { addresses, payload_hashes, payload_schemas, limit, offset, order = "desc", sourceQuery, destination, timestamp } = filter;
|
|
27
|
-
let bws = (await archivist?.all?.() ?? []).filter(isBoundWitness);
|
|
28
|
-
if (order === "desc") bws = bws.reverse();
|
|
29
|
-
const allAddresses = addresses?.map((address) => hexFromHexString(address)).filter(exists);
|
|
30
|
-
if (allAddresses?.length) bws = bws.filter((bw) => containsAll(bw.addresses, allAddresses));
|
|
31
|
-
if (payload_hashes?.length) bws = bws.filter((bw) => containsAll(bw.payload_hashes, payload_hashes));
|
|
32
|
-
if (payload_schemas?.length) bws = bws.filter((bw) => containsAll(bw.payload_schemas, payload_schemas));
|
|
33
|
-
if (sourceQuery) bws = bws.filter((bw) => bw?.$meta?.sourceQuery === sourceQuery);
|
|
34
|
-
if (destination && Array.isArray(destination) && destination?.length > 0) {
|
|
35
|
-
const targetFilter = assertEx(destination, () => "Missing destination");
|
|
36
|
-
bws = bws.filter((bw) => {
|
|
37
|
-
const targetDestinationField = bw?.$meta?.destination;
|
|
38
|
-
return targetDestinationField !== void 0 && Array.isArray(targetDestinationField) && targetDestinationField.length > 0 ? (
|
|
39
|
-
// Check that the targetDestinationField contains all the elements in the targetFilter
|
|
40
|
-
containsAll(targetFilter, targetDestinationField ?? [])
|
|
41
|
-
) : false;
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
if (timestamp !== void 0) {
|
|
45
|
-
bws = order === "desc" ? bws.filter(hasTimestamp).filter((bw) => bw.timestamp <= timestamp) : bws.filter(hasTimestamp).filter((bw) => bw.timestamp >= timestamp);
|
|
46
|
-
}
|
|
47
|
-
const parsedLimit = limit ?? bws.length;
|
|
48
|
-
const parsedOffset = offset ?? 0;
|
|
49
|
-
return bws.slice(parsedOffset, parsedLimit);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
export {
|
|
53
|
-
MemoryBoundWitnessDiviner
|
|
54
|
-
};
|
|
1
|
+
var F=Object.defineProperty;var f=(i,n)=>F(i,"name",{value:n,configurable:!0});import{containsAll as a}from"@xylabs/array";import{assertEx as l}from"@xylabs/assert";import{exists as Q}from"@xylabs/exists";import{hexFromHexString as W}from"@xylabs/hex";import{isBoundWitness as b}from"@xyo-network/boundwitness-model";import{BoundWitnessDiviner as C}from"@xyo-network/diviner-boundwitness-abstract";import{BoundWitnessDivinerConfigSchema as g,isBoundWitnessDivinerQueryPayload as H}from"@xyo-network/diviner-boundwitness-model";var y=f(i=>i.timestamp!==void 0,"hasTimestamp"),v=class extends C{static{f(this,"MemoryBoundWitnessDiviner")}static configSchemas=[...super.configSchemas,g];static defaultConfigSchema=g;async divineHandler(n){let m=l(n?.filter(H)?.pop(),()=>"Missing query payload");if(!m)return[];let x=l(await this.archivistInstance(),()=>"Unable to resolve archivist"),{addresses:A,payload_hashes:d,payload_schemas:c,limit:S,offset:_,order:p="desc",sourceQuery:h,destination:s,timestamp:o}=m,e=(await x?.all?.()??[]).filter(b);p==="desc"&&(e=e.reverse());let u=A?.map(t=>W(t)).filter(Q);if(u?.length&&(e=e.filter(t=>a(t.addresses,u))),d?.length&&(e=e.filter(t=>a(t.payload_hashes,d))),c?.length&&(e=e.filter(t=>a(t.payload_schemas,c))),h&&(e=e.filter(t=>t?.$meta?.sourceQuery===h)),s&&Array.isArray(s)&&s?.length>0){let t=l(s,()=>"Missing destination");e=e.filter(D=>{let r=D?.$meta?.destination;return r!==void 0&&Array.isArray(r)&&r.length>0?a(t,r??[]):!1})}o!==void 0&&(e=p==="desc"?e.filter(y).filter(t=>t.timestamp<=o):e.filter(y).filter(t=>t.timestamp>=o));let w=S??e.length,B=_??0;return e.slice(B,w)}};export{v as MemoryBoundWitnessDiviner};
|
|
55
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/MemoryBoundWitnessDiviner.ts"],"sourcesContent":["import { containsAll } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { hexFromHexString } from '@xylabs/hex'\nimport { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'\nimport {\n BoundWitnessDivinerConfigSchema,\n BoundWitnessDivinerParams,\n BoundWitnessDivinerQueryPayload,\n isBoundWitnessDivinerQueryPayload,\n} from '@xyo-network/diviner-boundwitness-model'\nimport { Schema, WithMeta } from '@xyo-network/payload-model'\n\nexport interface EqualityComparisonOperators {\n /**\n * 'Not Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value does not match the provided string.\n * Example: field != 'value'\n */\n '!=': string\n\n /**\n * 'Less Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than the provided string.\n * Example: field < 'value'\n */\n '<': string\n\n /**\n * 'Less Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than or equal to the provided string.\n * Example: field <= 'value'\n */\n '<=': string\n\n /**\n * 'Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value matches the provided string exactly.\n * Example: field = 'value'\n */\n '=': string\n\n /**\n * 'Greater Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than the provided string.\n * Example: field > 'value'\n */\n '>': string\n\n /**\n * 'Greater Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than or equal to the provided string.\n * Example: field >= 'value'\n */\n '>=': string\n}\n\ntype WithTimestamp = BoundWitness & { timestamp: number }\nconst hasTimestamp = (bw: BoundWitness): bw is WithTimestamp => bw.timestamp !== undefined\n\nexport class MemoryBoundWitnessDiviner<\n TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams,\n TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload,\n TOut extends BoundWitness = BoundWitness,\n> extends BoundWitnessDiviner<TParams, TIn, TOut> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, BoundWitnessDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = BoundWitnessDivinerConfigSchema\n\n protected override async divineHandler(payloads?: TIn[]) {\n const filter = assertEx(payloads?.filter(isBoundWitnessDivinerQueryPayload)?.pop(), () => 'Missing query payload')\n if (!filter) return []\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const { addresses, payload_hashes, payload_schemas, limit, offset, order = 'desc', sourceQuery, destination, timestamp } = filter\n let bws = ((await archivist?.all?.()) ?? []).filter(isBoundWitness) as WithMeta<BoundWitness>[]\n if (order === 'desc') bws = bws.reverse()\n const allAddresses = addresses?.map((address) => hexFromHexString(address)).filter(exists)\n if (allAddresses?.length) bws = bws.filter((bw) => containsAll(bw.addresses, allAddresses))\n if (payload_hashes?.length) bws = bws.filter((bw) => containsAll(bw.payload_hashes, payload_hashes))\n if (payload_schemas?.length) bws = bws.filter((bw) => containsAll(bw.payload_schemas, payload_schemas))\n if (sourceQuery) bws = bws.filter((bw) => (bw?.$meta as { sourceQuery?: string })?.sourceQuery === sourceQuery)\n // If there's a destination filter of the right kind\n if (destination && Array.isArray(destination) && destination?.length > 0) {\n const targetFilter = assertEx(destination, () => 'Missing destination')\n // Find all BWs that satisfy the destination constraint\n bws = bws.filter((bw) => {\n const targetDestinationField = (bw?.$meta as { destination?: string[] })?.destination\n // If the destination field is an array and contains at least one element\n return targetDestinationField !== undefined && Array.isArray(targetDestinationField) && targetDestinationField.length > 0 ?\n // Check that the targetDestinationField contains all the elements in the targetFilter\n containsAll(targetFilter, targetDestinationField ?? [])\n // Otherwise, filter it out\n : false\n })\n }\n if (timestamp !== undefined) {\n bws =\n order === 'desc' ?\n bws.filter(hasTimestamp).filter((bw) => bw.timestamp <= timestamp)\n : bws.filter(hasTimestamp).filter((bw) => bw.timestamp >= timestamp)\n }\n const parsedLimit = limit ?? bws.length\n const parsedOffset = offset ?? 0\n return bws.slice(parsedOffset, parsedLimit) as WithMeta<TOut>[]\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/MemoryBoundWitnessDiviner.ts"],"sourcesContent":["import { containsAll } from '@xylabs/array'\nimport { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport { hexFromHexString } from '@xylabs/hex'\nimport { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'\nimport {\n BoundWitnessDivinerConfigSchema,\n BoundWitnessDivinerParams,\n BoundWitnessDivinerQueryPayload,\n isBoundWitnessDivinerQueryPayload,\n} from '@xyo-network/diviner-boundwitness-model'\nimport { Schema, WithMeta } from '@xyo-network/payload-model'\n\nexport interface EqualityComparisonOperators {\n /**\n * 'Not Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value does not match the provided string.\n * Example: field != 'value'\n */\n '!=': string\n\n /**\n * 'Less Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than the provided string.\n * Example: field < 'value'\n */\n '<': string\n\n /**\n * 'Less Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically less than or equal to the provided string.\n * Example: field <= 'value'\n */\n '<=': string\n\n /**\n * 'Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value matches the provided string exactly.\n * Example: field = 'value'\n */\n '=': string\n\n /**\n * 'Greater Than' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than the provided string.\n * Example: field > 'value'\n */\n '>': string\n\n /**\n * 'Greater Than or Equal To' comparison operator.\n * Compares the field with the specified string value,\n * selecting records where the field value is lexicographically greater than or equal to the provided string.\n * Example: field >= 'value'\n */\n '>=': string\n}\n\ntype WithTimestamp = BoundWitness & { timestamp: number }\nconst hasTimestamp = (bw: BoundWitness): bw is WithTimestamp => bw.timestamp !== undefined\n\nexport class MemoryBoundWitnessDiviner<\n TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams,\n TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload,\n TOut extends BoundWitness = BoundWitness,\n> extends BoundWitnessDiviner<TParams, TIn, TOut> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, BoundWitnessDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = BoundWitnessDivinerConfigSchema\n\n // eslint-disable-next-line complexity\n protected override async divineHandler(payloads?: TIn[]) {\n const filter = assertEx(payloads?.filter(isBoundWitnessDivinerQueryPayload)?.pop(), () => 'Missing query payload')\n if (!filter) return []\n const archivist = assertEx(await this.archivistInstance(), () => 'Unable to resolve archivist')\n const { addresses, payload_hashes, payload_schemas, limit, offset, order = 'desc', sourceQuery, destination, timestamp } = filter\n let bws = ((await archivist?.all?.()) ?? []).filter(isBoundWitness) as WithMeta<BoundWitness>[]\n if (order === 'desc') bws = bws.reverse()\n const allAddresses = addresses?.map((address) => hexFromHexString(address)).filter(exists)\n if (allAddresses?.length) bws = bws.filter((bw) => containsAll(bw.addresses, allAddresses))\n if (payload_hashes?.length) bws = bws.filter((bw) => containsAll(bw.payload_hashes, payload_hashes))\n if (payload_schemas?.length) bws = bws.filter((bw) => containsAll(bw.payload_schemas, payload_schemas))\n if (sourceQuery) bws = bws.filter((bw) => (bw?.$meta as { sourceQuery?: string })?.sourceQuery === sourceQuery)\n // If there's a destination filter of the right kind\n if (destination && Array.isArray(destination) && destination?.length > 0) {\n const targetFilter = assertEx(destination, () => 'Missing destination')\n // Find all BWs that satisfy the destination constraint\n bws = bws.filter((bw) => {\n const targetDestinationField = (bw?.$meta as { destination?: string[] })?.destination\n // If the destination field is an array and contains at least one element\n return targetDestinationField !== undefined && Array.isArray(targetDestinationField) && targetDestinationField.length > 0 ?\n // Check that the targetDestinationField contains all the elements in the targetFilter\n containsAll(targetFilter, targetDestinationField ?? [])\n // Otherwise, filter it out\n : false\n })\n }\n if (timestamp !== undefined) {\n bws =\n order === 'desc' ?\n bws.filter(hasTimestamp).filter((bw) => bw.timestamp <= timestamp)\n : bws.filter(hasTimestamp).filter((bw) => bw.timestamp >= timestamp)\n }\n const parsedLimit = limit ?? bws.length\n const parsedOffset = offset ?? 0\n return bws.slice(parsedOffset, parsedLimit) as WithMeta<TOut>[]\n }\n}\n"],"mappings":"+EAAA,OAASA,eAAAA,MAAmB,gBAC5B,OAASC,YAAAA,MAAgB,iBACzB,OAASC,UAAAA,MAAc,iBACvB,OAASC,oBAAAA,MAAwB,cACjC,OAAuBC,kBAAAA,MAAsB,kCAC7C,OAASC,uBAAAA,MAA2B,6CACpC,OACEC,mCAAAA,EAGAC,qCAAAA,MACK,0CAsDP,IAAMC,EAAeC,EAACC,GAA0CA,EAAGC,YAAcC,OAA5D,gBAERC,EAAN,cAIGC,CAAAA,CAvEV,MAuEUA,CAAAA,EAAAA,kCACR,OAAyBC,cAA0B,IAAI,MAAMA,cAAeC,GAC5E,OAAyBC,oBAA8BD,EAGvD,MAAyBE,cAAcC,EAAkB,CACvD,IAAMC,EAASC,EAASF,GAAUC,OAAOE,CAAAA,GAAoCC,IAAAA,EAAO,IAAM,uBAAA,EAC1F,GAAI,CAACH,EAAQ,MAAO,CAAA,EACpB,IAAMI,EAAYH,EAAS,MAAM,KAAKI,kBAAiB,EAAI,IAAM,6BAAA,EAC3D,CAAEC,UAAAA,EAAWC,eAAAA,EAAgBC,gBAAAA,EAAiBC,MAAAA,EAAOC,OAAAA,EAAQC,MAAAA,EAAQ,OAAQC,YAAAA,EAAaC,YAAAA,EAAatB,UAAAA,CAAS,EAAKS,EACvHc,GAAQ,MAAMV,GAAWW,MAAAA,GAAY,CAAA,GAAIf,OAAOgB,CAAAA,EAChDL,IAAU,SAAQG,EAAMA,EAAIG,QAAO,GACvC,IAAMC,EAAeZ,GAAWa,IAAKC,GAAYC,EAAiBD,CAAAA,CAAAA,EAAUpB,OAAOsB,CAAAA,EAMnF,GALIJ,GAAcK,SAAQT,EAAMA,EAAId,OAAQV,GAAOkC,EAAYlC,EAAGgB,UAAWY,CAAAA,CAAAA,GACzEX,GAAgBgB,SAAQT,EAAMA,EAAId,OAAQV,GAAOkC,EAAYlC,EAAGiB,eAAgBA,CAAAA,CAAAA,GAChFC,GAAiBe,SAAQT,EAAMA,EAAId,OAAQV,GAAOkC,EAAYlC,EAAGkB,gBAAiBA,CAAAA,CAAAA,GAClFI,IAAaE,EAAMA,EAAId,OAAQV,GAAQA,GAAImC,OAAoCb,cAAgBA,CAAAA,GAE/FC,GAAea,MAAMC,QAAQd,CAAAA,GAAgBA,GAAaU,OAAS,EAAG,CACxE,IAAMK,EAAe3B,EAASY,EAAa,IAAM,qBAAA,EAEjDC,EAAMA,EAAId,OAAQV,GAAAA,CAChB,IAAMuC,EAA0BvC,GAAImC,OAAsCZ,YAE1E,OAAOgB,IAA2BrC,QAAakC,MAAMC,QAAQE,CAAAA,GAA2BA,EAAuBN,OAAS,EAEpHC,EAAYI,EAAcC,GAA0B,CAAA,CAAE,EAEtD,EACN,CAAA,CACF,CACItC,IAAcC,SAChBsB,EACEH,IAAU,OACRG,EAAId,OAAOZ,CAAAA,EAAcY,OAAQV,GAAOA,EAAGC,WAAaA,CAAAA,EACxDuB,EAAId,OAAOZ,CAAAA,EAAcY,OAAQV,GAAOA,EAAGC,WAAaA,CAAAA,GAE9D,IAAMuC,EAAcrB,GAASK,EAAIS,OAC3BQ,EAAerB,GAAU,EAC/B,OAAOI,EAAIkB,MAAMD,EAAcD,CAAAA,CACjC,CACF","names":["containsAll","assertEx","exists","hexFromHexString","isBoundWitness","BoundWitnessDiviner","BoundWitnessDivinerConfigSchema","isBoundWitnessDivinerQueryPayload","hasTimestamp","__name","bw","timestamp","undefined","MemoryBoundWitnessDiviner","BoundWitnessDiviner","configSchemas","BoundWitnessDivinerConfigSchema","defaultConfigSchema","divineHandler","payloads","filter","assertEx","isBoundWitnessDivinerQueryPayload","pop","archivist","archivistInstance","addresses","payload_hashes","payload_schemas","limit","offset","order","sourceQuery","destination","bws","all","isBoundWitness","reverse","allAddresses","map","address","hexFromHexString","exists","length","containsAll","$meta","Array","isArray","targetFilter","targetDestinationField","parsedLimit","parsedOffset","slice"]}
|
|
@@ -3,47 +3,11 @@ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'
|
|
|
3
3
|
import { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
|
|
4
4
|
import { Schema, WithMeta } from '@xyo-network/payload-model';
|
|
5
5
|
export interface EqualityComparisonOperators {
|
|
6
|
-
/**
|
|
7
|
-
* 'Not Equal To' comparison operator.
|
|
8
|
-
* Compares the field with the specified string value,
|
|
9
|
-
* selecting records where the field value does not match the provided string.
|
|
10
|
-
* Example: field != 'value'
|
|
11
|
-
*/
|
|
12
6
|
'!=': string;
|
|
13
|
-
/**
|
|
14
|
-
* 'Less Than' comparison operator.
|
|
15
|
-
* Compares the field with the specified string value,
|
|
16
|
-
* selecting records where the field value is lexicographically less than the provided string.
|
|
17
|
-
* Example: field < 'value'
|
|
18
|
-
*/
|
|
19
7
|
'<': string;
|
|
20
|
-
/**
|
|
21
|
-
* 'Less Than or Equal To' comparison operator.
|
|
22
|
-
* Compares the field with the specified string value,
|
|
23
|
-
* selecting records where the field value is lexicographically less than or equal to the provided string.
|
|
24
|
-
* Example: field <= 'value'
|
|
25
|
-
*/
|
|
26
8
|
'<=': string;
|
|
27
|
-
/**
|
|
28
|
-
* 'Equal To' comparison operator.
|
|
29
|
-
* Compares the field with the specified string value,
|
|
30
|
-
* selecting records where the field value matches the provided string exactly.
|
|
31
|
-
* Example: field = 'value'
|
|
32
|
-
*/
|
|
33
9
|
'=': string;
|
|
34
|
-
/**
|
|
35
|
-
* 'Greater Than' comparison operator.
|
|
36
|
-
* Compares the field with the specified string value,
|
|
37
|
-
* selecting records where the field value is lexicographically greater than the provided string.
|
|
38
|
-
* Example: field > 'value'
|
|
39
|
-
*/
|
|
40
10
|
'>': string;
|
|
41
|
-
/**
|
|
42
|
-
* 'Greater Than or Equal To' comparison operator.
|
|
43
|
-
* Compares the field with the specified string value,
|
|
44
|
-
* selecting records where the field value is lexicographically greater than or equal to the provided string.
|
|
45
|
-
* Example: field >= 'value'
|
|
46
|
-
*/
|
|
47
11
|
'>=': string;
|
|
48
12
|
}
|
|
49
13
|
export declare class MemoryBoundWitnessDiviner<TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;
|
|
1
|
+
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;IAO1C,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;CACb;AAKD,qBAAa,yBAAyB,CACpC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAG7D,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE;CAoCxD"}
|
|
@@ -3,47 +3,11 @@ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'
|
|
|
3
3
|
import { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
|
|
4
4
|
import { Schema, WithMeta } from '@xyo-network/payload-model';
|
|
5
5
|
export interface EqualityComparisonOperators {
|
|
6
|
-
/**
|
|
7
|
-
* 'Not Equal To' comparison operator.
|
|
8
|
-
* Compares the field with the specified string value,
|
|
9
|
-
* selecting records where the field value does not match the provided string.
|
|
10
|
-
* Example: field != 'value'
|
|
11
|
-
*/
|
|
12
6
|
'!=': string;
|
|
13
|
-
/**
|
|
14
|
-
* 'Less Than' comparison operator.
|
|
15
|
-
* Compares the field with the specified string value,
|
|
16
|
-
* selecting records where the field value is lexicographically less than the provided string.
|
|
17
|
-
* Example: field < 'value'
|
|
18
|
-
*/
|
|
19
7
|
'<': string;
|
|
20
|
-
/**
|
|
21
|
-
* 'Less Than or Equal To' comparison operator.
|
|
22
|
-
* Compares the field with the specified string value,
|
|
23
|
-
* selecting records where the field value is lexicographically less than or equal to the provided string.
|
|
24
|
-
* Example: field <= 'value'
|
|
25
|
-
*/
|
|
26
8
|
'<=': string;
|
|
27
|
-
/**
|
|
28
|
-
* 'Equal To' comparison operator.
|
|
29
|
-
* Compares the field with the specified string value,
|
|
30
|
-
* selecting records where the field value matches the provided string exactly.
|
|
31
|
-
* Example: field = 'value'
|
|
32
|
-
*/
|
|
33
9
|
'=': string;
|
|
34
|
-
/**
|
|
35
|
-
* 'Greater Than' comparison operator.
|
|
36
|
-
* Compares the field with the specified string value,
|
|
37
|
-
* selecting records where the field value is lexicographically greater than the provided string.
|
|
38
|
-
* Example: field > 'value'
|
|
39
|
-
*/
|
|
40
10
|
'>': string;
|
|
41
|
-
/**
|
|
42
|
-
* 'Greater Than or Equal To' comparison operator.
|
|
43
|
-
* Compares the field with the specified string value,
|
|
44
|
-
* selecting records where the field value is lexicographically greater than or equal to the provided string.
|
|
45
|
-
* Example: field >= 'value'
|
|
46
|
-
*/
|
|
47
11
|
'>=': string;
|
|
48
12
|
}
|
|
49
13
|
export declare class MemoryBoundWitnessDiviner<TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;
|
|
1
|
+
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;IAO1C,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;CACb;AAKD,qBAAa,yBAAyB,CACpC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAG7D,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE;CAoCxD"}
|
|
@@ -3,47 +3,11 @@ import { BoundWitnessDiviner } from '@xyo-network/diviner-boundwitness-abstract'
|
|
|
3
3
|
import { BoundWitnessDivinerParams, BoundWitnessDivinerQueryPayload } from '@xyo-network/diviner-boundwitness-model';
|
|
4
4
|
import { Schema, WithMeta } from '@xyo-network/payload-model';
|
|
5
5
|
export interface EqualityComparisonOperators {
|
|
6
|
-
/**
|
|
7
|
-
* 'Not Equal To' comparison operator.
|
|
8
|
-
* Compares the field with the specified string value,
|
|
9
|
-
* selecting records where the field value does not match the provided string.
|
|
10
|
-
* Example: field != 'value'
|
|
11
|
-
*/
|
|
12
6
|
'!=': string;
|
|
13
|
-
/**
|
|
14
|
-
* 'Less Than' comparison operator.
|
|
15
|
-
* Compares the field with the specified string value,
|
|
16
|
-
* selecting records where the field value is lexicographically less than the provided string.
|
|
17
|
-
* Example: field < 'value'
|
|
18
|
-
*/
|
|
19
7
|
'<': string;
|
|
20
|
-
/**
|
|
21
|
-
* 'Less Than or Equal To' comparison operator.
|
|
22
|
-
* Compares the field with the specified string value,
|
|
23
|
-
* selecting records where the field value is lexicographically less than or equal to the provided string.
|
|
24
|
-
* Example: field <= 'value'
|
|
25
|
-
*/
|
|
26
8
|
'<=': string;
|
|
27
|
-
/**
|
|
28
|
-
* 'Equal To' comparison operator.
|
|
29
|
-
* Compares the field with the specified string value,
|
|
30
|
-
* selecting records where the field value matches the provided string exactly.
|
|
31
|
-
* Example: field = 'value'
|
|
32
|
-
*/
|
|
33
9
|
'=': string;
|
|
34
|
-
/**
|
|
35
|
-
* 'Greater Than' comparison operator.
|
|
36
|
-
* Compares the field with the specified string value,
|
|
37
|
-
* selecting records where the field value is lexicographically greater than the provided string.
|
|
38
|
-
* Example: field > 'value'
|
|
39
|
-
*/
|
|
40
10
|
'>': string;
|
|
41
|
-
/**
|
|
42
|
-
* 'Greater Than or Equal To' comparison operator.
|
|
43
|
-
* Compares the field with the specified string value,
|
|
44
|
-
* selecting records where the field value is lexicographically greater than or equal to the provided string.
|
|
45
|
-
* Example: field >= 'value'
|
|
46
|
-
*/
|
|
47
11
|
'>=': string;
|
|
48
12
|
}
|
|
49
13
|
export declare class MemoryBoundWitnessDiviner<TParams extends BoundWitnessDivinerParams = BoundWitnessDivinerParams, TIn extends BoundWitnessDivinerQueryPayload = BoundWitnessDivinerQueryPayload, TOut extends BoundWitness = BoundWitness> extends BoundWitnessDiviner<TParams, TIn, TOut> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;
|
|
1
|
+
{"version":3,"file":"MemoryBoundWitnessDiviner.d.ts","sourceRoot":"","sources":["../../src/MemoryBoundWitnessDiviner.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAkB,MAAM,iCAAiC,CAAA;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAA;AAChF,OAAO,EAEL,yBAAyB,EACzB,+BAA+B,EAEhC,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAE7D,MAAM,WAAW,2BAA2B;IAO1C,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;IAQZ,GAAG,EAAE,MAAM,CAAA;IAQX,GAAG,EAAE,MAAM,CAAA;IAQX,IAAI,EAAE,MAAM,CAAA;CACb;AAKD,qBAAa,yBAAyB,CACpC,OAAO,SAAS,yBAAyB,GAAG,yBAAyB,EACrE,GAAG,SAAS,+BAA+B,GAAG,+BAA+B,EAC7E,IAAI,SAAS,YAAY,GAAG,YAAY,CACxC,SAAQ,mBAAmB,CAAC,OAAO,EAAE,GAAG,EAAE,IAAI,CAAC;IAC/C,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4D;IAC5G,gBAAyB,mBAAmB,EAAE,MAAM,CAAkC;cAG7D,aAAa,CAAC,QAAQ,CAAC,EAAE,GAAG,EAAE;CAoCxD"}
|