diff --git a/VERSION b/VERSION index a50236a..f9a3d49 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.2.12 +4.2.13 diff --git a/clients/c/src/un.c b/clients/c/src/un.c index 2b6edfb..58956cb 100644 --- a/clients/c/src/un.c +++ b/clients/c/src/un.c @@ -6013,7 +6013,7 @@ void print_usage(const char *prog) { * ============================================================================ */ const char *unsandbox_version(void) { - return "4.2.12"; + return "4.2.13"; } const char *unsandbox_detect_language(const char *filename) { diff --git a/clients/groovy/sync/src/un.groovy b/clients/groovy/sync/src/un.groovy index d8ec996..72c9780 100644 --- a/clients/groovy/sync/src/un.groovy +++ b/clients/groovy/sync/src/un.groovy @@ -72,7 +72,7 @@ * * * @author Permacomputer Project - * @version 4.2.12 + * @version 4.2.13 */ import javax.crypto.Mac diff --git a/clients/javascript/async/package.json b/clients/javascript/async/package.json index 599225c..70384a7 100644 --- a/clients/javascript/async/package.json +++ b/clients/javascript/async/package.json @@ -1,6 +1,6 @@ { "name": "un-async", - "version": "4.2.12", + "version": "4.2.13", "description": "Unsandbox async JavaScript SDK - Execute code in 50+ languages", "main": "src/un_async.js", "type": "module", diff --git a/clients/javascript/sync/package.json b/clients/javascript/sync/package.json new file mode 100644 index 0000000..bfe00fe --- /dev/null +++ b/clients/javascript/sync/package.json @@ -0,0 +1,13 @@ +{ + "name": "un-sync", + "version": "4.2.13", + "description": "unsandbox.com JavaScript SDK (Isomorphic - Node.js + Browser)", + "type": "module", + "main": "src/un.js", + "scripts": { + "test": "echo 'No tests configured yet'" + }, + "keywords": ["unsandbox", "code-execution", "sandbox", "api"], + "author": "unsandbox.com", + "license": "Unlicense" +} diff --git a/clients/javascript/sync/src/un.js b/clients/javascript/sync/src/un.js index 85f1976..3fdd4c1 100644 --- a/clients/javascript/sync/src/un.js +++ b/clients/javascript/sync/src/un.js @@ -2,9 +2,10 @@ * PUBLIC DOMAIN - NO LICENSE, NO WARRANTY * * unsandbox.com JavaScript SDK (Synchronous/Async) + * Isomorphic: Works in Node.js (CLI + SDK) and Browser environments * - * Library Usage: - * const { + * Library Usage (ES Modules): + * import { * // Code execution * executeCode, executeAsync, getJob, waitForJob, cancelJob, listJobs, * getLanguages, detectLanguage, @@ -26,18 +27,19 @@ * transferImage, spawnFromImage, cloneImage, * // Key validation * validateKeys, - * } = require('./un.js'); + * } from './un.js'; * * // Execute code asynchronously (returns Promise) * const result = await executeCode('python', 'print("hello")', publicKey, secretKey); * const jobId = await executeAsync('javascript', 'console.log("hello")', publicKey, secretKey); * const result = await waitForJob(jobId, publicKey, secretKey); * - * Authentication Priority (4-tier): + * Authentication Priority (5-tier): * 1. Function arguments (publicKey, secretKey) - * 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) - * 3. ~/.unsandbox/accounts.csv (if in Node.js) - * 4. ./accounts.csv (if in Node.js) + * 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) [Node.js] + * 3. localStorage (unsandboxPublicKey, unsandboxSecretKey) [Browser] + * 4. ~/.unsandbox/accounts.csv [Node.js] + * 5. ./accounts.csv [Node.js] * * Request Authentication (HMAC-SHA256): * Authorization: Bearer @@ -48,12 +50,32 @@ * - Cached in ~/.unsandbox/languages.json (Node.js only) * - TTL: 1 hour * - Updated on successful API calls + * + * Browser Usage: + * - Import as ES module: