@xailabs/altx
Version:
Flux flavor based on alt.js
1,745 lines (1,744 loc) • 169 kB
JSON
{
"type": "File",
"start": 0,
"end": 1134,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 45,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1134,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 45,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "ImportDeclaration",
"start": 0,
"end": 34,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 1,
"column": 34
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 7,
"end": 16,
"loc": {
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 16
},
"identifierName": "Immutable"
},
"name": "Immutable"
}
}
],
"source": {
"type": "StringLiteral",
"start": 22,
"end": 33,
"loc": {
"start": {
"line": 1,
"column": 22
},
"end": {
"line": 1,
"column": 33
}
},
"extra": {
"rawValue": "immutable",
"raw": "'immutable'"
},
"value": "immutable"
}
},
{
"type": "ImportDeclaration",
"start": 36,
"end": 106,
"loc": {
"start": {
"line": 2,
"column": 0
},
"end": {
"line": 2,
"column": 70
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 45,
"end": 53,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
}
},
"imported": {
"type": "Identifier",
"start": 45,
"end": 53,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
},
"identifierName": "decorate"
},
"name": "decorate"
},
"local": {
"type": "Identifier",
"start": 45,
"end": 53,
"loc": {
"start": {
"line": 2,
"column": 9
},
"end": {
"line": 2,
"column": 17
},
"identifierName": "decorate"
},
"name": "decorate"
}
},
{
"type": "ImportSpecifier",
"start": 55,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 29
}
},
"imported": {
"type": "Identifier",
"start": 55,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 29
},
"identifierName": "datasource"
},
"name": "datasource"
},
"local": {
"type": "Identifier",
"start": 55,
"end": 65,
"loc": {
"start": {
"line": 2,
"column": 19
},
"end": {
"line": 2,
"column": 29
},
"identifierName": "datasource"
},
"name": "datasource"
}
},
{
"type": "ImportSpecifier",
"start": 67,
"end": 71,
"loc": {
"start": {
"line": 2,
"column": 31
},
"end": {
"line": 2,
"column": 35
}
},
"imported": {
"type": "Identifier",
"start": 67,
"end": 71,
"loc": {
"start": {
"line": 2,
"column": 31
},
"end": {
"line": 2,
"column": 35
},
"identifierName": "bind"
},
"name": "bind"
},
"local": {
"type": "Identifier",
"start": 67,
"end": 71,
"loc": {
"start": {
"line": 2,
"column": 31
},
"end": {
"line": 2,
"column": 35
},
"identifierName": "bind"
},
"name": "bind"
}
}
],
"source": {
"type": "StringLiteral",
"start": 79,
"end": 105,
"loc": {
"start": {
"line": 2,
"column": 43
},
"end": {
"line": 2,
"column": 69
}
},
"extra": {
"rawValue": "alt-utils/lib/decorators",
"raw": "'alt-utils/lib/decorators'"
},
"value": "alt-utils/lib/decorators"
}
},
{
"type": "ImportDeclaration",
"start": 108,
"end": 160,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 52
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 115,
"end": 124,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 115,
"end": 124,
"loc": {
"start": {
"line": 3,
"column": 7
},
"end": {
"line": 3,
"column": 16
},
"identifierName": "immutable"
},
"name": "immutable"
}
}
],
"source": {
"type": "StringLiteral",
"start": 130,
"end": 159,
"loc": {
"start": {
"line": 3,
"column": 22
},
"end": {
"line": 3,
"column": 51
}
},
"extra": {
"rawValue": "alt-utils/lib/ImmutableUtil",
"raw": "'alt-utils/lib/ImmutableUtil'"
},
"value": "alt-utils/lib/ImmutableUtil"
}
},
{
"type": "ImportDeclaration",
"start": 164,
"end": 209,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 45
}
},
"specifiers": [
{
"type": "ImportSpecifier",
"start": 172,
"end": 186,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 22
}
},
"imported": {
"type": "Identifier",
"start": 172,
"end": 186,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 22
},
"identifierName": "getAltInstance"
},
"name": "getAltInstance"
},
"local": {
"type": "Identifier",
"start": 172,
"end": 186,
"loc": {
"start": {
"line": 5,
"column": 8
},
"end": {
"line": 5,
"column": 22
},
"identifierName": "getAltInstance"
},
"name": "getAltInstance"
}
}
],
"source": {
"type": "StringLiteral",
"start": 193,
"end": 208,
"loc": {
"start": {
"line": 5,
"column": 29
},
"end": {
"line": 5,
"column": 44
}
},
"extra": {
"rawValue": "./altInstance",
"raw": "'./altInstance'"
},
"value": "./altInstance"
}
},
{
"type": "ImportDeclaration",
"start": 211,
"end": 257,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 46
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 218,
"end": 232,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 21
}
},
"local": {
"type": "Identifier",
"start": 218,
"end": 232,
"loc": {
"start": {
"line": 6,
"column": 7
},
"end": {
"line": 6,
"column": 21
},
"identifierName": "ImmutableStore"
},
"name": "ImmutableStore"
}
}
],
"source": {
"type": "StringLiteral",
"start": 238,
"end": 256,
"loc": {
"start": {
"line": 6,
"column": 27
},
"end": {
"line": 6,
"column": 45
}
},
"extra": {
"rawValue": "./ImmutableStore",
"raw": "'./ImmutableStore'"
},
"value": "./ImmutableStore"
}
},
{
"type": "ImportDeclaration",
"start": 259,
"end": 297,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 38
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 266,
"end": 276,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 17
}
},
"local": {
"type": "Identifier",
"start": 266,
"end": 276,
"loc": {
"start": {
"line": 7,
"column": 7
},
"end": {
"line": 7,
"column": 17
},
"identifierName": "getSources"
},
"name": "getSources"
}
}
],
"source": {
"type": "StringLiteral",
"start": 282,
"end": 296,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 37
}
},
"extra": {
"rawValue": "./getSources",
"raw": "'./getSources'"
},
"value": "./getSources"
}
},
{
"type": "ImportDeclaration",
"start": 301,
"end": 348,
"loc": {
"start": {
"line": 9,
"column": 0
},
"end": {
"line": 9,
"column": 47
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 308,
"end": 317,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 16
}
},
"local": {
"type": "Identifier",
"start": 308,
"end": 317,
"loc": {
"start": {
"line": 9,
"column": 7
},
"end": {
"line": 9,
"column": 16
},
"identifierName": "bindCalls"
},
"name": "bindCalls"
}
}
],
"source": {
"type": "StringLiteral",
"start": 323,
"end": 347,
"loc": {
"start": {
"line": 9,
"column": 22
},
"end": {
"line": 9,
"column": 46
}
},
"extra": {
"rawValue": "./decorators/bindCalls",
"raw": "'./decorators/bindCalls'"
},
"value": "./decorators/bindCalls"
}
},
{
"type": "ImportDeclaration",
"start": 350,
"end": 401,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 10,
"column": 51
}
},
"specifiers": [
{
"type": "ImportDefaultSpecifier",
"start": 357,
"end": 368,
"loc": {
"start": {
"line": 10,
"column": 7
},
"end": {
"line": 10,
"column": 18
}
},
"local": {
"type": "Identifier",
"start": 357,
"end": 368,
"loc": {
"start": {
"line": 10,
"column": 7
},
"end": {
"line": 10,
"column": 18
},
"identifierName": "bindActions"
},
"name": "bindActions"
}
}
],
"source": {
"type": "StringLiteral",
"start": 374,
"end": 400,
"loc": {
"start": {
"line": 10,
"column": 24
},
"end": {
"line": 10,
"column": 50
}
},
"extra": {
"rawValue": "./decorators/bindActions",
"raw": "'./decorators/bindActions'"
},
"value": "./decorators/bindActions"
}
},
{
"type": "ExportDefaultDeclaration",
"start": 405,
"end": 1132,
"loc": {
"start": {
"line": 12,
"column": 0
},
"end": {
"line": 44,
"column": 1
}
},
"declaration": {
"type": "FunctionDeclaration",
"start": 420,
"end": 1132,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 44,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 429,
"end": 440,
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 35
},
"identifierName": "createStore"
},
"name": "createStore"
},
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 441,
"end": 452,
"loc": {
"start": {
"line": 12,
"column": 36
},
"end": {
"line": 12,
"column": 47
},
"identifierName": "displayName"
},
"name": "displayName"
},
{
"type": "AssignmentPattern",
"start": 454,
"end": 528,
"loc": {
"start": {
"line": 12,
"column": 49
},
"end": {
"line": 18,
"column": 6
}
},
"left": {
"type": "ObjectPattern",
"start": 454,
"end": 523,
"loc": {
"start": {
"line": 12,
"column": 49
},
"end": {
"line": 18,
"column": 1
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 461,
"end": 464,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 7
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 461,
"end": 464,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 7
},
"identifierName": "alt"
},
"name": "alt"
},
"value": {
"type": "Identifier",
"start": 461,
"end": 464,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 7
},
"identifierName": "alt"
},
"name": "alt"
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 471,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 9
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 471,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 9
},
"identifierName": "state"
},
"name": "state"
},
"value": {
"type": "Identifier",
"start": 471,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 9
},
"identifierName": "state"
},
"name": "state"
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 483,
"end": 488,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 9
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 483,
"end": 488,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 9
},
"identifierName": "calls"
},
"name": "calls"
},
"value": {
"type": "Identifier",
"start": 483,
"end": 488,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 9
},
"identifierName": "calls"
},
"name": "calls"
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 495,
"end": 502,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 11
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 495,
"end": 502,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 11
},
"identifierName": "sources"
},
"name": "sources"
},
"value": {
"type": "Identifier",
"start": 495,
"end": 502,
"loc": {
"start": {
"line": 16,
"column": 4
},
"end": {
"line": 16,
"column": 11
},
"identifierName": "sources"
},
"name": "sources"
},
"extra": {
"shorthand": true
}
},
{
"type": "ObjectProperty",
"start": 509,
"end": 520,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 15
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 509,
"end": 520,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 15
},
"identifierName": "viewActions"
},
"name": "viewActions"
},
"value": {
"type": "Identifier",
"start": 509,
"end": 520,
"loc": {
"start": {
"line": 17,
"column": 4
},
"end": {
"line": 17,
"column": 15
},
"identifierName": "viewActions"
},
"name": "viewActions"
},
"extra": {
"shorthand": true
}
}
]
},
"right": {
"type": "ObjectExpression",
"start": 526,
"end": 528,
"loc": {
"start": {
"line": 18,
"column": 4
},
"end": {
"line": 18,
"column": 6
}
},
"properties": []
}
}
],
"body": {
"type": "BlockStatement",
"start": 530,
"end": 1132,
"loc": {
"start": {
"line": 18,
"column": 8
},
"end": {
"line": 44,
"column": 1
}
},
"body": [
{
"type": "IfStatement",
"start": 539,
"end": 618,
"loc": {
"start": {
"line": 20,
"column": 4
},
"end": {
"line": 22,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 543,
"end": 555,
"loc": {
"start": {
"line": 20,
"column": 8
},
"end": {
"line": 20,
"column": 20
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 544,
"end": 555,
"loc": {
"start": {
"line": 20,
"column": 9
},
"end": {
"line": 20,
"column": 20
},
"identifierName": "displayName"
},
"name": "displayName"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 557,
"end": 618,
"loc": {
"start": {
"line": 20,
"column": 22
},
"end": {
"line": 22,
"column": 5
}
},
"body": [
{
"type": "ThrowStatement",
"start": 568,
"end": 611,
"loc": {
"start": {
"line": 21,
"column": 8
},
"end": {
"line": 21,
"column": 51
}
},
"argument": {
"type": "NewExpression",
"start": 574,
"end": 610,
"loc": {
"start": {
"line": 21,
"column": 14
},
"end": {
"line": 21,
"column": 50
}
},
"callee": {
"type": "Identifier",
"start": 578,
"end": 583,
"loc": {
"start": {
"line": 21,
"column": 18
},
"end": {
"line": 21,
"column": 23
},
"identifierName": "Error"
},
"name": "Error"
},
"arguments": [
{
"type": "StringLiteral",
"start": 584,
"end": 609,
"loc": {
"start": {
"line": 21,
"column": 24
},
"end": {
"line": 21,
"column": 49
}
},
"extra": {
"rawValue": "displayName is required",
"raw": "'displayName is required'"
},
"value": "displayName is required"
}
]
}
}
],
"directives": []
},
"alternate": null
},
{
"type": "ExpressionStatement",
"start": 626,
"end": 656,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 34
}
},
"expression": {
"type": "AssignmentExpression",
"start": 626,
"end": 655,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 33
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 626,
"end": 629,
"loc": {
"start": {
"line": 24,
"column": 4
},
"end": {
"line": 24,
"column": 7
},
"identifierName": "alt"
},
"name": "alt"
},
"right": {
"type": "LogicalExpression",
"start": 632,
"end": 655,
"loc": {
"start": {
"line": 24,
"column": 10
},
"end": {
"line": 24,
"column": 33
}
},
"left": {
"type": "Identifier",
"start": 632,
"end": 635,
"loc": {
"start": {
"line": 24,
"column": 10
},
"end": {
"line": 24,
"column": 13
},
"identifierName": "alt"
},
"name": "alt"
},
"operator": "||",
"right": {
"type": "CallExpression",
"start": 639,
"end": 655,
"loc": {
"start": {
"line": 24,
"column": 17
},
"end": {
"line": 24,
"column": 33
}
},
"callee": {
"type": "Identifier",
"start": 639,
"end": 653,
"loc": {
"start": {
"line": 24,
"column": 17
},
"end": {
"line": 24,
"column": 31
},
"identifierName": "getAltInstance"
},
"name": "getAltInstance"
},
"arguments": []
}
}
}
},
{
"type": "ExpressionStatement",
"start": 662,
"end": 700,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 42
}
},
"expression": {
"type": "AssignmentExpression",
"start": 662,
"end": 699,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 41
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 662,
"end": 667,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 25,
"column": 9
},
"identifierName": "state"
},
"name": "state"
},
"right": {
"type": "LogicalExpression",
"start": 670,
"end": 699,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 41
}
},
"left": {
"type": "Identifier",
"start": 670,
"end": 675,
"loc": {
"start": {
"line": 25,
"column": 12
},
"end": {
"line": 25,
"column": 17
},
"identifierName": "state"
},
"name": "state"
},
"operator": "||",
"right": {
"type": "CallExpression",
"start": 679,
"end": 699,
"loc": {
"start": {
"line": 25,
"column": 21
},
"end": {
"line": 25,
"column": 41
}
},
"callee": {
"type": "MemberExpression",
"start": 679,
"end": 695,
"loc": {
"start": {
"line": 25,
"column": 21
},
"end": {
"line": 25,
"column": 37
}
},
"object": {
"type": "Identifier",
"start": 679,
"end": 688,
"loc": {
"start": {
"line": 25,
"column": 21
},
"end": {
"line": 25,
"column": 30
},
"identifierName": "Immutable"
},
"name": "Immutable"
},
"property": {
"type": "Identifier",
"start": 689,
"end": 695,
"loc": {
"start": {
"line": 25,
"column": 31
},
"end": {
"line": 25,
"column": 37
},
"identifierName": "fromJS"
},
"name": "fromJS"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 696,
"end": 698,
"loc": {
"start": {
"line": 25,
"column": 38
},
"end": {
"line": 25,
"column": 40
}
},
"properties": []
}
]
}
}
}
},
{
"type": "ExpressionStatement",
"start": 708,
"end": 728,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 24
}
},
"expression": {
"type": "AssignmentExpression",
"start": 708,
"end": 727,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 23
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 708,
"end": 713,
"loc": {
"start": {
"line": 27,
"column": 4
},
"end": {
"line": 27,
"column": 9
},
"identifierName": "calls"
},
"name": "calls"
},
"right": {
"type": "LogicalExpression",
"start": 716,
"end": 727,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 23
}
},
"left": {
"type": "Identifier",
"start": 716,
"end": 721,
"loc": {
"start": {
"line": 27,
"column": 12
},
"end": {
"line": 27,
"column": 17
},
"identifierName": "calls"
},
"name": "calls"
},
"operator": "||",
"right": {
"type": "ArrayExpression",
"start": 725,
"end": 727,
"loc": {
"start": {
"line": 27,
"column": 21
},
"end": {
"line": 27,
"column": 23
}
},
"elements": []
}
}
}
},
{
"type": "ExpressionStatement",
"start": 734,
"end": 773,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 43
}
},
"expression": {
"type": "AssignmentExpression",
"start": 734,
"end": 772,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 42
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 734,
"end": 741,
"loc": {
"start": {
"line": 28,
"column": 4
},
"end": {
"line": 28,
"column": 11
},
"identifierName": "sources"
},
"name": "sources"
},
"right": {
"type": "LogicalExpression",
"start": 744,
"end": 772,
"loc": {
"start": {
"line": 28,
"column": 14
},
"end": {
"line": 28,
"column": 42
}
},
"left": {
"type": "Identifier",
"start": 744,
"end": 751,
"loc": {
"start": {
"line": 28,
"column": 14
},
"end": {
"line": 28,
"column": 21
},
"identifierName": "sources"
},
"name": "sources"
},
"operator": "||",
"right": {
"type": "CallExpression",
"start": 755,
"end": 772,
"loc": {
"start": {
"line": 28,
"column": 25
},
"end": {
"line": 28,
"column": 42
}
},
"callee": {
"type": "Identifier",
"start": 755,
"end": 765,
"loc": {
"start": {
"line": 28,
"column": 25
},
"end": {
"line": 28,
"column": 35
},
"identifierName": "getSources"
},
"name": "getSources"
},
"arguments": [