UNPKG

awv3

Version:
1,841 lines (1,840 loc) 1.19 MB
{ "type": "Program", "start": 0, "end": 10186, "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": 49, "end": 114, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 65 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 57, "end": 71, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 22 } }, "imported": { "type": "Identifier", "start": 57, "end": 71, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 22 } }, "name": "ClassCadObject" }, "local": { "type": "Identifier", "start": 57, "end": 71, "loc": { "start": { "line": 2, "column": 8 }, "end": { "line": 2, "column": 22 } }, "name": "ClassCadObject" } }, { "type": "ImportSpecifier", "start": 73, "end": 83, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 34 } }, "imported": { "type": "Identifier", "start": 73, "end": 83, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 34 } }, "name": "RootObject" }, "local": { "type": "Identifier", "start": 73, "end": 83, "loc": { "start": { "line": 2, "column": 24 }, "end": { "line": 2, "column": 34 } }, "name": "RootObject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 90, "end": 113, "loc": { "start": { "line": 2, "column": 41 }, "end": { "line": 2, "column": 64 } }, "value": "../sketcher/ccobjects", "rawValue": "../sketcher/ccobjects", "raw": "'../sketcher/ccobjects'" } }, { "type": "ImportDeclaration", "start": 115, "end": 141, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 122, "end": 127, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 12 } }, "local": { "type": "Identifier", "start": 122, "end": 127, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 133, "end": 140, "loc": { "start": { "line": 3, "column": 18 }, "end": { "line": 3, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ImportDeclaration", "start": 142, "end": 181, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 39 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 149, "end": 156, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 14 } }, "local": { "type": "Identifier", "start": 149, "end": 156, "loc": { "start": { "line": 4, "column": 7 }, "end": { "line": 4, "column": 14 } }, "name": "Object3" } } ], "importKind": "value", "source": { "type": "Literal", "start": 162, "end": 180, "loc": { "start": { "line": 4, "column": 20 }, "end": { "line": 4, "column": 38 } }, "value": "../three/object3", "rawValue": "../three/object3", "raw": "'../three/object3'" } }, { "type": "ImportDeclaration", "start": 182, "end": 229, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 47 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 190, "end": 193, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 11 } }, "imported": { "type": "Identifier", "start": 190, "end": 193, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 11 } }, "name": "url" }, "local": { "type": "Identifier", "start": 190, "end": 193, "loc": { "start": { "line": 5, "column": 8 }, "end": { "line": 5, "column": 11 } }, "name": "url" } }, { "type": "ImportSpecifier", "start": 195, "end": 204, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 22 } }, "imported": { "type": "Identifier", "start": 195, "end": 204, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 22 } }, "name": "Timestamp" }, "local": { "type": "Identifier", "start": 195, "end": 204, "loc": { "start": { "line": 5, "column": 13 }, "end": { "line": 5, "column": 22 } }, "name": "Timestamp" } } ], "importKind": "value", "source": { "type": "Literal", "start": 211, "end": 228, "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": 230, "end": 275, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "range": [ 230, 275 ] } ] }, { "type": "ExportNamedDeclaration", "start": 277, "end": 325, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 48 } }, "declaration": { "type": "VariableDeclaration", "start": 284, "end": 325, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 48 } }, "declarations": [ { "type": "VariableDeclarator", "start": 290, "end": 324, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 47 } }, "id": { "type": "Identifier", "start": 290, "end": 298, "loc": { "start": { "line": 8, "column": 13 }, "end": { "line": 8, "column": 21 } }, "name": "logLevel", "leadingComments": null }, "init": { "type": "CallExpression", "start": 301, "end": 324, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 47 } }, "callee": { "type": "Identifier", "start": 301, "end": 307, "loc": { "start": { "line": 8, "column": 24 }, "end": { "line": 8, "column": 30 } }, "name": "Number" }, "arguments": [ { "type": "CallExpression", "start": 308, "end": 323, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 46 } }, "callee": { "type": "Identifier", "start": 308, "end": 311, "loc": { "start": { "line": 8, "column": 31 }, "end": { "line": 8, "column": 34 } }, "name": "url" }, "arguments": [ { "type": "Literal", "start": 312, "end": 322, "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": 230, "end": 275, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "range": [ 230, 275 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " execute one ClassCad command and return its result in a Promise", "start": 327, "end": 393, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 66 } }, "range": [ 327, 393 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 230, "end": 275, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 45 } }, "range": [ 230, 275 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " execute one ClassCad command and return its result in a Promise", "start": 327, "end": 393, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 10, "column": 66 } }, "range": [ 327, 393 ] } ] }, { "type": "Identifier", "start": 394, "end": 720, "loc": { "start": { "line": 11, "column": 0 }, "end": { "line": 17, "column": 1 } }, "id": { "type": "Identifier", "start": 403, "end": 410, "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": 411, "end": 417, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 23 } }, "name": "socket" }, { "type": "Identifier", "start": 419, "end": 422, "loc": { "start": { "line": 11, "column": 25 }, "end": { "line": 11, "column": 28 } }, "name": "cmd" }, { "type": "Identifier", "start": 424, "end": 431, "loc": { "start": { "line": 11, "column": 30 }, "end": { "line": 11, "column": 37 } }, "name": "factory" }, { "type": "Identifier", "start": 433, "end": 443, "loc": { "start": { "line": 11, "column": 39 }, "end": { "line": 11, "column": 49 } }, "name": "attributes" } ], "body": { "type": "BlockStatement", "start": 445, "end": 720, "loc": { "start": { "line": 11, "column": 51 }, "end": { "line": 17, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 451, "end": 505, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 13, "column": 24 } }, "test": { "type": "BinaryExpression", "start": 455, "end": 479, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 32 } }, "left": { "type": "Identifier", "start": 455, "end": 465, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 18 } }, "name": "attributes" }, "operator": "===", "right": { "type": "Identifier", "start": 470, "end": 479, "loc": { "start": { "line": 12, "column": 23 }, "end": { "line": 12, "column": 32 } }, "name": "undefined" } }, "consequent": { "type": "ExpressionStatement", "start": 489, "end": 505, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 489, "end": 504, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 23 } }, "operator": "=", "left": { "type": "Identifier", "start": 489, "end": 499, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 18 } }, "name": "attributes" }, "right": { "type": "ObjectExpression", "start": 502, "end": 504, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 23 } }, "properties": [] } } }, "alternate": null }, { "type": "IfStatement", "start": 510, "end": 610, "loc": { "start": { "line": 14, "column": 4 }, "end": { "line": 15, "column": 48 } }, "test": { "type": "BinaryExpression", "start": 514, "end": 560, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 54 } }, "left": { "type": "MemberExpression", "start": 514, "end": 546, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 40 } }, "object": { "type": "Identifier", "start": 514, "end": 524, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 18 } }, "name": "attributes" }, "property": { "type": "Identifier", "start": 525, "end": 546, "loc": { "start": { "line": 14, "column": 19 }, "end": { "line": 14, "column": 40 } }, "name": "ignoreNumberOfResults" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 551, "end": 560, "loc": { "start": { "line": 14, "column": 45 }, "end": { "line": 14, "column": 54 } }, "name": "undefined" } }, "consequent": { "type": "ExpressionStatement", "start": 570, "end": 610, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 48 } }, "expression": { "type": "AssignmentExpression", "start": 570, "end": 609, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 47 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 570, "end": 602, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 40 } }, "object": { "type": "Identifier", "start": 570, "end": 580, "loc": { "start": { "line": 15, "column": 8 }, "end": { "line": 15, "column": 18 } }, "name": "attributes" }, "property": { "type": "Identifier", "start": 581, "end": 602, "loc": { "start": { "line": 15, "column": 19 }, "end": { "line": 15, "column": 40 } }, "name": "ignoreNumberOfResults" }, "computed": false }, "right": { "type": "Literal", "start": 605, "end": 609, "loc": { "start": { "line": 15, "column": 43 }, "end": { "line": 15, "column": 47 } }, "value": true, "rawValue": true, "raw": "true" } } }, "alternate": null }, { "type": "ReturnStatement", "start": 615, "end": 718, "loc": { "start": { "line": 16, "column": 4 }, "end": { "line": 16, "column": 107 } }, "argument": { "type": "CallExpression", "start": 622, "end": 717, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 106 } }, "callee": { "type": "MemberExpression", "start": 622, "end": 706, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 95 } }, "object": { "type": "CallExpression", "start": 622, "end": 701, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 90 } }, "callee": { "type": "Identifier", "start": 622, "end": 637, "loc": { "start": { "line": 16, "column": 11 }, "end": { "line": 16, "column": 26 } }, "name": "executePrepared" }, "arguments": [ { "type": "Identifier", "start": 638, "end": 644, "loc": { "start": { "line": 16, "column": 27 }, "end": { "line": 16, "column": 33 } }, "name": "socket" }, { "type": "ArrayExpression", "start": 646, "end": 679, "loc": { "start": { "line": 16, "column": 35 }, "end": { "line": 16, "column": 68 } }, "elements": [ { "type": "ObjectExpression", "start": 647, "end": 678, "loc": { "start": { "line": 16, "column": 36 }, "end": { "line": 16, "column": 67 } }, "properties": [ { "type": "Property", "start": 648, "end": 666, "loc": { "start": { "line": 16, "column": 37 }, "end": { "line": 16, "column": 55 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 648, "end": 655, "loc": { "start": { "line": 16, "column": 37 }, "end": { "line": 16, "column": 44 } }, "name": "command" }, "value": { "type": "Literal", "start": 657, "end": 666, "loc": { "start": { "line": 16, "column": 46 }, "end": { "line": 16, "column": 55 } }, "value": "Execute", "rawValue": "Execute", "raw": "'Execute'" }, "kind": "init" }, { "type": "Property", "start": 668, "end": 677, "loc": { "start": { "line": 16, "column": 57 }, "end": { "line": 16, "column": 66 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 668, "end": 672, "loc": { "start": { "line": 16, "column": 57 }, "end": { "line": 16, "column": 61 } }, "name": "task" }, "value": { "type": "Identifier", "start": 674, "end": 677, "loc": { "start": { "line": 16, "column": 63 }, "end": { "line": 16, "column": 66 } }, "name": "cmd" }, "kind": "init" } ] } ] }, { "type": "Identifier", "start": 681, "end": 688, "loc": { "start": { "line": 16, "column": 70 }, "end": { "line": 16, "column": 77 } }, "name": "factory" }, { "type": "Identifier", "start": 690, "end": 700, "loc": { "start": { "line": 16, "column": 79 }, "end": { "line": 16, "column": 89 } }, "name": "attributes" } ] }, "property": { "type": "Identifier", "start": 702, "end": 706, "loc": { "start": { "line": 16, "column": 91 }, "end": { "line": 16, "column": 95 } }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 707, "end": 716, "loc": { "start": { "line": 16, "column": 96 }, "end": { "line": 16, "column": 105 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 707, "end": 708, "loc": { "start": { "line": 16, "column": 96 }, "end": { "line": 16, "column": 97 } }, "name": "x" } ], "body": { "type": "MemberExpression", "start": 712, "end": 716, "loc": { "start": { "line": 16, "column": 101 }, "end": { "line": 16, "column": 105 } }, "object": { "type": "Identifier", "start": 712, "end": 713, "loc": { "start": { "line": 16, "column": 101 }, "end": { "line": 16, "column": 102 } }, "name": "x" }, "property": { "type": "Literal", "start": 714, "end": 715, "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": 722, "end": 894, "loc": { "start": { "line": 19, "column": 0 }, "end": { "line": 21, "column": 1 } }, "id": { "type": "Identifier", "start": 731, "end": 744, "loc": { "start": { "line": 19, "column": 9 }, "end": { "line": 19, "column": 22 } }, "name": "executeModels" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 745, "end": 751, "loc": { "start": { "line": 19, "column": 23 }, "end": { "line": 19, "column": 29 } }, "name": "socket" }, { "type": "Identifier", "start": 753, "end": 756, "loc": { "start": { "line": 19, "column": 31 }, "end": { "line": 19, "column": 34 } }, "name": "cmd" } ], "body": { "type": "BlockStatement", "start": 758, "end": 894, "loc": { "start": { "line": 19, "column": 36 }, "end": { "line": 21, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 764, "end": 892, "loc": { "start": { "line": 20, "column": 4 }, "end": { "line": 20, "column": 132 } }, "argument": { "type": "CallExpression", "start": 771, "end": 891, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 131 } }, "callee": { "type": "MemberExpression", "start": 771, "end": 876, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 116 } }, "object": { "type": "CallExpression", "start": 771, "end": 871, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 111 } }, "callee": { "type": "Identifier", "start": 771, "end": 786, "loc": { "start": { "line": 20, "column": 11 }, "end": { "line": 20, "column": 26 } }, "name": "executePrepared" }, "arguments": [ { "type": "Identifier", "start": 787, "end": 793, "loc": { "start": { "line": 20, "column": 27 }, "end": { "line": 20, "column": 33 } }, "name": "socket" }, { "type": "ArrayExpression", "start": 795, "end": 828, "loc": { "start": { "line": 20, "column": 35 }, "end": { "line": 20, "column": 68 } }, "elements": [ { "type": "ObjectExpression", "start": 796, "end": 827, "loc": { "start": { "line": 20, "column": 36 }, "end": { "line": 20, "column": 67 } }, "properties": [ { "type": "Property", "start": 797, "end": 815, "loc": { "start": { "line": 20, "column": 37 }, "end": { "line": 20, "column": 55 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 797, "end": 804, "loc": { "start": { "line": 20, "column": 37 }, "end": { "line": 20, "column": 44 } }, "name": "command" }, "value": { "type": "Literal", "start": 806, "end": 815, "loc": { "start": { "line": 20, "column": 46 }, "end": { "line": 20, "column": 55 } }, "value": "Execute", "rawValue": "Execute", "raw": "'Execute'" }, "kind": "init" }, { "type": "Property", "start": 817, "end": 826, "loc": { "start": { "line": 20, "column": 57 }, "end": { "line": 20, "column": 66 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 817, "end": 821, "loc": { "start": { "line": 20, "column": 57 }, "end": { "line": 20, "column": 61 } }, "name": "task" }, "value": { "type": "Identifier", "start": 823,