namirasoft-cost 1.4.0

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 (99) hide show
  1. package/dist/NamirasoftCostServer.d.ts +13 -0
  2. package/dist/NamirasoftCostServer.js +20 -0
  3. package/dist/NamirasoftCostServer.js.map +1 -0
  4. package/dist/NamirasoftCostServerBase.d.ts +5 -0
  5. package/dist/NamirasoftCostServerBase.js +11 -0
  6. package/dist/NamirasoftCostServerBase.js.map +1 -0
  7. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +12 -0
  8. package/dist/NamirasoftCostServerBillWatchAWS.js +29 -0
  9. package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -0
  10. package/dist/NamirasoftCostServerCost.d.ts +14 -0
  11. package/dist/NamirasoftCostServerCost.js +41 -0
  12. package/dist/NamirasoftCostServerCost.js.map +1 -0
  13. package/dist/NamirasoftCostServerHealthz.d.ts +6 -0
  14. package/dist/NamirasoftCostServerHealthz.js +28 -0
  15. package/dist/NamirasoftCostServerHealthz.js.map +1 -0
  16. package/dist/NamirasoftCostServerValue.d.ts +6 -0
  17. package/dist/NamirasoftCostServerValue.js +29 -0
  18. package/dist/NamirasoftCostServerValue.js.map +1 -0
  19. package/dist/command/BillWatchAWSCommand.d.ts +4 -0
  20. package/dist/command/BillWatchAWSCommand.js +15 -0
  21. package/dist/command/BillWatchAWSCommand.js.map +1 -0
  22. package/dist/command/BillWatchAWSEstimationCommand.d.ts +5 -0
  23. package/dist/command/BillWatchAWSEstimationCommand.js +67 -0
  24. package/dist/command/BillWatchAWSEstimationCommand.js.map +1 -0
  25. package/dist/command/CostCommand.d.ts +4 -0
  26. package/dist/command/CostCommand.js +17 -0
  27. package/dist/command/CostCommand.js.map +1 -0
  28. package/dist/command/CostListCommand.d.ts +5 -0
  29. package/dist/command/CostListCommand.js +38 -0
  30. package/dist/command/CostListCommand.js.map +1 -0
  31. package/dist/command/Cost_CreateCommand.d.ts +5 -0
  32. package/dist/command/Cost_CreateCommand.js +148 -0
  33. package/dist/command/Cost_CreateCommand.js.map +1 -0
  34. package/dist/command/HealthzCommand.d.ts +4 -0
  35. package/dist/command/HealthzCommand.js +15 -0
  36. package/dist/command/HealthzCommand.js.map +1 -0
  37. package/dist/command/HealthzGetCommand.d.ts +5 -0
  38. package/dist/command/HealthzGetCommand.js +38 -0
  39. package/dist/command/HealthzGetCommand.js.map +1 -0
  40. package/dist/command/ValueCommand.d.ts +4 -0
  41. package/dist/command/ValueCommand.js +15 -0
  42. package/dist/command/ValueCommand.js.map +1 -0
  43. package/dist/command/ValueListCommand.d.ts +5 -0
  44. package/dist/command/ValueListCommand.js +38 -0
  45. package/dist/command/ValueListCommand.js.map +1 -0
  46. package/dist/command/cli.d.ts +2 -0
  47. package/dist/command/cli.js +20 -0
  48. package/dist/command/cli.js.map +1 -0
  49. package/dist/index.d.ts +22 -0
  50. package/dist/index.js +39 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/meta/CostMetaTable.d.ts +23 -0
  53. package/dist/meta/CostMetaTable.js +46 -0
  54. package/dist/meta/CostMetaTable.js.map +1 -0
  55. package/dist/meta/NamirasoftCostMetaDatabase.d.ts +13 -0
  56. package/dist/meta/NamirasoftCostMetaDatabase.js +27 -0
  57. package/dist/meta/NamirasoftCostMetaDatabase.js.map +1 -0
  58. package/dist/row/CostCreateRow.d.ts +14 -0
  59. package/dist/row/CostCreateRow.js +3 -0
  60. package/dist/row/CostCreateRow.js.map +1 -0
  61. package/dist/row/CostRow.d.ts +16 -0
  62. package/dist/row/CostRow.js +3 -0
  63. package/dist/row/CostRow.js.map +1 -0
  64. package/dist/row/EstimationRow.d.ts +5 -0
  65. package/dist/row/EstimationRow.js +3 -0
  66. package/dist/row/EstimationRow.js.map +1 -0
  67. package/dist/row/EstimationRowRow.d.ts +5 -0
  68. package/dist/row/EstimationRowRow.js +3 -0
  69. package/dist/row/EstimationRowRow.js.map +1 -0
  70. package/dist/row/PeriodRow.d.ts +4 -0
  71. package/dist/row/PeriodRow.js +3 -0
  72. package/dist/row/PeriodRow.js.map +1 -0
  73. package/logo.png +0 -0
  74. package/package.json +28 -0
  75. package/src/NamirasoftCostServer.ts +42 -0
  76. package/src/NamirasoftCostServerBase.ts +30 -0
  77. package/src/NamirasoftCostServerBillWatchAWS.ts +39 -0
  78. package/src/NamirasoftCostServerCost.ts +50 -0
  79. package/src/NamirasoftCostServerHealthz.ts +36 -0
  80. package/src/NamirasoftCostServerValue.ts +37 -0
  81. package/src/command/BillWatchAWSCommand.ts +32 -0
  82. package/src/command/BillWatchAWSEstimationCommand.ts +74 -0
  83. package/src/command/CostCommand.ts +34 -0
  84. package/src/command/CostListCommand.ts +45 -0
  85. package/src/command/Cost_CreateCommand.ts +155 -0
  86. package/src/command/HealthzCommand.ts +32 -0
  87. package/src/command/HealthzGetCommand.ts +45 -0
  88. package/src/command/ValueCommand.ts +32 -0
  89. package/src/command/ValueListCommand.ts +45 -0
  90. package/src/command/cli.ts +39 -0
  91. package/src/index.ts +42 -0
  92. package/src/meta/CostMetaTable.ts +74 -0
  93. package/src/meta/NamirasoftCostMetaDatabase.ts +51 -0
  94. package/src/row/CostCreateRow.ts +35 -0
  95. package/src/row/CostRow.ts +37 -0
  96. package/src/row/EstimationRow.ts +27 -0
  97. package/src/row/EstimationRowRow.ts +27 -0
  98. package/src/row/PeriodRow.ts +25 -0
  99. package/tsconfig.json +42 -0
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class HealthzGetCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,38 @@
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.HealthzGetCommand = 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 HealthzGetCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, [], []);
20
+ }
21
+ exec() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ let token = this.app.storage.getNSAToken();
24
+ if (token == null)
25
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
26
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
27
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
28
+ manager.setValue(token, false);
29
+ let url = this.app.storage.getItem("ns-cost-server-url");
30
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
31
+ let ans = yield server.healthz.Get();
32
+ this.app.logger.success(JSON.stringify(ans));
33
+ });
34
+ }
35
+ }
36
+ exports.HealthzGetCommand = HealthzGetCommand;
37
+ ;
38
+ //# sourceMappingURL=HealthzGetCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HealthzGetCommand.js","sourceRoot":"","sources":["../../src/command/HealthzGetCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,iBAAkB,SAAQ,sCAAgB;IAEnD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IACxB,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,OAAO,CAAC,GAAG,EAAE,CAAC;YACrC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,8CAmBC;AAAA,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
2
+ export declare class ValueCommand extends BaseNavigatorCommand {
3
+ constructor(argv: string[]);
4
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValueCommand = void 0;
4
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
+ const ValueListCommand_1 = require("./ValueListCommand");
6
+ class ValueCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
7
+ constructor(argv) {
8
+ super(argv, {
9
+ "list": ValueListCommand_1.ValueListCommand,
10
+ });
11
+ }
12
+ }
13
+ exports.ValueCommand = ValueCommand;
14
+ ;
15
+ //# sourceMappingURL=ValueCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValueCommand.js","sourceRoot":"","sources":["../../src/command/ValueCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,yDAAsD;AAEtD,MAAa,YAAa,SAAQ,0CAAoB;IAElD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,MAAM,EAAE,mCAAgB;SAC3B,CAAC,CAAC;IACP,CAAC;CACJ;AARD,oCAQC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class ValueListCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,38 @@
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.ValueListCommand = 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 ValueListCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, ["table", "column", "search", "field_id", "limit"], []);
20
+ }
21
+ exec() {
22
+ return __awaiter(this, void 0, void 0, function* () {
23
+ let token = this.app.storage.getNSAToken();
24
+ if (token == null)
25
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
26
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
27
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
28
+ manager.setValue(token, false);
29
+ let url = this.app.storage.getItem("ns-cost-server-url");
30
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
31
+ let ans = yield server.value.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4]);
32
+ this.app.logger.success(JSON.stringify(ans));
33
+ });
34
+ }
35
+ }
36
+ exports.ValueListCommand = ValueListCommand;
37
+ ;
38
+ //# sourceMappingURL=ValueListCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ValueListCommand.js","sourceRoot":"","sources":["../../src/command/ValueListCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,gBAAiB,SAAQ,sCAAgB;IAElD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAC;IACxE,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,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;YACtI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAnBD,4CAmBC;AAAA,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const namirasoft_account_1 = require("namirasoft-account");
5
+ const namirasoft_node_cli_1 = require("namirasoft-node-cli");
6
+ const BillWatchAWSCommand_1 = require("./BillWatchAWSCommand");
7
+ const namirasoft_node_cli_2 = require("namirasoft-node-cli");
8
+ const CostCommand_1 = require("./CostCommand");
9
+ const HealthzCommand_1 = require("./HealthzCommand");
10
+ const ValueCommand_1 = require("./ValueCommand");
11
+ let app = new namirasoft_node_cli_1.Application("ns-cost", new namirasoft_node_cli_1.BaseStorage(), {
12
+ "healthz": HealthzCommand_1.HealthzCommand,
13
+ "value": ValueCommand_1.ValueCommand,
14
+ "billwatchaws": BillWatchAWSCommand_1.BillWatchAWSCommand,
15
+ "cost": CostCommand_1.CostCommand,
16
+ "account": namirasoft_account_1.AccountCommand,
17
+ "config": (argv) => new namirasoft_node_cli_2.ConfigCommand(argv, ["ns-cost-server-url"])
18
+ });
19
+ app.run();
20
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +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"}
@@ -0,0 +1,22 @@
1
+ export * from "./NamirasoftCostServer";
2
+ export * from "./NamirasoftCostServerBase";
3
+ export * from "./NamirasoftCostServerBillWatchAWS";
4
+ export * from "./NamirasoftCostServerCost";
5
+ export * from "./NamirasoftCostServerHealthz";
6
+ export * from "./NamirasoftCostServerValue";
7
+ export * from "./command/BillWatchAWSCommand";
8
+ export * from "./command/BillWatchAWSEstimationCommand";
9
+ export * from "./command/CostCommand";
10
+ export * from "./command/CostListCommand";
11
+ export * from "./command/Cost_CreateCommand";
12
+ export * from "./command/HealthzCommand";
13
+ export * from "./command/HealthzGetCommand";
14
+ export * from "./command/ValueCommand";
15
+ export * from "./command/ValueListCommand";
16
+ export * from "./meta/CostMetaTable";
17
+ export * from "./meta/NamirasoftCostMetaDatabase";
18
+ export * from "./row/CostCreateRow";
19
+ export * from "./row/CostRow";
20
+ export * from "./row/EstimationRow";
21
+ export * from "./row/EstimationRowRow";
22
+ export * from "./row/PeriodRow";
package/dist/index.js ADDED
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./NamirasoftCostServer"), exports);
18
+ __exportStar(require("./NamirasoftCostServerBase"), exports);
19
+ __exportStar(require("./NamirasoftCostServerBillWatchAWS"), exports);
20
+ __exportStar(require("./NamirasoftCostServerCost"), exports);
21
+ __exportStar(require("./NamirasoftCostServerHealthz"), exports);
22
+ __exportStar(require("./NamirasoftCostServerValue"), exports);
23
+ __exportStar(require("./command/BillWatchAWSCommand"), exports);
24
+ __exportStar(require("./command/BillWatchAWSEstimationCommand"), exports);
25
+ __exportStar(require("./command/CostCommand"), exports);
26
+ __exportStar(require("./command/CostListCommand"), exports);
27
+ __exportStar(require("./command/Cost_CreateCommand"), exports);
28
+ __exportStar(require("./command/HealthzCommand"), exports);
29
+ __exportStar(require("./command/HealthzGetCommand"), exports);
30
+ __exportStar(require("./command/ValueCommand"), exports);
31
+ __exportStar(require("./command/ValueListCommand"), exports);
32
+ __exportStar(require("./meta/CostMetaTable"), exports);
33
+ __exportStar(require("./meta/NamirasoftCostMetaDatabase"), exports);
34
+ __exportStar(require("./row/CostCreateRow"), exports);
35
+ __exportStar(require("./row/CostRow"), exports);
36
+ __exportStar(require("./row/EstimationRow"), exports);
37
+ __exportStar(require("./row/EstimationRowRow"), exports);
38
+ __exportStar(require("./row/PeriodRow"), exports);
39
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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"}
@@ -0,0 +1,23 @@
1
+ import { BaseMetaColumn } from "namirasoft-core";
2
+ import { CostRow } from "../row/CostRow";
3
+ import { NSBaseMetaDatabase, NSBaseMetaTable } from "namirasoft-site";
4
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
5
+ export declare class CostMetaTable extends NSBaseMetaTable<NamirasoftCostServer, CostRow> {
6
+ columns: {
7
+ id: BaseMetaColumn;
8
+ user_id: BaseMetaColumn;
9
+ workspace_id: BaseMetaColumn;
10
+ product_id: BaseMetaColumn;
11
+ resource_entity: BaseMetaColumn;
12
+ resource_id: BaseMetaColumn;
13
+ usage_name: BaseMetaColumn;
14
+ usage_value: BaseMetaColumn;
15
+ usage_unit: BaseMetaColumn;
16
+ period_start: BaseMetaColumn;
17
+ period_end: BaseMetaColumn;
18
+ amount: BaseMetaColumn;
19
+ currency: BaseMetaColumn;
20
+ created_at: BaseMetaColumn;
21
+ };
22
+ constructor(database: NSBaseMetaDatabase<NamirasoftCostServer>);
23
+ }
@@ -0,0 +1,46 @@
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.CostMetaTable = void 0;
13
+ const namirasoft_core_1 = require("namirasoft-core");
14
+ const namirasoft_site_1 = require("namirasoft-site");
15
+ class CostMetaTable extends namirasoft_site_1.NSBaseMetaTable {
16
+ constructor(database) {
17
+ super(database, "cost", "Cost", new namirasoft_core_1.BaseUUID("cst"));
18
+ this.columns = {
19
+ id: new namirasoft_core_1.BaseMetaColumn(this, "id", "ID", "String", true),
20
+ user_id: new namirasoft_core_1.BaseMetaColumn(this, "user_id", "User ID", "String", true),
21
+ workspace_id: new namirasoft_core_1.BaseMetaColumn(this, "workspace_id", "Workspace ID", "String", true),
22
+ product_id: new namirasoft_core_1.BaseMetaColumn(this, "product_id", "Product ID", "String", true),
23
+ resource_entity: new namirasoft_core_1.BaseMetaColumn(this, "resource_entity", "Resource Entity", "String", true),
24
+ resource_id: new namirasoft_core_1.BaseMetaColumn(this, "resource_id", "Resource ID", "String", true),
25
+ usage_name: new namirasoft_core_1.BaseMetaColumn(this, "usage_name", "Usage Name", "String", true),
26
+ usage_value: new namirasoft_core_1.BaseMetaColumn(this, "usage_value", "Usage Value", "Double", true),
27
+ usage_unit: new namirasoft_core_1.BaseMetaColumn(this, "usage_unit", "Usage Unit", "String", true),
28
+ period_start: new namirasoft_core_1.BaseMetaColumn(this, "period_start", "Period Start", "DateTime", true),
29
+ period_end: new namirasoft_core_1.BaseMetaColumn(this, "period_end", "Period End", "DateTime", true),
30
+ amount: new namirasoft_core_1.BaseMetaColumn(this, "amount", "Amount", "Double", true),
31
+ currency: new namirasoft_core_1.BaseMetaColumn(this, "currency", "Currency", "String", true),
32
+ created_at: new namirasoft_core_1.BaseMetaColumn(this, "created_at", "Created At", "DateTime", true),
33
+ };
34
+ this.back_end.get = (id) => __awaiter(this, void 0, void 0, function* () {
35
+ console.log(id);
36
+ throw new Error("Cost.Get is not implemented");
37
+ });
38
+ this.back_end.list = (filters, page, size, sorts) => __awaiter(this, void 0, void 0, function* () {
39
+ let server = this.database.getServer();
40
+ return yield server.cost.List(filters, page, size, sorts);
41
+ });
42
+ }
43
+ }
44
+ exports.CostMetaTable = CostMetaTable;
45
+ ;
46
+ //# sourceMappingURL=CostMetaTable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CostMetaTable.js","sourceRoot":"","sources":["../../src/meta/CostMetaTable.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,qDAAiF;AAEjF,qDAAsE;AAGtE,MAAa,aAAc,SAAQ,iCAA8C;IAkB7E,YAAY,QAAkD;QAE1D,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,0BAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,OAAO,GAAG;YACX,EAAE,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC;YACxD,OAAO,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC;YACvE,YAAY,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,CAAC;YACtF,UAAU,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC;YAChF,eAAe,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC/F,WAAW,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC;YACnF,UAAU,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC;YAChF,WAAW,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,aAAa,EAAE,aAAa,EAAE,QAAQ,EAAE,IAAI,CAAC;YACnF,UAAU,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC;YAChF,YAAY,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,CAAC;YACxF,UAAU,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC;YAClF,MAAM,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC;YACpE,QAAQ,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,IAAI,CAAC;YAC1E,UAAU,EAAE,IAAI,gCAAc,CAAC,IAAI,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,IAAI,CAAC;SACrF,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,GAAG,GAAG,CAAO,EAAU,EAAE,EAAE;YAErC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;YAChB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;QACnD,CAAC,CAAA,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAO,OAA4B,EAAE,IAAqB,EAAE,IAAqB,EAAE,KAAiB,EAAE,EAAE;YAEzH,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC;YACvC,OAAO,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;QAC9D,CAAC,CAAA,CAAC;IACN,CAAC;CACJ;AAhDD,sCAgDC;AAAA,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { CostMetaTable } from "./CostMetaTable";
2
+ import { NSBaseMetaDatabase } from "namirasoft-site";
3
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
4
+ import { TokenManager } from "namirasoft-account";
5
+ export declare class NamirasoftCostMetaDatabase extends NSBaseMetaDatabase<NamirasoftCostServer> {
6
+ private manager?;
7
+ private onError?;
8
+ tables: {
9
+ cost: CostMetaTable;
10
+ };
11
+ constructor(manager?: TokenManager, onError?: (error: Error) => void);
12
+ getServer(): NamirasoftCostServer;
13
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NamirasoftCostMetaDatabase = void 0;
4
+ const CostMetaTable_1 = require("./CostMetaTable");
5
+ const namirasoft_core_1 = require("namirasoft-core");
6
+ const namirasoft_site_1 = require("namirasoft-site");
7
+ const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
8
+ class NamirasoftCostMetaDatabase extends namirasoft_site_1.NSBaseMetaDatabase {
9
+ constructor(manager, onError) {
10
+ super({ id: "prd-10bb85099e6f4c0a", name: "Namirasoft History", headline: "Activity Record Keeping", description: "A service that provides a comprehensive record of all activities across all services, such as edit and delete, to keep users informed.", logo: "https://static.namirasoft.com/image/namirasoft/history/logo/base.png", link: "https://history.namirasoft.com" });
11
+ this.manager = manager;
12
+ this.onError = onError;
13
+ this.tables = {
14
+ cost: new CostMetaTable_1.CostMetaTable(this),
15
+ };
16
+ }
17
+ getServer() {
18
+ if (!this.manager || !this.onError)
19
+ throw new Error("Arguments of NamirasoftCostMetaDatabase (manager, onError) are required for server operations.");
20
+ let NAME = namirasoft_site_1.NSBaseMetaDatabase.getServerBaseURL(this.product.name);
21
+ let BASE_URL = new namirasoft_core_1.EnvService(NAME, true).getString();
22
+ return new NamirasoftCostServer_1.NamirasoftCostServer(BASE_URL, this.manager, this.onError);
23
+ }
24
+ }
25
+ exports.NamirasoftCostMetaDatabase = NamirasoftCostMetaDatabase;
26
+ ;
27
+ //# sourceMappingURL=NamirasoftCostMetaDatabase.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NamirasoftCostMetaDatabase.js","sourceRoot":"","sources":["../../src/meta/NamirasoftCostMetaDatabase.ts"],"names":[],"mappings":";;;AAoBA,mDAAgD;AAChD,qDAA6C;AAC7C,qDAAqD;AACrD,kEAA+D;AAG/D,MAAa,0BAA2B,SAAQ,oCAAwC;IAOpF,YAAY,OAAsB,EAAE,OAAgC;QAEhE,KAAK,CAAC,EAAE,EAAE,EAAE,sBAAsB,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,yBAAyB,EAAE,WAAW,EAAE,wIAAwI,EAAE,IAAI,EAAE,sEAAsE,EAAE,IAAI,EAAE,gCAAgC,EAAE,CAAC,CAAC;QACpX,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG;YACV,IAAI,EAAE,IAAI,6BAAa,CAAC,IAAI,CAAC;SAChC,CAAC;IACN,CAAC;IACQ,SAAS;QAEd,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO;YAC9B,MAAM,IAAI,KAAK,CAAC,gGAAgG,CAAC,CAAA;QACrH,IAAI,IAAI,GAAG,oCAAkB,CAAC,gBAAgB,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAClE,IAAI,QAAQ,GAAG,IAAI,4BAAU,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,SAAS,EAAE,CAAC;QACtD,OAAO,IAAI,2CAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;IAC1E,CAAC;CACJ;AAxBD,gEAwBC;AAAA,CAAC"}
@@ -0,0 +1,14 @@
1
+ export type CostCreateRow = {
2
+ user_id: string;
3
+ workspace_id: string;
4
+ product_id: string;
5
+ resource_entity: string;
6
+ resource_id: string;
7
+ usage_name: string;
8
+ usage_value: number;
9
+ usage_unit: string;
10
+ period_start: Date;
11
+ period_end: Date;
12
+ amount: number;
13
+ currency: string;
14
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CostCreateRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CostCreateRow.js","sourceRoot":"","sources":["../../src/row/CostCreateRow.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ export type CostRow = {
2
+ id: string;
3
+ user_id: string;
4
+ workspace_id: string;
5
+ product_id: string;
6
+ resource_entity: string;
7
+ resource_id: string;
8
+ usage_name: string;
9
+ usage_value: number;
10
+ usage_unit: string;
11
+ period_start: Date;
12
+ period_end: Date;
13
+ amount: number;
14
+ currency: string;
15
+ created_at: Date;
16
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=CostRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CostRow.js","sourceRoot":"","sources":["../../src/row/CostRow.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { EstimationRowRow } from "./EstimationRowRow";
2
+ export type EstimationRow = {
3
+ sum: number;
4
+ rows: EstimationRowRow[];
5
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=EstimationRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EstimationRow.js","sourceRoot":"","sources":["../../src/row/EstimationRow.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ import { PeriodRow } from "./PeriodRow";
2
+ export type EstimationRowRow = {
3
+ period: PeriodRow;
4
+ amount: number;
5
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=EstimationRowRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EstimationRowRow.js","sourceRoot":"","sources":["../../src/row/EstimationRowRow.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export type PeriodRow = {
2
+ start: string;
3
+ end: string;
4
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=PeriodRow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PeriodRow.js","sourceRoot":"","sources":["../../src/row/PeriodRow.ts"],"names":[],"mappings":""}
package/logo.png ADDED
Binary file
package/package.json ADDED
@@ -0,0 +1,28 @@
1
+ {
2
+ "name": "namirasoft-cost",
3
+ "title": "Namirasoft Cost NPM Package",
4
+ "description": "Namira Software Corporation Cost NPM Package",
5
+ "icon": "logo.png",
6
+ "logo": "https://static.namirasoft.com/image/namirasoft/cost/logo/base.png",
7
+ "language": "ts",
8
+ "framework": "npm",
9
+ "application": "package",
10
+ "private": false,
11
+ "version": "1.4.0",
12
+ "author": "Amir Abolhasani",
13
+ "license": "MIT",
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "scripts": {
17
+ "build": ""
18
+ },
19
+ "dependencies": {
20
+ "namirasoft-core": "^1.4.68",
21
+ "namirasoft-site": "^1.4.31",
22
+ "namirasoft-node-cli": "^1.4.7",
23
+ "namirasoft-account": "^1.4.71"
24
+ },
25
+ "bin": {
26
+ "ns-cost": "./dist/command/cli.js"
27
+ }
28
+ }
@@ -0,0 +1,42 @@
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 { NSABaseServer } from "namirasoft-account";
22
+ import { NamirasoftCostServerBillWatchAWS } from "./NamirasoftCostServerBillWatchAWS";
23
+ import { NamirasoftCostServerCost } from "./NamirasoftCostServerCost";
24
+ import { NamirasoftCostServerHealthz } from "./NamirasoftCostServerHealthz";
25
+ import { NamirasoftCostServerValue } from "./NamirasoftCostServerValue";
26
+ import { TokenManager } from "namirasoft-account";
27
+
28
+ export class NamirasoftCostServer extends NSABaseServer
29
+ {
30
+ healthz: NamirasoftCostServerHealthz;
31
+ value: NamirasoftCostServerValue;
32
+ bill_watch_a_w_s: NamirasoftCostServerBillWatchAWS;
33
+ cost: NamirasoftCostServerCost;
34
+ constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
35
+ {
36
+ super(base_url, `1.4.0`, manager, onError);
37
+ this.healthz = new NamirasoftCostServerHealthz(this);
38
+ this.value = new NamirasoftCostServerValue(this);
39
+ this.bill_watch_a_w_s = new NamirasoftCostServerBillWatchAWS(this);
40
+ this.cost = new NamirasoftCostServerCost(this);
41
+ }
42
+ };
@@ -0,0 +1,30 @@
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 { NamirasoftCostServer } from "./NamirasoftCostServer";
22
+
23
+ export class NamirasoftCostServerBase
24
+ {
25
+ public server: NamirasoftCostServer;
26
+ constructor(server: NamirasoftCostServer)
27
+ {
28
+ this.server = server;
29
+ }
30
+ };
@@ -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 NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase
27
+ {
28
+ constructor(server: NamirasoftCostServer)
29
+ {
30
+ super(server);
31
+ this.Estimation = this.Estimation.bind(this);
32
+ }
33
+ async Estimation(body: { first_watch_created_at: string, period: PeriodRow, regions: string[] }): Promise<EstimationRow>
34
+ {
35
+ let path = `/estimation/bill-watch/watch/aws`;
36
+ let { data } = await this.server._post<EstimationRow>(path, {}, body);
37
+ return data;
38
+ }
39
+ };