namirasoft-cost 1.4.25 → 1.4.27

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 (220) hide show
  1. package/.ns-sdkg-file-keep +11 -8
  2. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +2 -2
  3. package/dist/NamirasoftCostServerBillWatchAWS.js +4 -4
  4. package/dist/NamirasoftCostServerBillWatchAzure.d.ts +2 -2
  5. package/dist/NamirasoftCostServerBillWatchAzure.js +4 -4
  6. package/dist/NamirasoftCostServerBillWatchGCP.d.ts +2 -2
  7. package/dist/NamirasoftCostServerBillWatchGCP.js +4 -4
  8. package/dist/NamirasoftCostServerFieldCategory.d.ts +2 -2
  9. package/dist/NamirasoftCostServerFieldCategory.js +4 -4
  10. package/dist/NamirasoftCostServerFieldField.d.ts +2 -2
  11. package/dist/NamirasoftCostServerFieldField.js +4 -4
  12. package/dist/NamirasoftCostServerSecretSecret.d.ts +2 -2
  13. package/dist/NamirasoftCostServerSecretSecret.js +4 -4
  14. package/dist/index.d.ts +3 -29
  15. package/dist/index.js +3 -29
  16. package/dist/index.js.map +1 -1
  17. package/dist/type/Bonus.d.ts +9 -0
  18. package/dist/type/Bonus.js +16 -0
  19. package/dist/type/Bonus.js.map +1 -0
  20. package/dist/type/CalculationOption.d.ts +15 -0
  21. package/dist/type/CalculationOption.js +25 -0
  22. package/dist/type/CalculationOption.js.map +1 -0
  23. package/dist/type/Estimation.d.ts +4 -0
  24. package/dist/type/Estimation.js +22 -0
  25. package/dist/type/Estimation.js.map +1 -1
  26. package/dist/type/EstimationOption.d.ts +4 -0
  27. package/dist/type/EstimationOption.js +20 -0
  28. package/dist/type/EstimationOption.js.map +1 -1
  29. package/dist/type/EstimationUsage.d.ts +4 -0
  30. package/dist/type/EstimationUsage.js +15 -0
  31. package/dist/type/EstimationUsage.js.map +1 -1
  32. package/dist/type/Period.d.ts +4 -0
  33. package/dist/type/Period.js +27 -4
  34. package/dist/type/Period.js.map +1 -1
  35. package/dist/type/SimulationOption.d.ts +13 -0
  36. package/dist/type/SimulationOption.js +23 -0
  37. package/dist/type/SimulationOption.js.map +1 -0
  38. package/package.json +4 -3
  39. package/src/NamirasoftCostServerBillWatchAWS.ts +4 -4
  40. package/src/NamirasoftCostServerBillWatchAzure.ts +4 -4
  41. package/src/NamirasoftCostServerBillWatchGCP.ts +4 -4
  42. package/src/NamirasoftCostServerFieldCategory.ts +4 -4
  43. package/src/NamirasoftCostServerFieldField.ts +4 -4
  44. package/src/NamirasoftCostServerSecretSecret.ts +4 -4
  45. package/src/index.ts +3 -29
  46. package/src/type/Bonus.ts +21 -0
  47. package/src/type/CalculationOption.ts +34 -0
  48. package/src/type/Estimation.ts +24 -3
  49. package/src/type/EstimationOption.ts +22 -2
  50. package/src/type/EstimationUsage.ts +18 -1
  51. package/src/type/Period.ts +27 -3
  52. package/src/type/SimulationOption.ts +30 -0
  53. package/dist/command/BillWatchAWSCommand.d.ts +0 -4
  54. package/dist/command/BillWatchAWSCommand.js +0 -17
  55. package/dist/command/BillWatchAWSCommand.js.map +0 -1
  56. package/dist/command/BillWatchAWSEstimateHourlyCommand.d.ts +0 -5
  57. package/dist/command/BillWatchAWSEstimateHourlyCommand.js +0 -76
  58. package/dist/command/BillWatchAWSEstimateHourlyCommand.js.map +0 -1
  59. package/dist/command/BillWatchAWS_CreateForHourlyCommand.d.ts +0 -5
  60. package/dist/command/BillWatchAWS_CreateForHourlyCommand.js +0 -94
  61. package/dist/command/BillWatchAWS_CreateForHourlyCommand.js.map +0 -1
  62. package/dist/command/BillWatchAzureCommand.d.ts +0 -4
  63. package/dist/command/BillWatchAzureCommand.js +0 -17
  64. package/dist/command/BillWatchAzureCommand.js.map +0 -1
  65. package/dist/command/BillWatchAzureEstimateHourlyCommand.d.ts +0 -5
  66. package/dist/command/BillWatchAzureEstimateHourlyCommand.js +0 -76
  67. package/dist/command/BillWatchAzureEstimateHourlyCommand.js.map +0 -1
  68. package/dist/command/BillWatchAzure_CreateForHourlyCommand.d.ts +0 -5
  69. package/dist/command/BillWatchAzure_CreateForHourlyCommand.js +0 -94
  70. package/dist/command/BillWatchAzure_CreateForHourlyCommand.js.map +0 -1
  71. package/dist/command/BillWatchGCPCommand.d.ts +0 -4
  72. package/dist/command/BillWatchGCPCommand.js +0 -17
  73. package/dist/command/BillWatchGCPCommand.js.map +0 -1
  74. package/dist/command/BillWatchGCPEstimateHourlyCommand.d.ts +0 -5
  75. package/dist/command/BillWatchGCPEstimateHourlyCommand.js +0 -76
  76. package/dist/command/BillWatchGCPEstimateHourlyCommand.js.map +0 -1
  77. package/dist/command/BillWatchGCP_CreateForHourlyCommand.d.ts +0 -5
  78. package/dist/command/BillWatchGCP_CreateForHourlyCommand.js +0 -94
  79. package/dist/command/BillWatchGCP_CreateForHourlyCommand.js.map +0 -1
  80. package/dist/command/CostCommand.d.ts +0 -4
  81. package/dist/command/CostCommand.js +0 -17
  82. package/dist/command/CostCommand.js.map +0 -1
  83. package/dist/command/CostListCommand.d.ts +0 -5
  84. package/dist/command/CostListCommand.js +0 -38
  85. package/dist/command/CostListCommand.js.map +0 -1
  86. package/dist/command/Cost_CreateForCommand.d.ts +0 -5
  87. package/dist/command/Cost_CreateForCommand.js +0 -175
  88. package/dist/command/Cost_CreateForCommand.js.map +0 -1
  89. package/dist/command/FieldCategoryCommand.d.ts +0 -4
  90. package/dist/command/FieldCategoryCommand.js +0 -17
  91. package/dist/command/FieldCategoryCommand.js.map +0 -1
  92. package/dist/command/FieldCategoryEstimateHourlyCommand.d.ts +0 -5
  93. package/dist/command/FieldCategoryEstimateHourlyCommand.js +0 -76
  94. package/dist/command/FieldCategoryEstimateHourlyCommand.js.map +0 -1
  95. package/dist/command/FieldCategory_CreateForHourlyCommand.d.ts +0 -5
  96. package/dist/command/FieldCategory_CreateForHourlyCommand.js +0 -94
  97. package/dist/command/FieldCategory_CreateForHourlyCommand.js.map +0 -1
  98. package/dist/command/FieldFieldCommand.d.ts +0 -4
  99. package/dist/command/FieldFieldCommand.js +0 -17
  100. package/dist/command/FieldFieldCommand.js.map +0 -1
  101. package/dist/command/FieldFieldEstimateHourlyCommand.d.ts +0 -5
  102. package/dist/command/FieldFieldEstimateHourlyCommand.js +0 -76
  103. package/dist/command/FieldFieldEstimateHourlyCommand.js.map +0 -1
  104. package/dist/command/FieldField_CreateForHourlyCommand.d.ts +0 -5
  105. package/dist/command/FieldField_CreateForHourlyCommand.js +0 -94
  106. package/dist/command/FieldField_CreateForHourlyCommand.js.map +0 -1
  107. package/dist/command/HealthzCommand.d.ts +0 -4
  108. package/dist/command/HealthzCommand.js +0 -15
  109. package/dist/command/HealthzCommand.js.map +0 -1
  110. package/dist/command/HealthzGetCommand.d.ts +0 -5
  111. package/dist/command/HealthzGetCommand.js +0 -38
  112. package/dist/command/HealthzGetCommand.js.map +0 -1
  113. package/dist/command/MetricsCommand.d.ts +0 -4
  114. package/dist/command/MetricsCommand.js +0 -15
  115. package/dist/command/MetricsCommand.js.map +0 -1
  116. package/dist/command/MetricsGetCommand.d.ts +0 -5
  117. package/dist/command/MetricsGetCommand.js +0 -38
  118. package/dist/command/MetricsGetCommand.js.map +0 -1
  119. package/dist/command/SecretSecretCommand.d.ts +0 -4
  120. package/dist/command/SecretSecretCommand.js +0 -21
  121. package/dist/command/SecretSecretCommand.js.map +0 -1
  122. package/dist/command/SecretSecretEstimateHourlyCommand.d.ts +0 -5
  123. package/dist/command/SecretSecretEstimateHourlyCommand.js +0 -76
  124. package/dist/command/SecretSecretEstimateHourlyCommand.js.map +0 -1
  125. package/dist/command/SecretSecretEstimateReadCommand.d.ts +0 -5
  126. package/dist/command/SecretSecretEstimateReadCommand.js +0 -76
  127. package/dist/command/SecretSecretEstimateReadCommand.js.map +0 -1
  128. package/dist/command/SecretSecret_CreateForHourlyCommand.d.ts +0 -5
  129. package/dist/command/SecretSecret_CreateForHourlyCommand.js +0 -94
  130. package/dist/command/SecretSecret_CreateForHourlyCommand.js.map +0 -1
  131. package/dist/command/SecretSecret_CreateForReadCommand.d.ts +0 -5
  132. package/dist/command/SecretSecret_CreateForReadCommand.js +0 -94
  133. package/dist/command/SecretSecret_CreateForReadCommand.js.map +0 -1
  134. package/dist/command/ValueCommand.d.ts +0 -4
  135. package/dist/command/ValueCommand.js +0 -15
  136. package/dist/command/ValueCommand.js.map +0 -1
  137. package/dist/command/ValueListCommand.d.ts +0 -5
  138. package/dist/command/ValueListCommand.js +0 -38
  139. package/dist/command/ValueListCommand.js.map +0 -1
  140. package/dist/command/cli.d.ts +0 -2
  141. package/dist/command/cli.js +0 -32
  142. package/dist/command/cli.js.map +0 -1
  143. package/dist/estimator/BillWatchAWSEstimator.d.ts +0 -3
  144. package/dist/estimator/BillWatchAWSEstimator.js +0 -8
  145. package/dist/estimator/BillWatchAWSEstimator.js.map +0 -1
  146. package/dist/estimator/BillWatchAWSHourlyEstimator.d.ts +0 -3
  147. package/dist/estimator/BillWatchAWSHourlyEstimator.js +0 -8
  148. package/dist/estimator/BillWatchAWSHourlyEstimator.js.map +0 -1
  149. package/dist/estimator/BillWatchAzureEstimator.d.ts +0 -3
  150. package/dist/estimator/BillWatchAzureEstimator.js +0 -8
  151. package/dist/estimator/BillWatchAzureEstimator.js.map +0 -1
  152. package/dist/estimator/BillWatchAzureHourlyEstimator.d.ts +0 -3
  153. package/dist/estimator/BillWatchAzureHourlyEstimator.js +0 -8
  154. package/dist/estimator/BillWatchAzureHourlyEstimator.js.map +0 -1
  155. package/dist/estimator/BillWatchBaseEstimator.d.ts +0 -14
  156. package/dist/estimator/BillWatchBaseEstimator.js +0 -26
  157. package/dist/estimator/BillWatchBaseEstimator.js.map +0 -1
  158. package/dist/estimator/BillWatchBaseHourlyEstimator.d.ts +0 -14
  159. package/dist/estimator/BillWatchBaseHourlyEstimator.js +0 -26
  160. package/dist/estimator/BillWatchBaseHourlyEstimator.js.map +0 -1
  161. package/dist/estimator/BillWatchGCPEstimator.d.ts +0 -3
  162. package/dist/estimator/BillWatchGCPEstimator.js +0 -8
  163. package/dist/estimator/BillWatchGCPEstimator.js.map +0 -1
  164. package/dist/estimator/BillWatchGCPHourlyEstimator.d.ts +0 -3
  165. package/dist/estimator/BillWatchGCPHourlyEstimator.js +0 -8
  166. package/dist/estimator/BillWatchGCPHourlyEstimator.js.map +0 -1
  167. package/dist/estimator/FieldBaseEstimator.d.ts +0 -9
  168. package/dist/estimator/FieldBaseEstimator.js +0 -22
  169. package/dist/estimator/FieldBaseEstimator.js.map +0 -1
  170. package/dist/estimator/FieldBaseHourlyEstimator.d.ts +0 -9
  171. package/dist/estimator/FieldBaseHourlyEstimator.js +0 -22
  172. package/dist/estimator/FieldBaseHourlyEstimator.js.map +0 -1
  173. package/dist/estimator/FieldCategoryEstimator.d.ts +0 -8
  174. package/dist/estimator/FieldCategoryEstimator.js +0 -12
  175. package/dist/estimator/FieldCategoryEstimator.js.map +0 -1
  176. package/dist/estimator/FieldCategoryHourlyEstimator.d.ts +0 -8
  177. package/dist/estimator/FieldCategoryHourlyEstimator.js +0 -12
  178. package/dist/estimator/FieldCategoryHourlyEstimator.js.map +0 -1
  179. package/dist/estimator/FieldFieldEstimator.d.ts +0 -8
  180. package/dist/estimator/FieldFieldEstimator.js +0 -12
  181. package/dist/estimator/FieldFieldEstimator.js.map +0 -1
  182. package/dist/estimator/FieldFieldHourlyEstimator.d.ts +0 -8
  183. package/dist/estimator/FieldFieldHourlyEstimator.js +0 -12
  184. package/dist/estimator/FieldFieldHourlyEstimator.js.map +0 -1
  185. package/dist/estimator/SecretSecretEstimator.d.ts +0 -14
  186. package/dist/estimator/SecretSecretEstimator.js +0 -25
  187. package/dist/estimator/SecretSecretEstimator.js.map +0 -1
  188. package/dist/estimator/SecretSecretHourlyEstimator.d.ts +0 -14
  189. package/dist/estimator/SecretSecretHourlyEstimator.js +0 -25
  190. package/dist/estimator/SecretSecretHourlyEstimator.js.map +0 -1
  191. package/src/command/BillWatchAWSCommand.ts +0 -34
  192. package/src/command/BillWatchAWSEstimateHourlyCommand.ts +0 -83
  193. package/src/command/BillWatchAWS_CreateForHourlyCommand.ts +0 -101
  194. package/src/command/BillWatchAzureCommand.ts +0 -34
  195. package/src/command/BillWatchAzureEstimateHourlyCommand.ts +0 -83
  196. package/src/command/BillWatchAzure_CreateForHourlyCommand.ts +0 -101
  197. package/src/command/BillWatchGCPCommand.ts +0 -34
  198. package/src/command/BillWatchGCPEstimateHourlyCommand.ts +0 -83
  199. package/src/command/BillWatchGCP_CreateForHourlyCommand.ts +0 -101
  200. package/src/command/CostCommand.ts +0 -34
  201. package/src/command/CostListCommand.ts +0 -45
  202. package/src/command/Cost_CreateForCommand.ts +0 -182
  203. package/src/command/FieldCategoryCommand.ts +0 -34
  204. package/src/command/FieldCategoryEstimateHourlyCommand.ts +0 -83
  205. package/src/command/FieldCategory_CreateForHourlyCommand.ts +0 -101
  206. package/src/command/FieldFieldCommand.ts +0 -34
  207. package/src/command/FieldFieldEstimateHourlyCommand.ts +0 -83
  208. package/src/command/FieldField_CreateForHourlyCommand.ts +0 -101
  209. package/src/command/HealthzCommand.ts +0 -32
  210. package/src/command/HealthzGetCommand.ts +0 -45
  211. package/src/command/MetricsCommand.ts +0 -32
  212. package/src/command/MetricsGetCommand.ts +0 -45
  213. package/src/command/SecretSecretCommand.ts +0 -38
  214. package/src/command/SecretSecretEstimateHourlyCommand.ts +0 -83
  215. package/src/command/SecretSecretEstimateReadCommand.ts +0 -83
  216. package/src/command/SecretSecret_CreateForHourlyCommand.ts +0 -101
  217. package/src/command/SecretSecret_CreateForReadCommand.ts +0 -101
  218. package/src/command/ValueCommand.ts +0 -32
  219. package/src/command/ValueListCommand.ts +0 -45
  220. package/src/command/cli.ts +0 -51
@@ -9,21 +9,44 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.PeriodUtil = void 0;
12
+ exports.PeriodUtil = exports.PeriodSchema = void 0;
13
13
  const namirasoft_core_1 = require("namirasoft-core");
14
+ const namirasoft_schema_1 = require("namirasoft-schema");
15
+ class PeriodSchema extends namirasoft_schema_1.ObjectSchema {
16
+ constructor(required) {
17
+ super("Period", required, [
18
+ new namirasoft_schema_1.BaseVariableSchema("year", new namirasoft_schema_1.IntegerSchema(true, 0, 9999)),
19
+ new namirasoft_schema_1.BaseVariableSchema("month", new namirasoft_schema_1.IntegerSchema(true, 1, 12)),
20
+ new namirasoft_schema_1.BaseVariableSchema("day", new namirasoft_schema_1.IntegerSchema(true, 1, 31)),
21
+ new namirasoft_schema_1.BaseVariableSchema("hour", new namirasoft_schema_1.IntegerSchema(true, 0, 23)),
22
+ new namirasoft_schema_1.BaseVariableSchema("start", new namirasoft_schema_1.ObjectSchema("", true, [
23
+ new namirasoft_schema_1.BaseVariableSchema("minute", new namirasoft_schema_1.IntegerSchema(true, 0, 59)),
24
+ new namirasoft_schema_1.BaseVariableSchema("second", new namirasoft_schema_1.IntegerSchema(true, 0, 59))
25
+ ])),
26
+ new namirasoft_schema_1.BaseVariableSchema("end", new namirasoft_schema_1.ObjectSchema("", true, [
27
+ new namirasoft_schema_1.BaseVariableSchema("minute", new namirasoft_schema_1.IntegerSchema(true, 0, 59)),
28
+ new namirasoft_schema_1.BaseVariableSchema("second", new namirasoft_schema_1.IntegerSchema(true, 0, 59))
29
+ ])),
30
+ ]);
31
+ this.external = {
32
+ package: "./type/Period"
33
+ };
34
+ }
35
+ }
36
+ exports.PeriodSchema = PeriodSchema;
14
37
  class PeriodUtil {
15
38
  static toSeconds(period) {
16
39
  return (period.end.minute * 60 + period.end.second) - (period.start.minute * 60 + period.start.second) + 1;
17
40
  }
18
41
  static toDates(period) {
19
- let start = new Date(period.year, period.month, period.day, period.hour, period.start.minute, period.start.second);
20
- let end = new Date(period.year, period.month, period.day, period.hour, period.end.minute, period.end.second);
42
+ let start = new Date(period.year, period.month - 1, period.day, period.hour, period.start.minute, period.start.second);
43
+ let end = new Date(period.year, period.month - 1, period.day, period.hour, period.end.minute, period.end.second);
21
44
  return { start, end };
22
45
  }
23
46
  static byDates(start, end) {
24
47
  return {
25
48
  year: start.getFullYear(),
26
- month: start.getMonth(),
49
+ month: start.getMonth() + 1,
27
50
  day: start.getDate(),
28
51
  hour: start.getHours(),
29
52
  start: {
@@ -1 +1 @@
1
- {"version":3,"file":"Period.js","sourceRoot":"","sources":["../../src/type/Period.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgD;AAkBhD,MAAa,UAAU;IAEnB,MAAM,CAAC,SAAS,CAAC,MAAc;QAE3B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IAC9G,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,MAAc;QAEzB,IAAI,KAAK,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACnH,IAAI,GAAG,GAAG,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;QAC7G,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;IAC1B,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,KAAW,EAAE,GAAS;QAEjC,OAAO;YACH,IAAI,EAAE,KAAK,CAAC,WAAW,EAAE;YACzB,KAAK,EAAE,KAAK,CAAC,Q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;CACJ;AA3DD,gCA2DC;AAAA,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ObjectSchema } from "namirasoft-schema";
2
+ import { Period } from "./Period";
3
+ export interface SimulationOption {
4
+ period: Period;
5
+ total_count: number;
6
+ number: number;
7
+ total_value: number;
8
+ value: number;
9
+ active: boolean;
10
+ }
11
+ export declare class SimulationOptionSchema extends ObjectSchema {
12
+ constructor(required: boolean);
13
+ }
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SimulationOptionSchema = void 0;
4
+ const namirasoft_schema_1 = require("namirasoft-schema");
5
+ const Period_1 = require("./Period");
6
+ ;
7
+ class SimulationOptionSchema extends namirasoft_schema_1.ObjectSchema {
8
+ constructor(required) {
9
+ super("SimulationOption", required, [
10
+ new namirasoft_schema_1.BaseVariableSchema("period", new Period_1.PeriodSchema(true)),
11
+ new namirasoft_schema_1.BaseVariableSchema("total_count", new namirasoft_schema_1.IntegerSchema(true, 0)),
12
+ new namirasoft_schema_1.BaseVariableSchema("number", new namirasoft_schema_1.IntegerSchema(true, 1)),
13
+ new namirasoft_schema_1.BaseVariableSchema("total_value", new namirasoft_schema_1.IntegerSchema(true, 0)),
14
+ new namirasoft_schema_1.BaseVariableSchema("value", new namirasoft_schema_1.IntegerSchema(true, 1)),
15
+ new namirasoft_schema_1.BaseVariableSchema("active", new namirasoft_schema_1.BoolSchema(true)),
16
+ ]);
17
+ this.external = {
18
+ package: "./type/SimulationOption"
19
+ };
20
+ }
21
+ }
22
+ exports.SimulationOptionSchema = SimulationOptionSchema;
23
+ //# sourceMappingURL=SimulationOption.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimulationOption.js","sourceRoot":"","sources":["../../src/type/SimulationOption.ts"],"names":[],"mappings":";;;AAAA,yDAAgG;AAChG,qCAAgD;AAU/C,CAAC;AAEF,MAAa,sBAAuB,SAAQ,gCAAY;IAEpD,YAAY,QAAiB;QAEzB,KAAK,CAAC,kBAAkB,EAAE,QAAQ,EAAE;YAChC,IAAI,sCAAkB,CAAC,QAAQ,EAAE,IAAI,qBAAY,CAAC,IAAI,CAAC,CAAC;YACxD,IAAI,sCAAkB,CAAC,aAAa,EAAE,IAAI,iCAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACjE,IAAI,sCAAkB,CAAC,QAAQ,EAAE,IAAI,iCAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC5D,IAAI,sCAAkB,CAAC,aAAa,EAAE,IAAI,iCAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YACjE,IAAI,sCAAkB,CAAC,OAAO,EAAE,IAAI,iCAAa,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAC3D,IAAI,sCAAkB,CAAC,QAAQ,EAAE,IAAI,8BAAU,CAAC,IAAI,CAAC,CAAC;SACzD,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,GAAG;YACZ,OAAO,EAAE,yBAAyB;SACrC,CAAC;IACN,CAAC;CACJ;AAhBD,wDAgBC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.25",
11
+ "version": "1.4.27",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -17,10 +17,11 @@
17
17
  "build": ""
18
18
  },
19
19
  "dependencies": {
20
+ "namirasoft-account": "^1.4.85",
20
21
  "namirasoft-core": "^1.4.80",
21
- "namirasoft-site": "^1.4.39",
22
22
  "namirasoft-node-cli": "^1.4.7",
23
- "namirasoft-account": "^1.4.85"
23
+ "namirasoft-schema": "^1.4.25",
24
+ "namirasoft-site": "^1.4.39"
24
25
  },
25
26
  "bin": {
26
27
  "ns-cost": "./dist/command/cli.js"
@@ -29,16 +29,16 @@ export class NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase
29
29
  constructor(server: NamirasoftCostServer)
30
30
  {
31
31
  super(server);
32
- this.EstimateHourly = this.EstimateHourly.bind(this);
33
- this._CreateForHourly = this._CreateForHourly.bind(this);
32
+ this.EstimateRecord = this.EstimateRecord.bind(this);
33
+ this._CreateForRecord = this._CreateForRecord.bind(this);
34
34
  }
35
- async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
35
+ async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
36
36
  {
37
37
  let path = `/estimation/bill-watch/aws/hourly`;
38
38
  let { data } = await this.server._post<Estimation>(path, {}, body);
39
39
  return data;
40
40
  }
41
- async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
41
+ async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
42
42
  {
43
43
  let path = `/application/user/${user_id}/cost/bill-watch/aws/hourly`;
44
44
  let { data } = await this.server._post<CostRow>(path, {}, body);
@@ -29,16 +29,16 @@ export class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase
29
29
  constructor(server: NamirasoftCostServer)
30
30
  {
31
31
  super(server);
32
- this.EstimateHourly = this.EstimateHourly.bind(this);
33
- this._CreateForHourly = this._CreateForHourly.bind(this);
32
+ this.EstimateRecord = this.EstimateRecord.bind(this);
33
+ this._CreateForRecord = this._CreateForRecord.bind(this);
34
34
  }
35
- async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
35
+ async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
36
36
  {
37
37
  let path = `/estimation/bill-watch/azure/hourly`;
38
38
  let { data } = await this.server._post<Estimation>(path, {}, body);
39
39
  return data;
40
40
  }
41
- async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
41
+ async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
42
42
  {
43
43
  let path = `/application/user/${user_id}/cost/bill-watch/azure/hourly`;
44
44
  let { data } = await this.server._post<CostRow>(path, {}, body);
@@ -29,16 +29,16 @@ export class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase
29
29
  constructor(server: NamirasoftCostServer)
30
30
  {
31
31
  super(server);
32
- this.EstimateHourly = this.EstimateHourly.bind(this);
33
- this._CreateForHourly = this._CreateForHourly.bind(this);
32
+ this.EstimateRecord = this.EstimateRecord.bind(this);
33
+ this._CreateForRecord = this._CreateForRecord.bind(this);
34
34
  }
35
- async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
35
+ async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
36
36
  {
37
37
  let path = `/estimation/bill-watch/gcp/hourly`;
38
38
  let { data } = await this.server._post<Estimation>(path, {}, body);
39
39
  return data;
40
40
  }
41
- async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
41
+ async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
42
42
  {
43
43
  let path = `/application/user/${user_id}/cost/bill-watch/gcp/hourly`;
44
44
  let { data } = await this.server._post<CostRow>(path, {}, body);
@@ -29,16 +29,16 @@ export class NamirasoftCostServerFieldCategory extends NamirasoftCostServerBase
29
29
  constructor(server: NamirasoftCostServer)
30
30
  {
31
31
  super(server);
32
- this.EstimateHourly = this.EstimateHourly.bind(this);
33
- this._CreateForHourly = this._CreateForHourly.bind(this);
32
+ this.EstimateRecord = this.EstimateRecord.bind(this);
33
+ this._CreateForRecord = this._CreateForRecord.bind(this);
34
34
  }
35
- async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
35
+ async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
36
36
  {
37
37
  let path = `/estimation/field/category/hourly`;
38
38
  let { data } = await this.server._post<Estimation>(path, {}, body);
39
39
  return data;
40
40
  }
41
- async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
41
+ async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
42
42
  {
43
43
  let path = `/application/user/${user_id}/cost/field/category/hourly`;
44
44
  let { data } = await this.server._post<CostRow>(path, {}, body);
@@ -29,16 +29,16 @@ export class NamirasoftCostServerFieldField extends NamirasoftCostServerBase
29
29
  constructor(server: NamirasoftCostServer)
30
30
  {
31
31
  super(server);
32
- this.EstimateHourly = this.EstimateHourly.bind(this);
33
- this._CreateForHourly = this._CreateForHourly.bind(this);
32
+ this.EstimateRecord = this.EstimateRecord.bind(this);
33
+ this._CreateForRecord = this._CreateForRecord.bind(this);
34
34
  }
35
- async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
35
+ async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
36
36
  {
37
37
  let path = `/estimation/field/field/hourly`;
38
38
  let { data } = await this.server._post<Estimation>(path, {}, body);
39
39
  return data;
40
40
  }
41
- async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
41
+ async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
42
42
  {
43
43
  let path = `/application/user/${user_id}/cost/field/field/hourly`;
44
44
  let { data } = await this.server._post<CostRow>(path, {}, body);
@@ -29,18 +29,18 @@ export class NamirasoftCostServerSecretSecret extends NamirasoftCostServerBase
29
29
  constructor(server: NamirasoftCostServer)
30
30
  {
31
31
  super(server);
32
- this.EstimateHourly = this.EstimateHourly.bind(this);
33
- this._CreateForHourly = this._CreateForHourly.bind(this);
32
+ this.EstimateRecord = this.EstimateRecord.bind(this);
33
+ this._CreateForRecord = this._CreateForRecord.bind(this);
34
34
  this.EstimateRead = this.EstimateRead.bind(this);
35
35
  this._CreateForRead = this._CreateForRead.bind(this);
36
36
  }
37
- async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
37
+ async EstimateRecord(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
38
38
  {
39
39
  let path = `/estimation/secret/secret/hourly`;
40
40
  let { data } = await this.server._post<Estimation>(path, {}, body);
41
41
  return data;
42
42
  }
43
- async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
43
+ async _CreateForRecord(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
44
44
  {
45
45
  let path = `/application/user/${user_id}/cost/secret/secret/hourly`;
46
46
  let { data } = await this.server._post<CostRow>(path, {}, body);
package/src/index.ts CHANGED
@@ -41,41 +41,15 @@ export * from "./NamirasoftCostServerHealthz";
41
41
  export * from "./NamirasoftCostServerMetrics";
42
42
  export * from "./NamirasoftCostServerSecretSecret";
43
43
  export * from "./NamirasoftCostServerValue";
44
- export * from "./command/BillWatchAWSCommand";
45
- export * from "./command/BillWatchAWSEstimateHourlyCommand";
46
- export * from "./command/BillWatchAWS_CreateForHourlyCommand";
47
- export * from "./command/BillWatchAzureCommand";
48
- export * from "./command/BillWatchAzureEstimateHourlyCommand";
49
- export * from "./command/BillWatchAzure_CreateForHourlyCommand";
50
- export * from "./command/BillWatchGCPCommand";
51
- export * from "./command/BillWatchGCPEstimateHourlyCommand";
52
- export * from "./command/BillWatchGCP_CreateForHourlyCommand";
53
- export * from "./command/CostCommand";
54
- export * from "./command/CostListCommand";
55
- export * from "./command/Cost_CreateForCommand";
56
- export * from "./command/FieldCategoryCommand";
57
- export * from "./command/FieldCategoryEstimateHourlyCommand";
58
- export * from "./command/FieldCategory_CreateForHourlyCommand";
59
- export * from "./command/FieldFieldCommand";
60
- export * from "./command/FieldFieldEstimateHourlyCommand";
61
- export * from "./command/FieldField_CreateForHourlyCommand";
62
- export * from "./command/HealthzCommand";
63
- export * from "./command/HealthzGetCommand";
64
- export * from "./command/MetricsCommand";
65
- export * from "./command/MetricsGetCommand";
66
- export * from "./command/SecretSecretCommand";
67
- export * from "./command/SecretSecretEstimateHourlyCommand";
68
- export * from "./command/SecretSecretEstimateReadCommand";
69
- export * from "./command/SecretSecret_CreateForHourlyCommand";
70
- export * from "./command/SecretSecret_CreateForReadCommand";
71
- export * from "./command/ValueCommand";
72
- export * from "./command/ValueListCommand";
73
44
  export * from "./meta/CostMetaTable";
74
45
  export * from "./meta/NamirasoftCostMetaDatabase";
75
46
  export * from "./row/CostCreateRow";
76
47
  export * from "./row/CostRow";
48
+ export * from "./type/Bonus";
49
+ export * from "./type/CalculationOption";
77
50
  export * from "./type/Estimation";
78
51
  export * from "./type/EstimationOption";
79
52
  export * from "./type/EstimationUsage";
80
53
  export * from "./type/Period";
54
+ export * from "./type/SimulationOption";
81
55
  export * from "./type/Usage";
@@ -0,0 +1,21 @@
1
+ import { BaseVariableSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
+
3
+ export type Bonus =
4
+ {
5
+ name: string;
6
+ value: number;
7
+ unit: string;
8
+ };
9
+
10
+ export class BonusSchema extends ObjectSchema
11
+ {
12
+ constructor(required: boolean)
13
+ {
14
+ super("Bonus", required, [
15
+ new BaseVariableSchema("name", new StringSchema(true)),
16
+ ]);
17
+ this.external = {
18
+ package: "./type/Bonus"
19
+ };
20
+ }
21
+ }
@@ -0,0 +1,34 @@
1
+ import { BaseVariableSchema, BoolSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
+ import { Period, PeriodSchema } from "./Period";
3
+
4
+ export interface CalculationOption
5
+ {
6
+ period: Period;
7
+ total_count: number;
8
+ number: number;
9
+ total_value: number;
10
+ value: number;
11
+ active: boolean;
12
+ workspace_id: string;
13
+ resource_id: string;
14
+ };
15
+
16
+ export class CalculationOptionSchema extends ObjectSchema
17
+ {
18
+ constructor(required: boolean)
19
+ {
20
+ super("CalculationOption", required, [
21
+ new BaseVariableSchema("period", new PeriodSchema(true)),
22
+ new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
23
+ new BaseVariableSchema("number", new IntegerSchema(true, 1)),
24
+ new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
25
+ new BaseVariableSchema("value", new IntegerSchema(true, 1)),
26
+ new BaseVariableSchema("active", new BoolSchema(true)),
27
+ new BaseVariableSchema("workspace_id", new StringSchema(false, 20, 20)),
28
+ new BaseVariableSchema("resource_id", new StringSchema(false, 20, 20)),
29
+ ]);
30
+ this.external = {
31
+ package: "./type/CalculationOption"
32
+ };
33
+ }
34
+ }
@@ -1,6 +1,8 @@
1
+ import { BaseVariableSchema, IntegerSchema, MoneySchema, ObjectSchema, StringSchema } from "namirasoft-schema";
1
2
  import { BaseBonus } from "../bonus/BaseBonus";
2
- import { EstimationOption } from "./EstimationOption";
3
- import { EstimationUsage } from "./EstimationUsage";
3
+ import { EstimationOption, EstimationOptionSchema } from "./EstimationOption";
4
+ import { EstimationUsage, EstimationUsageSchema } from "./EstimationUsage";
5
+ import { BonusSchema } from "./Bonus";
4
6
 
5
7
  export type Estimation =
6
8
  {
@@ -11,4 +13,23 @@ export type Estimation =
11
13
  amount: number;
12
14
  currency: string;
13
15
  free?: BaseBonus;
14
- };
16
+ };
17
+
18
+ export class EstimationSchema extends ObjectSchema
19
+ {
20
+ constructor(required: boolean)
21
+ {
22
+ super("Estimation", required, [
23
+ new BaseVariableSchema("option", new EstimationOptionSchema(true)),
24
+ new BaseVariableSchema("seconds", new IntegerSchema(true, 1, 3600)),
25
+ new BaseVariableSchema("usage", new EstimationUsageSchema(true)),
26
+ new BaseVariableSchema("fee", new MoneySchema(true)),
27
+ new BaseVariableSchema("amount", new MoneySchema(true, 1)),
28
+ new BaseVariableSchema("currency", new StringSchema(true)),
29
+ new BaseVariableSchema("free", new BonusSchema(false)),
30
+ ]);
31
+ this.external = {
32
+ package: "./type/Estimation"
33
+ };
34
+ }
35
+ }
@@ -1,4 +1,5 @@
1
- import { Period } from "./Period";
1
+ import { BaseVariableSchema, BoolSchema, DateTimeSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
+ import { Period, PeriodSchema } from "./Period";
2
3
 
3
4
  export interface EstimationOption
4
5
  {
@@ -9,4 +10,23 @@ export interface EstimationOption
9
10
  value: number;
10
11
  active: boolean;
11
12
  trial_started_at: Date | null;
12
- };
13
+ };
14
+
15
+ export class EstimationOptionSchema extends ObjectSchema
16
+ {
17
+ constructor(required: boolean)
18
+ {
19
+ super("EstimationOption", required, [
20
+ new BaseVariableSchema("period", new PeriodSchema(true)),
21
+ new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
22
+ new BaseVariableSchema("number", new IntegerSchema(true, 1)),
23
+ new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
24
+ new BaseVariableSchema("value", new IntegerSchema(true, 1)),
25
+ new BaseVariableSchema("active", new BoolSchema(true)),
26
+ new BaseVariableSchema("trial_started_at", new DateTimeSchema(false)),
27
+ ]);
28
+ this.external = {
29
+ package: "./type/EstimationOption"
30
+ };
31
+ }
32
+ }
@@ -1,6 +1,23 @@
1
+ import { BaseVariableSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
+
1
3
  export type EstimationUsage =
2
4
  {
3
5
  name: string;
4
6
  value: number;
5
7
  unit: string;
6
- };
8
+ };
9
+
10
+ export class EstimationUsageSchema extends ObjectSchema
11
+ {
12
+ constructor(required: boolean)
13
+ {
14
+ super("EstimationUsage", required, [
15
+ new BaseVariableSchema("name", new StringSchema(true)),
16
+ new BaseVariableSchema("value", new IntegerSchema(true)),
17
+ new BaseVariableSchema("unit", new StringSchema(true)),
18
+ ]);
19
+ this.external = {
20
+ package: "./type/EstimationUsage"
21
+ };
22
+ }
23
+ }
@@ -1,4 +1,5 @@
1
1
  import { TimeOperation } from "namirasoft-core";
2
+ import { BaseVariableSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
3
 
3
4
  export type Period =
4
5
  {
@@ -16,6 +17,29 @@ export type Period =
16
17
  };
17
18
  };
18
19
 
20
+ export class PeriodSchema extends ObjectSchema
21
+ {
22
+ constructor(required: boolean)
23
+ {
24
+ super("Period", required, [
25
+ new BaseVariableSchema("year", new IntegerSchema(true, 0, 9999)),
26
+ new BaseVariableSchema("month", new IntegerSchema(true, 1, 12)),
27
+ new BaseVariableSchema("day", new IntegerSchema(true, 1, 31)),
28
+ new BaseVariableSchema("hour", new IntegerSchema(true, 0, 23)),
29
+ new BaseVariableSchema("start", new ObjectSchema("", true, [
30
+ new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
31
+ new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
32
+ ])),
33
+ new BaseVariableSchema("end", new ObjectSchema("", true, [
34
+ new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
35
+ new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
36
+ ])),
37
+ ]);
38
+ this.external = {
39
+ package: "./type/Period"
40
+ };
41
+ }
42
+ }
19
43
  export class PeriodUtil
20
44
  {
21
45
  static toSeconds(period: Period)
@@ -24,15 +48,15 @@ export class PeriodUtil
24
48
  }
25
49
  static toDates(period: Period)
26
50
  {
27
- let start = new Date(period.year, period.month, period.day, period.hour, period.start.minute, period.start.second);
28
- let end = new Date(period.year, period.month, period.day, period.hour, period.end.minute, period.end.second);
51
+ let start = new Date(period.year, period.month - 1, period.day, period.hour, period.start.minute, period.start.second);
52
+ let end = new Date(period.year, period.month - 1, period.day, period.hour, period.end.minute, period.end.second);
29
53
  return { start, end };
30
54
  }
31
55
  static byDates(start: Date, end: Date)
32
56
  {
33
57
  return {
34
58
  year: start.getFullYear(),
35
- month: start.getMonth(),
59
+ month: start.getMonth() + 1,
36
60
  day: start.getDate(),
37
61
  hour: start.getHours(),
38
62
  start: {
@@ -0,0 +1,30 @@
1
+ import { BaseVariableSchema, BoolSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
+ import { Period, PeriodSchema } from "./Period";
3
+
4
+ export interface SimulationOption
5
+ {
6
+ period: Period;
7
+ total_count: number;
8
+ number: number;
9
+ total_value: number;
10
+ value: number;
11
+ active: boolean;
12
+ };
13
+
14
+ export class SimulationOptionSchema extends ObjectSchema
15
+ {
16
+ constructor(required: boolean)
17
+ {
18
+ super("SimulationOption", required, [
19
+ new BaseVariableSchema("period", new PeriodSchema(true)),
20
+ new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
21
+ new BaseVariableSchema("number", new IntegerSchema(true, 1)),
22
+ new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
23
+ new BaseVariableSchema("value", new IntegerSchema(true, 1)),
24
+ new BaseVariableSchema("active", new BoolSchema(true)),
25
+ ]);
26
+ this.external = {
27
+ package: "./type/SimulationOption"
28
+ };
29
+ }
30
+ }
@@ -1,4 +0,0 @@
1
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
2
- export declare class BillWatchAWSCommand extends BaseNavigatorCommand {
3
- constructor(argv: string[]);
4
- }
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BillWatchAWSCommand = void 0;
4
- const namirasoft_node_cli_1 = require("namirasoft-node-cli");
5
- const BillWatchAWSEstimateHourlyCommand_1 = require("./BillWatchAWSEstimateHourlyCommand");
6
- const BillWatchAWS_CreateForHourlyCommand_1 = require("./BillWatchAWS_CreateForHourlyCommand");
7
- class BillWatchAWSCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
8
- constructor(argv) {
9
- super(argv, {
10
- "estimatehourly": BillWatchAWSEstimateHourlyCommand_1.BillWatchAWSEstimateHourlyCommand,
11
- "_createforhourly": BillWatchAWS_CreateForHourlyCommand_1.BillWatchAWS_CreateForHourlyCommand,
12
- });
13
- }
14
- }
15
- exports.BillWatchAWSCommand = BillWatchAWSCommand;
16
- ;
17
- //# sourceMappingURL=BillWatchAWSCommand.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BillWatchAWSCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSCommand.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"}
@@ -1,5 +0,0 @@
1
- import { BaseFinalCommand } from "namirasoft-node-cli";
2
- export declare class BillWatchAWSEstimateHourlyCommand extends BaseFinalCommand {
3
- constructor(argv: string[]);
4
- exec(): Promise<void>;
5
- }