@opra/cli 1.22.9 → 1.23.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/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@opra/cli",
3
- "version": "1.22.9",
3
+ "version": "1.23.0",
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
9
  "ansi-colors": "^4.1.3",
10
- "commander": "^14.0.2",
10
+ "commander": "^14.0.3",
11
11
  "js-string-escape": "^1.0.1",
12
12
  "putil-flattentext": "^2.1.1",
13
13
  "putil-varhelpers": "^1.7.0",
14
14
  "tslib": "^2.8.1"
15
15
  },
16
16
  "peerDependencies": {
17
- "@opra/client": "^1.22.9",
18
- "@opra/common": "^1.22.9"
17
+ "@opra/client": "^1.23.0",
18
+ "@opra/common": "^1.23.0"
19
19
  },
20
20
  "type": "module",
21
21
  "module": "./index.js",
@@ -1,6 +1,6 @@
1
1
  import path from 'node:path';
2
2
  import typeIs from '@browsery/type-is';
3
- import { ComplexType, HttpController, MimeTypes, } from '@opra/common';
3
+ import { ComplexType, HttpController, MimeTypes, OperationResult, } from '@opra/common';
4
4
  import { camelCase, pascalCase } from 'putil-varhelpers';
5
5
  import { CodeBlock } from '../../code-block.js';
6
6
  import { locateNamedType } from '../utils/locate-named-type.js';
@@ -283,7 +283,9 @@ constructor(client: OpraHttpClient) {`;
283
283
  if (typeDef && resp.isArray)
284
284
  typeDef += '[]';
285
285
  if (resp.contentType &&
286
- typeIs.is(String(resp.contentType), [MimeTypes.opra_response_json])) {
286
+ typeIs.is(String(resp.contentType), [MimeTypes.opra_response_json]) &&
287
+ !(resp.type instanceof ComplexType &&
288
+ resp.type.base?.ctor === OperationResult)) {
287
289
  file.addImport('@opra/common', ['OperationResult']);
288
290
  typeDef = typeDef ? `OperationResult<${typeDef}>` : 'OperationResult';
289
291
  }