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
package/.ns-sdkg-dir-deep
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
/src
|
2
|
-
/src/
|
3
|
-
/src/
|
1
|
+
/src
|
2
|
+
/src/bonus
|
3
|
+
/src/estimator
|
4
|
+
/src/type
|
package/.ns-sdkg-file-keep
CHANGED
@@ -1,8 +1,24 @@
|
|
1
|
-
src/
|
2
|
-
src/
|
3
|
-
src/
|
4
|
-
src/
|
5
|
-
src/
|
6
|
-
src/
|
7
|
-
src/
|
8
|
-
src/
|
1
|
+
src/bonus/BaseBonus.ts
|
2
|
+
src/bonus/DeactiveBonus.ts
|
3
|
+
src/bonus/FreeCountBonus.ts
|
4
|
+
src/bonus/FreeTotalValueBonus.ts
|
5
|
+
src/bonus/LowAmountBonus.ts
|
6
|
+
src/bonus/LowSecondsBonus.ts
|
7
|
+
src/bonus/LowTotalCountBonus.ts
|
8
|
+
src/bonus/LowTotalValueBonus.ts
|
9
|
+
src/bonus/TrialBonus.ts
|
10
|
+
src/bonus/BaseEstimator.ts
|
11
|
+
src/bonus/BillWatchAWSHourlyEstimator.ts
|
12
|
+
src/bonus/BillWatchAzureHourlyEstimator.ts
|
13
|
+
src/bonus/BillWatchBaseHourlyEstimator.ts
|
14
|
+
src/bonus/BillWatchGCPHourlyEstimator.ts
|
15
|
+
src/bonus/FieldBaseHourlyEstimator.ts
|
16
|
+
src/bonus/FieldCategoryHourlyEstimator.ts
|
17
|
+
src/bonus/FieldFieldHourlyEstimator.ts
|
18
|
+
src/bonus/SecretSecretHourlyEstimator.ts
|
19
|
+
src/bonus/SecretSecretReadEstimator.ts
|
20
|
+
src/type/Estimation.ts
|
21
|
+
src/type/EstimationOption.ts
|
22
|
+
src/type/EstimationUsage.ts
|
23
|
+
src/type/Period.ts
|
24
|
+
src/type/Usage.ts
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { Estimation } from "../type/Estimation";
|
2
|
+
import { EstimationOption } from "../type/EstimationOption";
|
3
|
+
export declare abstract class BaseBonus {
|
4
|
+
name: string;
|
5
|
+
constructor(name: string);
|
6
|
+
abstract isFree(option: EstimationOption, estimation: Estimation): Promise<{
|
7
|
+
free: boolean;
|
8
|
+
split?: {
|
9
|
+
free: EstimationOption;
|
10
|
+
paids: EstimationOption[];
|
11
|
+
};
|
12
|
+
}>;
|
13
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BaseBonus.js","sourceRoot":"","sources":["../../src/bonus/BaseBonus.ts"],"names":[],"mappings":";;;AAGA,MAAsB,SAAS;IAE3B,YAAmB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;IAC7B,CAAC;CAON;AAVD,8BAUC;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 DeactiveBonus 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.DeactiveBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class DeactiveBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(count) {
|
16
|
+
super("Deactive");
|
17
|
+
this.count = count;
|
18
|
+
}
|
19
|
+
isFree(option, _) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
return { free: !option.active };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.DeactiveBonus = DeactiveBonus;
|
26
|
+
;
|
27
|
+
//# sourceMappingURL=DeactiveBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"DeactiveBonus.js","sourceRoot":"","sources":["../../src/bonus/DeactiveBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,aAAc,SAAQ,qBAAS;IAExC,YAAmB,KAAa;QAE5B,KAAK,CAAC,UAAU,CAAC,CAAC;QAFH,UAAK,GAAL,KAAK,CAAQ;IAGhC,CAAC;IACK,MAAM,CAAC,MAAwB,EAAE,CAAa;;YAEhD,OAAO,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC;QACpC,CAAC;KAAA;CACJ;AAVD,sCAUC;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 FreeCountBonus 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.FreeCountBonus = void 0;
|
13
|
+
const BaseBonus_1 = require("./BaseBonus");
|
14
|
+
class FreeCountBonus extends BaseBonus_1.BaseBonus {
|
15
|
+
constructor(count) {
|
16
|
+
super("Free Count");
|
17
|
+
this.count = count;
|
18
|
+
}
|
19
|
+
isFree(option, _) {
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
21
|
+
return { free: option.number <= this.count };
|
22
|
+
});
|
23
|
+
}
|
24
|
+
}
|
25
|
+
exports.FreeCountBonus = FreeCountBonus;
|
26
|
+
;
|
27
|
+
//# sourceMappingURL=FreeCountBonus.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FreeCountBonus.js","sourceRoot":"","sources":["../../src/bonus/FreeCountBonus.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,2CAAwC;AAExC,MAAa,cAAe,SAAQ,qBAAS;IAEzC,YAAmB,KAAa;QAE5B,KAAK,CAAC,YAAY,CAAC,CAAC;QAFL,UAAK,GAAL,KAAK,CAAQ;IAGhC,CAAC;IACK,MAAM,CAAC,MAAwB,EAAE,CAAa;;YAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;QACjD,CAAC;KAAA;CACJ;AAVD,wCAUC;AAAA,CAAC"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
import { Estimation } from "../type/Estimation";
|
2
|
+
import { EstimationOption } from "../type/EstimationOption";
|
3
|
+
import { BaseBonus } from "./BaseBonus";
|
4
|
+
export declare class FreeTotalValueBonus extends BaseBonus {
|
5
|
+
value: number;
|
6
|
+
constructor(value: number);
|
7
|
+
isFree(option: EstimationOption, _: Estimation): Promise<{
|
8
|
+
free: boolean;
|
9
|
+
split: {
|
10
|
+
free: {
|
11
|
+
total_value: number;
|
12
|
+
value: number;
|
13
|
+
period: import("..").Period;
|
14
|
+
total_count: number;
|
15
|
+
number: number;
|
16
|
+
active: boolean;
|
17
|
+
trial_started_at: Date | null;
|
18
|
+
};
|
19
|
+
paids: {
|
20
|
+
value: number;
|
21
|
+
period: import("..").Period;
|
22
|
+
total_count: number;
|
23
|
+
number: number;
|
24
|
+
total_value: number;
|
25
|
+
active: boolean;
|
26
|
+
trial_started_at: Date | null;
|
27
|
+
}[];
|
28
|
+
};
|
29
|
+
} | {
|
30
|
+
free: boolean;
|
31
|
+
split?: undefined;
|
32
|
+
}>;
|
33
|
+
}
|
@@ -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"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import { EstimationOption } from "../type/EstimationOption";
|
2
|
+
import { BaseBonus } from "../bonus/BaseBonus";
|
3
|
+
import { Estimation } from "../type/Estimation";
|
4
|
+
export declare abstract class BaseEstimator {
|
5
|
+
estimate(option: EstimationOption, calculate_bonus?: boolean): Promise<Estimation[]>;
|
6
|
+
abstract getFee(): {
|
7
|
+
active: number;
|
8
|
+
deactive: number;
|
9
|
+
};
|
10
|
+
abstract getUsage(): {
|
11
|
+
name: string;
|
12
|
+
unit: string;
|
13
|
+
};
|
14
|
+
abstract getBonues(): BaseBonus[];
|
15
|
+
}
|
@@ -0,0 +1,58 @@
|
|
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.BaseEstimator = void 0;
|
13
|
+
const Period_1 = require("../type/Period");
|
14
|
+
class BaseEstimator {
|
15
|
+
estimate(option_1) {
|
16
|
+
return __awaiter(this, arguments, void 0, function* (option, calculate_bonus = true) {
|
17
|
+
let seconds = Period_1.PeriodUtil.toSeconds(option.period);
|
18
|
+
let percent = seconds / 3600;
|
19
|
+
let fee_object = this.getFee();
|
20
|
+
let fee = option.active ? fee_object.active : fee_object.deactive;
|
21
|
+
let amount = percent * fee * option.value;
|
22
|
+
let currency = "USD";
|
23
|
+
let estimation = {
|
24
|
+
option,
|
25
|
+
seconds,
|
26
|
+
usage: Object.assign({ value: option.value }, this.getUsage()),
|
27
|
+
fee,
|
28
|
+
amount,
|
29
|
+
currency,
|
30
|
+
free: undefined
|
31
|
+
};
|
32
|
+
let ans = [];
|
33
|
+
if (calculate_bonus) {
|
34
|
+
let bonuses = this.getBonues();
|
35
|
+
for (let bonus of bonuses) {
|
36
|
+
let res = yield bonus.isFree(option, estimation);
|
37
|
+
if (res.free) {
|
38
|
+
if (res.split) {
|
39
|
+
let estimation_free = yield this.estimate(res.split.free, false);
|
40
|
+
estimation_free.forEach(e => { e.free = bonus; });
|
41
|
+
ans.push(...estimation_free);
|
42
|
+
for (let estimation_paid of res.split.paids)
|
43
|
+
ans.push(...yield this.estimate(estimation_paid, false));
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
estimation.free = bonus;
|
47
|
+
ans.push(estimation);
|
48
|
+
}
|
49
|
+
break;
|
50
|
+
}
|
51
|
+
}
|
52
|
+
}
|
53
|
+
return ans;
|
54
|
+
});
|
55
|
+
}
|
56
|
+
}
|
57
|
+
exports.BaseEstimator = BaseEstimator;
|
58
|
+
//# sourceMappingURL=BaseEstimator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BaseEstimator.js","sourceRoot":"","sources":["../../src/estimator/BaseEstimator.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,2CAA4C;AAE5C,MAAsB,aAAa;IAEzB,QAAQ;6DAAC,MAAwB,EAAE,kBAA2B,IAAI;YAEpE,IAAI,OAAO,GAAG,mBAAU,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAClD,IAAI,OAAO,GAAG,OAAO,GAAG,IAAI,CAAC;YAC7B,IAAI,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;YAC/B,IAAI,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC;YAElE,IAAI,MAAM,GAAG,OAAO,GAAG,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;YAC1C,IAAI,QAAQ,GAAG,KAAK,CAAC;YAErB,IAAI,UAAU,GAAe;gBACzB,MAAM;gBACN,OAAO;gBACP,KAAK,kBACD,KAAK,EAAE,MAAM,CAAC,KAAK,IAChB,IAAI,CAAC,QAAQ,EAAE,CACrB;gBACD,GAAG;gBACH,MAAM;gBACN,QAAQ;gBACR,IAAI,EAAE,SAAS;aAClB,CAAC;YAEF,IAAI,GAAG,GAAiB,EAAE,CAAC;YAC3B,IAAI,eAAe,EACnB,CAAC;gBACG,IAAI,OAAO,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;gBAC/B,KAAK,IAAI,KAAK,IAAI,OAAO,EACzB,CAAC;oBACG,IAAI,GAAG,GAAG,MAAM,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;oBACjD,IAAI,GAAG,CAAC,IAAI,EACZ,CAAC;wBACG,IAAI,GAAG,CAAC,KAAK,EACb,CAAC;4BACG,IAAI,eAAe,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;4BACjE,eAAe,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;4BAClD,GAAG,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,CAAC;4BAC7B,KAAK,IAAI,eAAe,IAAI,GAAG,CAAC,KAAK,CAAC,KAAK;gCACvC,GAAG,CAAC,IAAI,CAAC,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,CAAC;wBACjE,CAAC;6BAED,CAAC;4BACG,UAAU,CAAC,IAAI,GAAG,KAAK,CAAC;4BACxB,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;wBACzB,CAAC;wBACD,MAAM;oBACV,CAAC;gBACL,CAAC;YACL,CAAC;YAED,OAAO,GAAG,CAAC;QACf,CAAC;KAAA;CAIJ;AAzDD,sCAyDC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BillWatchAWSHourlyEstimator = void 0;
|
4
|
+
const BillWatchBaseHourlyEstimator_1 = require("./BillWatchBaseHourlyEstimator");
|
5
|
+
class BillWatchAWSHourlyEstimator extends BillWatchBaseHourlyEstimator_1.BillWatchBaseHourlyEstimator {
|
6
|
+
}
|
7
|
+
exports.BillWatchAWSHourlyEstimator = BillWatchAWSHourlyEstimator;
|
8
|
+
//# sourceMappingURL=BillWatchAWSHourlyEstimator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchAWSHourlyEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchAWSHourlyEstimator.ts"],"names":[],"mappings":";;;AAAA,iFAA8E;AAE9E,MAAa,2BAA4B,SAAQ,2DAA4B;CAE5E;AAFD,kEAEC"}
|
@@ -0,0 +1,8 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BillWatchAzureHourlyEstimator = void 0;
|
4
|
+
const BillWatchBaseHourlyEstimator_1 = require("./BillWatchBaseHourlyEstimator");
|
5
|
+
class BillWatchAzureHourlyEstimator extends BillWatchBaseHourlyEstimator_1.BillWatchBaseHourlyEstimator {
|
6
|
+
}
|
7
|
+
exports.BillWatchAzureHourlyEstimator = BillWatchAzureHourlyEstimator;
|
8
|
+
//# sourceMappingURL=BillWatchAzureHourlyEstimator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchAzureHourlyEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchAzureHourlyEstimator.ts"],"names":[],"mappings":";;;AAAA,iFAA8E;AAE9E,MAAa,6BAA8B,SAAQ,2DAA4B;CAE9E;AAFD,sEAEC"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { BaseEstimator } from "./BaseEstimator";
|
2
|
+
import { TrialBonus } from "../bonus/TrialBonus";
|
3
|
+
export declare abstract class BillWatchBaseHourlyEstimator extends BaseEstimator {
|
4
|
+
static WATCH_PER_HOUR_ACTIVE: number;
|
5
|
+
getFee(): {
|
6
|
+
active: number;
|
7
|
+
deactive: number;
|
8
|
+
};
|
9
|
+
getUsage(): {
|
10
|
+
name: string;
|
11
|
+
unit: string;
|
12
|
+
};
|
13
|
+
getBonues(): TrialBonus[];
|
14
|
+
}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.BillWatchBaseHourlyEstimator = void 0;
|
4
|
+
const namirasoft_core_1 = require("namirasoft-core");
|
5
|
+
const BaseEstimator_1 = require("./BaseEstimator");
|
6
|
+
const Usage_1 = require("../type/Usage");
|
7
|
+
const TrialBonus_1 = require("../bonus/TrialBonus");
|
8
|
+
class BillWatchBaseHourlyEstimator extends BaseEstimator_1.BaseEstimator {
|
9
|
+
getFee() {
|
10
|
+
return { active: BillWatchBaseHourlyEstimator.WATCH_PER_HOUR_ACTIVE, deactive: 0 };
|
11
|
+
}
|
12
|
+
getUsage() {
|
13
|
+
return {
|
14
|
+
name: Usage_1.Usage.Time.name,
|
15
|
+
unit: Usage_1.Usage.Time.units.Hour.name
|
16
|
+
};
|
17
|
+
}
|
18
|
+
getBonues() {
|
19
|
+
return [
|
20
|
+
new TrialBonus_1.TrialBonus(1, namirasoft_core_1.DurationUnit.Week)
|
21
|
+
];
|
22
|
+
}
|
23
|
+
}
|
24
|
+
exports.BillWatchBaseHourlyEstimator = BillWatchBaseHourlyEstimator;
|
25
|
+
BillWatchBaseHourlyEstimator.WATCH_PER_HOUR_ACTIVE = namirasoft_core_1.PriceOperation.cent_to_millicent(3);
|
26
|
+
//# sourceMappingURL=BillWatchBaseHourlyEstimator.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"BillWatchBaseHourlyEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchBaseHourlyEstimator.ts"],"names":[],"mappings":";;;AAAA,qDAA+D;AAC/D,mDAAgD;AAChD,yCAAsC;AACtC,oDAAiD;AAEjD,MAAsB,4BAA6B,SAAQ,6BAAa;IAG3D,MAAM;QAEX,OAAO,EAAE,MAAM,EAAE,4BAA4B,CAAC,qBAAqB,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACvF,CAAC;IACQ,QAAQ;QAEb,OAAO;YACH,IAAI,EAAE,aAAK,CAAC,IAAI,CAAC,IAAI;YACrB,IAAI,EAAE,aAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI;SACnC,CAAC;IACN,CAAC;IACQ,SAAS;QAEd,OAAO;YACH,IAAI,uBAAU,CAAC,CAAC,EAAE,8BAAY,CAAC,IAAI,CAAC;SACvC,CAAC;IACN,CAAC;;AAnBL,oEAoBC;AAlBU,kDAAqB,GAAG,gCAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC"}
|