UNPKG

@composio/core

Version:

![Composio Banner](https://github.com/user-attachments/assets/9ba0e9c1-85a4-4b51-ae60-f9fe7992e819)

29 lines (27 loc) 1.07 kB
//#region src/models/Files.workerd.ts const UNSUPPORTED_MESSAGE = "File operations (upload/download) are not supported in Cloudflare Workers or Edge runtimes. These operations require Node.js-specific APIs (e.g., `node:crypto`, `node:fs`) that are not available in this environment. Please use a Node.js runtime for file operations."; /** * Creates a Proxy that throws a user-friendly error when any method is accessed. * This ensures that users get a clear error message when attempting to use * file operations in unsupported environments. */ const createUnsupportedFilesProxy = () => { return new Proxy({}, { get(_target, prop) { if (prop === Symbol.toStringTag) return "Files"; if (prop === "constructor") return Files; return () => { throw new Error(UNSUPPORTED_MESSAGE); }; } }); }; /** * Files class for Cloudflare Workers / Edge runtimes. * All methods throw an error indicating that file operations are not supported. */ var Files = class { constructor(_client) { return createUnsupportedFilesProxy(); } }; //#endregion exports.Files = Files;