namirasoft-cost 1.4.27 → 1.4.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (182) hide show
  1. package/.ns-sdkg-file-keep +10 -0
  2. package/dist/NamirasoftCostServer.js +1 -1
  3. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +4 -15
  4. package/dist/NamirasoftCostServerBillWatchAWS.js +2 -2
  5. package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
  6. package/dist/NamirasoftCostServerBillWatchAzure.d.ts +4 -15
  7. package/dist/NamirasoftCostServerBillWatchAzure.js +2 -2
  8. package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -1
  9. package/dist/NamirasoftCostServerBillWatchGCP.d.ts +4 -15
  10. package/dist/NamirasoftCostServerBillWatchGCP.js +2 -2
  11. package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -1
  12. package/dist/NamirasoftCostServerCost.d.ts +0 -2
  13. package/dist/NamirasoftCostServerCost.js +0 -8
  14. package/dist/NamirasoftCostServerCost.js.map +1 -1
  15. package/dist/NamirasoftCostServerFieldCategory.d.ts +4 -15
  16. package/dist/NamirasoftCostServerFieldCategory.js +2 -2
  17. package/dist/NamirasoftCostServerFieldCategory.js.map +1 -1
  18. package/dist/NamirasoftCostServerFieldField.d.ts +4 -15
  19. package/dist/NamirasoftCostServerFieldField.js +2 -2
  20. package/dist/NamirasoftCostServerFieldField.js.map +1 -1
  21. package/dist/NamirasoftCostServerSecretSecret.d.ts +6 -29
  22. package/dist/NamirasoftCostServerSecretSecret.js +2 -2
  23. package/dist/NamirasoftCostServerSecretSecret.js.map +1 -1
  24. package/dist/command/BillWatchAWSCommand.d.ts +4 -0
  25. package/dist/command/BillWatchAWSCommand.js +17 -0
  26. package/dist/command/BillWatchAWSCommand.js.map +1 -0
  27. package/dist/command/BillWatchAWSEstimateRecordCommand.d.ts +5 -0
  28. package/dist/command/BillWatchAWSEstimateRecordCommand.js +103 -0
  29. package/dist/command/BillWatchAWSEstimateRecordCommand.js.map +1 -0
  30. package/dist/command/BillWatchAWS_CreateForRecordCommand.d.ts +5 -0
  31. package/dist/command/BillWatchAWS_CreateForRecordCommand.js +112 -0
  32. package/dist/command/BillWatchAWS_CreateForRecordCommand.js.map +1 -0
  33. package/dist/command/BillWatchAzureCommand.d.ts +4 -0
  34. package/dist/command/BillWatchAzureCommand.js +17 -0
  35. package/dist/command/BillWatchAzureCommand.js.map +1 -0
  36. package/dist/command/BillWatchAzureEstimateRecordCommand.d.ts +5 -0
  37. package/dist/command/BillWatchAzureEstimateRecordCommand.js +103 -0
  38. package/dist/command/BillWatchAzureEstimateRecordCommand.js.map +1 -0
  39. package/dist/command/BillWatchAzure_CreateForRecordCommand.d.ts +5 -0
  40. package/dist/command/BillWatchAzure_CreateForRecordCommand.js +112 -0
  41. package/dist/command/BillWatchAzure_CreateForRecordCommand.js.map +1 -0
  42. package/dist/command/BillWatchGCPCommand.d.ts +4 -0
  43. package/dist/command/BillWatchGCPCommand.js +17 -0
  44. package/dist/command/BillWatchGCPCommand.js.map +1 -0
  45. package/dist/command/BillWatchGCPEstimateRecordCommand.d.ts +5 -0
  46. package/dist/command/BillWatchGCPEstimateRecordCommand.js +103 -0
  47. package/dist/command/BillWatchGCPEstimateRecordCommand.js.map +1 -0
  48. package/dist/command/BillWatchGCP_CreateForRecordCommand.d.ts +5 -0
  49. package/dist/command/BillWatchGCP_CreateForRecordCommand.js +112 -0
  50. package/dist/command/BillWatchGCP_CreateForRecordCommand.js.map +1 -0
  51. package/dist/command/CostCommand.d.ts +4 -0
  52. package/dist/command/CostCommand.js +15 -0
  53. package/dist/command/CostCommand.js.map +1 -0
  54. package/dist/command/CostListCommand.d.ts +5 -0
  55. package/dist/command/CostListCommand.js +38 -0
  56. package/dist/command/CostListCommand.js.map +1 -0
  57. package/dist/command/FieldCategoryCommand.d.ts +4 -0
  58. package/dist/command/FieldCategoryCommand.js +17 -0
  59. package/dist/command/FieldCategoryCommand.js.map +1 -0
  60. package/dist/command/FieldCategoryEstimateRecordCommand.d.ts +5 -0
  61. package/dist/command/FieldCategoryEstimateRecordCommand.js +103 -0
  62. package/dist/command/FieldCategoryEstimateRecordCommand.js.map +1 -0
  63. package/dist/command/FieldCategory_CreateForRecordCommand.d.ts +5 -0
  64. package/dist/command/FieldCategory_CreateForRecordCommand.js +112 -0
  65. package/dist/command/FieldCategory_CreateForRecordCommand.js.map +1 -0
  66. package/dist/command/FieldFieldCommand.d.ts +4 -0
  67. package/dist/command/FieldFieldCommand.js +17 -0
  68. package/dist/command/FieldFieldCommand.js.map +1 -0
  69. package/dist/command/FieldFieldEstimateRecordCommand.d.ts +5 -0
  70. package/dist/command/FieldFieldEstimateRecordCommand.js +103 -0
  71. package/dist/command/FieldFieldEstimateRecordCommand.js.map +1 -0
  72. package/dist/command/FieldField_CreateForRecordCommand.d.ts +5 -0
  73. package/dist/command/FieldField_CreateForRecordCommand.js +112 -0
  74. package/dist/command/FieldField_CreateForRecordCommand.js.map +1 -0
  75. package/dist/command/HealthzCommand.d.ts +4 -0
  76. package/dist/command/HealthzCommand.js +15 -0
  77. package/dist/command/HealthzCommand.js.map +1 -0
  78. package/dist/command/HealthzGetCommand.d.ts +5 -0
  79. package/dist/command/HealthzGetCommand.js +38 -0
  80. package/dist/command/HealthzGetCommand.js.map +1 -0
  81. package/dist/command/MetricsCommand.d.ts +4 -0
  82. package/dist/command/MetricsCommand.js +15 -0
  83. package/dist/command/MetricsCommand.js.map +1 -0
  84. package/dist/command/MetricsGetCommand.d.ts +5 -0
  85. package/dist/command/MetricsGetCommand.js +38 -0
  86. package/dist/command/MetricsGetCommand.js.map +1 -0
  87. package/dist/command/SecretSecretCommand.d.ts +4 -0
  88. package/dist/command/SecretSecretCommand.js +21 -0
  89. package/dist/command/SecretSecretCommand.js.map +1 -0
  90. package/dist/command/SecretSecretEstimateReadCommand.d.ts +5 -0
  91. package/dist/command/SecretSecretEstimateReadCommand.js +103 -0
  92. package/dist/command/SecretSecretEstimateReadCommand.js.map +1 -0
  93. package/dist/command/SecretSecretEstimateRecordCommand.d.ts +5 -0
  94. package/dist/command/SecretSecretEstimateRecordCommand.js +103 -0
  95. package/dist/command/SecretSecretEstimateRecordCommand.js.map +1 -0
  96. package/dist/command/SecretSecret_CreateForReadCommand.d.ts +5 -0
  97. package/dist/command/SecretSecret_CreateForReadCommand.js +112 -0
  98. package/dist/command/SecretSecret_CreateForReadCommand.js.map +1 -0
  99. package/dist/command/SecretSecret_CreateForRecordCommand.d.ts +5 -0
  100. package/dist/command/SecretSecret_CreateForRecordCommand.js +112 -0
  101. package/dist/command/SecretSecret_CreateForRecordCommand.js.map +1 -0
  102. package/dist/command/ValueCommand.d.ts +4 -0
  103. package/dist/command/ValueCommand.js +15 -0
  104. package/dist/command/ValueCommand.js.map +1 -0
  105. package/dist/command/ValueListCommand.d.ts +5 -0
  106. package/dist/command/ValueListCommand.js +38 -0
  107. package/dist/command/ValueListCommand.js.map +1 -0
  108. package/dist/command/cli.d.ts +2 -0
  109. package/dist/command/cli.js +32 -0
  110. package/dist/command/cli.js.map +1 -0
  111. package/dist/estimator/BaseEstimator.d.ts +1 -1
  112. package/dist/estimator/BaseEstimator.js +1 -1
  113. package/dist/estimator/BaseEstimator.js.map +1 -1
  114. package/dist/estimator/BillWatchBaseRecordEstimator.d.ts +1 -1
  115. package/dist/estimator/BillWatchBaseRecordEstimator.js +1 -1
  116. package/dist/estimator/BillWatchBaseRecordEstimator.js.map +1 -1
  117. package/dist/estimator/FieldBaseRecordEstimator.d.ts +1 -1
  118. package/dist/estimator/FieldBaseRecordEstimator.js +1 -1
  119. package/dist/estimator/FieldBaseRecordEstimator.js.map +1 -1
  120. package/dist/estimator/SecretSecretReadEstimator.d.ts +1 -1
  121. package/dist/estimator/SecretSecretReadEstimator.js +1 -1
  122. package/dist/estimator/SecretSecretReadEstimator.js.map +1 -1
  123. package/dist/estimator/SecretSecretRecordEstimator.d.ts +1 -1
  124. package/dist/estimator/SecretSecretRecordEstimator.js +1 -1
  125. package/dist/estimator/SecretSecretRecordEstimator.js.map +1 -1
  126. package/dist/index.d.ts +47 -12
  127. package/dist/index.js +47 -12
  128. package/dist/index.js.map +1 -1
  129. package/package.json +4 -4
  130. package/src/NamirasoftCostServer.ts +1 -1
  131. package/src/NamirasoftCostServerBillWatchAWS.ts +8 -7
  132. package/src/NamirasoftCostServerBillWatchAzure.ts +8 -7
  133. package/src/NamirasoftCostServerBillWatchGCP.ts +8 -7
  134. package/src/NamirasoftCostServerCost.ts +0 -8
  135. package/src/NamirasoftCostServerFieldCategory.ts +8 -7
  136. package/src/NamirasoftCostServerFieldField.ts +8 -7
  137. package/src/NamirasoftCostServerSecretSecret.ts +12 -11
  138. package/src/command/BillWatchAWSCommand.ts +34 -0
  139. package/src/command/BillWatchAWSEstimateRecordCommand.ts +110 -0
  140. package/src/command/BillWatchAWS_CreateForRecordCommand.ts +119 -0
  141. package/src/command/BillWatchAzureCommand.ts +34 -0
  142. package/src/command/BillWatchAzureEstimateRecordCommand.ts +110 -0
  143. package/src/command/BillWatchAzure_CreateForRecordCommand.ts +119 -0
  144. package/src/command/BillWatchGCPCommand.ts +34 -0
  145. package/src/command/BillWatchGCPEstimateRecordCommand.ts +110 -0
  146. package/src/command/BillWatchGCP_CreateForRecordCommand.ts +119 -0
  147. package/src/{row/CostCreateRow.ts → command/CostCommand.ts} +11 -17
  148. package/src/command/CostListCommand.ts +45 -0
  149. package/src/command/FieldCategoryCommand.ts +34 -0
  150. package/src/command/FieldCategoryEstimateRecordCommand.ts +110 -0
  151. package/src/command/FieldCategory_CreateForRecordCommand.ts +119 -0
  152. package/src/command/FieldFieldCommand.ts +34 -0
  153. package/src/command/FieldFieldEstimateRecordCommand.ts +110 -0
  154. package/src/command/FieldField_CreateForRecordCommand.ts +119 -0
  155. package/src/command/HealthzCommand.ts +32 -0
  156. package/src/command/HealthzGetCommand.ts +45 -0
  157. package/src/command/MetricsCommand.ts +32 -0
  158. package/src/command/MetricsGetCommand.ts +45 -0
  159. package/src/command/SecretSecretCommand.ts +38 -0
  160. package/src/command/SecretSecretEstimateReadCommand.ts +110 -0
  161. package/src/command/SecretSecretEstimateRecordCommand.ts +110 -0
  162. package/src/command/SecretSecret_CreateForReadCommand.ts +119 -0
  163. package/src/command/SecretSecret_CreateForRecordCommand.ts +119 -0
  164. package/src/command/ValueCommand.ts +32 -0
  165. package/src/command/ValueListCommand.ts +45 -0
  166. package/src/command/cli.ts +51 -0
  167. package/src/estimator/BaseEstimator.ts +62 -62
  168. package/src/estimator/BillWatchAWSRecordEstimator.ts +4 -4
  169. package/src/estimator/BillWatchAzureRecordEstimator.ts +4 -4
  170. package/src/estimator/BillWatchBaseRecordEstimator.ts +25 -25
  171. package/src/estimator/BillWatchGCPRecordEstimator.ts +4 -4
  172. package/src/estimator/FieldBaseRecordEstimator.ts +20 -20
  173. package/src/estimator/FieldCategoryRecordEstimator.ts +9 -9
  174. package/src/estimator/FieldFieldRecordEstimator.ts +9 -9
  175. package/src/estimator/SecretSecretReadEstimator.ts +25 -25
  176. package/src/estimator/SecretSecretRecordEstimator.ts +24 -24
  177. package/src/index.ts +47 -12
  178. package/src/type/CalculationOption.ts +1 -1
  179. package/src/type/Estimation.ts +1 -1
  180. package/dist/row/CostCreateRow.d.ts +0 -17
  181. package/dist/row/CostCreateRow.js +0 -3
  182. package/dist/row/CostCreateRow.js.map +0 -1
@@ -0,0 +1,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
+ }
45
+ };
@@ -0,0 +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
+ });
51
+ app.run();
@@ -1,63 +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[];
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.getBonuses();
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 getBonuses(): BaseBonus[];
63
63
  }
@@ -1,5 +1,5 @@
1
- import { BillWatchBaseRecordEstimator } from "./BillWatchBaseRecordEstimator";
2
-
3
- export class BillWatchAWSRecordEstimator extends BillWatchBaseRecordEstimator
4
- {
1
+ import { BillWatchBaseRecordEstimator } from "./BillWatchBaseRecordEstimator";
2
+
3
+ export class BillWatchAWSRecordEstimator extends BillWatchBaseRecordEstimator
4
+ {
5
5
  }
@@ -1,5 +1,5 @@
1
- import { BillWatchBaseRecordEstimator } from "./BillWatchBaseRecordEstimator";
2
-
3
- export class BillWatchAzureRecordEstimator extends BillWatchBaseRecordEstimator
4
- {
1
+ import { BillWatchBaseRecordEstimator } from "./BillWatchBaseRecordEstimator";
2
+
3
+ export class BillWatchAzureRecordEstimator extends BillWatchBaseRecordEstimator
4
+ {
5
5
  }
@@ -1,26 +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 BillWatchBaseRecordEstimator extends BaseEstimator
7
- {
8
- static WATCH_PER_HOUR_ACTIVE = PriceOperation.cent_to_millicent(3);
9
- override getFee()
10
- {
11
- return { active: BillWatchBaseRecordEstimator.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
- }
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 BillWatchBaseRecordEstimator extends BaseEstimator
7
+ {
8
+ static WATCH_PER_HOUR_ACTIVE = PriceOperation.cent_to_millicent(3);
9
+ override getFee()
10
+ {
11
+ return { active: BillWatchBaseRecordEstimator.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 getBonuses()
21
+ {
22
+ return [
23
+ new TrialBonus(1, DurationUnit.Week)
24
+ ];
25
+ }
26
26
  }
@@ -1,5 +1,5 @@
1
- import { BillWatchBaseRecordEstimator } from "./BillWatchBaseRecordEstimator";
2
-
3
- export class BillWatchGCPRecordEstimator extends BillWatchBaseRecordEstimator
4
- {
1
+ import { BillWatchBaseRecordEstimator } from "./BillWatchBaseRecordEstimator";
2
+
3
+ export class BillWatchGCPRecordEstimator extends BillWatchBaseRecordEstimator
4
+ {
5
5
  }
@@ -1,21 +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 FieldBaseRecordEstimator 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
- }
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 FieldBaseRecordEstimator extends BaseEstimator
7
+ {
8
+ override getBonuses()
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
21
  }
@@ -1,10 +1,10 @@
1
- import { FieldBaseRecordEstimator } from "./FieldBaseRecordEstimator";
2
-
3
- export class FieldCategoryRecordEstimator extends FieldBaseRecordEstimator
4
- {
5
- static PER_HOUR_ACTIVE = 200;
6
- override getFee()
7
- {
8
- return { active: FieldCategoryRecordEstimator.PER_HOUR_ACTIVE, deactive: FieldCategoryRecordEstimator.PER_HOUR_ACTIVE };
9
- }
1
+ import { FieldBaseRecordEstimator } from "./FieldBaseRecordEstimator";
2
+
3
+ export class FieldCategoryRecordEstimator extends FieldBaseRecordEstimator
4
+ {
5
+ static PER_HOUR_ACTIVE = 200;
6
+ override getFee()
7
+ {
8
+ return { active: FieldCategoryRecordEstimator.PER_HOUR_ACTIVE, deactive: FieldCategoryRecordEstimator.PER_HOUR_ACTIVE };
9
+ }
10
10
  }
@@ -1,10 +1,10 @@
1
- import { FieldBaseRecordEstimator } from "./FieldBaseRecordEstimator";
2
-
3
- export class FieldFieldRecordEstimator extends FieldBaseRecordEstimator
4
- {
5
- static PER_HOUR_ACTIVE = 250;
6
- override getFee()
7
- {
8
- return { active: FieldFieldRecordEstimator.PER_HOUR_ACTIVE, deactive: FieldFieldRecordEstimator.PER_HOUR_ACTIVE };
9
- }
1
+ import { FieldBaseRecordEstimator } from "./FieldBaseRecordEstimator";
2
+
3
+ export class FieldFieldRecordEstimator extends FieldBaseRecordEstimator
4
+ {
5
+ static PER_HOUR_ACTIVE = 250;
6
+ override getFee()
7
+ {
8
+ return { active: FieldFieldRecordEstimator.PER_HOUR_ACTIVE, deactive: FieldFieldRecordEstimator.PER_HOUR_ACTIVE };
9
+ }
10
10
  }
@@ -1,26 +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
- }
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 getBonuses()
21
+ {
22
+ return [
23
+ new FreeTotalValueBonus(1000)
24
+ ];
25
+ }
26
26
  }
@@ -1,25 +1,25 @@
1
- import { FreeCountBonus } from "../bonus/FreeCountBonus";
2
- import { Usage } from "../type/Usage";
3
- import { BaseEstimator } from "./BaseEstimator";
4
-
5
- export class SecretSecretRecordEstimator extends BaseEstimator
6
- {
7
- static PER_HOUR_ACTIVE = 2;
8
- override getFee()
9
- {
10
- return { active: SecretSecretRecordEstimator.PER_HOUR_ACTIVE, deactive: SecretSecretRecordEstimator.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
- }
1
+ import { FreeCountBonus } from "../bonus/FreeCountBonus";
2
+ import { Usage } from "../type/Usage";
3
+ import { BaseEstimator } from "./BaseEstimator";
4
+
5
+ export class SecretSecretRecordEstimator extends BaseEstimator
6
+ {
7
+ static PER_HOUR_ACTIVE = 2;
8
+ override getFee()
9
+ {
10
+ return { active: SecretSecretRecordEstimator.PER_HOUR_ACTIVE, deactive: SecretSecretRecordEstimator.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 getBonuses()
20
+ {
21
+ return [
22
+ new FreeCountBonus(100)
23
+ ];
24
+ }
25
25
  }
package/src/index.ts CHANGED
@@ -18,17 +18,6 @@
18
18
  /* */
19
19
  /****************************************************************/
20
20
 
21
- export * from "./bonus/BaseBonus";
22
- export * from "./estimator/BaseEstimator";
23
- export * from "./estimator/BillWatchAWSRecordEstimator";
24
- export * from "./estimator/BillWatchAzureRecordEstimator";
25
- export * from "./estimator/BillWatchBaseRecordEstimator";
26
- export * from "./estimator/BillWatchGCPRecordEstimator";
27
- export * from "./estimator/FieldBaseRecordEstimator";
28
- export * from "./estimator/FieldCategoryRecordEstimator";
29
- export * from "./estimator/FieldFieldRecordEstimator";
30
- export * from "./estimator/SecretSecretRecordEstimator";
31
- export * from "./estimator/SecretSecretReadEstimator";
32
21
  export * from "./NamirasoftCostServer";
33
22
  export * from "./NamirasoftCostServerBase";
34
23
  export * from "./NamirasoftCostServerBillWatchAWS";
@@ -41,9 +30,55 @@ export * from "./NamirasoftCostServerHealthz";
41
30
  export * from "./NamirasoftCostServerMetrics";
42
31
  export * from "./NamirasoftCostServerSecretSecret";
43
32
  export * from "./NamirasoftCostServerValue";
33
+ export * from "./bonus/BaseBonus";
34
+ export * from "./bonus/DeactiveBonus";
35
+ export * from "./bonus/FreeCountBonus";
36
+ export * from "./bonus/FreeTotalValueBonus";
37
+ export * from "./bonus/LowAmountBonus";
38
+ export * from "./bonus/LowSecondsBonus";
39
+ export * from "./bonus/LowTotalCountBonus";
40
+ export * from "./bonus/LowTotalValueBonus";
41
+ export * from "./bonus/TrialBonus";
42
+ export * from "./command/BillWatchAWSCommand";
43
+ export * from "./command/BillWatchAWSEstimateRecordCommand";
44
+ export * from "./command/BillWatchAWS_CreateForRecordCommand";
45
+ export * from "./command/BillWatchAzureCommand";
46
+ export * from "./command/BillWatchAzureEstimateRecordCommand";
47
+ export * from "./command/BillWatchAzure_CreateForRecordCommand";
48
+ export * from "./command/BillWatchGCPCommand";
49
+ export * from "./command/BillWatchGCPEstimateRecordCommand";
50
+ export * from "./command/BillWatchGCP_CreateForRecordCommand";
51
+ export * from "./command/CostCommand";
52
+ export * from "./command/CostListCommand";
53
+ export * from "./command/FieldCategoryCommand";
54
+ export * from "./command/FieldCategoryEstimateRecordCommand";
55
+ export * from "./command/FieldCategory_CreateForRecordCommand";
56
+ export * from "./command/FieldFieldCommand";
57
+ export * from "./command/FieldFieldEstimateRecordCommand";
58
+ export * from "./command/FieldField_CreateForRecordCommand";
59
+ export * from "./command/HealthzCommand";
60
+ export * from "./command/HealthzGetCommand";
61
+ export * from "./command/MetricsCommand";
62
+ export * from "./command/MetricsGetCommand";
63
+ export * from "./command/SecretSecretCommand";
64
+ export * from "./command/SecretSecretEstimateReadCommand";
65
+ export * from "./command/SecretSecretEstimateRecordCommand";
66
+ export * from "./command/SecretSecret_CreateForReadCommand";
67
+ export * from "./command/SecretSecret_CreateForRecordCommand";
68
+ export * from "./command/ValueCommand";
69
+ export * from "./command/ValueListCommand";
70
+ export * from "./estimator/BaseEstimator";
71
+ export * from "./estimator/BillWatchAWSRecordEstimator";
72
+ export * from "./estimator/BillWatchAzureRecordEstimator";
73
+ export * from "./estimator/BillWatchBaseRecordEstimator";
74
+ export * from "./estimator/BillWatchGCPRecordEstimator";
75
+ export * from "./estimator/FieldBaseRecordEstimator";
76
+ export * from "./estimator/FieldCategoryRecordEstimator";
77
+ export * from "./estimator/FieldFieldRecordEstimator";
78
+ export * from "./estimator/SecretSecretReadEstimator";
79
+ export * from "./estimator/SecretSecretRecordEstimator";
44
80
  export * from "./meta/CostMetaTable";
45
81
  export * from "./meta/NamirasoftCostMetaDatabase";
46
- export * from "./row/CostCreateRow";
47
82
  export * from "./row/CostRow";
48
83
  export * from "./type/Bonus";
49
84
  export * from "./type/CalculationOption";
@@ -31,4 +31,4 @@ export class CalculationOptionSchema extends ObjectSchema
31
31
  package: "./type/CalculationOption"
32
32
  };
33
33
  }
34
- }
34
+ }
@@ -32,4 +32,4 @@ export class EstimationSchema extends ObjectSchema
32
32
  package: "./type/Estimation"
33
33
  };
34
34
  }
35
- }
35
+ }
@@ -1,17 +0,0 @@
1
- export type CostCreateRow = {
2
- workspace_id: string;
3
- product_id: string;
4
- sales_item_id: string;
5
- offer_id: string;
6
- offer_item_id: string;
7
- resource_entity: string;
8
- resource_id: string;
9
- usage_name: string;
10
- usage_value: number;
11
- usage_unit: string;
12
- period_start: Date;
13
- period_end: Date;
14
- amount: number;
15
- currency: string;
16
- description: string;
17
- };
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=CostCreateRow.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CostCreateRow.js","sourceRoot":"","sources":["../../src/row/CostCreateRow.ts"],"names":[],"mappings":""}