UNPKG

awv3

Version:
1,841 lines (1,840 loc) 1.19 MB
{ "type": "Program", "start": 0, "end": 10452, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 256, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 48, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 48 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "local": { "type": "Identifier", "start": 7, "end": 17, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 17 } }, "name": "Statements" } } ], "importKind": "value", "source": { "type": "Literal", "start": 23, "end": 47, "loc": { "start": { "line": 1, "column": 23 }, "end": { "line": 1, "column": 47 } }, "value": "../sketcher/statements", "rawValue": "../sketcher/statements", "raw": "'../sketcher/statements'" } }, { "type": "ImportDeclaration", "start": 50, "end": 115, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 65 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 58, "end": 72, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 22 } }, "imported": { "type": "Identifier", "start": 58, "end": 72, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 22 } }, "name": "ClassCadObject" }, "local": { "type": "Identifier", "start": 58, "end": 72, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 22 } }, "name": "ClassCadObject" } }, { "type": "ImportSpecifier", "start": 74, "end": 84, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 34 } }, "imported": { "type": "Identifier", "start": 74, "end": 84, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 34 } }, "name": "RootObject" }, "local": { "type": "Identifier", "start": 74, "end": 84, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 34 } }, "name": "RootObject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 91, "end": 114, "loc": { "start": { "line": 2, "column": 41 }, "end": { "line": 2, "column": 64 } }, "value": "../sketcher/ccobjects", "rawValue": "../sketcher/ccobjects", "raw": "'../sketcher/ccobjects'" } }, { "type": "ImportDeclaration", "start": 117, "end": 143, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 124, "end": 129, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 12 } }, "local": { "type": "Identifier", "start": 124, "end": 129, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 135, "end": 142, "loc": { "start": { "line": 3, "column": 18 }, "end": { "line": 3, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ImportDeclaration", "start": 145, "end": 184, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 152, "end": 159, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 14 } }, "local": { "type": "Identifier", "start": 152, "end": 159, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 14 } }, "name": "Object3" } } ], "importKind": "value", "source": { "type": "Literal", "start": 165, "end": 183, "loc": { "start": { "line": 4, "column": 20 }, "end": { "line": 4, "column": 38 } }, "value": "../three/object3", "rawValue": "../three/object3", "raw": "'../three/object3'" } }, { "type": "ImportDeclaration", "start": 186, "end": 233, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 47 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 194, "end": 197, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 11 } }, "imported": { "type": "Identifier", "start": 194, "end": 197, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 11 } }, "name": "url" }, "local": { "type": "Identifier", "start": 194, "end": 197, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 11 } }, "name": "url" } }, { "type": "ImportSpecifier", "start": 199, "end": 208, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 22 } }, "imported": { "type": "Identifier", "start": 199, "end": 208, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 22 } }, "name": "Timestamp" }, "local": { "type": "Identifier", "start": 199, "end": 208, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 22 } }, "name": "Timestamp" } } ], "importKind": "value", "source": { "type": "Literal", "start": 215, "end": 232, "loc": { "start": { "line": 5, "column": 29 }, "end": { "line": 5, "column": 46 } }, "value": "../core/helpers", "rawValue": "../core/helpers", "raw": "'../core/helpers'" }, "trailingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 235, "end": 280, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "range": [ 235, 280 ] } ] }, { "type": "ExportNamedDeclaration", "start": 284, "end": 332, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 48 } }, "declaration": { "type": "VariableDeclaration", "start": 291, "end": 332, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 48 } }, "declarations": [ { "type": "VariableDeclarator", "start": 297, "end": 331, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 47 } }, "id": { "type": "Identifier", "start": 297, "end": 305, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 21 } }, "name": "logLevel", "leadingComments": null }, "init": { "type": "CallExpression", "start": 308, "end": 331, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 47 } }, "callee": { "type": "Identifier", "start": 308, "end": 314, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 30 } }, "name": "Number" }, "arguments": [ { "type": "CallExpression", "start": 315, "end": 330, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 46 } }, "callee": { "type": "Identifier", "start": 315, "end": 318, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 34 } }, "name": "url" }, "arguments": [ { "type": "Literal", "start": 319, "end": 329, "loc": { "start": { "line": 8, "column": 35 }, "end": { "line": 8, "column": 45 } }, "value": "logLevel", "rawValue": "logLevel", "raw": "'logLevel'" } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 235, "end": 280, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "range": [ 235, 280 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " execute one ClassCad command and return its result in a Promise", "start": 336, "end": 402, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 66 } }, "range": [ 336, 402 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 235, "end": 280, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "range": [ 235, 280 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " execute one ClassCad command and return its result in a Promise", "start": 336, "end": 402, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 66 } }, "range": [ 336, 402 ] } ] }, { "type": "Identifier", "start": 404, "end": 736, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 17, "column": 1 } }, "id": { "type": "Identifier", "start": 413, "end": 420, "loc": { "start": { "line": 11, "column": 9 }, "end": { "line": 11, "column": 16 } }, "name": "execute", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 421, "end": 427, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 23 } }, "name": "socket" }, { "type": "Identifier", "start": 429, "end": 432, "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 28 } }, "name": "cmd" }, { "type": "Identifier", "start": 434, "end": 441, "loc": { "start": { "line": 11, "column": 30 }, "end": { "line": 11, "column": 37 } }, "name": "factory" }, { "type": "Identifier", "start": 443, "end": 453, "loc": { "start": { "line": 11, "column": 39 }, "end": { "line": 11, "column": 49 } }, "name": "attributes" } ], "body": { "type": "BlockStatement", "start": 455, "end": 736, "loc": { "start": { "line": 11, "column": 51 }, "end": { "line": 17, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 462, "end": 517, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 13, "column": 24 } }, "test": { "type": "BinaryExpression", "start": 466, "end": 490, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 32 } }, "left": { "type": "Identifier", "start": 466, "end": 476, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 18 } }, "name": "attributes" }, "operator": "===", "right": { "type": "Identifier", "start": 481, "end": 490, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 32 } }, "name": "undefined" } }, "consequent": { "type": "ExpressionStatement", "start": 501, "end": 517, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 501, "end": 516, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 23 } }, "operator": "=", "left": { "type": "Identifier", "start": 501, "end": 511, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 18 } }, "name": "attributes" }, "right": { "type": "ObjectExpression", "start": 514, "end": 516, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 23 } }, "properties": [] } } }, "alternate": null }, { "type": "IfStatement", "start": 523, "end": 624, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 15, "column": 48 } }, "test": { "type": "BinaryExpression", "start": 527, "end": 573, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 54 } }, "left": { "type": "MemberExpression", "start": 527, "end": 559, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 40 } }, "object": { "type": "Identifier", "start": 527, "end": 537, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 18 } }, "name": "attributes" }, "property": { "type": "Identifier", "start": 538, "end": 559, "loc": { "start": { "line": 14, "column": 19 }, "end": { "line": 14, "column": 40 } }, "name": "ignoreNumberOfResults" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 564, "end": 573, "loc": { "start": { "line": 14, "column": 45 }, "end": { "line": 14, "column": 54 } }, "name": "undefined" } }, "consequent": { "type": "ExpressionStatement", "start": 584, "end": 624, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 48 } }, "expression": { "type": "AssignmentExpression", "start": 584, "end": 623, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 47 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 584, "end": 616, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 40 } }, "object": { "type": "Identifier", "start": 584, "end": 594, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 18 } }, "name": "attributes" }, "property": { "type": "Identifier", "start": 595, "end": 616, "loc": { "start": { "line": 15, "column": 19 }, "end": { "line": 15, "column": 40 } }, "name": "ignoreNumberOfResults" }, "computed": false }, "right": { "type": "Literal", "start": 619, "end": 623, "loc": { "start": { "line": 15, "column": 43 }, "end": { "line": 15, "column": 47 } }, "value": true, "rawValue": true, "raw": "true" } } }, "alternate": null }, { "type": "ReturnStatement", "start": 630, "end": 733, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 107 } }, "argument": { "type": "CallExpression", "start": 637, "end": 732, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 106 } }, "callee": { "type": "MemberExpression", "start": 637, "end": 721, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 95 } }, "object": { "type": "CallExpression", "start": 637, "end": 716, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 90 } }, "callee": { "type": "Identifier", "start": 637, "end": 652, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 26 } }, "name": "executePrepared" }, "arguments": [ { "type": "Identifier", "start": 653, "end": 659, "loc": { "start": { "line": 16, "column": 27 }, "end": { "line": 16, "column": 33 } }, "name": "socket" }, { "type": "ArrayExpression", "start": 661, "end": 694, "loc": { "start": { "line": 16, "column": 35 }, "end": { "line": 16, "column": 68 } }, "elements": [ { "type": "ObjectExpression", "start": 662, "end": 693, "loc": { "start": { "line": 16, "column": 36 }, "end": { "line": 16, "column": 67 } }, "properties": [ { "type": "Property", "start": 663, "end": 681, "loc": { "start": { "line": 16, "column": 37 }, "end": { "line": 16, "column": 55 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 663, "end": 670, "loc": { "start": { "line": 16, "column": 37 }, "end": { "line": 16, "column": 44 } }, "name": "command" }, "value": { "type": "Literal", "start": 672, "end": 681, "loc": { "start": { "line": 16, "column": 46 }, "end": { "line": 16, "column": 55 } }, "value": "Execute", "rawValue": "Execute", "raw": "'Execute'" }, "kind": "init" }, { "type": "Property", "start": 683, "end": 692, "loc": { "start": { "line": 16, "column": 57 }, "end": { "line": 16, "column": 66 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 683, "end": 687, "loc": { "start": { "line": 16, "column": 57 }, "end": { "line": 16, "column": 61 } }, "name": "task" }, "value": { "type": "Identifier", "start": 689, "end": 692, "loc": { "start": { "line": 16, "column": 63 }, "end": { "line": 16, "column": 66 } }, "name": "cmd" }, "kind": "init" } ] } ] }, { "type": "Identifier", "start": 696, "end": 703, "loc": { "start": { "line": 16, "column": 70 }, "end": { "line": 16, "column": 77 } }, "name": "factory" }, { "type": "Identifier", "start": 705, "end": 715, "loc": { "start": { "line": 16, "column": 79 }, "end": { "line": 16, "column": 89 } }, "name": "attributes" } ] }, "property": { "type": "Identifier", "start": 717, "end": 721, "loc": { "start": { "line": 16, "column": 91 }, "end": { "line": 16, "column": 95 } }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 722, "end": 731, "loc": { "start": { "line": 16, "column": 96 }, "end": { "line": 16, "column": 105 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 722, "end": 723, "loc": { "start": { "line": 16, "column": 96 }, "end": { "line": 16, "column": 97 } }, "name": "x" } ], "body": { "type": "MemberExpression", "start": 727, "end": 731, "loc": { "start": { "line": 16, "column": 101 }, "end": { "line": 16, "column": 105 } }, "object": { "type": "Identifier", "start": 727, "end": 728, "loc": { "start": { "line": 16, "column": 101 }, "end": { "line": 16, "column": 102 } }, "name": "x" }, "property": { "type": "Literal", "start": 729, "end": 730, "loc": { "start": { "line": 16, "column": 103 }, "end": { "line": 16, "column": 104 } }, "value": 0, "rawValue": 0, "raw": "0" }, "computed": true } } ] } } ] }, "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "Identifier", "start": 740, "end": 914, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 1 } }, "id": { "type": "Identifier", "start": 749, "end": 762, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 22 } }, "name": "executeModels" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 763, "end": 769, "loc": { "start": { "line": 19, "column": 23 }, "end": { "line": 19, "column": 29 } }, "name": "socket" }, { "type": "Identifier", "start": 771, "end": 774, "loc": { "start": { "line": 19, "column": 31 }, "end": { "line": 19, "column": 34 } }, "name": "cmd" } ], "body": { "type": "BlockStatement", "start": 776, "end": 914, "loc": { "start": { "line": 19, "column": 36 }, "end": { "line": 21, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 783, "end": 911, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 132 } }, "argument": { "type": "CallExpression", "start": 790, "end": 910, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 131 } }, "callee": { "type": "MemberExpression", "start": 790, "end": 895, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 116 } }, "object": { "type": "CallExpression", "start": 790, "end": 890, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 111 } }, "callee": { "type": "Identifier", "start": 790, "end": 805, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 26 } }, "name": "executePrepared" }, "arguments": [ { "type": "Identifier", "start": 806, "end": 812, "loc": { "start": { "line": 20, "column": 27 }, "end": { "line": 20, "column": 33 } }, "name": "socket" }, { "type": "ArrayExpression", "start": 814, "end": 847, "loc": { "start": { "line": 20, "column": 35 }, "end": { "line": 20, "column": 68 } }, "elements": [ { "type": "ObjectExpression", "start": 815, "end": 846, "loc": { "start": { "line": 20, "column": 36 }, "end": { "line": 20, "column": 67 } }, "properties": [ { "type": "Property", "start": 816, "end": 834, "loc": { "start": { "line": 20, "column": 37 }, "end": { "line": 20, "column": 55 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 816, "end": 823, "loc": { "start": { "line": 20, "column": 37 }, "end": { "line": 20, "column": 44 } }, "name": "command" }, "value": { "type": "Literal", "start": 825, "end": 834, "loc": { "start": { "line": 20, "column": 46 }, "end": { "line": 20, "column": 55 } }, "value": "Execute", "rawValue": "Execute", "raw": "'Execute'" }, "kind": "init" }, { "type": "Property", "start": 836, "end": 845, "loc": { "start": { "line": 20, "column": 57 }, "end": { "line": 20, "column": 66 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 836, "end": 840, "loc": { "start": { "line": 20, "column": 57 }, "end": { "line": 20, "column": 61 } }, "name": "task" }, "value": { "type": "Identifier", "start": 842,