@tsed/objection 7.18.3-rc.1 → 7.18.3

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 (64) hide show
  1. package/.eslintignore +13 -0
  2. package/.eslintrc.js +1 -0
  3. package/jest.config.js +9 -5
  4. package/lib/cjs/components/createBooleanColumn.js.map +1 -1
  5. package/lib/cjs/components/createIdColumn.js.map +1 -1
  6. package/lib/cjs/components/createNumberColumn.js.map +1 -1
  7. package/lib/cjs/components/createStringColumn.js.map +1 -1
  8. package/lib/cjs/decorators/belongsToOne.js.map +1 -1
  9. package/lib/cjs/decorators/columnOptions.js.map +1 -1
  10. package/lib/cjs/decorators/decimal.js.map +1 -1
  11. package/lib/cjs/decorators/entity.js.map +1 -1
  12. package/lib/cjs/decorators/hasMany.js.map +1 -1
  13. package/lib/cjs/decorators/hasOne.js.map +1 -1
  14. package/lib/cjs/decorators/hasOneThroughRelation.js.map +1 -1
  15. package/lib/cjs/decorators/idColumn.js.map +1 -1
  16. package/lib/cjs/decorators/manyToMany.js.map +1 -1
  17. package/lib/cjs/decorators/relatesTo.js.map +1 -1
  18. package/lib/cjs/domain/ColumnOpts.js.map +1 -1
  19. package/lib/cjs/domain/RelationshipOpts.js.map +1 -1
  20. package/lib/cjs/domain/interfaces.js.map +1 -1
  21. package/lib/cjs/index.js.map +1 -1
  22. package/lib/cjs/services/ColumnTypesContainer.js.map +1 -1
  23. package/lib/cjs/services/ObjectionConnection.js.map +1 -1
  24. package/lib/cjs/utils/connect.js.map +1 -1
  25. package/lib/cjs/utils/createColumns.js.map +1 -1
  26. package/lib/cjs/utils/createJoinKeys.js.map +1 -1
  27. package/lib/cjs/utils/createRelationshipMapping.js.map +1 -1
  28. package/lib/cjs/utils/defineStaticGetter.js.map +1 -1
  29. package/lib/cjs/utils/getColumnCtx.js.map +1 -1
  30. package/lib/cjs/utils/getJsonEntityRelationships.js.map +1 -1
  31. package/lib/esm/components/createBooleanColumn.js.map +1 -1
  32. package/lib/esm/components/createIdColumn.js.map +1 -1
  33. package/lib/esm/components/createNumberColumn.js.map +1 -1
  34. package/lib/esm/components/createStringColumn.js.map +1 -1
  35. package/lib/esm/decorators/belongsToOne.js.map +1 -1
  36. package/lib/esm/decorators/columnOptions.js.map +1 -1
  37. package/lib/esm/decorators/decimal.js.map +1 -1
  38. package/lib/esm/decorators/entity.js.map +1 -1
  39. package/lib/esm/decorators/hasMany.js.map +1 -1
  40. package/lib/esm/decorators/hasOne.js.map +1 -1
  41. package/lib/esm/decorators/hasOneThroughRelation.js.map +1 -1
  42. package/lib/esm/decorators/idColumn.js.map +1 -1
  43. package/lib/esm/decorators/manyToMany.js.map +1 -1
  44. package/lib/esm/decorators/relatesTo.js.map +1 -1
  45. package/lib/esm/domain/ColumnOpts.js.map +1 -1
  46. package/lib/esm/domain/RelationshipOpts.js.map +1 -1
  47. package/lib/esm/domain/interfaces.js.map +1 -1
  48. package/lib/esm/index.js.map +1 -1
  49. package/lib/esm/services/ColumnTypesContainer.js.map +1 -1
  50. package/lib/esm/services/ObjectionConnection.js.map +1 -1
  51. package/lib/esm/utils/connect.js.map +1 -1
  52. package/lib/esm/utils/createColumns.js.map +1 -1
  53. package/lib/esm/utils/createJoinKeys.js.map +1 -1
  54. package/lib/esm/utils/createRelationshipMapping.js.map +1 -1
  55. package/lib/esm/utils/defineStaticGetter.js.map +1 -1
  56. package/lib/esm/utils/getColumnCtx.js.map +1 -1
  57. package/lib/esm/utils/getJsonEntityRelationships.js.map +1 -1
  58. package/lib/tsconfig.esm.tsbuildinfo +1 -0
  59. package/lib/tsconfig.tsbuildinfo +1 -0
  60. package/lib/types/domain/RelationshipOpts.d.ts +3 -3
  61. package/lib/types/services/ObjectionConnection.d.ts +1 -1
  62. package/package.json +21 -20
  63. package/tsconfig.esm.json +45 -0
  64. package/tsconfig.compile.esm.json +0 -12
package/.eslintignore ADDED
@@ -0,0 +1,13 @@
1
+ node_modules
2
+ docs
3
+ docs-references
4
+ lib
5
+ dist
6
+ coverage
7
+ .nyc_output
8
+ *-lock.json
9
+ *.lock
10
+ benchmarks.*
11
+ **/generated
12
+
13
+ **/*.js
package/.eslintrc.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require("@tsed/eslint/node.js");
package/jest.config.js CHANGED
@@ -2,13 +2,17 @@
2
2
  // https://jestjs.io/docs/en/configuration.html
3
3
 
4
4
  module.exports = {
5
- ...require("@tsed/jest-config")(__dirname, "objection"),
5
+ ...require("@tsed/jest-config"),
6
+ roots: ["<rootDir>/src", "<rootDir>/test"],
7
+ moduleNameMapper: {
8
+ "@tsed/objection": "<rootDir>/src/index.ts"
9
+ },
6
10
  coverageThreshold: {
7
11
  global: {
8
- branches: 68.75,
9
- functions: 81.48,
10
- lines: 92.44,
11
- statements: 92.86
12
+ branches: 96.87,
13
+ functions: 91.48,
14
+ lines: 98.26,
15
+ statements: 98.26
12
16
  }
13
17
  }
14
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAEtE;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAY;IAC/E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAFD,kDAEC;AAED,2CAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n/**\n * @ignore\n */\nexport function createBooleanColumn(table: Knex.TableBuilder, {entity}: ColumnCtx) {\n table.boolean(entity.propertyName);\n}\n\nColumnTypesContainer.set(\"boolean\", createBooleanColumn);\n"]}
1
+ {"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAEtE;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAY;IAC/E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAFD,kDAEC;AAED,2CAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAEtE,mCAAkC;AAElC;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACnF,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM;QACR,KAAK,YAAY;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,IAAA,mBAAU,GAAE,CAAC,CAAC;KACrE;AACH,CAAC;AAXD,wCAWC;AAED,2CAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {ColumnCtx} from \"../utils/getColumnCtx\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport type {Knex} from \"knex\";\nimport {randomUUID} from \"crypto\";\n\n/**\n * @ignore\n */\nexport function createIdColumn(table: Knex.TableBuilder, {entity, options}: ColumnCtx) {\n switch (options.type) {\n case \"bigIncrements\":\n table.bigIncrements(entity.propertyName).primary();\n break;\n case \"increments\":\n table.increments(entity.propertyName).primary();\n break;\n case \"uuid\":\n table.uuid(entity.propertyName).primary().defaultTo(randomUUID());\n }\n}\n\nColumnTypesContainer.set(\"idColumn\", createIdColumn);\n"]}
1
+ {"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAEtE,mCAAkC;AAElC;;GAEG;AACH,SAAgB,cAAc,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACnF,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM;QACR,KAAK,YAAY;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,IAAA,mBAAU,GAAE,CAAC,CAAC;KACrE;AACH,CAAC;AAXD,wCAWC;AAED,2CAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAGtE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACvF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAFD,gDAEC;AAED,2CAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createNumberColumn(table: Knex.TableBuilder, {entity, options}: ColumnCtx) {\n table.decimal(entity.propertyName, options.precision, options.scale);\n}\n\nColumnTypesContainer.set(\"number\", createNumberColumn);\n"]}
1
+ {"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAGtE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACvF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAFD,gDAEC;AAED,2CAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAGtE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,MAAM,EAAY;IACtF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AAFD,gDAEC;AAED,2CAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createStringColumn(table: Knex.TableBuilder, {entity, schema}: ColumnCtx) {\n table.string(entity.propertyName, schema.maxLength);\n}\n\nColumnTypesContainer.set(\"string\", createStringColumn);\n"]}
1
+ {"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":";;;AACA,2EAAsE;AAGtE;;GAEG;AACH,SAAgB,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,MAAM,EAAY;IACtF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AAFD,gDAEC;AAED,2CAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,IAAqC;IAChE,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAFD,oCAEC","sourcesContent":["import {Model} from \"objection\";\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithoutThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function BelongsToOne(opts?: RelationshipOptsWithoutThrough): PropertyDecorator {\n return RelatesTo(Model.BelongsToOneRelation, opts);\n}\n"]}
1
+ {"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,IAAqC;IAChE,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAFD,oCAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"columnOptions.js","sourceRoot":"","sources":["../../../src/decorators/columnOptions.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAGpC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAA4B;IACxD,OAAO,IAAA,eAAQ,EAAC,WAAW,EAAE,OAAO,CAAQ,CAAC;AAC/C,CAAC;AAFD,sCAEC","sourcesContent":["import {StoreSet} from \"@tsed/core\";\nimport type {ColumnOpts} from \"../domain/ColumnOpts\";\n\n/**\n *\n * @param options\n * @decorator\n * @objection\n */\nexport function ColumnOptions(options: Partial<ColumnOpts>): PropertyDecorator {\n return StoreSet(\"objection\", options) as any;\n}\n"]}
1
+ {"version":3,"file":"columnOptions.js","sourceRoot":"","sources":["../../../src/decorators/columnOptions.ts"],"names":[],"mappings":";;;AAAA,qCAAoC;AAGpC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAA4B;IACxD,OAAO,IAAA,eAAQ,EAAC,WAAW,EAAE,OAAO,CAAQ,CAAC;AAC/C,CAAC;AAFD,sCAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AACtC,mDAA8C;AAO9C;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,UAA0B,EAAE;IAClD,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAQ,GAAE,EACV,IAAA,6BAAa,EAAC;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,EACF,IAAA,eAAQ,EAAC,WAAW,EAAE;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAlBD,0BAkBC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {Property} from \"@tsed/schema\";\nimport {ColumnOptions} from \"./columnOptions\";\n\nexport interface DecimalOptions {\n precision?: number | null;\n scale?: number;\n}\n\n/**\n *\n * @param options\n * @decorator\n * @objection\n */\nexport function Decimal(options: DecimalOptions = {}) {\n return useDecorators(\n Property(),\n ColumnOptions({\n columnType: \"number\",\n options: {\n type: \"decimal\",\n ...options\n }\n }),\n StoreSet(\"objection\", {\n columnType: \"number\",\n options: {\n type: \"decimal\",\n ...options\n }\n })\n );\n}\n"]}
1
+ {"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":";;;AAAA,qCAAmD;AACnD,yCAAsC;AACtC,mDAA8C;AAO9C;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,UAA0B,EAAE;IAClD,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAQ,GAAE,EACV,IAAA,6BAAa,EAAC;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,EACF,IAAA,eAAQ,EAAC,WAAW,EAAE;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,CACH,CAAC;AACJ,CAAC;AAlBD,0BAkBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,oFAA+E;AAC/E,yCAA2C;AAE3C;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,SAAiB;IACtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC5D,IAAA,uCAAkB,EAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzD,IAAA,uCAAkB,EAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;QACtE,IAAA,uCAAkB,EAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,wBAAwB,IAAI,IAAA,uDAA0B,EAAC,MAAM,CAAC,CAAC,CAAC;QACrH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAZD,wBAYC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\nimport {getJsonEntityRelationships} from \"../utils/getJsonEntityRelationships\";\nimport {getJsonSchema} from \"@tsed/schema\";\n\n/**\n *\n * @param tableName\n * @decorator\n * @objection\n */\nexport function Entity(tableName: string): ClassDecorator {\n if (!tableName) {\n throw new Error(\"Please provide a table name\");\n }\n\n return (target: any) => {\n const originalRelationMappings = target[\"relationMappings\"];\n defineStaticGetter(target, \"tableName\", () => tableName);\n defineStaticGetter(target, \"jsonSchema\", () => getJsonSchema(target));\n defineStaticGetter(target, \"relationMappings\", () => originalRelationMappings || getJsonEntityRelationships(target));\n return target;\n };\n}\n\nexport interface EntityMethods<T> extends Type<T> {\n readonly tableName: string;\n}\n"]}
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":";;;AACA,oEAA+D;AAC/D,oFAA+E;AAC/E,yCAA2C;AAE3C;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,SAAiB;IACtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC5D,IAAA,uCAAkB,EAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzD,IAAA,uCAAkB,EAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,IAAA,sBAAa,EAAC,MAAM,CAAC,CAAC,CAAC;QACtE,IAAA,uCAAkB,EAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,wBAAwB,IAAI,IAAA,uDAA0B,EAAC,MAAM,CAAC,CAAC,CAAC;QACrH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC;AAZD,wBAYC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,IAAyB,EAAE,IAAkC;IACnF,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,eAAe,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,0BAEC","sourcesContent":["import {Model, ModelClassSpecifier} from \"objection\";\n\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function HasMany(type: ModelClassSpecifier, opts?: RelationshipOptsWithThrough): PropertyDecorator {\n return RelatesTo(Model.HasManyRelation, {...opts, type});\n}\n"]}
1
+ {"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,OAAO,CAAC,IAAyB,EAAE,IAAkC;IACnF,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,eAAe,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,CAAC;AAFD,0BAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,IAAqC;IAC1D,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAFD,wBAEC","sourcesContent":["import {Model} from \"objection\";\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithoutThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function HasOne(opts?: RelationshipOptsWithoutThrough): PropertyDecorator {\n return RelatesTo(Model.HasOneRelation, opts);\n}\n"]}
1
+ {"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":";;;AAAA,yCAAgC;AAChC,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,MAAM,CAAC,IAAqC;IAC1D,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAFD,wBAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":";;;AAEA,yCAAgC;AAChC,2CAAsC;AAEtC;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAkC;IACtE,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC;AAFD,sDAEC","sourcesContent":["import {RelationshipOptsWithThrough, RelationshipOptsWithoutThrough} from \"../domain/RelationshipOpts\";\n\nimport {Model} from \"objection\";\nimport {RelatesTo} from \"./relatesTo\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function HasOneThroughRelation(opts?: RelationshipOptsWithThrough): PropertyDecorator {\n return RelatesTo(Model.HasOneThroughRelation, opts);\n}\n"]}
1
+ {"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":";;;AAEA,yCAAgC;AAChC,2CAAsC;AAEtC;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,IAAkC;IACtE,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC;AAFD,sDAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,yCAAsC;AACtC,oEAA+D;AAC/D,qCAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAgD,YAAY;IACnF,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAQ,GAAE,EACV,IAAA,6BAAa,EAAC;QACZ,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,EACF,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACnC,IAAA,uCAAkB,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC;AAbD,4BAaC","sourcesContent":["import {ColumnOptions} from \"./columnOptions\";\nimport {Property} from \"@tsed/schema\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\nimport {useDecorators} from \"@tsed/core\";\n\n/**\n *\n * @param type\n * @decorator\n * @objection\n */\nexport function IdColumn(type: \"uuid\" | \"increments\" | \"bigIncrements\" = \"increments\"): PropertyDecorator {\n return useDecorators(\n Property(),\n ColumnOptions({\n columnType: \"idColumn\",\n options: {\n type\n }\n }),\n (target: any, propertyKey: string) => {\n defineStaticGetter(target, \"idColumn\", () => propertyKey);\n }\n );\n}\n"]}
1
+ {"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,yCAAsC;AACtC,oEAA+D;AAC/D,qCAAyC;AAEzC;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,OAAgD,YAAY;IACnF,OAAO,IAAA,oBAAa,EAClB,IAAA,iBAAQ,GAAE,EACV,IAAA,6BAAa,EAAC;QACZ,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,EACF,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACnC,IAAA,uCAAkB,EAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC;AAbD,4BAaC"}
@@ -1 +1 @@
1
- {"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAyB,EAAE,IAAkC;IACtF,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,kBAAkB,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,gCAEC","sourcesContent":["import {Model, ModelClassSpecifier} from \"objection\";\n\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function ManyToMany(type: ModelClassSpecifier, opts?: RelationshipOptsWithThrough): PropertyDecorator {\n return RelatesTo(Model.ManyToManyRelation, {...opts, type});\n}\n"]}
1
+ {"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":";;;AAAA,yCAAqD;AAErD,2CAAsC;AAGtC;;;;;GAKG;AACH,SAAgB,UAAU,CAAC,IAAyB,EAAE,IAAkC;IACtF,OAAO,IAAA,qBAAS,EAAC,iBAAK,CAAC,kBAAkB,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9D,CAAC;AAFD,gCAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AACpD,iEAAiF;AACjF,qCAAkD;AAElD,oFAA+E;AAE/E,kFAA6E;AAE7E;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,QAAsB,EAAE,IAAuB;IACvE,OAAO,IAAA,oBAAa,EAClB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAQ,GAAE,EACjD,IAAA,cAAO,EAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,IAAI,IAAI,IAAA,sCAAmB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,GAAG,CAAC,uDAA0B,EAAE,IAAA,qDAAyB,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAVD,8BAUC","sourcesContent":["import {CollectionOf, Property} from \"@tsed/schema\";\nimport {RelationshipOpts, isModelClassFactory} from \"../domain/RelationshipOpts\";\nimport {StoreFn, useDecorators} from \"@tsed/core\";\n\nimport {OBJECTION_RELATIONSHIP_KEY} from \"../utils/getJsonEntityRelationships\";\nimport {RelationType} from \"objection\";\nimport {createRelationshipMapping} from \"../utils/createRelationshipMapping\";\n\n/**\n *\n * @param relation\n * @param opts\n * @decorator\n * @objection\n */\nexport function RelatesTo(relation: RelationType, opts?: RelationshipOpts): PropertyDecorator {\n return useDecorators(\n opts?.type ? CollectionOf(opts.type) : Property(),\n StoreFn((store, params) => {\n if (opts && isModelClassFactory(opts.type)) {\n opts.type = opts.type();\n }\n store.set(OBJECTION_RELATIONSHIP_KEY, createRelationshipMapping(params, relation, opts));\n })\n );\n}\n"]}
1
+ {"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":";;;AAAA,yCAAoD;AACpD,iEAAiF;AACjF,qCAAkD;AAElD,oFAA+E;AAE/E,kFAA6E;AAE7E;;;;;;GAMG;AACH,SAAgB,SAAS,CAAC,QAAsB,EAAE,IAAuB;IACvE,OAAO,IAAA,oBAAa,EAClB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAQ,GAAE,EACjD,IAAA,cAAO,EAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,IAAI,IAAI,IAAA,sCAAmB,EAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,GAAG,CAAC,uDAA0B,EAAE,IAAA,qDAAyB,EAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CACH,CAAC;AACJ,CAAC;AAVD,8BAUC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnOpts.js","sourceRoot":"","sources":["../../../src/domain/ColumnOpts.ts"],"names":[],"mappings":"","sourcesContent":["export interface ColumnOpts {\n columnType: \"idColumn\" | \"string\" | \"number\" | \"boolean\";\n options: any;\n}\n"]}
1
+ {"version":3,"file":"ColumnOpts.js","sourceRoot":"","sources":["../../../src/domain/ColumnOpts.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipOpts.js","sourceRoot":"","sources":["../../../src/domain/RelationshipOpts.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AASzC,MAAM,6BAA6B,GAAG,CAAC,IAAuB,EAAuC,EAAE,CAC5G,IAAI,KAAK,SAAS,IAAkC,IAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AADrE,QAAA,6BAA6B,iCACwC;AAE3E,MAAM,mBAAmB,GAAG,CAAC,IAA0B,EAA6B,EAAE,CAC3F,IAAI,KAAK,SAAS,IAAI,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,IAAA,iBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;AADzE,QAAA,mBAAmB,uBACsD","sourcesContent":["import {isFunction, isString} from \"@tsed/core\";\nimport {ModelClassFactory, ModelClassSpecifier, RelationJoin, RelationMapping} from \"objection\";\n\nexport type RelationshipOptsWithThrough = Partial<RelationJoin> & Omit<RelationMapping<any>, \"relation\" | \"join\" | \"modelClass\">;\n\nexport type RelationshipOptsWithoutThrough = Omit<RelationshipOptsWithThrough, \"through\">;\n\nexport type RelationshipOpts = (RelationshipOptsWithThrough | RelationshipOptsWithoutThrough) & {type?: ModelClassSpecifier};\n\nexport const isRelationshipOptsWithThrough = (opts?: RelationshipOpts): opts is RelationshipOptsWithThrough =>\n opts !== undefined && (<RelationshipOptsWithThrough>opts).through !== undefined;\n\nexport const isModelClassFactory = (type?: ModelClassSpecifier): type is ModelClassFactory =>\n type !== undefined && !isString(type) && isFunction(type) && !(\"prototype\" in type);\n"]}
1
+ {"version":3,"file":"RelationshipOpts.js","sourceRoot":"","sources":["../../../src/domain/RelationshipOpts.ts"],"names":[],"mappings":";;;AAAA,qCAAgD;AASzC,MAAM,6BAA6B,GAAG,CAAC,IAAuB,EAAuC,EAAE,CAC5G,IAAI,KAAK,SAAS,IAAkC,IAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AADrE,QAAA,6BAA6B,iCACwC;AAE3E,MAAM,mBAAmB,GAAG,CAAC,IAA0B,EAA6B,EAAE,CAC3F,IAAI,KAAK,SAAS,IAAI,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,IAAI,IAAA,iBAAU,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC;AADzE,QAAA,mBAAmB,uBACsD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/domain/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {Knex} from \"knex\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n knex: Knex.Config;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/domain/interfaces.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2EAAiD;AACjD,sEAA4C;AAC5C,0EAAgD;AAChD,0EAAgD;AAChD,oEAA0C;AAC1C,qEAA2C;AAC3C,+DAAqC;AACrC,8DAAoC;AACpC,+DAAqC;AACrC,8DAAoC;AACpC,6EAAmD;AACnD,gEAAsC;AACtC,kEAAwC;AACxC,iEAAuC;AACvC,8DAAoC;AACpC,oEAA0C;AAC1C,8DAAoC;AACpC,0EAAgD;AAChD,yEAA+C;AAC/C,0DAAgC;AAChC,gEAAsC;AACtC,iEAAuC;AACvC,4EAAkD;AAClD,qEAA2C;AAC3C,+DAAqC;AACrC,6EAAmD","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./components/createBooleanColumn\";\nexport * from \"./components/createIdColumn\";\nexport * from \"./components/createNumberColumn\";\nexport * from \"./components/createStringColumn\";\nexport * from \"./decorators/belongsToOne\";\nexport * from \"./decorators/columnOptions\";\nexport * from \"./decorators/decimal\";\nexport * from \"./decorators/entity\";\nexport * from \"./decorators/hasMany\";\nexport * from \"./decorators/hasOne\";\nexport * from \"./decorators/hasOneThroughRelation\";\nexport * from \"./decorators/idColumn\";\nexport * from \"./decorators/manyToMany\";\nexport * from \"./decorators/relatesTo\";\nexport * from \"./domain/ColumnOpts\";\nexport * from \"./domain/RelationshipOpts\";\nexport * from \"./domain/interfaces\";\nexport * from \"./services/ColumnTypesContainer\";\nexport * from \"./services/ObjectionConnection\";\nexport * from \"./utils/connect\";\nexport * from \"./utils/createColumns\";\nexport * from \"./utils/createJoinKeys\";\nexport * from \"./utils/createRelationshipMapping\";\nexport * from \"./utils/defineStaticGetter\";\nexport * from \"./utils/getColumnCtx\";\nexport * from \"./utils/getJsonEntityRelationships\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,2EAAiD;AACjD,sEAA4C;AAC5C,0EAAgD;AAChD,0EAAgD;AAChD,oEAA0C;AAC1C,qEAA2C;AAC3C,+DAAqC;AACrC,8DAAoC;AACpC,+DAAqC;AACrC,8DAAoC;AACpC,6EAAmD;AACnD,gEAAsC;AACtC,kEAAwC;AACxC,iEAAuC;AACvC,8DAAoC;AACpC,oEAA0C;AAC1C,8DAAoC;AACpC,0EAAgD;AAChD,yEAA+C;AAC/C,0DAAgC;AAChC,gEAAsC;AACtC,iEAAuC;AACvC,4EAAkD;AAClD,qEAA2C;AAC3C,+DAAqC;AACrC,6EAAmD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnTypesContainer.js","sourceRoot":"","sources":["../../../src/services/ColumnTypesContainer.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACU,QAAA,oBAAoB,GAAoE,IAAI,GAAG,EAAE,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport const ColumnTypesContainer: Map<string, (table: Knex.TableBuilder, ctx: ColumnCtx) => void> = new Map();\n"]}
1
+ {"version":3,"file":"ColumnTypesContainer.js","sourceRoot":"","sources":["../../../src/services/ColumnTypesContainer.ts"],"names":[],"mappings":";;;AAGA;;GAEG;AACU,QAAA,oBAAoB,GAAoE,IAAI,GAAG,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAEzD,8CAAkD;AAErC,QAAA,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAGrE,IAAA,qBAAgB,EAAC;IACf,OAAO,EAAE,4BAAoB;IAC7B,IAAI,EAAE,CAAC,kBAAa,CAAC;IACrB,KAAK,CAAC,eAAe,CAAC,aAA4B;QAChD,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAc,MAAM,CAAE,CAAC;QAElE,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,OAAO,IAAA,0BAAgB,EAAC,iBAAiB,CAAC,CAAC;aAC5C;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import {Configuration, registerProvider} from \"@tsed/di\";\nimport type {Knex} from \"knex\";\nimport {createConnection} from \"../utils/connect\";\n\nexport const OBJECTION_CONNECTION = Symbol.for(\"DEFAULT_CONNECTION\");\nexport type OBJECTION_CONNECTION = Knex<any, unknown[]>;\n\nregisterProvider({\n provide: OBJECTION_CONNECTION,\n deps: [Configuration],\n async useAsyncFactory(configuration: Configuration) {\n const connectionOptions = configuration.get<Knex.Config>(\"knex\")!;\n\n if (connectionOptions) {\n try {\n return createConnection(connectionOptions);\n } catch (er) {\n // istanbul ignore next\n console.error(er);\n }\n }\n\n return {};\n }\n});\n"]}
1
+ {"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAEzD,8CAAkD;AAErC,QAAA,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAGrE,IAAA,qBAAgB,EAAC;IACf,OAAO,EAAE,4BAAoB;IAC7B,IAAI,EAAE,CAAC,kBAAa,CAAC;IACrB,KAAK,CAAC,eAAe,CAAC,aAA4B;QAChD,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAc,MAAM,CAAE,CAAC;QAElE,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,OAAO,IAAA,0BAAgB,EAAC,iBAAiB,CAAC,CAAC;aAC5C;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../src/utils/connect.ts"],"names":[],"mappings":";;;;AAAA,wDAAgC;AAChC,yCAAgC;AAEhC,SAAgB,gBAAgB,CAAC,iBAA8B;IAC7D,MAAM,UAAU,GAAG,IAAA,cAAI,EAAC,iBAAiB,CAAC,CAAC;IAC3C,iBAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEvB,OAAO,UAAU,CAAC;AACpB,CAAC;AALD,4CAKC","sourcesContent":["import knex, {Knex} from \"knex\";\nimport {Model} from \"objection\";\n\nexport function createConnection(connectionOptions: Knex.Config): Knex {\n const connection = knex(connectionOptions);\n Model.knex(connection);\n\n return connection;\n}\n"]}
1
+ {"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../src/utils/connect.ts"],"names":[],"mappings":";;;;AAAA,wDAAgC;AAChC,yCAAgC;AAEhC,SAAgB,gBAAgB,CAAC,iBAA8B;IAC7D,MAAM,UAAU,GAAG,IAAA,cAAI,EAAC,iBAAiB,CAAC,CAAC;IAC3C,iBAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEvB,OAAO,UAAU,CAAC;AACpB,CAAC;AALD,4CAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":";;;AAAA,yCAA4D;AAE5D,6CAA2C;AAC3C,wCAAsC;AACtC,4CAA0C;AAC1C,4CAA0C;AAC1C,2EAAsE;AACtE,iDAA4C;AAE5C;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB,EAAE,MAAuB;IAC5E,MAAM,GAAG,GAAG,IAAA,2BAAY,EAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,2CAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7C,MAAM,eAAe,GAAG,CAAC,UAAU,oFAAoF,CAAC;KACzH;IAED,2CAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AARD,oCAQC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,GAAG,IAAA,sBAAa,EAAC,KAAK,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACtG,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,KAAwB,EAAE,KAAU;IAChE,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,sCAIC","sourcesContent":["import {getProperties, JsonEntityStore} from \"@tsed/schema\";\nimport {Knex} from \"knex\";\nimport \"../components/createBooleanColumn\";\nimport \"../components/createIdColumn\";\nimport \"../components/createNumberColumn\";\nimport \"../components/createStringColumn\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {getColumnCtx} from \"./getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createColumn(table: Knex.TableBuilder, entity: JsonEntityStore) {\n const ctx = getColumnCtx(entity);\n\n if (!ColumnTypesContainer.has(ctx.columnType)) {\n throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;\n }\n\n ColumnTypesContainer.get(ctx.columnType)!(table, ctx);\n}\n\n/**\n * @ignore\n */\nexport function getColumns(model: any) {\n return [...getProperties(model, {withIgnoredProps: true, objection: true, groups: false}).values()];\n}\n\n/**\n * @ignore\n */\nexport function createColumns(table: Knex.TableBuilder, model: any) {\n getColumns(model).map((entity) => {\n createColumn(table, entity);\n });\n}\n"]}
1
+ {"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":";;;AAAA,yCAA4D;AAE5D,6CAA2C;AAC3C,wCAAsC;AACtC,4CAA0C;AAC1C,4CAA0C;AAC1C,2EAAsE;AACtE,iDAA4C;AAE5C;;GAEG;AACH,SAAgB,YAAY,CAAC,KAAwB,EAAE,MAAuB;IAC5E,MAAM,GAAG,GAAG,IAAA,2BAAY,EAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,2CAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7C,MAAM,eAAe,GAAG,CAAC,UAAU,oFAAoF,CAAC;KACzH;IAED,2CAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AARD,oCAQC;AAED;;GAEG;AACH,SAAgB,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,GAAG,IAAA,sBAAa,EAAC,KAAK,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACtG,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,aAAa,CAAC,KAAwB,EAAE,KAAU;IAChE,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC;AAJD,sCAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,iEAA2F;AAE3F,qCAAoC;AAEpC;;GAEG;AACH,SAAgB,cAAc,CAAC,WAAgB,EAAE,WAAgB,EAAE,WAAmB,EAAE,QAAsB,EAAE,IAAuB;IACrI,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,eAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC1F,MAAM,iBAAiB,GAAG,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;IAE7F,QAAQ,QAAQ,EAAE;QAChB,KAAK,iBAAK,CAAC,eAAe,CAAC;QAC3B,KAAK,iBAAK,CAAC,cAAc;YACvB,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC,SAAS,GAAG,IAAI,EAAE;aAC7E,CAAC;QACJ,KAAK,iBAAK,CAAC,kBAAkB,CAAC;QAC9B,KAAK,iBAAK,CAAC,qBAAqB;YAC9B,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,IAAA,gDAA6B,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;oBAChE,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,IAAI;oBACtF,EAAE,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI;iBACvF;gBACD,EAAE,EAAE,iBAAiB;aACtB,CAAC;QACJ,KAAK,iBAAK,CAAC,oBAAoB,CAAC;QAChC;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,GAAG,IAAI,EAAE;gBACpE,EAAE,EAAE,iBAAiB;aACtB,CAAC;KACL;AACH,CAAC;AA7BD,wCA6BC","sourcesContent":["import {Model, RelationType} from \"objection\";\nimport {RelationshipOpts, isRelationshipOptsWithThrough} from \"../domain/RelationshipOpts\";\n\nimport {Metadata} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport function createJoinKeys(targetClass: any, targetSuper: any, propertyKey: string, relation: RelationType, opts?: RelationshipOpts) {\n const FOREIGN_MODEL = opts?.type || Metadata.getType(targetSuper, propertyKey);\n const SOURCE_MODEL_KEY = `${targetClass.tableName}.${opts?.from || targetClass.idColumn}`;\n const FOREIGN_MODEL_KEY = `${FOREIGN_MODEL.tableName}.${opts?.to || FOREIGN_MODEL.idColumn}`;\n\n switch (relation) {\n case Model.HasManyRelation:\n case Model.HasOneRelation:\n return {\n from: SOURCE_MODEL_KEY,\n to: `${FOREIGN_MODEL.tableName}.${opts?.to || targetClass.tableName + \"Id\"}`\n };\n case Model.ManyToManyRelation:\n case Model.HasOneThroughRelation:\n return {\n from: SOURCE_MODEL_KEY,\n through: (isRelationshipOptsWithThrough(opts) && opts.through) || {\n from: `${targetClass.tableName}_${FOREIGN_MODEL.tableName}.${targetClass.tableName}Id`,\n to: `${targetClass.tableName}_${FOREIGN_MODEL.tableName}.${FOREIGN_MODEL.tableName}Id`\n },\n to: FOREIGN_MODEL_KEY\n };\n case Model.BelongsToOneRelation:\n default:\n return {\n from: `${targetClass.tableName}.${opts?.from || propertyKey + \"Id\"}`,\n to: FOREIGN_MODEL_KEY\n };\n }\n}\n"]}
1
+ {"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":";;;AAAA,yCAA8C;AAC9C,iEAA2F;AAE3F,qCAAoC;AAEpC;;GAEG;AACH,SAAgB,cAAc,CAAC,WAAgB,EAAE,WAAgB,EAAE,WAAmB,EAAE,QAAsB,EAAE,IAAuB;IACrI,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,eAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC1F,MAAM,iBAAiB,GAAG,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;IAE7F,QAAQ,QAAQ,EAAE;QAChB,KAAK,iBAAK,CAAC,eAAe,CAAC;QAC3B,KAAK,iBAAK,CAAC,cAAc;YACvB,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC,SAAS,GAAG,IAAI,EAAE;aAC7E,CAAC;QACJ,KAAK,iBAAK,CAAC,kBAAkB,CAAC;QAC9B,KAAK,iBAAK,CAAC,qBAAqB;YAC9B,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,IAAA,gDAA6B,EAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;oBAChE,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,IAAI;oBACtF,EAAE,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI;iBACvF;gBACD,EAAE,EAAE,iBAAiB;aACtB,CAAC;QACJ,KAAK,iBAAK,CAAC,oBAAoB,CAAC;QAChC;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,GAAG,IAAI,EAAE;gBACpE,EAAE,EAAE,iBAAiB;aACtB,CAAC;KACL;AACH,CAAC;AA7BD,wCA6BC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":";;;AAAA,qCAAmE;AAInE,qDAAgD;AAEhD;;GAEG;AACH,SAAgB,yBAAyB,CAAC,CAAC,MAAM,EAAE,WAAW,CAAsB,EAAE,QAAsB,EAAE,IAAuB;IACnI,OAAO,CAAC,WAAgB,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC,WAAW,CAAC,EAAE;YACb,QAAQ;YACR,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,eAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;YAC/D,IAAI,EAAE,IAAA,+BAAc,EAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9E,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,YAAY,EAAE,IAAI,EAAE,YAAY;SACjC;KACF,CAAC,CAAC;AACL,CAAC;AAXD,8DAWC","sourcesContent":["import {DecoratorParameters, Metadata, getClass} from \"@tsed/core\";\n\nimport {RelationType} from \"objection\";\nimport {RelationshipOpts} from \"../domain/RelationshipOpts\";\nimport {createJoinKeys} from \"./createJoinKeys\";\n\n/**\n * @ignore\n */\nexport function createRelationshipMapping([target, propertyKey]: DecoratorParameters, relation: RelationType, opts?: RelationshipOpts) {\n return (targetClass: any) => ({\n [propertyKey]: {\n relation,\n modelClass: opts?.type || Metadata.getType(target, propertyKey),\n join: createJoinKeys(targetClass, target, String(propertyKey), relation, opts),\n modify: opts?.modify,\n filter: opts?.filter,\n beforeInsert: opts?.beforeInsert\n }\n });\n}\n"]}
1
+ {"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":";;;AAAA,qCAAmE;AAInE,qDAAgD;AAEhD;;GAEG;AACH,SAAgB,yBAAyB,CAAC,CAAC,MAAM,EAAE,WAAW,CAAsB,EAAE,QAAsB,EAAE,IAAuB;IACnI,OAAO,CAAC,WAAgB,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC,WAAW,CAAC,EAAE;YACb,QAAQ;YACR,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,eAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;YAC/D,IAAI,EAAE,IAAA,+BAAc,EAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9E,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,YAAY,EAAE,IAAI,EAAE,YAAY;SACjC;KACF,CAAC,CAAC;AACL,CAAC;AAXD,8DAWC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defineStaticGetter.js","sourceRoot":"","sources":["../../../src/utils/defineStaticGetter.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAEnC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAO;IAC1E,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,EAAE,WAAW,EAAE;QACzD,GAAG,EAAE,EAAE;KACR,CAAC,CAAC;AACL,CAAC;AAJD,gDAIC","sourcesContent":["import {classOf} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport function defineStaticGetter(target: any, propertyKey: string, fn: any) {\n return Object.defineProperty(classOf(target), propertyKey, {\n get: fn\n });\n}\n"]}
1
+ {"version":3,"file":"defineStaticGetter.js","sourceRoot":"","sources":["../../../src/utils/defineStaticGetter.ts"],"names":[],"mappings":";;;AAAA,qCAAmC;AAEnC;;GAEG;AACH,SAAgB,kBAAkB,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAO;IAC1E,OAAO,MAAM,CAAC,cAAc,CAAC,IAAA,cAAO,EAAC,MAAM,CAAC,EAAE,WAAW,EAAE;QACzD,GAAG,EAAE,EAAE;KACR,CAAC,CAAC;AACL,CAAC;AAJD,gDAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getColumnCtx.js","sourceRoot":"","sources":["../../../src/utils/getColumnCtx.ts"],"names":[],"mappings":";;;AAWA;;GAEG;AACH,SAAgB,YAAY,CAAC,MAAuB;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,EAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAsB,WAAW,EAAE,EAAE,CAAC,CAAC;IAExG,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC;AAC/C,CAAC;AALD,oCAKC","sourcesContent":["import {JsonEntityStore} from \"@tsed/schema\";\nimport {ColumnOpts} from \"../domain/ColumnOpts\";\n\n/**\n * @ignore\n */\nexport interface ColumnCtx extends ColumnOpts {\n entity: JsonEntityStore;\n schema: any;\n}\n\n/**\n * @ignore\n */\nexport function getColumnCtx(entity: JsonEntityStore): ColumnCtx {\n const schema = entity.schema.toJSON();\n const {columnType = schema.type, options = {}} = entity.store.get<Partial<ColumnOpts>>(\"objection\", {});\n\n return {entity, columnType, options, schema};\n}\n"]}
1
+ {"version":3,"file":"getColumnCtx.js","sourceRoot":"","sources":["../../../src/utils/getColumnCtx.ts"],"names":[],"mappings":";;;AAWA;;GAEG;AACH,SAAgB,YAAY,CAAC,MAAuB;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,EAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAsB,WAAW,EAAE,EAAE,CAAC,CAAC;IAExG,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC;AAC/C,CAAC;AALD,oCAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":";;;AAAA,mDAA2C;AAE3C;;GAEG;AACU,QAAA,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;GAEG;AACH,SAAgB,0BAA0B,CAAC,MAAW;IACpD,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAA0B,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;SAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AALD,gEAKC","sourcesContent":["import {getColumns} from \"./createColumns\";\n\n/**\n * @ignore\n */\nexport const OBJECTION_RELATIONSHIP_KEY = \"objectionRelationship\";\n\n/**\n * @ignore\n */\nexport function getJsonEntityRelationships(target: any) {\n return getColumns(target)\n .filter((col) => col.store.get(OBJECTION_RELATIONSHIP_KEY))\n .map((col) => col.store.get(OBJECTION_RELATIONSHIP_KEY)(target))\n .reduce((dict, col) => ({...dict, ...col}), {});\n}\n"]}
1
+ {"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":";;;AAAA,mDAA2C;AAE3C;;GAEG;AACU,QAAA,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;GAEG;AACH,SAAgB,0BAA0B,CAAC,MAAW;IACpD,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAA0B,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kCAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;SAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AALD,gEAKC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAEtE;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAY;IAC/E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n/**\n * @ignore\n */\nexport function createBooleanColumn(table: Knex.TableBuilder, {entity}: ColumnCtx) {\n table.boolean(entity.propertyName);\n}\n\nColumnTypesContainer.set(\"boolean\", createBooleanColumn);\n"]}
1
+ {"version":3,"file":"createBooleanColumn.js","sourceRoot":"","sources":["../../../src/components/createBooleanColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAEtE;;GAEG;AACH,MAAM,UAAU,mBAAmB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAY;IAC/E,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;AACrC,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,SAAS,EAAE,mBAAmB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACnF,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM;QACR,KAAK,YAAY;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;KACrE;AACH,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {ColumnCtx} from \"../utils/getColumnCtx\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport type {Knex} from \"knex\";\nimport {randomUUID} from \"crypto\";\n\n/**\n * @ignore\n */\nexport function createIdColumn(table: Knex.TableBuilder, {entity, options}: ColumnCtx) {\n switch (options.type) {\n case \"bigIncrements\":\n table.bigIncrements(entity.propertyName).primary();\n break;\n case \"increments\":\n table.increments(entity.propertyName).primary();\n break;\n case \"uuid\":\n table.uuid(entity.propertyName).primary().defaultTo(randomUUID());\n }\n}\n\nColumnTypesContainer.set(\"idColumn\", createIdColumn);\n"]}
1
+ {"version":3,"file":"createIdColumn.js","sourceRoot":"","sources":["../../../src/components/createIdColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAEtE,OAAO,EAAC,UAAU,EAAC,MAAM,QAAQ,CAAC;AAElC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACnF,QAAQ,OAAO,CAAC,IAAI,EAAE;QACpB,KAAK,eAAe;YAClB,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YACnD,MAAM;QACR,KAAK,YAAY;YACf,KAAK,CAAC,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;YAChD,MAAM;QACR,KAAK,MAAM;YACT,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC,CAAC;KACrE;AACH,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,UAAU,EAAE,cAAc,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAGtE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACvF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createNumberColumn(table: Knex.TableBuilder, {entity, options}: ColumnCtx) {\n table.decimal(entity.propertyName, options.precision, options.scale);\n}\n\nColumnTypesContainer.set(\"number\", createNumberColumn);\n"]}
1
+ {"version":3,"file":"createNumberColumn.js","sourceRoot":"","sources":["../../../src/components/createNumberColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAGtE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,OAAO,EAAY;IACvF,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;AACvE,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAGtE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,MAAM,EAAY;IACtF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createStringColumn(table: Knex.TableBuilder, {entity, schema}: ColumnCtx) {\n table.string(entity.propertyName, schema.maxLength);\n}\n\nColumnTypesContainer.set(\"string\", createStringColumn);\n"]}
1
+ {"version":3,"file":"createStringColumn.js","sourceRoot":"","sources":["../../../src/components/createStringColumn.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAGtE;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,KAAwB,EAAE,EAAC,MAAM,EAAE,MAAM,EAAY;IACtF,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC;AACtD,CAAC;AAED,oBAAoB,CAAC,GAAG,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAqC;IAChE,OAAO,SAAS,CAAC,KAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import {Model} from \"objection\";\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithoutThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function BelongsToOne(opts?: RelationshipOptsWithoutThrough): PropertyDecorator {\n return RelatesTo(Model.BelongsToOneRelation, opts);\n}\n"]}
1
+ {"version":3,"file":"belongsToOne.js","sourceRoot":"","sources":["../../../src/decorators/belongsToOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,IAAqC;IAChE,OAAO,SAAS,CAAC,KAAK,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"columnOptions.js","sourceRoot":"","sources":["../../../src/decorators/columnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpC;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAA4B;IACxD,OAAO,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAQ,CAAC;AAC/C,CAAC","sourcesContent":["import {StoreSet} from \"@tsed/core\";\nimport type {ColumnOpts} from \"../domain/ColumnOpts\";\n\n/**\n *\n * @param options\n * @decorator\n * @objection\n */\nexport function ColumnOptions(options: Partial<ColumnOpts>): PropertyDecorator {\n return StoreSet(\"objection\", options) as any;\n}\n"]}
1
+ {"version":3,"file":"columnOptions.js","sourceRoot":"","sources":["../../../src/decorators/columnOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAGpC;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAA4B;IACxD,OAAO,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAQ,CAAC;AAC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAO9C;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,UAA0B,EAAE;IAClD,OAAO,aAAa,CAClB,QAAQ,EAAE,EACV,aAAa,CAAC;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,EACF,QAAQ,CAAC,WAAW,EAAE;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import {StoreSet, useDecorators} from \"@tsed/core\";\nimport {Property} from \"@tsed/schema\";\nimport {ColumnOptions} from \"./columnOptions\";\n\nexport interface DecimalOptions {\n precision?: number | null;\n scale?: number;\n}\n\n/**\n *\n * @param options\n * @decorator\n * @objection\n */\nexport function Decimal(options: DecimalOptions = {}) {\n return useDecorators(\n Property(),\n ColumnOptions({\n columnType: \"number\",\n options: {\n type: \"decimal\",\n ...options\n }\n }),\n StoreSet(\"objection\", {\n columnType: \"number\",\n options: {\n type: \"decimal\",\n ...options\n }\n })\n );\n}\n"]}
1
+ {"version":3,"file":"decimal.js","sourceRoot":"","sources":["../../../src/decorators/decimal.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAO9C;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,UAA0B,EAAE;IAClD,OAAO,aAAa,CAClB,QAAQ,EAAE,EACV,aAAa,CAAC;QACZ,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,EACF,QAAQ,CAAC,WAAW,EAAE;QACpB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE;YACP,IAAI,EAAE,SAAS;YACf,GAAG,OAAO;SACX;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,0BAA0B,EAAC,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,SAAiB;IACtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC5D,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzD,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;QACtE,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,wBAAwB,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;QACrH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import {Type} from \"@tsed/core\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\nimport {getJsonEntityRelationships} from \"../utils/getJsonEntityRelationships\";\nimport {getJsonSchema} from \"@tsed/schema\";\n\n/**\n *\n * @param tableName\n * @decorator\n * @objection\n */\nexport function Entity(tableName: string): ClassDecorator {\n if (!tableName) {\n throw new Error(\"Please provide a table name\");\n }\n\n return (target: any) => {\n const originalRelationMappings = target[\"relationMappings\"];\n defineStaticGetter(target, \"tableName\", () => tableName);\n defineStaticGetter(target, \"jsonSchema\", () => getJsonSchema(target));\n defineStaticGetter(target, \"relationMappings\", () => originalRelationMappings || getJsonEntityRelationships(target));\n return target;\n };\n}\n\nexport interface EntityMethods<T> extends Type<T> {\n readonly tableName: string;\n}\n"]}
1
+ {"version":3,"file":"entity.js","sourceRoot":"","sources":["../../../src/decorators/entity.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,0BAA0B,EAAC,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAC,aAAa,EAAC,MAAM,cAAc,CAAC;AAE3C;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,SAAiB;IACtC,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;KAChD;IAED,OAAO,CAAC,MAAW,EAAE,EAAE;QACrB,MAAM,wBAAwB,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QAC5D,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QACzD,kBAAkB,CAAC,MAAM,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,CAAC;QACtE,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,GAAG,EAAE,CAAC,wBAAwB,IAAI,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;QACrH,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAyB,EAAE,IAAkC;IACnF,OAAO,SAAS,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import {Model, ModelClassSpecifier} from \"objection\";\n\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function HasMany(type: ModelClassSpecifier, opts?: RelationshipOptsWithThrough): PropertyDecorator {\n return RelatesTo(Model.HasManyRelation, {...opts, type});\n}\n"]}
1
+ {"version":3,"file":"hasMany.js","sourceRoot":"","sources":["../../../src/decorators/hasMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,OAAO,CAAC,IAAyB,EAAE,IAAkC;IACnF,OAAO,SAAS,CAAC,KAAK,CAAC,eAAe,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,IAAqC;IAC1D,OAAO,SAAS,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC","sourcesContent":["import {Model} from \"objection\";\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithoutThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function HasOne(opts?: RelationshipOptsWithoutThrough): PropertyDecorator {\n return RelatesTo(Model.HasOneRelation, opts);\n}\n"]}
1
+ {"version":3,"file":"hasOne.js","sourceRoot":"","sources":["../../../src/decorators/hasOne.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,MAAM,CAAC,IAAqC;IAC1D,OAAO,SAAS,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAkC;IACtE,OAAO,SAAS,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import {RelationshipOptsWithThrough, RelationshipOptsWithoutThrough} from \"../domain/RelationshipOpts\";\n\nimport {Model} from \"objection\";\nimport {RelatesTo} from \"./relatesTo\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function HasOneThroughRelation(opts?: RelationshipOptsWithThrough): PropertyDecorator {\n return RelatesTo(Model.HasOneThroughRelation, opts);\n}\n"]}
1
+ {"version":3,"file":"hasOneThroughRelation.js","sourceRoot":"","sources":["../../../src/decorators/hasOneThroughRelation.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAChC,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAkC;IACtE,OAAO,SAAS,CAAC,KAAK,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAgD,YAAY;IACnF,OAAO,aAAa,CAClB,QAAQ,EAAE,EACV,aAAa,CAAC;QACZ,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,EACF,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACnC,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC","sourcesContent":["import {ColumnOptions} from \"./columnOptions\";\nimport {Property} from \"@tsed/schema\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\nimport {useDecorators} from \"@tsed/core\";\n\n/**\n *\n * @param type\n * @decorator\n * @objection\n */\nexport function IdColumn(type: \"uuid\" | \"increments\" | \"bigIncrements\" = \"increments\"): PropertyDecorator {\n return useDecorators(\n Property(),\n ColumnOptions({\n columnType: \"idColumn\",\n options: {\n type\n }\n }),\n (target: any, propertyKey: string) => {\n defineStaticGetter(target, \"idColumn\", () => propertyKey);\n }\n );\n}\n"]}
1
+ {"version":3,"file":"idColumn.js","sourceRoot":"","sources":["../../../src/decorators/idColumn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,kBAAkB,EAAC,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAC,aAAa,EAAC,MAAM,YAAY,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAgD,YAAY;IACnF,OAAO,aAAa,CAClB,QAAQ,EAAE,EACV,aAAa,CAAC;QACZ,UAAU,EAAE,UAAU;QACtB,OAAO,EAAE;YACP,IAAI;SACL;KACF,CAAC,EACF,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAE;QACnC,kBAAkB,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5D,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAyB,EAAE,IAAkC;IACtF,OAAO,SAAS,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9D,CAAC","sourcesContent":["import {Model, ModelClassSpecifier} from \"objection\";\n\nimport {RelatesTo} from \"./relatesTo\";\nimport {RelationshipOptsWithThrough} from \"../domain/RelationshipOpts\";\n\n/**\n *\n * @param opts\n * @decorator\n * @objection\n */\nexport function ManyToMany(type: ModelClassSpecifier, opts?: RelationshipOptsWithThrough): PropertyDecorator {\n return RelatesTo(Model.ManyToManyRelation, {...opts, type});\n}\n"]}
1
+ {"version":3,"file":"manyToMany.js","sourceRoot":"","sources":["../../../src/decorators/manyToMany.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAsB,MAAM,WAAW,CAAC;AAErD,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AAGtC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,IAAyB,EAAE,IAAkC;IACtF,OAAO,SAAS,CAAC,KAAK,CAAC,kBAAkB,EAAE,EAAC,GAAG,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;AAC9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAmB,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAElD,OAAO,EAAC,0BAA0B,EAAC,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAAsB,EAAE,IAAuB;IACvE,OAAO,aAAa,CAClB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EACjD,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,GAAG,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CACH,CAAC;AACJ,CAAC","sourcesContent":["import {CollectionOf, Property} from \"@tsed/schema\";\nimport {RelationshipOpts, isModelClassFactory} from \"../domain/RelationshipOpts\";\nimport {StoreFn, useDecorators} from \"@tsed/core\";\n\nimport {OBJECTION_RELATIONSHIP_KEY} from \"../utils/getJsonEntityRelationships\";\nimport {RelationType} from \"objection\";\nimport {createRelationshipMapping} from \"../utils/createRelationshipMapping\";\n\n/**\n *\n * @param relation\n * @param opts\n * @decorator\n * @objection\n */\nexport function RelatesTo(relation: RelationType, opts?: RelationshipOpts): PropertyDecorator {\n return useDecorators(\n opts?.type ? CollectionOf(opts.type) : Property(),\n StoreFn((store, params) => {\n if (opts && isModelClassFactory(opts.type)) {\n opts.type = opts.type();\n }\n store.set(OBJECTION_RELATIONSHIP_KEY, createRelationshipMapping(params, relation, opts));\n })\n );\n}\n"]}
1
+ {"version":3,"file":"relatesTo.js","sourceRoot":"","sources":["../../../src/decorators/relatesTo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,QAAQ,EAAC,MAAM,cAAc,CAAC;AACpD,OAAO,EAAmB,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AACjF,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,YAAY,CAAC;AAElD,OAAO,EAAC,0BAA0B,EAAC,MAAM,qCAAqC,CAAC;AAE/E,OAAO,EAAC,yBAAyB,EAAC,MAAM,oCAAoC,CAAC;AAE7E;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,QAAsB,EAAE,IAAuB;IACvE,OAAO,aAAa,CAClB,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EACjD,OAAO,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACxB,IAAI,IAAI,IAAI,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YAC1C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;SACzB;QACD,KAAK,CAAC,GAAG,CAAC,0BAA0B,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnOpts.js","sourceRoot":"","sources":["../../../src/domain/ColumnOpts.ts"],"names":[],"mappings":"","sourcesContent":["export interface ColumnOpts {\n columnType: \"idColumn\" | \"string\" | \"number\" | \"boolean\";\n options: any;\n}\n"]}
1
+ {"version":3,"file":"ColumnOpts.js","sourceRoot":"","sources":["../../../src/domain/ColumnOpts.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipOpts.js","sourceRoot":"","sources":["../../../src/domain/RelationshipOpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAShD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAAuB,EAAuC,EAAE,CAC5G,IAAI,KAAK,SAAS,IAAkC,IAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AAElF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAA0B,EAA6B,EAAE,CAC3F,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC","sourcesContent":["import {isFunction, isString} from \"@tsed/core\";\nimport {ModelClassFactory, ModelClassSpecifier, RelationJoin, RelationMapping} from \"objection\";\n\nexport type RelationshipOptsWithThrough = Partial<RelationJoin> & Omit<RelationMapping<any>, \"relation\" | \"join\" | \"modelClass\">;\n\nexport type RelationshipOptsWithoutThrough = Omit<RelationshipOptsWithThrough, \"through\">;\n\nexport type RelationshipOpts = (RelationshipOptsWithThrough | RelationshipOptsWithoutThrough) & {type?: ModelClassSpecifier};\n\nexport const isRelationshipOptsWithThrough = (opts?: RelationshipOpts): opts is RelationshipOptsWithThrough =>\n opts !== undefined && (<RelationshipOptsWithThrough>opts).through !== undefined;\n\nexport const isModelClassFactory = (type?: ModelClassSpecifier): type is ModelClassFactory =>\n type !== undefined && !isString(type) && isFunction(type) && !(\"prototype\" in type);\n"]}
1
+ {"version":3,"file":"RelationshipOpts.js","sourceRoot":"","sources":["../../../src/domain/RelationshipOpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,YAAY,CAAC;AAShD,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,IAAuB,EAAuC,EAAE,CAC5G,IAAI,KAAK,SAAS,IAAkC,IAAK,CAAC,OAAO,KAAK,SAAS,CAAC;AAElF,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,IAA0B,EAA6B,EAAE,CAC3F,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,IAAI,IAAI,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/domain/interfaces.ts"],"names":[],"mappings":"","sourcesContent":["import {Knex} from \"knex\";\n\ndeclare global {\n namespace TsED {\n interface Configuration {\n knex: Knex.Config;\n }\n }\n}\n"]}
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../../src/domain/interfaces.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC","sourcesContent":["/**\n * @file Automatically generated by barrelsby.\n */\n\nexport * from \"./components/createBooleanColumn\";\nexport * from \"./components/createIdColumn\";\nexport * from \"./components/createNumberColumn\";\nexport * from \"./components/createStringColumn\";\nexport * from \"./decorators/belongsToOne\";\nexport * from \"./decorators/columnOptions\";\nexport * from \"./decorators/decimal\";\nexport * from \"./decorators/entity\";\nexport * from \"./decorators/hasMany\";\nexport * from \"./decorators/hasOne\";\nexport * from \"./decorators/hasOneThroughRelation\";\nexport * from \"./decorators/idColumn\";\nexport * from \"./decorators/manyToMany\";\nexport * from \"./decorators/relatesTo\";\nexport * from \"./domain/ColumnOpts\";\nexport * from \"./domain/RelationshipOpts\";\nexport * from \"./domain/interfaces\";\nexport * from \"./services/ColumnTypesContainer\";\nexport * from \"./services/ObjectionConnection\";\nexport * from \"./utils/connect\";\nexport * from \"./utils/createColumns\";\nexport * from \"./utils/createJoinKeys\";\nexport * from \"./utils/createRelationshipMapping\";\nexport * from \"./utils/defineStaticGetter\";\nexport * from \"./utils/getColumnCtx\";\nexport * from \"./utils/getJsonEntityRelationships\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,cAAc,kCAAkC,CAAC;AACjD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mCAAmC,CAAC;AAClD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sBAAsB,CAAC;AACrC,cAAc,oCAAoC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnTypesContainer.js","sourceRoot":"","sources":["../../../src/services/ColumnTypesContainer.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAoE,IAAI,GAAG,EAAE,CAAC","sourcesContent":["import type {Knex} from \"knex\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport const ColumnTypesContainer: Map<string, (table: Knex.TableBuilder, ctx: ColumnCtx) => void> = new Map();\n"]}
1
+ {"version":3,"file":"ColumnTypesContainer.js","sourceRoot":"","sources":["../../../src/services/ColumnTypesContainer.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAoE,IAAI,GAAG,EAAE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAGrE,gBAAgB,CAAC;IACf,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,CAAC,aAAa,CAAC;IACrB,KAAK,CAAC,eAAe,CAAC,aAA4B;QAChD,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAc,MAAM,CAAE,CAAC;QAElE,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;aAC5C;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import {Configuration, registerProvider} from \"@tsed/di\";\nimport type {Knex} from \"knex\";\nimport {createConnection} from \"../utils/connect\";\n\nexport const OBJECTION_CONNECTION = Symbol.for(\"DEFAULT_CONNECTION\");\nexport type OBJECTION_CONNECTION = Knex<any, unknown[]>;\n\nregisterProvider({\n provide: OBJECTION_CONNECTION,\n deps: [Configuration],\n async useAsyncFactory(configuration: Configuration) {\n const connectionOptions = configuration.get<Knex.Config>(\"knex\")!;\n\n if (connectionOptions) {\n try {\n return createConnection(connectionOptions);\n } catch (er) {\n // istanbul ignore next\n console.error(er);\n }\n }\n\n return {};\n }\n});\n"]}
1
+ {"version":3,"file":"ObjectionConnection.js","sourceRoot":"","sources":["../../../src/services/ObjectionConnection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAE,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAC,gBAAgB,EAAC,MAAM,kBAAkB,CAAC;AAElD,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;AAGrE,gBAAgB,CAAC;IACf,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,CAAC,aAAa,CAAC;IACrB,KAAK,CAAC,eAAe,CAAC,aAA4B;QAChD,MAAM,iBAAiB,GAAG,aAAa,CAAC,GAAG,CAAc,MAAM,CAAE,CAAC;QAElE,IAAI,iBAAiB,EAAE;YACrB,IAAI;gBACF,OAAO,gBAAgB,CAAC,iBAAiB,CAAC,CAAC;aAC5C;YAAC,OAAO,EAAE,EAAE;gBACX,uBAAuB;gBACvB,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;aACnB;SACF;QAED,OAAO,EAAE,CAAC;IACZ,CAAC;CACF,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../src/utils/connect.ts"],"names":[],"mappings":"AAAA,OAAO,IAAY,MAAM,MAAM,CAAC;AAChC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAEhC,MAAM,UAAU,gBAAgB,CAAC,iBAA8B;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC3C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEvB,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import knex, {Knex} from \"knex\";\nimport {Model} from \"objection\";\n\nexport function createConnection(connectionOptions: Knex.Config): Knex {\n const connection = knex(connectionOptions);\n Model.knex(connection);\n\n return connection;\n}\n"]}
1
+ {"version":3,"file":"connect.js","sourceRoot":"","sources":["../../../src/utils/connect.ts"],"names":[],"mappings":"AAAA,OAAO,IAAY,MAAM,MAAM,CAAC;AAChC,OAAO,EAAC,KAAK,EAAC,MAAM,WAAW,CAAC;AAEhC,MAAM,UAAU,gBAAgB,CAAC,iBAA8B;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,CAAC;IAC3C,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAEvB,OAAO,UAAU,CAAC;AACpB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAkB,MAAM,cAAc,CAAC;AAE5D,OAAO,mCAAmC,CAAC;AAC3C,OAAO,8BAA8B,CAAC;AACtC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB,EAAE,MAAuB;IAC5E,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7C,MAAM,eAAe,GAAG,CAAC,UAAU,oFAAoF,CAAC;KACzH;IAED,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACtG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB,EAAE,KAAU;IAChE,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {getProperties, JsonEntityStore} from \"@tsed/schema\";\nimport {Knex} from \"knex\";\nimport \"../components/createBooleanColumn\";\nimport \"../components/createIdColumn\";\nimport \"../components/createNumberColumn\";\nimport \"../components/createStringColumn\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {getColumnCtx} from \"./getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createColumn(table: Knex.TableBuilder, entity: JsonEntityStore) {\n const ctx = getColumnCtx(entity);\n\n if (!ColumnTypesContainer.has(ctx.columnType)) {\n throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;\n }\n\n ColumnTypesContainer.get(ctx.columnType)!(table, ctx);\n}\n\n/**\n * @ignore\n */\nexport function getColumns(model: any) {\n return [...getProperties(model, {withIgnoredProps: true, objection: true, groups: false}).values()];\n}\n\n/**\n * @ignore\n */\nexport function createColumns(table: Knex.TableBuilder, model: any) {\n getColumns(model).map((entity) => {\n createColumn(table, entity);\n });\n}\n"]}
1
+ {"version":3,"file":"createColumns.js","sourceRoot":"","sources":["../../../src/utils/createColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAkB,MAAM,cAAc,CAAC;AAE5D,OAAO,mCAAmC,CAAC;AAC3C,OAAO,8BAA8B,CAAC;AACtC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAE5C;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,KAAwB,EAAE,MAAuB;IAC5E,MAAM,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;QAC7C,MAAM,eAAe,GAAG,CAAC,UAAU,oFAAoF,CAAC;KACzH;IAED,oBAAoB,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,KAAU;IACnC,OAAO,CAAC,GAAG,aAAa,CAAC,KAAK,EAAE,EAAC,gBAAgB,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;AACtG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,KAAwB,EAAE,KAAU;IAChE,UAAU,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAC/B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAe,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAmB,6BAA6B,EAAC,MAAM,4BAA4B,CAAC;AAE3F,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,WAAgB,EAAE,WAAgB,EAAE,WAAmB,EAAE,QAAsB,EAAE,IAAuB;IACrI,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC1F,MAAM,iBAAiB,GAAG,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;IAE7F,QAAQ,QAAQ,EAAE;QAChB,KAAK,KAAK,CAAC,eAAe,CAAC;QAC3B,KAAK,KAAK,CAAC,cAAc;YACvB,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC,SAAS,GAAG,IAAI,EAAE;aAC7E,CAAC;QACJ,KAAK,KAAK,CAAC,kBAAkB,CAAC;QAC9B,KAAK,KAAK,CAAC,qBAAqB;YAC9B,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;oBAChE,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,IAAI;oBACtF,EAAE,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI;iBACvF;gBACD,EAAE,EAAE,iBAAiB;aACtB,CAAC;QACJ,KAAK,KAAK,CAAC,oBAAoB,CAAC;QAChC;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,GAAG,IAAI,EAAE;gBACpE,EAAE,EAAE,iBAAiB;aACtB,CAAC;KACL;AACH,CAAC","sourcesContent":["import {Model, RelationType} from \"objection\";\nimport {RelationshipOpts, isRelationshipOptsWithThrough} from \"../domain/RelationshipOpts\";\n\nimport {Metadata} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport function createJoinKeys(targetClass: any, targetSuper: any, propertyKey: string, relation: RelationType, opts?: RelationshipOpts) {\n const FOREIGN_MODEL = opts?.type || Metadata.getType(targetSuper, propertyKey);\n const SOURCE_MODEL_KEY = `${targetClass.tableName}.${opts?.from || targetClass.idColumn}`;\n const FOREIGN_MODEL_KEY = `${FOREIGN_MODEL.tableName}.${opts?.to || FOREIGN_MODEL.idColumn}`;\n\n switch (relation) {\n case Model.HasManyRelation:\n case Model.HasOneRelation:\n return {\n from: SOURCE_MODEL_KEY,\n to: `${FOREIGN_MODEL.tableName}.${opts?.to || targetClass.tableName + \"Id\"}`\n };\n case Model.ManyToManyRelation:\n case Model.HasOneThroughRelation:\n return {\n from: SOURCE_MODEL_KEY,\n through: (isRelationshipOptsWithThrough(opts) && opts.through) || {\n from: `${targetClass.tableName}_${FOREIGN_MODEL.tableName}.${targetClass.tableName}Id`,\n to: `${targetClass.tableName}_${FOREIGN_MODEL.tableName}.${FOREIGN_MODEL.tableName}Id`\n },\n to: FOREIGN_MODEL_KEY\n };\n case Model.BelongsToOneRelation:\n default:\n return {\n from: `${targetClass.tableName}.${opts?.from || propertyKey + \"Id\"}`,\n to: FOREIGN_MODEL_KEY\n };\n }\n}\n"]}
1
+ {"version":3,"file":"createJoinKeys.js","sourceRoot":"","sources":["../../../src/utils/createJoinKeys.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,EAAe,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAmB,6BAA6B,EAAC,MAAM,4BAA4B,CAAC;AAE3F,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AAEpC;;GAEG;AACH,MAAM,UAAU,cAAc,CAAC,WAAgB,EAAE,WAAgB,EAAE,WAAmB,EAAE,QAAsB,EAAE,IAAuB;IACrI,MAAM,aAAa,GAAG,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,CAAC,QAAQ,EAAE,CAAC;IAC1F,MAAM,iBAAiB,GAAG,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC;IAE7F,QAAQ,QAAQ,EAAE;QAChB,KAAK,KAAK,CAAC,eAAe,CAAC;QAC3B,KAAK,KAAK,CAAC,cAAc;YACvB,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,EAAE,EAAE,GAAG,aAAa,CAAC,SAAS,IAAI,IAAI,EAAE,EAAE,IAAI,WAAW,CAAC,SAAS,GAAG,IAAI,EAAE;aAC7E,CAAC;QACJ,KAAK,KAAK,CAAC,kBAAkB,CAAC;QAC9B,KAAK,KAAK,CAAC,qBAAqB;YAC9B,OAAO;gBACL,IAAI,EAAE,gBAAgB;gBACtB,OAAO,EAAE,CAAC,6BAA6B,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI;oBAChE,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,WAAW,CAAC,SAAS,IAAI;oBACtF,EAAE,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI,aAAa,CAAC,SAAS,IAAI;iBACvF;gBACD,EAAE,EAAE,iBAAiB;aACtB,CAAC;QACJ,KAAK,KAAK,CAAC,oBAAoB,CAAC;QAChC;YACE,OAAO;gBACL,IAAI,EAAE,GAAG,WAAW,CAAC,SAAS,IAAI,IAAI,EAAE,IAAI,IAAI,WAAW,GAAG,IAAI,EAAE;gBACpE,EAAE,EAAE,iBAAiB;aACtB,CAAC;KACL;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAW,MAAM,YAAY,CAAC;AAInE,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,CAAC,MAAM,EAAE,WAAW,CAAsB,EAAE,QAAsB,EAAE,IAAuB;IACnI,OAAO,CAAC,WAAgB,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC,WAAW,CAAC,EAAE;YACb,QAAQ;YACR,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;YAC/D,IAAI,EAAE,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9E,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,YAAY,EAAE,IAAI,EAAE,YAAY;SACjC;KACF,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {DecoratorParameters, Metadata, getClass} from \"@tsed/core\";\n\nimport {RelationType} from \"objection\";\nimport {RelationshipOpts} from \"../domain/RelationshipOpts\";\nimport {createJoinKeys} from \"./createJoinKeys\";\n\n/**\n * @ignore\n */\nexport function createRelationshipMapping([target, propertyKey]: DecoratorParameters, relation: RelationType, opts?: RelationshipOpts) {\n return (targetClass: any) => ({\n [propertyKey]: {\n relation,\n modelClass: opts?.type || Metadata.getType(target, propertyKey),\n join: createJoinKeys(targetClass, target, String(propertyKey), relation, opts),\n modify: opts?.modify,\n filter: opts?.filter,\n beforeInsert: opts?.beforeInsert\n }\n });\n}\n"]}
1
+ {"version":3,"file":"createRelationshipMapping.js","sourceRoot":"","sources":["../../../src/utils/createRelationshipMapping.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,QAAQ,EAAW,MAAM,YAAY,CAAC;AAInE,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,CAAC,MAAM,EAAE,WAAW,CAAsB,EAAE,QAAsB,EAAE,IAAuB;IACnI,OAAO,CAAC,WAAgB,EAAE,EAAE,CAAC,CAAC;QAC5B,CAAC,WAAW,CAAC,EAAE;YACb,QAAQ;YACR,UAAU,EAAE,IAAI,EAAE,IAAI,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,CAAC;YAC/D,IAAI,EAAE,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,CAAC,WAAW,CAAC,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC9E,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,MAAM,EAAE,IAAI,EAAE,MAAM;YACpB,YAAY,EAAE,IAAI,EAAE,YAAY;SACjC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defineStaticGetter.js","sourceRoot":"","sources":["../../../src/utils/defineStaticGetter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAO;IAC1E,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE;QACzD,GAAG,EAAE,EAAE;KACR,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {classOf} from \"@tsed/core\";\n\n/**\n * @ignore\n */\nexport function defineStaticGetter(target: any, propertyKey: string, fn: any) {\n return Object.defineProperty(classOf(target), propertyKey, {\n get: fn\n });\n}\n"]}
1
+ {"version":3,"file":"defineStaticGetter.js","sourceRoot":"","sources":["../../../src/utils/defineStaticGetter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,YAAY,CAAC;AAEnC;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAW,EAAE,WAAmB,EAAE,EAAO;IAC1E,OAAO,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,WAAW,EAAE;QACzD,GAAG,EAAE,EAAE;KACR,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getColumnCtx.js","sourceRoot":"","sources":["../../../src/utils/getColumnCtx.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAuB;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,EAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAsB,WAAW,EAAE,EAAE,CAAC,CAAC;IAExG,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC;AAC/C,CAAC","sourcesContent":["import {JsonEntityStore} from \"@tsed/schema\";\nimport {ColumnOpts} from \"../domain/ColumnOpts\";\n\n/**\n * @ignore\n */\nexport interface ColumnCtx extends ColumnOpts {\n entity: JsonEntityStore;\n schema: any;\n}\n\n/**\n * @ignore\n */\nexport function getColumnCtx(entity: JsonEntityStore): ColumnCtx {\n const schema = entity.schema.toJSON();\n const {columnType = schema.type, options = {}} = entity.store.get<Partial<ColumnOpts>>(\"objection\", {});\n\n return {entity, columnType, options, schema};\n}\n"]}
1
+ {"version":3,"file":"getColumnCtx.js","sourceRoot":"","sources":["../../../src/utils/getColumnCtx.ts"],"names":[],"mappings":"AAWA;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAuB;IAClD,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;IACtC,MAAM,EAAC,UAAU,GAAG,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,EAAE,EAAC,GAAG,MAAM,CAAC,KAAK,CAAC,GAAG,CAAsB,WAAW,EAAE,EAAE,CAAC,CAAC;IAExG,OAAO,EAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,EAAC,CAAC;AAC/C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAW;IACpD,OAAO,UAAU,CAAC,MAAM,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;SAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC","sourcesContent":["import {getColumns} from \"./createColumns\";\n\n/**\n * @ignore\n */\nexport const OBJECTION_RELATIONSHIP_KEY = \"objectionRelationship\";\n\n/**\n * @ignore\n */\nexport function getJsonEntityRelationships(target: any) {\n return getColumns(target)\n .filter((col) => col.store.get(OBJECTION_RELATIONSHIP_KEY))\n .map((col) => col.store.get(OBJECTION_RELATIONSHIP_KEY)(target))\n .reduce((dict, col) => ({...dict, ...col}), {});\n}\n"]}
1
+ {"version":3,"file":"getJsonEntityRelationships.js","sourceRoot":"","sources":["../../../src/utils/getJsonEntityRelationships.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,uBAAuB,CAAC;AAElE;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,MAAW;IACpD,OAAO,UAAU,CAAC,MAAM,CAAC;SACtB,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC;SAC1D,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAC,MAAM,CAAC,CAAC;SAC/D,MAAM,CAAC,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAC,GAAG,IAAI,EAAE,GAAG,GAAG,EAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC"}