namirasoft-cost 1.4.3 → 1.4.4

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.
Files changed (50) hide show
  1. package/dist/NamirasoftCostServer.d.ts +4 -0
  2. package/dist/NamirasoftCostServer.js +5 -1
  3. package/dist/NamirasoftCostServer.js.map +1 -1
  4. package/dist/NamirasoftCostServerBillWatchAzure.d.ts +11 -0
  5. package/dist/NamirasoftCostServerBillWatchAzure.js +29 -0
  6. package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -0
  7. package/dist/NamirasoftCostServerBillWatchGCP.d.ts +11 -0
  8. package/dist/NamirasoftCostServerBillWatchGCP.js +29 -0
  9. package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -0
  10. package/dist/NamirasoftCostServerCost.d.ts +1 -1
  11. package/dist/NamirasoftCostServerCost.js +3 -3
  12. package/dist/NamirasoftCostServerCost.js.map +1 -1
  13. package/dist/command/BillWatchAzureCommand.d.ts +4 -0
  14. package/dist/command/BillWatchAzureCommand.js +15 -0
  15. package/dist/command/BillWatchAzureCommand.js.map +1 -0
  16. package/dist/command/BillWatchAzureEstimationCommand.d.ts +5 -0
  17. package/dist/command/BillWatchAzureEstimationCommand.js +58 -0
  18. package/dist/command/BillWatchAzureEstimationCommand.js.map +1 -0
  19. package/dist/command/BillWatchGCPCommand.d.ts +4 -0
  20. package/dist/command/BillWatchGCPCommand.js +15 -0
  21. package/dist/command/BillWatchGCPCommand.js.map +1 -0
  22. package/dist/command/BillWatchGCPEstimationCommand.d.ts +5 -0
  23. package/dist/command/BillWatchGCPEstimationCommand.js +58 -0
  24. package/dist/command/BillWatchGCPEstimationCommand.js.map +1 -0
  25. package/dist/command/CostCommand.js +2 -2
  26. package/dist/command/CostCommand.js.map +1 -1
  27. package/dist/command/{Cost_CreateCommand.d.ts → Cost_CreateForCommand.d.ts} +1 -1
  28. package/dist/command/{Cost_CreateCommand.js → Cost_CreateForCommand.js} +6 -15
  29. package/dist/command/Cost_CreateForCommand.js.map +1 -0
  30. package/dist/command/cli.js +4 -0
  31. package/dist/command/cli.js.map +1 -1
  32. package/dist/index.d.ts +7 -1
  33. package/dist/index.js +7 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/row/CostCreateRow.d.ts +0 -1
  36. package/package.json +1 -1
  37. package/src/NamirasoftCostServer.ts +7 -1
  38. package/src/NamirasoftCostServerBillWatchAzure.ts +39 -0
  39. package/src/NamirasoftCostServerBillWatchGCP.ts +39 -0
  40. package/src/NamirasoftCostServerCost.ts +3 -3
  41. package/src/command/BillWatchAzureCommand.ts +32 -0
  42. package/src/command/BillWatchAzureEstimationCommand.ts +65 -0
  43. package/src/command/BillWatchGCPCommand.ts +32 -0
  44. package/src/command/BillWatchGCPEstimationCommand.ts +65 -0
  45. package/src/command/CostCommand.ts +2 -2
  46. package/src/command/{Cost_CreateCommand.ts → Cost_CreateForCommand.ts} +3 -12
  47. package/src/command/cli.ts +4 -0
  48. package/src/index.ts +7 -1
  49. package/src/row/CostCreateRow.ts +0 -1
  50. package/dist/command/Cost_CreateCommand.js.map +0 -1
@@ -1,5 +1,7 @@
1
1
  import { NSABaseServer } from "namirasoft-account";
2
2
  import { NamirasoftCostServerBillWatchAWS } from "./NamirasoftCostServerBillWatchAWS";
3
+ import { NamirasoftCostServerBillWatchAzure } from "./NamirasoftCostServerBillWatchAzure";
4
+ import { NamirasoftCostServerBillWatchGCP } from "./NamirasoftCostServerBillWatchGCP";
3
5
  import { NamirasoftCostServerCost } from "./NamirasoftCostServerCost";
4
6
  import { NamirasoftCostServerHealthz } from "./NamirasoftCostServerHealthz";
5
7
  import { NamirasoftCostServerValue } from "./NamirasoftCostServerValue";
@@ -8,6 +10,8 @@ export declare class NamirasoftCostServer extends NSABaseServer {
8
10
  healthz: NamirasoftCostServerHealthz;
9
11
  value: NamirasoftCostServerValue;
10
12
  bill_watch_a_w_s: NamirasoftCostServerBillWatchAWS;
13
+ bill_watch_azure: NamirasoftCostServerBillWatchAzure;
14
+ bill_watch_g_c_p: NamirasoftCostServerBillWatchGCP;
11
15
  cost: NamirasoftCostServerCost;
12
16
  constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void);
13
17
  }
@@ -3,15 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NamirasoftCostServer = void 0;
4
4
  const namirasoft_account_1 = require("namirasoft-account");
5
5
  const NamirasoftCostServerBillWatchAWS_1 = require("./NamirasoftCostServerBillWatchAWS");
6
+ const NamirasoftCostServerBillWatchAzure_1 = require("./NamirasoftCostServerBillWatchAzure");
7
+ const NamirasoftCostServerBillWatchGCP_1 = require("./NamirasoftCostServerBillWatchGCP");
6
8
  const NamirasoftCostServerCost_1 = require("./NamirasoftCostServerCost");
7
9
  const NamirasoftCostServerHealthz_1 = require("./NamirasoftCostServerHealthz");
8
10
  const NamirasoftCostServerValue_1 = require("./NamirasoftCostServerValue");
9
11
  class NamirasoftCostServer extends namirasoft_account_1.NSABaseServer {
10
12
  constructor(base_url, manager, onError) {
11
- super(base_url, `1.4.3`, manager, onError);
13
+ super(base_url, `1.4.4`, manager, onError);
12
14
  this.healthz = new NamirasoftCostServerHealthz_1.NamirasoftCostServerHealthz(this);
13
15
  this.value = new NamirasoftCostServerValue_1.NamirasoftCostServerValue(this);
14
16
  this.bill_watch_a_w_s = new NamirasoftCostServerBillWatchAWS_1.NamirasoftCostServerBillWatchAWS(this);
17
+ this.bill_watch_azure = new NamirasoftCostServerBillWatchAzure_1.NamirasoftCostServerBillWatchAzure(this);
18
+ this.bill_watch_g_c_p = new NamirasoftCostServerBillWatchGCP_1.NamirasoftCostServerBillWatchGCP(this);
15
19
  this.cost = new NamirasoftCostServerCost_1.NamirasoftCostServerCost(this);
16
20
  }
17
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftCostServer.js","sourceRoot":"","sources":["../src/NamirasoftCostServer.ts"],"names":[],"mappings":";;;AAoBA,2DAAmD;AACnD,yFAAsF;AACtF,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AAC,IAAI,GAAG,IAAI,mDAAwB,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;CACJ;AAlBD,oDAkBC;AAAA,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { EstimationRow } from "./row/EstimationRow";
2
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
3
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
4
+ import { PeriodRow } from "./row/PeriodRow";
5
+ export declare class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase {
6
+ constructor(server: NamirasoftCostServer);
7
+ Estimation(body: {
8
+ period: PeriodRow;
9
+ active: boolean;
10
+ }): Promise<EstimationRow>;
11
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NamirasoftCostServerBillWatchAzure = void 0;
13
+ const NamirasoftCostServerBase_1 = require("./NamirasoftCostServerBase");
14
+ class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase_1.NamirasoftCostServerBase {
15
+ constructor(server) {
16
+ super(server);
17
+ this.Estimation = this.Estimation.bind(this);
18
+ }
19
+ Estimation(body) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ let path = `/estimation/bill-watch/watch/azure`;
22
+ let { data } = yield this.server._post(path, {}, body);
23
+ return data;
24
+ });
25
+ }
26
+ }
27
+ exports.NamirasoftCostServerBillWatchAzure = NamirasoftCostServerBillWatchAzure;
28
+ ;
29
+ //# sourceMappingURL=NamirasoftCostServerBillWatchAzure.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamirasoftCostServerBillWatchAzure.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchAzure.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,kCAAmC,SAAQ,mDAAwB;IAE5E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAA4C;;YAEzD,IAAI,IAAI,GAAG,oCAAoC,CAAC;YAChD,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAgB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACtE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,gFAaC;AAAA,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { EstimationRow } from "./row/EstimationRow";
2
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
3
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
4
+ import { PeriodRow } from "./row/PeriodRow";
5
+ export declare class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase {
6
+ constructor(server: NamirasoftCostServer);
7
+ Estimation(body: {
8
+ period: PeriodRow;
9
+ active: boolean;
10
+ }): Promise<EstimationRow>;
11
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.NamirasoftCostServerBillWatchGCP = void 0;
13
+ const NamirasoftCostServerBase_1 = require("./NamirasoftCostServerBase");
14
+ class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase_1.NamirasoftCostServerBase {
15
+ constructor(server) {
16
+ super(server);
17
+ this.Estimation = this.Estimation.bind(this);
18
+ }
19
+ Estimation(body) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ let path = `/estimation/bill-watch/watch/gcp`;
22
+ let { data } = yield this.server._post(path, {}, body);
23
+ return data;
24
+ });
25
+ }
26
+ }
27
+ exports.NamirasoftCostServerBillWatchGCP = NamirasoftCostServerBillWatchGCP;
28
+ ;
29
+ //# sourceMappingURL=NamirasoftCostServerBillWatchGCP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamirasoftCostServerBillWatchGCP.js","sourceRoot":"","sources":["../src/NamirasoftCostServerBillWatchGCP.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,yEAAsE;AAGtE,MAAa,gCAAiC,SAAQ,mDAAwB;IAE1E,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC;IACK,UAAU,CAAC,IAA4C;;YAEzD,IAAI,IAAI,GAAG,kCAAkC,CAAC;YAC9C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAgB,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACtE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAbD,4EAaC;AAAA,CAAC"}
@@ -10,5 +10,5 @@ export declare class NamirasoftCostServerCost extends NamirasoftCostServerBase {
10
10
  rows: CostRow[];
11
11
  count: number;
12
12
  }>;
13
- _Create(body: CostCreateRow): Promise<CostRow>;
13
+ _CreateFor(user_id: string, body: CostCreateRow): Promise<CostRow>;
14
14
  }
@@ -17,7 +17,7 @@ class NamirasoftCostServerCost extends NamirasoftCostServerBase_1.NamirasoftCost
17
17
  constructor(server) {
18
18
  super(server);
19
19
  this.List = this.List.bind(this);
20
- this._Create = this._Create.bind(this);
20
+ this._CreateFor = this._CreateFor.bind(this);
21
21
  }
22
22
  List(filters, page, size, sorts) {
23
23
  return __awaiter(this, void 0, void 0, function* () {
@@ -28,9 +28,9 @@ class NamirasoftCostServerCost extends NamirasoftCostServerBase_1.NamirasoftCost
28
28
  return data;
29
29
  });
30
30
  }
31
- _Create(body) {
31
+ _CreateFor(user_id, body) {
32
32
  return __awaiter(this, void 0, void 0, function* () {
33
- let path = `/application/cost`;
33
+ let path = `/application/user/${user_id}/cost`;
34
34
  let { data } = yield this.server._post(path, {}, body);
35
35
  return data;
36
36
  });
@@ -1 +1 @@
1
- {"version":3,"file":"NamirasoftCostServerCost.js","sourceRoot":"","sources":["../src/NamirasoftCostServerCost.ts"],"names":[],"mappings":";;;;;;;;;;;;AAsBA,qDAA6C;AAE7C,yEAAsE;AACtE,qDAA2C;AAE3C,MAAa,wBAAyB,SAAQ,mDAAwB;IAElE,YAAY,MAA4B;QAEpC,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACK,IAAI,CAAC,OAA4B,EAAE,IAAqB,EAAE,IAAqB,EAAE,KAAiB;;YAEpG,IAAI,oBAAoB,GAAW,4BAAU,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;YACj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,IAAI,IAAI,GAAG,YAAY,CAAC;YACxB,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAqC,IAAI,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC,CAAC;YAC1J,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;IACK,UAAU,CAAC,OAAe,EAAE,IAAmB;;YAEjD,IAAI,IAAI,GAAG,qBAAqB,OAAO,OAAO,CAAC;YAC/C,IAAI,EAAE,IAAI,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAU,IAAI,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YAChE,OAAO,IAAI,CAAC;QAChB,CAAC;KAAA;CACJ;AAtBD,4DAsBC;AAAA,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchAzureCommand extends BaseNavigatorCommand {
3
+ constructor(argv: string[]);
4
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillWatchAzureCommand = void 0;
4
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
+ const BillWatchAzureEstimationCommand_1 = require("./BillWatchAzureEstimationCommand");
6
+ class BillWatchAzureCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
7
+ constructor(argv) {
8
+ super(argv, {
9
+ "estimation": BillWatchAzureEstimationCommand_1.BillWatchAzureEstimationCommand,
10
+ });
11
+ }
12
+ }
13
+ exports.BillWatchAzureCommand = BillWatchAzureCommand;
14
+ ;
15
+ //# sourceMappingURL=BillWatchAzureCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAzureCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,uFAAoF;AAEpF,MAAa,qBAAsB,SAAQ,0CAAoB;IAE3D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,YAAY,EAAE,iEAA+B;SAChD,CAAC,CAAC;IACP,CAAC;CACJ;AARD,sDAQC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchAzureEstimationCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BillWatchAzureEstimationCommand = void 0;
13
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
14
+ const namirasoft_core_1 = require("namirasoft-core");
15
+ const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
16
+ const namirasoft_account_1 = require("namirasoft-account");
17
+ class BillWatchAzureEstimationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, [], [
20
+ {
21
+ name: "period",
22
+ short: "",
23
+ description: "Provides the value of 'period' in body",
24
+ optional: false,
25
+ args: ["period"],
26
+ defaults: [""]
27
+ },
28
+ {
29
+ name: "active",
30
+ short: "",
31
+ description: "Provides the value of 'active' in body",
32
+ optional: false,
33
+ args: ["active"],
34
+ defaults: [""]
35
+ }
36
+ ]);
37
+ }
38
+ exec() {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ let token = this.app.storage.getNSAToken();
41
+ if (token == null)
42
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
43
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
44
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
45
+ manager.setValue(token, false);
46
+ let url = this.app.storage.getItem("ns-cost-server-url");
47
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
48
+ let ans = yield server.bill_watch_azure.Estimation({
49
+ period: this.option_values.period,
50
+ active: this.option_values.active
51
+ });
52
+ this.app.logger.success(JSON.stringify(ans));
53
+ });
54
+ }
55
+ }
56
+ exports.BillWatchAzureEstimationCommand = BillWatchAzureEstimationCommand;
57
+ ;
58
+ //# sourceMappingURL=BillWatchAzureEstimationCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAzureEstimationCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureEstimationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,+BAAgC,SAAQ,sCAAgB;IAEjE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC/H,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YACzD,IAAI,MAAM,GAAG,IAAI,2CAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,UAAU,CAAC;gBAC/C,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;aACpC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAvCD,0EAuCC;AAAA,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchGCPCommand extends BaseNavigatorCommand {
3
+ constructor(argv: string[]);
4
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillWatchGCPCommand = void 0;
4
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
+ const BillWatchGCPEstimationCommand_1 = require("./BillWatchGCPEstimationCommand");
6
+ class BillWatchGCPCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
7
+ constructor(argv) {
8
+ super(argv, {
9
+ "estimation": BillWatchGCPEstimationCommand_1.BillWatchGCPEstimationCommand,
10
+ });
11
+ }
12
+ }
13
+ exports.BillWatchGCPCommand = BillWatchGCPCommand;
14
+ ;
15
+ //# sourceMappingURL=BillWatchGCPCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchGCPCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchGCPCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,mFAAgF;AAEhF,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,YAAY,EAAE,6DAA6B;SAC9C,CAAC,CAAC;IACP,CAAC;CACJ;AARD,kDAQC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchGCPEstimationCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.BillWatchGCPEstimationCommand = void 0;
13
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
14
+ const namirasoft_core_1 = require("namirasoft-core");
15
+ const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
16
+ const namirasoft_account_1 = require("namirasoft-account");
17
+ class BillWatchGCPEstimationCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, [], [
20
+ {
21
+ name: "period",
22
+ short: "",
23
+ description: "Provides the value of 'period' in body",
24
+ optional: false,
25
+ args: ["period"],
26
+ defaults: [""]
27
+ },
28
+ {
29
+ name: "active",
30
+ short: "",
31
+ description: "Provides the value of 'active' in body",
32
+ optional: false,
33
+ args: ["active"],
34
+ defaults: [""]
35
+ }
36
+ ]);
37
+ }
38
+ exec() {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ let token = this.app.storage.getNSAToken();
41
+ if (token == null)
42
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
43
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
44
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
45
+ manager.setValue(token, false);
46
+ let url = this.app.storage.getItem("ns-cost-server-url");
47
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
48
+ let ans = yield server.bill_watch_g_c_p.Estimation({
49
+ period: this.option_values.period,
50
+ active: this.option_values.active
51
+ });
52
+ this.app.logger.success(JSON.stringify(ans));
53
+ });
54
+ }
55
+ }
56
+ exports.BillWatchGCPEstimationCommand = BillWatchGCPEstimationCommand;
57
+ ;
58
+ //# sourceMappingURL=BillWatchGCPEstimationCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchGCPEstimationCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchGCPEstimationCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,6BAA8B,SAAQ,sCAA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AC,MAAM;gBACjC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;aACpC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAvCD,sEAuCC;AAAA,CAAC"}
@@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CostCommand = void 0;
4
4
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
5
  const CostListCommand_1 = require("./CostListCommand");
6
- const Cost_CreateCommand_1 = require("./Cost_CreateCommand");
6
+ const Cost_CreateForCommand_1 = require("./Cost_CreateForCommand");
7
7
  class CostCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
8
8
  constructor(argv) {
9
9
  super(argv, {
10
10
  "list": CostListCommand_1.CostListCommand,
11
- "_create": Cost_CreateCommand_1.Cost_CreateCommand,
11
+ "_createfor": Cost_CreateForCommand_1.Cost_CreateForCommand,
12
12
  });
13
13
  }
14
14
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CostCommand.js","sourceRoot":"","sources":["../../src/command/CostCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,uDAAoD;AACpD,6DAA0D;AAE1D,MAAa,WAAY,SAAQ,0CAAoB;IAEjD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,MAAM,EAAE,iCAAe;YACvB,SAAS,EAAE,uCAAkB;SAChC,CAAC,CAAC;IACP,CAAC;CACJ;AATD,kCASC;AAAA,CAAC"}
1
+ {"version":3,"file":"CostCommand.js","sourceRoot":"","sources":["../../src/command/CostCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,uDAAoD;AACpD,mEAAgE;AAEhE,MAAa,WAAY,SAAQ,0CAAoB;IAEjD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,MAAM,EAAE,iCAAe;YACvB,YAAY,EAAE,6CAAqB;SACtC,CAAC,CAAC;IACP,CAAC;CACJ;AATD,kCASC;AAAA,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { BaseFinalCommand } from "namirasoft-node-cli";
2
- export declare class Cost_CreateCommand extends BaseFinalCommand {
2
+ export declare class Cost_CreateForCommand extends BaseFinalCommand {
3
3
  constructor(argv: string[]);
4
4
  exec(): Promise<void>;
5
5
  }
@@ -9,22 +9,14 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.Cost_CreateCommand = void 0;
12
+ exports.Cost_CreateForCommand = void 0;
13
13
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
14
14
  const namirasoft_core_1 = require("namirasoft-core");
15
15
  const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
16
16
  const namirasoft_account_1 = require("namirasoft-account");
17
- class Cost_CreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
17
+ class Cost_CreateForCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
18
  constructor(argv) {
19
- super(argv, [], [
20
- {
21
- name: "user_id",
22
- short: "",
23
- description: "Provides the value of 'user_id' in body",
24
- optional: false,
25
- args: ["user_id"],
26
- defaults: [""]
27
- },
19
+ super(argv, ["user_id"], [
28
20
  {
29
21
  name: "sales_item_id",
30
22
  short: "",
@@ -149,8 +141,7 @@ class Cost_CreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
149
141
  manager.setValue(token, false);
150
142
  let url = this.app.storage.getItem("ns-cost-server-url");
151
143
  let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
152
- let ans = yield server.cost._Create({
153
- user_id: this.option_values.user_id,
144
+ let ans = yield server.cost._CreateFor(this.arg_values[0], {
154
145
  sales_item_id: this.option_values.sales_item_id,
155
146
  offer_id: this.option_values.offer_id,
156
147
  offer_item_id: this.option_values.offer_item_id,
@@ -170,6 +161,6 @@ class Cost_CreateCommand extends namirasoft_node_cli_1.BaseFinalCommand {
170
161
  });
171
162
  }
172
163
  }
173
- exports.Cost_CreateCommand = Cost_CreateCommand;
164
+ exports.Cost_CreateForCommand = Cost_CreateForCommand;
174
165
  ;
175
- //# sourceMappingURL=Cost_CreateCommand.js.map
166
+ //# sourceMappingURL=Cost_CreateForCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Cost_CreateForCommand.js","sourceRoot":"","sources":["../../src/command/Cost_CreateForCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,qBAAsB,SAAQ,sCAAgB;IAEvD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;YACrB;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,8CAA8C;gBAC3D,QAAQ,EAAE,KAAK;gBACf,IAA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ft-account");
5
5
  const namirasoft_node_cli_1 = require("namirasoft-node-cli");
6
6
  const BillWatchAWSCommand_1 = require("./BillWatchAWSCommand");
7
+ const BillWatchAzureCommand_1 = require("./BillWatchAzureCommand");
8
+ const BillWatchGCPCommand_1 = require("./BillWatchGCPCommand");
7
9
  const namirasoft_node_cli_2 = require("namirasoft-node-cli");
8
10
  const CostCommand_1 = require("./CostCommand");
9
11
  const HealthzCommand_1 = require("./HealthzCommand");
@@ -12,6 +14,8 @@ let app = new namirasoft_node_cli_1.Application("ns-cost", new namirasoft_node_c
12
14
  "healthz": HealthzCommand_1.HealthzCommand,
13
15
  "value": ValueCommand_1.ValueCommand,
14
16
  "billwatchaws": BillWatchAWSCommand_1.BillWatchAWSCommand,
17
+ "billwatchazure": BillWatchAzureCommand_1.BillWatchAzureCommand,
18
+ "billwatchgcp": BillWatchGCPCommand_1.BillWatchGCPCommand,
15
19
  "cost": CostCommand_1.CostCommand,
16
20
  "account": namirasoft_account_1.AccountCommand,
17
21
  "config": (argv) => new namirasoft_node_cli_2.ConfigCommand(argv, ["ns-cost-server-url"])
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,+DAA4D;AAC5D,6DAAoD;AACpD,+CAA4C;AAC5C,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,SAAS,EAAE,IAAI,iCAAW,EAAE,EAClD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,cAAc,EAAE,yCAAmB;IACnC,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,+DAA4D;AAC5D,mEAAgE;AAChE,+DAA4D;AAC5D,6DAAoD;AACpD,+CAA4C;AAC5C,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,SAAS,EAAE,IAAI,iCAAW,EAAE,EAClD;IACI,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,cAAc,EAAE,yCAAmB;IACnC,gBAAgB,EAAE,6CAAqB;IACvC,cAAc,EAAE,yCAAmB;IACnC,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,14 +1,20 @@
1
1
  export * from "./NamirasoftCostServer";
2
2
  export * from "./NamirasoftCostServerBase";
3
3
  export * from "./NamirasoftCostServerBillWatchAWS";
4
+ export * from "./NamirasoftCostServerBillWatchAzure";
5
+ export * from "./NamirasoftCostServerBillWatchGCP";
4
6
  export * from "./NamirasoftCostServerCost";
5
7
  export * from "./NamirasoftCostServerHealthz";
6
8
  export * from "./NamirasoftCostServerValue";
7
9
  export * from "./command/BillWatchAWSCommand";
8
10
  export * from "./command/BillWatchAWSEstimationCommand";
11
+ export * from "./command/BillWatchAzureCommand";
12
+ export * from "./command/BillWatchAzureEstimationCommand";
13
+ export * from "./command/BillWatchGCPCommand";
14
+ export * from "./command/BillWatchGCPEstimationCommand";
9
15
  export * from "./command/CostCommand";
10
16
  export * from "./command/CostListCommand";
11
- export * from "./command/Cost_CreateCommand";
17
+ export * from "./command/Cost_CreateForCommand";
12
18
  export * from "./command/HealthzCommand";
13
19
  export * from "./command/HealthzGetCommand";
14
20
  export * from "./command/ValueCommand";
package/dist/index.js CHANGED
@@ -17,14 +17,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./NamirasoftCostServer"), exports);
18
18
  __exportStar(require("./NamirasoftCostServerBase"), exports);
19
19
  __exportStar(require("./NamirasoftCostServerBillWatchAWS"), exports);
20
+ __exportStar(require("./NamirasoftCostServerBillWatchAzure"), exports);
21
+ __exportStar(require("./NamirasoftCostServerBillWatchGCP"), exports);
20
22
  __exportStar(require("./NamirasoftCostServerCost"), exports);
21
23
  __exportStar(require("./NamirasoftCostServerHealthz"), exports);
22
24
  __exportStar(require("./NamirasoftCostServerValue"), exports);
23
25
  __exportStar(require("./command/BillWatchAWSCommand"), exports);
24
26
  __exportStar(require("./command/BillWatchAWSEstimationCommand"), exports);
27
+ __exportStar(require("./command/BillWatchAzureCommand"), exports);
28
+ __exportStar(require("./command/BillWatchAzureEstimationCommand"), exports);
29
+ __exportStar(require("./command/BillWatchGCPCommand"), exports);
30
+ __exportStar(require("./command/BillWatchGCPEstimationCommand"), exports);
25
31
  __exportStar(require("./command/CostCommand"), exports);
26
32
  __exportStar(require("./command/CostListCommand"), exports);
27
- __exportStar(require("./command/Cost_CreateCommand"), exports);
33
+ __exportStar(require("./command/Cost_CreateForCommand"), exports);
28
34
  __exportStar(require("./command/HealthzCommand"), exports);
29
35
  __exportStar(require("./command/HealthzGetCommand"), exports);
30
36
  __exportStar(require("./command/ValueCommand"), exports);
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,6DAA2C;AAC3C,gEAA8C;AAC9C,8DAA4C;AAC5C,gEAA8C;AAC9C,0EAAwD;AACxD,wDAAsC;AACtC,4DAA0C;AAC1C,+DAA6C;AAC7C,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,sDAAoC;AACpC,yDAAuC;AACvC,kDAAgC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,uEAAqD;AACrD,qEAAmD;AACnD,6DAA2C;AAC3C,gEAA8C;AAC9C,8DAA4C;AAC5C,gEAA8C;AAC9C,0EAAwD;AACxD,kEAAgD;AAChD,4EAA0D;AAC1D,gEAA8C;AAC9C,0EAAwD;AACxD,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,2DAAyC;AACzC,8DAA4C;AAC5C,yDAAuC;AACvC,6DAA2C;AAC3C,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,sDAAoC;AACpC,yDAAuC;AACvC,kDAAgC"}
@@ -1,5 +1,4 @@
1
1
  export type CostCreateRow = {
2
- user_id: string;
3
2
  sales_item_id: string;
4
3
  offer_id: string;
5
4
  offer_item_id: string;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.3",
11
+ "version": "1.4.4",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -20,6 +20,8 @@
20
20
 
21
21
  import { NSABaseServer } from "namirasoft-account";
22
22
  import { NamirasoftCostServerBillWatchAWS } from "./NamirasoftCostServerBillWatchAWS";
23
+ import { NamirasoftCostServerBillWatchAzure } from "./NamirasoftCostServerBillWatchAzure";
24
+ import { NamirasoftCostServerBillWatchGCP } from "./NamirasoftCostServerBillWatchGCP";
23
25
  import { NamirasoftCostServerCost } from "./NamirasoftCostServerCost";
24
26
  import { NamirasoftCostServerHealthz } from "./NamirasoftCostServerHealthz";
25
27
  import { NamirasoftCostServerValue } from "./NamirasoftCostServerValue";
@@ -30,13 +32,17 @@ export class NamirasoftCostServer extends NSABaseServer
30
32
  healthz: NamirasoftCostServerHealthz;
31
33
  value: NamirasoftCostServerValue;
32
34
  bill_watch_a_w_s: NamirasoftCostServerBillWatchAWS;
35
+ bill_watch_azure: NamirasoftCostServerBillWatchAzure;
36
+ bill_watch_g_c_p: NamirasoftCostServerBillWatchGCP;
33
37
  cost: NamirasoftCostServerCost;
34
38
  constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
35
39
  {
36
- super(base_url, `1.4.3`, manager, onError);
40
+ super(base_url, `1.4.4`, manager, onError);
37
41
  this.healthz = new NamirasoftCostServerHealthz(this);
38
42
  this.value = new NamirasoftCostServerValue(this);
39
43
  this.bill_watch_a_w_s = new NamirasoftCostServerBillWatchAWS(this);
44
+ this.bill_watch_azure = new NamirasoftCostServerBillWatchAzure(this);
45
+ this.bill_watch_g_c_p = new NamirasoftCostServerBillWatchGCP(this);
40
46
  this.cost = new NamirasoftCostServerCost(this);
41
47
  }
42
48
  };
@@ -0,0 +1,39 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { EstimationRow } from "./row/EstimationRow";
22
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
23
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
24
+ import { PeriodRow } from "./row/PeriodRow";
25
+
26
+ export class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase
27
+ {
28
+ constructor(server: NamirasoftCostServer)
29
+ {
30
+ super(server);
31
+ this.Estimation = this.Estimation.bind(this);
32
+ }
33
+ async Estimation(body: { period: PeriodRow, active: boolean }): Promise<EstimationRow>
34
+ {
35
+ let path = `/estimation/bill-watch/watch/azure`;
36
+ let { data } = await this.server._post<EstimationRow>(path, {}, body);
37
+ return data;
38
+ }
39
+ };
@@ -0,0 +1,39 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { EstimationRow } from "./row/EstimationRow";
22
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
23
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
24
+ import { PeriodRow } from "./row/PeriodRow";
25
+
26
+ export class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase
27
+ {
28
+ constructor(server: NamirasoftCostServer)
29
+ {
30
+ super(server);
31
+ this.Estimation = this.Estimation.bind(this);
32
+ }
33
+ async Estimation(body: { period: PeriodRow, active: boolean }): Promise<EstimationRow>
34
+ {
35
+ let path = `/estimation/bill-watch/watch/gcp`;
36
+ let { data } = await this.server._post<EstimationRow>(path, {}, body);
37
+ return data;
38
+ }
39
+ };
@@ -31,7 +31,7 @@ export class NamirasoftCostServerCost extends NamirasoftCostServerBase
31
31
  {
32
32
  super(server);
33
33
  this.List = this.List.bind(this);
34
- this._Create = this._Create.bind(this);
34
+ this._CreateFor = this._CreateFor.bind(this);
35
35
  }
36
36
  async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]): Promise<{ rows: CostRow[], count: number }>
37
37
  {
@@ -41,9 +41,9 @@ export class NamirasoftCostServerCost extends NamirasoftCostServerBase
41
41
  let { data } = await this.server._get<{ rows: CostRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
42
42
  return data;
43
43
  }
44
- async _Create(body: CostCreateRow): Promise<CostRow>
44
+ async _CreateFor(user_id: string, body: CostCreateRow): Promise<CostRow>
45
45
  {
46
- let path = `/application/cost`;
46
+ let path = `/application/user/${user_id}/cost`;
47
47
  let { data } = await this.server._post<CostRow>(path, {}, body);
48
48
  return data;
49
49
  }
@@ -0,0 +1,32 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
22
+ import { BillWatchAzureEstimationCommand } from "./BillWatchAzureEstimationCommand";
23
+
24
+ export class BillWatchAzureCommand extends BaseNavigatorCommand
25
+ {
26
+ constructor(argv: string[])
27
+ {
28
+ super(argv, {
29
+ "estimation": BillWatchAzureEstimationCommand,
30
+ });
31
+ }
32
+ };
@@ -0,0 +1,65 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { BaseFinalCommand } from "namirasoft-node-cli";
22
+ import { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class BillWatchAzureEstimationCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, [], [
31
+ {
32
+ name: "period",
33
+ short: "",
34
+ description: "Provides the value of 'period' in body",
35
+ optional: false,
36
+ args: ["period"],
37
+ defaults: [""]
38
+ },
39
+ {
40
+ name: "active",
41
+ short: "",
42
+ description: "Provides the value of 'active' in body",
43
+ optional: false,
44
+ args: ["active"],
45
+ defaults: [""]
46
+ }
47
+ ]);
48
+ }
49
+ override async exec()
50
+ {
51
+ let token = this.app.storage.getNSAToken();
52
+ if (token == null)
53
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
54
+ let storage = new IStorageMemoryDedicated();
55
+ let manager = new TokenManager(storage, () => { });
56
+ manager.setValue(token, false);
57
+ let url = this.app.storage.getItem("ns-cost-server-url");
58
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
59
+ let ans = await server.bill_watch_azure.Estimation({
60
+ period: this.option_values.period,
61
+ active: this.option_values.active
62
+ });
63
+ this.app.logger.success(JSON.stringify(ans));
64
+ }
65
+ };
@@ -0,0 +1,32 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
22
+ import { BillWatchGCPEstimationCommand } from "./BillWatchGCPEstimationCommand";
23
+
24
+ export class BillWatchGCPCommand extends BaseNavigatorCommand
25
+ {
26
+ constructor(argv: string[])
27
+ {
28
+ super(argv, {
29
+ "estimation": BillWatchGCPEstimationCommand,
30
+ });
31
+ }
32
+ };
@@ -0,0 +1,65 @@
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { BaseFinalCommand } from "namirasoft-node-cli";
22
+ import { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class BillWatchGCPEstimationCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, [], [
31
+ {
32
+ name: "period",
33
+ short: "",
34
+ description: "Provides the value of 'period' in body",
35
+ optional: false,
36
+ args: ["period"],
37
+ defaults: [""]
38
+ },
39
+ {
40
+ name: "active",
41
+ short: "",
42
+ description: "Provides the value of 'active' in body",
43
+ optional: false,
44
+ args: ["active"],
45
+ defaults: [""]
46
+ }
47
+ ]);
48
+ }
49
+ override async exec()
50
+ {
51
+ let token = this.app.storage.getNSAToken();
52
+ if (token == null)
53
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
54
+ let storage = new IStorageMemoryDedicated();
55
+ let manager = new TokenManager(storage, () => { });
56
+ manager.setValue(token, false);
57
+ let url = this.app.storage.getItem("ns-cost-server-url");
58
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
59
+ let ans = await server.bill_watch_g_c_p.Estimation({
60
+ period: this.option_values.period,
61
+ active: this.option_values.active
62
+ });
63
+ this.app.logger.success(JSON.stringify(ans));
64
+ }
65
+ };
@@ -20,7 +20,7 @@
20
20
 
21
21
  import { BaseNavigatorCommand } from "namirasoft-node-cli";
22
22
  import { CostListCommand } from "./CostListCommand";
23
- import { Cost_CreateCommand } from "./Cost_CreateCommand";
23
+ import { Cost_CreateForCommand } from "./Cost_CreateForCommand";
24
24
 
25
25
  export class CostCommand extends BaseNavigatorCommand
26
26
  {
@@ -28,7 +28,7 @@ export class CostCommand extends BaseNavigatorCommand
28
28
  {
29
29
  super(argv, {
30
30
  "list": CostListCommand,
31
- "_create": Cost_CreateCommand,
31
+ "_createfor": Cost_CreateForCommand,
32
32
  });
33
33
  }
34
34
  };
@@ -23,19 +23,11 @@ import { IStorageMemoryDedicated } from "namirasoft-core";
23
23
  import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
24
  import { TokenManager } from "namirasoft-account";
25
25
 
26
- export class Cost_CreateCommand extends BaseFinalCommand
26
+ export class Cost_CreateForCommand extends BaseFinalCommand
27
27
  {
28
28
  constructor(argv: string[])
29
29
  {
30
- super(argv, [], [
31
- {
32
- name: "user_id",
33
- short: "",
34
- description: "Provides the value of 'user_id' in body",
35
- optional: false,
36
- args: ["user_id"],
37
- defaults: [""]
38
- },
30
+ super(argv, ["user_id"], [
39
31
  {
40
32
  name: "sales_item_id",
41
33
  short: "",
@@ -160,8 +152,7 @@ export class Cost_CreateCommand extends BaseFinalCommand
160
152
  manager.setValue(token, false);
161
153
  let url = this.app.storage.getItem("ns-cost-server-url");
162
154
  let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
163
- let ans = await server.cost._Create({
164
- user_id: this.option_values.user_id,
155
+ let ans = await server.cost._CreateFor(this.arg_values[0], {
165
156
  sales_item_id: this.option_values.sales_item_id,
166
157
  offer_id: this.option_values.offer_id,
167
158
  offer_item_id: this.option_values.offer_item_id,
@@ -22,6 +22,8 @@
22
22
  import { AccountCommand } from "namirasoft-account";
23
23
  import { Application, BaseStorage } from "namirasoft-node-cli";
24
24
  import { BillWatchAWSCommand } from "./BillWatchAWSCommand";
25
+ import { BillWatchAzureCommand } from "./BillWatchAzureCommand";
26
+ import { BillWatchGCPCommand } from "./BillWatchGCPCommand";
25
27
  import { ConfigCommand } from "namirasoft-node-cli";
26
28
  import { CostCommand } from "./CostCommand";
27
29
  import { HealthzCommand } from "./HealthzCommand";
@@ -32,6 +34,8 @@ let app = new Application("ns-cost", new BaseStorage(),
32
34
  "healthz": HealthzCommand,
33
35
  "value": ValueCommand,
34
36
  "billwatchaws": BillWatchAWSCommand,
37
+ "billwatchazure": BillWatchAzureCommand,
38
+ "billwatchgcp": BillWatchGCPCommand,
35
39
  "cost": CostCommand,
36
40
  "account": AccountCommand,
37
41
  "config": (argv: string[]) => new ConfigCommand(argv, ["ns-cost-server-url"])
package/src/index.ts CHANGED
@@ -21,14 +21,20 @@
21
21
  export * from "./NamirasoftCostServer";
22
22
  export * from "./NamirasoftCostServerBase";
23
23
  export * from "./NamirasoftCostServerBillWatchAWS";
24
+ export * from "./NamirasoftCostServerBillWatchAzure";
25
+ export * from "./NamirasoftCostServerBillWatchGCP";
24
26
  export * from "./NamirasoftCostServerCost";
25
27
  export * from "./NamirasoftCostServerHealthz";
26
28
  export * from "./NamirasoftCostServerValue";
27
29
  export * from "./command/BillWatchAWSCommand";
28
30
  export * from "./command/BillWatchAWSEstimationCommand";
31
+ export * from "./command/BillWatchAzureCommand";
32
+ export * from "./command/BillWatchAzureEstimationCommand";
33
+ export * from "./command/BillWatchGCPCommand";
34
+ export * from "./command/BillWatchGCPEstimationCommand";
29
35
  export * from "./command/CostCommand";
30
36
  export * from "./command/CostListCommand";
31
- export * from "./command/Cost_CreateCommand";
37
+ export * from "./command/Cost_CreateForCommand";
32
38
  export * from "./command/HealthzCommand";
33
39
  export * from "./command/HealthzGetCommand";
34
40
  export * from "./command/ValueCommand";
@@ -20,7 +20,6 @@
20
20
 
21
21
  export type CostCreateRow =
22
22
  {
23
- user_id: string;
24
23
  sales_item_id: string;
25
24
  offer_id: string;
26
25
  offer_item_id: string;
@@ -1 +0,0 @@
1
- {"version":3,"file":"Cost_CreateCommand.js","sourceRoot":"","sources":["../../src/command/Cost_CreateCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,kBAAmB,SAAQ,sCAAgB;IAEpD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,yCAAyC;gBACtD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,SAAS,CAAC;gBACjB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,0CAA0C;gBACvD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,UAAU,CAAC;gBAClB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,eAAe;gBACrB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,+CAA+C;gBAC5D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,eAAe,CAAC;gBACvB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,cAAc;gBACpB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