namirasoft-cost 1.4.20 → 1.4.21

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 (155) hide show
  1. package/.ns-sdkg-dir-deep +2 -2
  2. package/.ns-sdkg-file-keep +7 -7
  3. package/dist/NamirasoftCostServer.d.ts +2 -0
  4. package/dist/NamirasoftCostServer.js +3 -1
  5. package/dist/NamirasoftCostServer.js.map +1 -1
  6. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +4 -4
  7. package/dist/NamirasoftCostServerBillWatchAWS.js +6 -6
  8. package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
  9. package/dist/NamirasoftCostServerBillWatchAzure.d.ts +4 -4
  10. package/dist/NamirasoftCostServerBillWatchAzure.js +6 -6
  11. package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -1
  12. package/dist/NamirasoftCostServerBillWatchGCP.d.ts +4 -4
  13. package/dist/NamirasoftCostServerBillWatchGCP.js +6 -6
  14. package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -1
  15. package/dist/NamirasoftCostServerFieldCategory.d.ts +4 -4
  16. package/dist/NamirasoftCostServerFieldCategory.js +6 -6
  17. package/dist/NamirasoftCostServerFieldCategory.js.map +1 -1
  18. package/dist/NamirasoftCostServerFieldField.d.ts +4 -4
  19. package/dist/NamirasoftCostServerFieldField.js +6 -6
  20. package/dist/NamirasoftCostServerFieldField.js.map +1 -1
  21. package/dist/NamirasoftCostServerSecretSecret.d.ts +36 -0
  22. package/dist/NamirasoftCostServerSecretSecret.js +53 -0
  23. package/dist/NamirasoftCostServerSecretSecret.js.map +1 -0
  24. package/dist/command/BillWatchAWSCommand.js +4 -4
  25. package/dist/command/BillWatchAWSCommand.js.map +1 -1
  26. package/dist/command/{BillWatchAWSEstimationCommand.d.ts → BillWatchAWSEstimateHourlyCommand.d.ts} +1 -1
  27. package/dist/command/{BillWatchAWSEstimationCommand.js → BillWatchAWSEstimateHourlyCommand.js} +15 -15
  28. package/dist/command/BillWatchAWSEstimateHourlyCommand.js.map +1 -0
  29. package/dist/command/BillWatchAWS_CreateForHourlyCommand.d.ts +5 -0
  30. package/dist/command/{FieldCategory_CreateForCommand.js → BillWatchAWS_CreateForHourlyCommand.js} +14 -14
  31. package/dist/command/BillWatchAWS_CreateForHourlyCommand.js.map +1 -0
  32. package/dist/command/BillWatchAzureCommand.js +4 -4
  33. package/dist/command/BillWatchAzureCommand.js.map +1 -1
  34. package/dist/command/BillWatchAzureEstimateHourlyCommand.d.ts +5 -0
  35. package/dist/command/BillWatchAzureEstimateHourlyCommand.js +76 -0
  36. package/dist/command/BillWatchAzureEstimateHourlyCommand.js.map +1 -0
  37. package/dist/command/BillWatchAzure_CreateForHourlyCommand.d.ts +5 -0
  38. package/dist/command/BillWatchAzure_CreateForHourlyCommand.js +94 -0
  39. package/dist/command/BillWatchAzure_CreateForHourlyCommand.js.map +1 -0
  40. package/dist/command/BillWatchGCPCommand.js +4 -4
  41. package/dist/command/BillWatchGCPCommand.js.map +1 -1
  42. package/dist/command/{BillWatchAWS_CreateForCommand.d.ts → BillWatchGCPEstimateHourlyCommand.d.ts} +1 -1
  43. package/dist/command/{BillWatchGCPEstimationCommand.js → BillWatchGCPEstimateHourlyCommand.js} +15 -15
  44. package/dist/command/BillWatchGCPEstimateHourlyCommand.js.map +1 -0
  45. package/dist/command/BillWatchGCP_CreateForHourlyCommand.d.ts +5 -0
  46. package/dist/command/{BillWatchAzure_CreateForCommand.js → BillWatchGCP_CreateForHourlyCommand.js} +14 -14
  47. package/dist/command/BillWatchGCP_CreateForHourlyCommand.js.map +1 -0
  48. package/dist/command/FieldCategoryCommand.js +4 -4
  49. package/dist/command/FieldCategoryCommand.js.map +1 -1
  50. package/dist/command/FieldCategoryEstimateHourlyCommand.d.ts +5 -0
  51. package/dist/command/FieldCategoryEstimateHourlyCommand.js +76 -0
  52. package/dist/command/FieldCategoryEstimateHourlyCommand.js.map +1 -0
  53. package/dist/command/FieldCategory_CreateForHourlyCommand.d.ts +5 -0
  54. package/dist/command/FieldCategory_CreateForHourlyCommand.js +94 -0
  55. package/dist/command/FieldCategory_CreateForHourlyCommand.js.map +1 -0
  56. package/dist/command/FieldFieldCommand.js +4 -4
  57. package/dist/command/FieldFieldCommand.js.map +1 -1
  58. package/dist/command/{BillWatchAzureEstimationCommand.d.ts → FieldFieldEstimateHourlyCommand.d.ts} +1 -1
  59. package/dist/command/{BillWatchAzureEstimationCommand.js → FieldFieldEstimateHourlyCommand.js} +15 -15
  60. package/dist/command/{BillWatchAzureEstimationCommand.js.map → FieldFieldEstimateHourlyCommand.js.map} +1 -1
  61. package/dist/command/FieldField_CreateForHourlyCommand.d.ts +5 -0
  62. package/dist/command/{BillWatchAWS_CreateForCommand.js → FieldField_CreateForHourlyCommand.js} +14 -14
  63. package/dist/command/FieldField_CreateForHourlyCommand.js.map +1 -0
  64. package/dist/command/SecretSecretCommand.d.ts +4 -0
  65. package/dist/command/SecretSecretCommand.js +21 -0
  66. package/dist/command/SecretSecretCommand.js.map +1 -0
  67. package/dist/command/SecretSecretEstimateHourlyCommand.d.ts +5 -0
  68. package/dist/command/{FieldCategoryEstimationCommand.js → SecretSecretEstimateHourlyCommand.js} +15 -15
  69. package/dist/command/SecretSecretEstimateHourlyCommand.js.map +1 -0
  70. package/dist/command/{BillWatchAzure_CreateForCommand.d.ts → SecretSecretEstimateReadCommand.d.ts} +1 -1
  71. package/dist/command/{FieldFieldEstimationCommand.js → SecretSecretEstimateReadCommand.js} +17 -17
  72. package/dist/command/SecretSecretEstimateReadCommand.js.map +1 -0
  73. package/dist/command/SecretSecret_CreateForHourlyCommand.d.ts +5 -0
  74. package/dist/command/{BillWatchGCP_CreateForCommand.js → SecretSecret_CreateForHourlyCommand.js} +14 -14
  75. package/dist/command/SecretSecret_CreateForHourlyCommand.js.map +1 -0
  76. package/dist/command/SecretSecret_CreateForReadCommand.d.ts +5 -0
  77. package/dist/command/{FieldField_CreateForCommand.js → SecretSecret_CreateForReadCommand.js} +16 -16
  78. package/dist/command/SecretSecret_CreateForReadCommand.js.map +1 -0
  79. package/dist/command/cli.js +2 -0
  80. package/dist/command/cli.js.map +1 -1
  81. package/dist/index.d.ts +16 -10
  82. package/dist/index.js +16 -10
  83. package/dist/index.js.map +1 -1
  84. package/package.json +27 -27
  85. package/src/NamirasoftCostServer.ts +59 -56
  86. package/src/NamirasoftCostServerBase.ts +29 -29
  87. package/src/NamirasoftCostServerBillWatchAWS.ts +46 -46
  88. package/src/NamirasoftCostServerBillWatchAzure.ts +46 -46
  89. package/src/NamirasoftCostServerBillWatchGCP.ts +46 -46
  90. package/src/NamirasoftCostServerCost.ts +49 -49
  91. package/src/NamirasoftCostServerFieldCategory.ts +46 -46
  92. package/src/NamirasoftCostServerFieldField.ts +46 -46
  93. package/src/NamirasoftCostServerHealthz.ts +35 -35
  94. package/src/NamirasoftCostServerMetrics.ts +35 -35
  95. package/src/NamirasoftCostServerSecretSecret.ts +61 -0
  96. package/src/NamirasoftCostServerValue.ts +36 -36
  97. package/src/TimeUtil.ts +66 -66
  98. package/src/command/BillWatchAWSCommand.ts +33 -33
  99. package/src/command/{FieldFieldEstimationCommand.ts → BillWatchAWSEstimateHourlyCommand.ts} +82 -82
  100. package/src/command/{FieldField_CreateForCommand.ts → BillWatchAWS_CreateForHourlyCommand.ts} +100 -100
  101. package/src/command/BillWatchAzureCommand.ts +33 -33
  102. package/src/command/{BillWatchAWSEstimationCommand.ts → BillWatchAzureEstimateHourlyCommand.ts} +82 -82
  103. package/src/command/{BillWatchGCP_CreateForCommand.ts → BillWatchAzure_CreateForHourlyCommand.ts} +100 -100
  104. package/src/command/BillWatchGCPCommand.ts +33 -33
  105. package/src/command/{BillWatchGCPEstimationCommand.ts → BillWatchGCPEstimateHourlyCommand.ts} +82 -82
  106. package/src/command/{BillWatchAWS_CreateForCommand.ts → BillWatchGCP_CreateForHourlyCommand.ts} +100 -100
  107. package/src/command/CostCommand.ts +33 -33
  108. package/src/command/CostListCommand.ts +44 -44
  109. package/src/command/Cost_CreateForCommand.ts +181 -181
  110. package/src/command/FieldCategoryCommand.ts +33 -33
  111. package/src/command/{FieldCategoryEstimationCommand.ts → FieldCategoryEstimateHourlyCommand.ts} +82 -82
  112. package/src/command/{FieldCategory_CreateForCommand.ts → FieldCategory_CreateForHourlyCommand.ts} +100 -100
  113. package/src/command/FieldFieldCommand.ts +33 -33
  114. package/src/command/{BillWatchAzureEstimationCommand.ts → FieldFieldEstimateHourlyCommand.ts} +82 -82
  115. package/src/command/FieldField_CreateForHourlyCommand.ts +101 -0
  116. package/src/command/HealthzCommand.ts +31 -31
  117. package/src/command/HealthzGetCommand.ts +44 -44
  118. package/src/command/MetricsCommand.ts +31 -31
  119. package/src/command/MetricsGetCommand.ts +44 -44
  120. package/src/command/SecretSecretCommand.ts +38 -0
  121. package/src/command/SecretSecretEstimateHourlyCommand.ts +83 -0
  122. package/src/command/SecretSecretEstimateReadCommand.ts +83 -0
  123. package/src/command/SecretSecret_CreateForHourlyCommand.ts +101 -0
  124. package/src/command/SecretSecret_CreateForReadCommand.ts +101 -0
  125. package/src/command/ValueCommand.ts +31 -31
  126. package/src/command/ValueListCommand.ts +44 -44
  127. package/src/command/cli.ts +50 -48
  128. package/src/enum/TrialUnit.ts +5 -5
  129. package/src/index.ts +72 -66
  130. package/src/meta/CostMetaTable.ts +81 -81
  131. package/src/meta/NamirasoftCostMetaDatabase.ts +50 -50
  132. package/src/row/CostCreateRow.ts +37 -37
  133. package/src/row/CostRow.ts +40 -40
  134. package/src/type/Estimation.ts +6 -6
  135. package/src/type/EstimationRow.ts +9 -9
  136. package/src/type/EstimationUsage.ts +5 -5
  137. package/src/type/Period.ts +4 -4
  138. package/src/type/Trial.ts +6 -6
  139. package/src/type/TrialDuration.ts +6 -6
  140. package/dist/command/BillWatchAWSEstimationCommand.js.map +0 -1
  141. package/dist/command/BillWatchAWS_CreateForCommand.js.map +0 -1
  142. package/dist/command/BillWatchAzure_CreateForCommand.js.map +0 -1
  143. package/dist/command/BillWatchGCPEstimationCommand.d.ts +0 -5
  144. package/dist/command/BillWatchGCPEstimationCommand.js.map +0 -1
  145. package/dist/command/BillWatchGCP_CreateForCommand.d.ts +0 -5
  146. package/dist/command/BillWatchGCP_CreateForCommand.js.map +0 -1
  147. package/dist/command/FieldCategoryEstimationCommand.d.ts +0 -5
  148. package/dist/command/FieldCategoryEstimationCommand.js.map +0 -1
  149. package/dist/command/FieldCategory_CreateForCommand.d.ts +0 -5
  150. package/dist/command/FieldCategory_CreateForCommand.js.map +0 -1
  151. package/dist/command/FieldFieldEstimationCommand.d.ts +0 -5
  152. package/dist/command/FieldFieldEstimationCommand.js.map +0 -1
  153. package/dist/command/FieldField_CreateForCommand.d.ts +0 -5
  154. package/dist/command/FieldField_CreateForCommand.js.map +0 -1
  155. package/src/command/BillWatchAzure_CreateForCommand.ts +0 -101
@@ -0,0 +1,61 @@
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 { CostRow } from "./row/CostRow";
22
+ import { Estimation } from "./type/Estimation";
23
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
24
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
25
+ import { Period } from "./type/Period";
26
+
27
+ export class NamirasoftCostServerSecretSecret extends NamirasoftCostServerBase
28
+ {
29
+ constructor(server: NamirasoftCostServer)
30
+ {
31
+ super(server);
32
+ this.EstimateHourly = this.EstimateHourly.bind(this);
33
+ this._CreateForHourly = this._CreateForHourly.bind(this);
34
+ this.EstimateRead = this.EstimateRead.bind(this);
35
+ this._CreateForRead = this._CreateForRead.bind(this);
36
+ }
37
+ async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
38
+ {
39
+ let path = `/estimation/secret/secret/hourly`;
40
+ let { data } = await this.server._post<Estimation>(path, {}, body);
41
+ return data;
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>
44
+ {
45
+ let path = `/application/user/${user_id}/cost/secret/secret/hourly`;
46
+ let { data } = await this.server._post<CostRow>(path, {}, body);
47
+ return data;
48
+ }
49
+ async EstimateRead(body: { first_entity_created_at: (Date | null), period: Period, total: number, count: number }): Promise<Estimation>
50
+ {
51
+ let path = `/estimation/secret/secret/read`;
52
+ let { data } = await this.server._post<Estimation>(path, {}, body);
53
+ return data;
54
+ }
55
+ async _CreateForRead(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, total: number, count: number, workspace_id: string, resource_id: string }): Promise<CostRow>
56
+ {
57
+ let path = `/application/user/${user_id}/cost/secret/secret/read`;
58
+ let { data } = await this.server._post<CostRow>(path, {}, body);
59
+ return data;
60
+ }
61
+ };
@@ -1,37 +1,37 @@
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
- import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
23
-
24
- export class NamirasoftCostServerValue extends NamirasoftCostServerBase
25
- {
26
- constructor(server: NamirasoftCostServer)
27
- {
28
- super(server);
29
- this.List = this.List.bind(this);
30
- }
31
- async List(table: string, column: string, search: (string | null), field_id: (string | null), limit: (number | null)): Promise<string[]>
32
- {
33
- let path = `/value/list/${table}/${column}`;
34
- let { data } = await this.server._get<string[]>(path, { search, field_id, limit });
35
- return data;
36
- }
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
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
23
+
24
+ export class NamirasoftCostServerValue extends NamirasoftCostServerBase
25
+ {
26
+ constructor(server: NamirasoftCostServer)
27
+ {
28
+ super(server);
29
+ this.List = this.List.bind(this);
30
+ }
31
+ async List(table: string, column: string, search: (string | null), field_id: (string | null), limit: (number | null)): Promise<string[]>
32
+ {
33
+ let path = `/value/list/${table}/${column}`;
34
+ let { data } = await this.server._get<string[]>(path, { search, field_id, limit });
35
+ return data;
36
+ }
37
37
  };
package/src/TimeUtil.ts CHANGED
@@ -1,67 +1,67 @@
1
- import { TimeOperation, TimeUnitOperation } from "namirasoft-core";
2
- import { Trial } from "./type/Trial";
3
- import { Period } from "./type/Period";
4
-
5
- export class TimeUtil
6
- {
7
- static trialEndsAt(trial: Trial)
8
- {
9
- return TimeUnitOperation.later(trial.duration.value, trial.duration.unit as any, trial.started_at);
10
- }
11
- static isTrial(trial: Trial, date: Date)
12
- {
13
- return date <= TimeUtil.trialEndsAt(trial);
14
- }
15
- static async loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period, trial: boolean) => Promise<void>): Promise<void>
16
- {
17
- if (period.end <= period.start)
18
- return;
19
-
20
- let pre_estimate_hour = async (period: Period, trial: boolean) =>
21
- {
22
- if (period.end <= period.start)
23
- return;
24
- return await estimate_hour(period, trial);
25
- }
26
-
27
- let trial_ends_at: Date | null = null;
28
- if (trial)
29
- trial_ends_at = TimeUtil.trialEndsAt(trial);
30
-
31
- let start = period.start;
32
- let end = null;
33
-
34
- do
35
- {
36
- let next_start = TimeOperation.hoursLater(1, start);
37
- next_start.setMilliseconds(0);
38
- next_start.setSeconds(0);
39
- next_start.setMinutes(0);
40
- if (period.end < next_start)
41
- {
42
- next_start = period.end;
43
- end = period.end;
44
- }
45
- else
46
- end = TimeOperation.secondsAgo(1, next_start);
47
- if (trial_ends_at)
48
- {
49
- if (trial_ends_at < start)
50
- await pre_estimate_hour({ start, end }, false);
51
- else if (trial_ends_at <= end)
52
- {
53
- let trial_ends_at_e = TimeOperation.secondsAgo(1, trial_ends_at);
54
- let trial_ends_at_s = trial_ends_at;
55
- await pre_estimate_hour({ start, end: trial_ends_at_e }, true);
56
- await pre_estimate_hour({ start: trial_ends_at_s, end }, false);
57
- }
58
- else if (end < trial_ends_at)
59
- await pre_estimate_hour({ start: period.start, end }, true);
60
- }
61
- else
62
- await pre_estimate_hour({ start, end }, false);
63
- start = next_start;
64
- }
65
- while (end < period.end)
66
- }
1
+ import { TimeOperation, TimeUnitOperation } from "namirasoft-core";
2
+ import { Trial } from "./type/Trial";
3
+ import { Period } from "./type/Period";
4
+
5
+ export class TimeUtil
6
+ {
7
+ static trialEndsAt(trial: Trial)
8
+ {
9
+ return TimeUnitOperation.later(trial.duration.value, trial.duration.unit as any, trial.started_at);
10
+ }
11
+ static isTrial(trial: Trial, date: Date)
12
+ {
13
+ return date <= TimeUtil.trialEndsAt(trial);
14
+ }
15
+ static async loopHourly(trial: Trial | null, period: Period, estimate_hour: (period: Period, trial: boolean) => Promise<void>): Promise<void>
16
+ {
17
+ if (period.end <= period.start)
18
+ return;
19
+
20
+ let pre_estimate_hour = async (period: Period, trial: boolean) =>
21
+ {
22
+ if (period.end <= period.start)
23
+ return;
24
+ return await estimate_hour(period, trial);
25
+ }
26
+
27
+ let trial_ends_at: Date | null = null;
28
+ if (trial)
29
+ trial_ends_at = TimeUtil.trialEndsAt(trial);
30
+
31
+ let start = period.start;
32
+ let end = null;
33
+
34
+ do
35
+ {
36
+ let next_start = TimeOperation.hoursLater(1, start);
37
+ next_start.setMilliseconds(0);
38
+ next_start.setSeconds(0);
39
+ next_start.setMinutes(0);
40
+ if (period.end < next_start)
41
+ {
42
+ next_start = period.end;
43
+ end = period.end;
44
+ }
45
+ else
46
+ end = TimeOperation.secondsAgo(1, next_start);
47
+ if (trial_ends_at)
48
+ {
49
+ if (trial_ends_at < start)
50
+ await pre_estimate_hour({ start, end }, false);
51
+ else if (trial_ends_at <= end)
52
+ {
53
+ let trial_ends_at_e = TimeOperation.secondsAgo(1, trial_ends_at);
54
+ let trial_ends_at_s = trial_ends_at;
55
+ await pre_estimate_hour({ start, end: trial_ends_at_e }, true);
56
+ await pre_estimate_hour({ start: trial_ends_at_s, end }, false);
57
+ }
58
+ else if (end < trial_ends_at)
59
+ await pre_estimate_hour({ start: period.start, end }, true);
60
+ }
61
+ else
62
+ await pre_estimate_hour({ start, end }, false);
63
+ start = next_start;
64
+ }
65
+ while (end < period.end)
66
+ }
67
67
  }
@@ -1,34 +1,34 @@
1
- /****************************************************************/
2
- /* */
3
- /* This is an Auto-Generated File */
4
- /* Made By */
5
- /* Namirasoft SDK Generator NPM Package */
6
- /* */
7
- /****************************************************************/
8
- /****************************************************************/
9
- /* */
10
- /* Please do not make any change to this file */
11
- /* If any change is required, ns-sdkg command must be used */
12
- /* */
13
- /****************************************************************/
14
- /****************************************************************/
15
- /* */
16
- /* Namira Software Corporation */
17
- /* https://namirasoft.com */
18
- /* */
19
- /****************************************************************/
20
-
21
- import { BaseNavigatorCommand } from "namirasoft-node-cli";
22
- import { BillWatchAWSEstimationCommand } from "./BillWatchAWSEstimationCommand";
23
- import { BillWatchAWS_CreateForCommand } from "./BillWatchAWS_CreateForCommand";
24
-
25
- export class BillWatchAWSCommand extends BaseNavigatorCommand
26
- {
27
- constructor(argv: string[])
28
- {
29
- super(argv, {
30
- "estimation": BillWatchAWSEstimationCommand,
31
- "_createfor": BillWatchAWS_CreateForCommand,
32
- });
33
- }
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { BaseNavigatorCommand } from "namirasoft-node-cli";
22
+ import { BillWatchAWSEstimateHourlyCommand } from "./BillWatchAWSEstimateHourlyCommand";
23
+ import { BillWatchAWS_CreateForHourlyCommand } from "./BillWatchAWS_CreateForHourlyCommand";
24
+
25
+ export class BillWatchAWSCommand extends BaseNavigatorCommand
26
+ {
27
+ constructor(argv: string[])
28
+ {
29
+ super(argv, {
30
+ "estimatehourly": BillWatchAWSEstimateHourlyCommand,
31
+ "_createforhourly": BillWatchAWS_CreateForHourlyCommand,
32
+ });
33
+ }
34
34
  };
@@ -1,83 +1,83 @@
1
- /****************************************************************/
2
- /* */
3
- /* This is an Auto-Generated File */
4
- /* Made By */
5
- /* Namirasoft SDK Generator NPM Package */
6
- /* */
7
- /****************************************************************/
8
- /****************************************************************/
9
- /* */
10
- /* Please do not make any change to this file */
11
- /* If any change is required, ns-sdkg command must be used */
12
- /* */
13
- /****************************************************************/
14
- /****************************************************************/
15
- /* */
16
- /* Namira Software Corporation */
17
- /* https://namirasoft.com */
18
- /* */
19
- /****************************************************************/
20
-
21
- import { BaseFinalCommand } from "namirasoft-node-cli";
22
- import { IStorageMemoryDedicated } from "namirasoft-core";
23
- import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
- import { TokenManager } from "namirasoft-account";
25
-
26
- export class FieldFieldEstimationCommand extends BaseFinalCommand
27
- {
28
- constructor(argv: string[])
29
- {
30
- super(argv, [], [
31
- {
32
- name: "first_entity_created_at",
33
- short: "",
34
- description: "Provides the value of 'first_entity_created_at' in body",
35
- optional: true,
36
- args: ["first_entity_created_at"],
37
- defaults: [""]
38
- },
39
- {
40
- name: "row_number",
41
- short: "",
42
- description: "Provides the value of 'row_number' in body",
43
- optional: false,
44
- args: ["row_number"],
45
- defaults: [""]
46
- },
47
- {
48
- name: "active",
49
- short: "",
50
- description: "Provides the value of 'active' in body",
51
- optional: false,
52
- args: ["active"],
53
- defaults: [""]
54
- },
55
- {
56
- name: "period",
57
- short: "",
58
- description: "Provides the value of 'period' in body",
59
- optional: false,
60
- args: ["period"],
61
- defaults: [""]
62
- }
63
- ]);
64
- }
65
- override async exec()
66
- {
67
- let token = this.app.storage.getNSAToken();
68
- if (token == null)
69
- throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
70
- let storage = new IStorageMemoryDedicated();
71
- let manager = new TokenManager(storage, () => { });
72
- manager.setValue(token, false);
73
- let url = this.app.storage.getItem("ns-cost-server-url");
74
- let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
75
- let ans = await server.field_field.Estimation({
76
- first_entity_created_at: this.option_values.first_entity_created_at,
77
- row_number: this.option_values.row_number,
78
- active: this.option_values.active,
79
- period: this.option_values.period
80
- });
81
- this.app.logger.success(JSON.stringify(ans));
82
- }
1
+ /****************************************************************/
2
+ /* */
3
+ /* This is an Auto-Generated File */
4
+ /* Made By */
5
+ /* Namirasoft SDK Generator NPM Package */
6
+ /* */
7
+ /****************************************************************/
8
+ /****************************************************************/
9
+ /* */
10
+ /* Please do not make any change to this file */
11
+ /* If any change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { BaseFinalCommand } from "namirasoft-node-cli";
22
+ import { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class BillWatchAWSEstimateHourlyCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, [], [
31
+ {
32
+ name: "first_entity_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_entity_created_at' in body",
35
+ optional: true,
36
+ args: ["first_entity_created_at"],
37
+ defaults: [""]
38
+ },
39
+ {
40
+ name: "period",
41
+ short: "",
42
+ description: "Provides the value of 'period' in body",
43
+ optional: false,
44
+ args: ["period"],
45
+ defaults: [""]
46
+ },
47
+ {
48
+ name: "row_number",
49
+ short: "",
50
+ description: "Provides the value of 'row_number' in body",
51
+ optional: false,
52
+ args: ["row_number"],
53
+ defaults: [""]
54
+ },
55
+ {
56
+ name: "active",
57
+ short: "",
58
+ description: "Provides the value of 'active' in body",
59
+ optional: false,
60
+ args: ["active"],
61
+ defaults: [""]
62
+ }
63
+ ]);
64
+ }
65
+ override async exec()
66
+ {
67
+ let token = this.app.storage.getNSAToken();
68
+ if (token == null)
69
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
70
+ let storage = new IStorageMemoryDedicated();
71
+ let manager = new TokenManager(storage, () => { });
72
+ manager.setValue(token, false);
73
+ let url = this.app.storage.getItem("ns-cost-server-url");
74
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
75
+ let ans = await server.bill_watch_aws.EstimateHourly({
76
+ first_entity_created_at: this.option_values.first_entity_created_at,
77
+ period: this.option_values.period,
78
+ row_number: this.option_values.row_number,
79
+ active: this.option_values.active
80
+ });
81
+ this.app.logger.success(JSON.stringify(ans));
82
+ }
83
83
  };