sequelize
Version:
Multi dialect ORM for Node.JS/io.js
1,573 lines • 1.27 MB
JSON
{
"type": "File",
"start": 0,
"end": 14671,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 539,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 14671,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 539,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "VariableDeclaration",
"start": 15,
"end": 48,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 33
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 21,
"end": 47,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 32
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 26,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 11
},
"identifierName": "Utils"
},
"name": "Utils"
},
"init": {
"type": "CallExpression",
"start": 29,
"end": 47,
"loc": {
"start": {
"line": 3,
"column": 14
},
"end": {
"line": 3,
"column": 32
}
},
"callee": {
"type": "Identifier",
"start": 29,
"end": 36,
"loc": {
"start": {
"line": 3,
"column": 14
},
"end": {
"line": 3,
"column": 21
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 37,
"end": 46,
"loc": {
"start": {
"line": 3,
"column": 22
},
"end": {
"line": 3,
"column": 31
}
},
"extra": {
"rawValue": "./utils",
"raw": "'./utils'"
},
"value": "./utils"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 49,
"end": 86,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 37
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 55,
"end": 85,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 55,
"end": 62,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 13
},
"identifierName": "Promise"
},
"name": "Promise"
},
"init": {
"type": "CallExpression",
"start": 65,
"end": 85,
"loc": {
"start": {
"line": 4,
"column": 16
},
"end": {
"line": 4,
"column": 36
}
},
"callee": {
"type": "Identifier",
"start": 65,
"end": 72,
"loc": {
"start": {
"line": 4,
"column": 16
},
"end": {
"line": 4,
"column": 23
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 73,
"end": 84,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 35
}
},
"extra": {
"rawValue": "./promise",
"raw": "'./promise'"
},
"value": "./promise"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 87,
"end": 141,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 54
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 93,
"end": 140,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 53
}
},
"id": {
"type": "Identifier",
"start": 93,
"end": 98,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 11
},
"identifierName": "debug"
},
"name": "debug"
},
"init": {
"type": "CallExpression",
"start": 101,
"end": 140,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 53
}
},
"callee": {
"type": "MemberExpression",
"start": 101,
"end": 131,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 44
}
},
"object": {
"type": "CallExpression",
"start": 101,
"end": 118,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 31
}
},
"callee": {
"type": "MemberExpression",
"start": 101,
"end": 116,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 29
}
},
"object": {
"type": "Identifier",
"start": 101,
"end": 106,
"loc": {
"start": {
"line": 5,
"column": 14
},
"end": {
"line": 5,
"column": 19
},
"identifierName": "Utils"
},
"name": "Utils"
},
"property": {
"type": "Identifier",
"start": 107,
"end": 116,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 29
},
"identifierName": "getLogger"
},
"name": "getLogger"
},
"computed": false
},
"arguments": []
},
"property": {
"type": "Identifier",
"start": 119,
"end": 131,
"loc": {
"start": {
"line": 5,
"column": 32
},
"end": {
"line": 5,
"column": 44
},
"identifierName": "debugContext"
},
"name": "debugContext"
},
"computed": false
},
"arguments": [
{
"type": "StringLiteral",
"start": 132,
"end": 139,
"loc": {
"start": {
"line": 5,
"column": 45
},
"end": {
"line": 5,
"column": 52
}
},
"extra": {
"rawValue": "hooks",
"raw": "'hooks'"
},
"value": "hooks"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 143,
"end": 1447,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 46,
"column": 2
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 149,
"end": 1446,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 46,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 149,
"end": 158,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 15
},
"identifierName": "hookTypes"
},
"name": "hookTypes"
},
"init": {
"type": "ObjectExpression",
"start": 161,
"end": 1446,
"loc": {
"start": {
"line": 7,
"column": 18
},
"end": {
"line": 46,
"column": 1
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 165,
"end": 192,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 29
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 165,
"end": 179,
"loc": {
"start": {
"line": 8,
"column": 2
},
"end": {
"line": 8,
"column": 16
},
"identifierName": "beforeValidate"
},
"name": "beforeValidate"
},
"value": {
"type": "ObjectExpression",
"start": 181,
"end": 192,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 29
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 182,
"end": 191,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 28
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 182,
"end": 188,
"loc": {
"start": {
"line": 8,
"column": 19
},
"end": {
"line": 8,
"column": 25
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 190,
"end": 191,
"loc": {
"start": {
"line": 8,
"column": 27
},
"end": {
"line": 8,
"column": 28
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 196,
"end": 222,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 28
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 196,
"end": 209,
"loc": {
"start": {
"line": 9,
"column": 2
},
"end": {
"line": 9,
"column": 15
},
"identifierName": "afterValidate"
},
"name": "afterValidate"
},
"value": {
"type": "ObjectExpression",
"start": 211,
"end": 222,
"loc": {
"start": {
"line": 9,
"column": 17
},
"end": {
"line": 9,
"column": 28
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 212,
"end": 221,
"loc": {
"start": {
"line": 9,
"column": 18
},
"end": {
"line": 9,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 212,
"end": 218,
"loc": {
"start": {
"line": 9,
"column": 18
},
"end": {
"line": 9,
"column": 24
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 220,
"end": 221,
"loc": {
"start": {
"line": 9,
"column": 26
},
"end": {
"line": 9,
"column": 27
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 226,
"end": 255,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 10,
"column": 31
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 226,
"end": 242,
"loc": {
"start": {
"line": 10,
"column": 2
},
"end": {
"line": 10,
"column": 18
},
"identifierName": "validationFailed"
},
"name": "validationFailed"
},
"value": {
"type": "ObjectExpression",
"start": 244,
"end": 255,
"loc": {
"start": {
"line": 10,
"column": 20
},
"end": {
"line": 10,
"column": 31
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 245,
"end": 254,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 30
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 245,
"end": 251,
"loc": {
"start": {
"line": 10,
"column": 21
},
"end": {
"line": 10,
"column": 27
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 253,
"end": 254,
"loc": {
"start": {
"line": 10,
"column": 29
},
"end": {
"line": 10,
"column": 30
}
},
"extra": {
"rawValue": 3,
"raw": "3"
},
"value": 3
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 259,
"end": 284,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 11,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 259,
"end": 271,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 11,
"column": 14
},
"identifierName": "beforeCreate"
},
"name": "beforeCreate"
},
"value": {
"type": "ObjectExpression",
"start": 273,
"end": 284,
"loc": {
"start": {
"line": 11,
"column": 16
},
"end": {
"line": 11,
"column": 27
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 274,
"end": 283,
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 11,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 274,
"end": 280,
"loc": {
"start": {
"line": 11,
"column": 17
},
"end": {
"line": 11,
"column": 23
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 282,
"end": 283,
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 11,
"column": 26
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 288,
"end": 312,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 12,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 288,
"end": 299,
"loc": {
"start": {
"line": 12,
"column": 2
},
"end": {
"line": 12,
"column": 13
},
"identifierName": "afterCreate"
},
"name": "afterCreate"
},
"value": {
"type": "ObjectExpression",
"start": 301,
"end": 312,
"loc": {
"start": {
"line": 12,
"column": 15
},
"end": {
"line": 12,
"column": 26
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 302,
"end": 311,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 25
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 302,
"end": 308,
"loc": {
"start": {
"line": 12,
"column": 16
},
"end": {
"line": 12,
"column": 22
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 310,
"end": 311,
"loc": {
"start": {
"line": 12,
"column": 24
},
"end": {
"line": 12,
"column": 25
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 316,
"end": 342,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 13,
"column": 28
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 316,
"end": 329,
"loc": {
"start": {
"line": 13,
"column": 2
},
"end": {
"line": 13,
"column": 15
},
"identifierName": "beforeDestroy"
},
"name": "beforeDestroy"
},
"value": {
"type": "ObjectExpression",
"start": 331,
"end": 342,
"loc": {
"start": {
"line": 13,
"column": 17
},
"end": {
"line": 13,
"column": 28
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 332,
"end": 341,
"loc": {
"start": {
"line": 13,
"column": 18
},
"end": {
"line": 13,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 332,
"end": 338,
"loc": {
"start": {
"line": 13,
"column": 18
},
"end": {
"line": 13,
"column": 24
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 340,
"end": 341,
"loc": {
"start": {
"line": 13,
"column": 26
},
"end": {
"line": 13,
"column": 27
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 346,
"end": 371,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 14,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 346,
"end": 358,
"loc": {
"start": {
"line": 14,
"column": 2
},
"end": {
"line": 14,
"column": 14
},
"identifierName": "afterDestroy"
},
"name": "afterDestroy"
},
"value": {
"type": "ObjectExpression",
"start": 360,
"end": 371,
"loc": {
"start": {
"line": 14,
"column": 16
},
"end": {
"line": 14,
"column": 27
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 361,
"end": 370,
"loc": {
"start": {
"line": 14,
"column": 17
},
"end": {
"line": 14,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 361,
"end": 367,
"loc": {
"start": {
"line": 14,
"column": 17
},
"end": {
"line": 14,
"column": 23
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 369,
"end": 370,
"loc": {
"start": {
"line": 14,
"column": 25
},
"end": {
"line": 14,
"column": 26
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 375,
"end": 401,
"loc": {
"start": {
"line": 15,
"column": 2
},
"end": {
"line": 15,
"column": 28
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 375,
"end": 388,
"loc": {
"start": {
"line": 15,
"column": 2
},
"end": {
"line": 15,
"column": 15
},
"identifierName": "beforeRestore"
},
"name": "beforeRestore"
},
"value": {
"type": "ObjectExpression",
"start": 390,
"end": 401,
"loc": {
"start": {
"line": 15,
"column": 17
},
"end": {
"line": 15,
"column": 28
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 391,
"end": 400,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 391,
"end": 397,
"loc": {
"start": {
"line": 15,
"column": 18
},
"end": {
"line": 15,
"column": 24
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 399,
"end": 400,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 15,
"column": 27
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 405,
"end": 430,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 405,
"end": 417,
"loc": {
"start": {
"line": 16,
"column": 2
},
"end": {
"line": 16,
"column": 14
},
"identifierName": "afterRestore"
},
"name": "afterRestore"
},
"value": {
"type": "ObjectExpression",
"start": 419,
"end": 430,
"loc": {
"start": {
"line": 16,
"column": 16
},
"end": {
"line": 16,
"column": 27
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 420,
"end": 429,
"loc": {
"start": {
"line": 16,
"column": 17
},
"end": {
"line": 16,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 420,
"end": 426,
"loc": {
"start": {
"line": 16,
"column": 17
},
"end": {
"line": 16,
"column": 23
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 428,
"end": 429,
"loc": {
"start": {
"line": 16,
"column": 25
},
"end": {
"line": 16,
"column": 26
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 434,
"end": 459,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 27
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 434,
"end": 446,
"loc": {
"start": {
"line": 17,
"column": 2
},
"end": {
"line": 17,
"column": 14
},
"identifierName": "beforeUpdate"
},
"name": "beforeUpdate"
},
"value": {
"type": "ObjectExpression",
"start": 448,
"end": 459,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 17,
"column": 27
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 449,
"end": 458,
"loc": {
"start": {
"line": 17,
"column": 17
},
"end": {
"line": 17,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 449,
"end": 455,
"loc": {
"start": {
"line": 17,
"column": 17
},
"end": {
"line": 17,
"column": 23
},
"identifierName": "params"
},
"name": "params"
},
"value": {
"type": "NumericLiteral",
"start": 457,
"end": 458,
"loc": {
"start": {
"line": 17,
"column": 25
},
"end": {
"line": 17,
"column": 26
}
},
"extra": {
"rawValue": 2,
"raw": "2"
},
"value": 2
}
}
]
}
},
{
"type": "ObjectProperty",
"start": 463,
"end": 487,
"loc": {
"start": {
"line": 18,
"column": 2
},
"end": {
"line": 18,
"column": 26
}
},
"method": false,
"shorthand": false,
"computed": false,
"key":