@mo7yw4ng/openape 1.0.6 → 2.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.
Files changed (152) hide show
  1. package/bin/openape +29 -0
  2. package/bin/openape.js +29 -0
  3. package/package.json +22 -28
  4. package/LICENSE +0 -21
  5. package/README.md +0 -138
  6. package/esm/_dnt.polyfills.d.ts +0 -101
  7. package/esm/_dnt.polyfills.d.ts.map +0 -1
  8. package/esm/_dnt.polyfills.js +0 -127
  9. package/esm/_dnt.shims.d.ts +0 -6
  10. package/esm/_dnt.shims.d.ts.map +0 -1
  11. package/esm/_dnt.shims.js +0 -61
  12. package/esm/deno.d.ts +0 -25
  13. package/esm/deno.d.ts.map +0 -1
  14. package/esm/deno.js +0 -23
  15. package/esm/package.json +0 -3
  16. package/esm/src/commands/announcements.d.ts +0 -3
  17. package/esm/src/commands/announcements.d.ts.map +0 -1
  18. package/esm/src/commands/announcements.js +0 -71
  19. package/esm/src/commands/assignments.d.ts +0 -3
  20. package/esm/src/commands/assignments.d.ts.map +0 -1
  21. package/esm/src/commands/assignments.js +0 -229
  22. package/esm/src/commands/auth.d.ts +0 -3
  23. package/esm/src/commands/auth.d.ts.map +0 -1
  24. package/esm/src/commands/auth.js +0 -290
  25. package/esm/src/commands/calendar.d.ts +0 -3
  26. package/esm/src/commands/calendar.d.ts.map +0 -1
  27. package/esm/src/commands/calendar.js +0 -127
  28. package/esm/src/commands/courses.d.ts +0 -3
  29. package/esm/src/commands/courses.d.ts.map +0 -1
  30. package/esm/src/commands/courses.js +0 -312
  31. package/esm/src/commands/forums.d.ts +0 -3
  32. package/esm/src/commands/forums.d.ts.map +0 -1
  33. package/esm/src/commands/forums.js +0 -190
  34. package/esm/src/commands/grades.d.ts +0 -3
  35. package/esm/src/commands/grades.d.ts.map +0 -1
  36. package/esm/src/commands/grades.js +0 -84
  37. package/esm/src/commands/materials.d.ts +0 -3
  38. package/esm/src/commands/materials.d.ts.map +0 -1
  39. package/esm/src/commands/materials.js +0 -402
  40. package/esm/src/commands/quizzes.d.ts +0 -3
  41. package/esm/src/commands/quizzes.d.ts.map +0 -1
  42. package/esm/src/commands/quizzes.js +0 -236
  43. package/esm/src/commands/skills.d.ts +0 -3
  44. package/esm/src/commands/skills.d.ts.map +0 -1
  45. package/esm/src/commands/skills.js +0 -106
  46. package/esm/src/commands/upload.d.ts +0 -3
  47. package/esm/src/commands/upload.d.ts.map +0 -1
  48. package/esm/src/commands/upload.js +0 -55
  49. package/esm/src/commands/videos.d.ts +0 -3
  50. package/esm/src/commands/videos.d.ts.map +0 -1
  51. package/esm/src/commands/videos.js +0 -266
  52. package/esm/src/index.d.ts +0 -28
  53. package/esm/src/index.d.ts.map +0 -1
  54. package/esm/src/index.js +0 -164
  55. package/esm/src/lib/auth.d.ts +0 -66
  56. package/esm/src/lib/auth.d.ts.map +0 -1
  57. package/esm/src/lib/auth.js +0 -286
  58. package/esm/src/lib/config.d.ts +0 -6
  59. package/esm/src/lib/config.d.ts.map +0 -1
  60. package/esm/src/lib/config.js +0 -36
  61. package/esm/src/lib/logger.d.ts +0 -3
  62. package/esm/src/lib/logger.d.ts.map +0 -1
  63. package/esm/src/lib/logger.js +0 -26
  64. package/esm/src/lib/moodle.d.ts +0 -447
  65. package/esm/src/lib/moodle.d.ts.map +0 -1
  66. package/esm/src/lib/moodle.js +0 -1353
  67. package/esm/src/lib/session.d.ts +0 -8
  68. package/esm/src/lib/session.d.ts.map +0 -1
  69. package/esm/src/lib/session.js +0 -42
  70. package/esm/src/lib/token.d.ts +0 -38
  71. package/esm/src/lib/token.d.ts.map +0 -1
  72. package/esm/src/lib/token.js +0 -178
  73. package/esm/src/lib/types.d.ts +0 -189
  74. package/esm/src/lib/types.d.ts.map +0 -1
  75. package/esm/src/lib/types.js +0 -2
  76. package/esm/src/lib/utils.d.ts +0 -52
  77. package/esm/src/lib/utils.d.ts.map +0 -1
  78. package/esm/src/lib/utils.js +0 -122
  79. package/script/_dnt.polyfills.d.ts +0 -101
  80. package/script/_dnt.polyfills.d.ts.map +0 -1
  81. package/script/_dnt.polyfills.js +0 -130
  82. package/script/_dnt.shims.d.ts +0 -6
  83. package/script/_dnt.shims.d.ts.map +0 -1
  84. package/script/_dnt.shims.js +0 -65
  85. package/script/deno.d.ts +0 -25
  86. package/script/deno.d.ts.map +0 -1
  87. package/script/deno.js +0 -25
  88. package/script/package.json +0 -3
  89. package/script/src/commands/announcements.d.ts +0 -3
  90. package/script/src/commands/announcements.d.ts.map +0 -1
  91. package/script/src/commands/announcements.js +0 -74
  92. package/script/src/commands/assignments.d.ts +0 -3
  93. package/script/src/commands/assignments.d.ts.map +0 -1
  94. package/script/src/commands/assignments.js +0 -268
  95. package/script/src/commands/auth.d.ts +0 -3
  96. package/script/src/commands/auth.d.ts.map +0 -1
  97. package/script/src/commands/auth.js +0 -296
  98. package/script/src/commands/calendar.d.ts +0 -3
  99. package/script/src/commands/calendar.d.ts.map +0 -1
  100. package/script/src/commands/calendar.js +0 -133
  101. package/script/src/commands/courses.d.ts +0 -3
  102. package/script/src/commands/courses.d.ts.map +0 -1
  103. package/script/src/commands/courses.js +0 -315
  104. package/script/src/commands/forums.d.ts +0 -3
  105. package/script/src/commands/forums.d.ts.map +0 -1
  106. package/script/src/commands/forums.js +0 -193
  107. package/script/src/commands/grades.d.ts +0 -3
  108. package/script/src/commands/grades.d.ts.map +0 -1
  109. package/script/src/commands/grades.js +0 -87
  110. package/script/src/commands/materials.d.ts +0 -3
  111. package/script/src/commands/materials.d.ts.map +0 -1
  112. package/script/src/commands/materials.js +0 -408
  113. package/script/src/commands/quizzes.d.ts +0 -3
  114. package/script/src/commands/quizzes.d.ts.map +0 -1
  115. package/script/src/commands/quizzes.js +0 -239
  116. package/script/src/commands/skills.d.ts +0 -3
  117. package/script/src/commands/skills.d.ts.map +0 -1
  118. package/script/src/commands/skills.js +0 -112
  119. package/script/src/commands/upload.d.ts +0 -3
  120. package/script/src/commands/upload.d.ts.map +0 -1
  121. package/script/src/commands/upload.js +0 -61
  122. package/script/src/commands/videos.d.ts +0 -3
  123. package/script/src/commands/videos.d.ts.map +0 -1
  124. package/script/src/commands/videos.js +0 -272
  125. package/script/src/index.d.ts +0 -28
  126. package/script/src/index.d.ts.map +0 -1
  127. package/script/src/index.js +0 -171
  128. package/script/src/lib/auth.d.ts +0 -66
  129. package/script/src/lib/auth.d.ts.map +0 -1
  130. package/script/src/lib/auth.js +0 -296
  131. package/script/src/lib/config.d.ts +0 -6
  132. package/script/src/lib/config.d.ts.map +0 -1
  133. package/script/src/lib/config.js +0 -42
  134. package/script/src/lib/logger.d.ts +0 -3
  135. package/script/src/lib/logger.d.ts.map +0 -1
  136. package/script/src/lib/logger.js +0 -29
  137. package/script/src/lib/moodle.d.ts +0 -447
  138. package/script/src/lib/moodle.d.ts.map +0 -1
  139. package/script/src/lib/moodle.js +0 -1425
  140. package/script/src/lib/session.d.ts +0 -8
  141. package/script/src/lib/session.d.ts.map +0 -1
  142. package/script/src/lib/session.js +0 -45
  143. package/script/src/lib/token.d.ts +0 -38
  144. package/script/src/lib/token.d.ts.map +0 -1
  145. package/script/src/lib/token.js +0 -189
  146. package/script/src/lib/types.d.ts +0 -189
  147. package/script/src/lib/types.d.ts.map +0 -1
  148. package/script/src/lib/types.js +0 -3
  149. package/script/src/lib/utils.d.ts +0 -52
  150. package/script/src/lib/utils.d.ts.map +0 -1
  151. package/script/src/lib/utils.js +0 -167
  152. package/skills/openape/SKILL.md +0 -115
package/bin/openape ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const child_process_1 = require("child_process");
5
+ function getExePath() {
6
+ const arch = process.arch;
7
+ let os = process.platform;
8
+ let ext = "";
9
+ if (os === "win32" || os === "cygwin") {
10
+ os = "win32";
11
+ ext = ".exe";
12
+ }
13
+ const pkg = `openape-${os}-${arch}`;
14
+ try {
15
+ return require.resolve(`${pkg}/bin/openape${ext}`);
16
+ }
17
+ catch {
18
+ throw new Error(`Unsupported platform: ${process.platform} ${arch}\n` +
19
+ `Try installing the platform package manually: npm install ${pkg}`);
20
+ }
21
+ }
22
+ const result = (0, child_process_1.spawnSync)(getExePath(), process.argv.slice(2), {
23
+ stdio: "inherit",
24
+ });
25
+ if (result.error) {
26
+ console.error(result.error.message);
27
+ process.exit(1);
28
+ }
29
+ process.exit(result.status ?? 0);
package/bin/openape.js ADDED
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const child_process_1 = require("child_process");
5
+ function getExePath() {
6
+ const arch = process.arch;
7
+ let os = process.platform;
8
+ let ext = "";
9
+ if (os === "win32" || os === "cygwin") {
10
+ os = "win32";
11
+ ext = ".exe";
12
+ }
13
+ const pkg = `openape-${os}-${arch}`;
14
+ try {
15
+ return require.resolve(`${pkg}/bin/openape${ext}`);
16
+ }
17
+ catch {
18
+ throw new Error(`Unsupported platform: ${process.platform} ${arch}\n` +
19
+ `Try installing the platform package manually: npm install ${pkg}`);
20
+ }
21
+ }
22
+ const result = (0, child_process_1.spawnSync)(getExePath(), process.argv.slice(2), {
23
+ stdio: "inherit",
24
+ });
25
+ if (result.error) {
26
+ console.error(result.error.message);
27
+ process.exit(1);
28
+ }
29
+ process.exit(result.status ?? 0);
package/package.json CHANGED
@@ -1,37 +1,31 @@
1
1
  {
2
2
  "name": "@mo7yw4ng/openape",
3
- "version": "1.0.6",
3
+ "version": "2.0.3",
4
4
  "description": "CLI tool for CYCU i-Learning platform",
5
- "keywords": [
6
- "ilearning",
7
- "cycu",
8
- "cli",
9
- "headless",
10
- "automation",
11
- "playwright"
12
- ],
13
- "repository": {
14
- "type": "git",
15
- "url": "https://github.com/MO7YW4NG/openape"
16
- },
17
- "license": "MIT",
18
- "bugs": {
19
- "url": "https://github.com/mo7yw4ng/openape/issues"
20
- },
21
- "scripts": {},
22
5
  "bin": {
23
- "openape": "./script/src/index.js"
6
+ "openape": "bin/openape.js"
24
7
  },
25
- "engines": {
26
- "node": ">=18.0.0"
8
+ "scripts": {
9
+ "build": "tsc && npx shx mv bin/index.js bin/openape.js"
27
10
  },
28
- "dependencies": {
29
- "commander": "^12.1.0",
30
- "playwright-core": "^1.48.0",
31
- "@deno/shim-deno": "~0.18.0"
11
+ "optionalDependencies": {
12
+ "@mo7yw4ng/openape-linux-x64": "2.0.3",
13
+ "@mo7yw4ng/openape-linux-arm64": "2.0.3",
14
+ "@mo7yw4ng/openape-darwin-x64": "2.0.3",
15
+ "@mo7yw4ng/openape-darwin-arm64": "2.0.3",
16
+ "@mo7yw4ng/openape-win32-x64": "2.0.3",
17
+ "@mo7yw4ng/openape-win32-arm64": "2.0.3"
32
18
  },
33
19
  "devDependencies": {
34
- "@types/node": "^20.9.0"
20
+ "typescript": "^5.0.0",
21
+ "@types/node": "^20.0.0"
22
+ },
23
+ "files": [
24
+ "bin/"
25
+ ],
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "https://github.com/MO7YW4NG/openape"
35
29
  },
36
- "_generatedBy": "dnt@dev"
37
- }
30
+ "license": "MIT"
31
+ }
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 MO7YW4NG
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
package/README.md DELETED
@@ -1,138 +0,0 @@
1
- <h1 align="center">
2
- <img src="assets/logo.svg" width="150" /><br/>
3
- OpenApe CLI (Unofficial)<br/>
4
- <a href="https://www.npmjs.com/package/@mo7yw4ng/openape"><img src="https://img.shields.io/npm/v/@mo7yw4ng/openape" alt="npm version" /></a>
5
- <a href="https://jsr.io/@openape/openape"><img src="https://jsr.io/badges/@openape/openape" alt="JSR" /></a>
6
- <a href="https://www.npmjs.com/package/@mo7yw4ng/openape"><img src="https://img.shields.io/npm/dm/@mo7yw4ng/openape" alt="npm downloads" /></a>
7
- </h1>
8
-
9
- 中原大學 [i-Learning](https://ilearning.cycu.edu.tw/) (Moodle) 平台自動化命令列工具 (CLI),幫助你快速查詢課程、觀看影片、下載教材。
10
-
11
- ## 功能特色
12
- - 📚 **課程資訊**:列出修課清單、成績、課程大綱與進度。
13
- - 📺 **影片輔助**:列出/下載影片,甚至自動標記為已觀看。
14
- - 📝 **測驗與教材**:快速進行測驗、下載教材。
15
- - 💬 **討論區與公告**:閱讀公告、討論區、發表回覆。
16
- - 📅 **行事曆**:內建行事曆事件查詢與匯出。
17
- - ✅ **作業繳交**:查詢作業、檢查繳交狀態、上傳檔案並繳交。
18
- - 🤖 **Agent Skills**:提供 Claude Code 等 Skills 工作流支援。
19
-
20
- ## 安裝
21
-
22
- 透過 npm 安裝為全域指令(推薦,[Node.js](https://nodejs.org/) v18+):
23
- ```bash
24
- npm install -g @mo7yw4ng/openape
25
- ```
26
-
27
- 或用 npx 單次執行(不需安裝):
28
- ```bash
29
- npx @mo7yw4ng/openape --help
30
- ```
31
-
32
- 或透過 Deno/JSR 安裝:
33
- ```bash
34
- deno install -A -g -n openape jsr:@openape/openape
35
- ```
36
-
37
- ## 核心指令
38
-
39
- ### 登入與驗證 (Authentication)
40
- 第一次使用需要登入,會開啟瀏覽器讓你手動完成登入,隨後會快取 Session 供未來使用。
41
- ```bash
42
- openape login # 登入並儲存 session (開啟瀏覽器)
43
- openape status # 檢查當前登入狀態
44
- openape logout # 登出並清除 session
45
- ```
46
-
47
- ### 課程 (Courses)
48
- ```bash
49
- openape courses list # 列出所有課程 (支援 --incomplete-only, --level)
50
- openape courses info <id> # 顯示特定課程的詳細資訊
51
- openape courses progress <id> # 顯示特定課程的進度
52
- openape courses syllabus <id> # 顯示課程大綱
53
- ```
54
-
55
- ### 影片 (Videos)
56
- ```bash
57
- openape videos list <course-id> # 列出課程中的影片
58
- openape videos complete <id> # 標記特定影片為已觀看
59
- openape videos complete-all # 影片批次完成
60
- openape videos download <id> # 下載影片 (支援 --output-dir)
61
- ```
62
-
63
- ### 測驗與教材 (Quizzes & Materials)
64
- ```bash
65
- openape quizzes list <course-id> # 列出特定課程測驗
66
- openape quizzes list-all # 列出所有課程測驗
67
- openape quizzes start <quiz-id> # 開始測驗
68
- openape quizzes info <attempt-id> # 查看測驗題目
69
- openape quizzes save <attempt-id> '<answers>' # 儲存測驗答案
70
- openape materials list-all # 列出所有可下載教材
71
- openape materials download <id> # 下載指定教材 (支援 --output-dir)
72
- openape materials download-all # 批次下載教材 (支援 --output-dir, --level)
73
- openape materials complete <id> # 標記教材為已完成
74
- openape materials complete-all # 批次標記教材為已完成
75
- ```
76
-
77
- ### 成績與其他查詢 (Grades, Forums, Calendar)
78
- ```bash
79
- openape grades summary # 顯示學期成績總覽
80
- openape grades course <id> # 顯示特定課程成績
81
- openape forums list # 列出進行中課程的討論區
82
- openape forums list-all # 列出所有討論區
83
- openape forums discussions <forum-id> # 列出討論區中的討論串
84
- openape forums posts <discussion-id> # 列出討論串中的貼文
85
- openape forums reply <post-id> <subject> <message> # 回覆貼文 (支援 --attachment-id)
86
- openape forums post <forum-id> <subject> <message> # 發起新討論
87
- openape forums delete <post-id> # 刪除討論貼文
88
- openape announcements list-all # 列出所有公告
89
- openape announcements read <id> # 閱讀特定公告
90
- openape calendar events # 查詢行事曆事件 (支援 --upcoming, --days, --course)
91
- openape calendar export # 匯出事件 (支援 --output, --days)
92
- ```
93
-
94
- ### 作業與檔案上傳 (Assignments & Upload)
95
- ```bash
96
- # 作業查詢與繳交
97
- openape assignments list <course-id> # 列出課程作業
98
- openape assignments list-all # 列出所有作業 (支援 --level all)
99
- openape assignments status <assignment-id> # 檢查作業繳交狀態
100
- openape assignments submit <assignment-id> # 繳交作業
101
- --text "內容" # 線上文字繳交
102
- --file-id <draft-id> # 使用已上傳的檔案 ID
103
- --file <path> # 直接上傳檔案並繳交
104
-
105
- # 檔案上傳至草稿區
106
- openape upload file <path> # 上傳檔案取得 draft ID
107
- ```
108
-
109
- ### Skills
110
- 讓你的 AI Agent 也可以控制 OpenApe。只需一個指令即可安裝:
111
- ```bash
112
- openape skills install claude # 為 Claude Code 安裝技能 (支援 claude, codex, opencode)
113
- openape skills install --all # 自動偵測環境並安裝給所有支援的 Agent
114
- ```
115
- 也可以透過 `npx skills` 安裝:
116
- ```bash
117
- npx skills add mo7yw4ng/openape
118
- ```
119
-
120
- ## 開發
121
-
122
- 專案使用 [Deno](https://deno.land/) 開發,歡迎一同貢獻:
123
-
124
- ```bash
125
- git clone https://github.com/mo7yw4ng/openape && cd openape
126
-
127
- # 啟動開發伺服器 (將直接執行 src/index.ts)
128
- deno task dev
129
-
130
- # 編譯成各平台執行檔 (預設輸出到 dist/OpenApe.exe)
131
- deno task compile
132
- ```
133
-
134
- ## 版權與授權
135
-
136
- 此專案之版權規範採用 **MIT License** - 至 [LICENSE](LICENSE) 查看更多相關聲明
137
-
138
- > **免責聲明**:本工具為非官方開放原始碼專案,與中原大學官方無關。請斟酌使用腳本輔助功能,避免不當操作(如短時間發送大量請求修改系統狀態)而違反學術倫理或導致帳號遭封鎖。
@@ -1,101 +0,0 @@
1
- /**
2
- * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
3
- * but instead of using npm to install additional dependencies,
4
- * this approach manually consolidates cjs/mjs/d.ts into a single file.
5
- *
6
- * Note that this code might be imported multiple times
7
- * (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
8
- * or Node.js might dynamically clear the cache and then force a require).
9
- * Therefore, it's important to avoid redundant writes to global objects.
10
- * Additionally, consider that commonjs is used alongside esm,
11
- * so the two ponyfill functions are stored independently in two separate global objects.
12
- */
13
- import { createRequire } from "node:module";
14
- import { type URL } from "node:url";
15
- declare global {
16
- interface ImportMeta {
17
- /** A string representation of the fully qualified module URL. When the
18
- * module is loaded locally, the value will be a file URL (e.g.
19
- * `file:///path/module.ts`).
20
- *
21
- * You can also parse the string as a URL to determine more information about
22
- * how the current module was loaded. For example to determine if a module was
23
- * local or not:
24
- *
25
- * ```ts
26
- * const url = new URL(import.meta.url);
27
- * if (url.protocol === "file:") {
28
- * console.log("this module was loaded locally");
29
- * }
30
- * ```
31
- */
32
- url: string;
33
- /**
34
- * A function that returns resolved specifier as if it would be imported
35
- * using `import(specifier)`.
36
- *
37
- * ```ts
38
- * console.log(import.meta.resolve("./foo.js"));
39
- * // file:///dev/foo.js
40
- * ```
41
- *
42
- * @param specifier The module specifier to resolve relative to `parent`.
43
- * @param parent The absolute parent module URL to resolve from.
44
- * @returns The absolute (`file:`) URL string for the resolved module.
45
- */
46
- resolve(specifier: string, parent?: string | URL | undefined): string;
47
- /** A flag that indicates if the current module is the main module that was
48
- * called when starting the program under Deno.
49
- *
50
- * ```ts
51
- * if (import.meta.main) {
52
- * // this was loaded as the main module, maybe do some bootstrapping
53
- * }
54
- * ```
55
- */
56
- main: boolean;
57
- /** The absolute path of the current module.
58
- *
59
- * This property is only provided for local modules (ie. using `file://` URLs).
60
- *
61
- * Example:
62
- * ```
63
- * // Unix
64
- * console.log(import.meta.filename); // /home/alice/my_module.ts
65
- *
66
- * // Windows
67
- * console.log(import.meta.filename); // C:\alice\my_module.ts
68
- * ```
69
- */
70
- filename: string;
71
- /** The absolute path of the directory containing the current module.
72
- *
73
- * This property is only provided for local modules (ie. using `file://` URLs).
74
- *
75
- * * Example:
76
- * ```
77
- * // Unix
78
- * console.log(import.meta.dirname); // /home/alice
79
- *
80
- * // Windows
81
- * console.log(import.meta.dirname); // C:\alice
82
- * ```
83
- */
84
- dirname: string;
85
- }
86
- }
87
- type NodeRequest = ReturnType<typeof createRequire>;
88
- type NodeModule = NonNullable<NodeRequest["main"]>;
89
- interface ImportMetaPonyfillCommonjs {
90
- (require: NodeRequest, module: NodeModule): ImportMeta;
91
- }
92
- interface ImportMetaPonyfillEsmodule {
93
- (importMeta: ImportMeta): ImportMeta;
94
- }
95
- interface ImportMetaPonyfill extends ImportMetaPonyfillCommonjs, ImportMetaPonyfillEsmodule {
96
- }
97
- export declare let import_meta_ponyfill_commonjs: ImportMetaPonyfillCommonjs;
98
- export declare let import_meta_ponyfill_esmodule: ImportMetaPonyfillEsmodule;
99
- export declare let import_meta_ponyfill: ImportMetaPonyfill;
100
- export {};
101
- //# sourceMappingURL=_dnt.polyfills.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_dnt.polyfills.d.ts","sourceRoot":"","sources":["../src/_dnt.polyfills.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAgC,KAAK,GAAG,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,UAAU;QAClB;;;;;;;;;;;;;;WAcG;QACH,GAAG,EAAE,MAAM,CAAC;QACZ;;;;;;;;;;;;WAYG;QACH,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,GAAG,MAAM,CAAC;QACtE;;;;;;;;WAQG;QACH,IAAI,EAAE,OAAO,CAAC;QAEd;;;;;;;;;;;;WAYG;QACH,QAAQ,EAAE,MAAM,CAAC;QAEjB;;;;;;;;;;;;WAYG;QACH,OAAO,EAAE,MAAM,CAAC;KACjB;CACF;AAED,KAAK,WAAW,GAAG,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC;AACpD,KAAK,UAAU,GAAG,WAAW,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC;AACnD,UAAU,0BAA0B;IAClC,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC;CACxD;AACD,UAAU,0BAA0B;IAClC,CAAC,UAAU,EAAE,UAAU,GAAG,UAAU,CAAC;CACtC;AACD,UAAU,kBACR,SAAQ,0BAA0B,EAAE,0BAA0B;CAC/D;AAiBD,eAAO,IAAI,6BAA6B,EA2BnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,6BAA6B,EA4DnC,0BAA0B,CAAC;AAMhC,eAAO,IAAI,oBAAoB,EAoB1B,kBAAkB,CAAC"}
@@ -1,127 +0,0 @@
1
- /**
2
- * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
3
- * but instead of using npm to install additional dependencies,
4
- * this approach manually consolidates cjs/mjs/d.ts into a single file.
5
- *
6
- * Note that this code might be imported multiple times
7
- * (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
8
- * or Node.js might dynamically clear the cache and then force a require).
9
- * Therefore, it's important to avoid redundant writes to global objects.
10
- * Additionally, consider that commonjs is used alongside esm,
11
- * so the two ponyfill functions are stored independently in two separate global objects.
12
- */
13
- //@ts-ignore
14
- import { createRequire } from "node:module";
15
- //@ts-ignore
16
- import { fileURLToPath, pathToFileURL } from "node:url";
17
- //@ts-ignore
18
- import { dirname } from "node:path";
19
- const defineGlobalPonyfill = (symbolFor, fn) => {
20
- if (!Reflect.has(globalThis, Symbol.for(symbolFor))) {
21
- Object.defineProperty(globalThis, Symbol.for(symbolFor), {
22
- configurable: true,
23
- get() {
24
- return fn;
25
- },
26
- });
27
- }
28
- };
29
- export let import_meta_ponyfill_commonjs = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ??
30
- (() => {
31
- const moduleImportMetaWM = new WeakMap();
32
- return (require, module) => {
33
- let importMetaCache = moduleImportMetaWM.get(module);
34
- if (importMetaCache == null) {
35
- const importMeta = Object.assign(Object.create(null), {
36
- url: pathToFileURL(module.filename).href,
37
- main: require.main == module,
38
- resolve: (specifier, parentURL = importMeta.url) => {
39
- return pathToFileURL((importMeta.url === parentURL
40
- ? require
41
- : createRequire(parentURL))
42
- .resolve(specifier)).href;
43
- },
44
- filename: module.filename,
45
- dirname: module.path,
46
- });
47
- moduleImportMetaWM.set(module, importMeta);
48
- importMetaCache = importMeta;
49
- }
50
- return importMetaCache;
51
- };
52
- })());
53
- defineGlobalPonyfill("import-meta-ponyfill-commonjs", import_meta_ponyfill_commonjs);
54
- export let import_meta_ponyfill_esmodule = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ??
55
- ((importMeta) => {
56
- const resolveFunStr = String(importMeta.resolve);
57
- const shimWs = new WeakSet();
58
- //@ts-ignore
59
- const mainUrl = ("file:///" + process.argv[1].replace(/\\/g, "/"))
60
- .replace(/\/{3,}/, "///");
61
- const commonShim = (importMeta) => {
62
- if (typeof importMeta.main !== "boolean") {
63
- importMeta.main = importMeta.url === mainUrl;
64
- }
65
- if (typeof importMeta.filename !== "string") {
66
- importMeta.filename = fileURLToPath(importMeta.url);
67
- importMeta.dirname = dirname(importMeta.filename);
68
- }
69
- };
70
- if (
71
- // v16.2.0+, v14.18.0+: Add support for WHATWG URL object to parentURL parameter.
72
- resolveFunStr === "undefined" ||
73
- // v20.0.0+, v18.19.0+"" This API now returns a string synchronously instead of a Promise.
74
- resolveFunStr.startsWith("async")
75
- // enable by --experimental-import-meta-resolve flag
76
- ) {
77
- import_meta_ponyfill_esmodule = (importMeta) => {
78
- if (!shimWs.has(importMeta)) {
79
- shimWs.add(importMeta);
80
- const importMetaUrlRequire = {
81
- url: importMeta.url,
82
- require: createRequire(importMeta.url),
83
- };
84
- importMeta.resolve = function resolve(specifier, parentURL = importMeta.url) {
85
- return pathToFileURL((importMetaUrlRequire.url === parentURL
86
- ? importMetaUrlRequire.require
87
- : createRequire(parentURL)).resolve(specifier)).href;
88
- };
89
- commonShim(importMeta);
90
- }
91
- return importMeta;
92
- };
93
- }
94
- else {
95
- /// native support
96
- import_meta_ponyfill_esmodule = (importMeta) => {
97
- if (!shimWs.has(importMeta)) {
98
- shimWs.add(importMeta);
99
- commonShim(importMeta);
100
- }
101
- return importMeta;
102
- };
103
- }
104
- return import_meta_ponyfill_esmodule(importMeta);
105
- }));
106
- defineGlobalPonyfill("import-meta-ponyfill-esmodule", import_meta_ponyfill_esmodule);
107
- export let import_meta_ponyfill = ((...args) => {
108
- const _MODULE = (() => {
109
- if (typeof require === "function" && typeof module === "object") {
110
- return "commonjs";
111
- }
112
- else {
113
- // eval("typeof import.meta");
114
- return "esmodule";
115
- }
116
- })();
117
- if (_MODULE === "commonjs") {
118
- //@ts-ignore
119
- import_meta_ponyfill = (r, m) => import_meta_ponyfill_commonjs(r, m);
120
- }
121
- else {
122
- //@ts-ignore
123
- import_meta_ponyfill = (im) => import_meta_ponyfill_esmodule(im);
124
- }
125
- //@ts-ignore
126
- return import_meta_ponyfill(...args);
127
- });
@@ -1,6 +0,0 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- export declare const dntGlobalThis: Omit<typeof globalThis, "Deno"> & {
4
- Deno: typeof Deno;
5
- };
6
- //# sourceMappingURL=_dnt.shims.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_dnt.shims.d.ts","sourceRoot":"","sources":["../src/_dnt.shims.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAKvC,eAAO,MAAM,aAAa;;CAA2C,CAAC"}
package/esm/_dnt.shims.js DELETED
@@ -1,61 +0,0 @@
1
- import { Deno } from "@deno/shim-deno";
2
- export { Deno } from "@deno/shim-deno";
3
- const dntGlobals = {
4
- Deno,
5
- };
6
- export const dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
7
- function createMergeProxy(baseObj, extObj) {
8
- return new Proxy(baseObj, {
9
- get(_target, prop, _receiver) {
10
- if (prop in extObj) {
11
- return extObj[prop];
12
- }
13
- else {
14
- return baseObj[prop];
15
- }
16
- },
17
- set(_target, prop, value) {
18
- if (prop in extObj) {
19
- delete extObj[prop];
20
- }
21
- baseObj[prop] = value;
22
- return true;
23
- },
24
- deleteProperty(_target, prop) {
25
- let success = false;
26
- if (prop in extObj) {
27
- delete extObj[prop];
28
- success = true;
29
- }
30
- if (prop in baseObj) {
31
- delete baseObj[prop];
32
- success = true;
33
- }
34
- return success;
35
- },
36
- ownKeys(_target) {
37
- const baseKeys = Reflect.ownKeys(baseObj);
38
- const extKeys = Reflect.ownKeys(extObj);
39
- const extKeysSet = new Set(extKeys);
40
- return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
41
- },
42
- defineProperty(_target, prop, desc) {
43
- if (prop in extObj) {
44
- delete extObj[prop];
45
- }
46
- Reflect.defineProperty(baseObj, prop, desc);
47
- return true;
48
- },
49
- getOwnPropertyDescriptor(_target, prop) {
50
- if (prop in extObj) {
51
- return Reflect.getOwnPropertyDescriptor(extObj, prop);
52
- }
53
- else {
54
- return Reflect.getOwnPropertyDescriptor(baseObj, prop);
55
- }
56
- },
57
- has(_target, prop) {
58
- return prop in extObj || prop in baseObj;
59
- },
60
- });
61
- }
package/esm/deno.d.ts DELETED
@@ -1,25 +0,0 @@
1
- declare namespace _default {
2
- let name: string;
3
- let version: string;
4
- let description: string;
5
- let license: string;
6
- let exports: string;
7
- let tasks: {
8
- dev: string;
9
- compile: string;
10
- "build:npm": string;
11
- };
12
- let imports: {
13
- "@deno/dnt": string;
14
- commander: string;
15
- "playwright-core": string;
16
- "node-html-parser": string;
17
- };
18
- let nodeModulesDir: string;
19
- namespace compilerOptions {
20
- let lib: string[];
21
- }
22
- let unstable: string[];
23
- }
24
- export default _default;
25
- //# sourceMappingURL=deno.d.ts.map
package/esm/deno.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"deno.d.ts","sourceRoot":"","sources":["../src/deno.js"],"names":[],"mappings":""}
package/esm/deno.js DELETED
@@ -1,23 +0,0 @@
1
- export default {
2
- "name": "@openape/openape",
3
- "version": "1.0.6",
4
- "description": "CLI tool for CYCU i-Learning platform",
5
- "license": "MIT",
6
- "exports": "./src/index.ts",
7
- "tasks": {
8
- "dev": "deno run --allow-all --sloppy-imports --watch src/index.ts",
9
- "compile": "deno compile --allow-all --no-check --sloppy-imports --output dist/OpenApe.exe src/index.ts",
10
- "build:npm": "deno run -A src/build_npm.ts"
11
- },
12
- "imports": {
13
- "@deno/dnt": "jsr:@deno/dnt@^0.42.3",
14
- "commander": "npm:commander@^12.1.0",
15
- "playwright-core": "npm:playwright-core@^1.48.0",
16
- "node-html-parser": "npm:node-html-parser@^6.1.13"
17
- },
18
- "nodeModulesDir": "auto",
19
- "compilerOptions": {
20
- "lib": ["ES2022", "DOM", "deno.ns"]
21
- },
22
- "unstable": ["sloppy-imports"]
23
- };
package/esm/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerAnnouncementsCommand(program: Command): void;
3
- //# sourceMappingURL=announcements.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"announcements.d.ts","sourceRoot":"","sources":["../../../src/src/commands/announcements.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMpC,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuFnE"}