nexushub-commands 2.0.1 → 2.0.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.
@@ -89,7 +89,7 @@ class ParserSharedCommandsService {
89
89
  processedArgs = `{ value: ${processedArgs} }`;
90
90
  }
91
91
  }
92
- return `this.API.post(\`/commands/\${this.constructor.name}/${methodName}\`, ${processedArgs})`;
92
+ return `this.API.post(\`/commands/\${this.constructor.name}/${methodName}\`, ${processedArgs}).then((res) => res.data)`;
93
93
  }
94
94
  /**
95
95
  * Преобразует команду и возвращает объект с кодом и названием класса
@@ -168,7 +168,7 @@ class ParserSharedCommandsService {
168
168
  filePath: fullPath,
169
169
  transformedCode,
170
170
  className,
171
- object: require(fullPath)[className],
171
+ object: require(fullPath.replace('.ts', '.js').replace('src', 'dist'))[className],
172
172
  });
173
173
  console.log(`Команда преобразована: ${fullPath} (Класс: ${className || 'не найден'})`);
174
174
  }
@@ -7,7 +7,7 @@ const ParserSharedCommands_service_1 = require("./ParserSharedCommands.service")
7
7
  class SharedCommandsService {
8
8
  static init(projectName) {
9
9
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
10
- this.commands = ParserSharedCommands_service_1.ParserSharedCommandsService.transformAllCommands();
10
+ this.commands = ParserSharedCommands_service_1.ParserSharedCommandsService.transformAllCommands(process.cwd() + '/src');
11
11
  yield __1.Client.API.delete(`/projects/${projectName}/commands`).catch(console.error);
12
12
  for (const command of this.commands)
13
13
  yield __1.Client.API.post(`/projects/${projectName}/commands`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -98,7 +98,7 @@ export class ParserSharedCommandsService {
98
98
  }
99
99
  }
100
100
 
101
- return `this.API.post(\`/commands/\${this.constructor.name}/${methodName}\`, ${processedArgs})`
101
+ return `this.API.post(\`/commands/\${this.constructor.name}/${methodName}\`, ${processedArgs}).then((res) => res.data)`
102
102
  }
103
103
 
104
104
  /**
@@ -184,7 +184,7 @@ export class ParserSharedCommandsService {
184
184
  filePath: fullPath,
185
185
  transformedCode,
186
186
  className,
187
- object: require(fullPath)[className as any],
187
+ object: require(fullPath.replace('.ts', '.js').replace('src', 'dist'))[className as any],
188
188
  })
189
189
  console.log(`Команда преобразована: ${fullPath} (Класс: ${className || 'не найден'})`)
190
190
  } catch (error) {
@@ -5,7 +5,7 @@ export class SharedCommandsService {
5
5
  public static commands: { filePath: string; transformedCode: string; className: string | null; object: any }[] = []
6
6
 
7
7
  public static async init(projectName: string) {
8
- this.commands = ParserSharedCommandsService.transformAllCommands()
8
+ this.commands = ParserSharedCommandsService.transformAllCommands(process.cwd() + '/src')
9
9
 
10
10
  await Client.API.delete(`/projects/${projectName}/commands`).catch(console.error)
11
11
  for (const command of this.commands)