@chukyo-umebo/web_parser 0.0.1

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 (82) hide show
  1. package/README.md +56 -0
  2. package/dist/cjs/albo/index.js +5 -0
  3. package/dist/cjs/albo/parser/albo.js +52 -0
  4. package/dist/cjs/albo/types/albo.js +19 -0
  5. package/dist/cjs/common/dom.js +116 -0
  6. package/dist/cjs/common/utils.js +13 -0
  7. package/dist/cjs/cubics/index.js +5 -0
  8. package/dist/cjs/cubics/parser/cubics.js +94 -0
  9. package/dist/cjs/cubics/types/cubics.js +38 -0
  10. package/dist/cjs/index.js +19 -0
  11. package/dist/cjs/manabo/index.js +23 -0
  12. package/dist/cjs/manabo/parser/manaboClass.js +428 -0
  13. package/dist/cjs/manabo/parser/manaboEntry.js +35 -0
  14. package/dist/cjs/manabo/parser/manaboMail.js +169 -0
  15. package/dist/cjs/manabo/parser/manaboNews.js +29 -0
  16. package/dist/cjs/manabo/parser/manaboTimetable.js +75 -0
  17. package/dist/cjs/manabo/types/manaboClass.js +126 -0
  18. package/dist/cjs/manabo/types/manaboEntry.js +21 -0
  19. package/dist/cjs/manabo/types/manaboMail.js +66 -0
  20. package/dist/cjs/manabo/types/manaboNews.js +11 -0
  21. package/dist/cjs/manabo/types/manaboTimetable.js +32 -0
  22. package/dist/esm/albo/index.d.ts +3 -0
  23. package/dist/esm/albo/index.d.ts.map +1 -0
  24. package/dist/esm/albo/index.js +1 -0
  25. package/dist/esm/albo/parser/albo.d.ts +4 -0
  26. package/dist/esm/albo/parser/albo.d.ts.map +1 -0
  27. package/dist/esm/albo/parser/albo.js +48 -0
  28. package/dist/esm/albo/types/albo.d.ts +34 -0
  29. package/dist/esm/albo/types/albo.d.ts.map +1 -0
  30. package/dist/esm/albo/types/albo.js +16 -0
  31. package/dist/esm/common/dom.d.ts +18 -0
  32. package/dist/esm/common/dom.d.ts.map +1 -0
  33. package/dist/esm/common/dom.js +99 -0
  34. package/dist/esm/common/utils.d.ts +3 -0
  35. package/dist/esm/common/utils.d.ts.map +1 -0
  36. package/dist/esm/common/utils.js +8 -0
  37. package/dist/esm/cubics/index.d.ts +3 -0
  38. package/dist/esm/cubics/index.d.ts.map +1 -0
  39. package/dist/esm/cubics/index.js +1 -0
  40. package/dist/esm/cubics/parser/cubics.d.ts +4 -0
  41. package/dist/esm/cubics/parser/cubics.d.ts.map +1 -0
  42. package/dist/esm/cubics/parser/cubics.js +90 -0
  43. package/dist/esm/cubics/types/cubics.d.ts +60 -0
  44. package/dist/esm/cubics/types/cubics.d.ts.map +1 -0
  45. package/dist/esm/cubics/types/cubics.js +35 -0
  46. package/dist/esm/index.d.ts +4 -0
  47. package/dist/esm/index.d.ts.map +1 -0
  48. package/dist/esm/index.js +3 -0
  49. package/dist/esm/manabo/index.d.ts +11 -0
  50. package/dist/esm/manabo/index.d.ts.map +1 -0
  51. package/dist/esm/manabo/index.js +5 -0
  52. package/dist/esm/manabo/parser/manaboClass.d.ts +9 -0
  53. package/dist/esm/manabo/parser/manaboClass.d.ts.map +1 -0
  54. package/dist/esm/manabo/parser/manaboClass.js +419 -0
  55. package/dist/esm/manabo/parser/manaboEntry.d.ts +5 -0
  56. package/dist/esm/manabo/parser/manaboEntry.d.ts.map +1 -0
  57. package/dist/esm/manabo/parser/manaboEntry.js +30 -0
  58. package/dist/esm/manabo/parser/manaboMail.d.ts +8 -0
  59. package/dist/esm/manabo/parser/manaboMail.d.ts.map +1 -0
  60. package/dist/esm/manabo/parser/manaboMail.js +161 -0
  61. package/dist/esm/manabo/parser/manaboNews.d.ts +4 -0
  62. package/dist/esm/manabo/parser/manaboNews.d.ts.map +1 -0
  63. package/dist/esm/manabo/parser/manaboNews.js +25 -0
  64. package/dist/esm/manabo/parser/manaboTimetable.d.ts +4 -0
  65. package/dist/esm/manabo/parser/manaboTimetable.d.ts.map +1 -0
  66. package/dist/esm/manabo/parser/manaboTimetable.js +71 -0
  67. package/dist/esm/manabo/types/manaboClass.d.ts +268 -0
  68. package/dist/esm/manabo/types/manaboClass.d.ts.map +1 -0
  69. package/dist/esm/manabo/types/manaboClass.js +123 -0
  70. package/dist/esm/manabo/types/manaboEntry.d.ts +21 -0
  71. package/dist/esm/manabo/types/manaboEntry.d.ts.map +1 -0
  72. package/dist/esm/manabo/types/manaboEntry.js +18 -0
  73. package/dist/esm/manabo/types/manaboMail.d.ts +95 -0
  74. package/dist/esm/manabo/types/manaboMail.d.ts.map +1 -0
  75. package/dist/esm/manabo/types/manaboMail.js +63 -0
  76. package/dist/esm/manabo/types/manaboNews.d.ts +13 -0
  77. package/dist/esm/manabo/types/manaboNews.d.ts.map +1 -0
  78. package/dist/esm/manabo/types/manaboNews.js +8 -0
  79. package/dist/esm/manabo/types/manaboTimetable.d.ts +57 -0
  80. package/dist/esm/manabo/types/manaboTimetable.d.ts.map +1 -0
  81. package/dist/esm/manabo/types/manaboTimetable.js +29 -0
  82. package/package.json +37 -0
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ # @chukyo-passpal/web_parser
2
+
3
+ 中京大学の各種システム(Albo, Cubics, Manabo)のHTMLを解析し、構造化されたデータとして抽出するためのTypeScriptライブラリです。
4
+
5
+ ## 特徴
6
+
7
+ - **型安全性**: Zodを使用して解析結果を検証し、TypeScriptの型定義を提供します。
8
+ - **軽量**: `htmlparser2` と `css-select` を使用した高速な解析。
9
+ - **モジュール化**: システムごとにパーサーが分かれています。
10
+
11
+ ## インストール
12
+
13
+ ```bash
14
+ bun add @chukyo-passpal/web_parser
15
+ # または
16
+ npm install @chukyo-passpal/web_parser
17
+ ```
18
+
19
+ ## 使い方
20
+
21
+ ```typescript
22
+ import { parseManaboNews } from "@chukyo-passpal/web_parser";
23
+
24
+ const html = `...`; // 取得したHTML文字列
25
+ const result = parseManaboNews(html);
26
+
27
+ if (result.success) {
28
+ console.log(result.data);
29
+ } else {
30
+ console.error(result.error);
31
+ }
32
+ ```
33
+
34
+ ## 対応システム
35
+
36
+ - **Albo**: アルバイト情報など
37
+ - **Cubics**: 履修登録、時間割など
38
+ - **Manabo**: ポータルサイト(お知らせ、課題、メールなど)
39
+
40
+ ## 開発
41
+
42
+ このプロジェクトは [Bun](https://bun.sh) を使用しています。
43
+
44
+ ```bash
45
+ # 依存関係のインストール
46
+ bun install
47
+
48
+ # ビルド
49
+ bun run build
50
+
51
+ # テスト
52
+ bun test
53
+
54
+ # リント
55
+ bun run lint
56
+ ```
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCubicsPtNews = void 0;
4
+ var albo_1 = require("./parser/albo");
5
+ Object.defineProperty(exports, "parseCubicsPtNews", { enumerable: true, get: function () { return albo_1.parseCubicsPtNews; } });
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCubicsPtNews = void 0;
4
+ const dom_1 = require("../../common/dom");
5
+ 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;
13
+ }
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
+ };
52
+ exports.parseCubicsPtNews = parseCubicsPtNews;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CubicsPtNewsSchema = exports.CubicsPtNewsTabSchema = exports.CubicsPtNewsEntrySchema = void 0;
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(),
10
+ });
11
+ exports.CubicsPtNewsTabSchema = zod_1.z.object({
12
+ id: zod_1.z.string(),
13
+ title: zod_1.z.string(),
14
+ entries: zod_1.z.array(exports.CubicsPtNewsEntrySchema),
15
+ });
16
+ exports.CubicsPtNewsSchema = zod_1.z.object({
17
+ selectedTabId: zod_1.z.string().nullable(),
18
+ tabs: zod_1.z.array(exports.CubicsPtNewsTabSchema),
19
+ });
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.matches = exports.getChildrenElements = exports.filterElements = exports.isElement = exports.previousSiblingElement = exports.nextSiblingElement = exports.closest = exports.elementHasClass = exports.getInnerHtml = exports.getTextContent = exports.getAttribute = exports.queryOne = exports.queryAll = exports.loadDocument = void 0;
4
+ const htmlparser2_1 = require("htmlparser2");
5
+ const css_select_1 = require("css-select");
6
+ const domutils_1 = require("domutils");
7
+ const toArray = (root) => {
8
+ if (!root) {
9
+ return [];
10
+ }
11
+ if (Array.isArray(root)) {
12
+ return root;
13
+ }
14
+ if ("children" in root && Array.isArray(root.children)) {
15
+ return root.children;
16
+ }
17
+ return [root];
18
+ };
19
+ const loadDocument = (html) => (0, htmlparser2_1.parseDocument)(html);
20
+ exports.loadDocument = loadDocument;
21
+ const queryAll = (selector, root) => (0, css_select_1.selectAll)(selector, toArray(root));
22
+ exports.queryAll = queryAll;
23
+ const queryOne = (selector, root) => (0, css_select_1.selectOne)(selector, toArray(root));
24
+ exports.queryOne = queryOne;
25
+ const getAttribute = (element, name) => {
26
+ if (!element) {
27
+ return null;
28
+ }
29
+ const value = (0, domutils_1.getAttributeValue)(element, name);
30
+ return typeof value === "string" ? value : null;
31
+ };
32
+ exports.getAttribute = getAttribute;
33
+ const getTextContent = (node) => {
34
+ if (!node) {
35
+ return "";
36
+ }
37
+ return (0, domutils_1.textContent)(node);
38
+ };
39
+ exports.getTextContent = getTextContent;
40
+ const decodeNumericEntities = (value) => value
41
+ .replace(/&#x([0-9a-fA-F]+);/g, (match, hex) => {
42
+ const codePoint = Number.parseInt(hex, 16);
43
+ return Number.isNaN(codePoint) ? match : String.fromCodePoint(codePoint);
44
+ })
45
+ .replace(/&#([0-9]+);/g, (match, dec) => {
46
+ const codePoint = Number.parseInt(dec, 10);
47
+ return Number.isNaN(codePoint) ? match : String.fromCodePoint(codePoint);
48
+ });
49
+ const getInnerHtml = (element) => {
50
+ if (!element) {
51
+ return "";
52
+ }
53
+ const inner = (0, domutils_1.getInnerHTML)(element);
54
+ const decoded = decodeNumericEntities(inner);
55
+ const normalised = decoded.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
56
+ const withNbsp = normalised.replace(/\u00a0/g, " ");
57
+ return withNbsp.replace(/\salt(?!\s*=)(?=[\s/>])/g, ' alt=""');
58
+ };
59
+ exports.getInnerHtml = getInnerHtml;
60
+ const elementHasClass = (element, className) => {
61
+ if (!element) {
62
+ return false;
63
+ }
64
+ const classAttr = (0, exports.getAttribute)(element, "class");
65
+ if (!classAttr) {
66
+ return false;
67
+ }
68
+ return classAttr.split(/\s+/).includes(className);
69
+ };
70
+ exports.elementHasClass = elementHasClass;
71
+ const closest = (element, selector) => {
72
+ let current = element;
73
+ while (current) {
74
+ if ((0, css_select_1.is)(current, selector)) {
75
+ return current;
76
+ }
77
+ const parent = (0, domutils_1.getParent)(current);
78
+ current = parent && (0, domutils_1.isTag)(parent) ? parent : null;
79
+ }
80
+ return null;
81
+ };
82
+ exports.closest = closest;
83
+ const nextSiblingElement = (element) => {
84
+ if (!element) {
85
+ return null;
86
+ }
87
+ const sibling = (0, domutils_1.nextElementSibling)(element);
88
+ return sibling ?? null;
89
+ };
90
+ exports.nextSiblingElement = nextSiblingElement;
91
+ const previousSiblingElement = (element) => {
92
+ if (!element) {
93
+ return null;
94
+ }
95
+ const sibling = (0, domutils_1.prevElementSibling)(element);
96
+ return sibling ?? null;
97
+ };
98
+ exports.previousSiblingElement = previousSiblingElement;
99
+ const isElement = (node) => !!node && (0, domutils_1.isTag)(node);
100
+ exports.isElement = isElement;
101
+ const filterElements = (nodes) => nodes.filter((node) => (0, domutils_1.isTag)(node));
102
+ exports.filterElements = filterElements;
103
+ const getChildrenElements = (element) => {
104
+ if (!element) {
105
+ return [];
106
+ }
107
+ return (0, exports.filterElements)(element.children ?? []);
108
+ };
109
+ exports.getChildrenElements = getChildrenElements;
110
+ const matches = (element, selector) => {
111
+ if (!element) {
112
+ return false;
113
+ }
114
+ return (0, css_select_1.is)(element, selector);
115
+ };
116
+ exports.matches = matches;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.extractFirstQuotedValue = exports.normalizeWhitespace = void 0;
4
+ const normalizeWhitespace = (value) => value.replace(/\s+/g, " ").trim();
5
+ exports.normalizeWhitespace = normalizeWhitespace;
6
+ const extractFirstQuotedValue = (raw) => {
7
+ if (!raw) {
8
+ return null;
9
+ }
10
+ const match = raw.match(/'([^']+)'/);
11
+ return match ? match[1] ?? null : null;
12
+ };
13
+ exports.extractFirstQuotedValue = extractFirstQuotedValue;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCubicsAsTimetable = void 0;
4
+ var cubics_1 = require("./parser/cubics");
5
+ Object.defineProperty(exports, "parseCubicsAsTimetable", { enumerable: true, get: function () { return cubics_1.parseCubicsAsTimetable; } });
@@ -0,0 +1,94 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseCubicsAsTimetable = void 0;
4
+ const dom_1 = require("../../common/dom");
5
+ const cubics_1 = require("../types/cubics");
6
+ const utils_1 = require("../../common/utils");
7
+ const parseCubicsAsTimetable = (html) => {
8
+ const document = (0, dom_1.loadDocument)(html);
9
+ const studentTable = (0, dom_1.queryOne)("table.output", document);
10
+ const studentRows = studentTable ? (0, dom_1.queryAll)("tr", studentTable) : [];
11
+ const row1Cells = studentRows[0] ? (0, dom_1.queryAll)("td", studentRows[0]) : [];
12
+ const row2Cells = studentRows[1] ? (0, dom_1.queryAll)("td", studentRows[1]) : [];
13
+ const row3Cells = studentRows[2] ? (0, dom_1.queryAll)("td", studentRows[2]) : [];
14
+ const row4Cells = studentRows[3] ? (0, dom_1.queryAll)("td", studentRows[3]) : [];
15
+ const getCellText = (cells, index) => (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)(cells[index] ?? null));
16
+ const student = {
17
+ id: getCellText(row1Cells, 0),
18
+ name: getCellText(row1Cells, 1),
19
+ division: getCellText(row2Cells, 0),
20
+ affiliation: getCellText(row2Cells, 1),
21
+ status: getCellText(row2Cells, 2),
22
+ className: getCellText(row2Cells, 3),
23
+ faculty: getCellText(row3Cells, 0),
24
+ department: getCellText(row3Cells, 1),
25
+ course: getCellText(row3Cells, 2),
26
+ address: getCellText(row4Cells, 0),
27
+ };
28
+ const periodInput = (0, dom_1.queryOne)("input[name='lblSpcfProd']", document);
29
+ const fallbackPeriod = (0, dom_1.queryOne)("div.searcharea ul li", document);
30
+ const periodRangeRaw = (0, dom_1.getAttribute)(periodInput, "value") ?? (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)(fallbackPeriod));
31
+ const periodRange = (0, utils_1.normalizeWhitespace)(periodRangeRaw);
32
+ const curriculumTable = (0, dom_1.queryOne)("table.output_curriculum", document);
33
+ const headerRow = curriculumTable ? (0, dom_1.queryOne)("tr", curriculumTable) : null;
34
+ const headerCells = headerRow ? (0, dom_1.queryAll)("th", headerRow).slice(1) : [];
35
+ const days = headerCells.map((element) => {
36
+ const text = (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)(element));
37
+ const segments = text.split(" ").filter((segment) => segment.length > 0);
38
+ return {
39
+ label: segments[0] ?? "",
40
+ date: segments[1] ?? "",
41
+ };
42
+ });
43
+ const periodRows = curriculumTable ? (0, dom_1.queryAll)("tr", curriculumTable).slice(1) : [];
44
+ const periods = periodRows.map((row) => {
45
+ const periodLabel = (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)((0, dom_1.queryOne)("th", row)));
46
+ const cells = (0, dom_1.queryAll)("td", row);
47
+ const slots = cells.map((cell) => {
48
+ const lessonCode = (0, dom_1.getAttribute)((0, dom_1.queryOne)('input[name$=".hdnLsnCd1"]', cell), "value");
49
+ const lessonYear = (0, dom_1.getAttribute)((0, dom_1.queryOne)('input[name$=".hdnLsnOpcFcy1"]', cell), "value");
50
+ const termCode = (0, dom_1.getAttribute)((0, dom_1.queryOne)('input[name$=".hdnTacTrmCd1"]', cell), "value");
51
+ const timetableCode = (0, dom_1.getAttribute)((0, dom_1.queryOne)('input[name$=".hdnTmtxCd"]', cell), "value");
52
+ const optionDate = (0, dom_1.getAttribute)((0, dom_1.queryOne)('input[name$=".hdnOpcDt"]', cell), "value");
53
+ const detailAnchor = (0, dom_1.queryAll)("a", cell).find((anchor) => ((0, dom_1.getAttribute)(anchor, "onclick") ?? "").includes("execPopupWindowOpen"));
54
+ const detailOnclick = detailAnchor ? (0, dom_1.getAttribute)(detailAnchor, "onclick") ?? "" : "";
55
+ const infoAnchors = (0, dom_1.queryAll)("a.chiphelp", cell);
56
+ const classroom = (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)(infoAnchors[0] ?? null));
57
+ const subject = (0, utils_1.normalizeWhitespace)((0, dom_1.getTextContent)(infoAnchors[1] ?? null));
58
+ const slot = {
59
+ classroom: classroom.length ? classroom : null,
60
+ subject: subject.length ? subject : null,
61
+ detailUrl: (0, utils_1.extractFirstQuotedValue)(detailOnclick),
62
+ lessonCode,
63
+ lessonYear,
64
+ termCode,
65
+ timetableCode,
66
+ optionDate,
67
+ };
68
+ if (!slot.classroom && !slot.subject && !slot.detailUrl && !slot.lessonCode) {
69
+ return {
70
+ classroom: null,
71
+ subject: null,
72
+ detailUrl: null,
73
+ lessonCode: null,
74
+ lessonYear: null,
75
+ termCode: null,
76
+ timetableCode: null,
77
+ optionDate: null,
78
+ };
79
+ }
80
+ return slot;
81
+ });
82
+ return {
83
+ periodLabel,
84
+ slots,
85
+ };
86
+ });
87
+ return cubics_1.CubicsAsTimetableSchema.safeParse({
88
+ student,
89
+ periodRange,
90
+ days,
91
+ periods,
92
+ });
93
+ };
94
+ exports.parseCubicsAsTimetable = parseCubicsAsTimetable;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CubicsAsTimetableSchema = exports.CubicsAsTimetablePeriodSchema = exports.CubicsAsTimetableSlotSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.CubicsAsTimetableSlotSchema = zod_1.z.object({
6
+ classroom: zod_1.z.string().nullable(),
7
+ subject: zod_1.z.string().nullable(),
8
+ detailUrl: zod_1.z.string().nullable(),
9
+ lessonCode: zod_1.z.string().nullable(),
10
+ lessonYear: zod_1.z.string().nullable(),
11
+ termCode: zod_1.z.string().nullable(),
12
+ timetableCode: zod_1.z.string().nullable(),
13
+ optionDate: zod_1.z.string().nullable(),
14
+ });
15
+ exports.CubicsAsTimetablePeriodSchema = zod_1.z.object({
16
+ periodLabel: zod_1.z.string(),
17
+ slots: zod_1.z.array(exports.CubicsAsTimetableSlotSchema),
18
+ });
19
+ exports.CubicsAsTimetableSchema = zod_1.z.object({
20
+ student: zod_1.z.object({
21
+ id: zod_1.z.string(),
22
+ name: zod_1.z.string(),
23
+ division: zod_1.z.string(),
24
+ affiliation: zod_1.z.string(),
25
+ status: zod_1.z.string(),
26
+ className: zod_1.z.string(),
27
+ faculty: zod_1.z.string(),
28
+ department: zod_1.z.string(),
29
+ course: zod_1.z.string(),
30
+ address: zod_1.z.string(),
31
+ }),
32
+ periodRange: zod_1.z.string(),
33
+ days: zod_1.z.array(zod_1.z.object({
34
+ label: zod_1.z.string(),
35
+ date: zod_1.z.string(),
36
+ })),
37
+ periods: zod_1.z.array(exports.CubicsAsTimetablePeriodSchema),
38
+ });
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./albo/index"), exports);
18
+ __exportStar(require("./cubics/index"), exports);
19
+ __exportStar(require("./manabo/index"), exports);
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseManaboTimetable = exports.parseManaboNews = exports.parseManaboMailMember = exports.parseManaboMailSend = exports.parseManaboMailView = exports.parseManaboSentMail = exports.parseManaboReceivedMail = exports.parseManaboEntryResponse = exports.parseManaboEntryForm = exports.parseManaboClassQuizResult = exports.parseManaboClassSyllabus = exports.parseManaboClassNews = exports.parseManaboClassEntry = exports.parseManaboClassContent = exports.parseManaboClassDirectory = void 0;
4
+ var manaboClass_1 = require("./parser/manaboClass");
5
+ Object.defineProperty(exports, "parseManaboClassDirectory", { enumerable: true, get: function () { return manaboClass_1.parseManaboClassDirectory; } });
6
+ Object.defineProperty(exports, "parseManaboClassContent", { enumerable: true, get: function () { return manaboClass_1.parseManaboClassContent; } });
7
+ Object.defineProperty(exports, "parseManaboClassEntry", { enumerable: true, get: function () { return manaboClass_1.parseManaboClassEntry; } });
8
+ Object.defineProperty(exports, "parseManaboClassNews", { enumerable: true, get: function () { return manaboClass_1.parseManaboClassNews; } });
9
+ Object.defineProperty(exports, "parseManaboClassSyllabus", { enumerable: true, get: function () { return manaboClass_1.parseManaboClassSyllabus; } });
10
+ Object.defineProperty(exports, "parseManaboClassQuizResult", { enumerable: true, get: function () { return manaboClass_1.parseManaboClassQuizResult; } });
11
+ var manaboEntry_1 = require("./parser/manaboEntry");
12
+ Object.defineProperty(exports, "parseManaboEntryForm", { enumerable: true, get: function () { return manaboEntry_1.parseManaboEntryForm; } });
13
+ Object.defineProperty(exports, "parseManaboEntryResponse", { enumerable: true, get: function () { return manaboEntry_1.parseManaboEntryResponse; } });
14
+ var manaboMail_1 = require("./parser/manaboMail");
15
+ Object.defineProperty(exports, "parseManaboReceivedMail", { enumerable: true, get: function () { return manaboMail_1.parseManaboReceivedMail; } });
16
+ Object.defineProperty(exports, "parseManaboSentMail", { enumerable: true, get: function () { return manaboMail_1.parseManaboSentMail; } });
17
+ Object.defineProperty(exports, "parseManaboMailView", { enumerable: true, get: function () { return manaboMail_1.parseManaboMailView; } });
18
+ Object.defineProperty(exports, "parseManaboMailSend", { enumerable: true, get: function () { return manaboMail_1.parseManaboMailSend; } });
19
+ Object.defineProperty(exports, "parseManaboMailMember", { enumerable: true, get: function () { return manaboMail_1.parseManaboMailMember; } });
20
+ var manaboNews_1 = require("./parser/manaboNews");
21
+ Object.defineProperty(exports, "parseManaboNews", { enumerable: true, get: function () { return manaboNews_1.parseManaboNews; } });
22
+ var manaboTimetable_1 = require("./parser/manaboTimetable");
23
+ Object.defineProperty(exports, "parseManaboTimetable", { enumerable: true, get: function () { return manaboTimetable_1.parseManaboTimetable; } });