UNPKG

awv3

Version:
1,814 lines 1.57 MB
{ "type": "Program", "start": 0, "end": 13818, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 358, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 62, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 62 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 } }, "imported": { "type": "Identifier", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 } }, "name": "ClassCadObject" }, "local": { "type": "Identifier", "start": 8, "end": 22, "loc": { "start": { "line": 1, "column": 8 }, "end": { "line": 1, "column": 22 } }, "name": "ClassCadObject" } }, { "type": "ImportSpecifier", "start": 24, "end": 34, "loc": { "start": { "line": 1, "column": 24 }, "end": { "line": 1, "column": 34 } }, "imported": { "type": "Identifier", "start": 24, "end": 34, "loc": { "start": { "line": 1, "column": 24 }, "end": { "line": 1, "column": 34 } }, "name": "RootObject" }, "local": { "type": "Identifier", "start": 24, "end": 34, "loc": { "start": { "line": 1, "column": 24 }, "end": { "line": 1, "column": 34 } }, "name": "RootObject" } } ], "importKind": "value", "source": { "type": "Literal", "start": 41, "end": 61, "loc": { "start": { "line": 1, "column": 41 }, "end": { "line": 1, "column": 61 } }, "value": "sketcher/ccobjects", "rawValue": "sketcher/ccobjects", "raw": "'sketcher/ccobjects'" } }, { "type": "ImportDeclaration", "start": 63, "end": 89, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 26 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 70, "end": 75, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "local": { "type": "Identifier", "start": 70, "end": 75, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 12 } }, "name": "THREE" } } ], "importKind": "value", "source": { "type": "Literal", "start": 81, "end": 88, "loc": { "start": { "line": 2, "column": 18 }, "end": { "line": 2, "column": 25 } }, "value": "three", "rawValue": "three", "raw": "'three'" } }, { "type": "ImportDeclaration", "start": 90, "end": 126, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 97, "end": 104, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 14 } }, "local": { "type": "Identifier", "start": 97, "end": 104, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 14 } }, "name": "Object3" } } ], "importKind": "value", "source": { "type": "Literal", "start": 110, "end": 125, "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 35 } }, "value": "three/object3", "rawValue": "three/object3", "raw": "'three/object3'" } }, { "type": "ImportDeclaration", "start": 127, "end": 171, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 44 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 135, "end": 138, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 11 } }, "imported": { "type": "Identifier", "start": 135, "end": 138, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 11 } }, "name": "url" }, "local": { "type": "Identifier", "start": 135, "end": 138, "loc": { "start": { "line": 4, "column": 8 }, "end": { "line": 4, "column": 11 } }, "name": "url" } }, { "type": "ImportSpecifier", "start": 140, "end": 149, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 22 } }, "imported": { "type": "Identifier", "start": 140, "end": 149, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 22 } }, "name": "Timestamp" }, "local": { "type": "Identifier", "start": 140, "end": 149, "loc": { "start": { "line": 4, "column": 13 }, "end": { "line": 4, "column": 22 } }, "name": "Timestamp" } } ], "importKind": "value", "source": { "type": "Literal", "start": 156, "end": 170, "loc": { "start": { "line": 4, "column": 29 }, "end": { "line": 4, "column": 43 } }, "value": "core/helpers", "rawValue": "core/helpers", "raw": "'core/helpers'" }, "trailingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 172, "end": 217, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 45 } }, "range": [ 172, 217 ] } ] }, { "type": "ExportNamedDeclaration", "start": 219, "end": 267, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 7, "column": 48 } }, "declaration": { "type": "VariableDeclaration", "start": 226, "end": 267, "loc": { "start": { "line": 7, "column": 7 }, "end": { "line": 7, "column": 48 } }, "declarations": [ { "type": "VariableDeclarator", "start": 232, "end": 266, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 47 } }, "id": { "type": "Identifier", "start": 232, "end": 240, "loc": { "start": { "line": 7, "column": 13 }, "end": { "line": 7, "column": 21 } }, "name": "logLevel", "leadingComments": null }, "init": { "type": "CallExpression", "start": 243, "end": 266, "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 47 } }, "callee": { "type": "Identifier", "start": 243, "end": 249, "loc": { "start": { "line": 7, "column": 24 }, "end": { "line": 7, "column": 30 } }, "name": "Number" }, "arguments": [ { "type": "CallExpression", "start": 250, "end": 265, "loc": { "start": { "line": 7, "column": 31 }, "end": { "line": 7, "column": 46 } }, "callee": { "type": "Identifier", "start": 250, "end": 253, "loc": { "start": { "line": 7, "column": 31 }, "end": { "line": 7, "column": 34 } }, "name": "url" }, "arguments": [ { "type": "Literal", "start": 254, "end": 264, "loc": { "start": { "line": 7, "column": 35 }, "end": { "line": 7, "column": 45 } }, "value": "logLevel", "rawValue": "logLevel", "raw": "'logLevel'" } ] } ] }, "leadingComments": null } ], "kind": "const", "leadingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 172, "end": 217, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 45 } }, "range": [ 172, 217 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " execute one ClassCad command and return its result in a Promise", "start": 269, "end": 335, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 66 } }, "range": [ 269, 335 ] } ] }, "specifiers": [], "source": null, "leadingComments": [ { "type": "CommentLine", "value": " helper functions to interact with ClassCad", "start": 172, "end": 217, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 45 } }, "range": [ 172, 217 ] } ], "trailingComments": [ { "type": "CommentLine", "value": " execute one ClassCad command and return its result in a Promise", "start": 269, "end": 335, "loc": { "start": { "line": 9, "column": 0 }, "end": { "line": 9, "column": 66 } }, "range": [ 269, 335 ] } ] }, { "type": "Identifier", "start": 336, "end": 662, "loc": { "start": { "line": 10, "column": 0 }, "end": { "line": 16, "column": 1 } }, "id": { "type": "Identifier", "start": 345, "end": 352, "loc": { "start": { "line": 10, "column": 9 }, "end": { "line": 10, "column": 16 } }, "name": "execute", "leadingComments": null }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 353, "end": 359, "loc": { "start": { "line": 10, "column": 17 }, "end": { "line": 10, "column": 23 } }, "name": "server" }, { "type": "Identifier", "start": 361, "end": 364, "loc": { "start": { "line": 10, "column": 25 }, "end": { "line": 10, "column": 28 } }, "name": "cmd" }, { "type": "Identifier", "start": 366, "end": 373, "loc": { "start": { "line": 10, "column": 30 }, "end": { "line": 10, "column": 37 } }, "name": "factory" }, { "type": "Identifier", "start": 375, "end": 385, "loc": { "start": { "line": 10, "column": 39 }, "end": { "line": 10, "column": 49 } }, "name": "attributes" } ], "body": { "type": "BlockStatement", "start": 387, "end": 662, "loc": { "start": { "line": 10, "column": 51 }, "end": { "line": 16, "column": 1 } }, "body": [ { "type": "IfStatement", "start": 393, "end": 447, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 12, "column": 24 } }, "test": { "type": "BinaryExpression", "start": 397, "end": 421, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 32 } }, "left": { "type": "Identifier", "start": 397, "end": 407, "loc": { "start": { "line": 11, "column": 8 }, "end": { "line": 11, "column": 18 } }, "name": "attributes" }, "operator": "===", "right": { "type": "Identifier", "start": 412, "end": 421, "loc": { "start": { "line": 11, "column": 23 }, "end": { "line": 11, "column": 32 } }, "name": "undefined" } }, "consequent": { "type": "ExpressionStatement", "start": 431, "end": 447, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 24 } }, "expression": { "type": "AssignmentExpression", "start": 431, "end": 446, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 23 } }, "operator": "=", "left": { "type": "Identifier", "start": 431, "end": 441, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 18 } }, "name": "attributes" }, "right": { "type": "ObjectExpression", "start": 444, "end": 446, "loc": { "start": { "line": 12, "column": 21 }, "end": { "line": 12, "column": 23 } }, "properties": [] } } }, "alternate": null }, { "type": "IfStatement", "start": 452, "end": 552, "loc": { "start": { "line": 13, "column": 4 }, "end": { "line": 14, "column": 48 } }, "test": { "type": "BinaryExpression", "start": 456, "end": 502, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 54 } }, "left": { "type": "MemberExpression", "start": 456, "end": 488, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 40 } }, "object": { "type": "Identifier", "start": 456, "end": 466, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 18 } }, "name": "attributes" }, "property": { "type": "Identifier", "start": 467, "end": 488, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 40 } }, "name": "ignoreNumberOfResults" }, "computed": false }, "operator": "===", "right": { "type": "Identifier", "start": 493, "end": 502, "loc": { "start": { "line": 13, "column": 45 }, "end": { "line": 13, "column": 54 } }, "name": "undefined" } }, "consequent": { "type": "ExpressionStatement", "start": 512, "end": 552, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 48 } }, "expression": { "type": "AssignmentExpression", "start": 512, "end": 551, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 47 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 512, "end": 544, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 40 } }, "object": { "type": "Identifier", "start": 512, "end": 522, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 14, "column": 18 } }, "name": "attributes" }, "property": { "type": "Identifier", "start": 523, "end": 544, "loc": { "start": { "line": 14, "column": 19 }, "end": { "line": 14, "column": 40 } }, "name": "ignoreNumberOfResults" }, "computed": false }, "right": { "type": "Literal", "start": 547, "end": 551, "loc": { "start": { "line": 14, "column": 43 }, "end": { "line": 14, "column": 47 } }, "value": true, "rawValue": true, "raw": "true" } } }, "alternate": null }, { "type": "ReturnStatement", "start": 557, "end": 660, "loc": { "start": { "line": 15, "column": 4 }, "end": { "line": 15, "column": 107 } }, "argument": { "type": "CallExpression", "start": 564, "end": 659, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 106 } }, "callee": { "type": "MemberExpression", "start": 564, "end": 648, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 95 } }, "object": { "type": "CallExpression", "start": 564, "end": 643, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 90 } }, "callee": { "type": "Identifier", "start": 564, "end": 579, "loc": { "start": { "line": 15, "column": 11 }, "end": { "line": 15, "column": 26 } }, "name": "executePrepared" }, "arguments": [ { "type": "Identifier", "start": 580, "end": 586, "loc": { "start": { "line": 15, "column": 27 }, "end": { "line": 15, "column": 33 } }, "name": "server" }, { "type": "ArrayExpression", "start": 588, "end": 621, "loc": { "start": { "line": 15, "column": 35 }, "end": { "line": 15, "column": 68 } }, "elements": [ { "type": "ObjectExpression", "start": 589, "end": 620, "loc": { "start": { "line": 15, "column": 36 }, "end": { "line": 15, "column": 67 } }, "properties": [ { "type": "Property", "start": 590, "end": 608, "loc": { "start": { "line": 15, "column": 37 }, "end": { "line": 15, "column": 55 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 590, "end": 597, "loc": { "start": { "line": 15, "column": 37 }, "end": { "line": 15, "column": 44 } }, "name": "command" }, "value": { "type": "Literal", "start": 599, "end": 608, "loc": { "start": { "line": 15, "column": 46 }, "end": { "line": 15, "column": 55 } }, "value": "Execute", "rawValue": "Execute", "raw": "'Execute'" }, "kind": "init" }, { "type": "Property", "start": 610, "end": 619, "loc": { "start": { "line": 15, "column": 57 }, "end": { "line": 15, "column": 66 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 610, "end": 614, "loc": { "start": { "line": 15, "column": 57 }, "end": { "line": 15, "column": 61 } }, "name": "task" }, "value": { "type": "Identifier", "start": 616, "end": 619, "loc": { "start": { "line": 15, "column": 63 }, "end": { "line": 15, "column": 66 } }, "name": "cmd" }, "kind": "init" } ] } ] }, { "type": "Identifier", "start": 623, "end": 630, "loc": { "start": { "line": 15, "column": 70 }, "end": { "line": 15, "column": 77 } }, "name": "factory" }, { "type": "Identifier", "start": 632, "end": 642, "loc": { "start": { "line": 15, "column": 79 }, "end": { "line": 15, "column": 89 } }, "name": "attributes" } ] }, "property": { "type": "Identifier", "start": 644, "end": 648, "loc": { "start": { "line": 15, "column": 91 }, "end": { "line": 15, "column": 95 } }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 649, "end": 658, "loc": { "start": { "line": 15, "column": 96 }, "end": { "line": 15, "column": 105 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 649, "end": 650, "loc": { "start": { "line": 15, "column": 96 }, "end": { "line": 15, "column": 97 } }, "name": "x" } ], "body": { "type": "MemberExpression", "start": 654, "end": 658, "loc": { "start": { "line": 15, "column": 101 }, "end": { "line": 15, "column": 105 } }, "object": { "type": "Identifier", "start": 654, "end": 655, "loc": { "start": { "line": 15, "column": 101 }, "end": { "line": 15, "column": 102 } }, "name": "x" }, "property": { "type": "Literal", "start": 656, "end": 657, "loc": { "start": { "line": 15, "column": 103 }, "end": { "line": 15, "column": 104 } }, "value": 0, "rawValue": 0, "raw": "0" }, "computed": true } } ] } } ] }, "leadingComments": [], "name": "_", "trailingComments": [] }, { "type": "Identifier", "start": 664, "end": 836, "loc": { "start": { "line": 18, "column": 0 }, "end": { "line": 20, "column": 1 } }, "id": { "type": "Identifier", "start": 673, "end": 686, "loc": { "start": { "line": 18, "column": 9 }, "end": { "line": 18, "column": 22 } }, "name": "executeModels" }, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 687, "end": 693, "loc": { "start": { "line": 18, "column": 23 }, "end": { "line": 18, "column": 29 } }, "name": "server" }, { "type": "Identifier", "start": 695, "end": 698, "loc": { "start": { "line": 18, "column": 31 }, "end": { "line": 18, "column": 34 } }, "name": "cmd" } ], "body": { "type": "BlockStatement", "start": 700, "end": 836, "loc": { "start": { "line": 18, "column": 36 }, "end": { "line": 20, "column": 1 } }, "body": [ { "type": "ReturnStatement", "start": 706, "end": 834, "loc": { "start": { "line": 19, "column": 4 }, "end": { "line": 19, "column": 132 } }, "argument": { "type": "CallExpression", "start": 713, "end": 833, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 131 } }, "callee": { "type": "MemberExpression", "start": 713, "end": 818, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 116 } }, "object": { "type": "CallExpression", "start": 713, "end": 813, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 111 } }, "callee": { "type": "Identifier", "start": 713, "end": 728, "loc": { "start": { "line": 19, "column": 11 }, "end": { "line": 19, "column": 26 } }, "name": "executePrepared" }, "arguments": [ { "type": "Identifier", "start": 729, "end": 735, "loc": { "start": { "line": 19, "column": 27 }, "end": { "line": 19, "column": 33 } }, "name": "server" }, { "type": "ArrayExpression", "start": 737, "end": 770, "loc": { "start": { "line": 19, "column": 35 }, "end": { "line": 19, "column": 68 } }, "elements": [ { "type": "ObjectExpression", "start": 738, "end": 769, "loc": { "start": { "line": 19, "column": 36 }, "end": { "line": 19, "column": 67 } }, "properties": [ { "type": "Property", "start": 739, "end": 757, "loc": { "start": { "line": 19, "column": 37 }, "end": { "line": 19, "column": 55 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 739, "end": 746, "loc": { "start": { "line": 19, "column": 37 }, "end": { "line": 19, "column": 44 } }, "name": "command" }, "value": { "type": "Literal", "start": 748, "end": 757, "loc": { "start": { "line": 19, "column": 46 }, "end": { "line": 19, "column": 55 } }, "value": "Execute", "rawValue": "Execute", "raw": "'Execute'" }, "kind": "init" }, { "type": "Property", "start": 759, "end": 768, "loc": { "start": { "line": 19, "column": 57 }, "end": { "line": 19, "column": 66 } }, "method": false, "shorthand": false, "computed": false, "key": { "type": "Identifier", "start": 759, "end": 763, "loc": { "start": { "line": 19, "column": 57 }, "end": { "line": 19, "column": 61 } }, "name": "task" }, "value": { "type": "Identifier", "start": 765, "end": 768, "loc": { "start": { "line": 19, "column": 63 }, "end": { "line": 19, "column": 66 } }, "name": "cmd" }, "kind": "init" } ] } ] }, { "type": "Identifier", "start": 772, "end": 781, "loc": { "start": { "line": 19, "column": 70 }, "end": { "line": 19, "column": 79 } }, "name": "undefined" }, { "type": "ObjectExpression", "start": 783, "end": 812, "loc": { "start