UNPKG

awv3

Version:
1,415 lines 412 kB
{ "type": "File", "start": 0, "end": 1759, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 54, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 1759, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 54, "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 }, "identifierName": "Parser" }, "name": "Parser" } } ], "source": { "type": "StringLiteral", "start": 19, "end": 35, "loc": { "start": { "line": 1, "column": 19 }, "end": { "line": 1, "column": 35 } }, "extra": { "rawValue": "../core/parser", "raw": "'../core/parser'" }, "value": "../core/parser" } }, { "type": "ImportDeclaration", "start": 37, "end": 63, "loc": { "start": { "line": 2, "column": 0 }, "end": { "line": 2, "column": 26 } }, "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 }, "identifierName": "Base" }, "name": "Base" } } ], "source": { "type": "StringLiteral", "start": 54, "end": 62, "loc": { "start": { "line": 2, "column": 17 }, "end": { "line": 2, "column": 25 } }, "extra": { "rawValue": "./base", "raw": "'./base'" }, "value": "./base" } }, { "type": "ImportDeclaration", "start": 64, "end": 98, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 34 } }, "specifiers": [ { "type": "ImportDefaultSpecifier", "start": 71, "end": 83, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 } }, "local": { "type": "Identifier", "start": 71, "end": 83, "loc": { "start": { "line": 3, "column": 7 }, "end": { "line": 3, "column": 19 }, "identifierName": "EventEmitter" }, "name": "EventEmitter" } } ], "source": { "type": "StringLiteral", "start": 89, "end": 97, "loc": { "start": { "line": 3, "column": 25 }, "end": { "line": 3, "column": 33 } }, "extra": { "rawValue": "events", "raw": "'events'" }, "value": "events" } }, { "type": "ImportDeclaration", "start": 99, "end": 174, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 75 } }, "specifiers": [ { "type": "ImportSpecifier", "start": 108, "end": 121, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 22 } }, "imported": { "type": "Identifier", "start": 108, "end": 121, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 22 }, "identifierName": "createContext" }, "name": "createContext" }, "local": { "type": "Identifier", "start": 108, "end": 121, "loc": { "start": { "line": 4, "column": 9 }, "end": { "line": 4, "column": 22 }, "identifierName": "createContext" }, "name": "createContext" } }, { "type": "ImportSpecifier", "start": 123, "end": 135, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 36 } }, "imported": { "type": "Identifier", "start": 123, "end": 135, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 36 }, "identifierName": "mergeContext" }, "name": "mergeContext" }, "local": { "type": "Identifier", "start": 123, "end": 135, "loc": { "start": { "line": 4, "column": 24 }, "end": { "line": 4, "column": 36 }, "identifierName": "mergeContext" }, "name": "mergeContext" } }, { "type": "ImportSpecifier", "start": 137, "end": 149, "loc": { "start": { "line": 4, "column": 38 }, "end": { "line": 4, "column": 50 } }, "imported": { "type": "Identifier", "start": 137, "end": 149, "loc": { "start": { "line": 4, "column": 38 }, "end": { "line": 4, "column": 50 }, "identifierName": "handleResult" }, "name": "handleResult" }, "local": { "type": "Identifier", "start": 137, "end": 149, "loc": { "start": { "line": 4, "column": 38 }, "end": { "line": 4, "column": 50 }, "identifierName": "handleResult" }, "name": "handleResult" } } ], "source": { "type": "StringLiteral", "start": 157, "end": 173, "loc": { "start": { "line": 4, "column": 58 }, "end": { "line": 4, "column": 74 } }, "extra": { "rawValue": "../core/parser", "raw": "'../core/parser'" }, "value": "../core/parser" } }, { "type": "ExportDefaultDeclaration", "start": 176, "end": 1758, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 53, "column": 1 } }, "declaration": { "type": "ClassDeclaration", "start": 191, "end": 1758, "loc": { "start": { "line": 6, "column": 15 }, "end": { "line": 53, "column": 1 } }, "id": { "type": "Identifier", "start": 197, "end": 201, "loc": { "start": { "line": 6, "column": 21 }, "end": { "line": 6, "column": 25 }, "identifierName": "Rest" }, "name": "Rest" }, "superClass": { "type": "Identifier", "start": 210, "end": 214, "loc": { "start": { "line": 6, "column": 34 }, "end": { "line": 6, "column": 38 }, "identifierName": "Base" }, "name": "Base" }, "body": { "type": "ClassBody", "start": 215, "end": 1758, "loc": { "start": { "line": 6, "column": 39 }, "end": { "line": 53, "column": 1 } }, "body": [ { "type": "ClassMethod", "start": 221, "end": 273, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 9, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 221, "end": 232, "loc": { "start": { "line": 7, "column": 4 }, "end": { "line": 7, "column": 15 }, "identifierName": "constructor" }, "name": "constructor" }, "static": false, "kind": "constructor", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 233, "end": 240, "loc": { "start": { "line": 7, "column": 16 }, "end": { "line": 7, "column": 23 }, "identifierName": "options" }, "name": "options" } ], "body": { "type": "BlockStatement", "start": 242, "end": 273, "loc": { "start": { "line": 7, "column": 25 }, "end": { "line": 9, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 252, "end": 267, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 23 } }, "expression": { "type": "CallExpression", "start": 252, "end": 266, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 22 } }, "callee": { "type": "Super", "start": 252, "end": 257, "loc": { "start": { "line": 8, "column": 8 }, "end": { "line": 8, "column": 13 } } }, "arguments": [ { "type": "Identifier", "start": 258, "end": 265, "loc": { "start": { "line": 8, "column": 14 }, "end": { "line": 8, "column": 21 }, "identifierName": "options" }, "name": "options" } ] } } ], "directives": [] } }, { "type": "ClassMethod", "start": 279, "end": 585, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 20, "column": 5 } }, "computed": false, "key": { "type": "Identifier", "start": 279, "end": 286, "loc": { "start": { "line": 11, "column": 4 }, "end": { "line": 11, "column": 11 }, "identifierName": "connect" }, "name": "connect" }, "static": false, "kind": "method", "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 287, "end": 290, "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 15 }, "identifierName": "url" }, "name": "url" } ], "body": { "type": "BlockStatement", "start": 292, "end": 585, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 20, "column": 5 } }, "body": [ { "type": "ExpressionStatement", "start": 302, "end": 329, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 35 } }, "expression": { "type": "AssignmentExpression", "start": 302, "end": 328, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 34 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 302, "end": 310, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 16 } }, "object": { "type": "ThisExpression", "start": 302, "end": 306, "loc": { "start": { "line": 12, "column": 8 }, "end": { "line": 12, "column": 12 } } }, "property": { "type": "Identifier", "start": 307, "end": 310, "loc": { "start": { "line": 12, "column": 13 }, "end": { "line": 12, "column": 16 }, "identifierName": "url" }, "name": "url" }, "computed": false }, "right": { "type": "LogicalExpression", "start": 313, "end": 328, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 34 } }, "left": { "type": "MemberExpression", "start": 313, "end": 321, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 27 } }, "object": { "type": "ThisExpression", "start": 313, "end": 317, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 23 } } }, "property": { "type": "Identifier", "start": 318, "end": 321, "loc": { "start": { "line": 12, "column": 24 }, "end": { "line": 12, "column": 27 }, "identifierName": "url" }, "name": "url" }, "computed": false }, "operator": "||", "right": { "type": "Identifier", "start": 325, "end": 328, "loc": { "start": { "line": 12, "column": 31 }, "end": { "line": 12, "column": 34 }, "identifierName": "url" }, "name": "url" } } } }, { "type": "ReturnStatement", "start": 338, "end": 579, "loc": { "start": { "line": 13, "column": 8 }, "end": { "line": 19, "column": 11 } }, "argument": { "type": "CallExpression", "start": 345, "end": 578, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 19, "column": 10 } }, "callee": { "type": "MemberExpression", "start": 345, "end": 400, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 70 } }, "object": { "type": "CallExpression", "start": 345, "end": 395, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 65 } }, "callee": { "type": "MemberExpression", "start": 345, "end": 376, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 46 } }, "object": { "type": "CallExpression", "start": 345, "end": 371, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 41 } }, "callee": { "type": "Identifier", "start": 345, "end": 350, "loc": { "start": { "line": 13, "column": 15 }, "end": { "line": 13, "column": 20 }, "identifierName": "fetch" }, "name": "fetch" }, "arguments": [ { "type": "TemplateLiteral", "start": 351, "end": 370, "loc": { "start": { "line": 13, "column": 21 }, "end": { "line": 13, "column": 40 } }, "expressions": [ { "type": "MemberExpression", "start": 354, "end": 362, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 32 } }, "object": { "type": "ThisExpression", "start": 354, "end": 358, "loc": { "start": { "line": 13, "column": 24 }, "end": { "line": 13, "column": 28 } } }, "property": { "type": "Identifier", "start": 359, "end": 362, "loc": { "start": { "line": 13, "column": 29 }, "end": { "line": 13, "column": 32 }, "identifierName": "url" }, "name": "url" }, "computed": false } ], "quasis": [ { "type": "TemplateElement", "start": 352, "end": 352, "loc": { "start": { "line": 13, "column": 22 }, "end": { "line": 13, "column": 22 } }, "value": { "raw": "", "cooked": "" }, "tail": false }, { "type": "TemplateElement", "start": 363, "end": 369, "loc": { "start": { "line": 13, "column": 33 }, "end": { "line": 13, "column": 39 } }, "value": { "raw": "/login", "cooked": "/login" }, "tail": true } ] } ] }, "property": { "type": "Identifier", "start": 372, "end": 376, "loc": { "start": { "line": 13, "column": 42 }, "end": { "line": 13, "column": 46 }, "identifierName": "then" }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 377, "end": 394, "loc": { "start": { "line": 13, "column": 47 }, "end": { "line": 13, "column": 64 } }, "id": null, "generator": false, "expression": true, "async": false, "params": [ { "type": "Identifier", "start": 377, "end": 380, "loc": { "start": { "line": 13, "column": 47 }, "end": { "line": 13, "column": 50 }, "identifierName": "res" }, "name": "res" } ], "body": { "type": "CallExpression", "start": 384, "end": 394, "loc": { "start": { "line": 13, "column": 54 }, "end": { "line": 13, "column": 64 } }, "callee": { "type": "MemberExpression", "start": 384, "end": 392, "loc": { "start": { "line": 13, "column": 54 }, "end": { "line": 13, "column": 62 } }, "object": { "type": "Identifier", "start": 384, "end": 387, "loc": { "start": { "line": 13, "column": 54 }, "end": { "line": 13, "column": 57 }, "identifierName": "res" }, "name": "res" }, "property": { "type": "Identifier", "start": 388, "end": 392, "loc": { "start": { "line": 13, "column": 58 }, "end": { "line": 13, "column": 62 }, "identifierName": "json" }, "name": "json" }, "computed": false }, "arguments": [] } } ] }, "property": { "type": "Identifier", "start": 396, "end": 400, "loc": { "start": { "line": 13, "column": 66 }, "end": { "line": 13, "column": 70 }, "identifierName": "then" }, "name": "then" }, "computed": false }, "arguments": [ { "type": "ArrowFunctionExpression", "start": 401, "end": 577, "loc": { "start": { "line": 13, "column": 71 }, "end": { "line": 19, "column": 9 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 401, "end": 404, "loc": { "start": { "line": 13, "column": 71 }, "end": { "line": 13, "column": 74 }, "identifierName": "res" }, "name": "res" } ], "body": { "type": "BlockStatement", "start": 408, "end": 577, "loc": { "start": { "line": 13, "column": 78 }, "end": { "line": 19, "column": 9 } }, "body": [ { "type": "IfStatement", "start": 422, "end": 567, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 18, "column": 13 } }, "test": { "type": "BinaryExpression", "start": 426, "end": 452, "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 42 } }, "left": { "type": "MemberExpression", "start": 426, "end": 436, "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 26 } }, "object": { "type": "Identifier", "start": 426, "end": 429, "loc": { "start": { "line": 14, "column": 16 }, "end": { "line": 14, "column": 19 }, "identifierName": "res" }, "name": "res" }, "property": { "type": "Identifier", "start": 430, "end": 436, "loc": { "start": { "line": 14, "column": 20 }, "end": { "line": 14, "column": 26 }, "identifierName": "status" }, "name": "status" }, "computed": false }, "operator": "===", "right": { "type": "StringLiteral", "start": 441, "end": 452, "loc": { "start": { "line": 14, "column": 31 }, "end": { "line": 14, "column": 42 } }, "extra": { "rawValue": "permitted", "raw": "'permitted'" }, "value": "permitted" } }, "consequent": { "type": "BlockStatement", "start": 454, "end": 567, "loc": { "start": { "line": 14, "column": 44 }, "end": { "line": 18, "column": 13 } }, "body": [ { "type": "ExpressionStatement", "start": 472, "end": 490, "loc": { "start": { "line": 15, "column": 16 }, "end": { "line": 15, "column": 34 } }, "expression": { "type": "AssignmentExpression", "start": 472, "end": 489, "loc": { "start": { "l