@dcupl/cli 0.0.23 → 0.0.24
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/dist/functions/generate/types/generate.helper.d.ts +4 -4
- package/dist/functions/generate/types/generate.helper.js +2 -2
- package/dist/functions/generate/types/generate.helper.js.map +1 -1
- package/files/common/.vscode/settings.json +1 -1
- package/files/demo/bookstore_01/dcupl/dcupl.lc.json +1 -2
- package/files/demo/bookstore_01/dcupl/models/author.dcupl.json +2 -2
- package/files/demo/bookstore_01/dcupl/models/book.dcupl.json +3 -3
- package/files/demo/bookstore_01/dcupl/models/book_language.dcupl.json +1 -1
- package/files/demo/bookstore_01/dcupl/models/publisher.dcupl.json +1 -1
- package/files/demo/bookstore_02/dcupl/model/adv_address.dcupl.json +3 -3
- package/files/demo/bookstore_02/dcupl/model/adv_country.dcupl.json +1 -1
- package/files/demo/bookstore_02/dcupl/model/adv_cust_order.dcupl.json +2 -2
- package/files/demo/bookstore_02/dcupl/model/adv_customer.dcupl.json +4 -4
- package/files/demo/bookstore_02/dcupl/model/author.dcupl.json +2 -2
- package/files/demo/bookstore_02/dcupl/model/book.dcupl.json +6 -6
- package/files/demo/bookstore_02/dcupl/model/book_language.dcupl.json +1 -1
- package/files/demo/bookstore_02/dcupl/model/publisher.dcupl.json +1 -1
- package/files/starters/starter_01/dcupl/dcupl.lc.json +1 -1
- package/files/starters/starter_01/dcupl/models/a.dcupl.json +2 -2
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const loadModelFiles: (currentBasePath: string, modelFilesBasePath: string) =>
|
|
1
|
+
import { ModelDefinition } from '@dcupl/common';
|
|
2
|
+
export declare const loadModelFiles: (currentBasePath: string, modelFilesBasePath: string) => ModelDefinition<string>[] | undefined;
|
|
3
3
|
export declare const getAllModelFilePaths: (modelBasePath: string) => string[];
|
|
4
|
-
export declare const loadModelFile: (modelFilePath: string) =>
|
|
5
|
-
export declare const generateTypescriptTypeFromModel: (model:
|
|
4
|
+
export declare const loadModelFile: (modelFilePath: string) => ModelDefinition[] | null;
|
|
5
|
+
export declare const generateTypescriptTypeFromModel: (model: ModelDefinition) => string;
|
|
6
6
|
export declare const writeTypeFile: (typeOutput: string, outputFolderName: string, outputFileName: string) => void;
|
|
7
7
|
export declare const getFormatedTypeOutput: (typeOutput: string) => string;
|
|
@@ -47,7 +47,7 @@ const generateTypescriptTypeFromModel = (model) => {
|
|
|
47
47
|
output += `${property.key}: ${getTypescriptTypeForProperty(property)};`;
|
|
48
48
|
output += `\n`;
|
|
49
49
|
});
|
|
50
|
-
model.
|
|
50
|
+
model.references?.forEach((field) => {
|
|
51
51
|
output += `${field.key}: ${getTypescriptTypeForField(field)};`;
|
|
52
52
|
output += `\n`;
|
|
53
53
|
});
|
|
@@ -56,7 +56,7 @@ const generateTypescriptTypeFromModel = (model) => {
|
|
|
56
56
|
};
|
|
57
57
|
exports.generateTypescriptTypeFromModel = generateTypescriptTypeFromModel;
|
|
58
58
|
const getTypescriptTypeForProperty = (property) => {
|
|
59
|
-
switch (property.
|
|
59
|
+
switch (property.type) {
|
|
60
60
|
case 'any':
|
|
61
61
|
return 'any';
|
|
62
62
|
case 'date':
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.helper.js","sourceRoot":"","sources":["../../../../src/functions/generate/types/generate.helper.ts"],"names":[],"mappings":";;;;AACA,uCAA4G;AAC5G,+BAA4B;AAE5B,gEAAgC;AAChC,iGAA6D;AAEtD,MAAM,cAAc,GAAG,CAAC,eAAuB,EAAE,kBAA0B,EAAE,EAAE;IACpF,MAAM,aAAa,GAAG,IAAA,WAAI,EAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;IAChE,IAAI,CAAC,IAAA,qBAAU,EAAC,aAAa,CAAC,EAAE;QAC9B,OAAO,CAAC,GAAG,CAAC,iBAAiB,aAAa,iBAAiB,CAAC,CAAC;QAC7D,OAAO;KACR;IAED,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E,YAAY;QACpB,OAAO,EAAE,CAAC,8BAAgB,CAAC;KAC5B,CAAC;IAEF,OAAO,kBAAQ,CAAC,MAAM,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;AACtD,CAAC,CAAC;AAPW,QAAA,qBAAqB,yBAOhC"}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"*.dcupl.lc.json",
|
|
13
13
|
"dcupl.lc.json",
|
|
14
14
|
],
|
|
15
|
-
"url": "https://raw.githubusercontent.com/dcupl/dcupl-schema/main/bin/dcupl.loader.schema.json"
|
|
15
|
+
"url": "https://raw.githubusercontent.com/dcupl/dcupl-schema/main/bin/dcupl.loader.vscode.schema.json"
|
|
16
16
|
|
|
17
17
|
}
|
|
18
18
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "book",
|
|
3
|
-
"
|
|
3
|
+
"references": [
|
|
4
4
|
{
|
|
5
5
|
"key": "publisher_id",
|
|
6
6
|
"model": "publisher",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"properties": [
|
|
21
21
|
{
|
|
22
22
|
"key": "title",
|
|
23
|
-
"
|
|
23
|
+
"type": "string",
|
|
24
24
|
"filter": true
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"key": "language_code",
|
|
28
|
-
"
|
|
28
|
+
"type": "string"
|
|
29
29
|
}
|
|
30
30
|
]
|
|
31
31
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "address",
|
|
3
|
-
"
|
|
3
|
+
"references": [
|
|
4
4
|
{
|
|
5
5
|
"key": "country_id",
|
|
6
6
|
"model": "country",
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
"properties": [
|
|
11
11
|
{
|
|
12
12
|
"key": "street_number",
|
|
13
|
-
"
|
|
13
|
+
"type": "string"
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"key": "city",
|
|
17
|
-
"
|
|
17
|
+
"type": "string"
|
|
18
18
|
}
|
|
19
19
|
]
|
|
20
20
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
{
|
|
3
3
|
"key": "customer",
|
|
4
|
-
"
|
|
4
|
+
"references": [
|
|
5
5
|
{
|
|
6
6
|
"key": "addresses",
|
|
7
7
|
"model": "address",
|
|
@@ -21,15 +21,15 @@
|
|
|
21
21
|
"properties": [
|
|
22
22
|
{
|
|
23
23
|
"key": "first_name",
|
|
24
|
-
"
|
|
24
|
+
"type": "string"
|
|
25
25
|
},
|
|
26
26
|
{
|
|
27
27
|
"key": "last_name",
|
|
28
|
-
"
|
|
28
|
+
"type": "string"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
"key": "email",
|
|
32
|
-
"
|
|
32
|
+
"type": "string"
|
|
33
33
|
}
|
|
34
34
|
]
|
|
35
35
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "author",
|
|
3
|
-
"
|
|
3
|
+
"references": [
|
|
4
4
|
{
|
|
5
5
|
"key": "book_ids",
|
|
6
6
|
"model": "book",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"properties": [
|
|
11
11
|
{
|
|
12
12
|
"key": "author_name",
|
|
13
|
-
"
|
|
13
|
+
"type": "string",
|
|
14
14
|
"filter": {
|
|
15
15
|
"comparisonType": "containsIgnoreCase"
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"key": "book",
|
|
3
|
-
"
|
|
3
|
+
"references": [
|
|
4
4
|
{
|
|
5
5
|
"key": "publisher_id",
|
|
6
6
|
"model": "publisher",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"properties": [
|
|
32
32
|
{
|
|
33
33
|
"key": "title",
|
|
34
|
-
"
|
|
34
|
+
"type": "string",
|
|
35
35
|
"filter": {
|
|
36
36
|
"autocompletion": {
|
|
37
37
|
"maxNrOfSuggestions": 5
|
|
@@ -41,15 +41,15 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"key": "isbn13",
|
|
44
|
-
"
|
|
44
|
+
"type": "string"
|
|
45
45
|
},
|
|
46
46
|
{
|
|
47
47
|
"key": "publication_date",
|
|
48
|
-
"
|
|
48
|
+
"type": "string"
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
"key": "language",
|
|
52
|
-
"
|
|
52
|
+
"type": "string",
|
|
53
53
|
"derive": {
|
|
54
54
|
"localField": "language_code",
|
|
55
55
|
"remoteProperty": "language_name"
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
},
|
|
58
58
|
{
|
|
59
59
|
"key": "publisher",
|
|
60
|
-
"
|
|
60
|
+
"type": "string",
|
|
61
61
|
"derive": {
|
|
62
62
|
"localField": "publisher_id",
|
|
63
63
|
"remoteProperty": "publisher_name"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcupl/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.24",
|
|
4
4
|
"description": "The official dcupl CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"typescript": "^4.5.5"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@dcupl/common": "^0.0.
|
|
36
|
+
"@dcupl/common": "^0.0.55",
|
|
37
37
|
"@nestjs/common": "^8.4.5",
|
|
38
38
|
"@nestjs/core": "^8.4.5",
|
|
39
39
|
"@nestjs/platform-express": "^8.4.5",
|