sequelize-typescript-generator 10.1.1 → 11.0.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/.github/workflows/ci.yml +24 -19
- package/README.md +4 -4
- package/build/config/IConfig.js +1 -1
- package/build/dialects/Dialect.js +1 -1
- package/build/dialects/DialectMSSQL.js +2 -0
- package/build/dialects/DialectPostgres.js +2 -0
- package/package.json +19 -19
- package/tsconfig.json +12 -63
package/.github/workflows/ci.yml
CHANGED
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
- name: Setup node
|
|
12
12
|
uses: actions/setup-node@v2
|
|
13
13
|
with:
|
|
14
|
-
node-version: '
|
|
14
|
+
node-version: '16'
|
|
15
15
|
|
|
16
16
|
- name: Cache node_modules
|
|
17
17
|
id: cache-node-modules
|
|
@@ -36,7 +36,7 @@ jobs:
|
|
|
36
36
|
- name: Setup node
|
|
37
37
|
uses: actions/setup-node@v2
|
|
38
38
|
with:
|
|
39
|
-
node-version: '
|
|
39
|
+
node-version: '16'
|
|
40
40
|
|
|
41
41
|
- name: Restore node_modules
|
|
42
42
|
id: cache-node-modules
|
|
@@ -65,7 +65,7 @@ jobs:
|
|
|
65
65
|
- name: Setup node
|
|
66
66
|
uses: actions/setup-node@v2
|
|
67
67
|
with:
|
|
68
|
-
node-version: '
|
|
68
|
+
node-version: '16'
|
|
69
69
|
|
|
70
70
|
- name: Restore node_modules
|
|
71
71
|
id: cache-node-modules
|
|
@@ -74,20 +74,20 @@ jobs:
|
|
|
74
74
|
path: node_modules
|
|
75
75
|
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
76
76
|
|
|
77
|
-
- name: Test Postgres
|
|
77
|
+
- name: Test Postgres 11
|
|
78
78
|
run: npm run test-postgres
|
|
79
79
|
env:
|
|
80
|
-
DOCKER_POSTGRES_TAG:
|
|
80
|
+
DOCKER_POSTGRES_TAG: 11
|
|
81
81
|
|
|
82
|
-
- name: Test Postgres
|
|
82
|
+
- name: Test Postgres 14
|
|
83
83
|
run: npm run test-postgres
|
|
84
84
|
env:
|
|
85
|
-
DOCKER_POSTGRES_TAG:
|
|
85
|
+
DOCKER_POSTGRES_TAG: 14
|
|
86
86
|
|
|
87
|
-
- name: Test Postgres
|
|
87
|
+
- name: Test Postgres 16
|
|
88
88
|
run: npm run test-postgres
|
|
89
89
|
env:
|
|
90
|
-
DOCKER_POSTGRES_TAG:
|
|
90
|
+
DOCKER_POSTGRES_TAG: 16
|
|
91
91
|
|
|
92
92
|
test_mariadb:
|
|
93
93
|
runs-on: ubuntu-latest
|
|
@@ -99,7 +99,7 @@ jobs:
|
|
|
99
99
|
- name: Setup node
|
|
100
100
|
uses: actions/setup-node@v2
|
|
101
101
|
with:
|
|
102
|
-
node-version: '
|
|
102
|
+
node-version: '16'
|
|
103
103
|
|
|
104
104
|
- name: Restore node_modules
|
|
105
105
|
id: cache-node-modules
|
|
@@ -108,10 +108,15 @@ jobs:
|
|
|
108
108
|
path: node_modules
|
|
109
109
|
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
110
110
|
|
|
111
|
-
- name: Test MariaDB 10
|
|
111
|
+
- name: Test MariaDB 10
|
|
112
112
|
run: npm run test-mariadb
|
|
113
113
|
env:
|
|
114
|
-
DOCKER_MARIADB_TAG: 10
|
|
114
|
+
DOCKER_MARIADB_TAG: 10
|
|
115
|
+
|
|
116
|
+
- name: Test MariaDB 11
|
|
117
|
+
run: npm run test-mariadb
|
|
118
|
+
env:
|
|
119
|
+
DOCKER_MARIADB_TAG: 11
|
|
115
120
|
|
|
116
121
|
test_mssql:
|
|
117
122
|
runs-on: ubuntu-latest
|
|
@@ -123,7 +128,7 @@ jobs:
|
|
|
123
128
|
- name: Setup node
|
|
124
129
|
uses: actions/setup-node@v2
|
|
125
130
|
with:
|
|
126
|
-
node-version: '
|
|
131
|
+
node-version: '16'
|
|
127
132
|
|
|
128
133
|
- name: Restore node_modules
|
|
129
134
|
id: cache-node-modules
|
|
@@ -132,15 +137,15 @@ jobs:
|
|
|
132
137
|
path: node_modules
|
|
133
138
|
key: node-modules-${{ hashFiles('package-lock.json') }}
|
|
134
139
|
|
|
135
|
-
- name: Test MSSQL
|
|
140
|
+
- name: Test MSSQL 2019
|
|
136
141
|
run: npm run test-mssql
|
|
137
142
|
env:
|
|
138
|
-
DOCKER_MSSQL_TAG:
|
|
143
|
+
DOCKER_MSSQL_TAG: 2019-latest
|
|
139
144
|
|
|
140
|
-
- name: Test MSSQL
|
|
145
|
+
- name: Test MSSQL 2022
|
|
141
146
|
run: npm run test-mssql
|
|
142
147
|
env:
|
|
143
|
-
DOCKER_MSSQL_TAG:
|
|
148
|
+
DOCKER_MSSQL_TAG: 2022-latest
|
|
144
149
|
|
|
145
150
|
test_sqlite:
|
|
146
151
|
runs-on: ubuntu-latest
|
|
@@ -152,7 +157,7 @@ jobs:
|
|
|
152
157
|
- name: Setup node
|
|
153
158
|
uses: actions/setup-node@v2
|
|
154
159
|
with:
|
|
155
|
-
node-version: '
|
|
160
|
+
node-version: '16'
|
|
156
161
|
|
|
157
162
|
- name: Restore node_modules
|
|
158
163
|
id: cache-node-modules
|
|
@@ -174,7 +179,7 @@ jobs:
|
|
|
174
179
|
- name: Setup node
|
|
175
180
|
uses: actions/setup-node@v2
|
|
176
181
|
with:
|
|
177
|
-
node-version: '
|
|
182
|
+
node-version: '16'
|
|
178
183
|
|
|
179
184
|
- name: Restore node_modules
|
|
180
185
|
id: cache-node-modules
|
package/README.md
CHANGED
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
|
|
23
23
|
## Supported databases
|
|
24
24
|
|
|
25
|
-
Currently tested databases:
|
|
25
|
+
Currently tested databases and versions:
|
|
26
26
|
|
|
27
|
-
- Postgres (
|
|
27
|
+
- Postgres (11, 14, 16)
|
|
28
28
|
- Mysql (5, 8)
|
|
29
|
-
- MariaDB (10)
|
|
30
|
-
- SQL Server (
|
|
29
|
+
- MariaDB (10, 11)
|
|
30
|
+
- SQL Server (2019, 2022)
|
|
31
31
|
- SQLite (3)
|
|
32
32
|
|
|
33
33
|
## Prerequisites
|
package/build/config/IConfig.js
CHANGED
|
@@ -5,7 +5,7 @@ var TransformTarget;
|
|
|
5
5
|
(function (TransformTarget) {
|
|
6
6
|
TransformTarget["MODEL"] = "model";
|
|
7
7
|
TransformTarget["COLUMN"] = "column";
|
|
8
|
-
})(TransformTarget
|
|
8
|
+
})(TransformTarget || (exports.TransformTarget = TransformTarget = {}));
|
|
9
9
|
exports.TransformCases = new Set([
|
|
10
10
|
'UPPER',
|
|
11
11
|
'LOWER',
|
|
@@ -34,6 +34,7 @@ const jsDataTypesMap = {
|
|
|
34
34
|
varbinary: 'Uint8Array',
|
|
35
35
|
uniqueidentifier: 'string',
|
|
36
36
|
xml: 'string',
|
|
37
|
+
geography: 'object',
|
|
37
38
|
};
|
|
38
39
|
const sequelizeDataTypesMap = {
|
|
39
40
|
int: sequelize_typescript_1.DataType.INTEGER,
|
|
@@ -64,6 +65,7 @@ const sequelizeDataTypesMap = {
|
|
|
64
65
|
varbinary: sequelize_typescript_1.DataType.STRING,
|
|
65
66
|
uniqueidentifier: sequelize_typescript_1.DataType.STRING,
|
|
66
67
|
xml: sequelize_typescript_1.DataType.STRING,
|
|
68
|
+
geography: sequelize_typescript_1.DataType.GEOGRAPHY,
|
|
67
69
|
};
|
|
68
70
|
/**
|
|
69
71
|
* Dialect for Postgres
|
|
@@ -31,6 +31,7 @@ const sequelizeDataTypesMap = {
|
|
|
31
31
|
path: sequelize_typescript_1.DataType.GEOMETRY,
|
|
32
32
|
polygon: sequelize_typescript_1.DataType.GEOMETRY,
|
|
33
33
|
circle: sequelize_typescript_1.DataType.GEOMETRY,
|
|
34
|
+
geometry: sequelize_typescript_1.DataType.GEOMETRY,
|
|
34
35
|
cidr: sequelize_typescript_1.DataType.STRING,
|
|
35
36
|
inet: sequelize_typescript_1.DataType.STRING,
|
|
36
37
|
macaddr: sequelize_typescript_1.DataType.STRING,
|
|
@@ -69,6 +70,7 @@ const jsDataTypesMap = {
|
|
|
69
70
|
path: 'object',
|
|
70
71
|
polygon: 'object',
|
|
71
72
|
circle: 'object',
|
|
73
|
+
geometry: 'object',
|
|
72
74
|
cidr: 'string',
|
|
73
75
|
inet: 'string',
|
|
74
76
|
macaddr: 'string',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sequelize-typescript-generator",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "11.0.1",
|
|
4
4
|
"description": "Automatically generates typescript models compatible with sequelize-typescript library (https://www.npmjs.com/package/sequelize-typescript) directly from your source database.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -34,34 +34,34 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/spinlud/sequelize-typescript-generator.git#readme",
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@types/bluebird": "^3.5.
|
|
38
|
-
"@types/estree": "^1.0.
|
|
39
|
-
"@types/jest": "^29.5.
|
|
40
|
-
"@types/node": "^
|
|
41
|
-
"@types/pluralize": "0.0.
|
|
42
|
-
"@types/validator": "^13.
|
|
43
|
-
"@types/yargs": "^17.0.
|
|
44
|
-
"jest": "^29.
|
|
45
|
-
"mariadb": "^3.1
|
|
46
|
-
"mysql2": "^3.
|
|
47
|
-
"pg": "^8.11.
|
|
37
|
+
"@types/bluebird": "^3.5.40",
|
|
38
|
+
"@types/estree": "^1.0.2",
|
|
39
|
+
"@types/jest": "^29.5.5",
|
|
40
|
+
"@types/node": "^20.8.6",
|
|
41
|
+
"@types/pluralize": "0.0.31",
|
|
42
|
+
"@types/validator": "^13.11.3",
|
|
43
|
+
"@types/yargs": "^17.0.28",
|
|
44
|
+
"jest": "^29.7.0",
|
|
45
|
+
"mariadb": "^3.2.1",
|
|
46
|
+
"mysql2": "^3.6.2",
|
|
47
|
+
"pg": "^8.11.3",
|
|
48
48
|
"pg-hstore": "^2.3.4",
|
|
49
49
|
"reflect-metadata": "^0.1.13",
|
|
50
50
|
"sqlite3": "^5.1.6",
|
|
51
|
-
"tedious": "^
|
|
52
|
-
"ts-jest": "^29.1.
|
|
51
|
+
"tedious": "^16.4.1",
|
|
52
|
+
"ts-jest": "^29.1.1",
|
|
53
53
|
"ts-node-dev": "^2.0.0",
|
|
54
54
|
"wkx": "^0.5.0"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@types/eslint": "^8.
|
|
58
|
-
"@typescript-eslint/parser": "^
|
|
57
|
+
"@types/eslint": "^8.44.4",
|
|
58
|
+
"@typescript-eslint/parser": "^6.7.5",
|
|
59
59
|
"change-case": "^4.1.2",
|
|
60
|
-
"eslint": "^8.
|
|
60
|
+
"eslint": "^8.51.0",
|
|
61
61
|
"pluralize": "^8.0.0",
|
|
62
|
-
"sequelize": "^6.
|
|
62
|
+
"sequelize": "^6.33.0",
|
|
63
63
|
"sequelize-typescript": "^2.1.5",
|
|
64
|
-
"typescript": "^5.
|
|
64
|
+
"typescript": "^5.2.2",
|
|
65
65
|
"yargs": "^17.7.2"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
package/tsconfig.json
CHANGED
|
@@ -1,72 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
15
|
-
"outDir": "./build", /* Redirect output structure to the directory. */
|
|
16
|
-
"rootDir": "./src", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
17
|
-
// "composite": true, /* Enable project compilation */
|
|
18
|
-
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
19
|
-
// "removeComments": true, /* Do not emit comments to output. */
|
|
20
|
-
// "noEmit": true, /* Do not emit outputs. */
|
|
21
|
-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
22
|
-
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
23
|
-
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
24
|
-
|
|
25
|
-
/* Strict Type-Checking Options */
|
|
26
|
-
"strict": true, /* Enable all strict type-checking options. */
|
|
27
|
-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
|
|
28
|
-
// "strictNullChecks": true, /* Enable strict null checks. */
|
|
29
|
-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
|
|
30
|
-
// "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */
|
|
31
|
-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
|
|
32
|
-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
|
|
33
|
-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
|
|
34
|
-
|
|
35
|
-
/* Additional Checks */
|
|
36
|
-
// "noUnusedLocals": true, /* Report errors on unused locals. */
|
|
37
|
-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
|
|
38
|
-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
|
39
|
-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
|
|
40
|
-
|
|
41
|
-
/* Module Resolution Options */
|
|
42
|
-
// "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */
|
|
43
|
-
// "baseUrl": "./", /* Base directory to resolve non-absolute module names. */
|
|
44
|
-
// "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
|
|
45
|
-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
|
|
46
|
-
// "typeRoots": [], /* List of folders to include type definitions from. */
|
|
47
|
-
// "types": [], /* Type declaration files to be included in compilation. */
|
|
48
|
-
// "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */
|
|
49
|
-
"esModuleInterop": true, /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */
|
|
50
|
-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
|
|
51
|
-
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
|
52
|
-
|
|
53
|
-
/* Source Map Options */
|
|
54
|
-
// "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
|
|
55
|
-
// "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
|
|
56
|
-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
|
|
57
|
-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
|
|
58
|
-
|
|
59
|
-
/* Experimental Options */
|
|
60
|
-
"experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
|
|
61
|
-
"emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
|
|
62
|
-
|
|
63
|
-
/* Advanced Options */
|
|
64
|
-
"forceConsistentCasingInFileNames": false, /* Disallow inconsistently-cased references to the same file. */
|
|
3
|
+
"target": "ES2019",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"outDir": "./build",
|
|
7
|
+
"rootDir": "./src",
|
|
8
|
+
"downlevelIteration": true,
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"emitDecoratorMetadata": true,
|
|
13
|
+
"forceConsistentCasingInFileNames": false
|
|
65
14
|
},
|
|
66
15
|
"exclude": [
|
|
67
16
|
"src/tests",
|
|
68
17
|
"**/output-models",
|
|
69
18
|
"**/prova.ts",
|
|
70
|
-
"**/tmp"
|
|
19
|
+
"**/tmp"
|
|
71
20
|
]
|
|
72
21
|
}
|