namirasoft-cost 1.4.21 → 1.4.23

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 (163) hide show
  1. package/.ns-sdkg-dir-deep +4 -3
  2. package/.ns-sdkg-file-keep +24 -8
  3. package/dist/bonus/BaseBonus.d.ts +13 -0
  4. package/dist/bonus/BaseBonus.js +11 -0
  5. package/dist/bonus/BaseBonus.js.map +1 -0
  6. package/dist/bonus/DeactiveBonus.d.ts +10 -0
  7. package/dist/bonus/DeactiveBonus.js +27 -0
  8. package/dist/bonus/DeactiveBonus.js.map +1 -0
  9. package/dist/bonus/FreeCountBonus.d.ts +10 -0
  10. package/dist/bonus/FreeCountBonus.js +27 -0
  11. package/dist/bonus/FreeCountBonus.js.map +1 -0
  12. package/dist/bonus/FreeTotalValueBonus.d.ts +33 -0
  13. package/dist/bonus/FreeTotalValueBonus.js +39 -0
  14. package/dist/bonus/FreeTotalValueBonus.js.map +1 -0
  15. package/dist/bonus/LowAmountBonus.d.ts +10 -0
  16. package/dist/bonus/LowAmountBonus.js +27 -0
  17. package/dist/bonus/LowAmountBonus.js.map +1 -0
  18. package/dist/bonus/LowSecondsBonus.d.ts +10 -0
  19. package/dist/bonus/LowSecondsBonus.js +27 -0
  20. package/dist/bonus/LowSecondsBonus.js.map +1 -0
  21. package/dist/bonus/LowTotalCountBonus.d.ts +10 -0
  22. package/dist/bonus/LowTotalCountBonus.js +27 -0
  23. package/dist/bonus/LowTotalCountBonus.js.map +1 -0
  24. package/dist/bonus/LowTotalValueBonus.d.ts +10 -0
  25. package/dist/bonus/LowTotalValueBonus.js +27 -0
  26. package/dist/bonus/LowTotalValueBonus.js.map +1 -0
  27. package/dist/bonus/TrialBonus.d.ts +12 -0
  28. package/dist/bonus/TrialBonus.js +32 -0
  29. package/dist/bonus/TrialBonus.js.map +1 -0
  30. package/dist/estimator/BaseEstimator.d.ts +15 -0
  31. package/dist/estimator/BaseEstimator.js +58 -0
  32. package/dist/estimator/BaseEstimator.js.map +1 -0
  33. package/dist/estimator/BillWatchAWSHourlyEstimator.d.ts +3 -0
  34. package/dist/estimator/BillWatchAWSHourlyEstimator.js +8 -0
  35. package/dist/estimator/BillWatchAWSHourlyEstimator.js.map +1 -0
  36. package/dist/estimator/BillWatchAzureHourlyEstimator.d.ts +3 -0
  37. package/dist/estimator/BillWatchAzureHourlyEstimator.js +8 -0
  38. package/dist/estimator/BillWatchAzureHourlyEstimator.js.map +1 -0
  39. package/dist/estimator/BillWatchBaseHourlyEstimator.d.ts +14 -0
  40. package/dist/estimator/BillWatchBaseHourlyEstimator.js +26 -0
  41. package/dist/estimator/BillWatchBaseHourlyEstimator.js.map +1 -0
  42. package/dist/estimator/BillWatchGCPHourlyEstimator.d.ts +3 -0
  43. package/dist/estimator/BillWatchGCPHourlyEstimator.js +8 -0
  44. package/dist/estimator/BillWatchGCPHourlyEstimator.js.map +1 -0
  45. package/dist/estimator/FieldBaseHourlyEstimator.d.ts +9 -0
  46. package/dist/estimator/FieldBaseHourlyEstimator.js +22 -0
  47. package/dist/estimator/FieldBaseHourlyEstimator.js.map +1 -0
  48. package/dist/estimator/FieldCategoryHourlyEstimator.d.ts +8 -0
  49. package/dist/estimator/FieldCategoryHourlyEstimator.js +12 -0
  50. package/dist/estimator/FieldCategoryHourlyEstimator.js.map +1 -0
  51. package/dist/estimator/FieldFieldHourlyEstimator.d.ts +8 -0
  52. package/dist/estimator/FieldFieldHourlyEstimator.js +12 -0
  53. package/dist/estimator/FieldFieldHourlyEstimator.js.map +1 -0
  54. package/dist/estimator/SecretSecretHourlyEstimator.d.ts +14 -0
  55. package/dist/estimator/SecretSecretHourlyEstimator.js +25 -0
  56. package/dist/estimator/SecretSecretHourlyEstimator.js.map +1 -0
  57. package/dist/estimator/SecretSecretReadEstimator.d.ts +14 -0
  58. package/dist/estimator/SecretSecretReadEstimator.js +25 -0
  59. package/dist/estimator/SecretSecretReadEstimator.js.map +1 -0
  60. package/dist/index.d.ts +4 -5
  61. package/dist/index.js +4 -5
  62. package/dist/index.js.map +1 -1
  63. package/dist/type/Estimation.d.ts +10 -3
  64. package/dist/type/EstimationOption.d.ts +10 -0
  65. package/dist/type/{EstimationRow.js → EstimationOption.js} +2 -1
  66. package/dist/type/EstimationOption.js.map +1 -0
  67. package/dist/type/Period.d.ts +20 -2
  68. package/dist/type/Period.js +61 -0
  69. package/dist/type/Period.js.map +1 -1
  70. package/dist/type/Usage.d.ts +24 -0
  71. package/dist/type/Usage.js +30 -0
  72. package/dist/type/Usage.js.map +1 -0
  73. package/package.json +27 -27
  74. package/src/NamirasoftCostServer.ts +59 -59
  75. package/src/NamirasoftCostServerBase.ts +29 -29
  76. package/src/NamirasoftCostServerBillWatchAWS.ts +46 -46
  77. package/src/NamirasoftCostServerBillWatchAzure.ts +46 -46
  78. package/src/NamirasoftCostServerBillWatchGCP.ts +46 -46
  79. package/src/NamirasoftCostServerCost.ts +49 -49
  80. package/src/NamirasoftCostServerFieldCategory.ts +46 -46
  81. package/src/NamirasoftCostServerFieldField.ts +46 -46
  82. package/src/NamirasoftCostServerHealthz.ts +35 -35
  83. package/src/NamirasoftCostServerMetrics.ts +35 -35
  84. package/src/NamirasoftCostServerSecretSecret.ts +60 -60
  85. package/src/NamirasoftCostServerValue.ts +36 -36
  86. package/src/bonus/BaseBonus.ts +14 -0
  87. package/src/bonus/DeactiveBonus.ts +15 -0
  88. package/src/bonus/FreeCountBonus.ts +15 -0
  89. package/src/bonus/FreeTotalValueBonus.ts +29 -0
  90. package/src/bonus/LowAmountBonus.ts +15 -0
  91. package/src/bonus/LowSecondsBonus.ts +15 -0
  92. package/src/bonus/LowTotalCountBonus.ts +15 -0
  93. package/src/bonus/LowTotalValueBonus.ts +15 -0
  94. package/src/bonus/TrialBonus.ts +19 -0
  95. package/src/command/BillWatchAWSCommand.ts +33 -33
  96. package/src/command/BillWatchAWSEstimateHourlyCommand.ts +82 -82
  97. package/src/command/BillWatchAWS_CreateForHourlyCommand.ts +100 -100
  98. package/src/command/BillWatchAzureCommand.ts +33 -33
  99. package/src/command/BillWatchAzureEstimateHourlyCommand.ts +82 -82
  100. package/src/command/BillWatchAzure_CreateForHourlyCommand.ts +100 -100
  101. package/src/command/BillWatchGCPCommand.ts +33 -33
  102. package/src/command/BillWatchGCPEstimateHourlyCommand.ts +82 -82
  103. package/src/command/BillWatchGCP_CreateForHourlyCommand.ts +100 -100
  104. package/src/command/CostCommand.ts +33 -33
  105. package/src/command/CostListCommand.ts +44 -44
  106. package/src/command/Cost_CreateForCommand.ts +181 -181
  107. package/src/command/FieldCategoryCommand.ts +33 -33
  108. package/src/command/FieldCategoryEstimateHourlyCommand.ts +82 -82
  109. package/src/command/FieldCategory_CreateForHourlyCommand.ts +100 -100
  110. package/src/command/FieldFieldCommand.ts +33 -33
  111. package/src/command/FieldFieldEstimateHourlyCommand.ts +82 -82
  112. package/src/command/FieldField_CreateForHourlyCommand.ts +100 -100
  113. package/src/command/HealthzCommand.ts +31 -31
  114. package/src/command/HealthzGetCommand.ts +44 -44
  115. package/src/command/MetricsCommand.ts +31 -31
  116. package/src/command/MetricsGetCommand.ts +44 -44
  117. package/src/command/SecretSecretCommand.ts +37 -37
  118. package/src/command/SecretSecretEstimateHourlyCommand.ts +82 -82
  119. package/src/command/SecretSecretEstimateReadCommand.ts +82 -82
  120. package/src/command/SecretSecret_CreateForHourlyCommand.ts +100 -100
  121. package/src/command/SecretSecret_CreateForReadCommand.ts +100 -100
  122. package/src/command/ValueCommand.ts +31 -31
  123. package/src/command/ValueListCommand.ts +44 -44
  124. package/src/command/cli.ts +50 -50
  125. package/src/estimator/BaseEstimator.ts +63 -0
  126. package/src/estimator/BillWatchAWSHourlyEstimator.ts +5 -0
  127. package/src/estimator/BillWatchAzureHourlyEstimator.ts +5 -0
  128. package/src/estimator/BillWatchBaseHourlyEstimator.ts +26 -0
  129. package/src/estimator/BillWatchGCPHourlyEstimator.ts +5 -0
  130. package/src/estimator/FieldBaseHourlyEstimator.ts +21 -0
  131. package/src/estimator/FieldCategoryHourlyEstimator.ts +10 -0
  132. package/src/estimator/FieldFieldHourlyEstimator.ts +10 -0
  133. package/src/estimator/SecretSecretHourlyEstimator.ts +25 -0
  134. package/src/estimator/SecretSecretReadEstimator.ts +26 -0
  135. package/src/index.ts +72 -73
  136. package/src/meta/CostMetaTable.ts +81 -81
  137. package/src/meta/NamirasoftCostMetaDatabase.ts +50 -50
  138. package/src/row/CostCreateRow.ts +37 -37
  139. package/src/row/CostRow.ts +40 -40
  140. package/src/type/Estimation.ts +13 -6
  141. package/src/type/EstimationOption.ts +12 -0
  142. package/src/type/EstimationUsage.ts +5 -5
  143. package/src/type/Period.ts +74 -5
  144. package/src/type/Usage.ts +25 -0
  145. package/dist/TimeUtil.d.ts +0 -7
  146. package/dist/TimeUtil.js +0 -66
  147. package/dist/TimeUtil.js.map +0 -1
  148. package/dist/enum/TrialUnit.d.ts +0 -5
  149. package/dist/enum/TrialUnit.js +0 -10
  150. package/dist/enum/TrialUnit.js.map +0 -1
  151. package/dist/type/EstimationRow.d.ts +0 -9
  152. package/dist/type/EstimationRow.js.map +0 -1
  153. package/dist/type/Trial.d.ts +0 -5
  154. package/dist/type/Trial.js +0 -3
  155. package/dist/type/Trial.js.map +0 -1
  156. package/dist/type/TrialDuration.d.ts +0 -5
  157. package/dist/type/TrialDuration.js +0 -3
  158. package/dist/type/TrialDuration.js.map +0 -1
  159. package/src/TimeUtil.ts +0 -67
  160. package/src/enum/TrialUnit.ts +0 -6
  161. package/src/type/EstimationRow.ts +0 -10
  162. package/src/type/Trial.ts +0 -7
  163. package/src/type/TrialDuration.ts +0 -7
@@ -1,45 +1,45 @@
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 ValueListCommand extends BaseFinalCommand
27
- {
28
- constructor(argv: string[])
29
- {
30
- super(argv, ["table", "column", "search", "field_id", "limit"], []);
31
- }
32
- override async exec()
33
- {
34
- let token = this.app.storage.getNSAToken();
35
- if (token == null)
36
- throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
37
- let storage = new IStorageMemoryDedicated();
38
- let manager = new TokenManager(storage, () => { });
39
- manager.setValue(token, false);
40
- let url = this.app.storage.getItem("ns-cost-server-url");
41
- let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
42
- let ans = await server.value.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4]);
43
- this.app.logger.success(JSON.stringify(ans));
44
- }
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 ValueListCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, ["table", "column", "search", "field_id", "limit"], []);
31
+ }
32
+ override async exec()
33
+ {
34
+ let token = this.app.storage.getNSAToken();
35
+ if (token == null)
36
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
37
+ let storage = new IStorageMemoryDedicated();
38
+ let manager = new TokenManager(storage, () => { });
39
+ manager.setValue(token, false);
40
+ let url = this.app.storage.getItem("ns-cost-server-url");
41
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.value.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
45
  };
@@ -1,51 +1,51 @@
1
- #!/usr/bin/env node
2
- /****************************************************************/
3
- /* */
4
- /* This is an Auto-Generated File */
5
- /* Made By */
6
- /* Namirasoft SDK Generator NPM Package */
7
- /* */
8
- /****************************************************************/
9
- /****************************************************************/
10
- /* */
11
- /* Please do not make any change to this file */
12
- /* If any change is required, ns-sdkg command must be used */
13
- /* */
14
- /****************************************************************/
15
- /****************************************************************/
16
- /* */
17
- /* Namira Software Corporation */
18
- /* https://namirasoft.com */
19
- /* */
20
- /****************************************************************/
21
-
22
- import { AccountCommand } from "namirasoft-account";
23
- import { Application, BaseStorage } from "namirasoft-node-cli";
24
- import { BillWatchAWSCommand } from "./BillWatchAWSCommand";
25
- import { BillWatchAzureCommand } from "./BillWatchAzureCommand";
26
- import { BillWatchGCPCommand } from "./BillWatchGCPCommand";
27
- import { ConfigCommand } from "namirasoft-node-cli";
28
- import { CostCommand } from "./CostCommand";
29
- import { FieldCategoryCommand } from "./FieldCategoryCommand";
30
- import { FieldFieldCommand } from "./FieldFieldCommand";
31
- import { HealthzCommand } from "./HealthzCommand";
32
- import { MetricsCommand } from "./MetricsCommand";
33
- import { SecretSecretCommand } from "./SecretSecretCommand";
34
- import { ValueCommand } from "./ValueCommand";
35
-
36
- let app = new Application("ns-cost", new BaseStorage(),
37
- {
38
- "healthz": HealthzCommand,
39
- "metrics": MetricsCommand,
40
- "value": ValueCommand,
41
- "billwatchaws": BillWatchAWSCommand,
42
- "billwatchazure": BillWatchAzureCommand,
43
- "billwatchgcp": BillWatchGCPCommand,
44
- "fieldcategory": FieldCategoryCommand,
45
- "fieldfield": FieldFieldCommand,
46
- "secretsecret": SecretSecretCommand,
47
- "cost": CostCommand,
48
- "account": AccountCommand,
49
- "config": (argv: string[]) => new ConfigCommand(argv, ["ns-cost-server-url"])
50
- });
1
+ #!/usr/bin/env node
2
+ /****************************************************************/
3
+ /* */
4
+ /* This is an Auto-Generated File */
5
+ /* Made By */
6
+ /* Namirasoft SDK Generator NPM Package */
7
+ /* */
8
+ /****************************************************************/
9
+ /****************************************************************/
10
+ /* */
11
+ /* Please do not make any change to this file */
12
+ /* If any change is required, ns-sdkg command must be used */
13
+ /* */
14
+ /****************************************************************/
15
+ /****************************************************************/
16
+ /* */
17
+ /* Namira Software Corporation */
18
+ /* https://namirasoft.com */
19
+ /* */
20
+ /****************************************************************/
21
+
22
+ import { AccountCommand } from "namirasoft-account";
23
+ import { Application, BaseStorage } from "namirasoft-node-cli";
24
+ import { BillWatchAWSCommand } from "./BillWatchAWSCommand";
25
+ import { BillWatchAzureCommand } from "./BillWatchAzureCommand";
26
+ import { BillWatchGCPCommand } from "./BillWatchGCPCommand";
27
+ import { ConfigCommand } from "namirasoft-node-cli";
28
+ import { CostCommand } from "./CostCommand";
29
+ import { FieldCategoryCommand } from "./FieldCategoryCommand";
30
+ import { FieldFieldCommand } from "./FieldFieldCommand";
31
+ import { HealthzCommand } from "./HealthzCommand";
32
+ import { MetricsCommand } from "./MetricsCommand";
33
+ import { SecretSecretCommand } from "./SecretSecretCommand";
34
+ import { ValueCommand } from "./ValueCommand";
35
+
36
+ let app = new Application("ns-cost", new BaseStorage(),
37
+ {
38
+ "healthz": HealthzCommand,
39
+ "metrics": MetricsCommand,
40
+ "value": ValueCommand,
41
+ "billwatchaws": BillWatchAWSCommand,
42
+ "billwatchazure": BillWatchAzureCommand,
43
+ "billwatchgcp": BillWatchGCPCommand,
44
+ "fieldcategory": FieldCategoryCommand,
45
+ "fieldfield": FieldFieldCommand,
46
+ "secretsecret": SecretSecretCommand,
47
+ "cost": CostCommand,
48
+ "account": AccountCommand,
49
+ "config": (argv: string[]) => new ConfigCommand(argv, ["ns-cost-server-url"])
50
+ });
51
51
  app.run();
@@ -0,0 +1,63 @@
1
+ import { EstimationOption } from "../type/EstimationOption";
2
+ import { BaseBonus } from "../bonus/BaseBonus";
3
+ import { Estimation } from "../type/Estimation";
4
+ import { PeriodUtil } from "../type/Period";
5
+
6
+ export abstract class BaseEstimator
7
+ {
8
+ async estimate(option: EstimationOption, calculate_bonus: boolean = true): Promise<Estimation[]>
9
+ {
10
+ let seconds = PeriodUtil.toSeconds(option.period);
11
+ let percent = seconds / 3600;
12
+ let fee_object = this.getFee();
13
+ let fee = option.active ? fee_object.active : fee_object.deactive;
14
+
15
+ let amount = percent * fee * option.value;
16
+ let currency = "USD";
17
+
18
+ let estimation: Estimation = {
19
+ option,
20
+ seconds,
21
+ usage: {
22
+ value: option.value,
23
+ ...this.getUsage()
24
+ },
25
+ fee,
26
+ amount,
27
+ currency,
28
+ free: undefined
29
+ };
30
+
31
+ let ans: Estimation[] = [];
32
+ if (calculate_bonus)
33
+ {
34
+ let bonuses = this.getBonues();
35
+ for (let bonus of bonuses)
36
+ {
37
+ let res = await bonus.isFree(option, estimation);
38
+ if (res.free)
39
+ {
40
+ if (res.split)
41
+ {
42
+ let estimation_free = await this.estimate(res.split.free, false);
43
+ estimation_free.forEach(e => { e.free = bonus; });
44
+ ans.push(...estimation_free);
45
+ for (let estimation_paid of res.split.paids)
46
+ ans.push(...await this.estimate(estimation_paid, false));
47
+ }
48
+ else
49
+ {
50
+ estimation.free = bonus;
51
+ ans.push(estimation);
52
+ }
53
+ break;
54
+ }
55
+ }
56
+ }
57
+
58
+ return ans;
59
+ }
60
+ abstract getFee(): { active: number, deactive: number };
61
+ abstract getUsage(): { name: string, unit: string };
62
+ abstract getBonues(): BaseBonus[];
63
+ }
@@ -0,0 +1,5 @@
1
+ import { BillWatchBaseHourlyEstimator } from "./BillWatchBaseHourlyEstimator";
2
+
3
+ export class BillWatchAWSHourlyEstimator extends BillWatchBaseHourlyEstimator
4
+ {
5
+ }
@@ -0,0 +1,5 @@
1
+ import { BillWatchBaseHourlyEstimator } from "./BillWatchBaseHourlyEstimator";
2
+
3
+ export class BillWatchAzureHourlyEstimator extends BillWatchBaseHourlyEstimator
4
+ {
5
+ }
@@ -0,0 +1,26 @@
1
+ import { DurationUnit, PriceOperation } from "namirasoft-core";
2
+ import { BaseEstimator } from "./BaseEstimator";
3
+ import { Usage } from "../type/Usage";
4
+ import { TrialBonus } from "../bonus/TrialBonus";
5
+
6
+ export abstract class BillWatchBaseHourlyEstimator extends BaseEstimator
7
+ {
8
+ static WATCH_PER_HOUR_ACTIVE = PriceOperation.cent_to_millicent(3);
9
+ override getFee()
10
+ {
11
+ return { active: BillWatchBaseHourlyEstimator.WATCH_PER_HOUR_ACTIVE, deactive: 0 };
12
+ }
13
+ override getUsage()
14
+ {
15
+ return {
16
+ name: Usage.Time.name,
17
+ unit: Usage.Time.units.Hour.name
18
+ };
19
+ }
20
+ override getBonues()
21
+ {
22
+ return [
23
+ new TrialBonus(1, DurationUnit.Week)
24
+ ];
25
+ }
26
+ }
@@ -0,0 +1,5 @@
1
+ import { BillWatchBaseHourlyEstimator } from "./BillWatchBaseHourlyEstimator";
2
+
3
+ export class BillWatchGCPHourlyEstimator extends BillWatchBaseHourlyEstimator
4
+ {
5
+ }
@@ -0,0 +1,21 @@
1
+ import { DurationUnit } from "namirasoft-core";
2
+ import { TrialBonus } from "../bonus/TrialBonus";
3
+ import { BaseEstimator } from "./BaseEstimator";
4
+ import { Usage } from "../type/Usage";
5
+
6
+ export abstract class FieldBaseHourlyEstimator extends BaseEstimator
7
+ {
8
+ override getBonues()
9
+ {
10
+ return [
11
+ new TrialBonus(1, DurationUnit.Week)
12
+ ];
13
+ }
14
+ override getUsage()
15
+ {
16
+ return {
17
+ name: Usage.Time.name,
18
+ unit: Usage.Time.units.Hour.name
19
+ };
20
+ }
21
+ }
@@ -0,0 +1,10 @@
1
+ import { FieldBaseHourlyEstimator } from "./FieldBaseHourlyEstimator";
2
+
3
+ export class FieldCategoryHourlyEstimator extends FieldBaseHourlyEstimator
4
+ {
5
+ static PER_HOUR_ACTIVE = 200;
6
+ override getFee()
7
+ {
8
+ return { active: FieldCategoryHourlyEstimator.PER_HOUR_ACTIVE, deactive: FieldCategoryHourlyEstimator.PER_HOUR_ACTIVE };
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ import { FieldBaseHourlyEstimator } from "./FieldBaseHourlyEstimator";
2
+
3
+ export class FieldFieldHourlyEstimator extends FieldBaseHourlyEstimator
4
+ {
5
+ static PER_HOUR_ACTIVE = 250;
6
+ override getFee()
7
+ {
8
+ return { active: FieldFieldHourlyEstimator.PER_HOUR_ACTIVE, deactive: FieldFieldHourlyEstimator.PER_HOUR_ACTIVE };
9
+ }
10
+ }
@@ -0,0 +1,25 @@
1
+ import { FreeCountBonus } from "../bonus/FreeCountBonus";
2
+ import { Usage } from "../type/Usage";
3
+ import { BaseEstimator } from "./BaseEstimator";
4
+
5
+ export class SecretSecretHourlyEstimator extends BaseEstimator
6
+ {
7
+ static PER_HOUR_ACTIVE = 2;
8
+ override getFee()
9
+ {
10
+ return { active: SecretSecretHourlyEstimator.PER_HOUR_ACTIVE, deactive: SecretSecretHourlyEstimator.PER_HOUR_ACTIVE };
11
+ }
12
+ override getUsage()
13
+ {
14
+ return {
15
+ name: Usage.Time.name,
16
+ unit: Usage.Time.units.Hour.name
17
+ };
18
+ }
19
+ override getBonues()
20
+ {
21
+ return [
22
+ new FreeCountBonus(100)
23
+ ];
24
+ }
25
+ }
@@ -0,0 +1,26 @@
1
+ import { FreeTotalValueBonus } from "../bonus/FreeTotalValueBonus";
2
+ import { Usage } from "../type/Usage";
3
+ import { BaseEstimator } from "./BaseEstimator";
4
+
5
+ export class SecretSecretReadEstimator extends BaseEstimator
6
+ {
7
+ static PER_CALL = 1;
8
+
9
+ override getFee()
10
+ {
11
+ return { active: SecretSecretReadEstimator.PER_CALL, deactive: SecretSecretReadEstimator.PER_CALL };
12
+ }
13
+ override getUsage()
14
+ {
15
+ return {
16
+ name: Usage.APICALL.name,
17
+ unit: Usage.APICALL.units.REQUEST.name
18
+ };
19
+ }
20
+ override getBonues()
21
+ {
22
+ return [
23
+ new FreeTotalValueBonus(1000)
24
+ ];
25
+ }
26
+ }
package/src/index.ts CHANGED
@@ -1,73 +1,72 @@
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
- export * from "./NamirasoftCostServer";
22
- export * from "./NamirasoftCostServerBase";
23
- export * from "./NamirasoftCostServerBillWatchAWS";
24
- export * from "./NamirasoftCostServerBillWatchAzure";
25
- export * from "./NamirasoftCostServerBillWatchGCP";
26
- export * from "./NamirasoftCostServerCost";
27
- export * from "./NamirasoftCostServerFieldCategory";
28
- export * from "./NamirasoftCostServerFieldField";
29
- export * from "./NamirasoftCostServerHealthz";
30
- export * from "./NamirasoftCostServerMetrics";
31
- export * from "./NamirasoftCostServerSecretSecret";
32
- export * from "./NamirasoftCostServerValue";
33
- export * from "./TimeUtil";
34
- export * from "./command/BillWatchAWSCommand";
35
- export * from "./command/BillWatchAWSEstimateHourlyCommand";
36
- export * from "./command/BillWatchAWS_CreateForHourlyCommand";
37
- export * from "./command/BillWatchAzureCommand";
38
- export * from "./command/BillWatchAzureEstimateHourlyCommand";
39
- export * from "./command/BillWatchAzure_CreateForHourlyCommand";
40
- export * from "./command/BillWatchGCPCommand";
41
- export * from "./command/BillWatchGCPEstimateHourlyCommand";
42
- export * from "./command/BillWatchGCP_CreateForHourlyCommand";
43
- export * from "./command/CostCommand";
44
- export * from "./command/CostListCommand";
45
- export * from "./command/Cost_CreateForCommand";
46
- export * from "./command/FieldCategoryCommand";
47
- export * from "./command/FieldCategoryEstimateHourlyCommand";
48
- export * from "./command/FieldCategory_CreateForHourlyCommand";
49
- export * from "./command/FieldFieldCommand";
50
- export * from "./command/FieldFieldEstimateHourlyCommand";
51
- export * from "./command/FieldField_CreateForHourlyCommand";
52
- export * from "./command/HealthzCommand";
53
- export * from "./command/HealthzGetCommand";
54
- export * from "./command/MetricsCommand";
55
- export * from "./command/MetricsGetCommand";
56
- export * from "./command/SecretSecretCommand";
57
- export * from "./command/SecretSecretEstimateHourlyCommand";
58
- export * from "./command/SecretSecretEstimateReadCommand";
59
- export * from "./command/SecretSecret_CreateForHourlyCommand";
60
- export * from "./command/SecretSecret_CreateForReadCommand";
61
- export * from "./command/ValueCommand";
62
- export * from "./command/ValueListCommand";
63
- export * from "./enum/TrialUnit";
64
- export * from "./meta/CostMetaTable";
65
- export * from "./meta/NamirasoftCostMetaDatabase";
66
- export * from "./row/CostCreateRow";
67
- export * from "./row/CostRow";
68
- export * from "./type/Estimation";
69
- export * from "./type/EstimationRow";
70
- export * from "./type/EstimationUsage";
71
- export * from "./type/Period";
72
- export * from "./type/Trial";
73
- export * from "./type/TrialDuration";
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
+ export * from "./bonus/BaseBonus";
22
+ export * from "./estimator/BaseEstimator";
23
+ export * from "./NamirasoftCostServer";
24
+ export * from "./NamirasoftCostServerBase";
25
+ export * from "./NamirasoftCostServerBillWatchAWS";
26
+ export * from "./NamirasoftCostServerBillWatchAzure";
27
+ export * from "./NamirasoftCostServerBillWatchGCP";
28
+ export * from "./NamirasoftCostServerCost";
29
+ export * from "./NamirasoftCostServerFieldCategory";
30
+ export * from "./NamirasoftCostServerFieldField";
31
+ export * from "./NamirasoftCostServerHealthz";
32
+ export * from "./NamirasoftCostServerMetrics";
33
+ export * from "./NamirasoftCostServerSecretSecret";
34
+ export * from "./NamirasoftCostServerValue";
35
+ export * from "./command/BillWatchAWSCommand";
36
+ export * from "./command/BillWatchAWSEstimateHourlyCommand";
37
+ export * from "./command/BillWatchAWS_CreateForHourlyCommand";
38
+ export * from "./command/BillWatchAzureCommand";
39
+ export * from "./command/BillWatchAzureEstimateHourlyCommand";
40
+ export * from "./command/BillWatchAzure_CreateForHourlyCommand";
41
+ export * from "./command/BillWatchGCPCommand";
42
+ export * from "./command/BillWatchGCPEstimateHourlyCommand";
43
+ export * from "./command/BillWatchGCP_CreateForHourlyCommand";
44
+ export * from "./command/CostCommand";
45
+ export * from "./command/CostListCommand";
46
+ export * from "./command/Cost_CreateForCommand";
47
+ export * from "./command/FieldCategoryCommand";
48
+ export * from "./command/FieldCategoryEstimateHourlyCommand";
49
+ export * from "./command/FieldCategory_CreateForHourlyCommand";
50
+ export * from "./command/FieldFieldCommand";
51
+ export * from "./command/FieldFieldEstimateHourlyCommand";
52
+ export * from "./command/FieldField_CreateForHourlyCommand";
53
+ export * from "./command/HealthzCommand";
54
+ export * from "./command/HealthzGetCommand";
55
+ export * from "./command/MetricsCommand";
56
+ export * from "./command/MetricsGetCommand";
57
+ export * from "./command/SecretSecretCommand";
58
+ export * from "./command/SecretSecretEstimateHourlyCommand";
59
+ export * from "./command/SecretSecretEstimateReadCommand";
60
+ export * from "./command/SecretSecret_CreateForHourlyCommand";
61
+ export * from "./command/SecretSecret_CreateForReadCommand";
62
+ export * from "./command/ValueCommand";
63
+ export * from "./command/ValueListCommand";
64
+ export * from "./meta/CostMetaTable";
65
+ export * from "./meta/NamirasoftCostMetaDatabase";
66
+ export * from "./row/CostCreateRow";
67
+ export * from "./row/CostRow";
68
+ export * from "./type/Estimation";
69
+ export * from "./type/EstimationOption";
70
+ export * from "./type/EstimationUsage";
71
+ export * from "./type/Period";
72
+ export * from "./type/Usage";