amlich-api 0.2.0 → 0.2.2

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/README.md CHANGED
@@ -39,11 +39,13 @@ Constructor options:
39
39
  ```ts
40
40
  await api.today(7);
41
41
  await api.day("2026-02-21", 7, 22);
42
+ await api.days("2026-03-01", "2026-04-05", 7);
42
43
  await api.month(2026, 2, 7);
43
44
  ```
44
45
 
45
46
  - `today(tz?: number)` -> `GET /today`
46
47
  - `day(date: string, tz?: number, hour?: number)` -> `GET /day`
48
+ - `days(from: string, to: string, tz?: number)` -> `GET /days`
47
49
  - `month(year: number, month: number, tz?: number)` -> `GET /month`
48
50
 
49
51
  ### Tra cứu can chi / tương hợp
@@ -81,7 +83,7 @@ await api.warnings({
81
83
  date: "2026-02-21",
82
84
  tz: 7,
83
85
  userYear: 1987,
84
- purpose: "khaisuong",
86
+ purpose: "khaitruong",
85
87
  ruleset: "vn-basic",
86
88
  });
87
89
 
@@ -89,7 +91,7 @@ await api.pick({
89
91
  from: "2026-02-20",
90
92
  to: "2026-03-15",
91
93
  tz: 7,
92
- purpose: "khaisuong",
94
+ purpose: "khaitruong",
93
95
  userYear: 1987,
94
96
  limit: 5,
95
97
  maxDays: 92,
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  type UnknownFields = {
2
2
  [key: string]: unknown;
3
3
  };
4
- type Purpose = "khaisuong" | "cuoihoi" | "dongtho" | "nhaptrach" | "xuat_hanh" | (string & {});
4
+ type Purpose = "khaitruong" | "cuoihoi" | "dongtho" | "nhaptrach" | "xuat_hanh" | (string & {});
5
5
  type TodayResponse = {
6
6
  date: string;
7
7
  } & UnknownFields;
@@ -10,6 +10,11 @@ type DayResponse = {
10
10
  solar?: unknown;
11
11
  lunar?: unknown;
12
12
  } & UnknownFields;
13
+ type DaysResponse = {
14
+ from?: string;
15
+ to?: string;
16
+ days?: unknown[];
17
+ } & UnknownFields;
13
18
  type MonthResponse = {
14
19
  year: number;
15
20
  month: number;
@@ -133,6 +138,7 @@ declare class AmLichClient {
133
138
  constructor(options?: AmLichClientOptions);
134
139
  today(tz?: number): Promise<TodayResponse>;
135
140
  day(date: string, tz?: number, hour?: number): Promise<DayResponse>;
141
+ days(from: string, to: string, tz?: number): Promise<DaysResponse>;
136
142
  month(year: number, month: number, tz?: number): Promise<MonthResponse>;
137
143
  napam(name: string): Promise<NapAmResponse>;
138
144
  chiRelations(chi: string): Promise<ChiRelationsResponse>;
@@ -153,4 +159,4 @@ declare class AmLichClient {
153
159
  private request;
154
160
  }
155
161
 
156
- export { AmLichClient, type AmLichClientOptions, AmLichError, type ChiRelationsResponse, type CompatResponse, type ConvertRequest, type ConvertResponse, type DayResponse, type MonthResponse, type NapAmResponse, type NgayKyResponse, type PickQuery, type PickResponse, type SaoTuResponse, type ThanSatResponse, type TietKhiResponse, type TietKhiYearResponse, type TodayResponse, type WarningsQuery, type WarningsResponse };
162
+ export { AmLichClient, type AmLichClientOptions, AmLichError, type ChiRelationsResponse, type CompatResponse, type ConvertRequest, type ConvertResponse, type DayResponse, type DaysResponse, type MonthResponse, type NapAmResponse, type NgayKyResponse, type PickQuery, type PickResponse, type SaoTuResponse, type ThanSatResponse, type TietKhiResponse, type TietKhiYearResponse, type TodayResponse, type WarningsQuery, type WarningsResponse };
package/dist/index.js CHANGED
@@ -49,6 +49,13 @@ var AmLichClient = class {
49
49
  hour
50
50
  });
51
51
  }
52
+ days(from, to, tz) {
53
+ return this.get("/days", {
54
+ from,
55
+ to,
56
+ tz
57
+ });
58
+ }
52
59
  month(year, month, tz) {
53
60
  return this.get("/month", {
54
61
  year,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "amlich-api",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "TypeScript client SDK for AmLich API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",