@opra/cli 0.33.10 → 0.33.13

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.
@@ -78,8 +78,14 @@ export class ${className} {
78
78
  tsFile.content += `
79
79
  /**
80
80
  * ${(0, string_utils_js_1.wrapJSDocString)(endpoint.description || '')}
81
- */
82
- readonly ${operation}: HttpStorageNode['${operation}'];\n`;
81
+ */`;
82
+ if (operation === 'post' && endpoint.returnType) {
83
+ const typeName = endpoint.returnType.name || 'any'; // todo
84
+ tsFile.addImport(`/types/${typeName}`, [typeName], true);
85
+ tsFile.content += `\n readonly ${operation}: HttpStorageNode<${typeName}>['${operation}'];\n`;
86
+ }
87
+ else
88
+ tsFile.content += `\n readonly ${operation}: HttpStorageNode['${operation}'];\n`;
83
89
  constructorBody += ` this.${operation} = node.${operation}.bind(node);\n`;
84
90
  }
85
91
  }
@@ -74,8 +74,14 @@ export class ${className} {
74
74
  tsFile.content += `
75
75
  /**
76
76
  * ${wrapJSDocString(endpoint.description || '')}
77
- */
78
- readonly ${operation}: HttpStorageNode['${operation}'];\n`;
77
+ */`;
78
+ if (operation === 'post' && endpoint.returnType) {
79
+ const typeName = endpoint.returnType.name || 'any'; // todo
80
+ tsFile.addImport(`/types/${typeName}`, [typeName], true);
81
+ tsFile.content += `\n readonly ${operation}: HttpStorageNode<${typeName}>['${operation}'];\n`;
82
+ }
83
+ else
84
+ tsFile.content += `\n readonly ${operation}: HttpStorageNode['${operation}'];\n`;
79
85
  constructorBody += ` this.${operation} = node.${operation}.bind(node);\n`;
80
86
  }
81
87
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/cli",
3
- "version": "0.33.10",
3
+ "version": "0.33.13",
4
4
  "description": "Opra CLI tools",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "clean:cover": "rimraf ../../coverage/client"
30
30
  },
31
31
  "dependencies": {
32
- "@opra/client": "^0.33.10",
32
+ "@opra/client": "^0.33.13",
33
33
  "chalk": "^5.3.0",
34
34
  "commander": "^11.0.0",
35
35
  "js-string-escape": "^1.0.1",
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./api-exporter.js"), exports);
@@ -1 +0,0 @@
1
- export * from './api-exporter.js';
@@ -1 +0,0 @@
1
- export * from './api-exporter.js';