cormo-graphql 0.6.10 → 0.7.0
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/.eslintrc.js +13 -19
- package/README.md +0 -1
- package/lib/decorators.d.ts +3 -3
- package/lib/schema.js +5 -11
- package/package.json +14 -14
package/.eslintrc.js
CHANGED
|
@@ -3,27 +3,21 @@ module.exports = {
|
|
|
3
3
|
env: {
|
|
4
4
|
node: true,
|
|
5
5
|
},
|
|
6
|
-
extends: [
|
|
7
|
-
'@croquiscom/eslint-config/requiring-type-checking',
|
|
8
|
-
],
|
|
6
|
+
extends: ['@croquiscom/eslint-config/requiring-type-checking'],
|
|
9
7
|
parserOptions: {
|
|
10
|
-
project: [
|
|
11
|
-
`${__dirname}/tsconfig.json`,
|
|
12
|
-
],
|
|
8
|
+
project: [`${__dirname}/tsconfig.json`],
|
|
13
9
|
},
|
|
14
|
-
ignorePatterns: [
|
|
15
|
-
'.eslintrc.js',
|
|
16
|
-
'lib/',
|
|
17
|
-
],
|
|
10
|
+
ignorePatterns: ['.eslintrc.js', 'lib/'],
|
|
18
11
|
rules: {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
'@typescript-eslint/no-unsafe-call': 'off',
|
|
13
|
+
'@typescript-eslint/no-unsafe-member-access': 'off',
|
|
14
|
+
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
15
|
+
'@typescript-eslint/no-unsafe-return': 'off',
|
|
16
|
+
'@typescript-eslint/explicit-module-boundary-types': 'off',
|
|
17
|
+
'@typescript-eslint/no-floating-promises': 'off',
|
|
18
|
+
'@typescript-eslint/restrict-template-expressions': 'off',
|
|
19
|
+
'@typescript-eslint/restrict-plus-operands': 'off',
|
|
20
|
+
'@typescript-eslint/ban-types': 'off',
|
|
21
|
+
'@typescript-eslint/no-unsafe-argument': 'off',
|
|
28
22
|
},
|
|
29
23
|
};
|
package/README.md
CHANGED
package/lib/decorators.d.ts
CHANGED
|
@@ -12,11 +12,11 @@ interface ColumnBasicOptions {
|
|
|
12
12
|
description?: string;
|
|
13
13
|
default_value?: string | number | (() => string | number);
|
|
14
14
|
}
|
|
15
|
-
export declare function Column(options: {
|
|
15
|
+
export declare function Column(options: ({
|
|
16
16
|
enum: any;
|
|
17
|
-
} & ColumnBasicOptions | {
|
|
17
|
+
} & ColumnBasicOptions) | ({
|
|
18
18
|
type: cormo.types.ColumnType | cormo.types.ColumnType[];
|
|
19
|
-
} & ColumnBasicOptions): PropertyDecorator;
|
|
19
|
+
} & ColumnBasicOptions)): PropertyDecorator;
|
|
20
20
|
interface ObjectColumnOptions {
|
|
21
21
|
type: any;
|
|
22
22
|
required?: boolean;
|
package/lib/schema.js
CHANGED
|
@@ -60,9 +60,7 @@ function createSingleType(model_class, options) {
|
|
|
60
60
|
for (const [column, property] of Object.entries(model_class._schema)) {
|
|
61
61
|
const graphql_type = getGraphQlType(property);
|
|
62
62
|
if (graphql_type) {
|
|
63
|
-
const description = column === 'id'
|
|
64
|
-
? options.id_description
|
|
65
|
-
: property.description;
|
|
63
|
+
const description = column === 'id' ? options.id_description : property.description;
|
|
66
64
|
fields[column] = {
|
|
67
65
|
description,
|
|
68
66
|
type: graphql_type,
|
|
@@ -121,7 +119,7 @@ function createListType(model_class, options, single_type) {
|
|
|
121
119
|
}
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
|
-
return await query.select(crary_graphql_1.getFieldList(info));
|
|
122
|
+
return await query.select((0, crary_graphql_1.getFieldList)(info));
|
|
125
123
|
},
|
|
126
124
|
type: new graphql_1.GraphQLNonNull(new graphql_1.GraphQLList(new graphql_1.GraphQLNonNull(single_type))),
|
|
127
125
|
},
|
|
@@ -143,9 +141,7 @@ function createCreateInputType(model_class, options) {
|
|
|
143
141
|
}
|
|
144
142
|
const graphql_type = getGraphQlType(property);
|
|
145
143
|
if (graphql_type) {
|
|
146
|
-
const description = column === 'id'
|
|
147
|
-
? options.id_description
|
|
148
|
-
: property.description;
|
|
144
|
+
const description = column === 'id' ? options.id_description : property.description;
|
|
149
145
|
fields[column] = {
|
|
150
146
|
description,
|
|
151
147
|
type: graphql_type,
|
|
@@ -168,9 +164,7 @@ function createUpdateInputType(model_class, options) {
|
|
|
168
164
|
}
|
|
169
165
|
const graphql_type = getGraphQlType(property);
|
|
170
166
|
if (graphql_type) {
|
|
171
|
-
const description = column === 'id'
|
|
172
|
-
? options.id_description
|
|
173
|
-
: property.description;
|
|
167
|
+
const description = column === 'id' ? options.id_description : property.description;
|
|
174
168
|
fields[column] = {
|
|
175
169
|
description,
|
|
176
170
|
type: graphql_type,
|
|
@@ -352,7 +346,7 @@ function createDefaultCrudSchema(model_class, options = {}) {
|
|
|
352
346
|
if (!has_query) {
|
|
353
347
|
return null;
|
|
354
348
|
}
|
|
355
|
-
return await query.select(crary_graphql_1.getFieldList(info));
|
|
349
|
+
return await query.select((0, crary_graphql_1.getFieldList)(info));
|
|
356
350
|
},
|
|
357
351
|
type: single_type,
|
|
358
352
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cormo-graphql",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "GraphQL support for CORMO",
|
|
5
5
|
"main": "./lib",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -24,24 +24,24 @@
|
|
|
24
24
|
},
|
|
25
25
|
"homepage": "https://github.com/croquiscom/cormo",
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@croquiscom/crary-graphql": "^0.
|
|
28
|
-
"cormo": "^0.
|
|
29
|
-
"graphql": "^15.
|
|
27
|
+
"@croquiscom/crary-graphql": "^0.14.1",
|
|
28
|
+
"cormo": "^0.17.0",
|
|
29
|
+
"graphql": "^15.7.2",
|
|
30
30
|
"lodash": "^4.17.21"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@types/chai": "^4.2.
|
|
34
|
-
"@types/lodash": "^4.14.
|
|
35
|
-
"@types/mocha": "^
|
|
36
|
-
"@types/node": "^
|
|
37
|
-
"@types/sinon": "^
|
|
33
|
+
"@types/chai": "^4.2.22",
|
|
34
|
+
"@types/lodash": "^4.14.176",
|
|
35
|
+
"@types/mocha": "^9.0.0",
|
|
36
|
+
"@types/node": "^16.11.6",
|
|
37
|
+
"@types/sinon": "^10.0.6",
|
|
38
38
|
"chai": "^4.3.4",
|
|
39
|
-
"mocha": "^
|
|
39
|
+
"mocha": "^9.1.3",
|
|
40
40
|
"mysql": "^2.18.1",
|
|
41
41
|
"rimraf": "^3.0.2",
|
|
42
|
-
"sinon": "^
|
|
43
|
-
"ts-node": "^
|
|
44
|
-
"typescript": "^4.
|
|
42
|
+
"sinon": "^11.1.2",
|
|
43
|
+
"ts-node": "^10.4.0",
|
|
44
|
+
"typescript": "^4.4.4"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "872e1e3c54a371ba6e51a3e26f5fd9b0439e05ed"
|
|
47
47
|
}
|