namirasoft-cost 1.4.32 → 1.4.34

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 (80) hide show
  1. package/.ns-sdkg-dir-deep +3 -3
  2. package/.ns-sdkg-file-keep +27 -28
  3. package/dist/bonus/DeactiveBonus.d.ts +1 -2
  4. package/dist/bonus/DeactiveBonus.js +1 -2
  5. package/dist/bonus/DeactiveBonus.js.map +1 -1
  6. package/dist/estimator/BillWatchBaseRecordEstimator.d.ts +2 -1
  7. package/dist/estimator/BillWatchBaseRecordEstimator.js +3 -1
  8. package/dist/estimator/BillWatchBaseRecordEstimator.js.map +1 -1
  9. package/dist/index.d.ts +0 -1
  10. package/dist/index.js +0 -1
  11. package/dist/index.js.map +1 -1
  12. package/package.json +28 -28
  13. package/src/NamirasoftCostServer.ts +59 -59
  14. package/src/NamirasoftCostServerBase.ts +29 -29
  15. package/src/NamirasoftCostServerBillWatchAWS.ts +47 -47
  16. package/src/NamirasoftCostServerBillWatchAzure.ts +47 -47
  17. package/src/NamirasoftCostServerBillWatchGCP.ts +47 -47
  18. package/src/NamirasoftCostServerCost.ts +41 -41
  19. package/src/NamirasoftCostServerFieldCategory.ts +47 -47
  20. package/src/NamirasoftCostServerFieldField.ts +47 -47
  21. package/src/NamirasoftCostServerHealthz.ts +35 -35
  22. package/src/NamirasoftCostServerMetrics.ts +35 -35
  23. package/src/NamirasoftCostServerSecretSecret.ts +61 -61
  24. package/src/NamirasoftCostServerValue.ts +36 -36
  25. package/src/bonus/BaseBonus.ts +13 -13
  26. package/src/bonus/DeactiveBonus.ts +14 -14
  27. package/src/bonus/FreeCountBonus.ts +14 -14
  28. package/src/bonus/FreeTotalValueBonus.ts +28 -28
  29. package/src/bonus/FreeValueBonus.ts +24 -24
  30. package/src/bonus/LowAmountBonus.ts +14 -14
  31. package/src/bonus/LowSecondsBonus.ts +14 -14
  32. package/src/bonus/LowTotalValueBonus.ts +14 -14
  33. package/src/bonus/LowValueBonus.ts +14 -14
  34. package/src/bonus/TrialBonus.ts +18 -18
  35. package/src/command/BillWatchAWSCommand.ts +33 -33
  36. package/src/command/BillWatchAWSEstimateRecordCommand.ts +109 -109
  37. package/src/command/BillWatchAWS_CreateForRecordCommand.ts +118 -118
  38. package/src/command/BillWatchAzureCommand.ts +33 -33
  39. package/src/command/BillWatchAzureEstimateRecordCommand.ts +109 -109
  40. package/src/command/BillWatchAzure_CreateForRecordCommand.ts +118 -118
  41. package/src/command/BillWatchGCPCommand.ts +33 -33
  42. package/src/command/BillWatchGCPEstimateRecordCommand.ts +109 -109
  43. package/src/command/BillWatchGCP_CreateForRecordCommand.ts +118 -118
  44. package/src/command/CostCommand.ts +31 -31
  45. package/src/command/CostListCommand.ts +44 -44
  46. package/src/command/FieldCategoryCommand.ts +33 -33
  47. package/src/command/FieldCategoryEstimateRecordCommand.ts +109 -109
  48. package/src/command/FieldCategory_CreateForRecordCommand.ts +118 -118
  49. package/src/command/FieldFieldCommand.ts +33 -33
  50. package/src/command/FieldFieldEstimateRecordCommand.ts +109 -109
  51. package/src/command/FieldField_CreateForRecordCommand.ts +118 -118
  52. package/src/command/HealthzCommand.ts +31 -31
  53. package/src/command/HealthzGetCommand.ts +44 -44
  54. package/src/command/MetricsCommand.ts +31 -31
  55. package/src/command/MetricsGetCommand.ts +44 -44
  56. package/src/command/SecretSecretCommand.ts +37 -37
  57. package/src/command/SecretSecretEstimateReadCommand.ts +109 -109
  58. package/src/command/SecretSecretEstimateRecordCommand.ts +109 -109
  59. package/src/command/SecretSecret_CreateForReadCommand.ts +118 -118
  60. package/src/command/SecretSecret_CreateForRecordCommand.ts +118 -118
  61. package/src/command/ValueCommand.ts +31 -31
  62. package/src/command/ValueListCommand.ts +44 -44
  63. package/src/command/cli.ts +50 -50
  64. package/src/estimator/BillWatchBaseRecordEstimator.ts +3 -1
  65. package/src/index.ts +90 -91
  66. package/src/meta/CostMetaTable.ts +81 -81
  67. package/src/meta/NamirasoftCostMetaDatabase.ts +50 -50
  68. package/src/row/CostRow.ts +40 -40
  69. package/src/type/Bonus.ts +20 -20
  70. package/src/type/CalculationOption.ts +33 -33
  71. package/src/type/Estimation.ts +34 -34
  72. package/src/type/EstimationOption.ts +31 -31
  73. package/src/type/EstimationUsage.ts +22 -22
  74. package/src/type/Period.ts +101 -101
  75. package/src/type/SimulationOption.ts +29 -29
  76. package/src/type/Usage.ts +24 -24
  77. package/dist/bonus/LowTotalCountBonus.d.ts +0 -10
  78. package/dist/bonus/LowTotalCountBonus.js +0 -27
  79. package/dist/bonus/LowTotalCountBonus.js.map +0 -1
  80. package/src/bonus/LowTotalCountBonus.ts +0 -15
@@ -1,34 +1,34 @@
1
- import { BaseVariableSchema, BoolSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
- import { Period, PeriodSchema } from "./Period";
3
-
4
- export interface CalculationOption
5
- {
6
- period: Period;
7
- total_count: number;
8
- number: number;
9
- total_value: number;
10
- value: number;
11
- active: boolean;
12
- workspace_id: string;
13
- resource_id: string;
14
- };
15
-
16
- export class CalculationOptionSchema extends ObjectSchema
17
- {
18
- constructor(required: boolean)
19
- {
20
- super("CalculationOption", required, [
21
- new BaseVariableSchema("period", new PeriodSchema(true)),
22
- new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
23
- new BaseVariableSchema("number", new IntegerSchema(true, 1)),
24
- new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
25
- new BaseVariableSchema("value", new IntegerSchema(true, 1)),
26
- new BaseVariableSchema("active", new BoolSchema(true)),
27
- new BaseVariableSchema("workspace_id", new StringSchema(false, 20, 20)),
28
- new BaseVariableSchema("resource_id", new StringSchema(false, 20, 20)),
29
- ]);
30
- this.external = {
31
- package: "./type/CalculationOption"
32
- };
33
- }
1
+ import { BaseVariableSchema, BoolSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
+ import { Period, PeriodSchema } from "./Period";
3
+
4
+ export interface CalculationOption
5
+ {
6
+ period: Period;
7
+ total_count: number;
8
+ number: number;
9
+ total_value: number;
10
+ value: number;
11
+ active: boolean;
12
+ workspace_id: string;
13
+ resource_id: string;
14
+ };
15
+
16
+ export class CalculationOptionSchema extends ObjectSchema
17
+ {
18
+ constructor(required: boolean)
19
+ {
20
+ super("CalculationOption", required, [
21
+ new BaseVariableSchema("period", new PeriodSchema(true)),
22
+ new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
23
+ new BaseVariableSchema("number", new IntegerSchema(true, 1)),
24
+ new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
25
+ new BaseVariableSchema("value", new IntegerSchema(true, 1)),
26
+ new BaseVariableSchema("active", new BoolSchema(true)),
27
+ new BaseVariableSchema("workspace_id", new StringSchema(false, 20, 20)),
28
+ new BaseVariableSchema("resource_id", new StringSchema(false, 20, 20)),
29
+ ]);
30
+ this.external = {
31
+ package: "./type/CalculationOption"
32
+ };
33
+ }
34
34
  }
@@ -1,35 +1,35 @@
1
- import { BaseVariableSchema, IntegerSchema, MoneySchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
- import { BaseBonus } from "../bonus/BaseBonus";
3
- import { EstimationOption, EstimationOptionSchema } from "./EstimationOption";
4
- import { EstimationUsage, EstimationUsageSchema } from "./EstimationUsage";
5
- import { BonusSchema } from "./Bonus";
6
-
7
- export type Estimation =
8
- {
9
- option: EstimationOption;
10
- seconds: number;
11
- usage: EstimationUsage;
12
- fee: number;
13
- amount: number;
14
- currency: string;
15
- free?: BaseBonus;
16
- };
17
-
18
- export class EstimationSchema extends ObjectSchema
19
- {
20
- constructor(required: boolean)
21
- {
22
- super("Estimation", required, [
23
- new BaseVariableSchema("option", new EstimationOptionSchema(true)),
24
- new BaseVariableSchema("seconds", new IntegerSchema(true, 1, 3600)),
25
- new BaseVariableSchema("usage", new EstimationUsageSchema(true)),
26
- new BaseVariableSchema("fee", new MoneySchema(true)),
27
- new BaseVariableSchema("amount", new MoneySchema(true, 1)),
28
- new BaseVariableSchema("currency", new StringSchema(true)),
29
- new BaseVariableSchema("free", new BonusSchema(false)),
30
- ]);
31
- this.external = {
32
- package: "./type/Estimation"
33
- };
34
- }
1
+ import { BaseVariableSchema, IntegerSchema, MoneySchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
+ import { BaseBonus } from "../bonus/BaseBonus";
3
+ import { EstimationOption, EstimationOptionSchema } from "./EstimationOption";
4
+ import { EstimationUsage, EstimationUsageSchema } from "./EstimationUsage";
5
+ import { BonusSchema } from "./Bonus";
6
+
7
+ export type Estimation =
8
+ {
9
+ option: EstimationOption;
10
+ seconds: number;
11
+ usage: EstimationUsage;
12
+ fee: number;
13
+ amount: number;
14
+ currency: string;
15
+ free?: BaseBonus;
16
+ };
17
+
18
+ export class EstimationSchema extends ObjectSchema
19
+ {
20
+ constructor(required: boolean)
21
+ {
22
+ super("Estimation", required, [
23
+ new BaseVariableSchema("option", new EstimationOptionSchema(true)),
24
+ new BaseVariableSchema("seconds", new IntegerSchema(true, 1, 3600)),
25
+ new BaseVariableSchema("usage", new EstimationUsageSchema(true)),
26
+ new BaseVariableSchema("fee", new MoneySchema(true)),
27
+ new BaseVariableSchema("amount", new MoneySchema(true, 1)),
28
+ new BaseVariableSchema("currency", new StringSchema(true)),
29
+ new BaseVariableSchema("free", new BonusSchema(false)),
30
+ ]);
31
+ this.external = {
32
+ package: "./type/Estimation"
33
+ };
34
+ }
35
35
  }
@@ -1,32 +1,32 @@
1
- import { BaseVariableSchema, BoolSchema, DateTimeSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
- import { Period, PeriodSchema } from "./Period";
3
-
4
- export interface EstimationOption
5
- {
6
- period: Period;
7
- total_count: number;
8
- number: number;
9
- total_value: number;
10
- value: number;
11
- active: boolean;
12
- trial_started_at: Date | null;
13
- };
14
-
15
- export class EstimationOptionSchema extends ObjectSchema
16
- {
17
- constructor(required: boolean)
18
- {
19
- super("EstimationOption", required, [
20
- new BaseVariableSchema("period", new PeriodSchema(true)),
21
- new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
22
- new BaseVariableSchema("number", new IntegerSchema(true, 1)),
23
- new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
24
- new BaseVariableSchema("value", new IntegerSchema(true, 1)),
25
- new BaseVariableSchema("active", new BoolSchema(true)),
26
- new BaseVariableSchema("trial_started_at", new DateTimeSchema(false)),
27
- ]);
28
- this.external = {
29
- package: "./type/EstimationOption"
30
- };
31
- }
1
+ import { BaseVariableSchema, BoolSchema, DateTimeSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
+ import { Period, PeriodSchema } from "./Period";
3
+
4
+ export interface EstimationOption
5
+ {
6
+ period: Period;
7
+ total_count: number;
8
+ number: number;
9
+ total_value: number;
10
+ value: number;
11
+ active: boolean;
12
+ trial_started_at: Date | null;
13
+ };
14
+
15
+ export class EstimationOptionSchema extends ObjectSchema
16
+ {
17
+ constructor(required: boolean)
18
+ {
19
+ super("EstimationOption", required, [
20
+ new BaseVariableSchema("period", new PeriodSchema(true)),
21
+ new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
22
+ new BaseVariableSchema("number", new IntegerSchema(true, 1)),
23
+ new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
24
+ new BaseVariableSchema("value", new IntegerSchema(true, 1)),
25
+ new BaseVariableSchema("active", new BoolSchema(true)),
26
+ new BaseVariableSchema("trial_started_at", new DateTimeSchema(false)),
27
+ ]);
28
+ this.external = {
29
+ package: "./type/EstimationOption"
30
+ };
31
+ }
32
32
  }
@@ -1,23 +1,23 @@
1
- import { BaseVariableSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
-
3
- export type EstimationUsage =
4
- {
5
- name: string;
6
- value: number;
7
- unit: string;
8
- };
9
-
10
- export class EstimationUsageSchema extends ObjectSchema
11
- {
12
- constructor(required: boolean)
13
- {
14
- super("EstimationUsage", required, [
15
- new BaseVariableSchema("name", new StringSchema(true)),
16
- new BaseVariableSchema("value", new IntegerSchema(true)),
17
- new BaseVariableSchema("unit", new StringSchema(true)),
18
- ]);
19
- this.external = {
20
- package: "./type/EstimationUsage"
21
- };
22
- }
1
+ import { BaseVariableSchema, IntegerSchema, ObjectSchema, StringSchema } from "namirasoft-schema";
2
+
3
+ export type EstimationUsage =
4
+ {
5
+ name: string;
6
+ value: number;
7
+ unit: string;
8
+ };
9
+
10
+ export class EstimationUsageSchema extends ObjectSchema
11
+ {
12
+ constructor(required: boolean)
13
+ {
14
+ super("EstimationUsage", required, [
15
+ new BaseVariableSchema("name", new StringSchema(true)),
16
+ new BaseVariableSchema("value", new IntegerSchema(true)),
17
+ new BaseVariableSchema("unit", new StringSchema(true)),
18
+ ]);
19
+ this.external = {
20
+ package: "./type/EstimationUsage"
21
+ };
22
+ }
23
23
  }
@@ -1,102 +1,102 @@
1
- import { TimeOperation } from "namirasoft-core";
2
- import { BaseVariableSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
3
-
4
- export type Period =
5
- {
6
- year: number;
7
- month: number;
8
- day: number;
9
- hour: number;
10
- start: {
11
- minute: number;
12
- second: number;
13
- };
14
- end: {
15
- minute: number;
16
- second: number;
17
- };
18
- };
19
-
20
- export class PeriodSchema extends ObjectSchema
21
- {
22
- constructor(required: boolean)
23
- {
24
- super("Period", required, [
25
- new BaseVariableSchema("year", new IntegerSchema(true, 0, 9999)),
26
- new BaseVariableSchema("month", new IntegerSchema(true, 1, 12)),
27
- new BaseVariableSchema("day", new IntegerSchema(true, 1, 31)),
28
- new BaseVariableSchema("hour", new IntegerSchema(true, 0, 23)),
29
- new BaseVariableSchema("start", new ObjectSchema("", true, [
30
- new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
31
- new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
32
- ])),
33
- new BaseVariableSchema("end", new ObjectSchema("", true, [
34
- new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
35
- new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
36
- ])),
37
- ]);
38
- this.external = {
39
- package: "./type/Period"
40
- };
41
- }
42
- }
43
- export class PeriodUtil
44
- {
45
- static toSeconds(period: Period)
46
- {
47
- return (period.end.minute * 60 + period.end.second) - (period.start.minute * 60 + period.start.second) + 1
48
- }
49
- static toDates(period: Period)
50
- {
51
- let start = new Date(period.year, period.month - 1, period.day, period.hour, period.start.minute, period.start.second);
52
- let end = new Date(period.year, period.month - 1, period.day, period.hour, period.end.minute, period.end.second);
53
- return { start, end };
54
- }
55
- static byDates(start: Date, end: Date)
56
- {
57
- return {
58
- year: start.getFullYear(),
59
- month: start.getMonth() + 1,
60
- day: start.getDate(),
61
- hour: start.getHours(),
62
- start: {
63
- minute: start.getMinutes(),
64
- second: start.getSeconds(),
65
- },
66
- end: {
67
- minute: end.getMinutes(),
68
- second: end.getSeconds(),
69
- }
70
- };
71
- }
72
- static async loop(start: Date, end: Date, estimate_hour: (period: Period) => Promise<void>): Promise<void>
73
- {
74
- let pre_estimate_hour = async (start: Date, end: Date) =>
75
- {
76
- if (end <= start)
77
- return;
78
- return await estimate_hour(PeriodUtil.byDates(start, end));
79
- }
80
-
81
- let s = start;
82
- let e = null;
83
-
84
- do
85
- {
86
- let next_start = TimeOperation.hoursLater(1, s);
87
- next_start.setMilliseconds(0);
88
- next_start.setSeconds(0);
89
- next_start.setMinutes(0);
90
- if (end < next_start)
91
- {
92
- next_start = end;
93
- e = end;
94
- }
95
- else
96
- e = TimeOperation.secondsAgo(1, next_start);
97
- await pre_estimate_hour(s, e);
98
- s = next_start;
99
- }
100
- while (e < end)
101
- }
1
+ import { TimeOperation } from "namirasoft-core";
2
+ import { BaseVariableSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
3
+
4
+ export type Period =
5
+ {
6
+ year: number;
7
+ month: number;
8
+ day: number;
9
+ hour: number;
10
+ start: {
11
+ minute: number;
12
+ second: number;
13
+ };
14
+ end: {
15
+ minute: number;
16
+ second: number;
17
+ };
18
+ };
19
+
20
+ export class PeriodSchema extends ObjectSchema
21
+ {
22
+ constructor(required: boolean)
23
+ {
24
+ super("Period", required, [
25
+ new BaseVariableSchema("year", new IntegerSchema(true, 0, 9999)),
26
+ new BaseVariableSchema("month", new IntegerSchema(true, 1, 12)),
27
+ new BaseVariableSchema("day", new IntegerSchema(true, 1, 31)),
28
+ new BaseVariableSchema("hour", new IntegerSchema(true, 0, 23)),
29
+ new BaseVariableSchema("start", new ObjectSchema("", true, [
30
+ new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
31
+ new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
32
+ ])),
33
+ new BaseVariableSchema("end", new ObjectSchema("", true, [
34
+ new BaseVariableSchema("minute", new IntegerSchema(true, 0, 59)),
35
+ new BaseVariableSchema("second", new IntegerSchema(true, 0, 59))
36
+ ])),
37
+ ]);
38
+ this.external = {
39
+ package: "./type/Period"
40
+ };
41
+ }
42
+ }
43
+ export class PeriodUtil
44
+ {
45
+ static toSeconds(period: Period)
46
+ {
47
+ return (period.end.minute * 60 + period.end.second) - (period.start.minute * 60 + period.start.second) + 1
48
+ }
49
+ static toDates(period: Period)
50
+ {
51
+ let start = new Date(period.year, period.month - 1, period.day, period.hour, period.start.minute, period.start.second);
52
+ let end = new Date(period.year, period.month - 1, period.day, period.hour, period.end.minute, period.end.second);
53
+ return { start, end };
54
+ }
55
+ static byDates(start: Date, end: Date)
56
+ {
57
+ return {
58
+ year: start.getFullYear(),
59
+ month: start.getMonth() + 1,
60
+ day: start.getDate(),
61
+ hour: start.getHours(),
62
+ start: {
63
+ minute: start.getMinutes(),
64
+ second: start.getSeconds(),
65
+ },
66
+ end: {
67
+ minute: end.getMinutes(),
68
+ second: end.getSeconds(),
69
+ }
70
+ };
71
+ }
72
+ static async loop(start: Date, end: Date, estimate_hour: (period: Period) => Promise<void>): Promise<void>
73
+ {
74
+ let pre_estimate_hour = async (start: Date, end: Date) =>
75
+ {
76
+ if (end <= start)
77
+ return;
78
+ return await estimate_hour(PeriodUtil.byDates(start, end));
79
+ }
80
+
81
+ let s = start;
82
+ let e = null;
83
+
84
+ do
85
+ {
86
+ let next_start = TimeOperation.hoursLater(1, s);
87
+ next_start.setMilliseconds(0);
88
+ next_start.setSeconds(0);
89
+ next_start.setMinutes(0);
90
+ if (end < next_start)
91
+ {
92
+ next_start = end;
93
+ e = end;
94
+ }
95
+ else
96
+ e = TimeOperation.secondsAgo(1, next_start);
97
+ await pre_estimate_hour(s, e);
98
+ s = next_start;
99
+ }
100
+ while (e < end)
101
+ }
102
102
  };
@@ -1,30 +1,30 @@
1
- import { BaseVariableSchema, BoolSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
- import { Period, PeriodSchema } from "./Period";
3
-
4
- export interface SimulationOption
5
- {
6
- period: Period;
7
- total_count: number;
8
- number: number;
9
- total_value: number;
10
- value: number;
11
- active: boolean;
12
- };
13
-
14
- export class SimulationOptionSchema extends ObjectSchema
15
- {
16
- constructor(required: boolean)
17
- {
18
- super("SimulationOption", required, [
19
- new BaseVariableSchema("period", new PeriodSchema(true)),
20
- new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
21
- new BaseVariableSchema("number", new IntegerSchema(true, 1)),
22
- new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
23
- new BaseVariableSchema("value", new IntegerSchema(true, 1)),
24
- new BaseVariableSchema("active", new BoolSchema(true)),
25
- ]);
26
- this.external = {
27
- package: "./type/SimulationOption"
28
- };
29
- }
1
+ import { BaseVariableSchema, BoolSchema, IntegerSchema, ObjectSchema } from "namirasoft-schema";
2
+ import { Period, PeriodSchema } from "./Period";
3
+
4
+ export interface SimulationOption
5
+ {
6
+ period: Period;
7
+ total_count: number;
8
+ number: number;
9
+ total_value: number;
10
+ value: number;
11
+ active: boolean;
12
+ };
13
+
14
+ export class SimulationOptionSchema extends ObjectSchema
15
+ {
16
+ constructor(required: boolean)
17
+ {
18
+ super("SimulationOption", required, [
19
+ new BaseVariableSchema("period", new PeriodSchema(true)),
20
+ new BaseVariableSchema("total_count", new IntegerSchema(true, 0)),
21
+ new BaseVariableSchema("number", new IntegerSchema(true, 1)),
22
+ new BaseVariableSchema("total_value", new IntegerSchema(true, 0)),
23
+ new BaseVariableSchema("value", new IntegerSchema(true, 1)),
24
+ new BaseVariableSchema("active", new BoolSchema(true)),
25
+ ]);
26
+ this.external = {
27
+ package: "./type/SimulationOption"
28
+ };
29
+ }
30
30
  }
package/src/type/Usage.ts CHANGED
@@ -1,25 +1,25 @@
1
- export class Usage
2
- {
3
- static Time = {
4
- name: "Time",
5
- units: {
6
- Second: {
7
- name: "Second"
8
- },
9
- Minute: {
10
- name: "Minute"
11
- },
12
- Hour: {
13
- name: "Hour"
14
- }
15
- }
16
- };
17
- static APICALL = {
18
- name: "API Call",
19
- units: {
20
- REQUEST: {
21
- name: "Request"
22
- }
23
- }
24
- };
1
+ export class Usage
2
+ {
3
+ static Time = {
4
+ name: "Time",
5
+ units: {
6
+ Second: {
7
+ name: "Second"
8
+ },
9
+ Minute: {
10
+ name: "Minute"
11
+ },
12
+ Hour: {
13
+ name: "Hour"
14
+ }
15
+ }
16
+ };
17
+ static APICALL = {
18
+ name: "API Call",
19
+ units: {
20
+ REQUEST: {
21
+ name: "Request"
22
+ }
23
+ }
24
+ };
25
25
  };
@@ -1,10 +0,0 @@
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
- }
@@ -1,27 +0,0 @@
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", true);
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
@@ -1 +0,0 @@
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,EAAE,IAAI,CAAC,CAAC;QAFhB,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"}
@@ -1,15 +0,0 @@
1
- import { Estimation } from "../type/Estimation";
2
- import { EstimationOption } from "../type/EstimationOption";
3
- import { BaseBonus } from "./BaseBonus";
4
-
5
- export class LowTotalCountBonus extends BaseBonus
6
- {
7
- constructor(public count: number)
8
- {
9
- super("Low Total Count", true);
10
- }
11
- async isFree(option: EstimationOption, _: Estimation)
12
- {
13
- return { free: option.total_count <= this.count };
14
- }
15
- };