namirasoft-cost 1.4.22 → 1.4.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/estimator/BillWatchAWSEstimator.d.ts +3 -0
  2. package/dist/estimator/BillWatchAWSEstimator.js +8 -0
  3. package/dist/estimator/BillWatchAWSEstimator.js.map +1 -0
  4. package/dist/estimator/BillWatchAzureEstimator.d.ts +3 -0
  5. package/dist/estimator/BillWatchAzureEstimator.js +8 -0
  6. package/dist/estimator/BillWatchAzureEstimator.js.map +1 -0
  7. package/dist/estimator/BillWatchBaseEstimator.d.ts +14 -0
  8. package/dist/estimator/BillWatchBaseEstimator.js +26 -0
  9. package/dist/estimator/BillWatchBaseEstimator.js.map +1 -0
  10. package/dist/estimator/BillWatchGCPEstimator.d.ts +3 -0
  11. package/dist/estimator/BillWatchGCPEstimator.js +8 -0
  12. package/dist/estimator/BillWatchGCPEstimator.js.map +1 -0
  13. package/dist/estimator/FieldBaseEstimator.d.ts +9 -0
  14. package/dist/estimator/FieldBaseEstimator.js +22 -0
  15. package/dist/estimator/FieldBaseEstimator.js.map +1 -0
  16. package/dist/estimator/FieldCategoryEstimator.d.ts +8 -0
  17. package/dist/estimator/FieldCategoryEstimator.js +12 -0
  18. package/dist/estimator/FieldCategoryEstimator.js.map +1 -0
  19. package/dist/estimator/FieldFieldEstimator.d.ts +8 -0
  20. package/dist/estimator/FieldFieldEstimator.js +12 -0
  21. package/dist/estimator/FieldFieldEstimator.js.map +1 -0
  22. package/dist/estimator/SecretSecretEstimator.d.ts +14 -0
  23. package/dist/estimator/SecretSecretEstimator.js +25 -0
  24. package/dist/estimator/SecretSecretEstimator.js.map +1 -0
  25. package/dist/index.d.ts +13 -0
  26. package/dist/index.js +13 -0
  27. package/dist/index.js.map +1 -1
  28. package/dist/type/Period.d.ts +14 -0
  29. package/dist/type/Period.js +17 -14
  30. package/dist/type/Period.js.map +1 -1
  31. package/package.json +2 -2
  32. package/src/estimator/BillWatchAWSEstimator.ts +5 -0
  33. package/src/estimator/BillWatchAzureEstimator.ts +5 -0
  34. package/src/estimator/{BillWatchBaseHourlyEstimator.ts → BillWatchBaseEstimator.ts} +2 -2
  35. package/src/estimator/BillWatchGCPEstimator.ts +5 -0
  36. package/src/estimator/{FieldBaseHourlyEstimator.ts → FieldBaseEstimator.ts} +1 -1
  37. package/src/estimator/FieldCategoryEstimator.ts +10 -0
  38. package/src/estimator/FieldFieldEstimator.ts +10 -0
  39. package/src/estimator/{SecretSecretHourlyEstimator.ts → SecretSecretEstimator.ts} +2 -2
  40. package/src/index.ts +14 -1
  41. package/src/type/Period.ts +18 -14
  42. package/src/estimator/BillWatchAWSHourlyEstimator.ts +0 -5
  43. package/src/estimator/BillWatchAzureHourlyEstimator.ts +0 -5
  44. package/src/estimator/BillWatchGCPHourlyEstimator.ts +0 -5
  45. package/src/estimator/FieldCategoryHourlyEstimator.ts +0 -10
  46. package/src/estimator/FieldFieldHourlyEstimator.ts +0 -10
@@ -0,0 +1,3 @@
1
+ import { BillWatchBaseEstimator } from "./BillWatchBaseEstimator";
2
+ export declare class BillWatchAWSEstimator extends BillWatchBaseEstimator {
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillWatchAWSEstimator = void 0;
4
+ const BillWatchBaseEstimator_1 = require("./BillWatchBaseEstimator");
5
+ class BillWatchAWSEstimator extends BillWatchBaseEstimator_1.BillWatchBaseEstimator {
6
+ }
7
+ exports.BillWatchAWSEstimator = BillWatchAWSEstimator;
8
+ //# sourceMappingURL=BillWatchAWSEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAWSEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchAWSEstimator.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAElE,MAAa,qBAAsB,SAAQ,+CAAsB;CAEhE;AAFD,sDAEC"}
@@ -0,0 +1,3 @@
1
+ import { BillWatchBaseEstimator } from "./BillWatchBaseEstimator";
2
+ export declare class BillWatchAzureEstimator extends BillWatchBaseEstimator {
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillWatchAzureEstimator = void 0;
4
+ const BillWatchBaseEstimator_1 = require("./BillWatchBaseEstimator");
5
+ class BillWatchAzureEstimator extends BillWatchBaseEstimator_1.BillWatchBaseEstimator {
6
+ }
7
+ exports.BillWatchAzureEstimator = BillWatchAzureEstimator;
8
+ //# sourceMappingURL=BillWatchAzureEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchAzureEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchAzureEstimator.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAElE,MAAa,uBAAwB,SAAQ,+CAAsB;CAElE;AAFD,0DAEC"}
@@ -0,0 +1,14 @@
1
+ import { BaseEstimator } from "./BaseEstimator";
2
+ import { TrialBonus } from "../bonus/TrialBonus";
3
+ export declare abstract class BillWatchBaseEstimator 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.BillWatchBaseEstimator = 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 BillWatchBaseEstimator extends BaseEstimator_1.BaseEstimator {
9
+ getFee() {
10
+ return { active: BillWatchBaseEstimator.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.BillWatchBaseEstimator = BillWatchBaseEstimator;
25
+ BillWatchBaseEstimator.WATCH_PER_HOUR_ACTIVE = namirasoft_core_1.PriceOperation.cent_to_millicent(3);
26
+ //# sourceMappingURL=BillWatchBaseEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchBaseEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchBaseEstimator.ts"],"names":[],"mappings":";;;AAAA,qDAA+D;AAC/D,mDAAgD;AAChD,yCAAsC;AACtC,oDAAiD;AAEjD,MAAsB,sBAAuB,SAAQ,6BAAa;IAGrD,MAAM;QAEX,OAAO,EAAE,MAAM,EAAE,sBAAsB,CAAC,qBAAqB,EAAE,QAAQ,EAAE,CAAC,EAAE,CAAC;IACjF,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,wDAoBC;AAlBU,4CAAqB,GAAG,gCAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { BillWatchBaseEstimator } from "./BillWatchBaseEstimator";
2
+ export declare class BillWatchGCPEstimator extends BillWatchBaseEstimator {
3
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BillWatchGCPEstimator = void 0;
4
+ const BillWatchBaseEstimator_1 = require("./BillWatchBaseEstimator");
5
+ class BillWatchGCPEstimator extends BillWatchBaseEstimator_1.BillWatchBaseEstimator {
6
+ }
7
+ exports.BillWatchGCPEstimator = BillWatchGCPEstimator;
8
+ //# sourceMappingURL=BillWatchGCPEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BillWatchGCPEstimator.js","sourceRoot":"","sources":["../../src/estimator/BillWatchGCPEstimator.ts"],"names":[],"mappings":";;;AAAA,qEAAkE;AAElE,MAAa,qBAAsB,SAAQ,+CAAsB;CAEhE;AAFD,sDAEC"}
@@ -0,0 +1,9 @@
1
+ import { TrialBonus } from "../bonus/TrialBonus";
2
+ import { BaseEstimator } from "./BaseEstimator";
3
+ export declare abstract class FieldBaseEstimator extends BaseEstimator {
4
+ getBonues(): TrialBonus[];
5
+ getUsage(): {
6
+ name: string;
7
+ unit: string;
8
+ };
9
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldBaseEstimator = void 0;
4
+ const namirasoft_core_1 = require("namirasoft-core");
5
+ const TrialBonus_1 = require("../bonus/TrialBonus");
6
+ const BaseEstimator_1 = require("./BaseEstimator");
7
+ const Usage_1 = require("../type/Usage");
8
+ class FieldBaseEstimator extends BaseEstimator_1.BaseEstimator {
9
+ getBonues() {
10
+ return [
11
+ new TrialBonus_1.TrialBonus(1, namirasoft_core_1.DurationUnit.Week)
12
+ ];
13
+ }
14
+ getUsage() {
15
+ return {
16
+ name: Usage_1.Usage.Time.name,
17
+ unit: Usage_1.Usage.Time.units.Hour.name
18
+ };
19
+ }
20
+ }
21
+ exports.FieldBaseEstimator = FieldBaseEstimator;
22
+ //# sourceMappingURL=FieldBaseEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldBaseEstimator.js","sourceRoot":"","sources":["../../src/estimator/FieldBaseEstimator.ts"],"names":[],"mappings":";;;AAAA,qDAA+C;AAC/C,oDAAiD;AACjD,mDAAgD;AAChD,yCAAsC;AAEtC,MAAsB,kBAAmB,SAAQ,6BAAa;IAEjD,SAAS;QAEd,OAAO;YACH,IAAI,uBAAU,CAAC,CAAC,EAAE,8BAAY,CAAC,IAAI,CAAC;SACvC,CAAC;IACN,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;CACJ;AAfD,gDAeC"}
@@ -0,0 +1,8 @@
1
+ import { FieldBaseEstimator } from "./FieldBaseEstimator";
2
+ export declare class FieldCategoryEstimator extends FieldBaseEstimator {
3
+ static PER_HOUR_ACTIVE: number;
4
+ getFee(): {
5
+ active: number;
6
+ deactive: number;
7
+ };
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldCategoryEstimator = void 0;
4
+ const FieldBaseEstimator_1 = require("./FieldBaseEstimator");
5
+ class FieldCategoryEstimator extends FieldBaseEstimator_1.FieldBaseEstimator {
6
+ getFee() {
7
+ return { active: FieldCategoryEstimator.PER_HOUR_ACTIVE, deactive: FieldCategoryEstimator.PER_HOUR_ACTIVE };
8
+ }
9
+ }
10
+ exports.FieldCategoryEstimator = FieldCategoryEstimator;
11
+ FieldCategoryEstimator.PER_HOUR_ACTIVE = 200;
12
+ //# sourceMappingURL=FieldCategoryEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldCategoryEstimator.js","sourceRoot":"","sources":["../../src/estimator/FieldCategoryEstimator.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,MAAa,sBAAuB,SAAQ,uCAAkB;IAGjD,MAAM;QAEX,OAAO,EAAE,MAAM,EAAE,sBAAsB,CAAC,eAAe,EAAE,QAAQ,EAAE,sBAAsB,CAAC,eAAe,EAAE,CAAC;IAChH,CAAC;;AANL,wDAOC;AALU,sCAAe,GAAG,GAAG,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { FieldBaseEstimator } from "./FieldBaseEstimator";
2
+ export declare class FieldFieldEstimator extends FieldBaseEstimator {
3
+ static PER_HOUR_ACTIVE: number;
4
+ getFee(): {
5
+ active: number;
6
+ deactive: number;
7
+ };
8
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldFieldEstimator = void 0;
4
+ const FieldBaseEstimator_1 = require("./FieldBaseEstimator");
5
+ class FieldFieldEstimator extends FieldBaseEstimator_1.FieldBaseEstimator {
6
+ getFee() {
7
+ return { active: FieldFieldEstimator.PER_HOUR_ACTIVE, deactive: FieldFieldEstimator.PER_HOUR_ACTIVE };
8
+ }
9
+ }
10
+ exports.FieldFieldEstimator = FieldFieldEstimator;
11
+ FieldFieldEstimator.PER_HOUR_ACTIVE = 250;
12
+ //# sourceMappingURL=FieldFieldEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FieldFieldEstimator.js","sourceRoot":"","sources":["../../src/estimator/FieldFieldEstimator.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAE1D,MAAa,mBAAoB,SAAQ,uCAAkB;IAG9C,MAAM;QAEX,OAAO,EAAE,MAAM,EAAE,mBAAmB,CAAC,eAAe,EAAE,QAAQ,EAAE,mBAAmB,CAAC,eAAe,EAAE,CAAC;IAC1G,CAAC;;AANL,kDAOC;AALU,mCAAe,GAAG,GAAG,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { FreeCountBonus } from "../bonus/FreeCountBonus";
2
+ import { BaseEstimator } from "./BaseEstimator";
3
+ export declare class SecretSecretEstimator extends BaseEstimator {
4
+ static PER_HOUR_ACTIVE: number;
5
+ getFee(): {
6
+ active: number;
7
+ deactive: number;
8
+ };
9
+ getUsage(): {
10
+ name: string;
11
+ unit: string;
12
+ };
13
+ getBonues(): FreeCountBonus[];
14
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SecretSecretEstimator = void 0;
4
+ const FreeCountBonus_1 = require("../bonus/FreeCountBonus");
5
+ const Usage_1 = require("../type/Usage");
6
+ const BaseEstimator_1 = require("./BaseEstimator");
7
+ class SecretSecretEstimator extends BaseEstimator_1.BaseEstimator {
8
+ getFee() {
9
+ return { active: SecretSecretEstimator.PER_HOUR_ACTIVE, deactive: SecretSecretEstimator.PER_HOUR_ACTIVE };
10
+ }
11
+ getUsage() {
12
+ return {
13
+ name: Usage_1.Usage.Time.name,
14
+ unit: Usage_1.Usage.Time.units.Hour.name
15
+ };
16
+ }
17
+ getBonues() {
18
+ return [
19
+ new FreeCountBonus_1.FreeCountBonus(100)
20
+ ];
21
+ }
22
+ }
23
+ exports.SecretSecretEstimator = SecretSecretEstimator;
24
+ SecretSecretEstimator.PER_HOUR_ACTIVE = 2;
25
+ //# sourceMappingURL=SecretSecretEstimator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SecretSecretEstimator.js","sourceRoot":"","sources":["../../src/estimator/SecretSecretEstimator.ts"],"names":[],"mappings":";;;AAAA,4DAAyD;AACzD,yCAAsC;AACtC,mDAAgD;AAEhD,MAAa,qBAAsB,SAAQ,6BAAa;IAG3C,MAAM;QAEX,OAAO,EAAE,MAAM,EAAE,qBAAqB,CAAC,eAAe,EAAE,QAAQ,EAAE,qBAAqB,CAAC,eAAe,EAAE,CAAC;IAC9G,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,+BAAc,CAAC,GAAG,CAAC;SAC1B,CAAC;IACN,CAAC;;AAnBL,sDAoBC;AAlBU,qCAAe,GAAG,CAAC,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,14 @@
1
+ export * from "./bonus/BaseBonus";
2
+ export * from "./estimator/BaseEstimator";
3
+ export * from "./estimator/BillWatchAWSEstimator";
4
+ export * from "./estimator/BillWatchAzureEstimator";
5
+ export * from "./estimator/BillWatchBaseEstimator";
6
+ export * from "./estimator/BillWatchGCPEstimator";
7
+ export * from "./estimator/FieldBaseEstimator";
8
+ export * from "./estimator/FieldCategoryEstimator";
9
+ export * from "./estimator/FieldFieldEstimator";
10
+ export * from "./estimator/SecretSecretEstimator";
11
+ export * from "./estimator/SecretSecretReadEstimator";
1
12
  export * from "./NamirasoftCostServer";
2
13
  export * from "./NamirasoftCostServerBase";
3
14
  export * from "./NamirasoftCostServerBillWatchAWS";
@@ -44,5 +55,7 @@ export * from "./meta/NamirasoftCostMetaDatabase";
44
55
  export * from "./row/CostCreateRow";
45
56
  export * from "./row/CostRow";
46
57
  export * from "./type/Estimation";
58
+ export * from "./type/EstimationOption";
47
59
  export * from "./type/EstimationUsage";
48
60
  export * from "./type/Period";
61
+ export * from "./type/Usage";
package/dist/index.js CHANGED
@@ -14,6 +14,17 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./bonus/BaseBonus"), exports);
18
+ __exportStar(require("./estimator/BaseEstimator"), exports);
19
+ __exportStar(require("./estimator/BillWatchAWSEstimator"), exports);
20
+ __exportStar(require("./estimator/BillWatchAzureEstimator"), exports);
21
+ __exportStar(require("./estimator/BillWatchBaseEstimator"), exports);
22
+ __exportStar(require("./estimator/BillWatchGCPEstimator"), exports);
23
+ __exportStar(require("./estimator/FieldBaseEstimator"), exports);
24
+ __exportStar(require("./estimator/FieldCategoryEstimator"), exports);
25
+ __exportStar(require("./estimator/FieldFieldEstimator"), exports);
26
+ __exportStar(require("./estimator/SecretSecretEstimator"), exports);
27
+ __exportStar(require("./estimator/SecretSecretReadEstimator"), exports);
17
28
  __exportStar(require("./NamirasoftCostServer"), exports);
18
29
  __exportStar(require("./NamirasoftCostServerBase"), exports);
19
30
  __exportStar(require("./NamirasoftCostServerBillWatchAWS"), exports);
@@ -60,6 +71,8 @@ __exportStar(require("./meta/NamirasoftCostMetaDatabase"), exports);
60
71
  __exportStar(require("./row/CostCreateRow"), exports);
61
72
  __exportStar(require("./row/CostRow"), exports);
62
73
  __exportStar(require("./type/Estimation"), exports);
74
+ __exportStar(require("./type/EstimationOption"), exports);
63
75
  __exportStar(require("./type/EstimationUsage"), exports);
64
76
  __exportStar(require("./type/Period"), exports);
77
+ __exportStar(require("./type/Usage"), exports);
65
78
  //# sourceMappingURL=index.js.map
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,qEAAmD;AACnD,8DAA4C;AAC5C,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,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,yDAAuC;AACvC,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAoBA,oDAAkC;AAClC,4DAA0C;AAC1C,oEAAkD;AAClD,sEAAoD;AACpD,qEAAmD;AACnD,oEAAkD;AAClD,iEAA+C;AAC/C,qEAAmD;AACnD,kEAAgD;AAChD,oEAAkD;AAClD,wEAAsD;AACtD,yDAAuC;AACvC,6DAA2C;AAC3C,qEAAmD;AACnD,uEAAqD;AACrD,qEAAmD;AACnD,6DAA2C;AAC3C,sEAAoD;AACpD,mEAAiD;AACjD,gEAA8C;AAC9C,gEAA8C;AAC9C,qEAAmD;AACnD,8DAA4C;AAC5C,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,uDAAqC;AACrC,oEAAkD;AAClD,sDAAoC;AACpC,gDAA8B;AAC9B,oDAAkC;AAClC,0DAAwC;AACxC,yDAAuC;AACvC,gDAA8B;AAC9B,+CAA6B"}
@@ -18,5 +18,19 @@ export declare class PeriodUtil {
18
18
  start: Date;
19
19
  end: Date;
20
20
  };
21
+ static byDates(start: Date, end: Date): {
22
+ year: number;
23
+ month: number;
24
+ day: number;
25
+ hour: number;
26
+ start: {
27
+ minute: number;
28
+ second: number;
29
+ };
30
+ end: {
31
+ minute: number;
32
+ second: number;
33
+ };
34
+ };
21
35
  static loop(start: Date, end: Date, estimate_hour: (period: Period) => Promise<void>): Promise<void>;
22
36
  }
@@ -20,25 +20,28 @@ class PeriodUtil {
20
20
  let end = new Date(period.year, period.month, period.day, period.hour, period.end.minute, period.end.second);
21
21
  return { start, end };
22
22
  }
23
+ static byDates(start, end) {
24
+ return {
25
+ year: start.getFullYear(),
26
+ month: start.getMonth(),
27
+ day: start.getDate(),
28
+ hour: start.getHours(),
29
+ start: {
30
+ minute: start.getMinutes(),
31
+ second: start.getSeconds(),
32
+ },
33
+ end: {
34
+ minute: end.getMinutes(),
35
+ second: end.getSeconds(),
36
+ }
37
+ };
38
+ }
23
39
  static loop(start, end, estimate_hour) {
24
40
  return __awaiter(this, void 0, void 0, function* () {
25
41
  let pre_estimate_hour = (start, end) => __awaiter(this, void 0, void 0, function* () {
26
42
  if (end <= start)
27
43
  return;
28
- return yield estimate_hour({
29
- year: start.getFullYear(),
30
- month: start.getMonth(),
31
- day: start.getDate(),
32
- hour: start.getHours(),
33
- start: {
34
- minute: start.getMinutes(),
35
- second: start.getSeconds(),
36
- },
37
- end: {
38
- minute: end.getMinutes(),
39
- second: end.getSeconds(),
40
- }
41
- });
44
+ return yield estimate_hour(PeriodUtil.byDates(start, end));
42
45
  });
43
46
  let s = start;
44
47
  let e = null;
@@ -1 +1 @@
1
- {"version":3,"file":"Period.js","sourceRoot":"","sources":["../../src/type/Period.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAgD;AAkBhD,MAAa,UAAU;IAEnB,MAAM,CAAC,SAAS,CAAC,MAAc;QAE3B,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,GAAG,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE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ACA,CAAC;gBACG,IAAI,UAAU,GAAG,+BAAa,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAChD,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC;gBAC9B,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBACzB,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;gBACzB,IAAI,GAAG,GAAG,UAAU,EACpB,CAAC;oBACG,UAAU,GAAG,GAAG,CAAC;oBACjB,CAAC,GAAG,GAAG,CAAC;gBACZ,CAAC;;oBAEG,CAAC,GAAG,+BAAa,CAAC,UAAU,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;gBAChD,MAAM,iBAAiB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;gBAC9B,CAAC,GAAG,UAAU,CAAC;YACnB,CAAC,QACM,CAAC,GAAG,GAAG,EAAC;QACnB,CAAC;KAAA;CACJ;AA3DD,gCA2DC;AAAA,CAAC"}
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "framework": "npm",
9
9
  "application": "package",
10
10
  "private": false,
11
- "version": "1.4.22",
11
+ "version": "1.4.24",
12
12
  "author": "Amir Abolhasani",
13
13
  "license": "MIT",
14
14
  "main": "./dist/index.js",
@@ -20,7 +20,7 @@
20
20
  "namirasoft-core": "^1.4.80",
21
21
  "namirasoft-site": "^1.4.39",
22
22
  "namirasoft-node-cli": "^1.4.7",
23
- "namirasoft-account": "^1.4.84"
23
+ "namirasoft-account": "^1.4.85"
24
24
  },
25
25
  "bin": {
26
26
  "ns-cost": "./dist/command/cli.js"
@@ -0,0 +1,5 @@
1
+ import { BillWatchBaseEstimator } from "./BillWatchBaseEstimator";
2
+
3
+ export class BillWatchAWSEstimator extends BillWatchBaseEstimator
4
+ {
5
+ }
@@ -0,0 +1,5 @@
1
+ import { BillWatchBaseEstimator } from "./BillWatchBaseEstimator";
2
+
3
+ export class BillWatchAzureEstimator extends BillWatchBaseEstimator
4
+ {
5
+ }
@@ -3,12 +3,12 @@ import { BaseEstimator } from "./BaseEstimator";
3
3
  import { Usage } from "../type/Usage";
4
4
  import { TrialBonus } from "../bonus/TrialBonus";
5
5
 
6
- export abstract class BillWatchBaseHourlyEstimator extends BaseEstimator
6
+ export abstract class BillWatchBaseEstimator extends BaseEstimator
7
7
  {
8
8
  static WATCH_PER_HOUR_ACTIVE = PriceOperation.cent_to_millicent(3);
9
9
  override getFee()
10
10
  {
11
- return { active: BillWatchBaseHourlyEstimator.WATCH_PER_HOUR_ACTIVE, deactive: 0 };
11
+ return { active: BillWatchBaseEstimator.WATCH_PER_HOUR_ACTIVE, deactive: 0 };
12
12
  }
13
13
  override getUsage()
14
14
  {
@@ -0,0 +1,5 @@
1
+ import { BillWatchBaseEstimator } from "./BillWatchBaseEstimator";
2
+
3
+ export class BillWatchGCPEstimator extends BillWatchBaseEstimator
4
+ {
5
+ }
@@ -3,7 +3,7 @@ import { TrialBonus } from "../bonus/TrialBonus";
3
3
  import { BaseEstimator } from "./BaseEstimator";
4
4
  import { Usage } from "../type/Usage";
5
5
 
6
- export abstract class FieldBaseHourlyEstimator extends BaseEstimator
6
+ export abstract class FieldBaseEstimator extends BaseEstimator
7
7
  {
8
8
  override getBonues()
9
9
  {
@@ -0,0 +1,10 @@
1
+ import { FieldBaseEstimator } from "./FieldBaseEstimator";
2
+
3
+ export class FieldCategoryEstimator extends FieldBaseEstimator
4
+ {
5
+ static PER_HOUR_ACTIVE = 200;
6
+ override getFee()
7
+ {
8
+ return { active: FieldCategoryEstimator.PER_HOUR_ACTIVE, deactive: FieldCategoryEstimator.PER_HOUR_ACTIVE };
9
+ }
10
+ }
@@ -0,0 +1,10 @@
1
+ import { FieldBaseEstimator } from "./FieldBaseEstimator";
2
+
3
+ export class FieldFieldEstimator extends FieldBaseEstimator
4
+ {
5
+ static PER_HOUR_ACTIVE = 250;
6
+ override getFee()
7
+ {
8
+ return { active: FieldFieldEstimator.PER_HOUR_ACTIVE, deactive: FieldFieldEstimator.PER_HOUR_ACTIVE };
9
+ }
10
+ }
@@ -2,12 +2,12 @@ import { FreeCountBonus } from "../bonus/FreeCountBonus";
2
2
  import { Usage } from "../type/Usage";
3
3
  import { BaseEstimator } from "./BaseEstimator";
4
4
 
5
- export class SecretSecretHourlyEstimator extends BaseEstimator
5
+ export class SecretSecretEstimator extends BaseEstimator
6
6
  {
7
7
  static PER_HOUR_ACTIVE = 2;
8
8
  override getFee()
9
9
  {
10
- return { active: SecretSecretHourlyEstimator.PER_HOUR_ACTIVE, deactive: SecretSecretHourlyEstimator.PER_HOUR_ACTIVE };
10
+ return { active: SecretSecretEstimator.PER_HOUR_ACTIVE, deactive: SecretSecretEstimator.PER_HOUR_ACTIVE };
11
11
  }
12
12
  override getUsage()
13
13
  {
package/src/index.ts CHANGED
@@ -18,6 +18,17 @@
18
18
  /* */
19
19
  /****************************************************************/
20
20
 
21
+ export * from "./bonus/BaseBonus";
22
+ export * from "./estimator/BaseEstimator";
23
+ export * from "./estimator/BillWatchAWSEstimator";
24
+ export * from "./estimator/BillWatchAzureEstimator";
25
+ export * from "./estimator/BillWatchBaseEstimator";
26
+ export * from "./estimator/BillWatchGCPEstimator";
27
+ export * from "./estimator/FieldBaseEstimator";
28
+ export * from "./estimator/FieldCategoryEstimator";
29
+ export * from "./estimator/FieldFieldEstimator";
30
+ export * from "./estimator/SecretSecretEstimator";
31
+ export * from "./estimator/SecretSecretReadEstimator";
21
32
  export * from "./NamirasoftCostServer";
22
33
  export * from "./NamirasoftCostServerBase";
23
34
  export * from "./NamirasoftCostServerBillWatchAWS";
@@ -64,5 +75,7 @@ export * from "./meta/NamirasoftCostMetaDatabase";
64
75
  export * from "./row/CostCreateRow";
65
76
  export * from "./row/CostRow";
66
77
  export * from "./type/Estimation";
78
+ export * from "./type/EstimationOption";
67
79
  export * from "./type/EstimationUsage";
68
- export * from "./type/Period";
80
+ export * from "./type/Period";
81
+ export * from "./type/Usage";
@@ -28,26 +28,30 @@ export class PeriodUtil
28
28
  let end = new Date(period.year, period.month, period.day, period.hour, period.end.minute, period.end.second);
29
29
  return { start, end };
30
30
  }
31
+ static byDates(start: Date, end: Date)
32
+ {
33
+ return {
34
+ year: start.getFullYear(),
35
+ month: start.getMonth(),
36
+ day: start.getDate(),
37
+ hour: start.getHours(),
38
+ start: {
39
+ minute: start.getMinutes(),
40
+ second: start.getSeconds(),
41
+ },
42
+ end: {
43
+ minute: end.getMinutes(),
44
+ second: end.getSeconds(),
45
+ }
46
+ };
47
+ }
31
48
  static async loop(start: Date, end: Date, estimate_hour: (period: Period) => Promise<void>): Promise<void>
32
49
  {
33
50
  let pre_estimate_hour = async (start: Date, end: Date) =>
34
51
  {
35
52
  if (end <= start)
36
53
  return;
37
- return await estimate_hour({
38
- year: start.getFullYear(),
39
- month: start.getMonth(),
40
- day: start.getDate(),
41
- hour: start.getHours(),
42
- start: {
43
- minute: start.getMinutes(),
44
- second: start.getSeconds(),
45
- },
46
- end: {
47
- minute: end.getMinutes(),
48
- second: end.getSeconds(),
49
- }
50
- });
54
+ return await estimate_hour(PeriodUtil.byDates(start, end));
51
55
  }
52
56
 
53
57
  let s = start;
@@ -1,5 +0,0 @@
1
- import { BillWatchBaseHourlyEstimator } from "./BillWatchBaseHourlyEstimator";
2
-
3
- export class BillWatchAWSHourlyEstimator extends BillWatchBaseHourlyEstimator
4
- {
5
- }
@@ -1,5 +0,0 @@
1
- import { BillWatchBaseHourlyEstimator } from "./BillWatchBaseHourlyEstimator";
2
-
3
- export class BillWatchAzureHourlyEstimator extends BillWatchBaseHourlyEstimator
4
- {
5
- }
@@ -1,5 +0,0 @@
1
- import { BillWatchBaseHourlyEstimator } from "./BillWatchBaseHourlyEstimator";
2
-
3
- export class BillWatchGCPHourlyEstimator extends BillWatchBaseHourlyEstimator
4
- {
5
- }
@@ -1,10 +0,0 @@
1
- import { FieldBaseHourlyEstimator } from "./FieldBaseHourlyEstimator";
2
-
3
- export class FieldCategoryHourlyEstimator extends FieldBaseHourlyEstimator
4
- {
5
- static PER_HOUR_ACTIVE = 200;
6
- override getFee()
7
- {
8
- return { active: FieldCategoryHourlyEstimator.PER_HOUR_ACTIVE, deactive: FieldCategoryHourlyEstimator.PER_HOUR_ACTIVE };
9
- }
10
- }
@@ -1,10 +0,0 @@
1
- import { FieldBaseHourlyEstimator } from "./FieldBaseHourlyEstimator";
2
-
3
- export class FieldFieldHourlyEstimator extends FieldBaseHourlyEstimator
4
- {
5
- static PER_HOUR_ACTIVE = 250;
6
- override getFee()
7
- {
8
- return { active: FieldFieldHourlyEstimator.PER_HOUR_ACTIVE, deactive: FieldFieldHourlyEstimator.PER_HOUR_ACTIVE };
9
- }
10
- }