@mo7yw4ng/openape 1.0.6 → 2.0.4

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 +32 -0
  3. package/package.json +24 -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
@@ -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,130 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.import_meta_ponyfill = exports.import_meta_ponyfill_esmodule = exports.import_meta_ponyfill_commonjs = void 0;
4
- /**
5
- * Based on [import-meta-ponyfill](https://github.com/gaubee/import-meta-ponyfill),
6
- * but instead of using npm to install additional dependencies,
7
- * this approach manually consolidates cjs/mjs/d.ts into a single file.
8
- *
9
- * Note that this code might be imported multiple times
10
- * (for example, both dnt.test.polyfills.ts and dnt.polyfills.ts contain this code;
11
- * or Node.js might dynamically clear the cache and then force a require).
12
- * Therefore, it's important to avoid redundant writes to global objects.
13
- * Additionally, consider that commonjs is used alongside esm,
14
- * so the two ponyfill functions are stored independently in two separate global objects.
15
- */
16
- //@ts-ignore
17
- const node_module_1 = require("node:module");
18
- //@ts-ignore
19
- const node_url_1 = require("node:url");
20
- //@ts-ignore
21
- const node_path_1 = require("node:path");
22
- const defineGlobalPonyfill = (symbolFor, fn) => {
23
- if (!Reflect.has(globalThis, Symbol.for(symbolFor))) {
24
- Object.defineProperty(globalThis, Symbol.for(symbolFor), {
25
- configurable: true,
26
- get() {
27
- return fn;
28
- },
29
- });
30
- }
31
- };
32
- exports.import_meta_ponyfill_commonjs = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-commonjs")) ??
33
- (() => {
34
- const moduleImportMetaWM = new WeakMap();
35
- return (require, module) => {
36
- let importMetaCache = moduleImportMetaWM.get(module);
37
- if (importMetaCache == null) {
38
- const importMeta = Object.assign(Object.create(null), {
39
- url: (0, node_url_1.pathToFileURL)(module.filename).href,
40
- main: require.main == module,
41
- resolve: (specifier, parentURL = importMeta.url) => {
42
- return (0, node_url_1.pathToFileURL)((importMeta.url === parentURL
43
- ? require
44
- : (0, node_module_1.createRequire)(parentURL))
45
- .resolve(specifier)).href;
46
- },
47
- filename: module.filename,
48
- dirname: module.path,
49
- });
50
- moduleImportMetaWM.set(module, importMeta);
51
- importMetaCache = importMeta;
52
- }
53
- return importMetaCache;
54
- };
55
- })());
56
- defineGlobalPonyfill("import-meta-ponyfill-commonjs", exports.import_meta_ponyfill_commonjs);
57
- exports.import_meta_ponyfill_esmodule = (Reflect.get(globalThis, Symbol.for("import-meta-ponyfill-esmodule")) ??
58
- ((importMeta) => {
59
- const resolveFunStr = String(importMeta.resolve);
60
- const shimWs = new WeakSet();
61
- //@ts-ignore
62
- const mainUrl = ("file:///" + process.argv[1].replace(/\\/g, "/"))
63
- .replace(/\/{3,}/, "///");
64
- const commonShim = (importMeta) => {
65
- if (typeof importMeta.main !== "boolean") {
66
- importMeta.main = importMeta.url === mainUrl;
67
- }
68
- if (typeof importMeta.filename !== "string") {
69
- importMeta.filename = (0, node_url_1.fileURLToPath)(importMeta.url);
70
- importMeta.dirname = (0, node_path_1.dirname)(importMeta.filename);
71
- }
72
- };
73
- if (
74
- // v16.2.0+, v14.18.0+: Add support for WHATWG URL object to parentURL parameter.
75
- resolveFunStr === "undefined" ||
76
- // v20.0.0+, v18.19.0+"" This API now returns a string synchronously instead of a Promise.
77
- resolveFunStr.startsWith("async")
78
- // enable by --experimental-import-meta-resolve flag
79
- ) {
80
- exports.import_meta_ponyfill_esmodule = (importMeta) => {
81
- if (!shimWs.has(importMeta)) {
82
- shimWs.add(importMeta);
83
- const importMetaUrlRequire = {
84
- url: importMeta.url,
85
- require: (0, node_module_1.createRequire)(importMeta.url),
86
- };
87
- importMeta.resolve = function resolve(specifier, parentURL = importMeta.url) {
88
- return (0, node_url_1.pathToFileURL)((importMetaUrlRequire.url === parentURL
89
- ? importMetaUrlRequire.require
90
- : (0, node_module_1.createRequire)(parentURL)).resolve(specifier)).href;
91
- };
92
- commonShim(importMeta);
93
- }
94
- return importMeta;
95
- };
96
- }
97
- else {
98
- /// native support
99
- exports.import_meta_ponyfill_esmodule = (importMeta) => {
100
- if (!shimWs.has(importMeta)) {
101
- shimWs.add(importMeta);
102
- commonShim(importMeta);
103
- }
104
- return importMeta;
105
- };
106
- }
107
- return (0, exports.import_meta_ponyfill_esmodule)(importMeta);
108
- }));
109
- defineGlobalPonyfill("import-meta-ponyfill-esmodule", exports.import_meta_ponyfill_esmodule);
110
- exports.import_meta_ponyfill = ((...args) => {
111
- const _MODULE = (() => {
112
- if (typeof require === "function" && typeof module === "object") {
113
- return "commonjs";
114
- }
115
- else {
116
- // eval("typeof import.meta");
117
- return "esmodule";
118
- }
119
- })();
120
- if (_MODULE === "commonjs") {
121
- //@ts-ignore
122
- exports.import_meta_ponyfill = (r, m) => (0, exports.import_meta_ponyfill_commonjs)(r, m);
123
- }
124
- else {
125
- //@ts-ignore
126
- exports.import_meta_ponyfill = (im) => (0, exports.import_meta_ponyfill_esmodule)(im);
127
- }
128
- //@ts-ignore
129
- return (0, exports.import_meta_ponyfill)(...args);
130
- });
@@ -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"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.dntGlobalThis = exports.Deno = void 0;
4
- const shim_deno_1 = require("@deno/shim-deno");
5
- var shim_deno_2 = require("@deno/shim-deno");
6
- Object.defineProperty(exports, "Deno", { enumerable: true, get: function () { return shim_deno_2.Deno; } });
7
- const dntGlobals = {
8
- Deno: shim_deno_1.Deno,
9
- };
10
- exports.dntGlobalThis = createMergeProxy(globalThis, dntGlobals);
11
- function createMergeProxy(baseObj, extObj) {
12
- return new Proxy(baseObj, {
13
- get(_target, prop, _receiver) {
14
- if (prop in extObj) {
15
- return extObj[prop];
16
- }
17
- else {
18
- return baseObj[prop];
19
- }
20
- },
21
- set(_target, prop, value) {
22
- if (prop in extObj) {
23
- delete extObj[prop];
24
- }
25
- baseObj[prop] = value;
26
- return true;
27
- },
28
- deleteProperty(_target, prop) {
29
- let success = false;
30
- if (prop in extObj) {
31
- delete extObj[prop];
32
- success = true;
33
- }
34
- if (prop in baseObj) {
35
- delete baseObj[prop];
36
- success = true;
37
- }
38
- return success;
39
- },
40
- ownKeys(_target) {
41
- const baseKeys = Reflect.ownKeys(baseObj);
42
- const extKeys = Reflect.ownKeys(extObj);
43
- const extKeysSet = new Set(extKeys);
44
- return [...baseKeys.filter((k) => !extKeysSet.has(k)), ...extKeys];
45
- },
46
- defineProperty(_target, prop, desc) {
47
- if (prop in extObj) {
48
- delete extObj[prop];
49
- }
50
- Reflect.defineProperty(baseObj, prop, desc);
51
- return true;
52
- },
53
- getOwnPropertyDescriptor(_target, prop) {
54
- if (prop in extObj) {
55
- return Reflect.getOwnPropertyDescriptor(extObj, prop);
56
- }
57
- else {
58
- return Reflect.getOwnPropertyDescriptor(baseObj, prop);
59
- }
60
- },
61
- has(_target, prop) {
62
- return prop in extObj || prop in baseObj;
63
- },
64
- });
65
- }
package/script/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
@@ -1 +0,0 @@
1
- {"version":3,"file":"deno.d.ts","sourceRoot":"","sources":["../src/deno.js"],"names":[],"mappings":""}
package/script/deno.js DELETED
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- "name": "@openape/openape",
5
- "version": "1.0.6",
6
- "description": "CLI tool for CYCU i-Learning platform",
7
- "license": "MIT",
8
- "exports": "./src/index.ts",
9
- "tasks": {
10
- "dev": "deno run --allow-all --sloppy-imports --watch src/index.ts",
11
- "compile": "deno compile --allow-all --no-check --sloppy-imports --output dist/OpenApe.exe src/index.ts",
12
- "build:npm": "deno run -A src/build_npm.ts"
13
- },
14
- "imports": {
15
- "@deno/dnt": "jsr:@deno/dnt@^0.42.3",
16
- "commander": "npm:commander@^12.1.0",
17
- "playwright-core": "npm:playwright-core@^1.48.0",
18
- "node-html-parser": "npm:node-html-parser@^6.1.13"
19
- },
20
- "nodeModulesDir": "auto",
21
- "compilerOptions": {
22
- "lib": ["ES2022", "DOM", "deno.ns"]
23
- },
24
- "unstable": ["sloppy-imports"]
25
- };
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
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"}
@@ -1,74 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.registerAnnouncementsCommand = registerAnnouncementsCommand;
4
- const utils_js_1 = require("../lib/utils.js");
5
- const moodle_js_1 = require("../lib/moodle.js");
6
- const auth_js_1 = require("../lib/auth.js");
7
- const index_js_1 = require("../index.js");
8
- function registerAnnouncementsCommand(program) {
9
- const announcementsCmd = program.command("announcements");
10
- announcementsCmd.description("Announcement operations");
11
- announcementsCmd
12
- .command("list-all")
13
- .description("List all announcements across all courses")
14
- .option("--level <type>", "Course level: in_progress (default) | all", "in_progress")
15
- .option("--unread-only", "Show only unread announcements")
16
- .option("--limit <n>", "Maximum number of announcements to show", "20")
17
- .option("--output <format>", "Output format: json|csv|table|silent")
18
- .action(async (options, command) => {
19
- const output = (0, utils_js_1.getOutputFormat)(command);
20
- const limit = parseInt(options.limit, 10);
21
- const apiContext = await (0, auth_js_1.createApiContext)(options, command);
22
- if (!apiContext) {
23
- process.exitCode = 1;
24
- return;
25
- }
26
- const siteInfo = await (0, moodle_js_1.getSiteInfoApi)(apiContext.session);
27
- const messages = await (0, moodle_js_1.getMessagesApi)(apiContext.session, siteInfo.userid, {
28
- limitnum: limit,
29
- });
30
- const allAnnouncements = messages.map(m => ({
31
- course_id: 0,
32
- course_name: "Notifications",
33
- id: m.id,
34
- subject: m.subject,
35
- author: `User ${m.useridfrom}`,
36
- author_id: m.useridfrom,
37
- created_at: (0, utils_js_1.formatTimestamp)(m.timecreated),
38
- modified_at: (0, utils_js_1.formatTimestamp)(m.timecreated),
39
- unread: false,
40
- }));
41
- allAnnouncements.sort((a, b) => b.created_at > a.created_at ? 1 : -1);
42
- const shown = allAnnouncements.slice(0, limit);
43
- (0, index_js_1.formatAndOutput)(shown, output, apiContext.log, { status: "success", timestamp: new Date().toISOString(), total_announcements: allAnnouncements.length, shown: shown.length });
44
- });
45
- announcementsCmd
46
- .command("read")
47
- .description("Read a specific announcement (shows full content)")
48
- .argument("<announcement-id>", "Discussion ID of the announcement")
49
- .option("--output <format>", "Output format: json|csv|table|silent")
50
- .action(async (announcementId, options, command) => {
51
- const output = (0, utils_js_1.getOutputFormat)(command);
52
- const apiContext = await (0, auth_js_1.createApiContext)(options, command);
53
- if (!apiContext) {
54
- process.exitCode = 1;
55
- return;
56
- }
57
- const posts = await (0, moodle_js_1.getDiscussionPostsApi)(apiContext.session, parseInt(announcementId, 10));
58
- if (posts.length === 0) {
59
- apiContext.log.error(`Announcement not found: ${announcementId}`);
60
- process.exitCode = 1;
61
- return;
62
- }
63
- const firstPost = posts[0];
64
- (0, index_js_1.formatAndOutput)({
65
- id: announcementId,
66
- subject: firstPost.subject,
67
- author: firstPost.author,
68
- author_id: firstPost.authorId,
69
- created_at: (0, utils_js_1.formatTimestamp)(firstPost.created),
70
- modified_at: (0, utils_js_1.formatTimestamp)(firstPost.modified),
71
- message: firstPost.message,
72
- }, output, apiContext.log);
73
- });
74
- }
@@ -1,3 +0,0 @@
1
- import { Command } from "commander";
2
- export declare function registerAssignmentsCommand(program: Command): void;
3
- //# sourceMappingURL=assignments.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assignments.d.ts","sourceRoot":"","sources":["../../../src/src/commands/assignments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAQpC,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAyPjE"}