{"_id":"@crwilhit/kedge-actions-node","name":"@crwilhit/kedge-actions-node","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@crwilhit/kedge-actions-node","version":"0.1.0","description":"Server-side App Studio integration gateway client for generated apps","license":"Apache-2.0","type":"module","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","default":"./index.mjs"}},"main":"./index.mjs","types":"./index.d.ts","sideEffects":false,"scripts":{"test":"node test.mjs"},"engines":{"node":">=20"},"_id":"@crwilhit/kedge-actions-node@0.1.0","_nodeVersion":"22.22.1","_npmVersion":"9.2.0","dist":{"integrity":"sha512-Yf1CsaMaoni27j5GYtIpWhfgvEaKYxkrxkLW9AZCrgDuEngu5L73kNDK/hyi4EviD4B7aVZyhWMYZlFqvfT05w==","shasum":"932a54c489fc4bb7c63e880954b3ece3c7a6d070","tarball":"https://registry.npmjs.org/@crwilhit/kedge-actions-node/-/kedge-actions-node-0.1.0.tgz","fileCount":4,"unpackedSize":24598,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE88ESboZLH49AbNj3xmoR7+9iM7uAim9Png83bwUa2UAiEAgfMwi/gTs16zKAudCXJV05IdMLRM/kQfrGYqKR3Kt68="}]},"_npmUser":{"name":"crwilhit","email":"zinnias-due-7v@icloud.com"},"directories":{},"maintainers":[{"name":"crwilhit","email":"zinnias-due-7v@icloud.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/kedge-actions-node_0.1.0_1786056671076_0.7465039464956214"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-06T22:51:10.908Z","0.1.0":"2026-08-06T22:51:11.204Z","modified":"2026-08-06T22:51:11.463Z"},"maintainers":[{"name":"crwilhit","email":"zinnias-due-7v@icloud.com"}],"description":"Server-side App Studio integration gateway client for generated apps","license":"Apache-2.0","readme":"# `@kedge/actions-node`\n\n`@kedge/actions-node` is a server-only SDK for generated App Studio\napplications. It invokes a project integration through App Studio's\nauthenticated gateway; the gateway selects the provider and bound resource:\n\n```js\nimport { createActionsClient } from '@kedge/actions-node';\n\nconst kedge = createActionsClient({\n  baseURL: process.env.KEDGE_ACTIONS_BASE_URL,\n  project: process.env.KEDGE_PROJECT,\n  // The coordinator atomically refreshes this file; the SDK reads it for\n  // every request so an in-flight workload never needs the bootstrap token.\n  tokenFile: process.env.KEDGE_ACTIONS_TOKEN_FILE,\n});\n\nconst rows = await kedge.integration('sales').invoke('query_table/v1', {\n  columns: ['order_id', 'total'],\n  limit: 25,\n});\n```\n\nThe credential is sent only by the server-side process. Do not import this\nmodule into browser code, expose its token through client-side configuration,\nor pass provider URLs, credentials, resource references, or other topology in\naction input. The SDK throws when `window` or `document` is present as a\ndefense against accidental browser bundling.\n\n## Development sandbox delivery\n\nApp Studio development sandboxes receive the canonical package through the\nplatform-owned `kedge-dev-agent` image. At startup, its installer validates the\npackage metadata (`package.json`) and required `index.mjs`/`index.d.ts` files,\nthen atomically installs them into a shared `emptyDir`. The app and executor\ncontainers mount that same volume read-only at `/node_modules`, so generated\ncode uses the standard bare import\n`import { createActionsClient } from '@kedge/actions-node';` without `npm install`\nand without mutating the project PVC or its `node_modules`.\n\nThis is development-sandbox injection only. Production workloads still require\nthe normal pinned package install/publication path; this mechanism does not\nclaim that production publication or installation is complete. The image-build\nand Docker shared-volume Node import checks pass. In the local POC, Ready pod\n`data-dashboard` passed the executor bare-import check (function), the app\nSDK/environment/token preflight, and a `taxi-trips` `query_table/v1` call that\nreturned `rowCount=1`, `columnCount=6`, and `truncated=false` without printing\nrow data. This is local POC evidence only, not a production claim.\n\nUse an atomically refreshed token file (the default when\n`KEDGE_ACTIONS_TOKEN_FILE` is set), a static workload token, or a refreshable credential provider. A provider is\ncalled with `{ forceRefresh, signal }` and is called again with\n`forceRefresh: true` after a single HTTP 401:\n\n```js\nconst kedge = createActionsClient({\n  baseURL: process.env.KEDGE_APP_STUDIO_URL,\n  project: process.env.KEDGE_PROJECT,\n  getToken: ({ forceRefresh }) => tokenStore.get({ forceRefresh }),\n});\n```\n\nWhen `tokenFile` is omitted, the SDK reads `KEDGE_ACTIONS_TOKEN_FILE` on every\nrequest. This is the shared, read-only application token published by the\ndevelopment coordinator. Never point it at the coordinator-only projected\nbootstrap token path.\n\n`baseURL`, `project`, `org`, and `workspace` default to\n`KEDGE_ACTIONS_BASE_URL`, `KEDGE_PROJECT`, `KEDGE_ACTIONS_ORG`, and\n`KEDGE_ACTIONS_WORKSPACE`. The latter two are sent as `X-Kedge-Org` and\n`X-Kedge-Workspace` headers. The base URL must be absolute HTTPS; tests may\nexplicitly set `allowInsecureLoopback: true` for an HTTP loopback URL.\n\nEvery request can carry retry and tracing metadata. `timeoutMs` aborts the\nrequest locally; `signal` can be used by the enclosing server request:\n\n```js\nconst value = await kedge.integration('sales').invoke('lookup/v1', { key: 'order-1' }, {\n  signal: request.signal,\n  timeoutMs: 10_000,\n  idempotencyKey: 'job-42-attempt-1',\n  requestID: 'request-42',\n  actionDeadlineMs: 15_000,\n});\n```\n\nThe successful return value is `result`. `invokeEnvelope` returns the complete\nstable envelope (`requestID`, provider, action/version, bound `resourceRef`,\nand `result`). A provider failure throws `ProviderActionError` with stable\n`code`, `message`, `retryable`, request and binding metadata. Transport and\nconfiguration failures throw `ActionsClientError` with a machine-readable\n`code` such as `timeout`, `aborted`, `network_error`, or `invalid_response`.\n","readmeFilename":"README.md","_rev":"1-c6d46d4247032d84b3c851f04b92d7b6"}