UNPKG

awv3

Version:
1,485 lines (1,484 loc) 226 kB
{ "type": "Program", "start": 0, "end": 1840, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 59, "column": 0 } }, "sourceType": "module", "body": [ { "type": "ImportDeclaration", "start": 0, "end": 36, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 1, "column": 36 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 } }, "local": { "type": "Identifier", "start": 7, "end": 13, "loc": { "start": { "line": 1, "column": 7 }, "end": { "line": 1, "column": 13 } }, "name": "Parser" } } ], "importKind": "value", "source": { "type": "Literal", "start": 19, "end": 35, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 35 } }, "value": "../core/parser", "rawValue": "../core/parser", "raw": "'../core/parser'" } }, { "type": "ImportDeclaration", "start": 37, "end": 78, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 41 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 44, "end": 48, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 11 } }, "local": { "type": "Identifier", "start": 44, "end": 48, "loc": { "start": { "line": 2, "column": 7 }, "end": { "line": 2, "column": 11 } }, "name": "Base" } } ], "importKind": "value", "source": { "type": "Literal", "start": 54, "end": 77, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 40 } }, "value": "../communication/base", "rawValue": "../communication/base", "raw": "'../communication/base'" } }, { "type": "ImportDeclaration", "start": 79, "end": 113, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 86, "end": 98, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 } }, "local": { "type": "Identifier", "start": 86, "end": 98, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 } }, "name": "EventEmitter" } } ], "importKind": "value", "source": { "type": "Literal", "start": 104, "end": 112, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 33 } }, "value": "events", "rawValue": "events", "raw": "'events'" } }, { "type": "ImportDeclaration", "start": 114, "end": 153, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 39 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 123, "end": 127, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 13 } }, "imported": { "type": "Identifier", "start": 123, "end": 127, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 13 } }, "name": "guid" }, "local": { "type": "Identifier", "start": 123, "end": 127, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 13 } }, "name": "guid" } } ], "importKind": "value", "source": { "type": "Literal", "start": 135, "end": 152, "loc": { "start": { "line": 4, "column": 21 }, "end": { "line": 4, "column": 38 } }, "value": "../core/helpers", "rawValue": "../core/helpers", "raw": "'../core/helpers'" } }, { "type": "ImportDeclaration", "start": 154, "end": 229, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 75 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 163, "end": 176, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 22 } }, "imported": { "type": "Identifier", "start": 163, "end": 176, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 22 } }, "name": "createContext" }, "local": { "type": "Identifier", "start": 163, "end": 176, "loc": { "start": { "line": 5, "column": 9 }, "end": { "line": 5, "column": 22 } }, "name": "createContext" } }, { "type": "ImportSpecifier", "start": 178, "end": 190, "loc": { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 36 } }, "imported": { "type": "Identifier", "start": 178, "end": 190, "loc": { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 36 } }, "name": "mergeContext" }, "local": { "type": "Identifier", "start": 178, "end": 190, "loc": { "start": { "line": 5, "column": 24 }, "end": { "line": 5, "column": 36 } }, "name": "mergeContext" } }, { "type": "ImportSpecifier", "start": 192, "end": 204, "loc": { "start": { "line": 5, "column": 38 }, "end": { "line": 5, "column": 50 } }, "imported": { "type": "Identifier", "start": 192, "end": 204, "loc": { "start": { "line": 5, "column": 38 }, "end": { "line": 5, "column": 50 } }, "name": "handleResult" }, "local": { "type": "Identifier", "start": 192, "end": 204, "loc": { "start": { "line": 5, "column": 38 }, "end": { "line": 5, "column": 50 } }, "name": "handleResult" } } ], "importKind": "value", "source": { "type": "Literal", "start": 212, "end": 228, "loc": { "start": { "line": 5, "column": 58 }, "end": { "line": 5, "column": 74 } }, "value": "../core/parser", "rawValue": "../core/parser", "raw": "'../core/parser'" } }, { "type": "ExportDefaultDeclaration", "start": 231, "end": 1839, "loc": { "start": { "line": 7, "column": 0 }, "end": { "line": 58, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 246, "end": 1839, "loc": { "start": { "line": 7, "column": 15 }, "end": { "line": 58, "column": 1 } }, "id": { "type": "Identifier", "start": 252, "end": 256, "loc": { "start": { "line": 7, "column": 21 }, "end": { "line": 7, "column": 25 } }, "name": "Rest" }, "superClass": { "type": "Identifier", "start": 265, "end": 269, "loc": { "start": { "line": 7, "column": 34 }, "end": { "line": 7, "column": 38 } }, "name": "Base" }, "body": { "type": "ClassBody", "start": 270, "end": 1839, "loc": { "start": { "line": 7, "column": 39 }, "end": { "line": 58, "column": 1 } }, "body": [ { "type": "MethodDefinition", "start": 276, "end": 328, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 10, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 276, "end": 287, "loc": { "start": { "line": 8, "column": 4 }, "end": { "line": 8, "column": 15 } }, "name": "constructor" }, "static": false, "kind": "constructor", "value": { "type": "FunctionExpression", "start": 287, "end": 328, "loc": { "start": { "line": 8, "column": 15 }, "end": { "line": 10, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 288, "end": 295, "loc": { "start": { "line": 8, "column": 16 }, "end": { "line": 8, "column": 23 } }, "name": "options" } ], "body": { "type": "BlockStatement", "start": 297, "end": 328, "loc": { "start": { "line": 8, "column": 25 }, "end": { "line": 10, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 307, "end": 322, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 23 } }, "expression": { "type": "CallExpression", "start": 307, "end": 321, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 22 } }, "callee": { "type": "Super", "start": 307, "end": 312, "loc": { "start": { "line": 9, "column": 8 }, "end": { "line": 9, "column": 13 } } }, "arguments": [ { "type": "Identifier", "start": 313, "end": 320, "loc": { "start": { "line": 9, "column": 14 }, "end": { "line": 9, "column": 21 } }, "name": "options" } ] } } ] } } }, { "type": "MethodDefinition", "start": 334, "end": 690, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 23, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 334, "end": 341, "loc": { "start": { "line": 12, "column": 4 }, "end": { "line": 12, "column": 11 } }, "name": "connect" }, "static": false, "kind": "method", "value": { "type": "FunctionExpression", "start": 341, "end": 690, "loc": { "start": { "line": 12, "column": 11 }, "end": { "line": 23, "column": 5 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 342, "end": 345, "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 15 } }, "name": "url" } ], "body": { "type": "BlockStatement", "start": 347, "end": 690, "loc": { "start": { "line": 12, "column": 17 }, "end": { "line": 23, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 357, "end": 384, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 35 } }, "expression": { "type": "AssignmentExpression", "start": 357, "end": 383, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 34 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 357, "end": 365, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 16 } }, "object": { "type": "ThisExpression", "start": 357, "end": 361, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 13, "column": 12 } } }, "property": { "type": "Identifier", "start": 362, "end": 365, "loc": { "start": { "line": 13, "column": 13 }, "end": { "line": 13, "column": 16 } }, "name": "url" }, "computed": false }, "right": { "type": "LogicalExpression", "start": 368, "end": 383, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 34 } }, "left": { "type": "MemberExpression", "start": 368, "end": 376, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 27 } }, "object": { "type": "ThisExpression", "start": 368, "end": 372, "loc": { "start": { "line": 13, "column": 19 }, "end": { "line": 13, "column": 23 } } }, "property": { "type": "Identifier", "start": 373, "end": 376, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 27 } }, "name": "url" }, "computed": false }, "operator": "||", "right": { "type": "Identifier", "start": 380, "end": 383, "loc": { "start": { "line": 13, "column": 31 }, "end": { "line": 13, "column": 34 } }, "name": "url" } } } }, { "type": "ReturnStatement", "start": 393, "end": 684, "loc": { "start": { "line": 14, "column": 8 }, "end": { "line": 22, "column": 15 } }, "argument": { "type": "CallExpression", "start": 400, "end": 683, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 22, "column": 14 } }, "callee": { "type": "MemberExpression", "start": 400, "end": 481, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 16, "column": 17 } }, "object": { "type": "CallExpression", "start": 400, "end": 463, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 15, "column": 36 } }, "callee": { "type": "MemberExpression", "start": 400, "end": 444, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 15, "column": 17 } }, "object": { "type": "CallExpression", "start": 400, "end": 426, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 14, "column": 41 } }, "callee": { "type": "Identifier", "start": 400, "end": 405, "loc": { "start": { "line": 14, "column": 15 }, "end": { "line": 14, "column": 20 } }, "name": "fetch" }, "arguments": [ { "type": "TemplateLiteral", "start": 406, "end": 425, "loc": { "start": { "line": 14, "column": 21 }, "end": { "line": 14, "column": 40 } }, "expressions": [ { "type": "MemberExpression", "start": 409, "end": 417, "loc": { "start": { "line": 14, "column": 24 }, "end": { "line": 14, "column": 32 } }, "object": { "type": "ThisExpression", "start": 409, "end": 413, "loc": { "start": { "line": 14, "column": 24 }, "end": { "line": 14, "column": 28 } } }, "property": { "type": "Identifier", "start": 414, "end": 417, "loc": { "start": { "line": 14, "column": 29 }, "end": { "line": 14, "column": 32 } }, "name": "url" }, "computed": false } ], "quasis": [ { "type": "TemplateElement", "start": 407, "end": 407, "loc": { "start": { "line": 14, "column": 22 }, "end": { "line": 14, "column": 22 } }, "value": { "raw": "", "cooked": "" }, "tail": false }, { "type": "TemplateElement", "start": 418, "end": 424, "loc": { "start": { "line": 14, "column": 33 }, "end": { "line": 14, "column": 39 } }, "value": { "raw": "/login", "cooked": "/login" }, "tail": true } ] } ] }, "property": { "type": "Identifier", "start": 440, "end": 444, "loc": { "start": { "line": 15, "column": 13 }, "end": { "line": 15, "column": 17 } }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 445, "end": 462, "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 35 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 445, "end": 448, "loc": { "start": { "line": 15, "column": 18 }, "end": { "line": 15, "column": 21 } }, "name": "res" } ], "body": { "type": "CallExpression", "start": 452, "end": 462, "loc": { "start": { "line": 15, "column": 25 }, "end": { "line": 15, "column": 35 } }, "callee": { "type": "MemberExpression", "start": 452, "end": 460, "loc": { "start": { "line": 15, "column": 25 }, "end": { "line": 15, "column": 33 } }, "object": { "type": "Identifier", "start": 452, "end": 455, "loc": { "start": { "line": 15, "column": 25 }, "end": { "line": 15, "column": 28 } }, "name": "res" }, "property": { "type": "Identifier", "start": 456, "end": 460, "loc": { "start": { "line": 15, "column": 29 }, "end": { "line": 15, "column": 33 } }, "name": "json" }, "computed": false }, "arguments": [] } } ] }, "property": { "type": "Identifier", "start": 477, "end": 481, "loc": { "start": { "line": 16, "column": 13 }, "end": { "line": 16, "column": 17 } }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 482, "end": 682, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 22, "column": 13 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 482, "end": 485, "loc": { "start": { "line": 16, "column": 18 }, "end": { "line": 16, "column": 21 } }, "name": "res" } ], "body": { "type": "BlockStatement", "start": 489, "end": 682, "loc": { "start": { "line": 16, "column": 25 }, "end": { "line": 22, "column": 13 } }, "body": [ { "type": "IfStatement", "start": 507, "end": 668, "loc": { "start": { "line": 17, "column": 16 }, "end": { "line": 21, "column": 17 } }, "test": { "type": "BinaryExpression", "start": 511, "end": 537, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 46 } }, "left": { "type": "MemberExpression", "start": 511, "end": 521, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 30 } }, "object": { "type": "Identifier", "start": 511, "end": 514, "loc": { "start": { "line": 17, "column": 20 }, "end": { "line": 17, "column": 23 } }, "name": "res" }, "property": { "type": "Identifier", "start": 515, "end": 521, "loc": { "start": { "line": 17, "column": 24 }, "end": { "line": 17, "column": 30 } }, "name": "status" }, "computed": false }, "operator": "===", "right": { "type": "Literal", "start": 526, "end": 537, "loc": { "start": { "line": 17, "column": 35 }, "end": { "line": 17, "column": 46 } }, "value": "permitted", "rawValue": "permitted", "raw": "'permitted'" } }, "consequent": { "type": "BlockStatement", "start": 539, "end": 668, "loc": { "start": { "line": 17, "column": 48 }, "end": { "line": 21, "column": 17 } }, "body": [ { "type": "ExpressionStatement", "start": 561, "end": 579, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 38 } }, "expression": { "type": "AssignmentExpression", "start": 561, "end": 578, "loc": { "start": { "line": 18, "column": 20 }, "end": { "line": 18, "column": 37 } },