@tsed/objection 7.0.0-alpha.1 → 7.0.0-beta.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 (87) 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/index.js +21 -0
  20. package/lib/cjs/index.js.map +1 -0
  21. package/lib/cjs/services/ColumnTypesContainer.js +8 -0
  22. package/lib/cjs/services/ColumnTypesContainer.js.map +1 -0
  23. package/lib/cjs/services/ObjectionConnection.js +24 -0
  24. package/lib/cjs/services/ObjectionConnection.js.map +1 -0
  25. package/lib/cjs/utils/connect.js +13 -0
  26. package/lib/cjs/utils/connect.js.map +1 -0
  27. package/lib/cjs/utils/createColumns.js +38 -0
  28. package/lib/cjs/utils/createColumns.js.map +1 -0
  29. package/lib/cjs/utils/defineStaticGetter.js +14 -0
  30. package/lib/cjs/utils/defineStaticGetter.js.map +1 -0
  31. package/lib/cjs/utils/getColumnCtx.js +13 -0
  32. package/lib/cjs/utils/getColumnCtx.js.map +1 -0
  33. package/lib/esm/components/createBooleanColumn.js +9 -0
  34. package/lib/esm/components/createBooleanColumn.js.map +1 -0
  35. package/lib/esm/components/createIdColumn.js +14 -0
  36. package/lib/esm/components/createIdColumn.js.map +1 -0
  37. package/lib/esm/components/createNumberColumn.js +9 -0
  38. package/lib/esm/components/createNumberColumn.js.map +1 -0
  39. package/lib/esm/components/createStringColumn.js +9 -0
  40. package/lib/esm/components/createStringColumn.js.map +1 -0
  41. package/lib/esm/decorators/columnOptions.js +11 -0
  42. package/lib/esm/decorators/columnOptions.js.map +1 -0
  43. package/lib/esm/decorators/decimal.js +25 -0
  44. package/lib/esm/decorators/decimal.js.map +1 -0
  45. package/lib/esm/decorators/entity.js +19 -0
  46. package/lib/esm/decorators/entity.js.map +1 -0
  47. package/lib/esm/decorators/idColumn.js +21 -0
  48. package/lib/esm/decorators/idColumn.js.map +1 -0
  49. package/lib/esm/domain/ColumnOpts.js +2 -0
  50. package/lib/esm/domain/ColumnOpts.js.map +1 -0
  51. package/lib/esm/index.js +18 -0
  52. package/lib/esm/index.js.map +1 -0
  53. package/lib/esm/services/ColumnTypesContainer.js +5 -0
  54. package/lib/esm/services/ColumnTypesContainer.js.map +1 -0
  55. package/lib/esm/services/ObjectionConnection.js +21 -0
  56. package/lib/esm/services/ObjectionConnection.js.map +1 -0
  57. package/lib/esm/utils/connect.js +8 -0
  58. package/lib/esm/utils/connect.js.map +1 -0
  59. package/lib/esm/utils/createColumns.js +32 -0
  60. package/lib/esm/utils/createColumns.js.map +1 -0
  61. package/lib/esm/utils/defineStaticGetter.js +10 -0
  62. package/lib/esm/utils/defineStaticGetter.js.map +1 -0
  63. package/lib/esm/utils/getColumnCtx.js +9 -0
  64. package/lib/esm/utils/getColumnCtx.js.map +1 -0
  65. package/lib/{components → types/components}/createBooleanColumn.d.ts +0 -0
  66. package/lib/{components → types/components}/createIdColumn.d.ts +0 -0
  67. package/lib/{components → types/components}/createNumberColumn.d.ts +0 -0
  68. package/lib/{components → types/components}/createStringColumn.d.ts +0 -0
  69. package/lib/{decorators → types/decorators}/columnOptions.d.ts +0 -0
  70. package/lib/{decorators → types/decorators}/decimal.d.ts +0 -0
  71. package/lib/{decorators → types/decorators}/entity.d.ts +0 -0
  72. package/lib/{decorators → types/decorators}/idColumn.d.ts +0 -0
  73. package/lib/{domain → types/domain}/ColumnOpts.d.ts +0 -0
  74. package/lib/{index.d.ts → types/index.d.ts} +0 -1
  75. package/lib/{services → types/services}/ColumnTypesContainer.d.ts +0 -0
  76. package/lib/{services → types/services}/ObjectionConnection.d.ts +0 -0
  77. package/lib/{utils → types/utils}/connect.d.ts +0 -0
  78. package/lib/{utils → types/utils}/createColumns.d.ts +1 -1
  79. package/lib/{utils → types/utils}/defineStaticGetter.d.ts +0 -0
  80. package/lib/{utils → types/utils}/getColumnCtx.d.ts +0 -0
  81. package/package.json +23 -26
  82. package/tsconfig.compile.esm.json +23 -0
  83. package/lib/index.js +0 -270
  84. package/lib/index.js.map +0 -1
  85. package/lib/index.modern.js +0 -253
  86. package/lib/index.modern.js.map +0 -1
  87. package/lib/utils/patchModelJson.d.ts +0 -1
@@ -0,0 +1,21 @@
1
+ import { Configuration, registerProvider } from "@tsed/di";
2
+ import { createConnection } from "../utils/connect";
3
+ export const OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION");
4
+ registerProvider({
5
+ provide: OBJECTION_CONNECTION,
6
+ deps: [Configuration],
7
+ async useAsyncFactory(configuration) {
8
+ const connectionOptions = configuration.get("knex");
9
+ if (connectionOptions) {
10
+ try {
11
+ return createConnection(connectionOptions);
12
+ }
13
+ catch (er) {
14
+ // istanbul ignore next
15
+ console.error(er);
16
+ }
17
+ }
18
+ return {};
19
+ }
20
+ });
21
+ //# sourceMappingURL=ObjectionConnection.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,8 @@
1
+ import knex from "knex";
2
+ import { Model } from "objection";
3
+ export function createConnection(connectionOptions) {
4
+ const connection = knex(connectionOptions);
5
+ Model.knex(connection);
6
+ return connection;
7
+ }
8
+ //# sourceMappingURL=connect.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,32 @@
1
+ import { getProperties } from "@tsed/schema";
2
+ import "../components/createBooleanColumn";
3
+ import "../components/createIdColumn";
4
+ import "../components/createNumberColumn";
5
+ import "../components/createStringColumn";
6
+ import { ColumnTypesContainer } from "../services/ColumnTypesContainer";
7
+ import { getColumnCtx } from "./getColumnCtx";
8
+ /**
9
+ * @ignore
10
+ */
11
+ export function createColumn(table, entity) {
12
+ const ctx = getColumnCtx(entity);
13
+ if (!ColumnTypesContainer.has(ctx.columnType)) {
14
+ throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;
15
+ }
16
+ ColumnTypesContainer.get(ctx.columnType)(table, ctx);
17
+ }
18
+ /**
19
+ * @ignore
20
+ */
21
+ export function getColumns(model) {
22
+ return [...getProperties(model, { withIgnoredProps: true, objection: true, groups: false }).values()];
23
+ }
24
+ /**
25
+ * @ignore
26
+ */
27
+ export function createColumns(table, model) {
28
+ getColumns(model).map((entity) => {
29
+ createColumn(table, entity);
30
+ });
31
+ }
32
+ //# sourceMappingURL=createColumns.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,10 @@
1
+ import { classOf } from "@tsed/core";
2
+ /**
3
+ * @ignore
4
+ */
5
+ export function defineStaticGetter(target, propertyKey, fn) {
6
+ return Object.defineProperty(classOf(target), propertyKey, {
7
+ get: fn
8
+ });
9
+ }
10
+ //# sourceMappingURL=defineStaticGetter.js.map
@@ -0,0 +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"]}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @ignore
3
+ */
4
+ export function getColumnCtx(entity) {
5
+ const schema = entity.schema.toJSON();
6
+ const { columnType = schema.type, options = {} } = entity.store.get("objection", {});
7
+ return { entity, columnType, options, schema };
8
+ }
9
+ //# sourceMappingURL=getColumnCtx.js.map
@@ -0,0 +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"]}
File without changes
File without changes
@@ -1,5 +1,4 @@
1
1
  import { Knex } from "knex";
2
- import "./utils/patchModelJson";
3
2
  declare global {
4
3
  namespace TsED {
5
4
  interface Configuration {
File without changes
@@ -11,7 +11,7 @@ export declare function createColumn(table: Knex.TableBuilder, entity: JsonEntit
11
11
  /**
12
12
  * @ignore
13
13
  */
14
- export declare function getColumns(model: any): JsonEntityStore[];
14
+ export declare function getColumns(model: any): import("@tsed/schema").JsonPropertyStore[];
15
15
  /**
16
16
  * @ignore
17
17
  */
File without changes
package/package.json CHANGED
@@ -1,28 +1,32 @@
1
1
  {
2
2
  "name": "@tsed/objection",
3
- "version": "7.0.0-alpha.1",
3
+ "version": "7.0.0-beta.3",
4
4
  "description": "Objection.js package for Ts.ED framework",
5
5
  "private": false,
6
6
  "source": "./src/index.ts",
7
- "main": "./lib/index.js",
8
- "typings": "./lib/index.d.ts",
7
+ "main": "./lib/cjs/index.js",
8
+ "typings": "./lib/types/index.d.ts",
9
9
  "exports": {
10
- "require": "./lib/index.js",
11
- "default": "./lib/index.modern.js"
10
+ "types": "./lib/types/index.d.ts",
11
+ "import": "./lib/esm/index.js",
12
+ "require": "./lib/cjs/index.js",
13
+ "default": "./lib/esm/index.js"
12
14
  },
13
15
  "scripts": {
14
- "build": "microbundle --target node --no-compress --format modern,cjs --tsconfig ./tsconfig.compile.json",
16
+ "build": "yarn run build:esm && yarn run build:cjs",
17
+ "build:cjs": "tsc --build tsconfig.compile.json",
18
+ "build:esm": "tsc --build tsconfig.compile.esm.json",
15
19
  "test": "cross-env NODE_ENV=test yarn jest"
16
20
  },
17
21
  "dependencies": {
18
22
  "tslib": "2.2.0"
19
23
  },
20
24
  "devDependencies": {
21
- "@tsed/ajv": "7.0.0-alpha.1",
22
- "@tsed/core": "7.0.0-alpha.1",
23
- "@tsed/di": "7.0.0-alpha.1",
24
- "@tsed/json-mapper": "7.0.0-alpha.1",
25
- "@tsed/schema": "7.0.0-alpha.1",
25
+ "@tsed/ajv": "7.0.0-beta.3",
26
+ "@tsed/core": "7.0.0-beta.3",
27
+ "@tsed/di": "7.0.0-beta.3",
28
+ "@tsed/json-mapper": "7.0.0-beta.3",
29
+ "@tsed/schema": "7.0.0-beta.3",
26
30
  "knex": "^0.95.11",
27
31
  "mssql": "^7.2.1",
28
32
  "mysql": "^2.18.1",
@@ -34,26 +38,19 @@
34
38
  "sqlite3": "^5.0.2"
35
39
  },
36
40
  "peerDependencies": {
37
- "@tsed/ajv": "^7.0.0-alpha.1",
38
- "@tsed/core": "^7.0.0-alpha.1",
39
- "@tsed/di": "^7.0.0-alpha.1",
40
- "@tsed/json-mapper": "^7.0.0-alpha.1",
41
- "@tsed/schema": "^7.0.0-alpha.1",
42
- "knex": "^0.95.11",
43
- "mssql": "^7.2.1",
44
- "mysql": "^2.18.1",
45
- "mysql2": "^2.3.0",
46
- "objection": "^2.2.15",
47
- "oracledb": "^5.2.0",
48
- "pg": "^8.7.1",
49
- "sqlite": "^4.0.23",
50
- "sqlite3": "^5.0.2"
41
+ "@tsed/ajv": "^7.0.0-beta.3",
42
+ "@tsed/core": "^7.0.0-beta.3",
43
+ "@tsed/di": "^7.0.0-beta.3",
44
+ "@tsed/json-mapper": "^7.0.0-beta.3",
45
+ "@tsed/schema": "^7.0.0-beta.3",
46
+ "knex": ">=0.94.0",
47
+ "objection": ">=2.0.0"
51
48
  },
52
49
  "repository": "https://github.com/tsedio/tsed",
53
50
  "bugs": {
54
51
  "url": "https://github.com/tsedio/tsed/issues"
55
52
  },
56
- "homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/orm/objection",
53
+ "homepage": "https://github.com/tsedio/tsed/tree/beta/packages/orm/objection",
57
54
  "author": "Romain Lenzotti",
58
55
  "license": "MIT"
59
56
  }
@@ -0,0 +1,23 @@
1
+ {
2
+ "extends": "./tsconfig.compile.json",
3
+ "compilerOptions": {
4
+ "baseUrl": ".",
5
+ "module": "ES2020",
6
+ "rootDir": "src",
7
+ "outDir": "./lib/esm",
8
+ "declaration": true,
9
+ "declarationDir": "./lib/types"
10
+ },
11
+ "exclude": [
12
+ "node_modules",
13
+ "test",
14
+ "lib",
15
+ "benchmark",
16
+ "coverage",
17
+ "spec",
18
+ "**/*.benchmark.ts",
19
+ "**/*.spec.ts",
20
+ "keys",
21
+ "jest.config.js"
22
+ ]
23
+ }
package/lib/index.js DELETED
@@ -1,270 +0,0 @@
1
- var core = require('@tsed/core');
2
- var jsonMapper = require('@tsed/json-mapper');
3
- var objection = require('objection');
4
- var schema = require('@tsed/schema');
5
- var di = require('@tsed/di');
6
- var knex = require('knex');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var knex__default = /*#__PURE__*/_interopDefaultLegacy(knex);
11
-
12
- function _extends() {
13
- _extends = Object.assign || function (target) {
14
- for (var i = 1; i < arguments.length; i++) {
15
- var source = arguments[i];
16
-
17
- for (var key in source) {
18
- if (Object.prototype.hasOwnProperty.call(source, key)) {
19
- target[key] = source[key];
20
- }
21
- }
22
- }
23
-
24
- return target;
25
- };
26
-
27
- return _extends.apply(this, arguments);
28
- }
29
-
30
- objection.Model.prototype.toJSON = function toJSON(opt) {
31
- const obj = this.$toJson(opt);
32
-
33
- if (opt && opt.endpoint) {
34
- return jsonMapper.serialize(obj, _extends({
35
- type: core.classOf(this)
36
- }, opt));
37
- }
38
-
39
- return obj;
40
- };
41
-
42
- /**
43
- * @ignore
44
- */
45
- const ColumnTypesContainer = new Map();
46
-
47
- /**
48
- * @ignore
49
- */
50
-
51
- function createStringColumn(table, {
52
- entity,
53
- schema
54
- }) {
55
- table.string(entity.propertyName, schema.maxLength);
56
- }
57
- ColumnTypesContainer.set("string", createStringColumn);
58
-
59
- /**
60
- * @ignore
61
- */
62
-
63
- function createIdColumn(table, {
64
- entity,
65
- options
66
- }) {
67
- if (options.type === "bigIncrements") {
68
- table.bigIncrements(entity.propertyName).primary();
69
- } else {
70
- table.increments(entity.propertyName).primary();
71
- }
72
- }
73
- ColumnTypesContainer.set("idColumn", createIdColumn);
74
-
75
- /**
76
- * @ignore
77
- */
78
-
79
- function createBooleanColumn(table, {
80
- entity
81
- }) {
82
- table.boolean(entity.propertyName);
83
- }
84
- ColumnTypesContainer.set("boolean", createBooleanColumn);
85
-
86
- /**
87
- * @ignore
88
- */
89
-
90
- function createNumberColumn(table, {
91
- entity,
92
- options
93
- }) {
94
- table.decimal(entity.propertyName, options.precision, options.scale);
95
- }
96
- ColumnTypesContainer.set("number", createNumberColumn);
97
-
98
- /**
99
- * @ignore
100
- */
101
-
102
- function defineStaticGetter(target, propertyKey, fn) {
103
- return Object.defineProperty(core.classOf(target), propertyKey, {
104
- get: fn
105
- });
106
- }
107
-
108
- /**
109
- *
110
- * @param tableName
111
- * @decorator
112
- * @objection
113
- */
114
-
115
- function Entity(tableName) {
116
- if (!tableName) {
117
- throw new Error("Please provide a table name");
118
- }
119
-
120
- return target => {
121
- defineStaticGetter(target, "tableName", () => tableName);
122
- defineStaticGetter(target, "jsonSchema", () => schema.getJsonSchema(target));
123
- return target;
124
- };
125
- }
126
-
127
- /**
128
- *
129
- * @param options
130
- * @decorator
131
- * @objection
132
- */
133
-
134
- function ColumnOptions(options) {
135
- return core.StoreSet("objection", options);
136
- }
137
-
138
- /**
139
- *
140
- * @param options
141
- * @decorator
142
- * @objection
143
- */
144
-
145
- function Decimal(options = {}) {
146
- return core.useDecorators(schema.Property(), ColumnOptions({
147
- columnType: "number",
148
- options: _extends({
149
- type: "decimal"
150
- }, options)
151
- }), core.StoreSet("objection", {
152
- columnType: "number",
153
- options: _extends({
154
- type: "decimal"
155
- }, options)
156
- }));
157
- }
158
-
159
- /**
160
- *
161
- * @param type
162
- * @decorator
163
- * @objection
164
- */
165
-
166
- function IdColumn(type = "increments") {
167
- return core.useDecorators(schema.Property(), ColumnOptions({
168
- columnType: "idColumn",
169
- options: {
170
- type
171
- }
172
- }), (target, propertyKey) => {
173
- defineStaticGetter(target, "idColumn", () => propertyKey);
174
- });
175
- }
176
-
177
- function createConnection(connectionOptions) {
178
- const connection = knex__default['default'](connectionOptions);
179
- objection.Model.knex(connection);
180
- return connection;
181
- }
182
-
183
- const OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION");
184
- di.registerProvider({
185
- provide: OBJECTION_CONNECTION,
186
- deps: [di.Configuration],
187
-
188
- async useAsyncFactory(configuration) {
189
- const connectionOptions = configuration.get("knex");
190
-
191
- if (connectionOptions) {
192
- try {
193
- return createConnection(connectionOptions);
194
- } catch (er) {
195
- // istanbul ignore next
196
- console.error(er);
197
- }
198
- }
199
-
200
- return {};
201
- }
202
-
203
- });
204
-
205
- /**
206
- * @ignore
207
- */
208
- function getColumnCtx(entity) {
209
- const schema = entity.schema.toJSON();
210
- const {
211
- columnType = schema.type,
212
- options = {}
213
- } = entity.store.get("objection", {});
214
- return {
215
- entity,
216
- columnType,
217
- options,
218
- schema
219
- };
220
- }
221
-
222
- /**
223
- * @ignore
224
- */
225
-
226
- function createColumn(table, entity) {
227
- const ctx = getColumnCtx(entity);
228
-
229
- if (!ColumnTypesContainer.has(ctx.columnType)) {
230
- throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;
231
- }
232
-
233
- ColumnTypesContainer.get(ctx.columnType)(table, ctx);
234
- }
235
- /**
236
- * @ignore
237
- */
238
-
239
- function getColumns(model) {
240
- return [...schema.getProperties(model, {
241
- withIgnoredProps: true,
242
- objection: true,
243
- groups: false
244
- }).values()];
245
- }
246
- /**
247
- * @ignore
248
- */
249
-
250
- function createColumns(table, model) {
251
- getColumns(model).map(entity => {
252
- createColumn(table, entity);
253
- });
254
- }
255
-
256
- exports.ColumnOptions = ColumnOptions;
257
- exports.Decimal = Decimal;
258
- exports.Entity = Entity;
259
- exports.IdColumn = IdColumn;
260
- exports.OBJECTION_CONNECTION = OBJECTION_CONNECTION;
261
- exports.createBooleanColumn = createBooleanColumn;
262
- exports.createColumn = createColumn;
263
- exports.createColumns = createColumns;
264
- exports.createConnection = createConnection;
265
- exports.createIdColumn = createIdColumn;
266
- exports.createNumberColumn = createNumberColumn;
267
- exports.createStringColumn = createStringColumn;
268
- exports.getColumnCtx = getColumnCtx;
269
- exports.getColumns = getColumns;
270
- //# sourceMappingURL=index.js.map
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,E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