bgmt 0.1.2 → 0.2.0

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/dist/cdn.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as SubjectSearch, i as SubjectRating, n as FullSubject, r as SubjectImage, t as BasicSubject } from "./types-CDKF8vJi.mjs";
1
+ import { a as SubjectSearch, i as SubjectRating, n as FullSubject, r as SubjectImage, t as BasicSubject } from "./types-B_6x1YN9.mjs";
2
2
 
3
3
  //#region src/cdn/index.d.ts
4
4
  interface CdnOptions {
@@ -15,9 +15,16 @@ interface CdnOptions {
15
15
  */
16
16
  baseURL?: string;
17
17
  }
18
- declare function fetchBasicSubjects(options?: CdnOptions): Promise<BasicSubject[]>;
19
- declare function fetchFullSubjects(options?: CdnOptions): Promise<FullSubject[]>;
20
- declare function fetchCalendarSubjects(options: CdnOptions): Promise<{
18
+ declare function fetchBasicSubjects(options?: CdnOptions): Promise<{
19
+ version: string;
20
+ subjects: BasicSubject[];
21
+ }>;
22
+ declare function fetchFullSubjects(options?: CdnOptions): Promise<{
23
+ version: string;
24
+ subjects: FullSubject[];
25
+ }>;
26
+ declare function fetchCalendarSubjects(options?: CdnOptions): Promise<{
27
+ version: string;
21
28
  calendar: [BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[], BasicSubject[]];
22
29
  web: BasicSubject[];
23
30
  }>;
package/dist/cdn.mjs CHANGED
@@ -3,20 +3,19 @@ async function fetchBasicSubjects(options = {}) {
3
3
  const { version = "0", baseURL = "https://unpkg.com" } = options;
4
4
  const resp = await fetch(`${baseURL}/bgmd@${version}/dist/index.json`);
5
5
  if (!resp.ok) throw new Error(`Fetch bgmd index.json failed`, { cause: resp });
6
- return (await resp.json()).bangumis;
6
+ return await resp.json();
7
7
  }
8
8
  async function fetchFullSubjects(options = {}) {
9
9
  const { version = "0", baseURL = "https://unpkg.com" } = options;
10
10
  const resp = await fetch(`${baseURL}/bgmd@${version}/dist/full.json`);
11
11
  if (!resp.ok) throw new Error(`Fetch bgmd full.json failed`, { cause: resp });
12
- return (await resp.json()).bangumis;
12
+ return await resp.json();
13
13
  }
14
- async function fetchCalendarSubjects(options) {
14
+ async function fetchCalendarSubjects(options = {}) {
15
15
  const { version = "0", baseURL = "https://unpkg.com" } = options;
16
16
  const resp = await fetch(`${baseURL}/bgmd@${version}/dist/calendar.json`);
17
17
  if (!resp.ok) throw new Error(`Fetch bgmd calendar.json failed`, { cause: resp });
18
- return (await resp.json()).calendar;
18
+ return await resp.json();
19
19
  }
20
-
21
20
  //#endregion
22
- export { fetchBasicSubjects, fetchCalendarSubjects, fetchFullSubjects };
21
+ export { fetchBasicSubjects, fetchCalendarSubjects, fetchFullSubjects };