namirasoft-cost 1.4.31 → 1.4.32

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 (97) hide show
  1. package/.ns-sdkg-dir-deep +3 -3
  2. package/.ns-sdkg-file-keep +28 -36
  3. package/dist/bonus/BaseBonus.d.ts +2 -1
  4. package/dist/bonus/BaseBonus.js +2 -1
  5. package/dist/bonus/BaseBonus.js.map +1 -1
  6. package/dist/bonus/DeactiveBonus.js +1 -1
  7. package/dist/bonus/DeactiveBonus.js.map +1 -1
  8. package/dist/bonus/FreeCountBonus.js +1 -1
  9. package/dist/bonus/FreeCountBonus.js.map +1 -1
  10. package/dist/bonus/FreeTotalValueBonus.js +1 -1
  11. package/dist/bonus/FreeTotalValueBonus.js.map +1 -1
  12. package/dist/bonus/FreeValueBonus.d.ts +33 -0
  13. package/dist/bonus/FreeValueBonus.js +35 -0
  14. package/dist/bonus/FreeValueBonus.js.map +1 -0
  15. package/dist/bonus/LowAmountBonus.js +1 -1
  16. package/dist/bonus/LowAmountBonus.js.map +1 -1
  17. package/dist/bonus/LowSecondsBonus.js +1 -1
  18. package/dist/bonus/LowSecondsBonus.js.map +1 -1
  19. package/dist/bonus/LowTotalCountBonus.js +1 -1
  20. package/dist/bonus/LowTotalCountBonus.js.map +1 -1
  21. package/dist/bonus/LowTotalValueBonus.js +1 -1
  22. package/dist/bonus/LowTotalValueBonus.js.map +1 -1
  23. package/dist/bonus/LowValueBonus.d.ts +10 -0
  24. package/dist/bonus/LowValueBonus.js +27 -0
  25. package/dist/bonus/LowValueBonus.js.map +1 -0
  26. package/dist/bonus/TrialBonus.js +1 -1
  27. package/dist/bonus/TrialBonus.js.map +1 -1
  28. package/dist/estimator/SecretSecretReadEstimator.js.map +1 -1
  29. package/dist/index.d.ts +2 -0
  30. package/dist/index.js +2 -0
  31. package/dist/index.js.map +1 -1
  32. package/package.json +28 -28
  33. package/src/NamirasoftCostServer.ts +59 -59
  34. package/src/NamirasoftCostServerBase.ts +29 -29
  35. package/src/NamirasoftCostServerBillWatchAWS.ts +47 -47
  36. package/src/NamirasoftCostServerBillWatchAzure.ts +47 -47
  37. package/src/NamirasoftCostServerBillWatchGCP.ts +47 -47
  38. package/src/NamirasoftCostServerCost.ts +41 -41
  39. package/src/NamirasoftCostServerFieldCategory.ts +47 -47
  40. package/src/NamirasoftCostServerFieldField.ts +47 -47
  41. package/src/NamirasoftCostServerHealthz.ts +35 -35
  42. package/src/NamirasoftCostServerMetrics.ts +35 -35
  43. package/src/NamirasoftCostServerSecretSecret.ts +61 -61
  44. package/src/NamirasoftCostServerValue.ts +36 -36
  45. package/src/bonus/BaseBonus.ts +13 -13
  46. package/src/bonus/DeactiveBonus.ts +14 -14
  47. package/src/bonus/FreeCountBonus.ts +14 -14
  48. package/src/bonus/FreeTotalValueBonus.ts +28 -28
  49. package/src/bonus/FreeValueBonus.ts +25 -0
  50. package/src/bonus/LowAmountBonus.ts +14 -14
  51. package/src/bonus/LowSecondsBonus.ts +14 -14
  52. package/src/bonus/LowTotalCountBonus.ts +14 -14
  53. package/src/bonus/LowTotalValueBonus.ts +14 -14
  54. package/src/bonus/LowValueBonus.ts +15 -0
  55. package/src/bonus/TrialBonus.ts +18 -18
  56. package/src/command/BillWatchAWSCommand.ts +33 -33
  57. package/src/command/BillWatchAWSEstimateRecordCommand.ts +109 -109
  58. package/src/command/BillWatchAWS_CreateForRecordCommand.ts +118 -118
  59. package/src/command/BillWatchAzureCommand.ts +33 -33
  60. package/src/command/BillWatchAzureEstimateRecordCommand.ts +109 -109
  61. package/src/command/BillWatchAzure_CreateForRecordCommand.ts +118 -118
  62. package/src/command/BillWatchGCPCommand.ts +33 -33
  63. package/src/command/BillWatchGCPEstimateRecordCommand.ts +109 -109
  64. package/src/command/BillWatchGCP_CreateForRecordCommand.ts +118 -118
  65. package/src/command/CostCommand.ts +31 -31
  66. package/src/command/CostListCommand.ts +44 -44
  67. package/src/command/FieldCategoryCommand.ts +33 -33
  68. package/src/command/FieldCategoryEstimateRecordCommand.ts +109 -109
  69. package/src/command/FieldCategory_CreateForRecordCommand.ts +118 -118
  70. package/src/command/FieldFieldCommand.ts +33 -33
  71. package/src/command/FieldFieldEstimateRecordCommand.ts +109 -109
  72. package/src/command/FieldField_CreateForRecordCommand.ts +118 -118
  73. package/src/command/HealthzCommand.ts +31 -31
  74. package/src/command/HealthzGetCommand.ts +44 -44
  75. package/src/command/MetricsCommand.ts +31 -31
  76. package/src/command/MetricsGetCommand.ts +44 -44
  77. package/src/command/SecretSecretCommand.ts +37 -37
  78. package/src/command/SecretSecretEstimateReadCommand.ts +109 -109
  79. package/src/command/SecretSecretEstimateRecordCommand.ts +109 -109
  80. package/src/command/SecretSecret_CreateForReadCommand.ts +118 -118
  81. package/src/command/SecretSecret_CreateForRecordCommand.ts +118 -118
  82. package/src/command/ValueCommand.ts +31 -31
  83. package/src/command/ValueListCommand.ts +44 -44
  84. package/src/command/cli.ts +50 -50
  85. package/src/estimator/SecretSecretReadEstimator.ts +0 -1
  86. package/src/index.ts +91 -89
  87. package/src/meta/CostMetaTable.ts +81 -81
  88. package/src/meta/NamirasoftCostMetaDatabase.ts +50 -50
  89. package/src/row/CostRow.ts +40 -40
  90. package/src/type/Bonus.ts +20 -20
  91. package/src/type/CalculationOption.ts +33 -33
  92. package/src/type/Estimation.ts +34 -34
  93. package/src/type/EstimationOption.ts +31 -31
  94. package/src/type/EstimationUsage.ts +22 -22
  95. package/src/type/Period.ts +101 -101
  96. package/src/type/SimulationOption.ts +29 -29
  97. package/src/type/Usage.ts +24 -24
@@ -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
  };