awv3
Version:
AWV client CAD framework
1,485 lines (1,484 loc) • 226 kB
JSON
{
"type": "Program",
"start": 0,
"end": 1898,
"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": 38,
"end": 79,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 41
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 45,
"end": 49,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 11
}
},
"local": {
"type": "Identifier",
"start": 45,
"end": 49,
"loc": {
"start": {
"line": 2,
"column": 7
},
"end": {
"line": 2,
"column": 11
}
},
"name": "Base"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 55,
"end": 78,
"loc": {
"start": {
"line": 2,
"column": 17
},
"end": {
"line": 2,
"column": 40
}
},
"value": "../communication/base",
"rawValue": "../communication/base",
"raw": "'../communication/base'"
}
},
{
"type": "ImportDeclaration",
"start": 81,
"end": 115,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 34
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 88,
"end": 100,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 19
}
},
"local": {
"type": "Identifier",
"start": 88,
"end": 100,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 19
}
},
"name": "EventEmitter"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 106,
"end": 114,
"loc": {
"start": {
"line": 3,
"column": 25
},
"end": {
"line": 3,
"column": 33
}
},
"value": "events",
"rawValue": "events",
"raw": "'events'"
}
},
{
"type": "ImportDeclaration",
"start": 117,
"end": 156,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 39
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 126,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 13
}
},
"imported": {
"type": "Identifier",
"start": 126,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 13
}
},
"name": "guid"
},
"local": {
"type": "Identifier",
"start": 126,
"end": 130,
"loc": {
"start": {
"line": 4,
"column": 9
},
"end": {
"line": 4,
"column": 13
}
},
"name": "guid"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 138,
"end": 155,
"loc": {
"start": {
"line": 4,
"column": 21
},
"end": {
"line": 4,
"column": 38
}
},
"value": "../core/helpers",
"rawValue": "../core/helpers",
"raw": "'../core/helpers'"
}
},
{
"type": "ImportDeclaration",
"start": 158,
"end": 233,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 75
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 167,
"end": 180,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 22
}
},
"imported": {
"type": "Identifier",
"start": 167,
"end": 180,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 22
}
},
"name": "createContext"
},
"local": {
"type": "Identifier",
"start": 167,
"end": 180,
"loc": {
"start": {
"line": 5,
"column": 9
},
"end": {
"line": 5,
"column": 22
}
},
"name": "createContext"
}
},
{
"type": "ImportSpecifier",
"start": 182,
"end": 194,
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 36
}
},
"imported": {
"type": "Identifier",
"start": 182,
"end": 194,
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 36
}
},
"name": "mergeContext"
},
"local": {
"type": "Identifier",
"start": 182,
"end": 194,
"loc": {
"start": {
"line": 5,
"column": 24
},
"end": {
"line": 5,
"column": 36
}
},
"name": "mergeContext"
}
},
{
"type": "ImportSpecifier",
"start": 196,
"end": 208,
"loc": {
"start": {
"line": 5,
"column": 38
},
"end": {
"line": 5,
"column": 50
}
},
"imported": {
"type": "Identifier",
"start": 196,
"end": 208,
"loc": {
"start": {
"line": 5,
"column": 38
},
"end": {
"line": 5,
"column": 50
}
},
"name": "handleResult"
},
"local": {
"type": "Identifier",
"start": 196,
"end": 208,
"loc": {
"start": {
"line": 5,
"column": 38
},
"end": {
"line": 5,
"column": 50
}
},
"name": "handleResult"
}
}
],
"importKind": "value",
"source": {
"type": "Literal",
"start": 216,
"end": 232,
"loc": {
"start": {
"line": 5,
"column": 58
},
"end": {
"line": 5,
"column": 74
}
},
"value": "../core/parser",
"rawValue": "../core/parser",
"raw": "'../core/parser'"
}
},
{
"type": "ExportDefaultDeclaration",
"start": 237,
"end": 1896,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 58,
"column": 1
}
},
"declaration": {
"type": "ClassDeclaration",
"start": 252,
"end": 1896,
"loc": {
"start": {
"line": 7,
"column": 15
},
"end": {
"line": 58,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 258,
"end": 262,
"loc": {
"start": {
"line": 7,
"column": 21
},
"end": {
"line": 7,
"column": 25
}
},
"name": "Rest"
},
"superClass": {
"type": "Identifier",
"start": 271,
"end": 275,
"loc": {
"start": {
"line": 7,
"column": 34
},
"end": {
"line": 7,
"column": 38
}
},
"name": "Base"
},
"body": {
"type": "ClassBody",
"start": 276,
"end": 1896,
"loc": {
"start": {
"line": 7,
"column": 39
},
"end": {
"line": 58,
"column": 1
}
},
"body": [
{
"type": "MethodDefinition",
"start": 283,
"end": 337,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 10,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 283,
"end": 294,
"loc": {
"start": {
"line": 8,
"column": 4
},
"end": {
"line": 8,
"column": 15
}
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"value": {
"type": "FunctionExpression",
"start": 294,
"end": 337,
"loc": {
"start": {
"line": 8,
"column": 15
},
"end": {
"line": 10,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 295,
"end": 302,
"loc": {
"start": {
"line": 8,
"column": 16
},
"end": {
"line": 8,
"column": 23
}
},
"name": "options"
}
],
"body": {
"type": "BlockStatement",
"start": 304,
"end": 337,
"loc": {
"start": {
"line": 8,
"column": 25
},
"end": {
"line": 10,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 315,
"end": 330,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 23
}
},
"expression": {
"type": "CallExpression",
"start": 315,
"end": 329,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 22
}
},
"callee": {
"type": "Super",
"start": 315,
"end": 320,
"loc": {
"start": {
"line": 9,
"column": 8
},
"end": {
"line": 9,
"column": 13
}
}
},
"arguments": [
{
"type": "Identifier",
"start": 321,
"end": 328,
"loc": {
"start": {
"line": 9,
"column": 14
},
"end": {
"line": 9,
"column": 21
}
},
"name": "options"
}
]
}
}
]
}
}
},
{
"type": "MethodDefinition",
"start": 345,
"end": 712,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 23,
"column": 5
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 345,
"end": 352,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 11
}
},
"name": "connect"
},
"static": false,
"kind": "method",
"value": {
"type": "FunctionExpression",
"start": 352,
"end": 712,
"loc": {
"start": {
"line": 12,
"column": 11
},
"end": {
"line": 23,
"column": 5
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 353,
"end": 356,
"loc": {
"start": {
"line": 12,
"column": 12
},
"end": {
"line": 12,
"column": 15
}
},
"name": "url"
}
],
"body": {
"type": "BlockStatement",
"start": 358,
"end": 712,
"loc": {
"start": {
"line": 12,
"column": 17
},
"end": {
"line": 23,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 369,
"end": 396,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 35
}
},
"expression": {
"type": "AssignmentExpression",
"start": 369,
"end": 395,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 34
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 369,
"end": 377,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 16
}
},
"object": {
"type": "ThisExpression",
"start": 369,
"end": 373,
"loc": {
"start": {
"line": 13,
"column": 8
},
"end": {
"line": 13,
"column": 12
}
}
},
"property": {
"type": "Identifier",
"start": 374,
"end": 377,
"loc": {
"start": {
"line": 13,
"column": 13
},
"end": {
"line": 13,
"column": 16
}
},
"name": "url"
},
"computed": false
},
"right": {
"type": "LogicalExpression",
"start": 380,
"end": 395,
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 13,
"column": 34
}
},
"left": {
"type": "MemberExpression",
"start": 380,
"end": 388,
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 13,
"column": 27
}
},
"object": {
"type": "ThisExpression",
"start": 380,
"end": 384,
"loc": {
"start": {
"line": 13,
"column": 19
},
"end": {
"line": 13,
"column": 23
}
}
},
"property": {
"type": "Identifier",
"start": 385,
"end": 388,
"loc": {
"start": {
"line": 13,
"column": 24
},
"end": {
"line": 13,
"column": 27
}
},
"name": "url"
},
"computed": false
},
"operator": "||",
"right": {
"type": "Identifier",
"start": 392,
"end": 395,
"loc": {
"start": {
"line": 13,
"column": 31
},
"end": {
"line": 13,
"column": 34
}
},
"name": "url"
}
}
}
},
{
"type": "ReturnStatement",
"start": 406,
"end": 705,
"loc": {
"start": {
"line": 14,
"column": 8
},
"end": {
"line": 22,
"column": 15
}
},
"argument": {
"type": "CallExpression",
"start": 413,
"end": 704,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 22,
"column": 14
}
},
"callee": {
"type": "MemberExpression",
"start": 413,
"end": 496,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 16,
"column": 17
}
},
"object": {
"type": "CallExpression",
"start": 413,
"end": 477,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 15,
"column": 36
}
},
"callee": {
"type": "MemberExpression",
"start": 413,
"end": 458,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 15,
"column": 17
}
},
"object": {
"type": "CallExpression",
"start": 413,
"end": 439,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 41
}
},
"callee": {
"type": "Identifier",
"start": 413,
"end": 418,
"loc": {
"start": {
"line": 14,
"column": 15
},
"end": {
"line": 14,
"column": 20
}
},
"name": "fetch"
},
"arguments": [
{
"type": "TemplateLiteral",
"start": 419,
"end": 438,
"loc": {
"start": {
"line": 14,
"column": 21
},
"end": {
"line": 14,
"column": 40
}
},
"expressions": [
{
"type": "MemberExpression",
"start": 422,
"end": 430,
"loc": {
"start": {
"line": 14,
"column": 24
},
"end": {
"line": 14,
"column": 32
}
},
"object": {
"type": "ThisExpression",
"start": 422,
"end": 426,
"loc": {
"start": {
"line": 14,
"column": 24
},
"end": {
"line": 14,
"column": 28
}
}
},
"property": {
"type": "Identifier",
"start": 427,
"end": 430,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 32
}
},
"name": "url"
},
"computed": false
}
],
"quasis": [
{
"type": "TemplateElement",
"start": 420,
"end": 420,
"loc": {
"start": {
"line": 14,
"column": 22
},
"end": {
"line": 14,
"column": 22
}
},
"value": {
"raw": "",
"cooked": ""
},
"tail": false
},
{
"type": "TemplateElement",
"start": 431,
"end": 437,
"loc": {
"start": {
"line": 14,
"column": 33
},
"end": {
"line": 14,
"column": 39
}
},
"value": {
"raw": "/login",
"cooked": "/login"
},
"tail": true
}
]
}
]
},
"property": {
"type": "Identifier",
"start": 454,
"end": 458,
"loc": {
"start": {
"line": 15,
"column": 13
},
"end": {
"line": 15,
"column": 17
}
},
"name": "then"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 459,
"end": 476,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 35
}
},
"id": null,
"generator": false,
"expression": true,
"async": false,
"params": [
{
"type": "Identifier",
"start": 459,
"end": 462,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 21
}
},
"name": "res"
}
],
"body": {
"type": "CallExpression",
"start": 466,
"end": 476,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 15,
"column": 35
}
},
"callee": {
"type": "MemberExpression",
"start": 466,
"end": 474,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 15,
"column": 33
}
},
"object": {
"type": "Identifier",
"start": 466,
"end": 469,
"loc": {
"start": {
"line": 15,
"column": 25
},
"end": {
"line": 15,
"column": 28
}
},
"name": "res"
},
"property": {
"type": "Identifier",
"start": 470,
"end": 474,
"loc": {
"start": {
"line": 15,
"column": 29
},
"end": {
"line": 15,
"column": 33
}
},
"name": "json"
},
"computed": false
},
"arguments": []
}
}
]
},
"property": {
"type": "Identifier",
"start": 492,
"end": 496,
"loc": {
"start": {
"line": 16,
"column": 13
},
"end": {
"line": 16,
"column": 17
}
},
"name": "then"
},
"computed": false
},
"arguments": [
{
"type": "ArrowFunctionExpression",
"start": 497,
"end": 703,
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 22,
"column": 13
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 497,
"end": 500,
"loc": {
"start": {
"line": 16,
"column": 18
},
"end": {
"line": 16,
"column": 21
}
},
"name": "res"
}
],
"body": {
"type": "BlockStatement",
"start": 504,
"end": 703,
"loc": {
"start": {
"line": 16,
"column": 25
},
"end": {
"line": 22,
"column": 13
}
},
"body": [
{
"type": "IfStatement",
"start": 523,
"end": 688,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 21,
"column": 17
}
},
"test": {
"type": "BinaryExpression",
"start": 527,
"end": 553,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 46
}
},
"left": {
"type": "MemberExpression",
"start": 527,
"end": 537,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 30
}
},
"object": {
"type": "Identifier",
"start": 527,
"end": 530,
"loc": {
"start": {
"line": 17,
"column": 20
},
"end": {
"line": 17,
"column": 23
}
},
"name": "res"
},
"property": {
"type": "Identifier",
"start": 531,
"end": 537,
"loc": {
"start": {
"line": 17,
"column": 24
},
"end": {
"line": 17,
"column": 30
}
},
"name": "status"
},
"computed": false
},
"operator": "===",
"right": {
"type": "Literal",
"start": 542,
"end": 553,
"loc": {
"start": {
"line": 17,
"column": 35
},
"end": {
"line": 17,
"column": 46
}
},
"value": "permitted",
"rawValue": "permitted",
"raw": "'permitted'"
}
},
"consequent": {
"type": "BlockStatement",
"start": 555,
"end": 688,
"loc": {
"start": {
"line": 17,
"column": 48
},
"end": {
"line": 21,
"column": 17
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 578,
"end": 596,
"loc": {
"start": {
"line": 18,
"column": 20
},
"end": {
"line": 18,
"column": 38
}
},
"expression": {
"type": "AssignmentExpression",
"start": 578,
"end": 595,
"loc": {
"start": {
"line": 18,
"column": 20
},
"end": {
"line": 18,
"column": 37
}
},