namirasoft-cost 1.4.21 → 1.4.22
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.
- package/.ns-sdkg-dir-deep +4 -3
- package/.ns-sdkg-file-keep +24 -8
- package/dist/bonus/BaseBonus.d.ts +13 -0
- package/dist/bonus/BaseBonus.js +11 -0
- package/dist/bonus/BaseBonus.js.map +1 -0
- package/dist/bonus/DeactiveBonus.d.ts +10 -0
- package/dist/bonus/DeactiveBonus.js +27 -0
- package/dist/bonus/DeactiveBonus.js.map +1 -0
- package/dist/bonus/FreeCountBonus.d.ts +10 -0
- package/dist/bonus/FreeCountBonus.js +27 -0
- package/dist/bonus/FreeCountBonus.js.map +1 -0
- package/dist/bonus/FreeTotalValueBonus.d.ts +33 -0
- package/dist/bonus/FreeTotalValueBonus.js +39 -0
- package/dist/bonus/FreeTotalValueBonus.js.map +1 -0
- package/dist/bonus/LowAmountBonus.d.ts +10 -0
- package/dist/bonus/LowAmountBonus.js +27 -0
- package/dist/bonus/LowAmountBonus.js.map +1 -0
- package/dist/bonus/LowSecondsBonus.d.ts +10 -0
- package/dist/bonus/LowSecondsBonus.js +27 -0
- package/dist/bonus/LowSecondsBonus.js.map +1 -0
- package/dist/bonus/LowTotalCountBonus.d.ts +10 -0
- package/dist/bonus/LowTotalCountBonus.js +27 -0
- package/dist/bonus/LowTotalCountBonus.js.map +1 -0
- package/dist/bonus/LowTotalValueBonus.d.ts +10 -0
- package/dist/bonus/LowTotalValueBonus.js +27 -0
- package/dist/bonus/LowTotalValueBonus.js.map +1 -0
- package/dist/bonus/TrialBonus.d.ts +12 -0
- package/dist/bonus/TrialBonus.js +32 -0
- package/dist/bonus/TrialBonus.js.map +1 -0
- package/dist/estimator/BaseEstimator.d.ts +15 -0
- package/dist/estimator/BaseEstimator.js +58 -0
- package/dist/estimator/BaseEstimator.js.map +1 -0
- package/dist/estimator/BillWatchAWSHourlyEstimator.d.ts +3 -0
- package/dist/estimator/BillWatchAWSHourlyEstimator.js +8 -0
- package/dist/estimator/BillWatchAWSHourlyEstimator.js.map +1 -0
- package/dist/estimator/BillWatchAzureHourlyEstimator.d.ts +3 -0
- package/dist/estimator/BillWatchAzureHourlyEstimator.js +8 -0
- package/dist/estimator/BillWatchAzureHourlyEstimator.js.map +1 -0
- package/dist/estimator/BillWatchBaseHourlyEstimator.d.ts +14 -0
- package/dist/estimator/BillWatchBaseHourlyEstimator.js +26 -0
- package/dist/estimator/BillWatchBaseHourlyEstimator.js.map +1 -0
- package/dist/estimator/BillWatchGCPHourlyEstimator.d.ts +3 -0
- package/dist/estimator/BillWatchGCPHourlyEstimator.js +8 -0
- package/dist/estimator/BillWatchGCPHourlyEstimator.js.map +1 -0
- package/dist/estimator/FieldBaseHourlyEstimator.d.ts +9 -0
- package/dist/estimator/FieldBaseHourlyEstimator.js +22 -0
- package/dist/estimator/FieldBaseHourlyEstimator.js.map +1 -0
- package/dist/estimator/FieldCategoryHourlyEstimator.d.ts +8 -0
- package/dist/estimator/FieldCategoryHourlyEstimator.js +12 -0
- package/dist/estimator/FieldCategoryHourlyEstimator.js.map +1 -0
- package/dist/estimator/FieldFieldHourlyEstimator.d.ts +8 -0
- package/dist/estimator/FieldFieldHourlyEstimator.js +12 -0
- package/dist/estimator/FieldFieldHourlyEstimator.js.map +1 -0
- package/dist/estimator/SecretSecretHourlyEstimator.d.ts +14 -0
- package/dist/estimator/SecretSecretHourlyEstimator.js +25 -0
- package/dist/estimator/SecretSecretHourlyEstimator.js.map +1 -0
- package/dist/estimator/SecretSecretReadEstimator.d.ts +14 -0
- package/dist/estimator/SecretSecretReadEstimator.js +25 -0
- package/dist/estimator/SecretSecretReadEstimator.js.map +1 -0
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -5
- package/dist/index.js.map +1 -1
- package/dist/type/Estimation.d.ts +10 -3
- package/dist/type/EstimationOption.d.ts +10 -0
- package/dist/type/{EstimationRow.js → EstimationOption.js} +2 -1
- package/dist/type/EstimationOption.js.map +1 -0
- package/dist/type/Period.d.ts +20 -2
- package/dist/type/Period.js +61 -0
- package/dist/type/Period.js.map +1 -1
- package/dist/type/Usage.d.ts +24 -0
- package/dist/type/Usage.js +30 -0
- package/dist/type/Usage.js.map +1 -0
- package/package.json +27 -27
- package/src/NamirasoftCostServer.ts +59 -59
- package/src/NamirasoftCostServerBase.ts +29 -29
- package/src/NamirasoftCostServerBillWatchAWS.ts +46 -46
- package/src/NamirasoftCostServerBillWatchAzure.ts +46 -46
- package/src/NamirasoftCostServerBillWatchGCP.ts +46 -46
- package/src/NamirasoftCostServerCost.ts +49 -49
- package/src/NamirasoftCostServerFieldCategory.ts +46 -46
- package/src/NamirasoftCostServerFieldField.ts +46 -46
- package/src/NamirasoftCostServerHealthz.ts +35 -35
- package/src/NamirasoftCostServerMetrics.ts +35 -35
- package/src/NamirasoftCostServerSecretSecret.ts +60 -60
- package/src/NamirasoftCostServerValue.ts +36 -36
- package/src/bonus/BaseBonus.ts +14 -0
- package/src/bonus/DeactiveBonus.ts +15 -0
- package/src/bonus/FreeCountBonus.ts +15 -0
- package/src/bonus/FreeTotalValueBonus.ts +29 -0
- package/src/bonus/LowAmountBonus.ts +15 -0
- package/src/bonus/LowSecondsBonus.ts +15 -0
- package/src/bonus/LowTotalCountBonus.ts +15 -0
- package/src/bonus/LowTotalValueBonus.ts +15 -0
- package/src/bonus/TrialBonus.ts +19 -0
- package/src/command/BillWatchAWSCommand.ts +33 -33
- package/src/command/BillWatchAWSEstimateHourlyCommand.ts +82 -82
- package/src/command/BillWatchAWS_CreateForHourlyCommand.ts +100 -100
- package/src/command/BillWatchAzureCommand.ts +33 -33
- package/src/command/BillWatchAzureEstimateHourlyCommand.ts +82 -82
- package/src/command/BillWatchAzure_CreateForHourlyCommand.ts +100 -100
- package/src/command/BillWatchGCPCommand.ts +33 -33
- package/src/command/BillWatchGCPEstimateHourlyCommand.ts +82 -82
- package/src/command/BillWatchGCP_CreateForHourlyCommand.ts +100 -100
- package/src/command/CostCommand.ts +33 -33
- package/src/command/CostListCommand.ts +44 -44
- package/src/command/Cost_CreateForCommand.ts +181 -181
- package/src/command/FieldCategoryCommand.ts +33 -33
- package/src/command/FieldCategoryEstimateHourlyCommand.ts +82 -82
- package/src/command/FieldCategory_CreateForHourlyCommand.ts +100 -100
- package/src/command/FieldFieldCommand.ts +33 -33
- package/src/command/FieldFieldEstimateHourlyCommand.ts +82 -82
- package/src/command/FieldField_CreateForHourlyCommand.ts +100 -100
- package/src/command/HealthzCommand.ts +31 -31
- package/src/command/HealthzGetCommand.ts +44 -44
- package/src/command/MetricsCommand.ts +31 -31
- package/src/command/MetricsGetCommand.ts +44 -44
- package/src/command/SecretSecretCommand.ts +37 -37
- package/src/command/SecretSecretEstimateHourlyCommand.ts +82 -82
- package/src/command/SecretSecretEstimateReadCommand.ts +82 -82
- package/src/command/SecretSecret_CreateForHourlyCommand.ts +100 -100
- package/src/command/SecretSecret_CreateForReadCommand.ts +100 -100
- package/src/command/ValueCommand.ts +31 -31
- package/src/command/ValueListCommand.ts +44 -44
- package/src/command/cli.ts +50 -50
- package/src/estimator/BaseEstimator.ts +63 -0
- package/src/estimator/BillWatchAWSHourlyEstimator.ts +5 -0
- package/src/estimator/BillWatchAzureHourlyEstimator.ts +5 -0
- package/src/estimator/BillWatchBaseHourlyEstimator.ts +26 -0
- package/src/estimator/BillWatchGCPHourlyEstimator.ts +5 -0
- package/src/estimator/FieldBaseHourlyEstimator.ts +21 -0
- package/src/estimator/FieldCategoryHourlyEstimator.ts +10 -0
- package/src/estimator/FieldFieldHourlyEstimator.ts +10 -0
- package/src/estimator/SecretSecretHourlyEstimator.ts +25 -0
- package/src/estimator/SecretSecretReadEstimator.ts +26 -0
- package/src/index.ts +68 -73
- package/src/meta/CostMetaTable.ts +81 -81
- package/src/meta/NamirasoftCostMetaDatabase.ts +50 -50
- package/src/row/CostCreateRow.ts +37 -37
- package/src/row/CostRow.ts +40 -40
- package/src/type/Estimation.ts +13 -6
- package/src/type/EstimationOption.ts +12 -0
- package/src/type/EstimationUsage.ts +5 -5
- package/src/type/Period.ts +74 -5
- package/src/type/Usage.ts +25 -0
- package/dist/TimeUtil.d.ts +0 -7
- package/dist/TimeUtil.js +0 -66
- package/dist/TimeUtil.js.map +0 -1
- package/dist/enum/TrialUnit.d.ts +0 -5
- package/dist/enum/TrialUnit.js +0 -10
- package/dist/enum/TrialUnit.js.map +0 -1
- package/dist/type/EstimationRow.d.ts +0 -9
- package/dist/type/EstimationRow.js.map +0 -1
- package/dist/type/Trial.d.ts +0 -5
- package/dist/type/Trial.js +0 -3
- package/dist/type/Trial.js.map +0 -1
- package/dist/type/TrialDuration.d.ts +0 -5
- package/dist/type/TrialDuration.js +0 -3
- package/dist/type/TrialDuration.js.map +0 -1
- package/src/TimeUtil.ts +0 -67
- package/src/enum/TrialUnit.ts +0 -6
- package/src/type/EstimationRow.ts +0 -10
- package/src/type/Trial.ts +0 -7
- 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
|
};
|
package/src/command/cli.ts
CHANGED
@@ -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,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,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,68 @@
|
|
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 "./
|
34
|
-
export * from "./command/
|
35
|
-
export * from "./command/
|
36
|
-
export * from "./command/
|
37
|
-
export * from "./command/
|
38
|
-
export * from "./command/
|
39
|
-
export * from "./command/
|
40
|
-
export * from "./command/
|
41
|
-
export * from "./command/
|
42
|
-
export * from "./command/
|
43
|
-
export * from "./command/
|
44
|
-
export * from "./command/
|
45
|
-
export * from "./command/
|
46
|
-
export * from "./command/
|
47
|
-
export * from "./command/
|
48
|
-
export * from "./command/
|
49
|
-
export * from "./command/
|
50
|
-
export * from "./command/
|
51
|
-
export * from "./command/
|
52
|
-
export * from "./command/
|
53
|
-
export * from "./command/
|
54
|
-
export * from "./command/
|
55
|
-
export * from "./command/
|
56
|
-
export * from "./command/
|
57
|
-
export * from "./command/
|
58
|
-
export * from "./command/
|
59
|
-
export * from "./command/
|
60
|
-
export * from "./command/
|
61
|
-
export * from "./command/
|
62
|
-
export * from "./
|
63
|
-
export * from "./
|
64
|
-
export * from "./
|
65
|
-
export * from "./
|
66
|
-
export * from "./
|
67
|
-
export * from "./
|
68
|
-
export * from "./type/
|
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 "./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 "./command/BillWatchAWSCommand";
|
34
|
+
export * from "./command/BillWatchAWSEstimateHourlyCommand";
|
35
|
+
export * from "./command/BillWatchAWS_CreateForHourlyCommand";
|
36
|
+
export * from "./command/BillWatchAzureCommand";
|
37
|
+
export * from "./command/BillWatchAzureEstimateHourlyCommand";
|
38
|
+
export * from "./command/BillWatchAzure_CreateForHourlyCommand";
|
39
|
+
export * from "./command/BillWatchGCPCommand";
|
40
|
+
export * from "./command/BillWatchGCPEstimateHourlyCommand";
|
41
|
+
export * from "./command/BillWatchGCP_CreateForHourlyCommand";
|
42
|
+
export * from "./command/CostCommand";
|
43
|
+
export * from "./command/CostListCommand";
|
44
|
+
export * from "./command/Cost_CreateForCommand";
|
45
|
+
export * from "./command/FieldCategoryCommand";
|
46
|
+
export * from "./command/FieldCategoryEstimateHourlyCommand";
|
47
|
+
export * from "./command/FieldCategory_CreateForHourlyCommand";
|
48
|
+
export * from "./command/FieldFieldCommand";
|
49
|
+
export * from "./command/FieldFieldEstimateHourlyCommand";
|
50
|
+
export * from "./command/FieldField_CreateForHourlyCommand";
|
51
|
+
export * from "./command/HealthzCommand";
|
52
|
+
export * from "./command/HealthzGetCommand";
|
53
|
+
export * from "./command/MetricsCommand";
|
54
|
+
export * from "./command/MetricsGetCommand";
|
55
|
+
export * from "./command/SecretSecretCommand";
|
56
|
+
export * from "./command/SecretSecretEstimateHourlyCommand";
|
57
|
+
export * from "./command/SecretSecretEstimateReadCommand";
|
58
|
+
export * from "./command/SecretSecret_CreateForHourlyCommand";
|
59
|
+
export * from "./command/SecretSecret_CreateForReadCommand";
|
60
|
+
export * from "./command/ValueCommand";
|
61
|
+
export * from "./command/ValueListCommand";
|
62
|
+
export * from "./meta/CostMetaTable";
|
63
|
+
export * from "./meta/NamirasoftCostMetaDatabase";
|
64
|
+
export * from "./row/CostCreateRow";
|
65
|
+
export * from "./row/CostRow";
|
66
|
+
export * from "./type/Estimation";
|
67
|
+
export * from "./type/EstimationUsage";
|
68
|
+
export * from "./type/Period";
|