namirasoft-cost 1.4.20 → 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 +3 -2
- package/.ns-sdkg-file-keep +21 -5
- 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/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/command/BillWatchAWSCommand.js +4 -4
- package/dist/command/BillWatchAWSCommand.js.map +1 -1
- package/dist/command/{BillWatchAWS_CreateForCommand.d.ts → BillWatchAWSEstimateHourlyCommand.d.ts} +1 -1
- package/dist/command/{BillWatchGCPEstimationCommand.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/{BillWatchAWS_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/{BillWatchAWSEstimationCommand.d.ts → BillWatchGCPEstimateHourlyCommand.d.ts} +1 -1
- package/dist/command/{FieldCategoryEstimationCommand.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/{FieldCategory_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/{BillWatchAzure_CreateForCommand.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/{BillWatchGCP_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/{BillWatchAWSEstimationCommand.js → SecretSecretEstimateHourlyCommand.js} +15 -15
- package/dist/command/SecretSecretEstimateHourlyCommand.js.map +1 -0
- package/dist/command/{BillWatchAzureEstimationCommand.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/{BillWatchAzure_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/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 +16 -15
- package/dist/index.js +16 -15
- 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 +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/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 +4 -4
- package/src/command/{FieldCategoryEstimationCommand.ts → BillWatchAWSEstimateHourlyCommand.ts} +12 -12
- package/src/command/{BillWatchAzure_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/{FieldCategory_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/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 +17 -16
- package/src/type/Estimation.ts +10 -3
- package/src/type/EstimationOption.ts +12 -0
- package/src/type/Period.ts +72 -3
- 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/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/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
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.FreeTotalValueBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class FreeTotalValueBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(value) {
|
16
|
+
super("Free Total Value");
|
17
|
+
this.value = value;
|
18
|
+
}
|
19
|
+
isFree(option, _) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
let exceeded = option.total_value - this.value;
|
22
|
+
if (exceeded > 0) {
|
23
|
+
let value_free = Math.max(option.value - exceeded, 0);
|
24
|
+
let value_paid = option.value - value_free;
|
25
|
+
if (value_free > 0 && value_paid > 0) {
|
26
|
+
let free = Object.assign(Object.assign({}, option), { total_value: this.value, value: value_free });
|
27
|
+
let paid = Object.assign(Object.assign({}, option), { value: value_paid });
|
28
|
+
return { free: true, split: { free, paids: [paid] } };
|
29
|
+
}
|
30
|
+
else if (value_paid > 0)
|
31
|
+
return { free: false };
|
32
|
+
}
|
33
|
+
return { free: true };
|
34
|
+
});
|
35
|
+
}
|
36
|
+
}
|
37
|
+
exports.FreeTotalValueBonus = FreeTotalValueBonus;
|
38
|
+
;
|
39
|
+
//# sourceMappingURL=FreeTotalValueBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FreeTotalValueBonus.js","sourceRoot":"","sources":["../../src/bonus/FreeTotalValueBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,mBAAoB,SAAQ,qBAAS;IAE9C,YAAmB,KAAa;QAE5B,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAFX,UAAK,GAAL,KAAK,CAAQ;IAGhC,CAAC;IACK,MAAM,CAAC,MAAwB,EAAE,CAAa;;YAEhD,IAAI,QAAQ,GAAG,MAAM,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC;YAC/C,IAAI,QAAQ,GAAG,CAAC,EAChB,CAAC;gBACG,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,GAAG,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACtD,IAAI,UAAU,GAAG,MAAM,CAAC,KAAK,GAAG,UAAU,CAAC;gBAC3C,IAAI,UAAU,GAAG,CAAC,IAAI,UAAU,GAAG,CAAC,EACpC,CAAC;oBACG,IAAI,IAAI,mCAAQ,MAAM,KAAE,WAAW,EAAE,IAAI,CAAC,KAAK,EAAE,KAAK,EAAE,UAAU,GAAE,CAAC;oBACrE,IAAI,IAAI,mCAAQ,MAAM,KAAE,KAAK,EAAE,UAAU,GAAE,CAAC;oBAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;gBAC1D,CAAC;qBACI,IAAI,UAAU,GAAG,CAAC;oBACnB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;YAC/B,CAAC;YACD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;QAC1B,CAAC;KAAA;CACJ;AAxBD,kDAwBC;AAAA,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Estimation } from "../type/Estimation";
|
2
|
+
import { EstimationOption } from "../type/EstimationOption";
|
3
|
+
import { BaseBonus } from "./BaseBonus";
|
4
|
+
export declare class LowAmountBonus extends BaseBonus {
|
5
|
+
amount: number;
|
6
|
+
constructor(amount: number);
|
7
|
+
isFree(_: EstimationOption, estimation: Estimation): Promise<{
|
8
|
+
free: boolean;
|
9
|
+
}>;
|
10
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.LowAmountBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class LowAmountBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(amount) {
|
16
|
+
super("Low Amount");
|
17
|
+
this.amount = amount;
|
18
|
+
}
|
19
|
+
isFree(_, estimation) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
return { free: estimation.amount <= this.amount };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.LowAmountBonus = LowAmountBonus;
|
26
|
+
;
|
27
|
+
//# sourceMappingURL=LowAmountBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LowAmountBonus.js","sourceRoot":"","sources":["../../src/bonus/LowAmountBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,cAAe,SAAQ,qBAAS;IAEzC,YAAmB,MAAc;QAE7B,KAAK,CAAC,YAAY,CAAC,CAAC;QAFL,WAAM,GAAN,MAAM,CAAQ;IAGjC,CAAC;IACK,MAAM,CAAC,CAAmB,EAAE,UAAsB;;YAEpD,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QACtD,CAAC;KAAA;CACJ;AAVD,wCAUC;AAAA,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Estimation } from "../type/Estimation";
|
2
|
+
import { EstimationOption } from "../type/EstimationOption";
|
3
|
+
import { BaseBonus } from "./BaseBonus";
|
4
|
+
export declare class LowSecondsBonus extends BaseBonus {
|
5
|
+
seconds: number;
|
6
|
+
constructor(seconds: number);
|
7
|
+
isFree(_: EstimationOption, estimation: Estimation): Promise<{
|
8
|
+
free: boolean;
|
9
|
+
}>;
|
10
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.LowSecondsBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class LowSecondsBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(seconds) {
|
16
|
+
super("Low Seconds");
|
17
|
+
this.seconds = seconds;
|
18
|
+
}
|
19
|
+
isFree(_, estimation) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
return { free: estimation.seconds <= this.seconds };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.LowSecondsBonus = LowSecondsBonus;
|
26
|
+
;
|
27
|
+
//# sourceMappingURL=LowSecondsBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LowSecondsBonus.js","sourceRoot":"","sources":["../../src/bonus/LowSecondsBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,eAAgB,SAAQ,qBAAS;IAE1C,YAAmB,OAAe;QAE9B,KAAK,CAAC,aAAa,CAAC,CAAC;QAFN,YAAO,GAAP,OAAO,CAAQ;IAGlC,CAAC;IACK,MAAM,CAAC,CAAmB,EAAE,UAAsB;;YAEpD,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACxD,CAAC;KAAA;CACJ;AAVD,0CAUC;AAAA,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Estimation } from "../type/Estimation";
|
2
|
+
import { EstimationOption } from "../type/EstimationOption";
|
3
|
+
import { BaseBonus } from "./BaseBonus";
|
4
|
+
export declare class LowTotalCountBonus extends BaseBonus {
|
5
|
+
count: number;
|
6
|
+
constructor(count: number);
|
7
|
+
isFree(option: EstimationOption, _: Estimation): Promise<{
|
8
|
+
free: boolean;
|
9
|
+
}>;
|
10
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.LowTotalCountBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class LowTotalCountBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(count) {
|
16
|
+
super("Low Total Count");
|
17
|
+
this.count = count;
|
18
|
+
}
|
19
|
+
isFree(option, _) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
return { free: option.total_count <= this.count };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.LowTotalCountBonus = LowTotalCountBonus;
|
26
|
+
;
|
27
|
+
//# sourceMappingURL=LowTotalCountBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LowTotalCountBonus.js","sourceRoot":"","sources":["../../src/bonus/LowTotalCountBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,kBAAmB,SAAQ,qBAAS;IAE7C,YAAmB,KAAa;QAE5B,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAFV,UAAK,GAAL,KAAK,CAAQ;IAGhC,CAAC;IACK,MAAM,CAAC,MAAwB,EAAE,CAAa;;YAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACtD,CAAC;KAAA;CACJ;AAVD,gDAUC;AAAA,CAAC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { Estimation } from "../type/Estimation";
|
2
|
+
import { EstimationOption } from "../type/EstimationOption";
|
3
|
+
import { BaseBonus } from "./BaseBonus";
|
4
|
+
export declare class LowTotalValueBonus extends BaseBonus {
|
5
|
+
value: number;
|
6
|
+
constructor(value: number);
|
7
|
+
isFree(option: EstimationOption, _: Estimation): Promise<{
|
8
|
+
free: boolean;
|
9
|
+
}>;
|
10
|
+
}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.LowTotalValueBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class LowTotalValueBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(value) {
|
16
|
+
super("Low Total Value");
|
17
|
+
this.value = value;
|
18
|
+
}
|
19
|
+
isFree(option, _) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
return { free: option.total_value <= this.value };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.LowTotalValueBonus = LowTotalValueBonus;
|
26
|
+
;
|
27
|
+
//# sourceMappingURL=LowTotalValueBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"LowTotalValueBonus.js","sourceRoot":"","sources":["../../src/bonus/LowTotalValueBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,kBAAmB,SAAQ,qBAAS;IAE7C,YAAmB,KAAa;QAE5B,KAAK,CAAC,iBAAiB,CAAC,CAAC;QAFV,UAAK,GAAL,KAAK,CAAQ;IAGhC,CAAC;IACK,MAAM,CAAC,MAAwB,EAAE,CAAa;;YAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACtD,CAAC;KAAA;CACJ;AAVD,gDAUC;AAAA,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { DurationUnit } from "namirasoft-core";
|
2
|
+
import { Estimation } from "../type/Estimation";
|
3
|
+
import { EstimationOption } from "../type/EstimationOption";
|
4
|
+
import { BaseBonus } from "./BaseBonus";
|
5
|
+
export declare class TrialBonus extends BaseBonus {
|
6
|
+
value: number;
|
7
|
+
unit: DurationUnit;
|
8
|
+
constructor(value: number, unit: DurationUnit);
|
9
|
+
isFree(option: EstimationOption, _: Estimation): Promise<{
|
10
|
+
free: boolean;
|
11
|
+
}>;
|
12
|
+
}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.TrialBonus = void 0;
|
13
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
14
|
+
const Period_1 = require("../type/Period");
|
15
|
+
const BaseBonus_1 = require("./BaseBonus");
|
16
|
+
class TrialBonus extends BaseBonus_1.BaseBonus {
|
17
|
+
constructor(value, unit) {
|
18
|
+
super("Trial");
|
19
|
+
this.value = value;
|
20
|
+
this.unit = unit;
|
21
|
+
}
|
22
|
+
isFree(option, _) {
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
24
|
+
let { start } = Period_1.PeriodUtil.toDates(option.period);
|
25
|
+
let trial_ends_at = namirasoft_core_1.TimeUnitOperation.later(this.value, this.unit, option.trial_started_at);
|
26
|
+
return { free: start <= trial_ends_at };
|
27
|
+
});
|
28
|
+
}
|
29
|
+
}
|
30
|
+
exports.TrialBonus = TrialBonus;
|
31
|
+
;
|
32
|
+
//# sourceMappingURL=TrialBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"TrialBonus.js","sourceRoot":"","sources":["../../src/bonus/TrialBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAkE;AAGlE,2CAA4C;AAC5C,2CAAwC;AAExC,MAAa,UAAW,SAAQ,qBAAS;IAErC,YAAmB,KAAa,EAAS,IAAkB;QAEvD,KAAK,CAAC,OAAO,CAAC,CAAC;QAFA,UAAK,GAAL,KAAK,CAAQ;QAAS,SAAI,GAAJ,IAAI,CAAc;IAG3D,CAAC;IACK,MAAM,CAAC,MAAwB,EAAE,CAAa;;YAEhD,IAAI,EAAE,KAAK,EAAE,GAAG,mBAAU,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,aAAa,GAAG,mCAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,gBAAgB,CAAC,CAAA;YAC3F,OAAO,EAAE,IAAI,EAAE,KAAK,IAAI,aAAa,EAAE,CAAC;QAC5C,CAAC;KAAA;CACJ;AAZD,gCAYC;AAAA,CAAC"}
|
@@ -2,13 +2,13 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.BillWatchAWSCommand = void 0;
|
4
4
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
5
|
-
const
|
6
|
-
const
|
5
|
+
const BillWatchAWSEstimateHourlyCommand_1 = require("./BillWatchAWSEstimateHourlyCommand");
|
6
|
+
const BillWatchAWS_CreateForHourlyCommand_1 = require("./BillWatchAWS_CreateForHourlyCommand");
|
7
7
|
class BillWatchAWSCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
8
8
|
constructor(argv) {
|
9
9
|
super(argv, {
|
10
|
-
"
|
11
|
-
"
|
10
|
+
"estimatehourly": BillWatchAWSEstimateHourlyCommand_1.BillWatchAWSEstimateHourlyCommand,
|
11
|
+
"_createforhourly": BillWatchAWS_CreateForHourlyCommand_1.BillWatchAWS_CreateForHourlyCommand,
|
12
12
|
});
|
13
13
|
}
|
14
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BillWatchAWSCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,
|
1
|
+
{"version":3,"file":"BillWatchAWSCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,2FAAwF;AACxF,+FAA4F;AAE5F,MAAa,mBAAoB,SAAQ,0CAAoB;IAEzD,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,gBAAgB,EAAE,qEAAiC;YACnD,kBAAkB,EAAE,yEAAmC;SAC1D,CAAC,CAAC;IACP,CAAC;CACJ;AATD,kDASC;AAAA,CAAC"}
|
package/dist/command/{BillWatchAWS_CreateForCommand.d.ts → BillWatchAWSEstimateHourlyCommand.d.ts}
RENAMED
@@ -1,5 +1,5 @@
|
|
1
1
|
import { BaseFinalCommand } from "namirasoft-node-cli";
|
2
|
-
export declare class
|
2
|
+
export declare class BillWatchAWSEstimateHourlyCommand extends BaseFinalCommand {
|
3
3
|
constructor(argv: string[]);
|
4
4
|
exec(): Promise<void>;
|
5
5
|
}
|
package/dist/command/{BillWatchGCPEstimationCommand.js → BillWatchAWSEstimateHourlyCommand.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.BillWatchAWSEstimateHourlyCommand = 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 BillWatchAWSEstimateHourlyCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
18
|
constructor(argv) {
|
19
19
|
super(argv, [], [
|
20
20
|
{
|
@@ -25,6 +25,14 @@ class BillWatchGCPEstimationCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
25
25
|
args: ["first_entity_created_at"],
|
26
26
|
defaults: [""]
|
27
27
|
},
|
28
|
+
{
|
29
|
+
name: "period",
|
30
|
+
short: "",
|
31
|
+
description: "Provides the value of 'period' in body",
|
32
|
+
optional: false,
|
33
|
+
args: ["period"],
|
34
|
+
defaults: [""]
|
35
|
+
},
|
28
36
|
{
|
29
37
|
name: "row_number",
|
30
38
|
short: "",
|
@@ -40,14 +48,6 @@ class BillWatchGCPEstimationCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
40
48
|
optional: false,
|
41
49
|
args: ["active"],
|
42
50
|
defaults: [""]
|
43
|
-
},
|
44
|
-
{
|
45
|
-
name: "period",
|
46
|
-
short: "",
|
47
|
-
description: "Provides the value of 'period' in body",
|
48
|
-
optional: false,
|
49
|
-
args: ["period"],
|
50
|
-
defaults: [""]
|
51
51
|
}
|
52
52
|
]);
|
53
53
|
}
|
@@ -61,16 +61,16 @@ class BillWatchGCPEstimationCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
61
61
|
manager.setValue(token, false);
|
62
62
|
let url = this.app.storage.getItem("ns-cost-server-url");
|
63
63
|
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
64
|
-
let ans = yield server.
|
64
|
+
let ans = yield server.bill_watch_aws.EstimateHourly({
|
65
65
|
first_entity_created_at: this.option_values.first_entity_created_at,
|
66
|
+
period: this.option_values.period,
|
66
67
|
row_number: this.option_values.row_number,
|
67
|
-
active: this.option_values.active
|
68
|
-
period: this.option_values.period
|
68
|
+
active: this.option_values.active
|
69
69
|
});
|
70
70
|
this.app.logger.success(JSON.stringify(ans));
|
71
71
|
});
|
72
72
|
}
|
73
73
|
}
|
74
|
-
exports.
|
74
|
+
exports.BillWatchAWSEstimateHourlyCommand = BillWatchAWSEstimateHourlyCommand;
|
75
75
|
;
|
76
|
-
//# sourceMappingURL=
|
76
|
+
//# sourceMappingURL=BillWatchAWSEstimateHourlyCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchAWSEstimateHourlyCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWSEstimateHourlyCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,iCAAkC,SAAQ,sCAAgB;IAEnE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,yBAAyB;gBAC/B,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,yDAAyD;gBACtE,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,yBAAyB,CAAC;gBACjC,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC/H,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YACzD,IAAI,MAAM,GAAG,IAAI,2CAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC;gBACjD,uBAAuB,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB;gBACnE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;aACpC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAzDD,8EAyDC;AAAA,CAAC"}
|
package/dist/command/{BillWatchAWS_CreateForCommand.js → BillWatchAWS_CreateForHourlyCommand.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.BillWatchAWS_CreateForHourlyCommand = 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 BillWatchAWS_CreateForHourlyCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
18
|
constructor(argv) {
|
19
19
|
super(argv, ["user_id"], [
|
20
20
|
{
|
@@ -25,6 +25,14 @@ class BillWatchAWS_CreateForCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
25
25
|
args: ["first_entity_created_at"],
|
26
26
|
defaults: [""]
|
27
27
|
},
|
28
|
+
{
|
29
|
+
name: "period",
|
30
|
+
short: "",
|
31
|
+
description: "Provides the value of 'period' in body",
|
32
|
+
optional: false,
|
33
|
+
args: ["period"],
|
34
|
+
defaults: [""]
|
35
|
+
},
|
28
36
|
{
|
29
37
|
name: "row_number",
|
30
38
|
short: "",
|
@@ -41,14 +49,6 @@ class BillWatchAWS_CreateForCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
41
49
|
args: ["active"],
|
42
50
|
defaults: [""]
|
43
51
|
},
|
44
|
-
{
|
45
|
-
name: "period",
|
46
|
-
short: "",
|
47
|
-
description: "Provides the value of 'period' in body",
|
48
|
-
optional: false,
|
49
|
-
args: ["period"],
|
50
|
-
defaults: [""]
|
51
|
-
},
|
52
52
|
{
|
53
53
|
name: "workspace_id",
|
54
54
|
short: "",
|
@@ -77,11 +77,11 @@ class BillWatchAWS_CreateForCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
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.bill_watch_aws.
|
80
|
+
let ans = yield server.bill_watch_aws._CreateForHourly(this.arg_values[0], {
|
81
81
|
first_entity_created_at: this.option_values.first_entity_created_at,
|
82
|
+
period: this.option_values.period,
|
82
83
|
row_number: this.option_values.row_number,
|
83
84
|
active: this.option_values.active,
|
84
|
-
period: this.option_values.period,
|
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 BillWatchAWS_CreateForCommand extends namirasoft_node_cli_1.BaseFinalComma
|
|
89
89
|
});
|
90
90
|
}
|
91
91
|
}
|
92
|
-
exports.
|
92
|
+
exports.BillWatchAWS_CreateForHourlyCommand = BillWatchAWS_CreateForHourlyCommand;
|
93
93
|
;
|
94
|
-
//# sourceMappingURL=
|
94
|
+
//# sourceMappingURL=BillWatchAWS_CreateForHourlyCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchAWS_CreateForHourlyCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAWS_CreateForHourlyCommand.ts"],"names":[],"mappings":"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"}
|
@@ -2,13 +2,13 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.BillWatchAzureCommand = void 0;
|
4
4
|
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
5
|
-
const
|
6
|
-
const
|
5
|
+
const BillWatchAzureEstimateHourlyCommand_1 = require("./BillWatchAzureEstimateHourlyCommand");
|
6
|
+
const BillWatchAzure_CreateForHourlyCommand_1 = require("./BillWatchAzure_CreateForHourlyCommand");
|
7
7
|
class BillWatchAzureCommand extends namirasoft_node_cli_1.BaseNavigatorCommand {
|
8
8
|
constructor(argv) {
|
9
9
|
super(argv, {
|
10
|
-
"
|
11
|
-
"
|
10
|
+
"estimatehourly": BillWatchAzureEstimateHourlyCommand_1.BillWatchAzureEstimateHourlyCommand,
|
11
|
+
"_createforhourly": BillWatchAzure_CreateForHourlyCommand_1.BillWatchAzure_CreateForHourlyCommand,
|
12
12
|
});
|
13
13
|
}
|
14
14
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BillWatchAzureCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D
|
1
|
+
{"version":3,"file":"BillWatchAzureCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureCommand.ts"],"names":[],"mappings":";;;AAoBA,6DAA2D;AAC3D,+FAA4F;AAC5F,mGAAgG;AAEhG,MAAa,qBAAsB,SAAQ,0CAAoB;IAE3D,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE;YACR,gBAAgB,EAAE,yEAAmC;YACrD,kBAAkB,EAAE,6EAAqC;SAC5D,CAAC,CAAC;IACP,CAAC;CACJ;AATD,sDASC;AAAA,CAAC"}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.BillWatchAzureEstimateHourlyCommand = void 0;
|
13
|
+
const namirasoft_node_cli_1 = require("namirasoft-node-cli");
|
14
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
15
|
+
const NamirasoftCostServer_1 = require("../NamirasoftCostServer");
|
16
|
+
const namirasoft_account_1 = require("namirasoft-account");
|
17
|
+
class BillWatchAzureEstimateHourlyCommand extends namirasoft_node_cli_1.BaseFinalCommand {
|
18
|
+
constructor(argv) {
|
19
|
+
super(argv, [], [
|
20
|
+
{
|
21
|
+
name: "first_entity_created_at",
|
22
|
+
short: "",
|
23
|
+
description: "Provides the value of 'first_entity_created_at' in body",
|
24
|
+
optional: true,
|
25
|
+
args: ["first_entity_created_at"],
|
26
|
+
defaults: [""]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
name: "period",
|
30
|
+
short: "",
|
31
|
+
description: "Provides the value of 'period' in body",
|
32
|
+
optional: false,
|
33
|
+
args: ["period"],
|
34
|
+
defaults: [""]
|
35
|
+
},
|
36
|
+
{
|
37
|
+
name: "row_number",
|
38
|
+
short: "",
|
39
|
+
description: "Provides the value of 'row_number' in body",
|
40
|
+
optional: false,
|
41
|
+
args: ["row_number"],
|
42
|
+
defaults: [""]
|
43
|
+
},
|
44
|
+
{
|
45
|
+
name: "active",
|
46
|
+
short: "",
|
47
|
+
description: "Provides the value of 'active' in body",
|
48
|
+
optional: false,
|
49
|
+
args: ["active"],
|
50
|
+
defaults: [""]
|
51
|
+
}
|
52
|
+
]);
|
53
|
+
}
|
54
|
+
exec() {
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
56
|
+
let token = this.app.storage.getNSAToken();
|
57
|
+
if (token == null)
|
58
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
59
|
+
let storage = new namirasoft_core_1.IStorageMemoryDedicated();
|
60
|
+
let manager = new namirasoft_account_1.TokenManager(storage, () => { });
|
61
|
+
manager.setValue(token, false);
|
62
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
63
|
+
let server = new NamirasoftCostServer_1.NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
64
|
+
let ans = yield server.bill_watch_azure.EstimateHourly({
|
65
|
+
first_entity_created_at: this.option_values.first_entity_created_at,
|
66
|
+
period: this.option_values.period,
|
67
|
+
row_number: this.option_values.row_number,
|
68
|
+
active: this.option_values.active
|
69
|
+
});
|
70
|
+
this.app.logger.success(JSON.stringify(ans));
|
71
|
+
});
|
72
|
+
}
|
73
|
+
}
|
74
|
+
exports.BillWatchAzureEstimateHourlyCommand = BillWatchAzureEstimateHourlyCommand;
|
75
|
+
;
|
76
|
+
//# sourceMappingURL=BillWatchAzureEstimateHourlyCommand.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchAzureEstimateHourlyCommand.js","sourceRoot":"","sources":["../../src/command/BillWatchAzureEstimateHourlyCommand.ts"],"names":[],"mappings":";;;;;;;;;;;;AAoBA,6DAAuD;AACvD,qDAA0D;AAC1D,kEAA+D;AAC/D,2DAAkD;AAElD,MAAa,mCAAoC,SAAQ,sCAAgB;IAErE,YAAY,IAAc;QAEtB,KAAK,CAAC,IAAI,EAAE,EAAE,EAAE;YACZ;gBACI,IAAI,EAAE,yBAAyB;gBAC/B,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,yDAAyD;gBACtE,QAAQ,EAAE,IAAI;gBACd,IAAI,EAAE,CAAC,yBAAyB,CAAC;gBACjC,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,4CAA4C;gBACzD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,YAAY,CAAC;gBACpB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,EAAE;gBACT,WAAW,EAAE,wCAAwC;gBACrD,QAAQ,EAAE,KAAK;gBACf,IAAI,EAAE,CAAC,QAAQ,CAAC;gBAChB,QAAQ,EAAE,CAAC,EAAE,CAAC;aACjB;SACA,CAAC,CAAC;IACX,CAAC;IACc,IAAI;;YAEf,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;YAC3C,IAAI,KAAK,IAAI,IAAI;gBACb,MAAM,IAAI,KAAK,CAAC,yGAAyG,CAAC,CAAC;YAC/H,IAAI,OAAO,GAAG,IAAI,yCAAuB,EAAE,CAAC;YAC5C,IAAI,OAAO,GAAG,IAAI,iCAAY,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACnD,OAAO,CAAC,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAC/B,IAAI,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,oBAAoB,CAAC,CAAC;YACzD,IAAI,MAAM,GAAG,IAAI,2CAAoB,CAAC,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3F,IAAI,GAAG,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC,cAAc,CAAC;gBACnD,uBAAuB,EAAE,IAAI,CAAC,aAAa,CAAC,uBAAuB;gBACnE,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;gBACjC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,UAAU;gBACzC,MAAM,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;aACpC,CAAC,CAAC;YACH,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;QACjD,CAAC;KAAA;CACJ;AAzDD,kFAyDC;AAAA,CAAC"}
|