nexushub-commands 1.6.3 → 1.6.5

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.
@@ -5,7 +5,7 @@ const tslib_1 = require("tslib");
5
5
  const evogram_1 = require("evogram");
6
6
  const contexts_1 = require("evogram/lib/contexts");
7
7
  const Client_1 = require("../../Client");
8
- class DepositByPromocodeCommand extends evogram_1.Command {
8
+ let DepositByPromocodeCommand = class DepositByPromocodeCommand extends evogram_1.Command {
9
9
  execute(context, promocode) {
10
10
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
11
11
  const config = Client_1.Client.config(context);
@@ -23,7 +23,7 @@ class DepositByPromocodeCommand extends evogram_1.Command {
23
23
  });
24
24
  });
25
25
  }
26
- }
26
+ };
27
27
  exports.DepositByPromocodeCommand = DepositByPromocodeCommand;
28
28
  tslib_1.__decorate([
29
29
  tslib_1.__param(1, (0, evogram_1.CommandArgument)({
@@ -36,7 +36,7 @@ tslib_1.__decorate([
36
36
  .then((x) => x.text),
37
37
  }, (0, evogram_1.stringValidator)({ minLength: 16, maxLength: 16 }), (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ value, context }) {
38
38
  const config = Client_1.Client.config(context);
39
- const promocode = yield config.API.get(`/promocodes/${value}`).then((x) => x.data);
39
+ const promocode = yield config.API.get(`/promocodes/codes/${value}`).then((x) => x.data);
40
40
  if (!promocode)
41
41
  throw new Error('Промокод не найден');
42
42
  return promocode;
@@ -45,3 +45,6 @@ tslib_1.__decorate([
45
45
  tslib_1.__metadata("design:paramtypes", [contexts_1.CommandContext, Object]),
46
46
  tslib_1.__metadata("design:returntype", Promise)
47
47
  ], DepositByPromocodeCommand.prototype, "execute", null);
48
+ exports.DepositByPromocodeCommand = DepositByPromocodeCommand = tslib_1.__decorate([
49
+ (0, evogram_1.CommandD)('promocode')
50
+ ], DepositByPromocodeCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexushub-commands",
3
- "version": "1.6.3",
3
+ "version": "1.6.5",
4
4
  "main": "./lib/index.js",
5
5
  "license": "MIT",
6
6
  "dependencies": {
@@ -22,7 +22,7 @@ export class DepositByPromocodeCommand extends Command {
22
22
  async ({ value, context }) => {
23
23
  const config = Client.config(context);
24
24
 
25
- const promocode = await config.API.get(`/promocodes/${value}`).then((x) => x.data);
25
+ const promocode = await config.API.get(`/promocodes/codes/${value}`).then((x) => x.data);
26
26
  if (!promocode) throw new Error('Промокод не найден');
27
27
 
28
28
  return promocode;