namirasoft-cost 1.4.19 → 1.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/NamirasoftCostServer.d.ts +2 -0
- package/dist/NamirasoftCostServer.js +3 -1
- package/dist/NamirasoftCostServer.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchAWS.d.ts +4 -4
- package/dist/NamirasoftCostServerBillWatchAWS.js +6 -6
- package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchAzure.d.ts +4 -4
- package/dist/NamirasoftCostServerBillWatchAzure.js +6 -6
- package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchGCP.d.ts +4 -4
- package/dist/NamirasoftCostServerBillWatchGCP.js +6 -6
- package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -1
- package/dist/NamirasoftCostServerFieldCategory.d.ts +4 -4
- package/dist/NamirasoftCostServerFieldCategory.js +6 -6
- package/dist/NamirasoftCostServerFieldCategory.js.map +1 -1
- package/dist/NamirasoftCostServerFieldField.d.ts +4 -4
- package/dist/NamirasoftCostServerFieldField.js +6 -6
- package/dist/NamirasoftCostServerFieldField.js.map +1 -1
- package/dist/NamirasoftCostServerSecretSecret.d.ts +36 -0
- package/dist/NamirasoftCostServerSecretSecret.js +53 -0
- package/dist/NamirasoftCostServerSecretSecret.js.map +1 -0
- package/dist/TimeUtil.js +18 -11
- package/dist/TimeUtil.js.map +1 -1
- package/dist/command/BillWatchAWSCommand.js +4 -4
- package/dist/command/BillWatchAWSCommand.js.map +1 -1
- package/dist/command/{BillWatchAWSEstimationCommand.d.ts → BillWatchAWSEstimateHourlyCommand.d.ts} +1 -1
- package/dist/command/{BillWatchAWSEstimationCommand.js → BillWatchAWSEstimateHourlyCommand.js} +15 -15
- package/dist/command/BillWatchAWSEstimateHourlyCommand.js.map +1 -0
- package/dist/command/BillWatchAWS_CreateForHourlyCommand.d.ts +5 -0
- package/dist/command/{FieldCategory_CreateForCommand.js → BillWatchAWS_CreateForHourlyCommand.js} +14 -14
- package/dist/command/BillWatchAWS_CreateForHourlyCommand.js.map +1 -0
- package/dist/command/BillWatchAzureCommand.js +4 -4
- package/dist/command/BillWatchAzureCommand.js.map +1 -1
- package/dist/command/BillWatchAzureEstimateHourlyCommand.d.ts +5 -0
- package/dist/command/BillWatchAzureEstimateHourlyCommand.js +76 -0
- package/dist/command/BillWatchAzureEstimateHourlyCommand.js.map +1 -0
- package/dist/command/BillWatchAzure_CreateForHourlyCommand.d.ts +5 -0
- package/dist/command/BillWatchAzure_CreateForHourlyCommand.js +94 -0
- package/dist/command/BillWatchAzure_CreateForHourlyCommand.js.map +1 -0
- package/dist/command/BillWatchGCPCommand.js +4 -4
- package/dist/command/BillWatchGCPCommand.js.map +1 -1
- package/dist/command/{BillWatchAWS_CreateForCommand.d.ts → BillWatchGCPEstimateHourlyCommand.d.ts} +1 -1
- package/dist/command/{BillWatchGCPEstimationCommand.js → BillWatchGCPEstimateHourlyCommand.js} +15 -15
- package/dist/command/BillWatchGCPEstimateHourlyCommand.js.map +1 -0
- package/dist/command/BillWatchGCP_CreateForHourlyCommand.d.ts +5 -0
- package/dist/command/{BillWatchAzure_CreateForCommand.js → BillWatchGCP_CreateForHourlyCommand.js} +14 -14
- package/dist/command/BillWatchGCP_CreateForHourlyCommand.js.map +1 -0
- package/dist/command/FieldCategoryCommand.js +4 -4
- package/dist/command/FieldCategoryCommand.js.map +1 -1
- package/dist/command/FieldCategoryEstimateHourlyCommand.d.ts +5 -0
- package/dist/command/FieldCategoryEstimateHourlyCommand.js +76 -0
- package/dist/command/FieldCategoryEstimateHourlyCommand.js.map +1 -0
- package/dist/command/FieldCategory_CreateForHourlyCommand.d.ts +5 -0
- package/dist/command/FieldCategory_CreateForHourlyCommand.js +94 -0
- package/dist/command/FieldCategory_CreateForHourlyCommand.js.map +1 -0
- package/dist/command/FieldFieldCommand.js +4 -4
- package/dist/command/FieldFieldCommand.js.map +1 -1
- package/dist/command/{BillWatchAzureEstimationCommand.d.ts → FieldFieldEstimateHourlyCommand.d.ts} +1 -1
- package/dist/command/{BillWatchAzureEstimationCommand.js → FieldFieldEstimateHourlyCommand.js} +15 -15
- package/dist/command/{BillWatchAzureEstimationCommand.js.map → FieldFieldEstimateHourlyCommand.js.map} +1 -1
- package/dist/command/FieldField_CreateForHourlyCommand.d.ts +5 -0
- package/dist/command/{BillWatchAWS_CreateForCommand.js → FieldField_CreateForHourlyCommand.js} +14 -14
- package/dist/command/FieldField_CreateForHourlyCommand.js.map +1 -0
- package/dist/command/SecretSecretCommand.d.ts +4 -0
- package/dist/command/SecretSecretCommand.js +21 -0
- package/dist/command/SecretSecretCommand.js.map +1 -0
- package/dist/command/SecretSecretEstimateHourlyCommand.d.ts +5 -0
- package/dist/command/{FieldCategoryEstimationCommand.js → SecretSecretEstimateHourlyCommand.js} +15 -15
- package/dist/command/SecretSecretEstimateHourlyCommand.js.map +1 -0
- package/dist/command/{BillWatchAzure_CreateForCommand.d.ts → SecretSecretEstimateReadCommand.d.ts} +1 -1
- package/dist/command/{FieldFieldEstimationCommand.js → SecretSecretEstimateReadCommand.js} +17 -17
- package/dist/command/SecretSecretEstimateReadCommand.js.map +1 -0
- package/dist/command/SecretSecret_CreateForHourlyCommand.d.ts +5 -0
- package/dist/command/{BillWatchGCP_CreateForCommand.js → SecretSecret_CreateForHourlyCommand.js} +14 -14
- package/dist/command/SecretSecret_CreateForHourlyCommand.js.map +1 -0
- package/dist/command/SecretSecret_CreateForReadCommand.d.ts +5 -0
- package/dist/command/{FieldField_CreateForCommand.js → SecretSecret_CreateForReadCommand.js} +16 -16
- package/dist/command/SecretSecret_CreateForReadCommand.js.map +1 -0
- package/dist/command/cli.js +2 -0
- package/dist/command/cli.js.map +1 -1
- package/dist/index.d.ts +16 -10
- package/dist/index.js +16 -10
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/NamirasoftCostServer.ts +4 -1
- package/src/NamirasoftCostServerBillWatchAWS.ts +6 -6
- package/src/NamirasoftCostServerBillWatchAzure.ts +6 -6
- package/src/NamirasoftCostServerBillWatchGCP.ts +6 -6
- package/src/NamirasoftCostServerFieldCategory.ts +6 -6
- package/src/NamirasoftCostServerFieldField.ts +6 -6
- package/src/NamirasoftCostServerSecretSecret.ts +61 -0
- package/src/TimeUtil.ts +20 -10
- package/src/command/BillWatchAWSCommand.ts +4 -4
- package/src/command/{FieldCategoryEstimationCommand.ts → BillWatchAWSEstimateHourlyCommand.ts} +12 -12
- package/src/command/{FieldCategory_CreateForCommand.ts → BillWatchAWS_CreateForHourlyCommand.ts} +11 -11
- package/src/command/BillWatchAzureCommand.ts +4 -4
- package/src/command/BillWatchAzureEstimateHourlyCommand.ts +83 -0
- package/src/command/BillWatchAzure_CreateForHourlyCommand.ts +101 -0
- package/src/command/BillWatchGCPCommand.ts +4 -4
- package/src/command/{BillWatchGCPEstimationCommand.ts → BillWatchGCPEstimateHourlyCommand.ts} +12 -12
- package/src/command/{BillWatchAzure_CreateForCommand.ts → BillWatchGCP_CreateForHourlyCommand.ts} +11 -11
- package/src/command/FieldCategoryCommand.ts +4 -4
- package/src/command/FieldCategoryEstimateHourlyCommand.ts +83 -0
- package/src/command/FieldCategory_CreateForHourlyCommand.ts +101 -0
- package/src/command/FieldFieldCommand.ts +4 -4
- package/src/command/{BillWatchAzureEstimationCommand.ts → FieldFieldEstimateHourlyCommand.ts} +12 -12
- package/src/command/{BillWatchGCP_CreateForCommand.ts → FieldField_CreateForHourlyCommand.ts} +11 -11
- package/src/command/SecretSecretCommand.ts +38 -0
- package/src/command/{BillWatchAWSEstimationCommand.ts → SecretSecretEstimateHourlyCommand.ts} +12 -12
- package/src/command/{FieldFieldEstimationCommand.ts → SecretSecretEstimateReadCommand.ts} +14 -14
- package/src/command/{BillWatchAWS_CreateForCommand.ts → SecretSecret_CreateForHourlyCommand.ts} +11 -11
- package/src/command/{FieldField_CreateForCommand.ts → SecretSecret_CreateForReadCommand.ts} +13 -13
- package/src/command/cli.ts +2 -0
- package/src/index.ts +16 -10
- package/dist/command/BillWatchAWSEstimationCommand.js.map +0 -1
- package/dist/command/BillWatchAWS_CreateForCommand.js.map +0 -1
- package/dist/command/BillWatchAzure_CreateForCommand.js.map +0 -1
- package/dist/command/BillWatchGCPEstimationCommand.d.ts +0 -5
- package/dist/command/BillWatchGCPEstimationCommand.js.map +0 -1
- package/dist/command/BillWatchGCP_CreateForCommand.d.ts +0 -5
- package/dist/command/BillWatchGCP_CreateForCommand.js.map +0 -1
- package/dist/command/FieldCategoryEstimationCommand.d.ts +0 -5
- package/dist/command/FieldCategoryEstimationCommand.js.map +0 -1
- package/dist/command/FieldCategory_CreateForCommand.d.ts +0 -5
- package/dist/command/FieldCategory_CreateForCommand.js.map +0 -1
- package/dist/command/FieldFieldEstimationCommand.d.ts +0 -5
- package/dist/command/FieldFieldEstimationCommand.js.map +0 -1
- package/dist/command/FieldField_CreateForCommand.d.ts +0 -5
- package/dist/command/FieldField_CreateForCommand.js.map +0 -1
package/dist/command/{FieldField_CreateForCommand.js → SecretSecret_CreateForReadCommand.js}
RENAMED
@@ -9,12 +9,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
});
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
exports.
|
12
|
+
exports.SecretSecret_CreateForReadCommand = void 0;
|
13
13
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
14
14
|
const namirasoft_core_1 = require("namirasoft-core");
|
15
15
|
const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
|
16
16
|
const namirasoft_account_1 = require("namirasoft-account");
|
17
|
-
class
|
17
|
+
class SecretSecret_CreateForReadCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
18
|
constructor(argv) {
|
19
19
|
super(argv, ["user_id"], [
|
20
20
|
{
|
@@ -26,27 +26,27 @@ class FieldField_CreateForCommand extends namirasoft_node_cli_1.BaseFinalCommand
|
|
26
26
|
defaults: [""]
|
27
27
|
},
|
28
28
|
{
|
29
|
-
name: "
|
29
|
+
name: "period",
|
30
30
|
short: "",
|
31
|
-
description: "Provides the value of '
|
31
|
+
description: "Provides the value of 'period' in body",
|
32
32
|
optional: false,
|
33
|
-
args: ["
|
33
|
+
args: ["period"],
|
34
34
|
defaults: [""]
|
35
35
|
},
|
36
36
|
{
|
37
|
-
name: "
|
37
|
+
name: "total",
|
38
38
|
short: "",
|
39
|
-
description: "Provides the value of '
|
39
|
+
description: "Provides the value of 'total' in body",
|
40
40
|
optional: false,
|
41
|
-
args: ["
|
41
|
+
args: ["total"],
|
42
42
|
defaults: [""]
|
43
43
|
},
|
44
44
|
{
|
45
|
-
name: "
|
45
|
+
name: "count",
|
46
46
|
short: "",
|
47
|
-
description: "Provides the value of '
|
47
|
+
description: "Provides the value of 'count' in body",
|
48
48
|
optional: false,
|
49
|
-
args: ["
|
49
|
+
args: ["count"],
|
50
50
|
defaults: [""]
|
51
51
|
},
|
52
52
|
{
|
@@ -77,11 +77,11 @@ class FieldField_CreateForCommand extends namirasoft_node_cli_1.BaseFinalCommand
|
|
77
77
|
manager.setValue(token, false);
|
78
78
|
let url = this.app.storage.getItem("ns-cost-server-url");
|
79
79
|
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
80
|
-
let ans = yield server.
|
80
|
+
let ans = yield server.secret_secret._CreateForRead(this.arg_values[0], {
|
81
81
|
first_entity_created_at: this.option_values.first_entity_created_at,
|
82
|
-
row_number: this.option_values.row_number,
|
83
|
-
active: this.option_values.active,
|
84
82
|
period: this.option_values.period,
|
83
|
+
total: this.option_values.total,
|
84
|
+
count: this.option_values.count,
|
85
85
|
workspace_id: this.option_values.workspace_id,
|
86
86
|
resource_id: this.option_values.resource_id
|
87
87
|
});
|
@@ -89,6 +89,6 @@ class FieldField_CreateForCommand extends namirasoft_node_cli_1.BaseFinalCommand
|
|
89
89
|
});
|
90
90
|
}
|
91
91
|
}
|
92
|
-
exports.
|
92
|
+
exports.SecretSecret_CreateForReadCommand = SecretSecret_CreateForReadCommand;
|
93
93
|
;
|
94
|
-
//# sourceMappingURL=
|
94
|
+
//# sourceMappingURL=SecretSecret_CreateForReadCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"SecretSecret_CreateForReadCommand.js","sourceRoot":"","sources":["../../src/command/SecretSecret_CreateForReadCommand.ts"],"names":[],"mappings":"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"}
|
package/dist/command/cli.js
CHANGED
@@ -12,6 +12,7 @@ const FieldCategoryCommand_1 = require("./FieldCategoryCommand");
|
|
12
12
|
const FieldFieldCommand_1 = require("./FieldFieldCommand");
|
13
13
|
const HealthzCommand_1 = require("./HealthzCommand");
|
14
14
|
const MetricsCommand_1 = require("./MetricsCommand");
|
15
|
+
const SecretSecretCommand_1 = require("./SecretSecretCommand");
|
15
16
|
const ValueCommand_1 = require("./ValueCommand");
|
16
17
|
let app = new namirasoft_node_cli_1.Application("ns-cost", new namirasoft_node_cli_1.BaseStorage(), {
|
17
18
|
"healthz": HealthzCommand_1.HealthzCommand,
|
@@ -22,6 +23,7 @@ let app = new namirasoft_node_cli_1.Application("ns-cost", new namirasoft_node_c
|
|
22
23
|
"billwatchgcp": BillWatchGCPCommand_1.BillWatchGCPCommand,
|
23
24
|
"fieldcategory": FieldCategoryCommand_1.FieldCategoryCommand,
|
24
25
|
"fieldfield": FieldFieldCommand_1.FieldFieldCommand,
|
26
|
+
"secretsecret": SecretSecretCommand_1.SecretSecretCommand,
|
25
27
|
"cost": CostCommand_1.CostCommand,
|
26
28
|
"account": namirasoft_account_1.AccountCommand,
|
27
29
|
"config": (argv) => new namirasoft_node_cli_2.ConfigCommand(argv, ["ns-cost-server-url"])
|
package/dist/command/cli.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,+DAA4D;AAC5D,mEAAgE;AAChE,+DAA4D;AAC5D,6DAAoD;AACpD,+CAA4C;AAC5C,iEAA8D;AAC9D,2DAAwD;AACxD,qDAAkD;AAClD,qDAAkD;AAClD,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,SAAS,EAAE,IAAI,iCAAW,EAAE,EAClD;IACI,SAAS,EAAE,+BAAc;IACzB,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,cAAc,EAAE,yCAAmB;IACnC,gBAAgB,EAAE,6CAAqB;IACvC,cAAc,EAAE,yCAAmB;IACnC,eAAe,EAAE,2CAAoB;IACrC,YAAY,EAAE,qCAAiB;IAC/B,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/command/cli.ts"],"names":[],"mappings":";;;AAqBA,2DAAoD;AACpD,6DAA+D;AAC/D,+DAA4D;AAC5D,mEAAgE;AAChE,+DAA4D;AAC5D,6DAAoD;AACpD,+CAA4C;AAC5C,iEAA8D;AAC9D,2DAAwD;AACxD,qDAAkD;AAClD,qDAAkD;AAClD,+DAA4D;AAC5D,iDAA8C;AAE9C,IAAI,GAAG,GAAG,IAAI,iCAAW,CAAC,SAAS,EAAE,IAAI,iCAAW,EAAE,EAClD;IACI,SAAS,EAAE,+BAAc;IACzB,SAAS,EAAE,+BAAc;IACzB,OAAO,EAAE,2BAAY;IACrB,cAAc,EAAE,yCAAmB;IACnC,gBAAgB,EAAE,6CAAqB;IACvC,cAAc,EAAE,yCAAmB;IACnC,eAAe,EAAE,2CAAoB;IACrC,YAAY,EAAE,qCAAiB;IAC/B,cAAc,EAAE,yCAAmB;IACnC,MAAM,EAAE,yBAAW;IACnB,SAAS,EAAE,mCAAc;IACzB,QAAQ,EAAE,CAAC,IAAc,EAAE,EAAE,CAAC,IAAI,mCAAa,CAAC,IAAI,EAAE,CAAC,oBAAoB,CAAC,CAAC;CAChF,CAAC,CAAC;AACP,GAAG,CAAC,GAAG,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -8,30 +8,36 @@ export * from "./NamirasoftCostServerFieldCategory";
|
|
8
8
|
export * from "./NamirasoftCostServerFieldField";
|
9
9
|
export * from "./NamirasoftCostServerHealthz";
|
10
10
|
export * from "./NamirasoftCostServerMetrics";
|
11
|
+
export * from "./NamirasoftCostServerSecretSecret";
|
11
12
|
export * from "./NamirasoftCostServerValue";
|
12
13
|
export * from "./TimeUtil";
|
13
14
|
export * from "./command/BillWatchAWSCommand";
|
14
|
-
export * from "./command/
|
15
|
-
export * from "./command/
|
15
|
+
export * from "./command/BillWatchAWSEstimateHourlyCommand";
|
16
|
+
export * from "./command/BillWatchAWS_CreateForHourlyCommand";
|
16
17
|
export * from "./command/BillWatchAzureCommand";
|
17
|
-
export * from "./command/
|
18
|
-
export * from "./command/
|
18
|
+
export * from "./command/BillWatchAzureEstimateHourlyCommand";
|
19
|
+
export * from "./command/BillWatchAzure_CreateForHourlyCommand";
|
19
20
|
export * from "./command/BillWatchGCPCommand";
|
20
|
-
export * from "./command/
|
21
|
-
export * from "./command/
|
21
|
+
export * from "./command/BillWatchGCPEstimateHourlyCommand";
|
22
|
+
export * from "./command/BillWatchGCP_CreateForHourlyCommand";
|
22
23
|
export * from "./command/CostCommand";
|
23
24
|
export * from "./command/CostListCommand";
|
24
25
|
export * from "./command/Cost_CreateForCommand";
|
25
26
|
export * from "./command/FieldCategoryCommand";
|
26
|
-
export * from "./command/
|
27
|
-
export * from "./command/
|
27
|
+
export * from "./command/FieldCategoryEstimateHourlyCommand";
|
28
|
+
export * from "./command/FieldCategory_CreateForHourlyCommand";
|
28
29
|
export * from "./command/FieldFieldCommand";
|
29
|
-
export * from "./command/
|
30
|
-
export * from "./command/
|
30
|
+
export * from "./command/FieldFieldEstimateHourlyCommand";
|
31
|
+
export * from "./command/FieldField_CreateForHourlyCommand";
|
31
32
|
export * from "./command/HealthzCommand";
|
32
33
|
export * from "./command/HealthzGetCommand";
|
33
34
|
export * from "./command/MetricsCommand";
|
34
35
|
export * from "./command/MetricsGetCommand";
|
36
|
+
export * from "./command/SecretSecretCommand";
|
37
|
+
export * from "./command/SecretSecretEstimateHourlyCommand";
|
38
|
+
export * from "./command/SecretSecretEstimateReadCommand";
|
39
|
+
export * from "./command/SecretSecret_CreateForHourlyCommand";
|
40
|
+
export * from "./command/SecretSecret_CreateForReadCommand";
|
35
41
|
export * from "./command/ValueCommand";
|
36
42
|
export * from "./command/ValueListCommand";
|
37
43
|
export * from "./enum/TrialUnit";
|
package/dist/index.js
CHANGED
@@ -24,30 +24,36 @@ __exportStar(require("./NamirasoftCostServerFieldCategory"), exports);
|
|
24
24
|
__exportStar(require("./NamirasoftCostServerFieldField"), exports);
|
25
25
|
__exportStar(require("./NamirasoftCostServerHealthz"), exports);
|
26
26
|
__exportStar(require("./NamirasoftCostServerMetrics"), exports);
|
27
|
+
__exportStar(require("./NamirasoftCostServerSecretSecret"), exports);
|
27
28
|
__exportStar(require("./NamirasoftCostServerValue"), exports);
|
28
29
|
__exportStar(require("./TimeUtil"), exports);
|
29
30
|
__exportStar(require("./command/BillWatchAWSCommand"), exports);
|
30
|
-
__exportStar(require("./command/
|
31
|
-
__exportStar(require("./command/
|
31
|
+
__exportStar(require("./command/BillWatchAWSEstimateHourlyCommand"), exports);
|
32
|
+
__exportStar(require("./command/BillWatchAWS_CreateForHourlyCommand"), exports);
|
32
33
|
__exportStar(require("./command/BillWatchAzureCommand"), exports);
|
33
|
-
__exportStar(require("./command/
|
34
|
-
__exportStar(require("./command/
|
34
|
+
__exportStar(require("./command/BillWatchAzureEstimateHourlyCommand"), exports);
|
35
|
+
__exportStar(require("./command/BillWatchAzure_CreateForHourlyCommand"), exports);
|
35
36
|
__exportStar(require("./command/BillWatchGCPCommand"), exports);
|
36
|
-
__exportStar(require("./command/
|
37
|
-
__exportStar(require("./command/
|
37
|
+
__exportStar(require("./command/BillWatchGCPEstimateHourlyCommand"), exports);
|
38
|
+
__exportStar(require("./command/BillWatchGCP_CreateForHourlyCommand"), exports);
|
38
39
|
__exportStar(require("./command/CostCommand"), exports);
|
39
40
|
__exportStar(require("./command/CostListCommand"), exports);
|
40
41
|
__exportStar(require("./command/Cost_CreateForCommand"), exports);
|
41
42
|
__exportStar(require("./command/FieldCategoryCommand"), exports);
|
42
|
-
__exportStar(require("./command/
|
43
|
-
__exportStar(require("./command/
|
43
|
+
__exportStar(require("./command/FieldCategoryEstimateHourlyCommand"), exports);
|
44
|
+
__exportStar(require("./command/FieldCategory_CreateForHourlyCommand"), exports);
|
44
45
|
__exportStar(require("./command/FieldFieldCommand"), exports);
|
45
|
-
__exportStar(require("./command/
|
46
|
-
__exportStar(require("./command/
|
46
|
+
__exportStar(require("./command/FieldFieldEstimateHourlyCommand"), exports);
|
47
|
+
__exportStar(require("./command/FieldField_CreateForHourlyCommand"), exports);
|
47
48
|
__exportStar(require("./command/HealthzCommand"), exports);
|
48
49
|
__exportStar(require("./command/HealthzGetCommand"), exports);
|
49
50
|
__exportStar(require("./command/MetricsCommand"), exports);
|
50
51
|
__exportStar(require("./command/MetricsGetCommand"), exports);
|
52
|
+
__exportStar(require("./command/SecretSecretCommand"), exports);
|
53
|
+
__exportStar(require("./command/SecretSecretEstimateHourlyCommand"), exports);
|
54
|
+
__exportStar(require("./command/SecretSecretEstimateReadCommand"), exports);
|
55
|
+
__exportStar(require("./command/SecretSecret_CreateForHourlyCommand"), exports);
|
56
|
+
__exportStar(require("./command/SecretSecret_CreateForReadCommand"), exports);
|
51
57
|
__exportStar(require("./command/ValueCommand"), exports);
|
52
58
|
__exportStar(require("./command/ValueListCommand"), exports);
|
53
59
|
__exportStar(require("./enum/TrialUnit"), exports);
|
package/dist/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,uEAAqD;AACrD,qEAAmD;AACnD,6DAA2C;AAC3C,sEAAoD;AACpD,mEAAiD;AACjD,gEAA8C;AAC9C,gEAA8C;AAC9C,8DAA4C;AAC5C,6CAA2B;AAC3B,gEAA8C;AAC9C,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,uEAAqD;AACrD,qEAAmD;AACnD,6DAA2C;AAC3C,sEAAoD;AACpD,mEAAiD;AACjD,gEAA8C;AAC9C,gEAA8C;AAC9C,qEAAmD;AACnD,8DAA4C;AAC5C,6CAA2B;AAC3B,gEAA8C;AAC9C,8EAA4D;AAC5D,gFAA8D;AAC9D,kEAAgD;AAChD,gFAA8D;AAC9D,kFAAgE;AAChE,gEAA8C;AAC9C,8EAA4D;AAC5D,gFAA8D;AAC9D,wDAAsC;AACtC,4DAA0C;AAC1C,kEAAgD;AAChD,iEAA+C;AAC/C,+EAA6D;AAC7D,iFAA+D;AAC/D,8DAA4C;AAC5C,4EAA0D;AAC1D,8EAA4D;AAC5D,2DAAyC;AACzC,8DAA4C;AAC5C,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C;AAC9C,8EAA4D;AAC5D,4EAA0D;AAC1D,gFAA8D;AAC9D,8EAA4D;AAC5D,yDAAuC;AACvC,6DAA2C;AAC3C,mDAAiC;AACjC,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,uDAAqC;AACrC,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B;AAC7B,uDAAqC"}
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"framework": "npm",
|
9
9
|
"application": "package",
|
10
10
|
"private": false,
|
11
|
-
"version": "1.4.
|
11
|
+
"version": "1.4.21",
|
12
12
|
"author": "Amir Abolhasani",
|
13
13
|
"license": "MIT",
|
14
14
|
"main": "./dist/index.js",
|
@@ -17,7 +17,7 @@
|
|
17
17
|
"build": ""
|
18
18
|
},
|
19
19
|
"dependencies": {
|
20
|
-
"namirasoft-core": "^1.4.
|
20
|
+
"namirasoft-core": "^1.4.80",
|
21
21
|
"namirasoft-site": "^1.4.39",
|
22
22
|
"namirasoft-node-cli": "^1.4.7",
|
23
23
|
"namirasoft-account": "^1.4.84"
|
@@ -27,6 +27,7 @@ import { NamirasoftCostServerFieldCategory } from "./NamirasoftCostServerFieldCa
|
|
27
27
|
import { NamirasoftCostServerFieldField } from "./NamirasoftCostServerFieldField";
|
28
28
|
import { NamirasoftCostServerHealthz } from "./NamirasoftCostServerHealthz";
|
29
29
|
import { NamirasoftCostServerMetrics } from "./NamirasoftCostServerMetrics";
|
30
|
+
import { NamirasoftCostServerSecretSecret } from "./NamirasoftCostServerSecretSecret";
|
30
31
|
import { NamirasoftCostServerValue } from "./NamirasoftCostServerValue";
|
31
32
|
import { TokenManager } from "namirasoft-account";
|
32
33
|
|
@@ -40,10 +41,11 @@ export class NamirasoftCostServer extends NSABaseServer
|
|
40
41
|
bill_watch_gcp: NamirasoftCostServerBillWatchGCP;
|
41
42
|
field_category: NamirasoftCostServerFieldCategory;
|
42
43
|
field_field: NamirasoftCostServerFieldField;
|
44
|
+
secret_secret: NamirasoftCostServerSecretSecret;
|
43
45
|
cost: NamirasoftCostServerCost;
|
44
46
|
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
45
47
|
{
|
46
|
-
super(base_url, `1.4.
|
48
|
+
super(base_url, `1.4.21`, manager, onError);
|
47
49
|
this.healthz = new NamirasoftCostServerHealthz(this);
|
48
50
|
this.metrics = new NamirasoftCostServerMetrics(this);
|
49
51
|
this.value = new NamirasoftCostServerValue(this);
|
@@ -52,6 +54,7 @@ export class NamirasoftCostServer extends NSABaseServer
|
|
52
54
|
this.bill_watch_gcp = new NamirasoftCostServerBillWatchGCP(this);
|
53
55
|
this.field_category = new NamirasoftCostServerFieldCategory(this);
|
54
56
|
this.field_field = new NamirasoftCostServerFieldField(this);
|
57
|
+
this.secret_secret = new NamirasoftCostServerSecretSecret(this);
|
55
58
|
this.cost = new NamirasoftCostServerCost(this);
|
56
59
|
}
|
57
60
|
};
|
@@ -29,18 +29,18 @@ export class NamirasoftCostServerBillWatchAWS extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateHourly = this.EstimateHourly.bind(this);
|
33
|
+
this._CreateForHourly = this._CreateForHourly.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
|
-
let path = `/estimation/bill-watch/aws`;
|
37
|
+
let path = `/estimation/bill-watch/aws/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
|
-
let path = `/application/user/${user_id}/cost/bill-watch/aws`;
|
43
|
+
let path = `/application/user/${user_id}/cost/bill-watch/aws/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
45
45
|
return data;
|
46
46
|
}
|
@@ -29,18 +29,18 @@ export class NamirasoftCostServerBillWatchAzure extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateHourly = this.EstimateHourly.bind(this);
|
33
|
+
this._CreateForHourly = this._CreateForHourly.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
|
-
let path = `/estimation/bill-watch/azure`;
|
37
|
+
let path = `/estimation/bill-watch/azure/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
|
-
let path = `/application/user/${user_id}/cost/bill-watch/azure`;
|
43
|
+
let path = `/application/user/${user_id}/cost/bill-watch/azure/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
45
45
|
return data;
|
46
46
|
}
|
@@ -29,18 +29,18 @@ export class NamirasoftCostServerBillWatchGCP extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateHourly = this.EstimateHourly.bind(this);
|
33
|
+
this._CreateForHourly = this._CreateForHourly.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
|
-
let path = `/estimation/bill-watch/gcp`;
|
37
|
+
let path = `/estimation/bill-watch/gcp/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
|
-
let path = `/application/user/${user_id}/cost/bill-watch/gcp`;
|
43
|
+
let path = `/application/user/${user_id}/cost/bill-watch/gcp/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
45
45
|
return data;
|
46
46
|
}
|
@@ -29,18 +29,18 @@ export class NamirasoftCostServerFieldCategory extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateHourly = this.EstimateHourly.bind(this);
|
33
|
+
this._CreateForHourly = this._CreateForHourly.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
|
-
let path = `/estimation/field/category`;
|
37
|
+
let path = `/estimation/field/category/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
|
-
let path = `/application/user/${user_id}/cost/field/category`;
|
43
|
+
let path = `/application/user/${user_id}/cost/field/category/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
45
45
|
return data;
|
46
46
|
}
|
@@ -29,18 +29,18 @@ export class NamirasoftCostServerFieldField extends NamirasoftCostServerBase
|
|
29
29
|
constructor(server: NamirasoftCostServer)
|
30
30
|
{
|
31
31
|
super(server);
|
32
|
-
this.
|
33
|
-
this.
|
32
|
+
this.EstimateHourly = this.EstimateHourly.bind(this);
|
33
|
+
this._CreateForHourly = this._CreateForHourly.bind(this);
|
34
34
|
}
|
35
|
-
async
|
35
|
+
async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
36
36
|
{
|
37
|
-
let path = `/estimation/field/field`;
|
37
|
+
let path = `/estimation/field/field/hourly`;
|
38
38
|
let { data } = await this.server._post<Estimation>(path, {}, body);
|
39
39
|
return data;
|
40
40
|
}
|
41
|
-
async
|
41
|
+
async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
42
42
|
{
|
43
|
-
let path = `/application/user/${user_id}/cost/field/field`;
|
43
|
+
let path = `/application/user/${user_id}/cost/field/field/hourly`;
|
44
44
|
let { data } = await this.server._post<CostRow>(path, {}, body);
|
45
45
|
return data;
|
46
46
|
}
|
@@ -0,0 +1,61 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { CostRow } from "./row/CostRow";
|
22
|
+
import { Estimation } from "./type/Estimation";
|
23
|
+
import { NamirasoftCostServer } from "./NamirasoftCostServer";
|
24
|
+
import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
|
25
|
+
import { Period } from "./type/Period";
|
26
|
+
|
27
|
+
export class NamirasoftCostServerSecretSecret extends NamirasoftCostServerBase
|
28
|
+
{
|
29
|
+
constructor(server: NamirasoftCostServer)
|
30
|
+
{
|
31
|
+
super(server);
|
32
|
+
this.EstimateHourly = this.EstimateHourly.bind(this);
|
33
|
+
this._CreateForHourly = this._CreateForHourly.bind(this);
|
34
|
+
this.EstimateRead = this.EstimateRead.bind(this);
|
35
|
+
this._CreateForRead = this._CreateForRead.bind(this);
|
36
|
+
}
|
37
|
+
async EstimateHourly(body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean }): Promise<Estimation>
|
38
|
+
{
|
39
|
+
let path = `/estimation/secret/secret/hourly`;
|
40
|
+
let { data } = await this.server._post<Estimation>(path, {}, body);
|
41
|
+
return data;
|
42
|
+
}
|
43
|
+
async _CreateForHourly(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, row_number: number, active: boolean, workspace_id: string, resource_id: string }): Promise<CostRow>
|
44
|
+
{
|
45
|
+
let path = `/application/user/${user_id}/cost/secret/secret/hourly`;
|
46
|
+
let { data } = await this.server._post<CostRow>(path, {}, body);
|
47
|
+
return data;
|
48
|
+
}
|
49
|
+
async EstimateRead(body: { first_entity_created_at: (Date | null), period: Period, total: number, count: number }): Promise<Estimation>
|
50
|
+
{
|
51
|
+
let path = `/estimation/secret/secret/read`;
|
52
|
+
let { data } = await this.server._post<Estimation>(path, {}, body);
|
53
|
+
return data;
|
54
|
+
}
|
55
|
+
async _CreateForRead(user_id: string, body: { first_entity_created_at: (Date | null), period: Period, total: number, count: number, workspace_id: string, resource_id: string }): Promise<CostRow>
|
56
|
+
{
|
57
|
+
let path = `/application/user/${user_id}/cost/secret/secret/read`;
|
58
|
+
let { data } = await this.server._post<CostRow>(path, {}, body);
|
59
|
+
return data;
|
60
|
+
}
|
61
|
+
};
|
package/src/TimeUtil.ts
CHANGED
@@ -17,6 +17,13 @@ export class TimeUtil
|
|
17
17
|
if (period.end <= period.start)
|
18
18
|
return;
|
19
19
|
|
20
|
+
let pre_estimate_hour = async (period: Period, trial: boolean) =>
|
21
|
+
{
|
22
|
+
if (period.end <= period.start)
|
23
|
+
return;
|
24
|
+
return await estimate_hour(period, trial);
|
25
|
+
}
|
26
|
+
|
20
27
|
let trial_ends_at: Date | null = null;
|
21
28
|
if (trial)
|
22
29
|
trial_ends_at = TimeUtil.trialEndsAt(trial);
|
@@ -31,25 +38,28 @@ export class TimeUtil
|
|
31
38
|
next_start.setSeconds(0);
|
32
39
|
next_start.setMinutes(0);
|
33
40
|
if (period.end < next_start)
|
41
|
+
{
|
34
42
|
next_start = period.end;
|
35
|
-
|
43
|
+
end = period.end;
|
44
|
+
}
|
45
|
+
else
|
46
|
+
end = TimeOperation.secondsAgo(1, next_start);
|
36
47
|
if (trial_ends_at)
|
37
48
|
{
|
38
|
-
if (trial_ends_at <
|
39
|
-
await
|
40
|
-
else if (trial_ends_at <=
|
49
|
+
if (trial_ends_at < start)
|
50
|
+
await pre_estimate_hour({ start, end }, false);
|
51
|
+
else if (trial_ends_at <= end)
|
41
52
|
{
|
42
53
|
let trial_ends_at_e = TimeOperation.secondsAgo(1, trial_ends_at);
|
43
54
|
let trial_ends_at_s = trial_ends_at;
|
44
|
-
|
45
|
-
|
46
|
-
await estimate_hour({ start: trial_ends_at_s, end }, false);
|
55
|
+
await pre_estimate_hour({ start, end: trial_ends_at_e }, true);
|
56
|
+
await pre_estimate_hour({ start: trial_ends_at_s, end }, false);
|
47
57
|
}
|
48
|
-
else if (
|
49
|
-
await
|
58
|
+
else if (end < trial_ends_at)
|
59
|
+
await pre_estimate_hour({ start: period.start, end }, true);
|
50
60
|
}
|
51
61
|
else
|
52
|
-
await
|
62
|
+
await pre_estimate_hour({ start, end }, false);
|
53
63
|
start = next_start;
|
54
64
|
}
|
55
65
|
while (end < period.end)
|
@@ -19,16 +19,16 @@
|
|
19
19
|
/****************************************************************/
|
20
20
|
|
21
21
|
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
22
|
-
import {
|
23
|
-
import {
|
22
|
+
import { BillWatchAWSEstimateHourlyCommand } from "./BillWatchAWSEstimateHourlyCommand";
|
23
|
+
import { BillWatchAWS_CreateForHourlyCommand } from "./BillWatchAWS_CreateForHourlyCommand";
|
24
24
|
|
25
25
|
export class BillWatchAWSCommand extends BaseNavigatorCommand
|
26
26
|
{
|
27
27
|
constructor(argv: string[])
|
28
28
|
{
|
29
29
|
super(argv, {
|
30
|
-
"
|
31
|
-
"
|
30
|
+
"estimatehourly": BillWatchAWSEstimateHourlyCommand,
|
31
|
+
"_createforhourly": BillWatchAWS_CreateForHourlyCommand,
|
32
32
|
});
|
33
33
|
}
|
34
34
|
};
|
package/src/command/{FieldCategoryEstimationCommand.ts → BillWatchAWSEstimateHourlyCommand.ts}
RENAMED
@@ -23,7 +23,7 @@ import { IStorageMemoryDedicated } from "namirasoft-core";
|
|
23
23
|
import { NamirasoftCostServer } from "../NamirasoftCostServer";
|
24
24
|
import { TokenManager } from "namirasoft-account";
|
25
25
|
|
26
|
-
export class
|
26
|
+
export class BillWatchAWSEstimateHourlyCommand extends BaseFinalCommand
|
27
27
|
{
|
28
28
|
constructor(argv: string[])
|
29
29
|
{
|
@@ -36,6 +36,14 @@ export class FieldCategoryEstimationCommand extends BaseFinalCommand
|
|
36
36
|
args: ["first_entity_created_at"],
|
37
37
|
defaults: [""]
|
38
38
|
},
|
39
|
+
{
|
40
|
+
name: "period",
|
41
|
+
short: "",
|
42
|
+
description: "Provides the value of 'period' in body",
|
43
|
+
optional: false,
|
44
|
+
args: ["period"],
|
45
|
+
defaults: [""]
|
46
|
+
},
|
39
47
|
{
|
40
48
|
name: "row_number",
|
41
49
|
short: "",
|
@@ -51,14 +59,6 @@ export class FieldCategoryEstimationCommand extends BaseFinalCommand
|
|
51
59
|
optional: false,
|
52
60
|
args: ["active"],
|
53
61
|
defaults: [""]
|
54
|
-
},
|
55
|
-
{
|
56
|
-
name: "period",
|
57
|
-
short: "",
|
58
|
-
description: "Provides the value of 'period' in body",
|
59
|
-
optional: false,
|
60
|
-
args: ["period"],
|
61
|
-
defaults: [""]
|
62
62
|
}
|
63
63
|
]);
|
64
64
|
}
|
@@ -72,11 +72,11 @@ export class FieldCategoryEstimationCommand extends BaseFinalCommand
|
|
72
72
|
manager.setValue(token, false);
|
73
73
|
let url = this.app.storage.getItem("ns-cost-server-url");
|
74
74
|
let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
75
|
-
let ans = await server.
|
75
|
+
let ans = await server.bill_watch_aws.EstimateHourly({
|
76
76
|
first_entity_created_at: this.option_values.first_entity_created_at,
|
77
|
+
period: this.option_values.period,
|
77
78
|
row_number: this.option_values.row_number,
|
78
|
-
active: this.option_values.active
|
79
|
-
period: this.option_values.period
|
79
|
+
active: this.option_values.active
|
80
80
|
});
|
81
81
|
this.app.logger.success(JSON.stringify(ans));
|
82
82
|
}
|