flowquery 1.0.35 → 1.0.37
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/flowquery.min.js +1 -1
- package/dist/parsing/data_structures/lookup.d.ts.map +1 -1
- package/dist/parsing/data_structures/lookup.js +5 -1
- package/dist/parsing/data_structures/lookup.js.map +1 -1
- package/dist/parsing/functions/coalesce.d.ts +16 -0
- package/dist/parsing/functions/coalesce.d.ts.map +1 -0
- package/dist/parsing/functions/coalesce.js +60 -0
- package/dist/parsing/functions/coalesce.js.map +1 -0
- package/dist/parsing/functions/date.d.ts +20 -0
- package/dist/parsing/functions/date.d.ts.map +1 -0
- package/dist/parsing/functions/date.js +69 -0
- package/dist/parsing/functions/date.js.map +1 -0
- package/dist/parsing/functions/datetime.d.ts +20 -0
- package/dist/parsing/functions/datetime.d.ts.map +1 -0
- package/dist/parsing/functions/datetime.js +69 -0
- package/dist/parsing/functions/datetime.js.map +1 -0
- package/dist/parsing/functions/duration.d.ts +7 -0
- package/dist/parsing/functions/duration.d.ts.map +1 -0
- package/dist/parsing/functions/duration.js +145 -0
- package/dist/parsing/functions/duration.js.map +1 -0
- package/dist/parsing/functions/element_id.d.ts +7 -0
- package/dist/parsing/functions/element_id.d.ts.map +1 -0
- package/dist/parsing/functions/element_id.js +58 -0
- package/dist/parsing/functions/element_id.js.map +1 -0
- package/dist/parsing/functions/function_factory.d.ts +20 -0
- package/dist/parsing/functions/function_factory.d.ts.map +1 -1
- package/dist/parsing/functions/function_factory.js +20 -0
- package/dist/parsing/functions/function_factory.js.map +1 -1
- package/dist/parsing/functions/head.d.ts +7 -0
- package/dist/parsing/functions/head.d.ts.map +1 -0
- package/dist/parsing/functions/head.js +53 -0
- package/dist/parsing/functions/head.js.map +1 -0
- package/dist/parsing/functions/id.d.ts +7 -0
- package/dist/parsing/functions/id.d.ts.map +1 -0
- package/dist/parsing/functions/id.js +58 -0
- package/dist/parsing/functions/id.js.map +1 -0
- package/dist/parsing/functions/last.d.ts +7 -0
- package/dist/parsing/functions/last.d.ts.map +1 -0
- package/dist/parsing/functions/last.js +53 -0
- package/dist/parsing/functions/last.js.map +1 -0
- package/dist/parsing/functions/localdatetime.d.ts +19 -0
- package/dist/parsing/functions/localdatetime.d.ts.map +1 -0
- package/dist/parsing/functions/localdatetime.js +69 -0
- package/dist/parsing/functions/localdatetime.js.map +1 -0
- package/dist/parsing/functions/localtime.d.ts +18 -0
- package/dist/parsing/functions/localtime.d.ts.map +1 -0
- package/dist/parsing/functions/localtime.js +65 -0
- package/dist/parsing/functions/localtime.js.map +1 -0
- package/dist/parsing/functions/max.d.ts +14 -0
- package/dist/parsing/functions/max.d.ts.map +1 -0
- package/dist/parsing/functions/max.js +51 -0
- package/dist/parsing/functions/max.js.map +1 -0
- package/dist/parsing/functions/min.d.ts +14 -0
- package/dist/parsing/functions/min.d.ts.map +1 -0
- package/dist/parsing/functions/min.js +51 -0
- package/dist/parsing/functions/min.js.map +1 -0
- package/dist/parsing/functions/nodes.d.ts +7 -0
- package/dist/parsing/functions/nodes.d.ts.map +1 -0
- package/dist/parsing/functions/nodes.js +63 -0
- package/dist/parsing/functions/nodes.js.map +1 -0
- package/dist/parsing/functions/properties.d.ts +7 -0
- package/dist/parsing/functions/properties.d.ts.map +1 -0
- package/dist/parsing/functions/properties.js +74 -0
- package/dist/parsing/functions/properties.js.map +1 -0
- package/dist/parsing/functions/relationships.d.ts +7 -0
- package/dist/parsing/functions/relationships.d.ts.map +1 -0
- package/dist/parsing/functions/relationships.js +61 -0
- package/dist/parsing/functions/relationships.js.map +1 -0
- package/dist/parsing/functions/tail.d.ts +7 -0
- package/dist/parsing/functions/tail.d.ts.map +1 -0
- package/dist/parsing/functions/tail.js +50 -0
- package/dist/parsing/functions/tail.js.map +1 -0
- package/dist/parsing/functions/temporal_utils.d.ts +39 -0
- package/dist/parsing/functions/temporal_utils.d.ts.map +1 -0
- package/dist/parsing/functions/temporal_utils.js +168 -0
- package/dist/parsing/functions/temporal_utils.js.map +1 -0
- package/dist/parsing/functions/time.d.ts +18 -0
- package/dist/parsing/functions/time.d.ts.map +1 -0
- package/dist/parsing/functions/time.js +65 -0
- package/dist/parsing/functions/time.js.map +1 -0
- package/dist/parsing/functions/timestamp.d.ts +15 -0
- package/dist/parsing/functions/timestamp.d.ts.map +1 -0
- package/dist/parsing/functions/timestamp.js +48 -0
- package/dist/parsing/functions/timestamp.js.map +1 -0
- package/dist/parsing/functions/to_float.d.ts +7 -0
- package/dist/parsing/functions/to_float.d.ts.map +1 -0
- package/dist/parsing/functions/to_float.js +61 -0
- package/dist/parsing/functions/to_float.js.map +1 -0
- package/dist/parsing/functions/to_integer.d.ts +7 -0
- package/dist/parsing/functions/to_integer.d.ts.map +1 -0
- package/dist/parsing/functions/to_integer.js +61 -0
- package/dist/parsing/functions/to_integer.js.map +1 -0
- package/docs/flowquery.min.js +1 -1
- package/flowquery-py/pyproject.toml +1 -1
- package/flowquery-py/src/parsing/data_structures/lookup.py +2 -0
- package/flowquery-py/src/parsing/functions/__init__.py +40 -2
- package/flowquery-py/src/parsing/functions/coalesce.py +43 -0
- package/flowquery-py/src/parsing/functions/date_.py +61 -0
- package/flowquery-py/src/parsing/functions/datetime_.py +62 -0
- package/flowquery-py/src/parsing/functions/duration.py +159 -0
- package/flowquery-py/src/parsing/functions/element_id.py +50 -0
- package/flowquery-py/src/parsing/functions/head.py +39 -0
- package/flowquery-py/src/parsing/functions/id_.py +49 -0
- package/flowquery-py/src/parsing/functions/last.py +39 -0
- package/flowquery-py/src/parsing/functions/localdatetime.py +60 -0
- package/flowquery-py/src/parsing/functions/localtime.py +57 -0
- package/flowquery-py/src/parsing/functions/max_.py +49 -0
- package/flowquery-py/src/parsing/functions/min_.py +49 -0
- package/flowquery-py/src/parsing/functions/nodes.py +48 -0
- package/flowquery-py/src/parsing/functions/properties.py +50 -0
- package/flowquery-py/src/parsing/functions/relationships.py +46 -0
- package/flowquery-py/src/parsing/functions/tail.py +37 -0
- package/flowquery-py/src/parsing/functions/temporal_utils.py +186 -0
- package/flowquery-py/src/parsing/functions/time_.py +57 -0
- package/flowquery-py/src/parsing/functions/timestamp.py +37 -0
- package/flowquery-py/src/parsing/functions/to_float.py +46 -0
- package/flowquery-py/src/parsing/functions/to_integer.py +46 -0
- package/flowquery-py/tests/compute/test_runner.py +834 -1
- package/flowquery-vscode/flowQueryEngine/flowquery.min.js +1 -1
- package/package.json +1 -1
- package/src/parsing/data_structures/lookup.ts +8 -4
- package/src/parsing/functions/coalesce.ts +49 -0
- package/src/parsing/functions/date.ts +63 -0
- package/src/parsing/functions/datetime.ts +63 -0
- package/src/parsing/functions/duration.ts +143 -0
- package/src/parsing/functions/element_id.ts +51 -0
- package/src/parsing/functions/function_factory.ts +20 -0
- package/src/parsing/functions/head.ts +42 -0
- package/src/parsing/functions/id.ts +51 -0
- package/src/parsing/functions/last.ts +42 -0
- package/src/parsing/functions/localdatetime.ts +63 -0
- package/src/parsing/functions/localtime.ts +58 -0
- package/src/parsing/functions/max.ts +37 -0
- package/src/parsing/functions/min.ts +37 -0
- package/src/parsing/functions/nodes.ts +54 -0
- package/src/parsing/functions/properties.ts +56 -0
- package/src/parsing/functions/relationships.ts +52 -0
- package/src/parsing/functions/tail.ts +39 -0
- package/src/parsing/functions/temporal_utils.ts +180 -0
- package/src/parsing/functions/time.ts +58 -0
- package/src/parsing/functions/timestamp.ts +37 -0
- package/src/parsing/functions/to_float.ts +50 -0
- package/src/parsing/functions/to_integer.ts +50 -0
- package/tests/compute/runner.test.ts +726 -0
|
@@ -1,15 +1,30 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
require("./avg");
|
|
4
|
+
require("./coalesce");
|
|
4
5
|
require("./collect");
|
|
5
6
|
require("./count");
|
|
7
|
+
require("./date");
|
|
8
|
+
require("./datetime");
|
|
9
|
+
require("./duration");
|
|
10
|
+
require("./element_id");
|
|
6
11
|
const function_metadata_1 = require("./function_metadata");
|
|
7
12
|
require("./functions");
|
|
13
|
+
require("./head");
|
|
14
|
+
require("./id");
|
|
8
15
|
require("./join");
|
|
9
16
|
require("./keys");
|
|
17
|
+
require("./last");
|
|
18
|
+
require("./localdatetime");
|
|
19
|
+
require("./localtime");
|
|
20
|
+
require("./max");
|
|
21
|
+
require("./min");
|
|
22
|
+
require("./nodes");
|
|
10
23
|
require("./predicate_sum");
|
|
24
|
+
require("./properties");
|
|
11
25
|
require("./rand");
|
|
12
26
|
require("./range");
|
|
27
|
+
require("./relationships");
|
|
13
28
|
require("./replace");
|
|
14
29
|
require("./round");
|
|
15
30
|
require("./schema");
|
|
@@ -19,6 +34,11 @@ require("./string_distance");
|
|
|
19
34
|
require("./stringify");
|
|
20
35
|
// Import built-in functions to ensure their @FunctionDef decorators run
|
|
21
36
|
require("./sum");
|
|
37
|
+
require("./tail");
|
|
38
|
+
require("./time");
|
|
39
|
+
require("./timestamp");
|
|
40
|
+
require("./to_float");
|
|
41
|
+
require("./to_integer");
|
|
22
42
|
require("./to_json");
|
|
23
43
|
require("./to_lower");
|
|
24
44
|
require("./to_string");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"function_factory.js","sourceRoot":"","sources":["../../../src/parsing/functions/function_factory.ts"],"names":[],"mappings":";;AACA,iBAAe;AACf,qBAAmB;AACnB,mBAAiB;
|
|
1
|
+
{"version":3,"file":"function_factory.js","sourceRoot":"","sources":["../../../src/parsing/functions/function_factory.ts"],"names":[],"mappings":";;AACA,iBAAe;AACf,sBAAoB;AACpB,qBAAmB;AACnB,mBAAiB;AACjB,kBAAgB;AAChB,sBAAoB;AACpB,sBAAoB;AACpB,wBAAsB;AAEtB,2DAM6B;AAC7B,uBAAqB;AACrB,kBAAgB;AAChB,gBAAc;AACd,kBAAgB;AAChB,kBAAgB;AAChB,kBAAgB;AAChB,2BAAyB;AACzB,uBAAqB;AACrB,iBAAe;AACf,iBAAe;AACf,mBAAiB;AAEjB,2BAAyB;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ACnB,OAAO,gBAAgB,EAAE,CAAC;QAC9B,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,EAAE,CAAC,CAAC;IAC3D,CAAC;IAEM,MAAM,CAAC,WAAW,CAAC,IAAY;QAClC,MAAM,SAAS,GAAW,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,gBAAgB,GAAG,IAAA,gDAA4B,EAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC1E,IAAI,gBAAgB,EAAE,CAAC;YACnB,OAAO,gBAAgB,EAAmB,CAAC;QAC/C,CAAC;QACD,MAAM,IAAI,KAAK,CAAC,2BAA2B,IAAI,EAAE,CAAC,CAAC;IACvD,CAAC;CACJ;AAED,kBAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/head.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,cAiBM,IAAK,SAAQ,QAAQ;;IAMhB,KAAK,IAAI,GAAG;CAatB;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const function_1 = __importDefault(require("./function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
let Head = class Head extends function_1.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super("head");
|
|
17
|
+
this._expectedParameterCount = 1;
|
|
18
|
+
}
|
|
19
|
+
value() {
|
|
20
|
+
const val = this.getChildren()[0].value();
|
|
21
|
+
if (val === null || val === undefined) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (!Array.isArray(val)) {
|
|
25
|
+
throw new Error("head() expects a list");
|
|
26
|
+
}
|
|
27
|
+
if (val.length === 0) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return val[0];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
Head = __decorate([
|
|
34
|
+
(0, function_metadata_1.FunctionDef)({
|
|
35
|
+
description: "Returns the first element of a list",
|
|
36
|
+
category: "scalar",
|
|
37
|
+
parameters: [
|
|
38
|
+
{
|
|
39
|
+
name: "list",
|
|
40
|
+
description: "The list to get the first element from",
|
|
41
|
+
type: "array",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
output: {
|
|
45
|
+
description: "The first element of the list",
|
|
46
|
+
type: "any",
|
|
47
|
+
example: "1",
|
|
48
|
+
},
|
|
49
|
+
examples: ["RETURN head([1, 2, 3])", "WITH ['a', 'b', 'c'] AS items RETURN head(items)"],
|
|
50
|
+
})
|
|
51
|
+
], Head);
|
|
52
|
+
exports.default = Head;
|
|
53
|
+
//# sourceMappingURL=head.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"head.js","sourceRoot":"","sources":["../../../src/parsing/functions/head.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0DAAkC;AAClC,2DAAkD;AAmBlD,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,kBAAQ;IACvB;QACI,KAAK,CAAC,MAAM,CAA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
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const function_1 = __importDefault(require("./function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
let Id = class Id extends function_1.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super("id");
|
|
17
|
+
this._expectedParameterCount = 1;
|
|
18
|
+
}
|
|
19
|
+
value() {
|
|
20
|
+
const obj = this.getChildren()[0].value();
|
|
21
|
+
if (obj === null || obj === undefined) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (typeof obj !== "object" || Array.isArray(obj)) {
|
|
25
|
+
throw new Error("id() expects a node or relationship");
|
|
26
|
+
}
|
|
27
|
+
// If it's a RelationshipMatchRecord (has type, startNode, endNode, properties)
|
|
28
|
+
if ("type" in obj && "startNode" in obj && "endNode" in obj && "properties" in obj) {
|
|
29
|
+
return obj.type;
|
|
30
|
+
}
|
|
31
|
+
// If it's a node record (has id field)
|
|
32
|
+
if ("id" in obj) {
|
|
33
|
+
return obj.id;
|
|
34
|
+
}
|
|
35
|
+
throw new Error("id() expects a node or relationship");
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Id = __decorate([
|
|
39
|
+
(0, function_metadata_1.FunctionDef)({
|
|
40
|
+
description: "Returns the id of a node or relationship. For nodes, returns the id property. For relationships, returns the type.",
|
|
41
|
+
category: "scalar",
|
|
42
|
+
parameters: [
|
|
43
|
+
{
|
|
44
|
+
name: "entity",
|
|
45
|
+
description: "A node or relationship to get the id from",
|
|
46
|
+
type: "object",
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
output: {
|
|
50
|
+
description: "The id of the entity",
|
|
51
|
+
type: "any",
|
|
52
|
+
example: "1",
|
|
53
|
+
},
|
|
54
|
+
examples: ["MATCH (n:Person) RETURN id(n)", "MATCH (a)-[r]->(b) RETURN id(r)"],
|
|
55
|
+
})
|
|
56
|
+
], Id);
|
|
57
|
+
exports.default = Id;
|
|
58
|
+
//# sourceMappingURL=id.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"id.js","sourceRoot":"","sources":["../../../src/parsing/functions/id.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0DAAkC;AAClC,2DAAkD;AAoBlD,IAAM,EAAE,GAAR,MAAM,EAAG,SAAQ,kBAAQ;IACrB;QACI,KAAK,CAAC,IAAI,CAAC,CAAC;QACZ,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;IACrC,CAAC;IAEM,KAAK;QACR,MAAM,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC;QAC1C,IAAI,GAAG,KAAK,IAAI,IAAI,GAAG,KAAK,SAAS,EAAE,CAAC;YACpC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;QAC3D,CAAC;QAED,+EAA+E;QAC/E,IAAI,MAAM,IAAI,GAAG,IAAI,WAAW,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,YAAY,IAAI,GAAG,EAAE,CAAC;YACjF,OAAO,GAAG,CAAC,IAAI,CAAC;QACpB,CAAC;QAED,uCAAuC;QACvC,IAAI,IAAI,IAAI,GAAG,EAAE,CAAC;YACd,OAAO,GAAG,CAAC,EAAE,CAAC;QAClB,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAC3D,CAAC;CACJ,CAAA;AA3BK,EAAE;IAlBP,IAAA,+BAAW,EAAC;QACT,WAAW,EACP,oHAAoH;QACxH,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE;YACR;gBACI,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,2CAA2C;gBACxD,IAAI,EAAE,QAAQ;aACjB;SACJ;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,OAAO,EAAE,GAAG;SACf;QACD,QAAQ,EAAE,CAAC,+BAA+B,EAAE,iCAAiC,CAAC;KACjF,CAAC;GACI,EAAE,CA2BP;AAED,kBAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"last.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/last.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAGlC,cAiBM,IAAK,SAAQ,QAAQ;;IAMhB,KAAK,IAAI,GAAG;CAatB;AAED,eAAe,IAAI,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const function_1 = __importDefault(require("./function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
let Last = class Last extends function_1.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super("last");
|
|
17
|
+
this._expectedParameterCount = 1;
|
|
18
|
+
}
|
|
19
|
+
value() {
|
|
20
|
+
const val = this.getChildren()[0].value();
|
|
21
|
+
if (val === null || val === undefined) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (!Array.isArray(val)) {
|
|
25
|
+
throw new Error("last() expects a list");
|
|
26
|
+
}
|
|
27
|
+
if (val.length === 0) {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
30
|
+
return val[val.length - 1];
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
Last = __decorate([
|
|
34
|
+
(0, function_metadata_1.FunctionDef)({
|
|
35
|
+
description: "Returns the last element of a list",
|
|
36
|
+
category: "scalar",
|
|
37
|
+
parameters: [
|
|
38
|
+
{
|
|
39
|
+
name: "list",
|
|
40
|
+
description: "The list to get the last element from",
|
|
41
|
+
type: "array",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
output: {
|
|
45
|
+
description: "The last element of the list",
|
|
46
|
+
type: "any",
|
|
47
|
+
example: "3",
|
|
48
|
+
},
|
|
49
|
+
examples: ["RETURN last([1, 2, 3])", "WITH ['a', 'b', 'c'] AS items RETURN last(items)"],
|
|
50
|
+
})
|
|
51
|
+
], Last);
|
|
52
|
+
exports.default = Last;
|
|
53
|
+
//# sourceMappingURL=last.js.map
|
|
@@ -0,0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
|
1
|
+
import Function from "./function";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a local datetime value (date + time, no timezone offset).
|
|
4
|
+
* When called with no arguments, returns the current local datetime.
|
|
5
|
+
* When called with a string argument, parses it as an ISO 8601 datetime.
|
|
6
|
+
* When called with a map argument, constructs a datetime from components.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```
|
|
10
|
+
* RETURN localdatetime() AS now
|
|
11
|
+
* RETURN localdatetime('2025-06-15T12:30:00') AS dt
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
declare class LocalDatetime extends Function {
|
|
15
|
+
constructor();
|
|
16
|
+
value(): any;
|
|
17
|
+
}
|
|
18
|
+
export default LocalDatetime;
|
|
19
|
+
//# sourceMappingURL=localdatetime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localdatetime.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/localdatetime.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAIlC;;;;;;;;;;;GAWG;AACH,cAyBM,aAAc,SAAQ,QAAQ;;IAMzB,KAAK,IAAI,GAAG;CAatB;AAED,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const function_1 = __importDefault(require("./function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
const temporal_utils_1 = require("./temporal_utils");
|
|
15
|
+
/**
|
|
16
|
+
* Returns a local datetime value (date + time, no timezone offset).
|
|
17
|
+
* When called with no arguments, returns the current local datetime.
|
|
18
|
+
* When called with a string argument, parses it as an ISO 8601 datetime.
|
|
19
|
+
* When called with a map argument, constructs a datetime from components.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```
|
|
23
|
+
* RETURN localdatetime() AS now
|
|
24
|
+
* RETURN localdatetime('2025-06-15T12:30:00') AS dt
|
|
25
|
+
* ```
|
|
26
|
+
*/
|
|
27
|
+
let LocalDatetime = class LocalDatetime extends function_1.default {
|
|
28
|
+
constructor() {
|
|
29
|
+
super("localdatetime");
|
|
30
|
+
this._expectedParameterCount = null;
|
|
31
|
+
}
|
|
32
|
+
value() {
|
|
33
|
+
const children = this.getChildren();
|
|
34
|
+
if (children.length > 1) {
|
|
35
|
+
throw new Error("localdatetime() accepts at most one argument");
|
|
36
|
+
}
|
|
37
|
+
const d = children.length === 1
|
|
38
|
+
? (0, temporal_utils_1.parseTemporalArg)(children[0].value(), "localdatetime")
|
|
39
|
+
: new Date();
|
|
40
|
+
return (0, temporal_utils_1.buildDatetimeObject)(d, false);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
LocalDatetime = __decorate([
|
|
44
|
+
(0, function_metadata_1.FunctionDef)({
|
|
45
|
+
description: "Returns a local datetime value (no timezone). With no arguments returns the current local datetime. " +
|
|
46
|
+
"Accepts an ISO 8601 string or a map of components.",
|
|
47
|
+
category: "scalar",
|
|
48
|
+
parameters: [
|
|
49
|
+
{
|
|
50
|
+
name: "input",
|
|
51
|
+
description: "Optional. An ISO 8601 datetime string or a map of components.",
|
|
52
|
+
type: "string",
|
|
53
|
+
required: false,
|
|
54
|
+
},
|
|
55
|
+
],
|
|
56
|
+
output: {
|
|
57
|
+
description: "A datetime object with properties: year, month, day, hour, minute, second, millisecond, " +
|
|
58
|
+
"epochMillis, epochSeconds, dayOfWeek, dayOfYear, quarter, formatted",
|
|
59
|
+
type: "object",
|
|
60
|
+
},
|
|
61
|
+
examples: [
|
|
62
|
+
"RETURN localdatetime() AS now",
|
|
63
|
+
"RETURN localdatetime('2025-06-15T12:30:00') AS dt",
|
|
64
|
+
"WITH localdatetime() AS dt RETURN dt.hour, dt.minute",
|
|
65
|
+
],
|
|
66
|
+
})
|
|
67
|
+
], LocalDatetime);
|
|
68
|
+
exports.default = LocalDatetime;
|
|
69
|
+
//# sourceMappingURL=localdatetime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localdatetime.js","sourceRoot":"","sources":["../../../src/parsing/functions/localdatetime.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0DAAkC;AAClC,2DAAkD;AAClD,qDAAyE;AAEzE;;;;;;;;;;;GAWG;AA0BH,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,kBAAQ;IAChC;QACI,KAAK,CAAC,eAAe,CAAC,CAAC;QACvB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACxC,CAAC;IAEM,KAAK;QACR,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,CAAC,GACH,QAAQ,CAAC,MAAM,KAAK,CAAC;YACjB,CAAC,CAAC,IAAA,iCAAgB,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,eAAe,CAAC;YACxD,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QAErB,OAAO,IAAA,oCAAmB,EAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC;CACJ,CAAA;AAnBK,aAAa;IAzBlB,IAAA,+BAAW,EAAC;QACT,WAAW,EACP,sGAAsG;YACtG,oDAAoD;QACxD,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE;YACR;gBACI,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,+DAA+D;gBAC5E,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAClB;SACJ;QACD,MAAM,EAAE;YACJ,WAAW,EACP,0FAA0F;gBAC1F,qEAAqE;YACzE,IAAI,EAAE,QAAQ;SACjB;QACD,QAAQ,EAAE;YACN,+BAA+B;YAC/B,mDAAmD;YACnD,sDAAsD;SACzD;KACJ,CAAC;GACI,aAAa,CAmBlB;AAED,kBAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Function from "./function";
|
|
2
|
+
/**
|
|
3
|
+
* Returns a local time value (no timezone offset).
|
|
4
|
+
* When called with no arguments, returns the current local time.
|
|
5
|
+
* When called with a string argument, parses it.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```
|
|
9
|
+
* RETURN localtime() AS now
|
|
10
|
+
* RETURN localtime('14:30:00') AS t
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
13
|
+
declare class LocalTime extends Function {
|
|
14
|
+
constructor();
|
|
15
|
+
value(): any;
|
|
16
|
+
}
|
|
17
|
+
export default LocalTime;
|
|
18
|
+
//# sourceMappingURL=localtime.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localtime.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/localtime.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAIlC;;;;;;;;;;GAUG;AACH,cAuBM,SAAU,SAAQ,QAAQ;;IAMrB,KAAK,IAAI,GAAG;CAWtB;AAED,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const function_1 = __importDefault(require("./function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
const temporal_utils_1 = require("./temporal_utils");
|
|
15
|
+
/**
|
|
16
|
+
* Returns a local time value (no timezone offset).
|
|
17
|
+
* When called with no arguments, returns the current local time.
|
|
18
|
+
* When called with a string argument, parses it.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```
|
|
22
|
+
* RETURN localtime() AS now
|
|
23
|
+
* RETURN localtime('14:30:00') AS t
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
let LocalTime = class LocalTime extends function_1.default {
|
|
27
|
+
constructor() {
|
|
28
|
+
super("localtime");
|
|
29
|
+
this._expectedParameterCount = null;
|
|
30
|
+
}
|
|
31
|
+
value() {
|
|
32
|
+
const children = this.getChildren();
|
|
33
|
+
if (children.length > 1) {
|
|
34
|
+
throw new Error("localtime() accepts at most one argument");
|
|
35
|
+
}
|
|
36
|
+
const d = children.length === 1 ? (0, temporal_utils_1.parseTemporalArg)(children[0].value(), "localtime") : new Date();
|
|
37
|
+
return (0, temporal_utils_1.buildTimeObject)(d, false);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
LocalTime = __decorate([
|
|
41
|
+
(0, function_metadata_1.FunctionDef)({
|
|
42
|
+
description: "Returns a local time value (no timezone). With no arguments returns the current local time. " +
|
|
43
|
+
"Accepts an ISO 8601 time string or a map of components.",
|
|
44
|
+
category: "scalar",
|
|
45
|
+
parameters: [
|
|
46
|
+
{
|
|
47
|
+
name: "input",
|
|
48
|
+
description: "Optional. An ISO 8601 time string (HH:MM:SS) or a map of components.",
|
|
49
|
+
type: "string",
|
|
50
|
+
required: false,
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
output: {
|
|
54
|
+
description: "A time object with properties: hour, minute, second, millisecond, formatted",
|
|
55
|
+
type: "object",
|
|
56
|
+
},
|
|
57
|
+
examples: [
|
|
58
|
+
"RETURN localtime() AS now",
|
|
59
|
+
"RETURN localtime('14:30:00') AS t",
|
|
60
|
+
"WITH localtime() AS t RETURN t.hour, t.minute",
|
|
61
|
+
],
|
|
62
|
+
})
|
|
63
|
+
], LocalTime);
|
|
64
|
+
exports.default = LocalTime;
|
|
65
|
+
//# sourceMappingURL=localtime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"localtime.js","sourceRoot":"","sources":["../../../src/parsing/functions/localtime.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0DAAkC;AAClC,2DAAkD;AAClD,qDAAqE;AAErE;;;;;;;;;;GAUG;AAwBH,IAAM,SAAS,GAAf,MAAM,SAAU,SAAQ,kBAAQ;IAC5B;QACI,KAAK,CAAC,WAAW,CAAC,CAAC;QACnB,IAAI,CAAC,uBAAuB,GAAG,IAAI,CAAC;IACxC,CAAC;IAEM,KAAK;QACR,MAAM,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;QACpC,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;QAChE,CAAC;QAED,MAAM,CAAC,GACH,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAA,iCAAgB,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC;QAE5F,OAAO,IAAA,gCAAe,EAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACrC,CAAC;CACJ,CAAA;AAjBK,SAAS;IAvBd,IAAA,+BAAW,EAAC;QACT,WAAW,EACP,8FAA8F;YAC9F,yDAAyD;QAC7D,QAAQ,EAAE,QAAQ;QAClB,UAAU,EAAE;YACR;gBACI,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,sEAAsE;gBACnF,IAAI,EAAE,QAAQ;gBACd,QAAQ,EAAE,KAAK;aAClB;SACJ;QACD,MAAM,EAAE;YACJ,WAAW,EAAE,6EAA6E;YAC1F,IAAI,EAAE,QAAQ;SACjB;QACD,QAAQ,EAAE;YACN,2BAA2B;YAC3B,mCAAmC;YACnC,+CAA+C;SAClD;KACJ,CAAC;GACI,SAAS,CAiBd;AAED,kBAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import AggregateFunction from "./aggregate_function";
|
|
2
|
+
import ReducerElement from "./reducer_element";
|
|
3
|
+
declare class MaxReducerElement extends ReducerElement {
|
|
4
|
+
private _value;
|
|
5
|
+
get value(): any;
|
|
6
|
+
set value(value: any);
|
|
7
|
+
}
|
|
8
|
+
declare class Max extends AggregateFunction {
|
|
9
|
+
constructor();
|
|
10
|
+
reduce(element: MaxReducerElement): void;
|
|
11
|
+
element(): MaxReducerElement;
|
|
12
|
+
}
|
|
13
|
+
export default Max;
|
|
14
|
+
//# sourceMappingURL=max.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/max.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AAErD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,cAAM,iBAAkB,SAAQ,cAAc;IAC1C,OAAO,CAAC,MAAM,CAAa;IAC3B,IAAW,KAAK,IAAI,GAAG,CAEtB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,GAAG,EAI1B;CACJ;AAED,cAOM,GAAI,SAAQ,iBAAiB;;IAKxB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAGxC,OAAO,IAAI,iBAAiB;CAGtC;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const aggregate_function_1 = __importDefault(require("./aggregate_function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
const reducer_element_1 = __importDefault(require("./reducer_element"));
|
|
15
|
+
class MaxReducerElement extends reducer_element_1.default {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this._value = null;
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
return this._value;
|
|
22
|
+
}
|
|
23
|
+
set value(value) {
|
|
24
|
+
if (this._value === null || value > this._value) {
|
|
25
|
+
this._value = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
let Max = class Max extends aggregate_function_1.default {
|
|
30
|
+
constructor() {
|
|
31
|
+
super("max");
|
|
32
|
+
this._expectedParameterCount = 1;
|
|
33
|
+
}
|
|
34
|
+
reduce(element) {
|
|
35
|
+
element.value = this.firstChild().value();
|
|
36
|
+
}
|
|
37
|
+
element() {
|
|
38
|
+
return new MaxReducerElement();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
Max = __decorate([
|
|
42
|
+
(0, function_metadata_1.FunctionDef)({
|
|
43
|
+
description: "Returns the maximum value across grouped rows",
|
|
44
|
+
category: "aggregate",
|
|
45
|
+
parameters: [{ name: "value", description: "Value to compare", type: "number" }],
|
|
46
|
+
output: { description: "Maximum value", type: "number", example: 10 },
|
|
47
|
+
examples: ["WITH [3, 1, 2] AS nums UNWIND nums AS n RETURN max(n)"],
|
|
48
|
+
})
|
|
49
|
+
], Max);
|
|
50
|
+
exports.default = Max;
|
|
51
|
+
//# sourceMappingURL=max.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"max.js","sourceRoot":"","sources":["../../../src/parsing/functions/max.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8EAAqD;AACrD,2DAAkD;AAClD,wEAA+C;AAE/C,MAAM,iBAAkB,SAAQ,yBAAc;IAA9C;;QACY,WAAM,GAAQ,IAAI,CAAC;IAS/B,CAAC;IARG,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,IAAW,KAAK,CAAC,KAAU;QACvB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC9C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACxB,CAAC;IACL,CAAC;CACJ;AASD,IAAM,GAAG,GAAT,MAAM,GAAI,SAAQ,4BAAiB;IAC/B;QACI,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,uBAAuB,GAAG,CAAC,CAAC;IACrC,CAAC;IACM,MAAM,CAAC,OAA0B;QACpC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,KAAK,EAAE,CAAC;IAC9C,CAAC;IACM,OAAO;QACV,OAAO,IAAI,iBAAiB,EAAE,CAAC;IACnC,CAAC;CACJ,CAAA;AAXK,GAAG;IAPR,IAAA,+BAAW,EAAC;QACT,WAAW,EAAE,+CAA+C;QAC5D,QAAQ,EAAE,WAAW;QACrB,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;QAChF,MAAM,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE;QACrE,QAAQ,EAAE,CAAC,uDAAuD,CAAC;KACtE,CAAC;GACI,GAAG,CAWR;AAED,kBAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import AggregateFunction from "./aggregate_function";
|
|
2
|
+
import ReducerElement from "./reducer_element";
|
|
3
|
+
declare class MinReducerElement extends ReducerElement {
|
|
4
|
+
private _value;
|
|
5
|
+
get value(): any;
|
|
6
|
+
set value(value: any);
|
|
7
|
+
}
|
|
8
|
+
declare class Min extends AggregateFunction {
|
|
9
|
+
constructor();
|
|
10
|
+
reduce(element: MinReducerElement): void;
|
|
11
|
+
element(): MinReducerElement;
|
|
12
|
+
}
|
|
13
|
+
export default Min;
|
|
14
|
+
//# sourceMappingURL=min.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min.d.ts","sourceRoot":"","sources":["../../../src/parsing/functions/min.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,sBAAsB,CAAC;AAErD,OAAO,cAAc,MAAM,mBAAmB,CAAC;AAE/C,cAAM,iBAAkB,SAAQ,cAAc;IAC1C,OAAO,CAAC,MAAM,CAAa;IAC3B,IAAW,KAAK,IAAI,GAAG,CAEtB;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,GAAG,EAI1B;CACJ;AAED,cAOM,GAAI,SAAQ,iBAAiB;;IAKxB,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI;IAGxC,OAAO,IAAI,iBAAiB;CAGtC;AAED,eAAe,GAAG,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const aggregate_function_1 = __importDefault(require("./aggregate_function"));
|
|
13
|
+
const function_metadata_1 = require("./function_metadata");
|
|
14
|
+
const reducer_element_1 = __importDefault(require("./reducer_element"));
|
|
15
|
+
class MinReducerElement extends reducer_element_1.default {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this._value = null;
|
|
19
|
+
}
|
|
20
|
+
get value() {
|
|
21
|
+
return this._value;
|
|
22
|
+
}
|
|
23
|
+
set value(value) {
|
|
24
|
+
if (this._value === null || value < this._value) {
|
|
25
|
+
this._value = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
let Min = class Min extends aggregate_function_1.default {
|
|
30
|
+
constructor() {
|
|
31
|
+
super("min");
|
|
32
|
+
this._expectedParameterCount = 1;
|
|
33
|
+
}
|
|
34
|
+
reduce(element) {
|
|
35
|
+
element.value = this.firstChild().value();
|
|
36
|
+
}
|
|
37
|
+
element() {
|
|
38
|
+
return new MinReducerElement();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
Min = __decorate([
|
|
42
|
+
(0, function_metadata_1.FunctionDef)({
|
|
43
|
+
description: "Returns the minimum value across grouped rows",
|
|
44
|
+
category: "aggregate",
|
|
45
|
+
parameters: [{ name: "value", description: "Value to compare", type: "number" }],
|
|
46
|
+
output: { description: "Minimum value", type: "number", example: 1 },
|
|
47
|
+
examples: ["WITH [3, 1, 2] AS nums UNWIND nums AS n RETURN min(n)"],
|
|
48
|
+
})
|
|
49
|
+
], Min);
|
|
50
|
+
exports.default = Min;
|
|
51
|
+
//# sourceMappingURL=min.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"min.js","sourceRoot":"","sources":["../../../src/parsing/functions/min.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,8EAAqD;AACrD,2DAAkD;AAClD,wEAA+C;AAE/C,MAAM,iBAAkB,SAAQ,yBAAc;IAA9C;;QACY,WAAM,GAAQ,IAAI,CAAC;IAS/B,CAAC;IARG,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,IAAW,KAAK,CAAC,KAAU;QACvB,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC9C,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACx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