awv3
Version:
⚡ AWV3 embedded CAD
1,415 lines (1,414 loc) • 413 kB
JSON
{
"type": "File",
"start": 0,
"end": 1785,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 58,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1785,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 58,
"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": 1784,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 57,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 191,
"end": 1784,
"loc": {
"start": {
"line": 6,
"column": 15
},
"end": {
"line": 57,
"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": 1784,
"loc": {
"start": {
"line": 6,
"column": 39
},
"end": {
"line": 57,
"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": 635,
"loc": {
"start": {
"line": 11,
"column": 4
},
"end": {
"line": 22,
"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": 635,
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 22,
"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": 629,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 21,
"column": 15
}
},
"argument": {
"type": "CallExpression",
"start": 345,
"end": 628,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 21,
"column": 14
}
},
"callee": {
"type": "MemberExpression",
"start": 345,
"end": 426,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 15,
"column": 17
}
},
"object": {
"type": "CallExpression",
"start": 345,
"end": 408,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 14,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 345,
"end": 389,
"loc": {
"start": {
"line": 13,
"column": 15
},
"end": {
"line": 14,
"column": 17
}
},
"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": 385,
"end": 389,
"loc": {
"start": {
"line": 14,
"column": 13
},
"end": {
"line": 14,
"column": 17
},
"identifierName": "then"
},
"name": "then"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 390,
"end": 407,
"loc": {
"start": {
"line": 14,
"column": 18
},
"end": {
"line": 14,
"column": 35
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 390,
"end": 393,
"loc": {
"start": {
"line": 14,
"column": 18
},
"end": {
"line": 14,
"column": 21
},
"identifierName": "res"
},
"name": "res"
}
],
"body": {
"type": "CallExpression",
"start": 397,
"end": 407,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 397,
"end": 405,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 33
}
},
"object": {
"type": "Identifier",
"start": 397,
"end": 400,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 28
},
"identifierName": "res"
},
"name": "res"
},
"property": {
"type": "Identifier",
"start": 401,
"end": 405,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 33
},
"identifierName": "json"
},
"name": "json"
},
"computed": false
},
"arguments": []
}
}
]
},
"property": {
"type": "Identifier",
"start": 422,
"end": 426,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 17
},
"identifierName": "then"
},
"name": "then"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 427,
"end": 627,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 21,
"column": 13
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 427,
"end": 430,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 21
},
"identifierName": "res"
},
"name": "res"
}
],
"body": {
"type": "BlockStatement",
"start": 434,
"end": 627,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 21,
"column": 13
}
},
"body": [
{
"type": "IfStatement",
"start": 452,
"end": 613,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 20,
"column": 17
}
},
"test": {
"type": "BinaryExpression",
"start": 456,
"end": 482,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 46
}
},
"left": {
"type": "MemberExpression",
"start": 456,
"end": 466,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 456,
"end": 459,
"loc": {
"start": {
"line": 16,
"column": 20
},
"end": {
"line": 16,
"column": 23
},
"identifierName": "res"
},
"name": "res"
},
"property": {
"type": "Identifier",
"start": 460,
"end": 466,
"loc": {
"start": {
"line": 16,
"column": 24
},
"end": {
"line": 16,
"column": 30
},
"identifierName": "status"
},
"name": "status"
},
"computed": false
},
"operator": "===",
"right": {
"type": "StringLiteral",
"start": 471,
"end": 482,
"loc": {
"start": {
"line": 16,
"column": 35
},
"end": {
"line": 16,
"column": 46
}
},
"extra": {
"rawValue": "permitted",
"raw": "'permitted'"
},
"value": "permitted"
}
},
"consequent": {
"type": "BlockStatement",
"start": 484,
"end": 613,
"loc": {
"start": {
"line": 16,
"column": 48
},
"end": {
"line": 20,
"column": 17
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 506,
"end": 524,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 38
}
},
"expression": {
"type": "AssignmentExpression",
"start": 506,
"end": 523,
"loc": {
"start": {