@chukyo-umebo/web_parser 0.0.1 → 0.0.3

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
@@ -1,4 +1,4 @@
1
- # @chukyo-passpal/web_parser
1
+ # @chukyo-umebo/web_parser
2
2
 
3
3
  中京大学の各種システム(Albo, Cubics, Manabo)のHTMLを解析し、構造化されたデータとして抽出するためのTypeScriptライブラリです。
4
4
 
@@ -11,15 +11,15 @@
11
11
  ## インストール
12
12
 
13
13
  ```bash
14
- bun add @chukyo-passpal/web_parser
14
+ bun add @chukyo-umebo/web_parser
15
15
  # または
16
- npm install @chukyo-passpal/web_parser
16
+ npm install @chukyo-umebo/web_parser
17
17
  ```
18
18
 
19
19
  ## 使い方
20
20
 
21
21
  ```typescript
22
- import { parseManaboNews } from "@chukyo-passpal/web_parser";
22
+ import { parseManaboNews } from "@chukyo-umebo/web_parser";
23
23
 
24
24
  const html = `...`; // 取得したHTML文字列
25
25
  const result = parseManaboNews(html);
@@ -33,7 +33,7 @@ if (result.success) {
33
33
 
34
34
  ## 対応システム
35
35
 
36
- - **Albo**: アルバイト情報など
36
+ - **Albo**: お知らせ情報など
37
37
  - **Cubics**: 履修登録、時間割など
38
38
  - **Manabo**: ポータルサイト(お知らせ、課題、メールなど)
39
39
 
@@ -1,5 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseCubicsPtNews = void 0;
3
+ exports.parseAlboTimetable = exports.parseAlboPersonal = exports.parseAlboInformation = exports.parseAlboCalendar = void 0;
4
4
  var albo_1 = require("./parser/albo");
5
- Object.defineProperty(exports, "parseCubicsPtNews", { enumerable: true, get: function () { return albo_1.parseCubicsPtNews; } });
5
+ Object.defineProperty(exports, "parseAlboCalendar", { enumerable: true, get: function () { return albo_1.parseAlboCalendar; } });
6
+ Object.defineProperty(exports, "parseAlboInformation", { enumerable: true, get: function () { return albo_1.parseAlboInformation; } });
7
+ Object.defineProperty(exports, "parseAlboPersonal", { enumerable: true, get: function () { return albo_1.parseAlboPersonal; } });
8
+ Object.defineProperty(exports, "parseAlboTimetable", { enumerable: true, get: function () { return albo_1.parseAlboTimetable; } });
@@ -1,52 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.parseCubicsPtNews = void 0;
4
- const dom_1 = require("../../common/dom");
3
+ exports.parseAlboTimetable = exports.parseAlboPersonal = exports.parseAlboInformation = exports.parseAlboCalendar = void 0;
5
4
  const albo_1 = require("../types/albo");
6
- const utils_1 = require("../../common/utils");
7
- const parseNewsEntry = (row) => {
8
- const categoryImg = (0, dom_1.queryOne)("th.category img", row);
9
- const statusImg = (0, dom_1.queryOne)("td.status img", row);
10
- const headlineAnchor = (0, dom_1.queryOne)("td.headline a", row);
11
- if (!headlineAnchor) {
12
- return null;
5
+ const parseAlboJson = (input, schema) => {
6
+ try {
7
+ return schema.safeParse(JSON.parse(input));
8
+ }
9
+ catch {
10
+ return schema.safeParse(undefined);
13
11
  }
14
- const title = (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)(headlineAnchor));
15
- const onclick = (0, dom_1.getAttribute)(headlineAnchor, "onclick") ?? "";
16
- const href = (0, dom_1.getAttribute)(headlineAnchor, "href");
17
- const link = (0, utils_1.extractFirstQuotedValue)(onclick) ?? href ?? null;
18
- return {
19
- category: (0, dom_1.getAttribute)(categoryImg, "alt"),
20
- status: (0, dom_1.getAttribute)(statusImg, "alt") ?? (0, dom_1.getAttribute)(statusImg, "src"),
21
- title,
22
- link,
23
- };
24
- };
25
- const parseCubicsPtNews = (html) => {
26
- const document = (0, dom_1.loadDocument)(html);
27
- const tabs = (0, dom_1.queryAll)("#tab_element li", document).map((tab) => {
28
- const anchor = (0, dom_1.queryOne)("a", tab);
29
- const href = (0, dom_1.getAttribute)(anchor, "href") ?? "";
30
- const targetId = href.replace(/^#/, "");
31
- const title = (0, utils_1.normalizeWhitespace)(anchor ? (0, dom_1.getTextContent)(anchor) : "");
32
- const rows = (0, dom_1.queryAll)(`#${targetId} table.tab-newslist tr`, document)
33
- .map((row) => parseNewsEntry(row))
34
- .filter((entry) => entry !== null);
35
- return {
36
- id: targetId,
37
- title,
38
- entries: rows,
39
- active: (0, dom_1.elementHasClass)(tab, "selected"),
40
- };
41
- });
42
- const selectedTab = tabs.find((tab) => tab.active);
43
- return albo_1.CubicsPtNewsSchema.safeParse({
44
- selectedTabId: selectedTab ? selectedTab.id : null,
45
- tabs: tabs.map((tab) => ({
46
- id: tab.id,
47
- title: tab.title,
48
- entries: tab.entries,
49
- })),
50
- });
51
12
  };
52
- exports.parseCubicsPtNews = parseCubicsPtNews;
13
+ const parseAlboCalendar = (json) => parseAlboJson(json, albo_1.AlboCalendarSchema);
14
+ exports.parseAlboCalendar = parseAlboCalendar;
15
+ const parseAlboInformation = (json) => parseAlboJson(json, albo_1.AlboInformationSchema);
16
+ exports.parseAlboInformation = parseAlboInformation;
17
+ const parseAlboPersonal = (json) => parseAlboJson(json, albo_1.AlboPersonalSchema);
18
+ exports.parseAlboPersonal = parseAlboPersonal;
19
+ const parseAlboTimetable = (json) => parseAlboJson(json, albo_1.AlboTimetableSchema);
20
+ exports.parseAlboTimetable = parseAlboTimetable;
@@ -1,19 +1,216 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CubicsPtNewsSchema = exports.CubicsPtNewsTabSchema = exports.CubicsPtNewsEntrySchema = void 0;
3
+ exports.AlboPersonalSchema = exports.AlboPersonalUserSchema = exports.AlboPersonalGroupSchema = exports.AlboPersonalAuthProfileSchema = exports.AlboInformationSchema = exports.AlboInformationItemSchema = exports.AlboInformationFileSchema = exports.AlboInformationCategorySchema = exports.AlboTimetableSchema = exports.AlboTimetableItemSchema = exports.AlboTimetableBadgeSchema = exports.AlboCalendarSchema = exports.AlboCalendarItemSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- exports.CubicsPtNewsEntrySchema = zod_1.z.object({
6
- category: zod_1.z.string().nullable(),
7
- status: zod_1.z.string().nullable(),
8
- title: zod_1.z.string(),
9
- link: zod_1.z.string().nullable(),
5
+ exports.AlboCalendarItemSchema = zod_1.z.object({
6
+ calendar_source_uuid: zod_1.z.string(),
7
+ summary: zod_1.z.string(),
8
+ description: zod_1.z.string().nullable(),
9
+ start_at: zod_1.z.number(),
10
+ end_at: zod_1.z.number(),
11
+ created_at: zod_1.z.number(),
12
+ });
13
+ exports.AlboCalendarSchema = zod_1.z.object({
14
+ is_successful: zod_1.z.boolean(),
15
+ code: zod_1.z.number(),
16
+ api_version: zod_1.z.number(),
17
+ gmt: zod_1.z.number(),
18
+ user: zod_1.z.unknown().nullable(),
19
+ result: zod_1.z.object({
20
+ page_total: zod_1.z.number(),
21
+ page_size: zod_1.z.number(),
22
+ item_count: zod_1.z.number(),
23
+ source_name: zod_1.z.string(),
24
+ items: zod_1.z.array(exports.AlboCalendarItemSchema),
25
+ }),
26
+ });
27
+ exports.AlboTimetableBadgeSchema = zod_1.z.object({
28
+ term: zod_1.z.string(),
10
29
  });
11
- exports.CubicsPtNewsTabSchema = zod_1.z.object({
30
+ exports.AlboTimetableItemSchema = zod_1.z.object({
31
+ uuid: zod_1.z.string(),
12
32
  id: zod_1.z.string(),
33
+ execute_date: zod_1.z.string(),
34
+ day_of_week: zod_1.z.number(),
35
+ time_number: zod_1.z.number(),
36
+ class_id: zod_1.z.string(),
37
+ class_name: zod_1.z.string(),
38
+ term: zod_1.z.string(),
39
+ campus: zod_1.z.string(),
40
+ teacher: zod_1.z.string(),
41
+ room: zod_1.z.string().nullable(),
42
+ memo: zod_1.z.string(),
43
+ options: zod_1.z.unknown().nullable(),
44
+ created_at: zod_1.z.number(),
45
+ execute_school_year: zod_1.z.string(),
46
+ class_type: zod_1.z.number(),
47
+ memo_en: zod_1.z.string().nullable(),
48
+ options_en: zod_1.z.unknown().nullable(),
49
+ order: zod_1.z.number(),
50
+ badge: exports.AlboTimetableBadgeSchema,
51
+ term_en: zod_1.z.string(),
52
+ class_name_en: zod_1.z.string(),
53
+ campus_en: zod_1.z.string(),
54
+ cancels: zod_1.z.array(zod_1.z.unknown()),
55
+ extras: zod_1.z.array(zod_1.z.unknown()),
56
+ changes: zod_1.z.array(zod_1.z.unknown()),
57
+ });
58
+ exports.AlboTimetableSchema = zod_1.z.object({
59
+ is_successful: zod_1.z.boolean(),
60
+ code: zod_1.z.number(),
61
+ api_version: zod_1.z.number(),
62
+ gmt: zod_1.z.number(),
63
+ user: zod_1.z.unknown().nullable(),
64
+ result: zod_1.z.object({
65
+ time_table_type: zod_1.z.string(),
66
+ page_total: zod_1.z.number(),
67
+ page_size: zod_1.z.number(),
68
+ item_count: zod_1.z.number(),
69
+ items: zod_1.z.array(exports.AlboTimetableItemSchema),
70
+ }),
71
+ });
72
+ exports.AlboInformationCategorySchema = zod_1.z.object({
73
+ uuid: zod_1.z.string(),
74
+ name: zod_1.z.string(),
75
+ name_en: zod_1.z.string().nullable(),
76
+ description: zod_1.z.string().nullable(),
77
+ description_en: zod_1.z.string().nullable(),
78
+ order: zod_1.z.number(),
79
+ is_for_guest: zod_1.z.boolean(),
80
+ created_by: zod_1.z.string(),
81
+ updated_by: zod_1.z.string().nullable(),
82
+ created_at: zod_1.z.number(),
83
+ updated_at: zod_1.z.number(),
84
+ });
85
+ exports.AlboInformationFileSchema = zod_1.z.object({
86
+ uuid: zod_1.z.string(),
87
+ file_name: zod_1.z.string(),
88
+ mime_type: zod_1.z.string(),
89
+ is_thumb_exists: zod_1.z.boolean(),
90
+ created_by: zod_1.z.string(),
91
+ created_at: zod_1.z.number(),
92
+ });
93
+ exports.AlboInformationItemSchema = zod_1.z.object({
94
+ uuid: zod_1.z.string(),
95
+ publish_from: zod_1.z.string(),
96
+ publish_from_en: zod_1.z.string().nullable(),
97
+ publish_department_en: zod_1.z.string().nullable(),
98
+ publish_start_at: zod_1.z.number(),
99
+ publish_end_at: zod_1.z.number(),
13
100
  title: zod_1.z.string(),
14
- entries: zod_1.z.array(exports.CubicsPtNewsEntrySchema),
101
+ title_en: zod_1.z.string().nullable(),
102
+ content: zod_1.z.string(),
103
+ content_en: zod_1.z.string().nullable(),
104
+ priority: zod_1.z.number(),
105
+ event_title: zod_1.z.string().nullable(),
106
+ event_title_en: zod_1.z.string().nullable(),
107
+ event_start_at: zod_1.z.number().nullable(),
108
+ event_end_at: zod_1.z.number().nullable(),
109
+ is_send_mail_notification: zod_1.z.number(),
110
+ mail_from: zod_1.z.string().nullable(),
111
+ options: zod_1.z.unknown().nullable(),
112
+ created_by: zod_1.z.string(),
113
+ updated_by: zod_1.z.string().nullable(),
114
+ created_at: zod_1.z.number(),
115
+ is_template: zod_1.z.number(),
116
+ is_public: zod_1.z.boolean(),
117
+ is_read: zod_1.z.boolean(),
118
+ is_pinned: zod_1.z.boolean(),
119
+ is_reacted_good: zod_1.z.boolean(),
120
+ good_count: zod_1.z.number(),
121
+ category: exports.AlboInformationCategorySchema,
122
+ files: zod_1.z.array(exports.AlboInformationFileSchema).nullable(),
123
+ personal_files: zod_1.z.array(exports.AlboInformationFileSchema).nullable(),
124
+ images: zod_1.z.array(exports.AlboInformationFileSchema).nullable(),
125
+ });
126
+ exports.AlboInformationSchema = zod_1.z.object({
127
+ is_successful: zod_1.z.boolean(),
128
+ code: zod_1.z.number(),
129
+ api_version: zod_1.z.number(),
130
+ gmt: zod_1.z.number(),
131
+ user: zod_1.z.unknown().nullable(),
132
+ result: zod_1.z.object({
133
+ page_total: zod_1.z.number(),
134
+ page_size: zod_1.z.number(),
135
+ item_count: zod_1.z.number(),
136
+ items: zod_1.z.array(exports.AlboInformationItemSchema),
137
+ }),
138
+ });
139
+ exports.AlboPersonalAuthProfileSchema = zod_1.z.object({
140
+ uuid: zod_1.z.string(),
141
+ name: zod_1.z.string(),
142
+ created_at: zod_1.z.number(),
143
+ updated_at: zod_1.z.number().nullable(),
144
+ });
145
+ exports.AlboPersonalGroupSchema = zod_1.z.object({
146
+ group_index: zod_1.z.string(),
147
+ next_group_index: zod_1.z.string(),
148
+ orig_group_index: zod_1.z.string(),
149
+ uuid: zod_1.z.string(),
150
+ name: zod_1.z.string(),
151
+ name_en: zod_1.z.string().nullable(),
152
+ is_authority: zod_1.z.boolean(),
153
+ order: zod_1.z.number(),
154
+ is_active: zod_1.z.number(),
155
+ is_shown_in_signup: zod_1.z.number(),
156
+ created_at: zod_1.z.number(),
157
+ updated_at: zod_1.z.number(),
158
+ full_name: zod_1.z.string(),
159
+ display_name: zod_1.z.string(),
160
+ display_name_en: zod_1.z.string(),
161
+ });
162
+ exports.AlboPersonalUserSchema = zod_1.z.object({
163
+ uuid: zod_1.z.string(),
164
+ personal_id: zod_1.z.string(),
165
+ name: zod_1.z.string(),
166
+ name_kana: zod_1.z.string(),
167
+ name_alphabet: zod_1.z.string(),
168
+ email: zod_1.z.string(),
169
+ locale: zod_1.z.string(),
170
+ option_1: zod_1.z.string().nullable(),
171
+ option_2: zod_1.z.string().nullable(),
172
+ option_3: zod_1.z.string().nullable(),
173
+ option_4: zod_1.z.string().nullable(),
174
+ option_5: zod_1.z.string().nullable(),
175
+ option_6: zod_1.z.string().nullable(),
176
+ option_7: zod_1.z.string().nullable(),
177
+ option_8: zod_1.z.string().nullable(),
178
+ option_9: zod_1.z.string().nullable(),
179
+ option_10: zod_1.z.string().nullable(),
180
+ approval_status: zod_1.z.string().nullable(),
181
+ is_user_enabled: zod_1.z.boolean(),
182
+ is_login_enabled: zod_1.z.boolean(),
183
+ is_guest: zod_1.z.boolean(),
184
+ start_at: zod_1.z.number(),
185
+ end_at: zod_1.z.number(),
186
+ memo: zod_1.z.string().nullable(),
187
+ admin_memo: zod_1.z.string().nullable(),
188
+ is_not_delete_csv: zod_1.z.boolean(),
189
+ created_at: zod_1.z.number(),
190
+ updated_at: zod_1.z.number(),
191
+ user_id: zod_1.z.string(),
192
+ auth_profiles: exports.AlboPersonalAuthProfileSchema,
193
+ groups: zod_1.z.array(exports.AlboPersonalGroupSchema),
194
+ has_answer_force_questionnaire: zod_1.z.boolean(),
195
+ has_force_questionnaire: zod_1.z.boolean(),
196
+ sub_email_addresses: zod_1.z.array(zod_1.z.string()),
197
+ display_group_names: zod_1.z.array(zod_1.z.string()),
198
+ display_group_names_en: zod_1.z.array(zod_1.z.string()),
199
+ portrait: zod_1.z.string().nullable(),
200
+ permission: zod_1.z.string(),
201
+ permission_unit: zod_1.z.array(zod_1.z.unknown()),
202
+ has_local_auth: zod_1.z.boolean(),
203
+ affiliated_groups: zod_1.z.unknown().nullable(),
15
204
  });
16
- exports.CubicsPtNewsSchema = zod_1.z.object({
17
- selectedTabId: zod_1.z.string().nullable(),
18
- tabs: zod_1.z.array(exports.CubicsPtNewsTabSchema),
205
+ exports.AlboPersonalSchema = zod_1.z.object({
206
+ is_successful: zod_1.z.boolean(),
207
+ code: zod_1.z.number(),
208
+ api_version: zod_1.z.number(),
209
+ gmt: zod_1.z.number(),
210
+ user: exports.AlboPersonalUserSchema,
211
+ result: zod_1.z.object({
212
+ login: zod_1.z.string(),
213
+ message: zod_1.z.string(),
214
+ login_message: zod_1.z.string().nullable(),
215
+ }),
19
216
  });
@@ -1,3 +1,3 @@
1
- export { parseCubicsPtNews } from "./parser/albo";
2
- export { type CubicsPtNewsDTO, type CubicsPtNewsTabDTO, type CubicsPtNewsEntryDTO } from "./types/albo";
1
+ export { parseAlboCalendar, parseAlboInformation, parseAlboPersonal, parseAlboTimetable } from "./parser/albo";
2
+ export { type AlboCalendarDTO, type AlboCalendarItemDTO, type AlboTimetableDTO, type AlboTimetableBadgeDTO, type AlboTimetableItemDTO, type AlboInformationDTO, type AlboInformationCategoryDTO, type AlboInformationFileDTO, type AlboInformationItemDTO, type AlboPersonalDTO, type AlboPersonalAuthProfileDTO, type AlboPersonalGroupDTO, type AlboPersonalUserDTO, } from "./types/albo";
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/albo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,KAAK,oBAAoB,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/albo/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,kBAAkB,EACvB,KAAK,0BAA0B,EAC/B,KAAK,sBAAsB,EAC3B,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GAC3B,MAAM,cAAc,CAAC"}
@@ -1 +1 @@
1
- export { parseCubicsPtNews } from "./parser/albo";
1
+ export { parseAlboCalendar, parseAlboInformation, parseAlboPersonal, parseAlboTimetable } from "./parser/albo";
@@ -1,4 +1,7 @@
1
- import { type CubicsPtNewsDTO } from "../types/albo";
2
1
  import type { ZodSafeParseResult } from "zod";
3
- export declare const parseCubicsPtNews: (html: string) => ZodSafeParseResult<CubicsPtNewsDTO>;
2
+ import { type AlboCalendarDTO, type AlboInformationDTO, type AlboPersonalDTO, type AlboTimetableDTO } from "../types/albo";
3
+ export declare const parseAlboCalendar: (json: string) => ZodSafeParseResult<AlboCalendarDTO>;
4
+ export declare const parseAlboInformation: (json: string) => ZodSafeParseResult<AlboInformationDTO>;
5
+ export declare const parseAlboPersonal: (json: string) => ZodSafeParseResult<AlboPersonalDTO>;
6
+ export declare const parseAlboTimetable: (json: string) => ZodSafeParseResult<AlboTimetableDTO>;
4
7
  //# sourceMappingURL=albo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"albo.d.ts","sourceRoot":"","sources":["../../../../src/albo/parser/albo.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiD,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AACpG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAyB9C,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,kBAAkB,CAAC,eAAe,CA+BlF,CAAC"}
1
+ {"version":3,"file":"albo.d.ts","sourceRoot":"","sources":["../../../../src/albo/parser/albo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,KAAK,CAAC;AAC9C,OAAO,EAEH,KAAK,eAAe,EAEpB,KAAK,kBAAkB,EAEvB,KAAK,eAAe,EAEpB,KAAK,gBAAgB,EACxB,MAAM,eAAe,CAAC;AAUvB,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,kBAAkB,CAAC,eAAe,CAA4C,CAAC;AAEhI,eAAO,MAAM,oBAAoB,GAAI,MAAM,MAAM,KAAG,kBAAkB,CAAC,kBAAkB,CAA+C,CAAC;AAEzI,eAAO,MAAM,iBAAiB,GAAI,MAAM,MAAM,KAAG,kBAAkB,CAAC,eAAe,CAA4C,CAAC;AAEhI,eAAO,MAAM,kBAAkB,GAAI,MAAM,MAAM,KAAG,kBAAkB,CAAC,gBAAgB,CAA6C,CAAC"}
@@ -1,48 +1,13 @@
1
- import { loadDocument, queryAll, queryOne, getAttribute, getTextContent, elementHasClass } from "../../common/dom";
2
- import { CubicsPtNewsSchema } from "../types/albo";
3
- import { normalizeWhitespace, extractFirstQuotedValue } from "../../common/utils";
4
- const parseNewsEntry = (row) => {
5
- const categoryImg = queryOne("th.category img", row);
6
- const statusImg = queryOne("td.status img", row);
7
- const headlineAnchor = queryOne("td.headline a", row);
8
- if (!headlineAnchor) {
9
- return null;
1
+ import { AlboCalendarSchema, AlboInformationSchema, AlboPersonalSchema, AlboTimetableSchema, } from "../types/albo";
2
+ const parseAlboJson = (input, schema) => {
3
+ try {
4
+ return schema.safeParse(JSON.parse(input));
5
+ }
6
+ catch {
7
+ return schema.safeParse(undefined);
10
8
  }
11
- const title = normalizeWhitespace(getTextContent(headlineAnchor));
12
- const onclick = getAttribute(headlineAnchor, "onclick") ?? "";
13
- const href = getAttribute(headlineAnchor, "href");
14
- const link = extractFirstQuotedValue(onclick) ?? href ?? null;
15
- return {
16
- category: getAttribute(categoryImg, "alt"),
17
- status: getAttribute(statusImg, "alt") ?? getAttribute(statusImg, "src"),
18
- title,
19
- link,
20
- };
21
- };
22
- export const parseCubicsPtNews = (html) => {
23
- const document = loadDocument(html);
24
- const tabs = queryAll("#tab_element li", document).map((tab) => {
25
- const anchor = queryOne("a", tab);
26
- const href = getAttribute(anchor, "href") ?? "";
27
- const targetId = href.replace(/^#/, "");
28
- const title = normalizeWhitespace(anchor ? getTextContent(anchor) : "");
29
- const rows = queryAll(`#${targetId} table.tab-newslist tr`, document)
30
- .map((row) => parseNewsEntry(row))
31
- .filter((entry) => entry !== null);
32
- return {
33
- id: targetId,
34
- title,
35
- entries: rows,
36
- active: elementHasClass(tab, "selected"),
37
- };
38
- });
39
- const selectedTab = tabs.find((tab) => tab.active);
40
- return CubicsPtNewsSchema.safeParse({
41
- selectedTabId: selectedTab ? selectedTab.id : null,
42
- tabs: tabs.map((tab) => ({
43
- id: tab.id,
44
- title: tab.title,
45
- entries: tab.entries,
46
- })),
47
- });
48
9
  };
10
+ export const parseAlboCalendar = (json) => parseAlboJson(json, AlboCalendarSchema);
11
+ export const parseAlboInformation = (json) => parseAlboJson(json, AlboInformationSchema);
12
+ export const parseAlboPersonal = (json) => parseAlboJson(json, AlboPersonalSchema);
13
+ export const parseAlboTimetable = (json) => parseAlboJson(json, AlboTimetableSchema);
@@ -1,34 +1,447 @@
1
1
  import { z } from "zod";
2
- export declare const CubicsPtNewsEntrySchema: z.ZodObject<{
3
- category: z.ZodNullable<z.ZodString>;
4
- status: z.ZodNullable<z.ZodString>;
5
- title: z.ZodString;
6
- link: z.ZodNullable<z.ZodString>;
2
+ export declare const AlboCalendarItemSchema: z.ZodObject<{
3
+ calendar_source_uuid: z.ZodString;
4
+ summary: z.ZodString;
5
+ description: z.ZodNullable<z.ZodString>;
6
+ start_at: z.ZodNumber;
7
+ end_at: z.ZodNumber;
8
+ created_at: z.ZodNumber;
9
+ }, z.core.$strip>;
10
+ export type AlboCalendarItemDTO = z.infer<typeof AlboCalendarItemSchema>;
11
+ export declare const AlboCalendarSchema: z.ZodObject<{
12
+ is_successful: z.ZodBoolean;
13
+ code: z.ZodNumber;
14
+ api_version: z.ZodNumber;
15
+ gmt: z.ZodNumber;
16
+ user: z.ZodNullable<z.ZodUnknown>;
17
+ result: z.ZodObject<{
18
+ page_total: z.ZodNumber;
19
+ page_size: z.ZodNumber;
20
+ item_count: z.ZodNumber;
21
+ source_name: z.ZodString;
22
+ items: z.ZodArray<z.ZodObject<{
23
+ calendar_source_uuid: z.ZodString;
24
+ summary: z.ZodString;
25
+ description: z.ZodNullable<z.ZodString>;
26
+ start_at: z.ZodNumber;
27
+ end_at: z.ZodNumber;
28
+ created_at: z.ZodNumber;
29
+ }, z.core.$strip>>;
30
+ }, z.core.$strip>;
31
+ }, z.core.$strip>;
32
+ export type AlboCalendarDTO = z.infer<typeof AlboCalendarSchema>;
33
+ export declare const AlboTimetableBadgeSchema: z.ZodObject<{
34
+ term: z.ZodString;
7
35
  }, z.core.$strip>;
8
- export type CubicsPtNewsEntryDTO = z.infer<typeof CubicsPtNewsEntrySchema>;
9
- export declare const CubicsPtNewsTabSchema: z.ZodObject<{
36
+ export type AlboTimetableBadgeDTO = z.infer<typeof AlboTimetableBadgeSchema>;
37
+ export declare const AlboTimetableItemSchema: z.ZodObject<{
38
+ uuid: z.ZodString;
10
39
  id: z.ZodString;
40
+ execute_date: z.ZodString;
41
+ day_of_week: z.ZodNumber;
42
+ time_number: z.ZodNumber;
43
+ class_id: z.ZodString;
44
+ class_name: z.ZodString;
45
+ term: z.ZodString;
46
+ campus: z.ZodString;
47
+ teacher: z.ZodString;
48
+ room: z.ZodNullable<z.ZodString>;
49
+ memo: z.ZodString;
50
+ options: z.ZodNullable<z.ZodUnknown>;
51
+ created_at: z.ZodNumber;
52
+ execute_school_year: z.ZodString;
53
+ class_type: z.ZodNumber;
54
+ memo_en: z.ZodNullable<z.ZodString>;
55
+ options_en: z.ZodNullable<z.ZodUnknown>;
56
+ order: z.ZodNumber;
57
+ badge: z.ZodObject<{
58
+ term: z.ZodString;
59
+ }, z.core.$strip>;
60
+ term_en: z.ZodString;
61
+ class_name_en: z.ZodString;
62
+ campus_en: z.ZodString;
63
+ cancels: z.ZodArray<z.ZodUnknown>;
64
+ extras: z.ZodArray<z.ZodUnknown>;
65
+ changes: z.ZodArray<z.ZodUnknown>;
66
+ }, z.core.$strip>;
67
+ export type AlboTimetableItemDTO = z.infer<typeof AlboTimetableItemSchema>;
68
+ export declare const AlboTimetableSchema: z.ZodObject<{
69
+ is_successful: z.ZodBoolean;
70
+ code: z.ZodNumber;
71
+ api_version: z.ZodNumber;
72
+ gmt: z.ZodNumber;
73
+ user: z.ZodNullable<z.ZodUnknown>;
74
+ result: z.ZodObject<{
75
+ time_table_type: z.ZodString;
76
+ page_total: z.ZodNumber;
77
+ page_size: z.ZodNumber;
78
+ item_count: z.ZodNumber;
79
+ items: z.ZodArray<z.ZodObject<{
80
+ uuid: z.ZodString;
81
+ id: z.ZodString;
82
+ execute_date: z.ZodString;
83
+ day_of_week: z.ZodNumber;
84
+ time_number: z.ZodNumber;
85
+ class_id: z.ZodString;
86
+ class_name: z.ZodString;
87
+ term: z.ZodString;
88
+ campus: z.ZodString;
89
+ teacher: z.ZodString;
90
+ room: z.ZodNullable<z.ZodString>;
91
+ memo: z.ZodString;
92
+ options: z.ZodNullable<z.ZodUnknown>;
93
+ created_at: z.ZodNumber;
94
+ execute_school_year: z.ZodString;
95
+ class_type: z.ZodNumber;
96
+ memo_en: z.ZodNullable<z.ZodString>;
97
+ options_en: z.ZodNullable<z.ZodUnknown>;
98
+ order: z.ZodNumber;
99
+ badge: z.ZodObject<{
100
+ term: z.ZodString;
101
+ }, z.core.$strip>;
102
+ term_en: z.ZodString;
103
+ class_name_en: z.ZodString;
104
+ campus_en: z.ZodString;
105
+ cancels: z.ZodArray<z.ZodUnknown>;
106
+ extras: z.ZodArray<z.ZodUnknown>;
107
+ changes: z.ZodArray<z.ZodUnknown>;
108
+ }, z.core.$strip>>;
109
+ }, z.core.$strip>;
110
+ }, z.core.$strip>;
111
+ export type AlboTimetableDTO = z.infer<typeof AlboTimetableSchema>;
112
+ export declare const AlboInformationCategorySchema: z.ZodObject<{
113
+ uuid: z.ZodString;
114
+ name: z.ZodString;
115
+ name_en: z.ZodNullable<z.ZodString>;
116
+ description: z.ZodNullable<z.ZodString>;
117
+ description_en: z.ZodNullable<z.ZodString>;
118
+ order: z.ZodNumber;
119
+ is_for_guest: z.ZodBoolean;
120
+ created_by: z.ZodString;
121
+ updated_by: z.ZodNullable<z.ZodString>;
122
+ created_at: z.ZodNumber;
123
+ updated_at: z.ZodNumber;
124
+ }, z.core.$strip>;
125
+ export type AlboInformationCategoryDTO = z.infer<typeof AlboInformationCategorySchema>;
126
+ export declare const AlboInformationFileSchema: z.ZodObject<{
127
+ uuid: z.ZodString;
128
+ file_name: z.ZodString;
129
+ mime_type: z.ZodString;
130
+ is_thumb_exists: z.ZodBoolean;
131
+ created_by: z.ZodString;
132
+ created_at: z.ZodNumber;
133
+ }, z.core.$strip>;
134
+ export type AlboInformationFileDTO = z.infer<typeof AlboInformationFileSchema>;
135
+ export declare const AlboInformationItemSchema: z.ZodObject<{
136
+ uuid: z.ZodString;
137
+ publish_from: z.ZodString;
138
+ publish_from_en: z.ZodNullable<z.ZodString>;
139
+ publish_department_en: z.ZodNullable<z.ZodString>;
140
+ publish_start_at: z.ZodNumber;
141
+ publish_end_at: z.ZodNumber;
11
142
  title: z.ZodString;
12
- entries: z.ZodArray<z.ZodObject<{
13
- category: z.ZodNullable<z.ZodString>;
14
- status: z.ZodNullable<z.ZodString>;
15
- title: z.ZodString;
16
- link: z.ZodNullable<z.ZodString>;
17
- }, z.core.$strip>>;
143
+ title_en: z.ZodNullable<z.ZodString>;
144
+ content: z.ZodString;
145
+ content_en: z.ZodNullable<z.ZodString>;
146
+ priority: z.ZodNumber;
147
+ event_title: z.ZodNullable<z.ZodString>;
148
+ event_title_en: z.ZodNullable<z.ZodString>;
149
+ event_start_at: z.ZodNullable<z.ZodNumber>;
150
+ event_end_at: z.ZodNullable<z.ZodNumber>;
151
+ is_send_mail_notification: z.ZodNumber;
152
+ mail_from: z.ZodNullable<z.ZodString>;
153
+ options: z.ZodNullable<z.ZodUnknown>;
154
+ created_by: z.ZodString;
155
+ updated_by: z.ZodNullable<z.ZodString>;
156
+ created_at: z.ZodNumber;
157
+ is_template: z.ZodNumber;
158
+ is_public: z.ZodBoolean;
159
+ is_read: z.ZodBoolean;
160
+ is_pinned: z.ZodBoolean;
161
+ is_reacted_good: z.ZodBoolean;
162
+ good_count: z.ZodNumber;
163
+ category: z.ZodObject<{
164
+ uuid: z.ZodString;
165
+ name: z.ZodString;
166
+ name_en: z.ZodNullable<z.ZodString>;
167
+ description: z.ZodNullable<z.ZodString>;
168
+ description_en: z.ZodNullable<z.ZodString>;
169
+ order: z.ZodNumber;
170
+ is_for_guest: z.ZodBoolean;
171
+ created_by: z.ZodString;
172
+ updated_by: z.ZodNullable<z.ZodString>;
173
+ created_at: z.ZodNumber;
174
+ updated_at: z.ZodNumber;
175
+ }, z.core.$strip>;
176
+ files: z.ZodNullable<z.ZodArray<z.ZodObject<{
177
+ uuid: z.ZodString;
178
+ file_name: z.ZodString;
179
+ mime_type: z.ZodString;
180
+ is_thumb_exists: z.ZodBoolean;
181
+ created_by: z.ZodString;
182
+ created_at: z.ZodNumber;
183
+ }, z.core.$strip>>>;
184
+ personal_files: z.ZodNullable<z.ZodArray<z.ZodObject<{
185
+ uuid: z.ZodString;
186
+ file_name: z.ZodString;
187
+ mime_type: z.ZodString;
188
+ is_thumb_exists: z.ZodBoolean;
189
+ created_by: z.ZodString;
190
+ created_at: z.ZodNumber;
191
+ }, z.core.$strip>>>;
192
+ images: z.ZodNullable<z.ZodArray<z.ZodObject<{
193
+ uuid: z.ZodString;
194
+ file_name: z.ZodString;
195
+ mime_type: z.ZodString;
196
+ is_thumb_exists: z.ZodBoolean;
197
+ created_by: z.ZodString;
198
+ created_at: z.ZodNumber;
199
+ }, z.core.$strip>>>;
18
200
  }, z.core.$strip>;
19
- export type CubicsPtNewsTabDTO = z.infer<typeof CubicsPtNewsTabSchema>;
20
- export declare const CubicsPtNewsSchema: z.ZodObject<{
21
- selectedTabId: z.ZodNullable<z.ZodString>;
22
- tabs: z.ZodArray<z.ZodObject<{
23
- id: z.ZodString;
24
- title: z.ZodString;
25
- entries: z.ZodArray<z.ZodObject<{
26
- category: z.ZodNullable<z.ZodString>;
27
- status: z.ZodNullable<z.ZodString>;
201
+ export type AlboInformationItemDTO = z.infer<typeof AlboInformationItemSchema>;
202
+ export declare const AlboInformationSchema: z.ZodObject<{
203
+ is_successful: z.ZodBoolean;
204
+ code: z.ZodNumber;
205
+ api_version: z.ZodNumber;
206
+ gmt: z.ZodNumber;
207
+ user: z.ZodNullable<z.ZodUnknown>;
208
+ result: z.ZodObject<{
209
+ page_total: z.ZodNumber;
210
+ page_size: z.ZodNumber;
211
+ item_count: z.ZodNumber;
212
+ items: z.ZodArray<z.ZodObject<{
213
+ uuid: z.ZodString;
214
+ publish_from: z.ZodString;
215
+ publish_from_en: z.ZodNullable<z.ZodString>;
216
+ publish_department_en: z.ZodNullable<z.ZodString>;
217
+ publish_start_at: z.ZodNumber;
218
+ publish_end_at: z.ZodNumber;
28
219
  title: z.ZodString;
29
- link: z.ZodNullable<z.ZodString>;
220
+ title_en: z.ZodNullable<z.ZodString>;
221
+ content: z.ZodString;
222
+ content_en: z.ZodNullable<z.ZodString>;
223
+ priority: z.ZodNumber;
224
+ event_title: z.ZodNullable<z.ZodString>;
225
+ event_title_en: z.ZodNullable<z.ZodString>;
226
+ event_start_at: z.ZodNullable<z.ZodNumber>;
227
+ event_end_at: z.ZodNullable<z.ZodNumber>;
228
+ is_send_mail_notification: z.ZodNumber;
229
+ mail_from: z.ZodNullable<z.ZodString>;
230
+ options: z.ZodNullable<z.ZodUnknown>;
231
+ created_by: z.ZodString;
232
+ updated_by: z.ZodNullable<z.ZodString>;
233
+ created_at: z.ZodNumber;
234
+ is_template: z.ZodNumber;
235
+ is_public: z.ZodBoolean;
236
+ is_read: z.ZodBoolean;
237
+ is_pinned: z.ZodBoolean;
238
+ is_reacted_good: z.ZodBoolean;
239
+ good_count: z.ZodNumber;
240
+ category: z.ZodObject<{
241
+ uuid: z.ZodString;
242
+ name: z.ZodString;
243
+ name_en: z.ZodNullable<z.ZodString>;
244
+ description: z.ZodNullable<z.ZodString>;
245
+ description_en: z.ZodNullable<z.ZodString>;
246
+ order: z.ZodNumber;
247
+ is_for_guest: z.ZodBoolean;
248
+ created_by: z.ZodString;
249
+ updated_by: z.ZodNullable<z.ZodString>;
250
+ created_at: z.ZodNumber;
251
+ updated_at: z.ZodNumber;
252
+ }, z.core.$strip>;
253
+ files: z.ZodNullable<z.ZodArray<z.ZodObject<{
254
+ uuid: z.ZodString;
255
+ file_name: z.ZodString;
256
+ mime_type: z.ZodString;
257
+ is_thumb_exists: z.ZodBoolean;
258
+ created_by: z.ZodString;
259
+ created_at: z.ZodNumber;
260
+ }, z.core.$strip>>>;
261
+ personal_files: z.ZodNullable<z.ZodArray<z.ZodObject<{
262
+ uuid: z.ZodString;
263
+ file_name: z.ZodString;
264
+ mime_type: z.ZodString;
265
+ is_thumb_exists: z.ZodBoolean;
266
+ created_by: z.ZodString;
267
+ created_at: z.ZodNumber;
268
+ }, z.core.$strip>>>;
269
+ images: z.ZodNullable<z.ZodArray<z.ZodObject<{
270
+ uuid: z.ZodString;
271
+ file_name: z.ZodString;
272
+ mime_type: z.ZodString;
273
+ is_thumb_exists: z.ZodBoolean;
274
+ created_by: z.ZodString;
275
+ created_at: z.ZodNumber;
276
+ }, z.core.$strip>>>;
30
277
  }, z.core.$strip>>;
278
+ }, z.core.$strip>;
279
+ }, z.core.$strip>;
280
+ export type AlboInformationDTO = z.infer<typeof AlboInformationSchema>;
281
+ export declare const AlboPersonalAuthProfileSchema: z.ZodObject<{
282
+ uuid: z.ZodString;
283
+ name: z.ZodString;
284
+ created_at: z.ZodNumber;
285
+ updated_at: z.ZodNullable<z.ZodNumber>;
286
+ }, z.core.$strip>;
287
+ export type AlboPersonalAuthProfileDTO = z.infer<typeof AlboPersonalAuthProfileSchema>;
288
+ export declare const AlboPersonalGroupSchema: z.ZodObject<{
289
+ group_index: z.ZodString;
290
+ next_group_index: z.ZodString;
291
+ orig_group_index: z.ZodString;
292
+ uuid: z.ZodString;
293
+ name: z.ZodString;
294
+ name_en: z.ZodNullable<z.ZodString>;
295
+ is_authority: z.ZodBoolean;
296
+ order: z.ZodNumber;
297
+ is_active: z.ZodNumber;
298
+ is_shown_in_signup: z.ZodNumber;
299
+ created_at: z.ZodNumber;
300
+ updated_at: z.ZodNumber;
301
+ full_name: z.ZodString;
302
+ display_name: z.ZodString;
303
+ display_name_en: z.ZodString;
304
+ }, z.core.$strip>;
305
+ export type AlboPersonalGroupDTO = z.infer<typeof AlboPersonalGroupSchema>;
306
+ export declare const AlboPersonalUserSchema: z.ZodObject<{
307
+ uuid: z.ZodString;
308
+ personal_id: z.ZodString;
309
+ name: z.ZodString;
310
+ name_kana: z.ZodString;
311
+ name_alphabet: z.ZodString;
312
+ email: z.ZodString;
313
+ locale: z.ZodString;
314
+ option_1: z.ZodNullable<z.ZodString>;
315
+ option_2: z.ZodNullable<z.ZodString>;
316
+ option_3: z.ZodNullable<z.ZodString>;
317
+ option_4: z.ZodNullable<z.ZodString>;
318
+ option_5: z.ZodNullable<z.ZodString>;
319
+ option_6: z.ZodNullable<z.ZodString>;
320
+ option_7: z.ZodNullable<z.ZodString>;
321
+ option_8: z.ZodNullable<z.ZodString>;
322
+ option_9: z.ZodNullable<z.ZodString>;
323
+ option_10: z.ZodNullable<z.ZodString>;
324
+ approval_status: z.ZodNullable<z.ZodString>;
325
+ is_user_enabled: z.ZodBoolean;
326
+ is_login_enabled: z.ZodBoolean;
327
+ is_guest: z.ZodBoolean;
328
+ start_at: z.ZodNumber;
329
+ end_at: z.ZodNumber;
330
+ memo: z.ZodNullable<z.ZodString>;
331
+ admin_memo: z.ZodNullable<z.ZodString>;
332
+ is_not_delete_csv: z.ZodBoolean;
333
+ created_at: z.ZodNumber;
334
+ updated_at: z.ZodNumber;
335
+ user_id: z.ZodString;
336
+ auth_profiles: z.ZodObject<{
337
+ uuid: z.ZodString;
338
+ name: z.ZodString;
339
+ created_at: z.ZodNumber;
340
+ updated_at: z.ZodNullable<z.ZodNumber>;
341
+ }, z.core.$strip>;
342
+ groups: z.ZodArray<z.ZodObject<{
343
+ group_index: z.ZodString;
344
+ next_group_index: z.ZodString;
345
+ orig_group_index: z.ZodString;
346
+ uuid: z.ZodString;
347
+ name: z.ZodString;
348
+ name_en: z.ZodNullable<z.ZodString>;
349
+ is_authority: z.ZodBoolean;
350
+ order: z.ZodNumber;
351
+ is_active: z.ZodNumber;
352
+ is_shown_in_signup: z.ZodNumber;
353
+ created_at: z.ZodNumber;
354
+ updated_at: z.ZodNumber;
355
+ full_name: z.ZodString;
356
+ display_name: z.ZodString;
357
+ display_name_en: z.ZodString;
31
358
  }, z.core.$strip>>;
359
+ has_answer_force_questionnaire: z.ZodBoolean;
360
+ has_force_questionnaire: z.ZodBoolean;
361
+ sub_email_addresses: z.ZodArray<z.ZodString>;
362
+ display_group_names: z.ZodArray<z.ZodString>;
363
+ display_group_names_en: z.ZodArray<z.ZodString>;
364
+ portrait: z.ZodNullable<z.ZodString>;
365
+ permission: z.ZodString;
366
+ permission_unit: z.ZodArray<z.ZodUnknown>;
367
+ has_local_auth: z.ZodBoolean;
368
+ affiliated_groups: z.ZodNullable<z.ZodUnknown>;
369
+ }, z.core.$strip>;
370
+ export type AlboPersonalUserDTO = z.infer<typeof AlboPersonalUserSchema>;
371
+ export declare const AlboPersonalSchema: z.ZodObject<{
372
+ is_successful: z.ZodBoolean;
373
+ code: z.ZodNumber;
374
+ api_version: z.ZodNumber;
375
+ gmt: z.ZodNumber;
376
+ user: z.ZodObject<{
377
+ uuid: z.ZodString;
378
+ personal_id: z.ZodString;
379
+ name: z.ZodString;
380
+ name_kana: z.ZodString;
381
+ name_alphabet: z.ZodString;
382
+ email: z.ZodString;
383
+ locale: z.ZodString;
384
+ option_1: z.ZodNullable<z.ZodString>;
385
+ option_2: z.ZodNullable<z.ZodString>;
386
+ option_3: z.ZodNullable<z.ZodString>;
387
+ option_4: z.ZodNullable<z.ZodString>;
388
+ option_5: z.ZodNullable<z.ZodString>;
389
+ option_6: z.ZodNullable<z.ZodString>;
390
+ option_7: z.ZodNullable<z.ZodString>;
391
+ option_8: z.ZodNullable<z.ZodString>;
392
+ option_9: z.ZodNullable<z.ZodString>;
393
+ option_10: z.ZodNullable<z.ZodString>;
394
+ approval_status: z.ZodNullable<z.ZodString>;
395
+ is_user_enabled: z.ZodBoolean;
396
+ is_login_enabled: z.ZodBoolean;
397
+ is_guest: z.ZodBoolean;
398
+ start_at: z.ZodNumber;
399
+ end_at: z.ZodNumber;
400
+ memo: z.ZodNullable<z.ZodString>;
401
+ admin_memo: z.ZodNullable<z.ZodString>;
402
+ is_not_delete_csv: z.ZodBoolean;
403
+ created_at: z.ZodNumber;
404
+ updated_at: z.ZodNumber;
405
+ user_id: z.ZodString;
406
+ auth_profiles: z.ZodObject<{
407
+ uuid: z.ZodString;
408
+ name: z.ZodString;
409
+ created_at: z.ZodNumber;
410
+ updated_at: z.ZodNullable<z.ZodNumber>;
411
+ }, z.core.$strip>;
412
+ groups: z.ZodArray<z.ZodObject<{
413
+ group_index: z.ZodString;
414
+ next_group_index: z.ZodString;
415
+ orig_group_index: z.ZodString;
416
+ uuid: z.ZodString;
417
+ name: z.ZodString;
418
+ name_en: z.ZodNullable<z.ZodString>;
419
+ is_authority: z.ZodBoolean;
420
+ order: z.ZodNumber;
421
+ is_active: z.ZodNumber;
422
+ is_shown_in_signup: z.ZodNumber;
423
+ created_at: z.ZodNumber;
424
+ updated_at: z.ZodNumber;
425
+ full_name: z.ZodString;
426
+ display_name: z.ZodString;
427
+ display_name_en: z.ZodString;
428
+ }, z.core.$strip>>;
429
+ has_answer_force_questionnaire: z.ZodBoolean;
430
+ has_force_questionnaire: z.ZodBoolean;
431
+ sub_email_addresses: z.ZodArray<z.ZodString>;
432
+ display_group_names: z.ZodArray<z.ZodString>;
433
+ display_group_names_en: z.ZodArray<z.ZodString>;
434
+ portrait: z.ZodNullable<z.ZodString>;
435
+ permission: z.ZodString;
436
+ permission_unit: z.ZodArray<z.ZodUnknown>;
437
+ has_local_auth: z.ZodBoolean;
438
+ affiliated_groups: z.ZodNullable<z.ZodUnknown>;
439
+ }, z.core.$strip>;
440
+ result: z.ZodObject<{
441
+ login: z.ZodString;
442
+ message: z.ZodString;
443
+ login_message: z.ZodNullable<z.ZodString>;
444
+ }, z.core.$strip>;
32
445
  }, z.core.$strip>;
33
- export type CubicsPtNewsDTO = z.infer<typeof CubicsPtNewsSchema>;
446
+ export type AlboPersonalDTO = z.infer<typeof AlboPersonalSchema>;
34
447
  //# sourceMappingURL=albo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"albo.d.ts","sourceRoot":"","sources":["../../../../src/albo/types/albo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;iBAKlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,qBAAqB;;;;;;;;;iBAIhC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;iBAG7B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"albo.d.ts","sourceRoot":"","sources":["../../../../src/albo/types/albo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;;iBAOjC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;iBAa7B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEjE,eAAO,MAAM,wBAAwB;;iBAEnC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAE7E,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA2BlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAa9B,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEnE,eAAO,MAAM,6BAA6B;;;;;;;;;;;;iBAYxC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEvF,eAAO,MAAM,yBAAyB;;;;;;;iBAOpC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE/E,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgCpC,CAAC;AAEH,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAE/E,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAYhC,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEvE,eAAO,MAAM,6BAA6B;;;;;iBAKxC,CAAC;AAEH,MAAM,MAAM,0BAA0B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,6BAA6B,CAAC,CAAC;AAEvF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;iBAgBlC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE3E,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBA0CjC,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAW7B,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
@@ -1,16 +1,213 @@
1
1
  import { z } from "zod";
2
- export const CubicsPtNewsEntrySchema = z.object({
3
- category: z.string().nullable(),
4
- status: z.string().nullable(),
5
- title: z.string(),
6
- link: z.string().nullable(),
2
+ export const AlboCalendarItemSchema = z.object({
3
+ calendar_source_uuid: z.string(),
4
+ summary: z.string(),
5
+ description: z.string().nullable(),
6
+ start_at: z.number(),
7
+ end_at: z.number(),
8
+ created_at: z.number(),
9
+ });
10
+ export const AlboCalendarSchema = z.object({
11
+ is_successful: z.boolean(),
12
+ code: z.number(),
13
+ api_version: z.number(),
14
+ gmt: z.number(),
15
+ user: z.unknown().nullable(),
16
+ result: z.object({
17
+ page_total: z.number(),
18
+ page_size: z.number(),
19
+ item_count: z.number(),
20
+ source_name: z.string(),
21
+ items: z.array(AlboCalendarItemSchema),
22
+ }),
23
+ });
24
+ export const AlboTimetableBadgeSchema = z.object({
25
+ term: z.string(),
7
26
  });
8
- export const CubicsPtNewsTabSchema = z.object({
27
+ export const AlboTimetableItemSchema = z.object({
28
+ uuid: z.string(),
9
29
  id: z.string(),
30
+ execute_date: z.string(),
31
+ day_of_week: z.number(),
32
+ time_number: z.number(),
33
+ class_id: z.string(),
34
+ class_name: z.string(),
35
+ term: z.string(),
36
+ campus: z.string(),
37
+ teacher: z.string(),
38
+ room: z.string().nullable(),
39
+ memo: z.string(),
40
+ options: z.unknown().nullable(),
41
+ created_at: z.number(),
42
+ execute_school_year: z.string(),
43
+ class_type: z.number(),
44
+ memo_en: z.string().nullable(),
45
+ options_en: z.unknown().nullable(),
46
+ order: z.number(),
47
+ badge: AlboTimetableBadgeSchema,
48
+ term_en: z.string(),
49
+ class_name_en: z.string(),
50
+ campus_en: z.string(),
51
+ cancels: z.array(z.unknown()),
52
+ extras: z.array(z.unknown()),
53
+ changes: z.array(z.unknown()),
54
+ });
55
+ export const AlboTimetableSchema = z.object({
56
+ is_successful: z.boolean(),
57
+ code: z.number(),
58
+ api_version: z.number(),
59
+ gmt: z.number(),
60
+ user: z.unknown().nullable(),
61
+ result: z.object({
62
+ time_table_type: z.string(),
63
+ page_total: z.number(),
64
+ page_size: z.number(),
65
+ item_count: z.number(),
66
+ items: z.array(AlboTimetableItemSchema),
67
+ }),
68
+ });
69
+ export const AlboInformationCategorySchema = z.object({
70
+ uuid: z.string(),
71
+ name: z.string(),
72
+ name_en: z.string().nullable(),
73
+ description: z.string().nullable(),
74
+ description_en: z.string().nullable(),
75
+ order: z.number(),
76
+ is_for_guest: z.boolean(),
77
+ created_by: z.string(),
78
+ updated_by: z.string().nullable(),
79
+ created_at: z.number(),
80
+ updated_at: z.number(),
81
+ });
82
+ export const AlboInformationFileSchema = z.object({
83
+ uuid: z.string(),
84
+ file_name: z.string(),
85
+ mime_type: z.string(),
86
+ is_thumb_exists: z.boolean(),
87
+ created_by: z.string(),
88
+ created_at: z.number(),
89
+ });
90
+ export const AlboInformationItemSchema = z.object({
91
+ uuid: z.string(),
92
+ publish_from: z.string(),
93
+ publish_from_en: z.string().nullable(),
94
+ publish_department_en: z.string().nullable(),
95
+ publish_start_at: z.number(),
96
+ publish_end_at: z.number(),
10
97
  title: z.string(),
11
- entries: z.array(CubicsPtNewsEntrySchema),
98
+ title_en: z.string().nullable(),
99
+ content: z.string(),
100
+ content_en: z.string().nullable(),
101
+ priority: z.number(),
102
+ event_title: z.string().nullable(),
103
+ event_title_en: z.string().nullable(),
104
+ event_start_at: z.number().nullable(),
105
+ event_end_at: z.number().nullable(),
106
+ is_send_mail_notification: z.number(),
107
+ mail_from: z.string().nullable(),
108
+ options: z.unknown().nullable(),
109
+ created_by: z.string(),
110
+ updated_by: z.string().nullable(),
111
+ created_at: z.number(),
112
+ is_template: z.number(),
113
+ is_public: z.boolean(),
114
+ is_read: z.boolean(),
115
+ is_pinned: z.boolean(),
116
+ is_reacted_good: z.boolean(),
117
+ good_count: z.number(),
118
+ category: AlboInformationCategorySchema,
119
+ files: z.array(AlboInformationFileSchema).nullable(),
120
+ personal_files: z.array(AlboInformationFileSchema).nullable(),
121
+ images: z.array(AlboInformationFileSchema).nullable(),
122
+ });
123
+ export const AlboInformationSchema = z.object({
124
+ is_successful: z.boolean(),
125
+ code: z.number(),
126
+ api_version: z.number(),
127
+ gmt: z.number(),
128
+ user: z.unknown().nullable(),
129
+ result: z.object({
130
+ page_total: z.number(),
131
+ page_size: z.number(),
132
+ item_count: z.number(),
133
+ items: z.array(AlboInformationItemSchema),
134
+ }),
135
+ });
136
+ export const AlboPersonalAuthProfileSchema = z.object({
137
+ uuid: z.string(),
138
+ name: z.string(),
139
+ created_at: z.number(),
140
+ updated_at: z.number().nullable(),
141
+ });
142
+ export const AlboPersonalGroupSchema = z.object({
143
+ group_index: z.string(),
144
+ next_group_index: z.string(),
145
+ orig_group_index: z.string(),
146
+ uuid: z.string(),
147
+ name: z.string(),
148
+ name_en: z.string().nullable(),
149
+ is_authority: z.boolean(),
150
+ order: z.number(),
151
+ is_active: z.number(),
152
+ is_shown_in_signup: z.number(),
153
+ created_at: z.number(),
154
+ updated_at: z.number(),
155
+ full_name: z.string(),
156
+ display_name: z.string(),
157
+ display_name_en: z.string(),
158
+ });
159
+ export const AlboPersonalUserSchema = z.object({
160
+ uuid: z.string(),
161
+ personal_id: z.string(),
162
+ name: z.string(),
163
+ name_kana: z.string(),
164
+ name_alphabet: z.string(),
165
+ email: z.string(),
166
+ locale: z.string(),
167
+ option_1: z.string().nullable(),
168
+ option_2: z.string().nullable(),
169
+ option_3: z.string().nullable(),
170
+ option_4: z.string().nullable(),
171
+ option_5: z.string().nullable(),
172
+ option_6: z.string().nullable(),
173
+ option_7: z.string().nullable(),
174
+ option_8: z.string().nullable(),
175
+ option_9: z.string().nullable(),
176
+ option_10: z.string().nullable(),
177
+ approval_status: z.string().nullable(),
178
+ is_user_enabled: z.boolean(),
179
+ is_login_enabled: z.boolean(),
180
+ is_guest: z.boolean(),
181
+ start_at: z.number(),
182
+ end_at: z.number(),
183
+ memo: z.string().nullable(),
184
+ admin_memo: z.string().nullable(),
185
+ is_not_delete_csv: z.boolean(),
186
+ created_at: z.number(),
187
+ updated_at: z.number(),
188
+ user_id: z.string(),
189
+ auth_profiles: AlboPersonalAuthProfileSchema,
190
+ groups: z.array(AlboPersonalGroupSchema),
191
+ has_answer_force_questionnaire: z.boolean(),
192
+ has_force_questionnaire: z.boolean(),
193
+ sub_email_addresses: z.array(z.string()),
194
+ display_group_names: z.array(z.string()),
195
+ display_group_names_en: z.array(z.string()),
196
+ portrait: z.string().nullable(),
197
+ permission: z.string(),
198
+ permission_unit: z.array(z.unknown()),
199
+ has_local_auth: z.boolean(),
200
+ affiliated_groups: z.unknown().nullable(),
12
201
  });
13
- export const CubicsPtNewsSchema = z.object({
14
- selectedTabId: z.string().nullable(),
15
- tabs: z.array(CubicsPtNewsTabSchema),
202
+ export const AlboPersonalSchema = z.object({
203
+ is_successful: z.boolean(),
204
+ code: z.number(),
205
+ api_version: z.number(),
206
+ gmt: z.number(),
207
+ user: AlboPersonalUserSchema,
208
+ result: z.object({
209
+ login: z.string(),
210
+ message: z.string(),
211
+ login_message: z.string().nullable(),
212
+ }),
16
213
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chukyo-umebo/web_parser",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },