@opra/cli 1.0.0-alpha.15 → 1.0.0-alpha.17
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.
|
@@ -25,10 +25,11 @@ async function generateDataType(dataType, intent, currentFile) {
|
|
|
25
25
|
}
|
|
26
26
|
if (dataType instanceof common_1.SimpleType)
|
|
27
27
|
file = this.addFile(path_1.default.join(this._documentRoot, '/simple-types.ts'), true);
|
|
28
|
-
else if (dataType instanceof common_1.EnumType)
|
|
29
|
-
file = this.addFile(path_1.default.join(this._typesRoot, 'enums', typeName + '.ts'));
|
|
28
|
+
else if (dataType instanceof common_1.EnumType) {
|
|
29
|
+
file = this.addFile(path_1.default.join(this._typesRoot, 'enums', typeName + '.ts'), true);
|
|
30
|
+
}
|
|
30
31
|
else
|
|
31
|
-
file = this.addFile(path_1.default.join(this._typesRoot, 'types', typeName + '.ts'));
|
|
32
|
+
file = this.addFile(path_1.default.join(this._typesRoot, 'types', typeName + '.ts'), true);
|
|
32
33
|
this._filesMap.set(dataType, file);
|
|
33
34
|
if (file.exportTypes.includes(typeName)) {
|
|
34
35
|
if (currentFile)
|
|
@@ -208,12 +208,12 @@ async function generateHttpController(controller) {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
|
+
if (typeDef && resp.isArray)
|
|
212
|
+
typeDef += '[]';
|
|
211
213
|
if (resp.contentType && type_is_1.default.is(String(resp.contentType), [common_1.MimeTypes.opra_response_json])) {
|
|
212
214
|
file.addImport('@opra/common', ['OperationResult']);
|
|
213
215
|
typeDef = typeDef ? `OperationResult<${typeDef}>` : 'OperationResult';
|
|
214
216
|
}
|
|
215
|
-
if (typeDef && resp.isArray)
|
|
216
|
-
typeDef += '[]';
|
|
217
217
|
typeDef = typeDef || 'undefined';
|
|
218
218
|
if (!returnTypes.includes(typeDef))
|
|
219
219
|
returnTypes.push(typeDef);
|
|
@@ -21,10 +21,11 @@ export async function generateDataType(dataType, intent, currentFile) {
|
|
|
21
21
|
}
|
|
22
22
|
if (dataType instanceof SimpleType)
|
|
23
23
|
file = this.addFile(path.join(this._documentRoot, '/simple-types.ts'), true);
|
|
24
|
-
else if (dataType instanceof EnumType)
|
|
25
|
-
file = this.addFile(path.join(this._typesRoot, 'enums', typeName + '.ts'));
|
|
24
|
+
else if (dataType instanceof EnumType) {
|
|
25
|
+
file = this.addFile(path.join(this._typesRoot, 'enums', typeName + '.ts'), true);
|
|
26
|
+
}
|
|
26
27
|
else
|
|
27
|
-
file = this.addFile(path.join(this._typesRoot, 'types', typeName + '.ts'));
|
|
28
|
+
file = this.addFile(path.join(this._typesRoot, 'types', typeName + '.ts'), true);
|
|
28
29
|
this._filesMap.set(dataType, file);
|
|
29
30
|
if (file.exportTypes.includes(typeName)) {
|
|
30
31
|
if (currentFile)
|
|
@@ -204,12 +204,12 @@ export async function generateHttpController(controller) {
|
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
206
|
}
|
|
207
|
+
if (typeDef && resp.isArray)
|
|
208
|
+
typeDef += '[]';
|
|
207
209
|
if (resp.contentType && typeIs.is(String(resp.contentType), [MimeTypes.opra_response_json])) {
|
|
208
210
|
file.addImport('@opra/common', ['OperationResult']);
|
|
209
211
|
typeDef = typeDef ? `OperationResult<${typeDef}>` : 'OperationResult';
|
|
210
212
|
}
|
|
211
|
-
if (typeDef && resp.isArray)
|
|
212
|
-
typeDef += '[]';
|
|
213
213
|
typeDef = typeDef || 'undefined';
|
|
214
214
|
if (!returnTypes.includes(typeDef))
|
|
215
215
|
returnTypes.push(typeDef);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/cli",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.17",
|
|
4
4
|
"description": "Opra CLI tools",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@browsery/type-is": "^1.6.18-r3",
|
|
35
|
-
"@opra/client": "^1.0.0-alpha.
|
|
36
|
-
"@opra/common": "^1.0.0-alpha.
|
|
35
|
+
"@opra/client": "^1.0.0-alpha.17",
|
|
36
|
+
"@opra/common": "^1.0.0-alpha.17",
|
|
37
37
|
"chalk": "^5.3.0",
|
|
38
38
|
"commander": "^12.0.0",
|
|
39
39
|
"js-string-escape": "^1.0.1",
|