@opra/cli 1.23.0 → 1.23.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.
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opra/cli",
|
|
3
|
-
"version": "1.23.
|
|
3
|
+
"version": "1.23.2",
|
|
4
4
|
"description": "Opra CLI tools",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@browsery/type-is": "^2.0.1",
|
|
9
|
+
"@jsopen/objects": "^2.1.1",
|
|
9
10
|
"ansi-colors": "^4.1.3",
|
|
10
11
|
"commander": "^14.0.3",
|
|
11
12
|
"js-string-escape": "^1.0.1",
|
|
@@ -14,8 +15,8 @@
|
|
|
14
15
|
"tslib": "^2.8.1"
|
|
15
16
|
},
|
|
16
17
|
"peerDependencies": {
|
|
17
|
-
"@opra/client": "^1.23.
|
|
18
|
-
"@opra/common": "^1.23.
|
|
18
|
+
"@opra/client": "^1.23.2",
|
|
19
|
+
"@opra/common": "^1.23.2"
|
|
19
20
|
},
|
|
20
21
|
"type": "module",
|
|
21
22
|
"module": "./index.js",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
+
import { updateErrorMessage } from '@jsopen/objects';
|
|
2
3
|
import { ArrayType, ComplexType, EnumType, MappedType, MixinType, OperationResult, SimpleType, UnionType, } from '@opra/common';
|
|
3
4
|
import { CodeBlock } from '../../code-block.js';
|
|
4
5
|
import { wrapJSDocString } from '../utils/string-utils.js';
|
|
@@ -71,7 +72,7 @@ export async function generateDataType(dataType, intent, currentFile) {
|
|
|
71
72
|
return { kind: 'embedded', code: codeBlock.toString() };
|
|
72
73
|
}
|
|
73
74
|
catch (e) {
|
|
74
|
-
e
|
|
75
|
+
updateErrorMessage(e, `(${dataType.name}) ` + e.message);
|
|
75
76
|
throw e;
|
|
76
77
|
}
|
|
77
78
|
}
|
|
@@ -270,6 +270,9 @@ constructor(client: OpraHttpClient) {`;
|
|
|
270
270
|
}
|
|
271
271
|
if (typeDef) {
|
|
272
272
|
if (typeDef !== 'OperationResult') {
|
|
273
|
+
const isArray = typeDef.endsWith('[]');
|
|
274
|
+
if (isArray)
|
|
275
|
+
typeDef = typeDef.substring(0, typeDef.length - 2);
|
|
273
276
|
if (resp.partial) {
|
|
274
277
|
file.addImport('ts-gems', ['PartialDTO']);
|
|
275
278
|
typeDef = `PartialDTO<${typeDef}>`;
|
|
@@ -278,6 +281,8 @@ constructor(client: OpraHttpClient) {`;
|
|
|
278
281
|
file.addImport('ts-gems', ['DTO']);
|
|
279
282
|
typeDef = `DTO<${typeDef}>`;
|
|
280
283
|
}
|
|
284
|
+
if (isArray)
|
|
285
|
+
typeDef += '[]';
|
|
281
286
|
}
|
|
282
287
|
}
|
|
283
288
|
if (typeDef && resp.isArray)
|