@goast/typescript 0.2.1 → 0.2.2
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.
|
@@ -52,7 +52,12 @@ class DefaultTypeScriptAngularServiceGenerator extends file_generator_1.TypeScri
|
|
|
52
52
|
ast_1.ts.unionType([
|
|
53
53
|
...Object.entries(statusCodes).map(([key, value]) => ast_1.ts.intersectionType([
|
|
54
54
|
ast_1.ts.refs.angular.httpResponse([value]),
|
|
55
|
-
ast_1.ts.objectType({
|
|
55
|
+
ast_1.ts.objectType({
|
|
56
|
+
members: [
|
|
57
|
+
ast_1.ts.property('status', { type: key }),
|
|
58
|
+
ast_1.ts.property('ok', { type: key.startsWith('2') ? 'true' : 'false' }),
|
|
59
|
+
],
|
|
60
|
+
}),
|
|
56
61
|
])),
|
|
57
62
|
!ctx.config.strictResponseTypes
|
|
58
63
|
? ast_1.ts.intersectionType([
|
|
@@ -49,7 +49,12 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
|
|
|
49
49
|
ts.unionType([
|
|
50
50
|
...Object.entries(statusCodes).map(([key, value]) => ts.intersectionType([
|
|
51
51
|
ts.refs.angular.httpResponse([value]),
|
|
52
|
-
ts.objectType({
|
|
52
|
+
ts.objectType({
|
|
53
|
+
members: [
|
|
54
|
+
ts.property('status', { type: key }),
|
|
55
|
+
ts.property('ok', { type: key.startsWith('2') ? 'true' : 'false' }),
|
|
56
|
+
],
|
|
57
|
+
}),
|
|
53
58
|
])),
|
|
54
59
|
!ctx.config.strictResponseTypes
|
|
55
60
|
? ts.intersectionType([
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@goast/typescript",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"repository": "https://github.com/MaSch0212/goast.git",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Marc Schmidt (MaSch0212)",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"fs-extra": "^11.2.0",
|
|
13
13
|
"node-fetch": "^2.7.0",
|
|
14
14
|
"yaml": "^2.4.1",
|
|
15
|
-
"@goast/core": "0.2.
|
|
15
|
+
"@goast/core": "0.2.1",
|
|
16
16
|
"tslib": "2.6.2"
|
|
17
17
|
},
|
|
18
18
|
"module": "./esm/index.js",
|