@tsed/objection 7.0.0-alpha.2 → 7.0.0-beta.1
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.
- package/lib/cjs/components/createBooleanColumn.js +13 -0
- package/lib/cjs/components/createBooleanColumn.js.map +1 -0
- package/lib/cjs/components/createIdColumn.js +18 -0
- package/lib/cjs/components/createIdColumn.js.map +1 -0
- package/lib/cjs/components/createNumberColumn.js +13 -0
- package/lib/cjs/components/createNumberColumn.js.map +1 -0
- package/lib/cjs/components/createStringColumn.js +13 -0
- package/lib/cjs/components/createStringColumn.js.map +1 -0
- package/lib/cjs/decorators/columnOptions.js +15 -0
- package/lib/cjs/decorators/columnOptions.js.map +1 -0
- package/lib/cjs/decorators/decimal.js +29 -0
- package/lib/cjs/decorators/decimal.js.map +1 -0
- package/lib/cjs/decorators/entity.js +23 -0
- package/lib/cjs/decorators/entity.js.map +1 -0
- package/lib/cjs/decorators/idColumn.js +25 -0
- package/lib/cjs/decorators/idColumn.js.map +1 -0
- package/lib/cjs/domain/ColumnOpts.js +3 -0
- package/lib/cjs/domain/ColumnOpts.js.map +1 -0
- package/lib/cjs/index.js +21 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/services/ColumnTypesContainer.js +8 -0
- package/lib/cjs/services/ColumnTypesContainer.js.map +1 -0
- package/lib/cjs/services/ObjectionConnection.js +24 -0
- package/lib/cjs/services/ObjectionConnection.js.map +1 -0
- package/lib/cjs/utils/connect.js +13 -0
- package/lib/cjs/utils/connect.js.map +1 -0
- package/lib/cjs/utils/createColumns.js +38 -0
- package/lib/cjs/utils/createColumns.js.map +1 -0
- package/lib/cjs/utils/defineStaticGetter.js +14 -0
- package/lib/cjs/utils/defineStaticGetter.js.map +1 -0
- package/lib/cjs/utils/getColumnCtx.js +13 -0
- package/lib/cjs/utils/getColumnCtx.js.map +1 -0
- package/lib/esm/components/createBooleanColumn.js +9 -0
- package/lib/esm/components/createBooleanColumn.js.map +1 -0
- package/lib/esm/components/createIdColumn.js +14 -0
- package/lib/esm/components/createIdColumn.js.map +1 -0
- package/lib/esm/components/createNumberColumn.js +9 -0
- package/lib/esm/components/createNumberColumn.js.map +1 -0
- package/lib/esm/components/createStringColumn.js +9 -0
- package/lib/esm/components/createStringColumn.js.map +1 -0
- package/lib/esm/decorators/columnOptions.js +11 -0
- package/lib/esm/decorators/columnOptions.js.map +1 -0
- package/lib/esm/decorators/decimal.js +25 -0
- package/lib/esm/decorators/decimal.js.map +1 -0
- package/lib/esm/decorators/entity.js +19 -0
- package/lib/esm/decorators/entity.js.map +1 -0
- package/lib/esm/decorators/idColumn.js +21 -0
- package/lib/esm/decorators/idColumn.js.map +1 -0
- package/lib/esm/domain/ColumnOpts.js +2 -0
- package/lib/esm/domain/ColumnOpts.js.map +1 -0
- package/lib/esm/index.js +18 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/services/ColumnTypesContainer.js +5 -0
- package/lib/esm/services/ColumnTypesContainer.js.map +1 -0
- package/lib/esm/services/ObjectionConnection.js +21 -0
- package/lib/esm/services/ObjectionConnection.js.map +1 -0
- package/lib/esm/utils/connect.js +8 -0
- package/lib/esm/utils/connect.js.map +1 -0
- package/lib/esm/utils/createColumns.js +32 -0
- package/lib/esm/utils/createColumns.js.map +1 -0
- package/lib/esm/utils/defineStaticGetter.js +10 -0
- package/lib/esm/utils/defineStaticGetter.js.map +1 -0
- package/lib/esm/utils/getColumnCtx.js +9 -0
- package/lib/esm/utils/getColumnCtx.js.map +1 -0
- package/lib/{components → types/components}/createBooleanColumn.d.ts +0 -0
- package/lib/{components → types/components}/createIdColumn.d.ts +0 -0
- package/lib/{components → types/components}/createNumberColumn.d.ts +0 -0
- package/lib/{components → types/components}/createStringColumn.d.ts +0 -0
- package/lib/{decorators → types/decorators}/columnOptions.d.ts +0 -0
- package/lib/{decorators → types/decorators}/decimal.d.ts +0 -0
- package/lib/{decorators → types/decorators}/entity.d.ts +0 -0
- package/lib/{decorators → types/decorators}/idColumn.d.ts +0 -0
- package/lib/{domain → types/domain}/ColumnOpts.d.ts +0 -0
- package/lib/{index.d.ts → types/index.d.ts} +0 -0
- package/lib/{services → types/services}/ColumnTypesContainer.d.ts +0 -0
- package/lib/{services → types/services}/ObjectionConnection.d.ts +0 -0
- package/lib/{utils → types/utils}/connect.d.ts +0 -0
- package/lib/{utils → types/utils}/createColumns.d.ts +1 -1
- package/lib/{utils → types/utils}/defineStaticGetter.d.ts +0 -0
- package/lib/{utils → types/utils}/getColumnCtx.d.ts +0 -0
- package/package.json +23 -29
- package/tsconfig.compile.esm.json +23 -0
- package/lib/index.js +0 -257
- package/lib/index.js.map +0 -1
- package/lib/index.modern.js +0 -240
- package/lib/index.modern.js.map +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 @@
|
|
|
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 @@
|
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
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):
|
|
14
|
+
export declare function getColumns(model: any): import("@tsed/schema").JsonPropertyStore[];
|
|
15
15
|
/**
|
|
16
16
|
* @ignore
|
|
17
17
|
*/
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tsed/objection",
|
|
3
|
-
"version": "7.0.0-
|
|
3
|
+
"version": "7.0.0-beta.1",
|
|
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
|
-
"
|
|
11
|
-
"
|
|
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": "
|
|
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-
|
|
22
|
-
"@tsed/core": "7.0.0-
|
|
23
|
-
"@tsed/di": "7.0.0-
|
|
24
|
-
"@tsed/json-mapper": "7.0.0-
|
|
25
|
-
"@tsed/schema": "7.0.0-
|
|
25
|
+
"@tsed/ajv": "7.0.0-beta.1",
|
|
26
|
+
"@tsed/core": "7.0.0-beta.1",
|
|
27
|
+
"@tsed/di": "7.0.0-beta.1",
|
|
28
|
+
"@tsed/json-mapper": "7.0.0-beta.1",
|
|
29
|
+
"@tsed/schema": "7.0.0-beta.1",
|
|
26
30
|
"knex": "^0.95.11",
|
|
27
31
|
"mssql": "^7.2.1",
|
|
28
32
|
"mysql": "^2.18.1",
|
|
@@ -34,20 +38,13 @@
|
|
|
34
38
|
"sqlite3": "^5.0.2"
|
|
35
39
|
},
|
|
36
40
|
"peerDependencies": {
|
|
37
|
-
"@tsed/ajv": "^7.0.0-
|
|
38
|
-
"@tsed/core": "^7.0.0-
|
|
39
|
-
"@tsed/di": "^7.0.0-
|
|
40
|
-
"@tsed/json-mapper": "^7.0.0-
|
|
41
|
-
"@tsed/schema": "^7.0.0-
|
|
42
|
-
"knex": "
|
|
43
|
-
"
|
|
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.1",
|
|
42
|
+
"@tsed/core": "^7.0.0-beta.1",
|
|
43
|
+
"@tsed/di": "^7.0.0-beta.1",
|
|
44
|
+
"@tsed/json-mapper": "^7.0.0-beta.1",
|
|
45
|
+
"@tsed/schema": "^7.0.0-beta.1",
|
|
46
|
+
"knex": ">=0.94.0",
|
|
47
|
+
"objection": ">=2.0.0"
|
|
51
48
|
},
|
|
52
49
|
"repository": "https://github.com/tsedio/tsed",
|
|
53
50
|
"bugs": {
|
|
@@ -55,8 +52,5 @@
|
|
|
55
52
|
},
|
|
56
53
|
"homepage": "https://github.com/tsedio/tsed/tree/alpha/packages/orm/objection",
|
|
57
54
|
"author": "Romain Lenzotti",
|
|
58
|
-
"license": "MIT"
|
|
59
|
-
"publishConfig": {
|
|
60
|
-
"tag": "alpha"
|
|
61
|
-
}
|
|
55
|
+
"license": "MIT"
|
|
62
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,257 +0,0 @@
|
|
|
1
|
-
var schema = require('@tsed/schema');
|
|
2
|
-
var core = require('@tsed/core');
|
|
3
|
-
var di = require('@tsed/di');
|
|
4
|
-
var knex = require('knex');
|
|
5
|
-
var objection = require('objection');
|
|
6
|
-
|
|
7
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
|
-
|
|
9
|
-
var knex__default = /*#__PURE__*/_interopDefaultLegacy(knex);
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @ignore
|
|
13
|
-
*/
|
|
14
|
-
const ColumnTypesContainer = new Map();
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @ignore
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
function createStringColumn(table, {
|
|
21
|
-
entity,
|
|
22
|
-
schema
|
|
23
|
-
}) {
|
|
24
|
-
table.string(entity.propertyName, schema.maxLength);
|
|
25
|
-
}
|
|
26
|
-
ColumnTypesContainer.set("string", createStringColumn);
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @ignore
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
function createIdColumn(table, {
|
|
33
|
-
entity,
|
|
34
|
-
options
|
|
35
|
-
}) {
|
|
36
|
-
if (options.type === "bigIncrements") {
|
|
37
|
-
table.bigIncrements(entity.propertyName).primary();
|
|
38
|
-
} else {
|
|
39
|
-
table.increments(entity.propertyName).primary();
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
ColumnTypesContainer.set("idColumn", createIdColumn);
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* @ignore
|
|
46
|
-
*/
|
|
47
|
-
|
|
48
|
-
function createBooleanColumn(table, {
|
|
49
|
-
entity
|
|
50
|
-
}) {
|
|
51
|
-
table.boolean(entity.propertyName);
|
|
52
|
-
}
|
|
53
|
-
ColumnTypesContainer.set("boolean", createBooleanColumn);
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* @ignore
|
|
57
|
-
*/
|
|
58
|
-
|
|
59
|
-
function createNumberColumn(table, {
|
|
60
|
-
entity,
|
|
61
|
-
options
|
|
62
|
-
}) {
|
|
63
|
-
table.decimal(entity.propertyName, options.precision, options.scale);
|
|
64
|
-
}
|
|
65
|
-
ColumnTypesContainer.set("number", createNumberColumn);
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @ignore
|
|
69
|
-
*/
|
|
70
|
-
|
|
71
|
-
function defineStaticGetter(target, propertyKey, fn) {
|
|
72
|
-
return Object.defineProperty(core.classOf(target), propertyKey, {
|
|
73
|
-
get: fn
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* @param tableName
|
|
80
|
-
* @decorator
|
|
81
|
-
* @objection
|
|
82
|
-
*/
|
|
83
|
-
|
|
84
|
-
function Entity(tableName) {
|
|
85
|
-
if (!tableName) {
|
|
86
|
-
throw new Error("Please provide a table name");
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return target => {
|
|
90
|
-
defineStaticGetter(target, "tableName", () => tableName);
|
|
91
|
-
defineStaticGetter(target, "jsonSchema", () => schema.getJsonSchema(target));
|
|
92
|
-
return target;
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
function _extends() {
|
|
97
|
-
_extends = Object.assign || function (target) {
|
|
98
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
99
|
-
var source = arguments[i];
|
|
100
|
-
|
|
101
|
-
for (var key in source) {
|
|
102
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
103
|
-
target[key] = source[key];
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
return target;
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
return _extends.apply(this, arguments);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
*
|
|
116
|
-
* @param options
|
|
117
|
-
* @decorator
|
|
118
|
-
* @objection
|
|
119
|
-
*/
|
|
120
|
-
|
|
121
|
-
function ColumnOptions(options) {
|
|
122
|
-
return core.StoreSet("objection", options);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
*
|
|
127
|
-
* @param options
|
|
128
|
-
* @decorator
|
|
129
|
-
* @objection
|
|
130
|
-
*/
|
|
131
|
-
|
|
132
|
-
function Decimal(options = {}) {
|
|
133
|
-
return core.useDecorators(schema.Property(), ColumnOptions({
|
|
134
|
-
columnType: "number",
|
|
135
|
-
options: _extends({
|
|
136
|
-
type: "decimal"
|
|
137
|
-
}, options)
|
|
138
|
-
}), core.StoreSet("objection", {
|
|
139
|
-
columnType: "number",
|
|
140
|
-
options: _extends({
|
|
141
|
-
type: "decimal"
|
|
142
|
-
}, options)
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
*
|
|
148
|
-
* @param type
|
|
149
|
-
* @decorator
|
|
150
|
-
* @objection
|
|
151
|
-
*/
|
|
152
|
-
|
|
153
|
-
function IdColumn(type = "increments") {
|
|
154
|
-
return core.useDecorators(schema.Property(), ColumnOptions({
|
|
155
|
-
columnType: "idColumn",
|
|
156
|
-
options: {
|
|
157
|
-
type
|
|
158
|
-
}
|
|
159
|
-
}), (target, propertyKey) => {
|
|
160
|
-
defineStaticGetter(target, "idColumn", () => propertyKey);
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
function createConnection(connectionOptions) {
|
|
165
|
-
const connection = knex__default['default'](connectionOptions);
|
|
166
|
-
objection.Model.knex(connection);
|
|
167
|
-
return connection;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const OBJECTION_CONNECTION = Symbol.for("DEFAULT_CONNECTION");
|
|
171
|
-
di.registerProvider({
|
|
172
|
-
provide: OBJECTION_CONNECTION,
|
|
173
|
-
deps: [di.Configuration],
|
|
174
|
-
|
|
175
|
-
async useAsyncFactory(configuration) {
|
|
176
|
-
const connectionOptions = configuration.get("knex");
|
|
177
|
-
|
|
178
|
-
if (connectionOptions) {
|
|
179
|
-
try {
|
|
180
|
-
return createConnection(connectionOptions);
|
|
181
|
-
} catch (er) {
|
|
182
|
-
// istanbul ignore next
|
|
183
|
-
console.error(er);
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return {};
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* @ignore
|
|
194
|
-
*/
|
|
195
|
-
function getColumnCtx(entity) {
|
|
196
|
-
const schema = entity.schema.toJSON();
|
|
197
|
-
const {
|
|
198
|
-
columnType = schema.type,
|
|
199
|
-
options = {}
|
|
200
|
-
} = entity.store.get("objection", {});
|
|
201
|
-
return {
|
|
202
|
-
entity,
|
|
203
|
-
columnType,
|
|
204
|
-
options,
|
|
205
|
-
schema
|
|
206
|
-
};
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/**
|
|
210
|
-
* @ignore
|
|
211
|
-
*/
|
|
212
|
-
|
|
213
|
-
function createColumn(table, entity) {
|
|
214
|
-
const ctx = getColumnCtx(entity);
|
|
215
|
-
|
|
216
|
-
if (!ColumnTypesContainer.has(ctx.columnType)) {
|
|
217
|
-
throw `Column type ${ctx.columnType} isn't supported. Add function to ColumnTypesContainer to map the column with Knex`;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
ColumnTypesContainer.get(ctx.columnType)(table, ctx);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* @ignore
|
|
224
|
-
*/
|
|
225
|
-
|
|
226
|
-
function getColumns(model) {
|
|
227
|
-
return [...schema.getProperties(model, {
|
|
228
|
-
withIgnoredProps: true,
|
|
229
|
-
objection: true,
|
|
230
|
-
groups: false
|
|
231
|
-
}).values()];
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* @ignore
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
function createColumns(table, model) {
|
|
238
|
-
getColumns(model).map(entity => {
|
|
239
|
-
createColumn(table, entity);
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
exports.ColumnOptions = ColumnOptions;
|
|
244
|
-
exports.Decimal = Decimal;
|
|
245
|
-
exports.Entity = Entity;
|
|
246
|
-
exports.IdColumn = IdColumn;
|
|
247
|
-
exports.OBJECTION_CONNECTION = OBJECTION_CONNECTION;
|
|
248
|
-
exports.createBooleanColumn = createBooleanColumn;
|
|
249
|
-
exports.createColumn = createColumn;
|
|
250
|
-
exports.createColumns = createColumns;
|
|
251
|
-
exports.createConnection = createConnection;
|
|
252
|
-
exports.createIdColumn = createIdColumn;
|
|
253
|
-
exports.createNumberColumn = createNumberColumn;
|
|
254
|
-
exports.createStringColumn = createStringColumn;
|
|
255
|
-
exports.getColumnCtx = getColumnCtx;
|
|
256
|
-
exports.getColumns = getColumns;
|
|
257
|
-
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../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":["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":["ColumnTypesContainer","Map","createStringColumn","table","entity","schema","string","propertyName","maxLength","set","createIdColumn","options","type","bigIncrements","primary","increments","createBooleanColumn","boolean","createNumberColumn","decimal","precision","scale","defineStaticGetter","target","propertyKey","fn","Object","defineProperty","classOf","get","Entity","tableName","Error","getJsonSchema","ColumnOptions","StoreSet","Decimal","useDecorators","Property","columnType","IdColumn","createConnection","connectionOptions","connection","knex","Model","OBJECTION_CONNECTION","Symbol","for","registerProvider","provide","deps","Configuration","useAsyncFactory","configuration","er","console","error","getColumnCtx","toJSON","store","createColumn","ctx","has","getColumns","model","getProperties","withIgnoredProps","objection","groups","values","createColumns","map"],"mappings":";;;;;;;;;;AAGA;;;AAGO,MAAMA,oBAAoB,GAAoE,IAAIC,GAAJ,EAA9F;;ACFP;;;;SAGgBC,mBAAmBC,OAA0B;AAACC,EAAAA,MAAD;AAASC,EAAAA;AAAT;AAC3DF,EAAAA,KAAK,CAACG,MAAN,CAAaF,MAAM,CAACG,YAApB,EAAkCF,MAAM,CAACG,SAAzC;AACD;AAEDR,oBAAoB,CAACS,GAArB,CAAyB,QAAzB,EAAmCP,kBAAnC;;ACPA;;;;SAGgBQ,eAAeP,OAA0B;AAACC,EAAAA,MAAD;AAASO,EAAAA;AAAT;AACvD,MAAIA,OAAO,CAACC,IAAR,KAAiB,eAArB,EAAsC;AACpCT,IAAAA,KA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