@dbml/core 2.2.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/lib/export/DbmlExporter.js +15 -4
  2. package/lib/export/JsonExporter.js +1 -3
  3. package/lib/export/ModelExporter.js +1 -3
  4. package/lib/export/MysqlExporter.js +50 -42
  5. package/lib/export/PostgresExporter.js +64 -49
  6. package/lib/export/SqlServerExporter.js +52 -46
  7. package/lib/model_structure/database.js +73 -28
  8. package/lib/model_structure/dbState.js +1 -3
  9. package/lib/model_structure/element.js +13 -13
  10. package/lib/model_structure/endpoint.js +18 -14
  11. package/lib/model_structure/enum.js +18 -14
  12. package/lib/model_structure/enumValue.js +16 -12
  13. package/lib/model_structure/field.js +47 -13
  14. package/lib/model_structure/indexColumn.js +16 -12
  15. package/lib/model_structure/indexes.js +18 -14
  16. package/lib/model_structure/ref.js +19 -16
  17. package/lib/model_structure/schema.js +24 -36
  18. package/lib/model_structure/table.js +19 -15
  19. package/lib/model_structure/tableGroup.js +18 -14
  20. package/lib/model_structure/utils.js +5 -0
  21. package/lib/parse/Parser.js +2 -4
  22. package/lib/parse/buildParser.js +1 -3
  23. package/lib/parse/dbml/parser.pegjs +64 -20
  24. package/lib/parse/dbmlParser.js +1401 -899
  25. package/lib/parse/mssql/constraint_definition/actions.js +2 -2
  26. package/lib/parse/mssql/fk_definition/actions.js +10 -3
  27. package/lib/parse/mssql/keyword_parsers.js +0 -1
  28. package/lib/parse/mssql/statements/actions.js +9 -6
  29. package/lib/parse/mssql/statements/statement_types/alter_table/actions.js +11 -5
  30. package/lib/parse/mssql/statements/statement_types/create_index/actions.js +6 -1
  31. package/lib/parse/mssql/statements/statement_types/create_table/actions.js +12 -10
  32. package/lib/parse/mssql/utils.js +16 -1
  33. package/lib/parse/mysql/parser.pegjs +57 -34
  34. package/lib/parse/mysqlParser.js +270 -218
  35. package/lib/parse/postgresParser.js +12 -10
  36. package/lib/parse/postgresql/Base_rules.pegjs +45 -10
  37. package/lib/parse/postgresql/Commands/Alter_table/Alter_table.pegjs +2 -1
  38. package/lib/parse/postgresql/Commands/Create_table/Create_table_normal.pegjs +5 -3
  39. package/lib/parse/postgresql/Commands/Create_table/Create_table_of.pegjs +1 -1
  40. package/lib/parse/postgresql/Commands/Create_table/Create_table_partition_of.pegjs +1 -1
  41. package/lib/parse/postgresql/Commands/Create_type/Create_type_enum.pegjs +2 -2
  42. package/lib/parse/postgresql/InitializerUtils.pegjs +10 -0
  43. package/lib/parse/postgresql/parser.pegjs +2 -1
  44. package/lib/parse/schemarbParser.js +3 -3
  45. package/package.json +5 -3
  46. package/types/export/ModelExporter.d.ts +5 -0
  47. package/types/export/index.d.ts +5 -0
  48. package/types/import/index.d.ts +5 -0
  49. package/types/index.d.ts +5 -0
  50. package/types/model_structure/database.d.ts +195 -0
  51. package/types/model_structure/dbState.d.ts +14 -0
  52. package/types/model_structure/element.d.ts +21 -0
  53. package/types/model_structure/endpoint.d.ts +55 -0
  54. package/types/model_structure/enum.d.ts +67 -0
  55. package/types/model_structure/enumValue.d.ts +39 -0
  56. package/types/model_structure/field.d.ts +77 -0
  57. package/types/model_structure/indexColumn.d.ts +37 -0
  58. package/types/model_structure/indexes.d.ts +74 -0
  59. package/types/model_structure/ref.d.ts +66 -0
  60. package/types/model_structure/schema.d.ts +188 -0
  61. package/types/model_structure/table.d.ts +118 -0
  62. package/types/model_structure/tableGroup.d.ts +54 -0
  63. package/types/parse/Parser.d.ts +11 -0
  64. package/lib/export/Exporter.js +0 -80
  65. package/lib/export/SchemaExporter.js +0 -99
  66. package/lib/parse/dbml/multiline_content.txt +0 -7
  67. package/lib/parse/dbml/multiline_string.pegjs +0 -17
  68. package/lib/parse/dbml/parser1.json +0 -219
  69. package/lib/parse/dbml/parser1.pegjs +0 -702
  70. package/lib/parse/dbml/parser1_content.txt +0 -29
  71. package/lib/parse/dbml/test_multiline.js +0 -53
  72. package/lib/parse/dbml/test_parser1.js +0 -16
  73. package/lib/parse/mssql/base_utils.js +0 -28
  74. package/lib/parse/mssql/composite_parsers.js +0 -109
  75. package/lib/parse/mssql/statement_types/alter_table/actions.js +0 -29
  76. package/lib/parse/mssql/statement_types/alter_table/add/actions.js +0 -8
  77. package/lib/parse/mssql/statement_types/alter_table/add/index.js +0 -58
  78. package/lib/parse/mssql/statement_types/alter_table/index.js +0 -32
  79. package/lib/parse/mssql/statement_types/create_index/actions.js +0 -25
  80. package/lib/parse/mssql/statement_types/create_index/index.js +0 -50
  81. package/lib/parse/mssql/statement_types/create_table/actions.js +0 -95
  82. package/lib/parse/mssql/statement_types/create_table/index.js +0 -50
  83. package/lib/parse/mssql/statement_types/index.js +0 -13
  84. package/lib/schema/element.js +0 -84
  85. package/lib/schema/endpoint.js +0 -102
  86. package/lib/schema/enum.js +0 -102
  87. package/lib/schema/enumValue.js +0 -70
  88. package/lib/schema/field.js +0 -104
  89. package/lib/schema/indexes.js +0 -74
  90. package/lib/schema/ref.js +0 -93
  91. package/lib/schema/schema.js +0 -245
  92. package/lib/schema/table.js +0 -163
  93. package/lib/schema/tableGroup.js +0 -93
@@ -11,7 +11,7 @@ var _schema = _interopRequireDefault(require("./schema"));
11
11
 
12
12
  var _ref2 = _interopRequireDefault(require("./ref"));
13
13
 
14
- var _enum = _interopRequireDefault(require("./enum"));
14
+ var _enum2 = _interopRequireDefault(require("./enum"));
15
15
 
16
16
  var _tableGroup = _interopRequireDefault(require("./tableGroup"));
17
17
 
@@ -25,11 +25,11 @@ var _dbState = _interopRequireDefault(require("./dbState"));
25
25
 
26
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
27
27
 
28
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
28
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
29
29
 
30
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
31
31
 
32
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
32
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
33
33
 
34
34
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
35
35
 
@@ -39,21 +39,25 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
39
39
 
40
40
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
41
41
 
42
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
43
+
44
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
45
+
46
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
47
+
42
48
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
43
49
 
44
50
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
51
 
46
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
47
-
48
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
52
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
49
53
 
50
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
54
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
51
55
 
52
- var Database =
53
- /*#__PURE__*/
54
- function (_Element) {
56
+ var Database = /*#__PURE__*/function (_Element) {
55
57
  _inherits(Database, _Element);
56
58
 
59
+ var _super = _createSuper(Database);
60
+
57
61
  function Database(_ref) {
58
62
  var _this;
59
63
 
@@ -68,11 +72,13 @@ function (_Element) {
68
72
  _ref$tableGroups = _ref.tableGroups,
69
73
  tableGroups = _ref$tableGroups === void 0 ? [] : _ref$tableGroups,
70
74
  _ref$project = _ref.project,
71
- project = _ref$project === void 0 ? {} : _ref$project;
75
+ project = _ref$project === void 0 ? {} : _ref$project,
76
+ _ref$aliases = _ref.aliases,
77
+ aliases = _ref$aliases === void 0 ? [] : _ref$aliases;
72
78
 
73
79
  _classCallCheck(this, Database);
74
80
 
75
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Database).call(this));
81
+ _this = _super.call(this);
76
82
  _this.dbState = new _dbState["default"]();
77
83
 
78
84
  _this.generateId();
@@ -81,16 +87,17 @@ function (_Element) {
81
87
  _this.schemas = [];
82
88
  _this.note = project.note;
83
89
  _this.databaseType = project.database_type;
84
- _this.name = project.name; // The process order is important. Do not change !
90
+ _this.name = project.name;
91
+ _this.aliases = aliases; // The process order is important. Do not change !
85
92
 
86
93
  _this.processSchemas(schemas);
87
94
 
95
+ _this.processSchemaElements(enums, _config.ENUM);
96
+
88
97
  _this.processSchemaElements(tables, _config.TABLE);
89
98
 
90
99
  _this.processSchemaElements(refs, _config.REF);
91
100
 
92
- _this.processSchemaElements(enums, _config.ENUM);
93
-
94
101
  _this.processSchemaElements(tableGroups, _config.TABLE_GROUP);
95
102
 
96
103
  return _this;
@@ -107,7 +114,7 @@ function (_Element) {
107
114
  var _this2 = this;
108
115
 
109
116
  rawSchemas.forEach(function (schema) {
110
- _this2.pushSchema(new _schema["default"](_objectSpread({}, schema, {
117
+ _this2.pushSchema(new _schema["default"](_objectSpread(_objectSpread({}, schema), {}, {
111
118
  database: _this2
112
119
  })));
113
120
  });
@@ -137,8 +144,7 @@ function (_Element) {
137
144
  if (element.schemaName) {
138
145
  schema = _this3.findOrCreateSchema(element.schemaName);
139
146
 
140
- if (element.schemaName === _config.DEFAULT_SCHEMA_NAME) {
141
- _this3.hasDefaultSchema = true;
147
+ if (element.schemaName === _config.DEFAULT_SCHEMA_NAME) {// this.hasDefaultSchema = true;
142
148
  }
143
149
  } else {
144
150
  schema = _this3.findOrCreateSchema(_config.DEFAULT_SCHEMA_NAME);
@@ -146,25 +152,25 @@ function (_Element) {
146
152
 
147
153
  switch (elementType) {
148
154
  case _config.TABLE:
149
- schema.pushTable(new _table["default"](_objectSpread({}, element, {
155
+ schema.pushTable(new _table["default"](_objectSpread(_objectSpread({}, element), {}, {
150
156
  schema: schema
151
157
  })));
152
158
  break;
153
159
 
154
160
  case _config.ENUM:
155
- schema.pushEnum(new _enum["default"](_objectSpread({}, element, {
161
+ schema.pushEnum(new _enum2["default"](_objectSpread(_objectSpread({}, element), {}, {
156
162
  schema: schema
157
163
  })));
158
164
  break;
159
165
 
160
166
  case _config.TABLE_GROUP:
161
- schema.pushTableGroup(new _tableGroup["default"](_objectSpread({}, element, {
167
+ schema.pushTableGroup(new _tableGroup["default"](_objectSpread(_objectSpread({}, element), {}, {
162
168
  schema: schema
163
169
  })));
164
170
  break;
165
171
 
166
172
  case _config.REF:
167
- schema.pushRef(new _ref2["default"](_objectSpread({}, element, {
173
+ schema.pushRef(new _ref2["default"](_objectSpread(_objectSpread({}, element), {}, {
168
174
  schema: schema
169
175
  })));
170
176
  break;
@@ -192,16 +198,55 @@ function (_Element) {
192
198
 
193
199
  return schema;
194
200
  }
201
+ }, {
202
+ key: "findTableAlias",
203
+ value: function findTableAlias(alias) {
204
+ var sym = this.aliases.find(function (a) {
205
+ return a.name === alias;
206
+ });
207
+ if (!sym || sym.kind !== 'table') return null;
208
+ var schemaName = sym.value.schemaName || _config.DEFAULT_SCHEMA_NAME;
209
+ var schema = this.schemas.find(function (s) {
210
+ return s.name === schemaName;
211
+ });
212
+ if (!schema) return null;
213
+ var tableName = sym.value.tableName;
214
+ var table = schema.tables.find(function (t) {
215
+ return t.name === tableName;
216
+ });
217
+ return table;
218
+ }
195
219
  }, {
196
220
  key: "findTable",
197
- value: function findTable(rawTable) {
198
- var schema = this.findOrCreateSchema(rawTable.schemaName || _config.DEFAULT_SCHEMA_NAME);
221
+ value: function findTable(schemaName, tableName) {
222
+ var table = null;
223
+
224
+ if (!schemaName) {
225
+ table = this.findTableAlias(tableName);
226
+ if (table) return table;
227
+ }
228
+
229
+ var schema = this.findOrCreateSchema(schemaName || _config.DEFAULT_SCHEMA_NAME);
199
230
 
200
231
  if (!schema) {
201
- this.error("Schema ".concat(rawTable.schemaName || _config.DEFAULT_SCHEMA_NAME, " don't exist"));
232
+ this.error("Schema ".concat(schemaName || _config.DEFAULT_SCHEMA_NAME, " don't exist"));
202
233
  }
203
234
 
204
- return schema.findTable(rawTable.name);
235
+ return schema.findTable(tableName);
236
+ }
237
+ }, {
238
+ key: "findEnum",
239
+ value: function findEnum(schemaName, name) {
240
+ var schema = this.schemas.find(function (s) {
241
+ return s.name === schemaName || s.alias === schemaName;
242
+ });
243
+ if (!schema) return null;
244
+
245
+ var _enum = schema.enums.find(function (e) {
246
+ return e.name === name;
247
+ });
248
+
249
+ return _enum;
205
250
  }
206
251
  }, {
207
252
  key: "export",
@@ -240,9 +285,9 @@ function (_Element) {
240
285
  key: "normalize",
241
286
  value: function normalize() {
242
287
  var normalizedModel = {
243
- database: _defineProperty({}, this.id, _objectSpread({
288
+ database: _defineProperty({}, this.id, _objectSpread(_objectSpread({
244
289
  id: this.id
245
- }, this.shallowExport(), {}, this.exportChildIds())),
290
+ }, this.shallowExport()), this.exportChildIds())),
246
291
  schemas: {},
247
292
  refs: {},
248
293
  enums: {},
@@ -11,9 +11,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
11
11
 
12
12
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
13
13
 
14
- var DbState =
15
- /*#__PURE__*/
16
- function () {
14
+ var DbState = /*#__PURE__*/function () {
17
15
  function DbState() {
18
16
  _classCallCheck(this, DbState);
19
17
 
@@ -9,21 +9,23 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
9
9
 
10
10
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
11
11
 
12
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13
13
 
14
14
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
15
 
16
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
17
+
18
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
19
+
16
20
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
17
21
 
18
22
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
19
23
 
20
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
21
-
22
24
  function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
23
25
 
24
- function isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
26
+ function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
25
27
 
26
- function _construct(Parent, args, Class) { if (isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
28
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
27
29
 
28
30
  function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
29
31
 
@@ -32,11 +34,11 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
32
34
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
33
35
 
34
36
  /* eslint-disable */
35
- var ElementError =
36
- /*#__PURE__*/
37
- function (_Error) {
37
+ var ElementError = /*#__PURE__*/function (_Error) {
38
38
  _inherits(ElementError, _Error);
39
39
 
40
+ var _super = _createSuper(ElementError);
41
+
40
42
  function ElementError(message) {
41
43
  var _this;
42
44
 
@@ -49,17 +51,15 @@ function (_Error) {
49
51
 
50
52
  _classCallCheck(this, ElementError);
51
53
 
52
- _this = _possibleConstructorReturn(this, _getPrototypeOf(ElementError).call(this, message));
54
+ _this = _super.call(this, message);
53
55
  _this.location = location;
54
56
  return _this;
55
57
  }
56
58
 
57
59
  return ElementError;
58
- }(_wrapNativeSuper(Error));
60
+ }( /*#__PURE__*/_wrapNativeSuper(Error));
59
61
 
60
- var Element =
61
- /*#__PURE__*/
62
- function () {
62
+ var Element = /*#__PURE__*/function () {
63
63
  function Element(token) {
64
64
  _classCallCheck(this, Element);
65
65
 
@@ -13,11 +13,11 @@ var _utils = require("./utils");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
16
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
17
17
 
18
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19
19
 
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
21
 
22
22
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
23
 
@@ -27,21 +27,25 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
27
27
 
28
28
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
29
29
 
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
+
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+
30
36
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
31
37
 
32
38
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
39
 
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
35
41
 
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
-
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
43
 
40
- var Endpoint =
41
- /*#__PURE__*/
42
- function (_Element) {
44
+ var Endpoint = /*#__PURE__*/function (_Element) {
43
45
  _inherits(Endpoint, _Element);
44
46
 
47
+ var _super = _createSuper(Endpoint);
48
+
45
49
  function Endpoint(_ref) {
46
50
  var _this;
47
51
 
@@ -54,7 +58,7 @@ function (_Element) {
54
58
 
55
59
  _classCallCheck(this, Endpoint);
56
60
 
57
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Endpoint).call(this, token));
61
+ _this = _super.call(this, token);
58
62
  _this.relation = relation;
59
63
  _this.schemaName = schemaName;
60
64
  _this.tableName = tableName;
@@ -68,10 +72,10 @@ function (_Element) {
68
72
 
69
73
 
70
74
  var schema = ref.schema.database.findOrCreateSchema(schemaName || _config.DEFAULT_SCHEMA_NAME);
71
- var table = schema.findTable(tableName);
75
+ var table = schema.database.findTable(schemaName, tableName);
72
76
 
73
77
  if (!table) {
74
- _this.error("Can't find table ".concat((0, _utils.shouldPrintSchema)(schema) ? "\"".concat(schema.name, "\".") : '', "\"").concat(tableName, "\""));
78
+ _this.error("Can't find table ".concat((0, _utils.shouldPrintSchemaName)(schemaName) ? "\"".concat(schemaName, "\".") : '', "\"").concat(tableName, "\""));
75
79
  }
76
80
 
77
81
  _this.setFields(fieldNames, table);
@@ -151,9 +155,9 @@ function (_Element) {
151
155
  }, {
152
156
  key: "normalize",
153
157
  value: function normalize(model) {
154
- model.endpoints = _objectSpread({}, model.endpoints, _defineProperty({}, this.id, _objectSpread({
158
+ model.endpoints = _objectSpread(_objectSpread({}, model.endpoints), {}, _defineProperty({}, this.id, _objectSpread(_objectSpread({
155
159
  id: this.id
156
- }, this.shallowExport(), {}, this.exportParentIds())));
160
+ }, this.shallowExport()), this.exportParentIds())));
157
161
  }
158
162
  }]);
159
163
 
@@ -13,11 +13,11 @@ var _utils = require("./utils");
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
15
15
 
16
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
16
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
17
17
 
18
18
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
19
19
 
20
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
20
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
21
21
 
22
22
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
23
23
 
@@ -27,21 +27,25 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
27
27
 
28
28
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
29
29
 
30
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
31
+
32
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
33
+
34
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
35
+
30
36
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
31
37
 
32
38
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
33
39
 
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
40
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
35
41
 
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
-
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
42
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
43
 
40
- var Enum =
41
- /*#__PURE__*/
42
- function (_Element) {
44
+ var Enum = /*#__PURE__*/function (_Element) {
43
45
  _inherits(Enum, _Element);
44
46
 
47
+ var _super = _createSuper(Enum);
48
+
45
49
  function Enum() {
46
50
  var _this;
47
51
 
@@ -54,7 +58,7 @@ function (_Element) {
54
58
 
55
59
  _classCallCheck(this, Enum);
56
60
 
57
- _this = _possibleConstructorReturn(this, _getPrototypeOf(Enum).call(this, token));
61
+ _this = _super.call(this, token);
58
62
 
59
63
  if (!name) {
60
64
  _this.error('Enum must have a name');
@@ -85,7 +89,7 @@ function (_Element) {
85
89
  var _this2 = this;
86
90
 
87
91
  rawValues.forEach(function (value) {
88
- _this2.pushValue(new _enumValue["default"](_objectSpread({}, value, {
92
+ _this2.pushValue(new _enumValue["default"](_objectSpread(_objectSpread({}, value), {}, {
89
93
  _enum: _this2
90
94
  })));
91
95
  });
@@ -123,7 +127,7 @@ function (_Element) {
123
127
  }, {
124
128
  key: "export",
125
129
  value: function _export() {
126
- return _objectSpread({}, this.shallowExport(), {}, this.exportChild());
130
+ return _objectSpread(_objectSpread({}, this.shallowExport()), this.exportChild());
127
131
  }
128
132
  }, {
129
133
  key: "exportChild",
@@ -164,9 +168,9 @@ function (_Element) {
164
168
  }, {
165
169
  key: "normalize",
166
170
  value: function normalize(model) {
167
- model.enums = _objectSpread({}, model.enums, _defineProperty({}, this.id, _objectSpread({
171
+ model.enums = _objectSpread(_objectSpread({}, model.enums), {}, _defineProperty({}, this.id, _objectSpread(_objectSpread(_objectSpread({
168
172
  id: this.id
169
- }, this.shallowExport(), {}, this.exportChildIds(), {}, this.exportParentIds())));
173
+ }, this.shallowExport()), this.exportChildIds()), this.exportParentIds())));
170
174
  this.values.forEach(function (v) {
171
175
  return v.normalize(model);
172
176
  });
@@ -9,11 +9,11 @@ var _element = _interopRequireDefault(require("./element"));
9
9
 
10
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
11
11
 
12
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
12
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
13
13
 
14
14
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
15
15
 
16
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
16
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
17
17
 
18
18
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
19
19
 
@@ -23,21 +23,25 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
23
23
 
24
24
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
25
25
 
26
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
30
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
31
+
26
32
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
27
33
 
28
34
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
29
35
 
30
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
36
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
31
37
 
32
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
33
-
34
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
39
 
36
- var EnumValue =
37
- /*#__PURE__*/
38
- function (_Element) {
40
+ var EnumValue = /*#__PURE__*/function (_Element) {
39
41
  _inherits(EnumValue, _Element);
40
42
 
43
+ var _super = _createSuper(EnumValue);
44
+
41
45
  function EnumValue() {
42
46
  var _this;
43
47
 
@@ -49,7 +53,7 @@ function (_Element) {
49
53
 
50
54
  _classCallCheck(this, EnumValue);
51
55
 
52
- _this = _possibleConstructorReturn(this, _getPrototypeOf(EnumValue).call(this, token));
56
+ _this = _super.call(this, token);
53
57
 
54
58
  if (!name) {
55
59
  _this.error('Enum value must have a name');
@@ -93,9 +97,9 @@ function (_Element) {
93
97
  }, {
94
98
  key: "normalize",
95
99
  value: function normalize(model) {
96
- model.enumValues = _objectSpread({}, model.enumValues, _defineProperty({}, this.id, _objectSpread({
100
+ model.enumValues = _objectSpread(_objectSpread({}, model.enumValues), {}, _defineProperty({}, this.id, _objectSpread(_objectSpread({
97
101
  id: this.id
98
- }, this.shallowExport(), {}, this.exportParentIds())));
102
+ }, this.shallowExport()), this.exportParentIds())));
99
103
  }
100
104
  }]);
101
105