@crowdin/app-project-module 0.98.0-cf-9 → 0.98.0-cf-11

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.
@@ -47,9 +47,18 @@ function handle(config) {
47
47
  let status = 'ok';
48
48
  let message = 'Filesystem access successful';
49
49
  try {
50
- const testFile = path_1.default.join(os_1.default.tmpdir(), 'status-check.txt');
51
- yield promises_1.default.writeFile(testFile, 'test');
52
- yield promises_1.default.unlink(testFile);
50
+ if (config.fileStore) {
51
+ // Use custom fileStore if provided
52
+ const testContent = Buffer.from('test');
53
+ const fileRef = yield config.fileStore.storeFile(testContent);
54
+ yield config.fileStore.deleteFile(fileRef);
55
+ }
56
+ else {
57
+ // Fallback to default filesystem operations
58
+ const testFile = path_1.default.join(os_1.default.tmpdir(), 'status-check.txt');
59
+ yield promises_1.default.writeFile(testFile, 'test');
60
+ yield promises_1.default.unlink(testFile);
61
+ }
53
62
  }
54
63
  catch (e) {
55
64
  status = 'error';
package/out/types.d.ts CHANGED
@@ -527,5 +527,6 @@ export interface ContextModule extends ContextContent, UiModule, Environments {
527
527
  export interface FileStore {
528
528
  getFile: (fileRef: string) => Promise<Buffer>;
529
529
  storeFile: (content: Buffer) => Promise<string>;
530
+ deleteFile: (fileRef: string) => Promise<void>;
530
531
  }
531
532
  export {};
@@ -58,22 +58,10 @@ const AboutPage = ({ name, logo, manifest, storeLink }) => (react_1.default.crea
58
58
  react_1.default.createElement("div", { className: "mb-3" },
59
59
  react_1.default.createElement("label", { htmlFor: "manifest-url", className: "form-label" }, "Paste the following manifest URL when prompted during manual installation:"),
60
60
  react_1.default.createElement("div", { className: "input-group" },
61
- react_1.default.createElement("input", { type: "text", className: "form-control", id: "manifest-url", value: manifest, readOnly: true }),
62
- react_1.default.createElement("button", { className: "btn btn-outline-secondary", type: "button", id: "copy-button" }, "Copy"))),
61
+ react_1.default.createElement("input", { type: "text", className: "form-control", id: "manifest-url", value: manifest, readOnly: true }))),
63
62
  storeLink && (react_1.default.createElement("div", null,
64
63
  "Read more about",
65
64
  ' ',
66
65
  react_1.default.createElement("a", { href: storeLink, target: "_blank", title: `${name} on Crowdin Store` }, name),
67
- ".")))))),
68
- react_1.default.createElement("script", { dangerouslySetInnerHTML: {
69
- __html: `
70
- document.getElementById('copy-button').addEventListener('click', async () => {
71
- const text = document.getElementById('manifest-url').value;
72
- await navigator.clipboard.writeText(text);
73
- const btn = document.getElementById('copy-button');
74
- btn.textContent = 'Copied!';
75
- setTimeout(() => btn.textContent = 'Copy', 1500);
76
- });
77
- `,
78
- } }))));
66
+ ".")))))))));
79
67
  exports.AboutPage = AboutPage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crowdin/app-project-module",
3
- "version": "0.98.0-cf-9",
3
+ "version": "0.98.0-cf-11",
4
4
  "description": "Module that generates for you all common endpoints for serving standalone Crowdin App",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "devDependencies": {
47
47
  "@babel/preset-react": "^7.26.3",
48
- "@cloudflare/workers-types": "^4.20251011.0",
48
+ "@cloudflare/workers-types": "^4.20251117.0",
49
49
  "@emotion/react": "^11.14.0",
50
50
  "@emotion/styled": "^11.14.0",
51
51
  "@monaco-editor/react": "^4.7.0",