@garrix82/reactgenie-dsl 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +436 -0
- package/dist/__test__/dsl-descriptor.test.d.ts +1 -0
- package/dist/__test__/dsl-descriptor.test.js +27 -0
- package/dist/__test__/dsl-descriptor.test.js.map +1 -0
- package/dist/__test__/example_descriptor.d.ts +125 -0
- package/dist/__test__/example_descriptor.js +607 -0
- package/dist/__test__/example_descriptor.js.map +1 -0
- package/dist/__test__/food_descriptor.state.json +1 -0
- package/dist/__test__/food_descriptor.test.d.ts +74 -0
- package/dist/__test__/food_descriptor.test.js +205 -0
- package/dist/__test__/food_descriptor.test.js.map +1 -0
- package/dist/__test__/nl-interpreter-provider-selection.test.d.ts +1 -0
- package/dist/__test__/nl-interpreter-provider-selection.test.js +73 -0
- package/dist/__test__/nl-interpreter-provider-selection.test.js.map +1 -0
- package/dist/__test__/nl-interpreter.test.d.ts +1 -0
- package/dist/__test__/nl-interpreter.test.js +86 -0
- package/dist/__test__/nl-interpreter.test.js.map +1 -0
- package/dist/decorators/__test__/decorators.test.d.ts +1 -0
- package/dist/decorators/__test__/decorators.test.js +182 -0
- package/dist/decorators/__test__/decorators.test.js.map +1 -0
- package/dist/decorators/__test__/inheritance-descriptor.test.d.ts +1 -0
- package/dist/decorators/__test__/inheritance-descriptor.test.js +107 -0
- package/dist/decorators/__test__/inheritance-descriptor.test.js.map +1 -0
- package/dist/decorators/decorators.d.ts +20 -0
- package/dist/decorators/decorators.js +520 -0
- package/dist/decorators/decorators.js.map +1 -0
- package/dist/decorators/index.d.ts +2 -0
- package/dist/decorators/index.js +19 -0
- package/dist/decorators/index.js.map +1 -0
- package/dist/decorators/store.d.ts +12 -0
- package/dist/decorators/store.js +43 -0
- package/dist/decorators/store.js.map +1 -0
- package/dist/dsl/__test__/dsl-interpreter.test.d.ts +1 -0
- package/dist/dsl/__test__/dsl-interpreter.test.js +334 -0
- package/dist/dsl/__test__/dsl-interpreter.test.js.map +1 -0
- package/dist/dsl/__test__/parser.gen.test.d.ts +1 -0
- package/dist/dsl/__test__/parser.gen.test.js +283 -0
- package/dist/dsl/__test__/parser.gen.test.js.map +1 -0
- package/dist/dsl/dsl-interpreter.d.ts +66 -0
- package/dist/dsl/dsl-interpreter.js +767 -0
- package/dist/dsl/dsl-interpreter.js.map +1 -0
- package/dist/dsl/index.d.ts +1 -0
- package/dist/dsl/index.js +18 -0
- package/dist/dsl/index.js.map +1 -0
- package/dist/dsl/parser.gen.d.ts +10 -0
- package/dist/dsl/parser.gen.js +1524 -0
- package/dist/dsl/parser.gen.js.map +1 -0
- package/dist/dsl-descriptor.d.ts +75 -0
- package/dist/dsl-descriptor.js +151 -0
- package/dist/dsl-descriptor.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/nl/__test__/context-aware-prompt.test.d.ts +1 -0
- package/dist/nl/__test__/context-aware-prompt.test.js +247 -0
- package/dist/nl/__test__/context-aware-prompt.test.js.map +1 -0
- package/dist/nl/__test__/context-selector.test.d.ts +1 -0
- package/dist/nl/__test__/context-selector.test.js +20 -0
- package/dist/nl/__test__/context-selector.test.js.map +1 -0
- package/dist/nl/__test__/nl-parser-groq-transport.test.d.ts +1 -0
- package/dist/nl/__test__/nl-parser-groq-transport.test.js +87 -0
- package/dist/nl/__test__/nl-parser-groq-transport.test.js.map +1 -0
- package/dist/nl/__test__/nl-parser-openai-parity.test.d.ts +1 -0
- package/dist/nl/__test__/nl-parser-openai-parity.test.js +206 -0
- package/dist/nl/__test__/nl-parser-openai-parity.test.js.map +1 -0
- package/dist/nl/__test__/nl-parser-openai-sampling.test.d.ts +1 -0
- package/dist/nl/__test__/nl-parser-openai-sampling.test.js +44 -0
- package/dist/nl/__test__/nl-parser-openai-sampling.test.js.map +1 -0
- package/dist/nl/__test__/nl-parser-openai-transport.test.d.ts +1 -0
- package/dist/nl/__test__/nl-parser-openai-transport.test.js +55 -0
- package/dist/nl/__test__/nl-parser-openai-transport.test.js.map +1 -0
- package/dist/nl/__test__/nl-parser-utils.test.d.ts +1 -0
- package/dist/nl/__test__/nl-parser-utils.test.js +70 -0
- package/dist/nl/__test__/nl-parser-utils.test.js.map +1 -0
- package/dist/nl/__test__/nl-parser.test.d.ts +1 -0
- package/dist/nl/__test__/nl-parser.test.js +64 -0
- package/dist/nl/__test__/nl-parser.test.js.map +1 -0
- package/dist/nl/__test__/parameter-tuning.test.d.ts +1 -0
- package/dist/nl/__test__/parameter-tuning.test.js +95 -0
- package/dist/nl/__test__/parameter-tuning.test.js.map +1 -0
- package/dist/nl/__test__/semantic-parsing-experiment.test.d.ts +1 -0
- package/dist/nl/__test__/semantic-parsing-experiment.test.js +178 -0
- package/dist/nl/__test__/semantic-parsing-experiment.test.js.map +1 -0
- package/dist/nl/context-selector.d.ts +17 -0
- package/dist/nl/context-selector.js +99 -0
- package/dist/nl/context-selector.js.map +1 -0
- package/dist/nl/index.d.ts +6 -0
- package/dist/nl/index.js +15 -0
- package/dist/nl/index.js.map +1 -0
- package/dist/nl/llm-monitoring.d.ts +49 -0
- package/dist/nl/llm-monitoring.js +243 -0
- package/dist/nl/llm-monitoring.js.map +1 -0
- package/dist/nl/llm-monitoring.test.d.ts +5 -0
- package/dist/nl/llm-monitoring.test.js +101 -0
- package/dist/nl/llm-monitoring.test.js.map +1 -0
- package/dist/nl/nl-parser-groq.d.ts +21 -0
- package/dist/nl/nl-parser-groq.js +357 -0
- package/dist/nl/nl-parser-groq.js.map +1 -0
- package/dist/nl/nl-parser-utils.d.ts +101 -0
- package/dist/nl/nl-parser-utils.js +255 -0
- package/dist/nl/nl-parser-utils.js.map +1 -0
- package/dist/nl/nl-parser.d.ts +30 -0
- package/dist/nl/nl-parser.js +433 -0
- package/dist/nl/nl-parser.js.map +1 -0
- package/dist/nl/prompt-gen.d.ts +93 -0
- package/dist/nl/prompt-gen.js +369 -0
- package/dist/nl/prompt-gen.js.map +1 -0
- package/dist/nl/prompt-res.d.ts +16 -0
- package/dist/nl/prompt-res.js +190 -0
- package/dist/nl/prompt-res.js.map +1 -0
- package/dist/nl-interpreter.d.ts +48 -0
- package/dist/nl-interpreter.js +155 -0
- package/dist/nl-interpreter.js.map +1 -0
- package/lib/__test__/dsl-descriptor.test.ts +27 -0
- package/lib/__test__/example_descriptor.ts +762 -0
- package/lib/__test__/food_descriptor.state.json +1 -0
- package/lib/__test__/food_descriptor.test.ts +331 -0
- package/lib/__test__/nl-interpreter-provider-selection.test.ts +126 -0
- package/lib/__test__/nl-interpreter.test.ts +129 -0
- package/lib/decorators/__test__/decorators.test.ts +177 -0
- package/lib/decorators/__test__/inheritance-descriptor.test.ts +92 -0
- package/lib/decorators/decorators.ts +754 -0
- package/lib/decorators/index.ts +2 -0
- package/lib/decorators/store.ts +47 -0
- package/lib/dsl/__test__/dsl-interpreter.test.ts +453 -0
- package/lib/dsl/__test__/parser.gen.test.ts +296 -0
- package/lib/dsl/dsl-interpreter.ts +974 -0
- package/lib/dsl/index.ts +1 -0
- package/lib/dsl/parser.gen.js +1479 -0
- package/lib/dsl/parser.pegjs +130 -0
- package/lib/dsl-descriptor.ts +241 -0
- package/lib/index.ts +5 -0
- package/lib/nl/__test__/context-aware-prompt.test.ts +372 -0
- package/lib/nl/__test__/context-selector.test.ts +27 -0
- package/lib/nl/__test__/nl-parser-groq-transport.test.ts +139 -0
- package/lib/nl/__test__/nl-parser-openai-parity.test.ts +381 -0
- package/lib/nl/__test__/nl-parser-openai-sampling.test.ts +73 -0
- package/lib/nl/__test__/nl-parser-openai-transport.test.ts +79 -0
- package/lib/nl/__test__/nl-parser-utils.test.ts +98 -0
- package/lib/nl/__test__/nl-parser.test.ts +119 -0
- package/lib/nl/__test__/parameter-tuning.test.ts +137 -0
- package/lib/nl/__test__/semantic-parsing-experiment.test.ts +260 -0
- package/lib/nl/context-selector.ts +123 -0
- package/lib/nl/index.ts +19 -0
- package/lib/nl/llm-monitoring.test.ts +136 -0
- package/lib/nl/llm-monitoring.ts +339 -0
- package/lib/nl/nl-parser-groq.ts +510 -0
- package/lib/nl/nl-parser-utils.ts +310 -0
- package/lib/nl/nl-parser.ts +616 -0
- package/lib/nl/prompt-gen.ts +607 -0
- package/lib/nl/prompt-res.ts +207 -0
- package/lib/nl-interpreter.ts +262 -0
- package/package.json +58 -0
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const dsl_interpreter_1 = require("../dsl-interpreter");
|
|
4
|
+
const example_descriptor_1 = require("../../__test__/example_descriptor");
|
|
5
|
+
const decorators_1 = require("../../decorators");
|
|
6
|
+
(0, decorators_1.initGenie)();
|
|
7
|
+
test("Basic function call", async () => {
|
|
8
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
9
|
+
const funcCallResult = await interpreter.interpret("Restaurant.current().book(dateTime: DateTime(year: 2020, month: 1, day: 1, hour: 12, minute: 0))");
|
|
10
|
+
expect(example_descriptor_1.recentBooking).toEqual("McDonald's is booking for 2020-1-1 12:0");
|
|
11
|
+
expect(funcCallResult).toEqual({
|
|
12
|
+
objectType: "void",
|
|
13
|
+
type: "object",
|
|
14
|
+
value: undefined
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
test("Indexing", async () => {
|
|
18
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
19
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all()[1].name");
|
|
20
|
+
expect(funcCallResult).toEqual({
|
|
21
|
+
objectType: "string",
|
|
22
|
+
type: "object",
|
|
23
|
+
value: "KFC"
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
test("Array", async () => {
|
|
27
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
28
|
+
const funcCallResult = await interpreter.interpret("[Restaurant.all()[1].name, Restaurant.current().name]");
|
|
29
|
+
expect(funcCallResult).toEqual({
|
|
30
|
+
type: "array",
|
|
31
|
+
value: [
|
|
32
|
+
{
|
|
33
|
+
objectType: "string",
|
|
34
|
+
type: "object",
|
|
35
|
+
value: "KFC"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
objectType: "string",
|
|
39
|
+
type: "object",
|
|
40
|
+
value: "McDonald's"
|
|
41
|
+
}
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
test("Array matching", async () => {
|
|
46
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
47
|
+
const funcCallResult = await interpreter.interpret("Restaurant.current().menu.matching(field: .name, value: \"hamburger\")[0].name");
|
|
48
|
+
expect(funcCallResult).toEqual({
|
|
49
|
+
objectType: "string",
|
|
50
|
+
type: "object",
|
|
51
|
+
value: "Hamburger"
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
test("Array matching rejects quoted field parameter with a helpful error", async () => {
|
|
55
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
56
|
+
await expect(interpreter.interpret("Restaurant.all().matching(field: \"name\", value: \"Taste\")")).rejects.toThrow('Invalid DSL: matching(field: ...) requires a dotted accessor such as .name, but received string.');
|
|
57
|
+
});
|
|
58
|
+
test("Array matching does not crash on string field vs numeric value", async () => {
|
|
59
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
60
|
+
const funcCallResult = await interpreter.interpret("Order.all().matching(field: .dateTime.dayOfWeek, value: DateTime.today().month)");
|
|
61
|
+
expect(funcCallResult).toEqual({
|
|
62
|
+
type: "array",
|
|
63
|
+
value: []
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
test("Array contains does not crash on string field vs numeric value", async () => {
|
|
67
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
68
|
+
const funcCallResult = await interpreter.interpret("Order.all().contains(field: .dateTime.dayOfWeek, value: DateTime.today().month)");
|
|
69
|
+
expect(funcCallResult).toEqual({
|
|
70
|
+
type: "array",
|
|
71
|
+
value: []
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
test("Array between does not crash when comparator is unavailable", async () => {
|
|
75
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
76
|
+
const funcCallResult = await interpreter.interpret("Order.all().between(field: .restaurant, from: 1, to: 2)");
|
|
77
|
+
expect(funcCallResult).toEqual({
|
|
78
|
+
type: "array",
|
|
79
|
+
value: []
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
test("Array between", async () => {
|
|
83
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
84
|
+
const funcCallResult = await interpreter.interpret("Order.all().between(field: .dateTime, from: DateTime.today().addDateOffset(day: -7), to: DateTime.today())[0].restaurant.name");
|
|
85
|
+
expect(funcCallResult).toEqual({
|
|
86
|
+
objectType: "string",
|
|
87
|
+
type: "object",
|
|
88
|
+
value: "McDonald's"
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
test("Array between one side", async () => {
|
|
92
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
93
|
+
const funcCallResult = await interpreter.interpret("Order.all().between(field: .dateTime, from: DateTime.today().addDateOffset(day: -7))[-1].restaurant.name");
|
|
94
|
+
expect(funcCallResult).toEqual({
|
|
95
|
+
objectType: "string",
|
|
96
|
+
type: "object",
|
|
97
|
+
value: "McDonald's"
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
test("Array between one side deep accessor", async () => {
|
|
101
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
102
|
+
const funcCallResult = await interpreter.interpret("Order.all().between(field: .dateTime.day, from: 2, to: 3)[-1].dateTime.day");
|
|
103
|
+
expect(funcCallResult).toEqual({
|
|
104
|
+
"objectType": "int",
|
|
105
|
+
"type": "object",
|
|
106
|
+
"value": 3
|
|
107
|
+
});
|
|
108
|
+
});
|
|
109
|
+
test("Array equals", async () => {
|
|
110
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
111
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all().equals(field: .priceGrade, value: 1)[0].name");
|
|
112
|
+
expect(funcCallResult).toEqual({
|
|
113
|
+
objectType: "string",
|
|
114
|
+
type: "object",
|
|
115
|
+
value: "KFC"
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
test("Array sort", async () => {
|
|
119
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
120
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all().sort(field: .priceGrade, ascending: false)[0].name");
|
|
121
|
+
expect(funcCallResult).toEqual({
|
|
122
|
+
objectType: "string",
|
|
123
|
+
type: "object",
|
|
124
|
+
value: "Taste"
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
test("Array in array", async () => {
|
|
128
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
129
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all().menu.matching(field:.name, value:\"Hamburger\")[0][0].name");
|
|
130
|
+
expect(funcCallResult).toEqual({
|
|
131
|
+
objectType: "string",
|
|
132
|
+
type: "object",
|
|
133
|
+
value: "Hamburger"
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
test("length", async () => {
|
|
137
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
138
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all()[0].menu.matching(field:.name, value:\"Hamburger\").length()");
|
|
139
|
+
expect(funcCallResult).toEqual({
|
|
140
|
+
"objectType": "int",
|
|
141
|
+
"type": "object",
|
|
142
|
+
"value": 1
|
|
143
|
+
});
|
|
144
|
+
});
|
|
145
|
+
test("find burger name", async () => {
|
|
146
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
147
|
+
const funcCallResult = await interpreter.interpret("Restaurant.current().menu.matching(field: .name, value: \"hamburger\")[0].name");
|
|
148
|
+
expect(funcCallResult).toEqual({
|
|
149
|
+
objectType: "string",
|
|
150
|
+
type: "object",
|
|
151
|
+
value: "Hamburger"
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
test("find burger price", async () => {
|
|
155
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
156
|
+
const funcCallResult = await interpreter.interpret("Restaurant.current().menu.matching(field: .name, value: \"hamburger\")[0].price");
|
|
157
|
+
expect(funcCallResult).toEqual({
|
|
158
|
+
objectType: "float",
|
|
159
|
+
type: "object",
|
|
160
|
+
value: 5
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
test("best restaurant", async () => {
|
|
164
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
165
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all().matching(field: .address, value: \"palo alto\").sort(field: .rating, ascending: false)[0]");
|
|
166
|
+
expect(await interpreter.describe(funcCallResult)).toEqual({
|
|
167
|
+
type: "object",
|
|
168
|
+
value: {
|
|
169
|
+
address: "123 Main St, Palo Alto, USA",
|
|
170
|
+
cuisine: "Chinese",
|
|
171
|
+
name: "Taste",
|
|
172
|
+
priceGrade: 3,
|
|
173
|
+
rating: 5
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
test("find cheap chinese restaurant", async () => {
|
|
178
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
179
|
+
const funcCallResult = await interpreter.interpret("Restaurant.all().matching(field: .cuisine, value: \"chinese\").sort(field: .priceGrade, ascending: true)[0]");
|
|
180
|
+
expect(await interpreter.describe(funcCallResult)).toEqual({
|
|
181
|
+
type: "object",
|
|
182
|
+
value: {
|
|
183
|
+
address: "123 Main St, Palo Alto, USA",
|
|
184
|
+
cuisine: "Chinese",
|
|
185
|
+
name: "Steam",
|
|
186
|
+
priceGrade: 2,
|
|
187
|
+
rating: 4
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
test("add hamburger to the order", async () => {
|
|
192
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
193
|
+
const funcCallResult = await interpreter.interpret("Order.current().addFoods(foods: [Restaurant.current().menu.matching(field: .name, value: \"hamburger\")[0]])");
|
|
194
|
+
expect(await interpreter.describe(funcCallResult)).toEqual({
|
|
195
|
+
type: "object",
|
|
196
|
+
value: "undefined"
|
|
197
|
+
});
|
|
198
|
+
});
|
|
199
|
+
test("add hamburger to the order (steps)", async () => {
|
|
200
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
201
|
+
const funcCallResult = await interpreter.interpretSteps("Restaurant.all().equals(field: .priceGrade, value: 1)[0].name");
|
|
202
|
+
const describeSteps = (await interpreter.describeSteps(funcCallResult[funcCallResult.length - 1].steps)).reverse();
|
|
203
|
+
expect((describeSteps[1])).toEqual({
|
|
204
|
+
type: "object",
|
|
205
|
+
value: {
|
|
206
|
+
address: "123 Main St, Palo Alto, USA",
|
|
207
|
+
cuisine: "Fast Food",
|
|
208
|
+
name: "KFC",
|
|
209
|
+
priceGrade: 1,
|
|
210
|
+
rating: 3
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
});
|
|
214
|
+
test("DateTime object comparison", async () => {
|
|
215
|
+
example_descriptor_1.Restaurant.all();
|
|
216
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
217
|
+
const funcCallResult = await interpreter.interpret("Order.all().between(field: .dateTime, from: DateTime(year: 2020, month: 2, day: 1, hour: 0, minute: 0), to: DateTime(year: 2020, month: 2, day: 1, hour: 23, minute: 59))[0].restaurant.name");
|
|
218
|
+
expect(funcCallResult).toEqual({
|
|
219
|
+
objectType: "string",
|
|
220
|
+
type: "object",
|
|
221
|
+
value: "McDonald's"
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
test("Order containing burger", async () => {
|
|
225
|
+
example_descriptor_1.Restaurant.all();
|
|
226
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
227
|
+
const funcCallResult = await interpreter.interpret("Order.all().contains(field: .foods, value: Restaurant.current().menu.matching(field: .name, value: \"hamburger\")[0])[0].restaurant.name");
|
|
228
|
+
expect(funcCallResult).toEqual({
|
|
229
|
+
objectType: "string",
|
|
230
|
+
type: "object",
|
|
231
|
+
value: "McDonald's"
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
test("Order array distribution field", async () => {
|
|
235
|
+
example_descriptor_1.Restaurant.all();
|
|
236
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
237
|
+
const funcCallResult = await interpreter.interpret("Order.all().dateTime[0].dayOfWeek");
|
|
238
|
+
expect(funcCallResult).toEqual({
|
|
239
|
+
"objectType": "string",
|
|
240
|
+
"type": "object",
|
|
241
|
+
"value": "Wednesday"
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
test("Order array distribution function", async () => {
|
|
245
|
+
example_descriptor_1.Restaurant.all();
|
|
246
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
247
|
+
const funcCallResult = await interpreter.interpret("Order.all().placeOrder()");
|
|
248
|
+
expect(funcCallResult["objectType"]).toEqual("void");
|
|
249
|
+
});
|
|
250
|
+
test("Multiple actions", async () => {
|
|
251
|
+
example_descriptor_1.Restaurant.all();
|
|
252
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
253
|
+
const funcCallResult = await interpreter.interpret("Order.all().placeOrder(); Order.all().dateTime[0].dayOfWeek");
|
|
254
|
+
expect(funcCallResult["objectType"]).toEqual("string");
|
|
255
|
+
});
|
|
256
|
+
test("Single actions with semicolon", async () => {
|
|
257
|
+
example_descriptor_1.Restaurant.all();
|
|
258
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors);
|
|
259
|
+
const funcCallResult = await interpreter.interpret("Order.all().dateTime[0].dayOfWeek;");
|
|
260
|
+
expect(funcCallResult["objectType"]).toEqual("string");
|
|
261
|
+
});
|
|
262
|
+
test("[dry run] Order containing burger", async () => {
|
|
263
|
+
example_descriptor_1.Restaurant.all();
|
|
264
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
265
|
+
const funcCallResult = await interpreter.interpret("Order.all().contains(field: .foods, value: Restaurant.current().menu.matching(field: .name, value: \"hamburger\")[0])[0].restaurant.name");
|
|
266
|
+
expect(funcCallResult).toEqual({
|
|
267
|
+
objectType: "string",
|
|
268
|
+
type: "object",
|
|
269
|
+
value: null
|
|
270
|
+
});
|
|
271
|
+
});
|
|
272
|
+
test("[dry run][error] Restaurant noise level", async () => {
|
|
273
|
+
example_descriptor_1.Restaurant.all();
|
|
274
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
275
|
+
try {
|
|
276
|
+
await interpreter.interpret("Restaurant.All().matching(field: .noiseLevel, value: \"quiet\")");
|
|
277
|
+
}
|
|
278
|
+
catch (e) {
|
|
279
|
+
expect(e.message).toEqual("Field Restaurant.noiseLevel is missing");
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
test("[dry run][error] Restaurant noise level 2", async () => {
|
|
283
|
+
example_descriptor_1.Restaurant.all();
|
|
284
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
285
|
+
try {
|
|
286
|
+
await interpreter.interpret("Restaurant.All()[0].noiseLevel");
|
|
287
|
+
}
|
|
288
|
+
catch (e) {
|
|
289
|
+
expect(e.message).toEqual("Field Restaurant.noiseLevel is missing");
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
test("[dry run][error] Restaurant notify when near", async () => {
|
|
293
|
+
example_descriptor_1.Restaurant.all();
|
|
294
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
295
|
+
try {
|
|
296
|
+
await interpreter.interpret("Order.current().notifyWhenNearLocation()");
|
|
297
|
+
}
|
|
298
|
+
catch (e) {
|
|
299
|
+
expect(e.message).toEqual("Function Order.notifyWhenNearLocation is missing");
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
test("[dry run][error] Login", async () => {
|
|
303
|
+
example_descriptor_1.Restaurant.all();
|
|
304
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
305
|
+
try {
|
|
306
|
+
await interpreter.interpret("User.login()");
|
|
307
|
+
}
|
|
308
|
+
catch (e) {
|
|
309
|
+
expect(e.message).toEqual("Class User is missing");
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
test("[dry run][error] String", async () => {
|
|
313
|
+
example_descriptor_1.Restaurant.all();
|
|
314
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
315
|
+
try {
|
|
316
|
+
await interpreter.interpret("Restaurant.All().matching(field: .location, value: \"near me\")");
|
|
317
|
+
}
|
|
318
|
+
catch (e) {
|
|
319
|
+
console.log(e);
|
|
320
|
+
expect(e.message).toEqual("Field Restaurant.location is missing");
|
|
321
|
+
}
|
|
322
|
+
});
|
|
323
|
+
test("GetObject", async () => {
|
|
324
|
+
example_descriptor_1.Restaurant.all();
|
|
325
|
+
const interpreter = new dsl_interpreter_1.DslInterpreter(example_descriptor_1.allDescriptors, true);
|
|
326
|
+
try {
|
|
327
|
+
await interpreter.interpret("Restaurant.GetObject(id:0)");
|
|
328
|
+
}
|
|
329
|
+
catch (e) {
|
|
330
|
+
console.log(e);
|
|
331
|
+
expect(e.message).toEqual("Function Restaurant.GetObject is missing");
|
|
332
|
+
}
|
|
333
|
+
});
|
|
334
|
+
//# sourceMappingURL=dsl-interpreter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dsl-interpreter.test.js","sourceRoot":"","sources":["../../../lib/dsl/__test__/dsl-interpreter.test.ts"],"names":[],"mappings":";;AAAA,wDAAoD;AACpD,0EAA8F;AAC9F,iDAA6C;AAE7C,IAAA,sBAAS,GAAE,CAAC;AAEZ,IAAI,CAAC,qBAAqB,EAAE,KAAK,IAAI,EAAE;IACrC,MAAM,WAAW,GAAG,IAAI,gCAAc,CAAC,mCAAc,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC,SAAS,CAChD,kGAAkG,CACnG,CAAC;IACF,MAAM,CAAC,kCAAa,CAAC,CAAC,OAAO,CAAC,yCAAyC,CAAC,CAAC;IACzE,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;QAC7B,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,UAAU,EAAE,KAAK,IAAI,EAAE;IAC1B,MAAM,WAAW,GAAG,IAAI,gCAAc,CAAC,mCAAc,CAAC,CAAC;IACvD,MAAM,cAAc,GAAG,MAAM,WAAW,CAAC,SAAS,CAAC,0BAA0B,CAAC,CAAC;IAC/E,MAAM,CAAC,cAAc,CAAC,CAAC,OAAO,CAAC;QAC7B,UAAU,EAAE,QAAQ;QACpB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,KAAK;KACb,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,OAAO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require("../parser.gen.js");
|
|
4
|
+
test("parse", () => {
|
|
5
|
+
const result = (0, parser_gen_js_1.parse)("Order.past_orders.between(field:.order_date,from:Date.today.add_date(day:-7).day_of_the_same_week(new_day_of_the_week:Day.Monday),to:Date.today.add_date(day:-7).day_of_the_same_week(new_day_of_the_week:Day.Sunday))[0].foods[0]", {})[0];
|
|
6
|
+
expect(result).toEqual({
|
|
7
|
+
type: "index",
|
|
8
|
+
parent: {
|
|
9
|
+
type: "access",
|
|
10
|
+
parent: {
|
|
11
|
+
type: "index",
|
|
12
|
+
parent: {
|
|
13
|
+
type: "access",
|
|
14
|
+
parent: { type: "access", parent: "Order", access: "past_orders" },
|
|
15
|
+
access: {
|
|
16
|
+
type: "function_call",
|
|
17
|
+
func_name: "between",
|
|
18
|
+
parameters: [
|
|
19
|
+
{
|
|
20
|
+
parameter: "field",
|
|
21
|
+
value: { type: "accessor", field: "order_date" },
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
parameter: "from",
|
|
25
|
+
value: {
|
|
26
|
+
type: "access",
|
|
27
|
+
parent: {
|
|
28
|
+
type: "access",
|
|
29
|
+
parent: { type: "access", parent: "Date", access: "today" },
|
|
30
|
+
access: {
|
|
31
|
+
type: "function_call",
|
|
32
|
+
func_name: "add_date",
|
|
33
|
+
parameters: [
|
|
34
|
+
{ parameter: "day", value: { type: "int", value: -7 } },
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
access: {
|
|
39
|
+
type: "function_call",
|
|
40
|
+
func_name: "day_of_the_same_week",
|
|
41
|
+
parameters: [
|
|
42
|
+
{
|
|
43
|
+
parameter: "new_day_of_the_week",
|
|
44
|
+
value: {
|
|
45
|
+
type: "access",
|
|
46
|
+
parent: "Day",
|
|
47
|
+
access: "Monday",
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
parameter: "to",
|
|
56
|
+
value: {
|
|
57
|
+
type: "access",
|
|
58
|
+
parent: {
|
|
59
|
+
type: "access",
|
|
60
|
+
parent: { type: "access", parent: "Date", access: "today" },
|
|
61
|
+
access: {
|
|
62
|
+
type: "function_call",
|
|
63
|
+
func_name: "add_date",
|
|
64
|
+
parameters: [
|
|
65
|
+
{ parameter: "day", value: { type: "int", value: -7 } },
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
access: {
|
|
70
|
+
type: "function_call",
|
|
71
|
+
func_name: "day_of_the_same_week",
|
|
72
|
+
parameters: [
|
|
73
|
+
{
|
|
74
|
+
parameter: "new_day_of_the_week",
|
|
75
|
+
value: {
|
|
76
|
+
type: "access",
|
|
77
|
+
parent: "Day",
|
|
78
|
+
access: "Sunday",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
],
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
index: 0,
|
|
89
|
+
},
|
|
90
|
+
access: "foods",
|
|
91
|
+
},
|
|
92
|
+
index: 0,
|
|
93
|
+
});
|
|
94
|
+
const result2 = (0, parser_gen_js_1.parse)('Restaurant.default.matching(field: .name, value: "Panda Express")[0].remove_favorite_restaurant()')[0];
|
|
95
|
+
expect(result2).toEqual({
|
|
96
|
+
type: "access",
|
|
97
|
+
parent: {
|
|
98
|
+
type: "index",
|
|
99
|
+
parent: {
|
|
100
|
+
type: "access",
|
|
101
|
+
parent: { type: "access", parent: "Restaurant", access: "default" },
|
|
102
|
+
access: {
|
|
103
|
+
type: "function_call",
|
|
104
|
+
func_name: "matching",
|
|
105
|
+
parameters: [
|
|
106
|
+
{ parameter: "field", value: { type: "accessor", field: "name" } },
|
|
107
|
+
{
|
|
108
|
+
parameter: "value",
|
|
109
|
+
value: { type: "string", value: "Panda Express" },
|
|
110
|
+
},
|
|
111
|
+
],
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
index: 0,
|
|
115
|
+
},
|
|
116
|
+
access: {
|
|
117
|
+
type: "function_call",
|
|
118
|
+
func_name: "remove_favorite_restaurant",
|
|
119
|
+
parameters: null,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
const result3 = (0, parser_gen_js_1.parse)('Current.order.add_to_order(foods: [Current.food.matching(field: .name, value: "hamburger")])')[0];
|
|
123
|
+
expect(result3).toEqual({
|
|
124
|
+
type: "access",
|
|
125
|
+
parent: { type: "access", parent: "Current", access: "order" },
|
|
126
|
+
access: {
|
|
127
|
+
type: "function_call",
|
|
128
|
+
func_name: "add_to_order",
|
|
129
|
+
parameters: [
|
|
130
|
+
{
|
|
131
|
+
parameter: "foods",
|
|
132
|
+
value: {
|
|
133
|
+
type: "array",
|
|
134
|
+
value: [
|
|
135
|
+
{
|
|
136
|
+
type: "access",
|
|
137
|
+
parent: { type: "access", parent: "Current", access: "food" },
|
|
138
|
+
access: {
|
|
139
|
+
type: "function_call",
|
|
140
|
+
func_name: "matching",
|
|
141
|
+
parameters: [
|
|
142
|
+
{
|
|
143
|
+
parameter: "field",
|
|
144
|
+
value: { type: "accessor", field: "name" },
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
parameter: "value",
|
|
148
|
+
value: { type: "string", value: "hamburger" },
|
|
149
|
+
},
|
|
150
|
+
],
|
|
151
|
+
},
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
const result4 = (0, parser_gen_js_1.parse)('Order.current.add_to_order(foods: [Restaurant.all.matching(field: .name, value: "mcDonalds")[0].get_menu().matching(field: .name, value: "coke")[0]])')[0];
|
|
160
|
+
expect(result4).toEqual({
|
|
161
|
+
type: "access",
|
|
162
|
+
parent: { type: "access", parent: "Order", access: "current" },
|
|
163
|
+
access: {
|
|
164
|
+
type: "function_call",
|
|
165
|
+
func_name: "add_to_order",
|
|
166
|
+
parameters: [
|
|
167
|
+
{
|
|
168
|
+
parameter: "foods",
|
|
169
|
+
value: {
|
|
170
|
+
type: "array",
|
|
171
|
+
value: [
|
|
172
|
+
{
|
|
173
|
+
type: "index",
|
|
174
|
+
parent: {
|
|
175
|
+
type: "access",
|
|
176
|
+
parent: {
|
|
177
|
+
type: "access",
|
|
178
|
+
parent: {
|
|
179
|
+
type: "index",
|
|
180
|
+
parent: {
|
|
181
|
+
type: "access",
|
|
182
|
+
parent: {
|
|
183
|
+
type: "access",
|
|
184
|
+
parent: "Restaurant",
|
|
185
|
+
access: "all",
|
|
186
|
+
},
|
|
187
|
+
access: {
|
|
188
|
+
type: "function_call",
|
|
189
|
+
func_name: "matching",
|
|
190
|
+
parameters: [
|
|
191
|
+
{
|
|
192
|
+
parameter: "field",
|
|
193
|
+
value: { type: "accessor", field: "name" },
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
parameter: "value",
|
|
197
|
+
value: { type: "string", value: "mcDonalds" },
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
index: 0,
|
|
203
|
+
},
|
|
204
|
+
access: {
|
|
205
|
+
type: "function_call",
|
|
206
|
+
func_name: "get_menu",
|
|
207
|
+
parameters: null,
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
access: {
|
|
211
|
+
type: "function_call",
|
|
212
|
+
func_name: "matching",
|
|
213
|
+
parameters: [
|
|
214
|
+
{
|
|
215
|
+
parameter: "field",
|
|
216
|
+
value: { type: "accessor", field: "name" },
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
parameter: "value",
|
|
220
|
+
value: { type: "string", value: "coke" },
|
|
221
|
+
},
|
|
222
|
+
],
|
|
223
|
+
},
|
|
224
|
+
},
|
|
225
|
+
index: 0,
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
],
|
|
231
|
+
},
|
|
232
|
+
});
|
|
233
|
+
const result5 = (0, parser_gen_js_1.parse)("Order.all().sort(field: .date, ascending: true)[0].restaurant.name")[0];
|
|
234
|
+
expect(result5).toEqual({
|
|
235
|
+
access: "name",
|
|
236
|
+
parent: {
|
|
237
|
+
access: "restaurant",
|
|
238
|
+
parent: {
|
|
239
|
+
index: 0,
|
|
240
|
+
parent: {
|
|
241
|
+
access: {
|
|
242
|
+
func_name: "sort",
|
|
243
|
+
parameters: [
|
|
244
|
+
{
|
|
245
|
+
parameter: "field",
|
|
246
|
+
value: {
|
|
247
|
+
field: "date",
|
|
248
|
+
type: "accessor",
|
|
249
|
+
},
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
parameter: "ascending",
|
|
253
|
+
value: {
|
|
254
|
+
type: "boolean",
|
|
255
|
+
value: true,
|
|
256
|
+
},
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
type: "function_call",
|
|
260
|
+
},
|
|
261
|
+
parent: {
|
|
262
|
+
access: {
|
|
263
|
+
func_name: "all",
|
|
264
|
+
parameters: null,
|
|
265
|
+
type: "function_call",
|
|
266
|
+
},
|
|
267
|
+
parent: "Order",
|
|
268
|
+
type: "access",
|
|
269
|
+
},
|
|
270
|
+
type: "access",
|
|
271
|
+
},
|
|
272
|
+
type: "index",
|
|
273
|
+
},
|
|
274
|
+
type: "access",
|
|
275
|
+
},
|
|
276
|
+
type: "access",
|
|
277
|
+
});
|
|
278
|
+
});
|
|
279
|
+
test("parser error test", () => {
|
|
280
|
+
const result = (0, parser_gen_js_1.parse)("Booking.Current().payment.setProperty(method: \"MasterCard\"); Booking.Current().confirm();");
|
|
281
|
+
console.log(result);
|
|
282
|
+
});
|
|
283
|
+
//# sourceMappingURL=parser.gen.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.gen.test.js","sourceRoot":"","sources":["../../../lib/dsl/__test__/parser.gen.test.ts"],"names":[],"mappings":";;AAAA,oDAAyC;AAEz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