@opra/cli 0.31.2 → 0.31.3

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.
@@ -6,9 +6,7 @@ const node_path_1 = tslib_1.__importDefault(require("node:path"));
6
6
  const common_1 = require("@opra/common");
7
7
  const string_utils_js_1 = require("../utils/string-utils.js");
8
8
  async function processResource(resource, className, tsFile) {
9
- tsFile.addImport('@opra/client', ['kClient', 'kContext', 'OpraHttpClient']);
10
- const indexTs = this.addFile('/index.ts', true);
11
- indexTs.addExport(tsFile.filename);
9
+ tsFile.addImport('@opra/client', ['kClient', 'OpraHttpClient']);
12
10
  tsFile.content = `\n
13
11
  /**
14
12
  * ${(0, string_utils_js_1.wrapJSDocString)(resource.description || '')}
@@ -49,7 +47,7 @@ export class ${className} {
49
47
  tsFile.addImport('@opra/client', ['HttpCollectionNode']);
50
48
  const typeName = resource.type.name || '';
51
49
  tsFile.addImport(`/types/${typeName}`, [typeName], true);
52
- constructorBody += ` const node = this[kClient].collection('${resource.name}');\n`;
50
+ constructorBody += ` const node = this[kClient].collection('${resource.getFullPath()}');\n`;
53
51
  for (const [operation, endpoint] of resource.operations.entries()) {
54
52
  tsFile.content += `
55
53
  /**
@@ -63,7 +61,7 @@ export class ${className} {
63
61
  tsFile.addImport('@opra/client', ['HttpSingletonNode']);
64
62
  const typeName = resource.type.name || '';
65
63
  tsFile.addImport(`/types/${typeName}`, [typeName], true);
66
- constructorBody += ` const node = this[kClient].singleton('${resource.name}');\n`;
64
+ constructorBody += ` const node = this[kClient].singleton('${resource.getFullPath()}');\n`;
67
65
  for (const [operation, endpoint] of resource.operations.entries()) {
68
66
  tsFile.content += `
69
67
  /**
@@ -2,9 +2,7 @@ import path from 'node:path';
2
2
  import { Collection, Container, Singleton } from '@opra/common';
3
3
  import { wrapJSDocString } from '../utils/string-utils.js';
4
4
  export async function processResource(resource, className, tsFile) {
5
- tsFile.addImport('@opra/client', ['kClient', 'kContext', 'OpraHttpClient']);
6
- const indexTs = this.addFile('/index.ts', true);
7
- indexTs.addExport(tsFile.filename);
5
+ tsFile.addImport('@opra/client', ['kClient', 'OpraHttpClient']);
8
6
  tsFile.content = `\n
9
7
  /**
10
8
  * ${wrapJSDocString(resource.description || '')}
@@ -45,7 +43,7 @@ export class ${className} {
45
43
  tsFile.addImport('@opra/client', ['HttpCollectionNode']);
46
44
  const typeName = resource.type.name || '';
47
45
  tsFile.addImport(`/types/${typeName}`, [typeName], true);
48
- constructorBody += ` const node = this[kClient].collection('${resource.name}');\n`;
46
+ constructorBody += ` const node = this[kClient].collection('${resource.getFullPath()}');\n`;
49
47
  for (const [operation, endpoint] of resource.operations.entries()) {
50
48
  tsFile.content += `
51
49
  /**
@@ -59,7 +57,7 @@ export class ${className} {
59
57
  tsFile.addImport('@opra/client', ['HttpSingletonNode']);
60
58
  const typeName = resource.type.name || '';
61
59
  tsFile.addImport(`/types/${typeName}`, [typeName], true);
62
- constructorBody += ` const node = this[kClient].singleton('${resource.name}');\n`;
60
+ constructorBody += ` const node = this[kClient].singleton('${resource.getFullPath()}');\n`;
63
61
  for (const [operation, endpoint] of resource.operations.entries()) {
64
62
  tsFile.content += `
65
63
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opra/cli",
3
- "version": "0.31.2",
3
+ "version": "0.31.3",
4
4
  "description": "Opra CLI tools",
5
5
  "author": "Panates",
6
6
  "license": "MIT",
@@ -60,4 +60,4 @@
60
60
  "tool",
61
61
  "oprimp"
62
62
  ]
63
- }
63
+ }