namirasoft-cost 1.4.27 → 1.4.31

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 (182) hide show
  1. package/.ns-sdkg-file-keep +10 -0
  2. package/dist/NamirasoftCostServer.js +1 -1
  3. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +4 -15
  4. package/dist/NamirasoftCostServerBillWatchAWS.js +2 -2
  5. package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
  6. package/dist/NamirasoftCostServerBillWatchAzure.d.ts +4 -15
  7. package/dist/NamirasoftCostServerBillWatchAzure.js +2 -2
  8. package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -1
  9. package/dist/NamirasoftCostServerBillWatchGCP.d.ts +4 -15
  10. package/dist/NamirasoftCostServerBillWatchGCP.js +2 -2
  11. package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -1
  12. package/dist/NamirasoftCostServerCost.d.ts +0 -2
  13. package/dist/NamirasoftCostServerCost.js +0 -8
  14. package/dist/NamirasoftCostServerCost.js.map +1 -1
  15. package/dist/NamirasoftCostServerFieldCategory.d.ts +4 -15
  16. package/dist/NamirasoftCostServerFieldCategory.js +2 -2
  17. package/dist/NamirasoftCostServerFieldCategory.js.map +1 -1
  18. package/dist/NamirasoftCostServerFieldField.d.ts +4 -15
  19. package/dist/NamirasoftCostServerFieldField.js +2 -2
  20. package/dist/NamirasoftCostServerFieldField.js.map +1 -1
  21. package/dist/NamirasoftCostServerSecretSecret.d.ts +6 -29
  22. package/dist/NamirasoftCostServerSecretSecret.js +2 -2
  23. package/dist/NamirasoftCostServerSecretSecret.js.map +1 -1
  24. package/dist/command/BillWatchAWSCommand.d.ts +4 -0
  25. package/dist/command/BillWatchAWSCommand.js +17 -0
  26. package/dist/command/BillWatchAWSCommand.js.map +1 -0
  27. package/dist/command/BillWatchAWSEstimateRecordCommand.d.ts +5 -0
  28. package/dist/command/BillWatchAWSEstimateRecordCommand.js +103 -0
  29. package/dist/command/BillWatchAWSEstimateRecordCommand.js.map +1 -0
  30. package/dist/command/BillWatchAWS_CreateForRecordCommand.d.ts +5 -0
  31. package/dist/command/BillWatchAWS_CreateForRecordCommand.js +112 -0
  32. package/dist/command/BillWatchAWS_CreateForRecordCommand.js.map +1 -0
  33. package/dist/command/BillWatchAzureCommand.d.ts +4 -0
  34. package/dist/command/BillWatchAzureCommand.js +17 -0
  35. package/dist/command/BillWatchAzureCommand.js.map +1 -0
  36. package/dist/command/BillWatchAzureEstimateRecordCommand.d.ts +5 -0
  37. package/dist/command/BillWatchAzureEstimateRecordCommand.js +103 -0
  38. package/dist/command/BillWatchAzureEstimateRecordCommand.js.map +1 -0
  39. package/dist/command/BillWatchAzure_CreateForRecordCommand.d.ts +5 -0
  40. package/dist/command/BillWatchAzure_CreateForRecordCommand.js +112 -0
  41. package/dist/command/BillWatchAzure_CreateForRecordCommand.js.map +1 -0
  42. package/dist/command/BillWatchGCPCommand.d.ts +4 -0
  43. package/dist/command/BillWatchGCPCommand.js +17 -0
  44. package/dist/command/BillWatchGCPCommand.js.map +1 -0
  45. package/dist/command/BillWatchGCPEstimateRecordCommand.d.ts +5 -0
  46. package/dist/command/BillWatchGCPEstimateRecordCommand.js +103 -0
  47. package/dist/command/BillWatchGCPEstimateRecordCommand.js.map +1 -0
  48. package/dist/command/BillWatchGCP_CreateForRecordCommand.d.ts +5 -0
  49. package/dist/command/BillWatchGCP_CreateForRecordCommand.js +112 -0
  50. package/dist/command/BillWatchGCP_CreateForRecordCommand.js.map +1 -0
  51. package/dist/command/CostCommand.d.ts +4 -0
  52. package/dist/command/CostCommand.js +15 -0
  53. package/dist/command/CostCommand.js.map +1 -0
  54. package/dist/command/CostListCommand.d.ts +5 -0
  55. package/dist/command/CostListCommand.js +38 -0
  56. package/dist/command/CostListCommand.js.map +1 -0
  57. package/dist/command/FieldCategoryCommand.d.ts +4 -0
  58. package/dist/command/FieldCategoryCommand.js +17 -0
  59. package/dist/command/FieldCategoryCommand.js.map +1 -0
  60. package/dist/command/FieldCategoryEstimateRecordCommand.d.ts +5 -0
  61. package/dist/command/FieldCategoryEstimateRecordCommand.js +103 -0
  62. package/dist/command/FieldCategoryEstimateRecordCommand.js.map +1 -0
  63. package/dist/command/FieldCategory_CreateForRecordCommand.d.ts +5 -0
  64. package/dist/command/FieldCategory_CreateForRecordCommand.js +112 -0
  65. package/dist/command/FieldCategory_CreateForRecordCommand.js.map +1 -0
  66. package/dist/command/FieldFieldCommand.d.ts +4 -0
  67. package/dist/command/FieldFieldCommand.js +17 -0
  68. package/dist/command/FieldFieldCommand.js.map +1 -0
  69. package/dist/command/FieldFieldEstimateRecordCommand.d.ts +5 -0
  70. package/dist/command/FieldFieldEstimateRecordCommand.js +103 -0
  71. package/dist/command/FieldFieldEstimateRecordCommand.js.map +1 -0
  72. package/dist/command/FieldField_CreateForRecordCommand.d.ts +5 -0
  73. package/dist/command/FieldField_CreateForRecordCommand.js +112 -0
  74. package/dist/command/FieldField_CreateForRecordCommand.js.map +1 -0
  75. package/dist/command/HealthzCommand.d.ts +4 -0
  76. package/dist/command/HealthzCommand.js +15 -0
  77. package/dist/command/HealthzCommand.js.map +1 -0
  78. package/dist/command/HealthzGetCommand.d.ts +5 -0
  79. package/dist/command/HealthzGetCommand.js +38 -0
  80. package/dist/command/HealthzGetCommand.js.map +1 -0
  81. package/dist/command/MetricsCommand.d.ts +4 -0
  82. package/dist/command/MetricsCommand.js +15 -0
  83. package/dist/command/MetricsCommand.js.map +1 -0
  84. package/dist/command/MetricsGetCommand.d.ts +5 -0
  85. package/dist/command/MetricsGetCommand.js +38 -0
  86. package/dist/command/MetricsGetCommand.js.map +1 -0
  87. package/dist/command/SecretSecretCommand.d.ts +4 -0
  88. package/dist/command/SecretSecretCommand.js +21 -0
  89. package/dist/command/SecretSecretCommand.js.map +1 -0
  90. package/dist/command/SecretSecretEstimateReadCommand.d.ts +5 -0
  91. package/dist/command/SecretSecretEstimateReadCommand.js +103 -0
  92. package/dist/command/SecretSecretEstimateReadCommand.js.map +1 -0
  93. package/dist/command/SecretSecretEstimateRecordCommand.d.ts +5 -0
  94. package/dist/command/SecretSecretEstimateRecordCommand.js +103 -0
  95. package/dist/command/SecretSecretEstimateRecordCommand.js.map +1 -0
  96. package/dist/command/SecretSecret_CreateForReadCommand.d.ts +5 -0
  97. package/dist/command/SecretSecret_CreateForReadCommand.js +112 -0
  98. package/dist/command/SecretSecret_CreateForReadCommand.js.map +1 -0
  99. package/dist/command/SecretSecret_CreateForRecordCommand.d.ts +5 -0
  100. package/dist/command/SecretSecret_CreateForRecordCommand.js +112 -0
  101. package/dist/command/SecretSecret_CreateForRecordCommand.js.map +1 -0
  102. package/dist/command/ValueCommand.d.ts +4 -0
  103. package/dist/command/ValueCommand.js +15 -0
  104. package/dist/command/ValueCommand.js.map +1 -0
  105. package/dist/command/ValueListCommand.d.ts +5 -0
  106. package/dist/command/ValueListCommand.js +38 -0
  107. package/dist/command/ValueListCommand.js.map +1 -0
  108. package/dist/command/cli.d.ts +2 -0
  109. package/dist/command/cli.js +32 -0
  110. package/dist/command/cli.js.map +1 -0
  111. package/dist/estimator/BaseEstimator.d.ts +1 -1
  112. package/dist/estimator/BaseEstimator.js +1 -1
  113. package/dist/estimator/BaseEstimator.js.map +1 -1
  114. package/dist/estimator/BillWatchBaseRecordEstimator.d.ts +1 -1
  115. package/dist/estimator/BillWatchBaseRecordEstimator.js +1 -1
  116. package/dist/estimator/BillWatchBaseRecordEstimator.js.map +1 -1
  117. package/dist/estimator/FieldBaseRecordEstimator.d.ts +1 -1
  118. package/dist/estimator/FieldBaseRecordEstimator.js +1 -1
  119. package/dist/estimator/FieldBaseRecordEstimator.js.map +1 -1
  120. package/dist/estimator/SecretSecretReadEstimator.d.ts +1 -1
  121. package/dist/estimator/SecretSecretReadEstimator.js +1 -1
  122. package/dist/estimator/SecretSecretReadEstimator.js.map +1 -1
  123. package/dist/estimator/SecretSecretRecordEstimator.d.ts +1 -1
  124. package/dist/estimator/SecretSecretRecordEstimator.js +1 -1
  125. package/dist/estimator/SecretSecretRecordEstimator.js.map +1 -1
  126. package/dist/index.d.ts +47 -12
  127. package/dist/index.js +47 -12
  128. package/dist/index.js.map +1 -1
  129. package/package.json +4 -4
  130. package/src/NamirasoftCostServer.ts +1 -1
  131. package/src/NamirasoftCostServerBillWatchAWS.ts +8 -7
  132. package/src/NamirasoftCostServerBillWatchAzure.ts +8 -7
  133. package/src/NamirasoftCostServerBillWatchGCP.ts +8 -7
  134. package/src/NamirasoftCostServerCost.ts +0 -8
  135. package/src/NamirasoftCostServerFieldCategory.ts +8 -7
  136. package/src/NamirasoftCostServerFieldField.ts +8 -7
  137. package/src/NamirasoftCostServerSecretSecret.ts +12 -11
  138. package/src/command/BillWatchAWSCommand.ts +34 -0
  139. package/src/command/BillWatchAWSEstimateRecordCommand.ts +110 -0
  140. package/src/command/BillWatchAWS_CreateForRecordCommand.ts +119 -0
  141. package/src/command/BillWatchAzureCommand.ts +34 -0
  142. package/src/command/BillWatchAzureEstimateRecordCommand.ts +110 -0
  143. package/src/command/BillWatchAzure_CreateForRecordCommand.ts +119 -0
  144. package/src/command/BillWatchGCPCommand.ts +34 -0
  145. package/src/command/BillWatchGCPEstimateRecordCommand.ts +110 -0
  146. package/src/command/BillWatchGCP_CreateForRecordCommand.ts +119 -0
  147. package/src/{row/CostCreateRow.ts → command/CostCommand.ts} +11 -17
  148. package/src/command/CostListCommand.ts +45 -0
  149. package/src/command/FieldCategoryCommand.ts +34 -0
  150. package/src/command/FieldCategoryEstimateRecordCommand.ts +110 -0
  151. package/src/command/FieldCategory_CreateForRecordCommand.ts +119 -0
  152. package/src/command/FieldFieldCommand.ts +34 -0
  153. package/src/command/FieldFieldEstimateRecordCommand.ts +110 -0
  154. package/src/command/FieldField_CreateForRecordCommand.ts +119 -0
  155. package/src/command/HealthzCommand.ts +32 -0
  156. package/src/command/HealthzGetCommand.ts +45 -0
  157. package/src/command/MetricsCommand.ts +32 -0
  158. package/src/command/MetricsGetCommand.ts +45 -0
  159. package/src/command/SecretSecretCommand.ts +38 -0
  160. package/src/command/SecretSecretEstimateReadCommand.ts +110 -0
  161. package/src/command/SecretSecretEstimateRecordCommand.ts +110 -0
  162. package/src/command/SecretSecret_CreateForReadCommand.ts +119 -0
  163. package/src/command/SecretSecret_CreateForRecordCommand.ts +119 -0
  164. package/src/command/ValueCommand.ts +32 -0
  165. package/src/command/ValueListCommand.ts +45 -0
  166. package/src/command/cli.ts +51 -0
  167. package/src/estimator/BaseEstimator.ts +62 -62
  168. package/src/estimator/BillWatchAWSRecordEstimator.ts +4 -4
  169. package/src/estimator/BillWatchAzureRecordEstimator.ts +4 -4
  170. package/src/estimator/BillWatchBaseRecordEstimator.ts +25 -25
  171. package/src/estimator/BillWatchGCPRecordEstimator.ts +4 -4
  172. package/src/estimator/FieldBaseRecordEstimator.ts +20 -20
  173. package/src/estimator/FieldCategoryRecordEstimator.ts +9 -9
  174. package/src/estimator/FieldFieldRecordEstimator.ts +9 -9
  175. package/src/estimator/SecretSecretReadEstimator.ts +25 -25
  176. package/src/estimator/SecretSecretRecordEstimator.ts +24 -24
  177. package/src/index.ts +47 -12
  178. package/src/type/CalculationOption.ts +1 -1
  179. package/src/type/Estimation.ts +1 -1
  180. package/dist/row/CostCreateRow.d.ts +0 -17
  181. package/dist/row/CostCreateRow.js +0 -3
  182. package/dist/row/CostCreateRow.js.map +0 -1
@@ -0,0 +1,112 @@
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.BillWatchAWS_CreateForRecordCommand = 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 BillWatchAWS_CreateForRecordCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, ["user_id"], [
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: "total_count",
30
+ short: "",
31
+ description: "Provides the value of 'total_count' in body",
32
+ optional: false,
33
+ args: ["total_count"],
34
+ defaults: [""]
35
+ },
36
+ {
37
+ name: "number",
38
+ short: "",
39
+ description: "Provides the value of 'number' in body",
40
+ optional: false,
41
+ args: ["number"],
42
+ defaults: [""]
43
+ },
44
+ {
45
+ name: "total_value",
46
+ short: "",
47
+ description: "Provides the value of 'total_value' in body",
48
+ optional: false,
49
+ args: ["total_value"],
50
+ defaults: [""]
51
+ },
52
+ {
53
+ name: "value",
54
+ short: "",
55
+ description: "Provides the value of 'value' in body",
56
+ optional: false,
57
+ args: ["value"],
58
+ defaults: [""]
59
+ },
60
+ {
61
+ name: "active",
62
+ short: "",
63
+ description: "Provides the value of 'active' in body",
64
+ optional: false,
65
+ args: ["active"],
66
+ defaults: [""]
67
+ },
68
+ {
69
+ name: "workspace_id",
70
+ short: "",
71
+ description: "Provides the value of 'workspace_id' in body",
72
+ optional: true,
73
+ args: ["workspace_id"],
74
+ defaults: [""]
75
+ },
76
+ {
77
+ name: "resource_id",
78
+ short: "",
79
+ description: "Provides the value of 'resource_id' in body",
80
+ optional: true,
81
+ args: ["resource_id"],
82
+ defaults: [""]
83
+ }
84
+ ]);
85
+ }
86
+ exec() {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ let token = this.app.storage.getNSAToken();
89
+ if (token == null)
90
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
91
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
92
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
93
+ manager.setValue(token, false);
94
+ let url = this.app.storage.getItem("ns-cost-server-url");
95
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
96
+ let ans = yield server.bill_watch_aws._CreateForRecord(this.arg_values[0], {
97
+ period: this.option_values.period,
98
+ total_count: this.option_values.total_count,
99
+ number: this.option_values.number,
100
+ total_value: this.option_values.total_value,
101
+ value: this.option_values.value,
102
+ active: this.option_values.active,
103
+ workspace_id: this.option_values.workspace_id,
104
+ resource_id: this.option_values.resource_id
105
+ });
106
+ this.app.logger.success(JSON.stringify(ans));
107
+ });
108
+ }
109
+ }
110
+ exports.BillWatchAWS_CreateForRecordCommand = BillWatchAWS_CreateForRecordCommand;
111
+ ;
112
+ //# sourceMappingURL=BillWatchAWS_CreateForRecordCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAWS_CreateForRecordCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWS_CreateForRecordCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,mCAAoC,SAAQ,sCAAgB;IAErE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;YACrB;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,aAAa;gB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AAC,WAAW;aAC9C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA7FD,kFA6FC;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,17 @@
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 BillWatchAzureEstimateRecordCommand_1 = require("./BillWatchAzureEstimateRecordCommand");
6
+ const BillWatchAzure_CreateForRecordCommand_1 = require("./BillWatchAzure_CreateForRecordCommand");
7
+ class BillWatchAzureCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
8
+ constructor(argv) {
9
+ super(argv, {
10
+ "estimaterecord": BillWatchAzureEstimateRecordCommand_1.BillWatchAzureEstimateRecordCommand,
11
+ "_createforrecord": BillWatchAzure_CreateForRecordCommand_1.BillWatchAzure_CreateForRecordCommand,
12
+ });
13
+ }
14
+ }
15
+ exports.BillWatchAzureCommand = BillWatchAzureCommand;
16
+ ;
17
+ //# sourceMappingURL=BillWatchAzureCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAzureCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,+FAA4F;AAC5F,mGAAgG;AAEhG,MAAa,qBAAsB,SAAQ,0CAAoB;IAE3D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,gBAAgB,EAAE,yEAAmC;YACrD,kBAAkB,EAAE,6EAAqC;SAC5D,CAAC,CAAC;IACP,CAAC;CACJ;AATD,sDASC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchAzureEstimateRecordCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,103 @@
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.BillWatchAzureEstimateRecordCommand = 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 BillWatchAzureEstimateRecordCommand 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: "total_count",
30
+ short: "",
31
+ description: "Provides the value of 'total_count' in body",
32
+ optional: false,
33
+ args: ["total_count"],
34
+ defaults: [""]
35
+ },
36
+ {
37
+ name: "number",
38
+ short: "",
39
+ description: "Provides the value of 'number' in body",
40
+ optional: false,
41
+ args: ["number"],
42
+ defaults: [""]
43
+ },
44
+ {
45
+ name: "total_value",
46
+ short: "",
47
+ description: "Provides the value of 'total_value' in body",
48
+ optional: false,
49
+ args: ["total_value"],
50
+ defaults: [""]
51
+ },
52
+ {
53
+ name: "value",
54
+ short: "",
55
+ description: "Provides the value of 'value' in body",
56
+ optional: false,
57
+ args: ["value"],
58
+ defaults: [""]
59
+ },
60
+ {
61
+ name: "active",
62
+ short: "",
63
+ description: "Provides the value of 'active' in body",
64
+ optional: false,
65
+ args: ["active"],
66
+ defaults: [""]
67
+ },
68
+ {
69
+ name: "trial_started_at",
70
+ short: "",
71
+ description: "Provides the value of 'trial_started_at' in body",
72
+ optional: true,
73
+ args: ["trial_started_at"],
74
+ defaults: [""]
75
+ }
76
+ ]);
77
+ }
78
+ exec() {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ let token = this.app.storage.getNSAToken();
81
+ if (token == null)
82
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
83
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
84
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
85
+ manager.setValue(token, false);
86
+ let url = this.app.storage.getItem("ns-cost-server-url");
87
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
88
+ let ans = yield server.bill_watch_azure.EstimateRecord({
89
+ period: this.option_values.period,
90
+ total_count: this.option_values.total_count,
91
+ number: this.option_values.number,
92
+ total_value: this.option_values.total_value,
93
+ value: this.option_values.value,
94
+ active: this.option_values.active,
95
+ trial_started_at: this.option_values.trial_started_at
96
+ });
97
+ this.app.logger.success(JSON.stringify(ans));
98
+ });
99
+ }
100
+ }
101
+ exports.BillWatchAzureEstimateRecordCommand = BillWatchAzureEstimateRecordCommand;
102
+ ;
103
+ //# sourceMappingURL=BillWatchAzureEstimateRecordCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAzureEstimateRecordCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureEstimateRecordCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;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EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,gBAAgB;aACxD,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AApFD,kFAoFC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchAzure_CreateForRecordCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,112 @@
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.BillWatchAzure_CreateForRecordCommand = 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 BillWatchAzure_CreateForRecordCommand extends namirasoft_node_cli_1.BaseFinalCommand {
18
+ constructor(argv) {
19
+ super(argv, ["user_id"], [
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: "total_count",
30
+ short: "",
31
+ description: "Provides the value of 'total_count' in body",
32
+ optional: false,
33
+ args: ["total_count"],
34
+ defaults: [""]
35
+ },
36
+ {
37
+ name: "number",
38
+ short: "",
39
+ description: "Provides the value of 'number' in body",
40
+ optional: false,
41
+ args: ["number"],
42
+ defaults: [""]
43
+ },
44
+ {
45
+ name: "total_value",
46
+ short: "",
47
+ description: "Provides the value of 'total_value' in body",
48
+ optional: false,
49
+ args: ["total_value"],
50
+ defaults: [""]
51
+ },
52
+ {
53
+ name: "value",
54
+ short: "",
55
+ description: "Provides the value of 'value' in body",
56
+ optional: false,
57
+ args: ["value"],
58
+ defaults: [""]
59
+ },
60
+ {
61
+ name: "active",
62
+ short: "",
63
+ description: "Provides the value of 'active' in body",
64
+ optional: false,
65
+ args: ["active"],
66
+ defaults: [""]
67
+ },
68
+ {
69
+ name: "workspace_id",
70
+ short: "",
71
+ description: "Provides the value of 'workspace_id' in body",
72
+ optional: true,
73
+ args: ["workspace_id"],
74
+ defaults: [""]
75
+ },
76
+ {
77
+ name: "resource_id",
78
+ short: "",
79
+ description: "Provides the value of 'resource_id' in body",
80
+ optional: true,
81
+ args: ["resource_id"],
82
+ defaults: [""]
83
+ }
84
+ ]);
85
+ }
86
+ exec() {
87
+ return __awaiter(this, void 0, void 0, function* () {
88
+ let token = this.app.storage.getNSAToken();
89
+ if (token == null)
90
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
91
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
92
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
93
+ manager.setValue(token, false);
94
+ let url = this.app.storage.getItem("ns-cost-server-url");
95
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
96
+ let ans = yield server.bill_watch_azure._CreateForRecord(this.arg_values[0], {
97
+ period: this.option_values.period,
98
+ total_count: this.option_values.total_count,
99
+ number: this.option_values.number,
100
+ total_value: this.option_values.total_value,
101
+ value: this.option_values.value,
102
+ active: this.option_values.active,
103
+ workspace_id: this.option_values.workspace_id,
104
+ resource_id: this.option_values.resource_id
105
+ });
106
+ this.app.logger.success(JSON.stringify(ans));
107
+ });
108
+ }
109
+ }
110
+ exports.BillWatchAzure_CreateForRecordCommand = BillWatchAzure_CreateForRecordCommand;
111
+ ;
112
+ //# sourceMappingURL=BillWatchAzure_CreateForRecordCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAzure_CreateForRecordCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzure_CreateForRecordCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,qCAAsC,SAAQ,sCAAgB;IAEvE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE;YACrB;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,aAAa;gBACnB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,6CAA6C;gBAC1D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,aAAa,CAAC;gBACrB,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;YACD;gBACI,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,6CAA6C;gBAC1D,QAAQ,EAAE,KAAK;gBAC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C;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,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;gBACzE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC/B,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,YAAY,EAAE,IAAI,CAAC,aAAa,CAAC,YAAY;gBAC7C,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;aAC9C,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AA7FD,sFA6FC;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,17 @@
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 BillWatchGCPEstimateRecordCommand_1 = require("./BillWatchGCPEstimateRecordCommand");
6
+ const BillWatchGCP_CreateForRecordCommand_1 = require("./BillWatchGCP_CreateForRecordCommand");
7
+ class BillWatchGCPCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
8
+ constructor(argv) {
9
+ super(argv, {
10
+ "estimaterecord": BillWatchGCPEstimateRecordCommand_1.BillWatchGCPEstimateRecordCommand,
11
+ "_createforrecord": BillWatchGCP_CreateForRecordCommand_1.BillWatchGCP_CreateForRecordCommand,
12
+ });
13
+ }
14
+ }
15
+ exports.BillWatchGCPCommand = BillWatchGCPCommand;
16
+ ;
17
+ //# sourceMappingURL=BillWatchGCPCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchGCPCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchGCPCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,2FAAwF;AACxF,+FAA4F;AAE5F,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,gBAAgB,EAAE,qEAAiC;YACnD,kBAAkB,EAAE,yEAAmC;SAC1D,CAAC,CAAC;IACP,CAAC;CACJ;AATD,kDASC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchGCPEstimateRecordCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }
@@ -0,0 +1,103 @@
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.BillWatchGCPEstimateRecordCommand = 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 BillWatchGCPEstimateRecordCommand 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: "total_count",
30
+ short: "",
31
+ description: "Provides the value of 'total_count' in body",
32
+ optional: false,
33
+ args: ["total_count"],
34
+ defaults: [""]
35
+ },
36
+ {
37
+ name: "number",
38
+ short: "",
39
+ description: "Provides the value of 'number' in body",
40
+ optional: false,
41
+ args: ["number"],
42
+ defaults: [""]
43
+ },
44
+ {
45
+ name: "total_value",
46
+ short: "",
47
+ description: "Provides the value of 'total_value' in body",
48
+ optional: false,
49
+ args: ["total_value"],
50
+ defaults: [""]
51
+ },
52
+ {
53
+ name: "value",
54
+ short: "",
55
+ description: "Provides the value of 'value' in body",
56
+ optional: false,
57
+ args: ["value"],
58
+ defaults: [""]
59
+ },
60
+ {
61
+ name: "active",
62
+ short: "",
63
+ description: "Provides the value of 'active' in body",
64
+ optional: false,
65
+ args: ["active"],
66
+ defaults: [""]
67
+ },
68
+ {
69
+ name: "trial_started_at",
70
+ short: "",
71
+ description: "Provides the value of 'trial_started_at' in body",
72
+ optional: true,
73
+ args: ["trial_started_at"],
74
+ defaults: [""]
75
+ }
76
+ ]);
77
+ }
78
+ exec() {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ let token = this.app.storage.getNSAToken();
81
+ if (token == null)
82
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
83
+ let storage = new namirasoft_core_1.IStorageMemoryDedicated();
84
+ let manager = new namirasoft_account_1.TokenManager(storage, () => { });
85
+ manager.setValue(token, false);
86
+ let url = this.app.storage.getItem("ns-cost-server-url");
87
+ let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
88
+ let ans = yield server.bill_watch_gcp.EstimateRecord({
89
+ period: this.option_values.period,
90
+ total_count: this.option_values.total_count,
91
+ number: this.option_values.number,
92
+ total_value: this.option_values.total_value,
93
+ value: this.option_values.value,
94
+ active: this.option_values.active,
95
+ trial_started_at: this.option_values.trial_started_at
96
+ });
97
+ this.app.logger.success(JSON.stringify(ans));
98
+ });
99
+ }
100
+ }
101
+ exports.BillWatchGCPEstimateRecordCommand = BillWatchGCPEstimateRecordCommand;
102
+ ;
103
+ //# sourceMappingURL=BillWatchGCPEstimateRecordCommand.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchGCPEstimateRecordCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchGCPEstimateRecordCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,iCAAkC,SAAQ,sCAAgB;IAEnE,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,aAAa;gBACnB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,6CAA6C;gBAC1D,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,aAA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CAAuB,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,cAAc,CAAC,cAAc,CAAC;gBACjD,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC,WAAW;gBAC3C,KAAK,EAAE,IAAI,CAAC,aAAa,CAAC,KAAK;gBAC/B,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,gBAAgB,EAAE,IAAI,CAAC,aAAa,CAAC,gBAAgB;aACxD,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AApFD,8EAoFC;AAAA,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { BaseFinalCommand } from "namirasoft-node-cli";
2
+ export declare class BillWatchGCP_CreateForRecordCommand extends BaseFinalCommand {
3
+ constructor(argv: string[]);
4
+ exec(): Promise<void>;
5
+ }