@morphql/language-definitions 0.1.7 → 0.1.8
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/index.cjs +20 -0
- package/dist/index.js +20 -0
- package/dist/morphql-lang.json +30 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -215,6 +215,16 @@ var KEYWORDS = [
|
|
|
215
215
|
],
|
|
216
216
|
example: "set total = price * quantity\nmodify total = total * 1.10"
|
|
217
217
|
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: "return",
|
|
221
|
+
category: "action",
|
|
222
|
+
doc: {
|
|
223
|
+
signature: "return <expression>",
|
|
224
|
+
description: "Returns a value from the transformation, bypassing the default serialization. Reads from target context by default.",
|
|
225
|
+
parameters: [{ name: "expression", description: "The value to return" }],
|
|
226
|
+
example: "set computed = price * 1.1\nreturn computed"
|
|
227
|
+
}
|
|
218
228
|
}
|
|
219
229
|
];
|
|
220
230
|
var getKeywordsByCategory = (category) => KEYWORDS.filter((k) => k.category === category);
|
|
@@ -371,6 +381,16 @@ var FUNCTIONS = [
|
|
|
371
381
|
returns: "array",
|
|
372
382
|
example: "aslist(items) // Always returns an array"
|
|
373
383
|
}
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
name: "spreadsheet",
|
|
387
|
+
doc: {
|
|
388
|
+
signature: "spreadsheet(data)",
|
|
389
|
+
description: "Converts spreadsheet-style data (array of arrays) into an array of objects with named properties. First row is treated as headers.",
|
|
390
|
+
parameters: [{ name: "data", description: "Array of arrays (rows)" }],
|
|
391
|
+
returns: "array of objects",
|
|
392
|
+
example: 'spreadsheet(csvData) // Converts [["name","age"],["John",30]] to [{name:"John",age:30}]'
|
|
393
|
+
}
|
|
374
394
|
}
|
|
375
395
|
];
|
|
376
396
|
var getFunctionNames = () => FUNCTIONS.map((f) => f.name);
|
package/dist/index.js
CHANGED
|
@@ -173,6 +173,16 @@ var KEYWORDS = [
|
|
|
173
173
|
],
|
|
174
174
|
example: "set total = price * quantity\nmodify total = total * 1.10"
|
|
175
175
|
}
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: "return",
|
|
179
|
+
category: "action",
|
|
180
|
+
doc: {
|
|
181
|
+
signature: "return <expression>",
|
|
182
|
+
description: "Returns a value from the transformation, bypassing the default serialization. Reads from target context by default.",
|
|
183
|
+
parameters: [{ name: "expression", description: "The value to return" }],
|
|
184
|
+
example: "set computed = price * 1.1\nreturn computed"
|
|
185
|
+
}
|
|
176
186
|
}
|
|
177
187
|
];
|
|
178
188
|
var getKeywordsByCategory = (category) => KEYWORDS.filter((k) => k.category === category);
|
|
@@ -329,6 +339,16 @@ var FUNCTIONS = [
|
|
|
329
339
|
returns: "array",
|
|
330
340
|
example: "aslist(items) // Always returns an array"
|
|
331
341
|
}
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
name: "spreadsheet",
|
|
345
|
+
doc: {
|
|
346
|
+
signature: "spreadsheet(data)",
|
|
347
|
+
description: "Converts spreadsheet-style data (array of arrays) into an array of objects with named properties. First row is treated as headers.",
|
|
348
|
+
parameters: [{ name: "data", description: "Array of arrays (rows)" }],
|
|
349
|
+
returns: "array of objects",
|
|
350
|
+
example: 'spreadsheet(csvData) // Converts [["name","age"],["John",30]] to [{name:"John",age:30}]'
|
|
351
|
+
}
|
|
332
352
|
}
|
|
333
353
|
];
|
|
334
354
|
var getFunctionNames = () => FUNCTIONS.map((f) => f.name);
|
package/dist/morphql-lang.json
CHANGED
|
@@ -202,6 +202,21 @@
|
|
|
202
202
|
],
|
|
203
203
|
"example": "set total = price * quantity\nmodify total = total * 1.10"
|
|
204
204
|
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"name": "return",
|
|
208
|
+
"category": "action",
|
|
209
|
+
"doc": {
|
|
210
|
+
"signature": "return <expression>",
|
|
211
|
+
"description": "Returns a value from the transformation, bypassing the default serialization. Reads from target context by default.",
|
|
212
|
+
"parameters": [
|
|
213
|
+
{
|
|
214
|
+
"name": "expression",
|
|
215
|
+
"description": "The value to return"
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
"example": "set computed = price * 1.1\nreturn computed"
|
|
219
|
+
}
|
|
205
220
|
}
|
|
206
221
|
],
|
|
207
222
|
"functions": [
|
|
@@ -412,6 +427,21 @@
|
|
|
412
427
|
"returns": "array",
|
|
413
428
|
"example": "aslist(items) // Always returns an array"
|
|
414
429
|
}
|
|
430
|
+
},
|
|
431
|
+
{
|
|
432
|
+
"name": "spreadsheet",
|
|
433
|
+
"doc": {
|
|
434
|
+
"signature": "spreadsheet(data)",
|
|
435
|
+
"description": "Converts spreadsheet-style data (array of arrays) into an array of objects with named properties. First row is treated as headers.",
|
|
436
|
+
"parameters": [
|
|
437
|
+
{
|
|
438
|
+
"name": "data",
|
|
439
|
+
"description": "Array of arrays (rows)"
|
|
440
|
+
}
|
|
441
|
+
],
|
|
442
|
+
"returns": "array of objects",
|
|
443
|
+
"example": "spreadsheet(csvData) // Converts [[\"name\",\"age\"],[\"John\",30]] to [{name:\"John\",age:30}]"
|
|
444
|
+
}
|
|
415
445
|
}
|
|
416
446
|
],
|
|
417
447
|
"operators": [
|