moodle-cli 0.9.3 → 0.9.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.
package/dist/moodle.js CHANGED
@@ -4687,8 +4687,6 @@ function parseSubmissionForm(html, deps) {
4687
4687
  const repositories = (Array.isArray(picker.repositories) ? picker.repositories : Object.values(record2(picker.repositories))).map(record2);
4688
4688
  const upload = repositories.find((repo) => repo.type === "upload");
4689
4689
  if (!upload || upload.id === void 0) throw deps.fail("The site does not allow direct file uploads for this assignment.");
4690
- const accepted = options.accepted_types;
4691
- const acceptedTypes = Array.isArray(accepted) ? accepted.map(String).filter(Boolean) : accepted === void 0 || accepted === "*" ? "*" : [String(accepted)];
4692
4690
  return {
4693
4691
  action: resolveUrl(deps.baseUrl, form.getAttribute("action") || `${deps.baseUrl}${ASSIGN_VIEW_PATH}`),
4694
4692
  fields: fields2,
@@ -4702,7 +4700,7 @@ function parseSubmissionForm(html, deps) {
4702
4700
  maxBytes: integer(options.maxbytes),
4703
4701
  areaMaxBytes: integer(options.areamaxbytes),
4704
4702
  maxFiles: integer(options.maxfiles),
4705
- acceptedTypes: acceptedTypes.length === 1 && acceptedTypes[0] === "*" ? "*" : acceptedTypes,
4703
+ acceptedTypes: acceptedTypesOf(options.accepted_types),
4706
4704
  ...statementOf(form)
4707
4705
  };
4708
4706
  }
@@ -4800,6 +4798,11 @@ function filemanagerOptions(html, itemid) {
4800
4798
  }
4801
4799
  return null;
4802
4800
  }
4801
+ function acceptedTypesOf(value) {
4802
+ const list2 = Array.isArray(value) ? value : isRecord4(value) ? Object.values(value) : value === void 0 ? [] : [value];
4803
+ const types = list2.map((type) => String(type).trim()).filter(Boolean);
4804
+ return types.length === 0 || types.includes("*") ? "*" : types;
4805
+ }
4803
4806
  function balancedObject(text2, start) {
4804
4807
  if (text2[start] !== "{") return null;
4805
4808
  let depth = 0;
@@ -6825,7 +6828,7 @@ function standaloneAssetUrl(version, platform2, arch2) {
6825
6828
  }
6826
6829
 
6827
6830
  // src/version.ts
6828
- var VERSION = "0.9.3";
6831
+ var VERSION = "0.9.4";
6829
6832
 
6830
6833
  // src/update-check.ts
6831
6834
  var UPDATE_CACHE_FILENAME = "update-check.json";
@@ -26469,7 +26469,7 @@ function stringValue(value) {
26469
26469
  }
26470
26470
 
26471
26471
  // src/version.ts
26472
- var VERSION = "0.9.3";
26472
+ var VERSION = "0.9.4";
26473
26473
 
26474
26474
  // src/worker/http.ts
26475
26475
  var HEALTH_PATH = "/healthz";
@@ -27991,8 +27991,6 @@ function parseSubmissionForm(html, deps) {
27991
27991
  const repositories = (Array.isArray(picker.repositories) ? picker.repositories : Object.values(record2(picker.repositories))).map(record2);
27992
27992
  const upload = repositories.find((repo) => repo.type === "upload");
27993
27993
  if (!upload || upload.id === void 0) throw deps.fail("The site does not allow direct file uploads for this assignment.");
27994
- const accepted = options.accepted_types;
27995
- const acceptedTypes = Array.isArray(accepted) ? accepted.map(String).filter(Boolean) : accepted === void 0 || accepted === "*" ? "*" : [String(accepted)];
27996
27994
  return {
27997
27995
  action: resolveUrl(deps.baseUrl, form.getAttribute("action") || `${deps.baseUrl}${ASSIGN_VIEW_PATH}`),
27998
27996
  fields: fields2,
@@ -28006,7 +28004,7 @@ function parseSubmissionForm(html, deps) {
28006
28004
  maxBytes: integer2(options.maxbytes),
28007
28005
  areaMaxBytes: integer2(options.areamaxbytes),
28008
28006
  maxFiles: integer2(options.maxfiles),
28009
- acceptedTypes: acceptedTypes.length === 1 && acceptedTypes[0] === "*" ? "*" : acceptedTypes,
28007
+ acceptedTypes: acceptedTypesOf(options.accepted_types),
28010
28008
  ...statementOf(form)
28011
28009
  };
28012
28010
  }
@@ -28104,6 +28102,11 @@ function filemanagerOptions(html, itemid) {
28104
28102
  }
28105
28103
  return null;
28106
28104
  }
28105
+ function acceptedTypesOf(value) {
28106
+ const list2 = Array.isArray(value) ? value : isRecord5(value) ? Object.values(value) : value === void 0 ? [] : [value];
28107
+ const types = list2.map((type) => String(type).trim()).filter(Boolean);
28108
+ return types.length === 0 || types.includes("*") ? "*" : types;
28109
+ }
28107
28110
  function balancedObject(text, start) {
28108
28111
  if (text[start] !== "{") return null;
28109
28112
  let depth = 0;
@@ -26469,7 +26469,7 @@ function stringValue(value) {
26469
26469
  }
26470
26470
 
26471
26471
  // src/version.ts
26472
- var VERSION = "0.9.3";
26472
+ var VERSION = "0.9.4";
26473
26473
 
26474
26474
  // src/worker/http.ts
26475
26475
  var HEALTH_PATH = "/healthz";
@@ -27991,8 +27991,6 @@ function parseSubmissionForm(html, deps) {
27991
27991
  const repositories = (Array.isArray(picker.repositories) ? picker.repositories : Object.values(record2(picker.repositories))).map(record2);
27992
27992
  const upload = repositories.find((repo) => repo.type === "upload");
27993
27993
  if (!upload || upload.id === void 0) throw deps.fail("The site does not allow direct file uploads for this assignment.");
27994
- const accepted = options.accepted_types;
27995
- const acceptedTypes = Array.isArray(accepted) ? accepted.map(String).filter(Boolean) : accepted === void 0 || accepted === "*" ? "*" : [String(accepted)];
27996
27994
  return {
27997
27995
  action: resolveUrl(deps.baseUrl, form.getAttribute("action") || `${deps.baseUrl}${ASSIGN_VIEW_PATH}`),
27998
27996
  fields: fields2,
@@ -28006,7 +28004,7 @@ function parseSubmissionForm(html, deps) {
28006
28004
  maxBytes: integer2(options.maxbytes),
28007
28005
  areaMaxBytes: integer2(options.areamaxbytes),
28008
28006
  maxFiles: integer2(options.maxfiles),
28009
- acceptedTypes: acceptedTypes.length === 1 && acceptedTypes[0] === "*" ? "*" : acceptedTypes,
28007
+ acceptedTypes: acceptedTypesOf(options.accepted_types),
28010
28008
  ...statementOf(form)
28011
28009
  };
28012
28010
  }
@@ -28104,6 +28102,11 @@ function filemanagerOptions(html, itemid) {
28104
28102
  }
28105
28103
  return null;
28106
28104
  }
28105
+ function acceptedTypesOf(value) {
28106
+ const list2 = Array.isArray(value) ? value : isRecord5(value) ? Object.values(value) : value === void 0 ? [] : [value];
28107
+ const types = list2.map((type) => String(type).trim()).filter(Boolean);
28108
+ return types.length === 0 || types.includes("*") ? "*" : types;
28109
+ }
28107
28110
  function balancedObject(text, start) {
28108
28111
  if (text[start] !== "{") return null;
28109
28112
  let depth = 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "moodle-cli",
3
- "version": "0.9.3",
3
+ "version": "0.9.4",
4
4
  "description": "Moodle for terminals and AI agents: deadlines, grades, files, feedback and quiz reviews from your browser session, plus a private MCP server on Cloudflare",
5
5
  "license": "MIT",
6
6
  "type": "module",