@tsed/objection 7.0.0-alpha.1 → 7.0.0-beta.10

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 (95) hide show
  1. package/lib/cjs/components/createBooleanColumn.js +13 -0
  2. package/lib/cjs/components/createBooleanColumn.js.map +1 -0
  3. package/lib/cjs/components/createIdColumn.js +18 -0
  4. package/lib/cjs/components/createIdColumn.js.map +1 -0
  5. package/lib/cjs/components/createNumberColumn.js +13 -0
  6. package/lib/cjs/components/createNumberColumn.js.map +1 -0
  7. package/lib/cjs/components/createStringColumn.js +13 -0
  8. package/lib/cjs/components/createStringColumn.js.map +1 -0
  9. package/lib/cjs/decorators/columnOptions.js +15 -0
  10. package/lib/cjs/decorators/columnOptions.js.map +1 -0
  11. package/lib/cjs/decorators/decimal.js +29 -0
  12. package/lib/cjs/decorators/decimal.js.map +1 -0
  13. package/lib/cjs/decorators/entity.js +23 -0
  14. package/lib/cjs/decorators/entity.js.map +1 -0
  15. package/lib/cjs/decorators/idColumn.js +25 -0
  16. package/lib/cjs/decorators/idColumn.js.map +1 -0
  17. package/lib/cjs/domain/ColumnOpts.js +3 -0
  18. package/lib/cjs/domain/ColumnOpts.js.map +1 -0
  19. package/lib/cjs/domain/interfaces.js +3 -0
  20. package/lib/cjs/domain/interfaces.js.map +1 -0
  21. package/lib/cjs/index.js +23 -0
  22. package/lib/cjs/index.js.map +1 -0
  23. package/lib/cjs/package.json +3 -0
  24. package/lib/cjs/services/ColumnTypesContainer.js +8 -0
  25. package/lib/cjs/services/ColumnTypesContainer.js.map +1 -0
  26. package/lib/cjs/services/ObjectionConnection.js +24 -0
  27. package/lib/cjs/services/ObjectionConnection.js.map +1 -0
  28. package/lib/cjs/utils/connect.js +13 -0
  29. package/lib/cjs/utils/connect.js.map +1 -0
  30. package/lib/cjs/utils/createColumns.js +38 -0
  31. package/lib/cjs/utils/createColumns.js.map +1 -0
  32. package/lib/cjs/utils/defineStaticGetter.js +14 -0
  33. package/lib/cjs/utils/defineStaticGetter.js.map +1 -0
  34. package/lib/cjs/utils/getColumnCtx.js +13 -0
  35. package/lib/cjs/utils/getColumnCtx.js.map +1 -0
  36. package/lib/esm/components/createBooleanColumn.js +9 -0
  37. package/lib/esm/components/createBooleanColumn.js.map +1 -0
  38. package/lib/esm/components/createIdColumn.js +14 -0
  39. package/lib/esm/components/createIdColumn.js.map +1 -0
  40. package/lib/esm/components/createNumberColumn.js +9 -0
  41. package/lib/esm/components/createNumberColumn.js.map +1 -0
  42. package/lib/esm/components/createStringColumn.js +9 -0
  43. package/lib/esm/components/createStringColumn.js.map +1 -0
  44. package/lib/esm/decorators/columnOptions.js +11 -0
  45. package/lib/esm/decorators/columnOptions.js.map +1 -0
  46. package/lib/esm/decorators/decimal.js +25 -0
  47. package/lib/esm/decorators/decimal.js.map +1 -0
  48. package/lib/esm/decorators/entity.js +19 -0
  49. package/lib/esm/decorators/entity.js.map +1 -0
  50. package/lib/esm/decorators/idColumn.js +21 -0
  51. package/lib/esm/decorators/idColumn.js.map +1 -0
  52. package/lib/esm/domain/ColumnOpts.js +2 -0
  53. package/lib/esm/domain/ColumnOpts.js.map +1 -0
  54. package/lib/esm/domain/interfaces.js +2 -0
  55. package/lib/esm/domain/interfaces.js.map +1 -0
  56. package/lib/esm/index.js +20 -0
  57. package/lib/esm/index.js.map +1 -0
  58. package/lib/esm/package.json +3 -0
  59. package/lib/esm/services/ColumnTypesContainer.js +5 -0
  60. package/lib/esm/services/ColumnTypesContainer.js.map +1 -0
  61. package/lib/esm/services/ObjectionConnection.js +21 -0
  62. package/lib/esm/services/ObjectionConnection.js.map +1 -0
  63. package/lib/esm/utils/connect.js +8 -0
  64. package/lib/esm/utils/connect.js.map +1 -0
  65. package/lib/esm/utils/createColumns.js +32 -0
  66. package/lib/esm/utils/createColumns.js.map +1 -0
  67. package/lib/esm/utils/defineStaticGetter.js +10 -0
  68. package/lib/esm/utils/defineStaticGetter.js.map +1 -0
  69. package/lib/esm/utils/getColumnCtx.js +9 -0
  70. package/lib/esm/utils/getColumnCtx.js.map +1 -0
  71. package/lib/{components → types/components}/createBooleanColumn.d.ts +0 -0
  72. package/lib/{components → types/components}/createIdColumn.d.ts +0 -0
  73. package/lib/{components → types/components}/createNumberColumn.d.ts +0 -0
  74. package/lib/{components → types/components}/createStringColumn.d.ts +0 -0
  75. package/lib/{decorators → types/decorators}/columnOptions.d.ts +0 -0
  76. package/lib/{decorators → types/decorators}/decimal.d.ts +0 -0
  77. package/lib/{decorators → types/decorators}/entity.d.ts +0 -0
  78. package/lib/{decorators → types/decorators}/idColumn.d.ts +0 -0
  79. package/lib/{domain → types/domain}/ColumnOpts.d.ts +0 -0
  80. package/lib/types/domain/interfaces.d.ts +8 -0
  81. package/lib/{index.d.ts → types/index.d.ts} +10 -13
  82. package/lib/{services → types/services}/ColumnTypesContainer.d.ts +0 -0
  83. package/lib/{services → types/services}/ObjectionConnection.d.ts +0 -0
  84. package/lib/{utils → types/utils}/connect.d.ts +0 -0
  85. package/lib/{utils → types/utils}/createColumns.d.ts +1 -1
  86. package/lib/{utils → types/utils}/defineStaticGetter.d.ts +0 -0
  87. package/lib/{utils → types/utils}/getColumnCtx.d.ts +0 -0
  88. package/package.json +49 -33
  89. package/readme.md +5 -7
  90. package/tsconfig.compile.esm.json +12 -0
  91. package/lib/index.js +0 -270
  92. package/lib/index.js.map +0 -1
  93. package/lib/index.modern.js +0 -253
  94. package/lib/index.modern.js.map +0 -1
  95. package/lib/utils/patchModelJson.d.ts +0 -1
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":["../src/utils/patchModelJson.ts","../src/services/ColumnTypesContainer.ts","../src/components/createStringColumn.ts","../src/components/createIdColumn.ts","../src/components/createBooleanColumn.ts","../src/components/createNumberColumn.ts","../src/utils/defineStaticGetter.ts","../src/decorators/entity.ts","../src/decorators/columnOptions.ts","../src/decorators/decimal.ts","../src/decorators/idColumn.ts","../src/utils/connect.ts","../src/services/ObjectionConnection.ts","../src/utils/getColumnCtx.ts","../src/utils/createColumns.ts"],"sourcesContent":["// patch model\nimport {classOf} from \"@tsed/core\";\nimport {serialize} from \"@tsed/json-mapper\";\nimport {Model} from \"objection\";\n\nModel.prototype.toJSON = function toJSON(opt: any) {\n const obj = this.$toJson(opt);\n\n if (opt && opt.endpoint) {\n return serialize(obj, {type: classOf(this), ...opt});\n }\n\n return obj;\n};\n","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","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","import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createIdColumn(table: Knex.TableBuilder, {entity, options}: ColumnCtx) {\n if (options.type === \"bigIncrements\") {\n table.bigIncrements(entity.propertyName).primary();\n } else {\n table.increments(entity.propertyName).primary();\n }\n}\n\nColumnTypesContainer.set(\"idColumn\", createIdColumn);\n","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","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","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","import {Type} from \"@tsed/core\";\nimport {getJsonSchema} from \"@tsed/schema\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\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 defineStaticGetter(target, \"tableName\", () => tableName);\n defineStaticGetter(target, \"jsonSchema\", () => getJsonSchema(target));\n\n return target;\n };\n}\n\nexport interface EntityMethods<T> extends Type<T> {\n readonly tableName: string;\n}\n","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","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","import {useDecorators} from \"@tsed/core\";\nimport {Property} from \"@tsed/schema\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\nimport {ColumnOptions} from \"./columnOptions\";\n\n/**\n *\n * @param type\n * @decorator\n * @objection\n */\nexport function IdColumn(type: \"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","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","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","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","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"],"names":["Model","prototype","toJSON","opt","obj","$toJson","endpoint","serialize","type","classOf","ColumnTypesContainer","Map","createStringColumn","table","entity","schema","string","propertyName","maxLength","set","createIdColumn","options","bigIncrements","primary","increments","createBooleanColumn","boolean","createNumberColumn","decimal","precision","scale","defineStaticGetter","target","propertyKey","fn","Object","defineProperty","get","Entity","tableName","Error","getJsonSchema","ColumnOptions","StoreSet","Decimal","useDecorators","Property","columnType","IdColumn","createConnection","connectionOptions","connection","knex","OBJECTION_CONNECTION","Symbol","for","registerProvider","provide","deps","Configuration","useAsyncFactory","configuration","er","console","error","getColumnCtx","store","createColumn","ctx","has","getColumns","model","getProperties","withIgnoredProps","objection","groups","values","createColumns","map"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKAA,eAAK,CAACC,SAAN,CAAgBC,MAAhB,GAAyB,SAASA,MAAT,CAAgBC,GAAhB;AACvB,QAAMC,GAAG,GAAG,KAAKC,OAAL,CAAaF,GAAb,CAAZ;;AAEA,MAAIA,GAAG,IAAIA,GAAG,CAACG,QAAf,EAAyB;AACvB,WAAOC,oBAAS,CAACH,GAAD;AAAOI,MAAAA,IAAI,EAAEC,YAAO,CAAC,IAAD;AAApB,OAA+BN,GAA/B,EAAhB;AACD;;AAED,SA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rB,UAA7B,EAA0ClC,KAA1C,EAAiDuD,GAAjD;AACD;AAED;;;;SAGgBE,WAAWC;AACzB,SAAO,CAAC,GAAGC,oBAAa,CAACD,KAAD,EAAQ;AAACE,IAAAA,gBAAgB,EAAE,IAAnB;AAAyBC,IAAAA,SAAS,EAAE,IAApC;AAA0CC,IAAAA,MAAM,EAAE;AAAlD,GAAR,CAAb,CAA+EC,MAA/E,EAAJ,CAAP;AACD;AAED;;;;SAGgBC,cAAchE,OAA0B0D;AACtDD,EAAAA,UAAU,CAACC,KAAD,CAAV,CAAkBO,GAAlB,CAAuBhE,MAAD;AACpBqD,IAAAA,YAAY,CAACtD,KAAD,EAAQC,MAAR,CAAZ;AACD,GAFD;AAGD;;;;;;;;;;;;;;;;;"}
@@ -1,253 +0,0 @@
1
- import { classOf, StoreSet, useDecorators } from '@tsed/core';
2
- import { serialize } from '@tsed/json-mapper';
3
- import { Model } from 'objection';
4
- import { getJsonSchema, Property, getProperties } from '@tsed/schema';
5
- import { registerProvider, Configuration } from '@tsed/di';
6
- import knex from 'knex';
7
-
8
- function _extends() {
9
- _extends = Object.assign || function (target) {
10
- for (var i = 1; i < arguments.length; i++) {
11
- var source = arguments[i];
12
-
13
- for (var key in source) {
14
- if (Object.prototype.hasOwnProperty.call(source, key)) {
15
- target[key] = source[key];
16
- }
17
- }
18
- }
19
-
20
- return target;
21
- };
22
-
23
- return _extends.apply(this, arguments);
24
- }
25
-
26
- Model.prototype.toJSON = function toJSON(opt) {
27
- const obj = this.$toJson(opt);
28
-
29
- if (opt && opt.endpoint) {
30
- return serialize(obj, _extends({
31
- type: classOf(this)
32
- }, opt));
33
- }
34
-
35
- return obj;
36
- };
37
-
38
- /**
39
- * @ignore
40
- */
41
- const ColumnTypesContainer = new Map();
42
-
43
- /**
44
- * @ignore
45
- */
46
-
47
- function createStringColumn(table, {
48
- entity,
49
- schema
50
- }) {
51
- table.string(entity.propertyName, schema.maxLength);
52
- }
53
- ColumnTypesContainer.set("string", createStringColumn);
54
-
55
- /**
56
- * @ignore
57
- */
58
-
59
- function createIdColumn(table, {
60
- entity,
61
- options
62
- }) {
63
- if (options.type === "bigIncrements") {
64
- table.bigIncrements(entity.propertyName).primary();
65
- } else {
66
- table.increments(entity.propertyName).primary();
67
- }
68
- }
69
- ColumnTypesContainer.set("idColumn", createIdColumn);
70
-
71
- /**
72
- * @ignore
73
- */
74
-
75
- function createBooleanColumn(table, {
76
- entity
77
- }) {
78
- table.boolean(entity.propertyName);
79
- }
80
- ColumnTypesContainer.set("boolean", createBooleanColumn);
81
-
82
- /**
83
- * @ignore
84
- */
85
-
86
- function createNumberColumn(table, {
87
- entity,
88
- options
89
- }) {
90
- table.decimal(entity.propertyName, options.precision, options.scale);
91
- }
92
- ColumnTypesContainer.set("number", createNumberColumn);
93
-
94
- /**
95
- * @ignore
96
- */
97
-
98
- function defineStaticGetter(target, propertyKey, fn) {
99
- return Object.defineProperty(classOf(target), propertyKey, {
100
- get: fn
101
- });
102
- }
103
-
104
- /**
105
- *
106
- * @param tableName
107
- * @decorator
108
- * @objection
109
- */
110
-
111
- function Entity(tableName) {
112
- if (!tableName) {
113
- throw new Error("Please provide a table name");
114
- }
115
-
116
- return target => {
117
- defineStaticGetter(target, "tableName", () => tableName);
118
- defineStaticGetter(target, "jsonSchema", () => getJsonSchema(target));
119
- return target;
120
- };
121
- }
122
-
123
- /**
124
- *
125
- * @param options
126
- * @decorator
127
- * @objection
128
- */
129
-
130
- function ColumnOptions(options) {
131
- return StoreSet("objection", options);
132
- }
133
-
134
- /**
135
- *
136
- * @param options
137
- * @decorator
138
- * @objection
139
- */
140
-
141
- function Decimal(options = {}) {
142
- return useDecorators(Property(), ColumnOptions({
143
- columnType: "number",
144
- options: _extends({
145
- type: "decimal"
146
- }, options)
147
- }), StoreSet("objection", {
148
- columnType: "number",
149
- options: _extends({
150
- type: "decimal"
151
- }, options)
152
- }));
153
- }
154
-
155
- /**
156
- *
157
- * @param type
158
- * @decorator
159
- * @objection
160
- */
161
-
162
- function IdColumn(type = "increments") {
163
- return useDecorators(Property(), ColumnOptions({
164
- columnType: "idColumn",
165
- options: {
166
- type
167
- }
168
- }), (target, propertyKey) => {
169
- defineStaticGetter(target, "idColumn", () => propertyKey);
170
- });
171
- }
172
-
173
- function createConnection(connectionOptions) {
174
- const connection = knex(connectionOptions);
175
- Model.knex(connection);
176
- return connection;
177
- }
178
-
179
- const OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION");
180
- registerProvider({
181
- provide: OBJECTION_CONNECTION,
182
- deps: [Configuration],
183
-
184
- async useAsyncFactory(configuration) {
185
- const connectionOptions = configuration.get("knex");
186
-
187
- if (connectionOptions) {
188
- try {
189
- return createConnection(connectionOptions);
190
- } catch (er) {
191
- // istanbul ignore next
192
- console.error(er);
193
- }
194
- }
195
-
196
- return {};
197
- }
198
-
199
- });
200
-
201
- /**
202
- * @ignore
203
- */
204
- function getColumnCtx(entity) {
205
- const schema = entity.schema.toJSON();
206
- const {
207
- columnType = schema.type,
208
- options = {}
209
- } = entity.store.get("objection", {});
210
- return {
211
- entity,
212
- columnType,
213
- options,
214
- schema
215
- };
216
- }
217
-
218
- /**
219
- * @ignore
220
- */
221
-
222
- function createColumn(table, entity) {
223
- const ctx = getColumnCtx(entity);
224
-
225
- if (!ColumnTypesContainer.has(ctx.columnType)) {
226
- throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;
227
- }
228
-
229
- ColumnTypesContainer.get(ctx.columnType)(table, ctx);
230
- }
231
- /**
232
- * @ignore
233
- */
234
-
235
- function getColumns(model) {
236
- return [...getProperties(model, {
237
- withIgnoredProps: true,
238
- objection: true,
239
- groups: false
240
- }).values()];
241
- }
242
- /**
243
- * @ignore
244
- */
245
-
246
- function createColumns(table, model) {
247
- getColumns(model).map(entity => {
248
- createColumn(table, entity);
249
- });
250
- }
251
-
252
- export { ColumnOptions, Decimal, Entity, IdColumn, OBJECTION_CONNECTION, createBooleanColumn, createColumn, createColumns, createConnection, createIdColumn, createNumberColumn, createStringColumn, getColumnCtx, getColumns };
253
- //# sourceMappingURL=index.modern.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.modern.js","sources":["../src/utils/patchModelJson.ts","../src/services/ColumnTypesContainer.ts","../src/components/createStringColumn.ts","../src/components/createIdColumn.ts","../src/components/createBooleanColumn.ts","../src/components/createNumberColumn.ts","../src/utils/defineStaticGetter.ts","../src/decorators/entity.ts","../src/decorators/columnOptions.ts","../src/decorators/decimal.ts","../src/decorators/idColumn.ts","../src/utils/connect.ts","../src/services/ObjectionConnection.ts","../src/utils/getColumnCtx.ts","../src/utils/createColumns.ts"],"sourcesContent":["// patch model\nimport {classOf} from \"@tsed/core\";\nimport {serialize} from \"@tsed/json-mapper\";\nimport {Model} from \"objection\";\n\nModel.prototype.toJSON = function toJSON(opt: any) {\n const obj = this.$toJson(opt);\n\n if (opt && opt.endpoint) {\n return serialize(obj, {type: classOf(this), ...opt});\n }\n\n return obj;\n};\n","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","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","import type {Knex} from \"knex\";\nimport {ColumnTypesContainer} from \"../services/ColumnTypesContainer\";\nimport {ColumnCtx} from \"../utils/getColumnCtx\";\n\n/**\n * @ignore\n */\nexport function createIdColumn(table: Knex.TableBuilder, {entity, options}: ColumnCtx) {\n if (options.type === \"bigIncrements\") {\n table.bigIncrements(entity.propertyName).primary();\n } else {\n table.increments(entity.propertyName).primary();\n }\n}\n\nColumnTypesContainer.set(\"idColumn\", createIdColumn);\n","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","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","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","import {Type} from \"@tsed/core\";\nimport {getJsonSchema} from \"@tsed/schema\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\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 defineStaticGetter(target, \"tableName\", () => tableName);\n defineStaticGetter(target, \"jsonSchema\", () => getJsonSchema(target));\n\n return target;\n };\n}\n\nexport interface EntityMethods<T> extends Type<T> {\n readonly tableName: string;\n}\n","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","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","import {useDecorators} from \"@tsed/core\";\nimport {Property} from \"@tsed/schema\";\nimport {defineStaticGetter} from \"../utils/defineStaticGetter\";\nimport {ColumnOptions} from \"./columnOptions\";\n\n/**\n *\n * @param type\n * @decorator\n * @objection\n */\nexport function IdColumn(type: \"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","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","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","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","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"],"names":["Model","prototype","toJSON","opt","obj","$toJson","endpoint","serialize","type","classOf","ColumnTypesContainer","Map","createStringColumn","table","entity","schema","string","propertyName","maxLength","set","createIdColumn","options","bigIncrements","primary","increments","createBooleanColumn","boolean","createNumberColumn","decimal","precision","scale","defineStaticGetter","target","propertyKey","fn","Object","defineProperty","get","Entity","tableName","Error","getJsonSchema","ColumnOptions","StoreSet","Decimal","useDecorators","Property","columnType","IdColumn","createConnection","connectionOptions","connection","knex","OBJECTION_CONNECTION","Symbol","for","registerProvider","provide","deps","Configuration","useAsyncFactory","configuration","er","console","error","getColumnCtx","store","createColumn","ctx","has","getColumns","model","getProperties","withIgnoredProps","objection","groups","values","createColumns","map"],"m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