@walkeros/server-transformer-file 2.2.0-next-1772811722420
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/README.md +85 -0
- package/dist/index.d.mts +21 -0
- package/dist/index.d.ts +21 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +1 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +61 -0
package/README.md
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# @walkeros/server-transformer-file
|
|
2
|
+
|
|
3
|
+
File serving transformer for walkerOS server flows. Serves static files through
|
|
4
|
+
any Store backend, making it I/O-agnostic. Works with FsStore for disk,
|
|
5
|
+
MemoryStore for pre-loaded assets, or any custom Store implementation.
|
|
6
|
+
|
|
7
|
+
## How it works
|
|
8
|
+
|
|
9
|
+
1. Extracts `ingest.path` from the request
|
|
10
|
+
2. Strips optional URL prefix (e.g., `/static`)
|
|
11
|
+
3. Calls `store.get(filePath)` to fetch content
|
|
12
|
+
4. Responds with content, correct Content-Type, and Content-Length
|
|
13
|
+
5. Returns `false` to stop the transformer chain
|
|
14
|
+
|
|
15
|
+
If the file is not found or no store is provided, the event passes through
|
|
16
|
+
unchanged.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @walkeros/server-transformer-file
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Configuration
|
|
25
|
+
|
|
26
|
+
### Settings
|
|
27
|
+
|
|
28
|
+
| Option | Type | Default | Description |
|
|
29
|
+
| ----------- | ------------------------ | ------- | ----------------------------------- |
|
|
30
|
+
| `prefix` | `string` | — | URL prefix to strip before lookup |
|
|
31
|
+
| `headers` | `Record<string, string>` | — | Default headers for all responses |
|
|
32
|
+
| `mimeTypes` | `Record<string, string>` | — | Extension overrides (`.ext` → type) |
|
|
33
|
+
|
|
34
|
+
### Env
|
|
35
|
+
|
|
36
|
+
| Option | Type | Description |
|
|
37
|
+
| ------- | ----------- | --------------------------------------------------- |
|
|
38
|
+
| `store` | `FileStore` | Store providing file content (required for serving) |
|
|
39
|
+
|
|
40
|
+
### Example with FsStore
|
|
41
|
+
|
|
42
|
+
```typescript
|
|
43
|
+
import { startFlow } from '@walkeros/collector';
|
|
44
|
+
import { transformerFile } from '@walkeros/server-transformer-file';
|
|
45
|
+
import { storeFsInit } from '@walkeros/server-store-fs';
|
|
46
|
+
|
|
47
|
+
const fileStore = storeFsInit({
|
|
48
|
+
collector,
|
|
49
|
+
logger,
|
|
50
|
+
config: { settings: { basePath: './public' } },
|
|
51
|
+
env: {},
|
|
52
|
+
id: 'fs',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
await startFlow({
|
|
56
|
+
transformers: {
|
|
57
|
+
file: {
|
|
58
|
+
code: transformerFile,
|
|
59
|
+
config: {
|
|
60
|
+
settings: {
|
|
61
|
+
prefix: '/static',
|
|
62
|
+
headers: { 'Cache-Control': 'public, max-age=3600' },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
env: { store: fileStore },
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Built-in MIME types
|
|
72
|
+
|
|
73
|
+
`.js`, `.mjs`, `.css`, `.html`, `.json`, `.wasm`, `.map`, `.txt`, `.xml`,
|
|
74
|
+
`.svg`, `.png`, `.jpg`, `.gif`, `.ico`, `.webp`, `.woff`, `.woff2`
|
|
75
|
+
|
|
76
|
+
Unknown extensions default to `application/octet-stream`. Override with the
|
|
77
|
+
`mimeTypes` setting.
|
|
78
|
+
|
|
79
|
+
## Behavior notes
|
|
80
|
+
|
|
81
|
+
- **I/O-agnostic** — delegates all storage to the injected Store
|
|
82
|
+
- **No store = passthrough** — warns and lets the event continue
|
|
83
|
+
- **No path = passthrough** — skips when `ingest.path` is missing
|
|
84
|
+
- **Prefix mismatch = passthrough** — only serves paths matching the prefix
|
|
85
|
+
- **Stops chain on serve** — returns `false` after responding
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Transformer, Store } from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
interface FileSettings {
|
|
4
|
+
/** URL prefix to strip (e.g., "/static" → /static/walker.js looks up "walker.js") */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** Default response headers (Cache-Control, etc.) */
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
/** Extension → Content-Type overrides (keys include dot: { '.wasm': 'application/wasm' }) */
|
|
9
|
+
mimeTypes?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
interface FileEnv extends Transformer.BaseEnv {
|
|
12
|
+
/** Store providing file content. If not provided, transformer warns and passthroughs. */
|
|
13
|
+
store?: Store.Instance;
|
|
14
|
+
}
|
|
15
|
+
type Types = Transformer.Types<FileSettings, FileEnv, Partial<FileSettings>>;
|
|
16
|
+
|
|
17
|
+
declare const transformerFile: Transformer.Init<Types>;
|
|
18
|
+
|
|
19
|
+
declare function getMimeType(filePath: string, overrides?: Record<string, string>): string;
|
|
20
|
+
|
|
21
|
+
export { type FileEnv, type FileSettings, type Types, transformerFile as default, getMimeType, transformerFile };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Transformer, Store } from '@walkeros/core';
|
|
2
|
+
|
|
3
|
+
interface FileSettings {
|
|
4
|
+
/** URL prefix to strip (e.g., "/static" → /static/walker.js looks up "walker.js") */
|
|
5
|
+
prefix?: string;
|
|
6
|
+
/** Default response headers (Cache-Control, etc.) */
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
/** Extension → Content-Type overrides (keys include dot: { '.wasm': 'application/wasm' }) */
|
|
9
|
+
mimeTypes?: Record<string, string>;
|
|
10
|
+
}
|
|
11
|
+
interface FileEnv extends Transformer.BaseEnv {
|
|
12
|
+
/** Store providing file content. If not provided, transformer warns and passthroughs. */
|
|
13
|
+
store?: Store.Instance;
|
|
14
|
+
}
|
|
15
|
+
type Types = Transformer.Types<FileSettings, FileEnv, Partial<FileSettings>>;
|
|
16
|
+
|
|
17
|
+
declare const transformerFile: Transformer.Init<Types>;
|
|
18
|
+
|
|
19
|
+
declare function getMimeType(filePath: string, overrides?: Record<string, string>): string;
|
|
20
|
+
|
|
21
|
+
export { type FileEnv, type FileSettings, type Types, transformerFile as default, getMimeType, transformerFile };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,r=Object.prototype.hasOwnProperty,o={};((e,n)=>{for(var i in n)t(e,i,{get:n[i],enumerable:!0})})(o,{default:()=>p,getMimeType:()=>s,transformerFile:()=>p}),module.exports=(e=o,((e,o,a,s)=>{if(o&&"object"==typeof o||"function"==typeof o)for(let p of i(o))r.call(e,p)||p===a||t(e,p,{get:()=>o[p],enumerable:!(s=n(o,p))||s.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".html":"text/html",".htm":"text/html",".json":"application/json",".wasm":"application/wasm",".map":"application/json",".txt":"text/plain",".xml":"application/xml",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".ico":"image/x-icon",".webp":"image/webp",".woff":"font/woff",".woff2":"font/woff2"};function s(e,t){const n=e.lastIndexOf(".");if(-1===n)return"application/octet-stream";const i=e.slice(n).toLowerCase();return(null==t?void 0:t[i])||a[i]||"application/octet-stream"}var p=e=>{const{config:t}=e,n=t.settings||{},i=n.prefix,r=n.headers,o=n.mimeTypes,a=e.env.store;return{type:"file",config:t,async push(e,t){const{logger:n}=t,p=t.ingest||{},f=t.env.respond,l=p.path;if(!l)return;if(!a)return void n.warn("No store provided to file transformer");let c=l;if(i){if(!c.startsWith(i))return;c=c.slice(i.length)}if(c.startsWith("/")&&(c=c.slice(1)),!c)return;const g=await a.get(c);if(null==g)return;const m=s(c,o),u=g instanceof Buffer?g.length:"string"==typeof g?Buffer.byteLength(g):void 0,j={"Content-Type":m,...r};return void 0!==u&&(j["Content-Length"]=String(u)),null==f||f({body:g,status:200,headers:j}),!1}}};//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/mime.ts","../src/transformer.ts"],"sourcesContent":["export { transformerFile } from './transformer';\nexport { getMimeType } from './mime';\nexport type { FileSettings, FileEnv, Types } from './types';\nexport { transformerFile as default } from './transformer';\n","const DEFAULT_MIME_TYPES: Record<string, string> = {\n '.js': 'application/javascript',\n '.mjs': 'application/javascript',\n '.css': 'text/css',\n '.html': 'text/html',\n '.htm': 'text/html',\n '.json': 'application/json',\n '.wasm': 'application/wasm',\n '.map': 'application/json',\n '.txt': 'text/plain',\n '.xml': 'application/xml',\n '.svg': 'image/svg+xml',\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.ico': 'image/x-icon',\n '.webp': 'image/webp',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n};\n\nexport function getMimeType(\n filePath: string,\n overrides?: Record<string, string>,\n): string {\n const lastDot = filePath.lastIndexOf('.');\n if (lastDot === -1) return 'application/octet-stream';\n const ext = filePath.slice(lastDot).toLowerCase();\n return (\n overrides?.[ext] || DEFAULT_MIME_TYPES[ext] || 'application/octet-stream'\n );\n}\n","import type { Transformer } from '@walkeros/core';\nimport type { RespondFn } from '@walkeros/core';\nimport { getMimeType } from './mime';\nimport type { FileSettings, FileEnv, Types } from './types';\n\nexport const transformerFile: Transformer.Init<Types> = (context) => {\n const { config } = context;\n const settings = (config.settings || {}) as Partial<FileSettings>;\n const prefix = settings.prefix;\n const defaultHeaders = settings.headers;\n const mimeOverrides = settings.mimeTypes;\n\n const store = (context.env as FileEnv).store;\n\n return {\n type: 'file',\n config: config as Transformer.Config<Types>,\n\n async push(event, context) {\n const { logger } = context;\n const ingest = (context.ingest || {}) as Record<string, unknown>;\n const envRespond = context.env.respond as RespondFn | undefined;\n\n const rawPath = ingest.path as string | undefined;\n if (!rawPath) return;\n\n if (!store) {\n logger.warn('No store provided to file transformer');\n return;\n }\n\n // Apply prefix stripping\n let filePath = rawPath;\n if (prefix) {\n if (!filePath.startsWith(prefix)) return; // Not our path\n filePath = filePath.slice(prefix.length);\n }\n\n // Strip leading slash for store key\n if (filePath.startsWith('/')) filePath = filePath.slice(1);\n if (!filePath) return;\n\n // Fetch from store\n const content = await store.get(filePath);\n if (content == null) return;\n\n // Derive Content-Type\n const contentType = getMimeType(filePath, mimeOverrides);\n const contentLength =\n content instanceof Buffer\n ? content.length\n : typeof content === 'string'\n ? Buffer.byteLength(content)\n : undefined;\n\n const headers: Record<string, string> = {\n 'Content-Type': contentType,\n ...defaultHeaders,\n };\n if (contentLength !== undefined) {\n headers['Content-Length'] = String(contentLength);\n }\n\n envRespond?.({\n body: content,\n status: 200,\n headers,\n });\n\n return false;\n },\n };\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,IAAM,qBAA6C;AAAA,EACjD,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,UAAU;AACZ;AAEO,SAAS,YACd,UACA,WACQ;AACR,QAAM,UAAU,SAAS,YAAY,GAAG;AACxC,MAAI,YAAY,GAAI,QAAO;AAC3B,QAAM,MAAM,SAAS,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,EACF;AACF;","names":["context"]}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var t={".js":"application/javascript",".mjs":"application/javascript",".css":"text/css",".html":"text/html",".htm":"text/html",".json":"application/json",".wasm":"application/wasm",".map":"application/json",".txt":"text/plain",".xml":"application/xml",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".ico":"image/x-icon",".webp":"image/webp",".woff":"font/woff",".woff2":"font/woff2"};function e(e,i){const n=e.lastIndexOf(".");if(-1===n)return"application/octet-stream";const a=e.slice(n).toLowerCase();return(null==i?void 0:i[a])||t[a]||"application/octet-stream"}var i=t=>{const{config:i}=t,n=i.settings||{},a=n.prefix,o=n.headers,s=n.mimeTypes,r=t.env.store;return{type:"file",config:i,async push(t,i){const{logger:n}=i,p=i.ingest||{},f=i.env.respond,l=p.path;if(!l)return;if(!r)return void n.warn("No store provided to file transformer");let c=l;if(a){if(!c.startsWith(a))return;c=c.slice(a.length)}if(c.startsWith("/")&&(c=c.slice(1)),!c)return;const g=await r.get(c);if(null==g)return;const m=e(c,s),u=g instanceof Buffer?g.length:"string"==typeof g?Buffer.byteLength(g):void 0,h={"Content-Type":m,...o};return void 0!==u&&(h["Content-Length"]=String(u)),null==f||f({body:g,status:200,headers:h}),!1}}};export{i as default,e as getMimeType,i as transformerFile};//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/mime.ts","../src/transformer.ts"],"sourcesContent":["const DEFAULT_MIME_TYPES: Record<string, string> = {\n '.js': 'application/javascript',\n '.mjs': 'application/javascript',\n '.css': 'text/css',\n '.html': 'text/html',\n '.htm': 'text/html',\n '.json': 'application/json',\n '.wasm': 'application/wasm',\n '.map': 'application/json',\n '.txt': 'text/plain',\n '.xml': 'application/xml',\n '.svg': 'image/svg+xml',\n '.png': 'image/png',\n '.jpg': 'image/jpeg',\n '.jpeg': 'image/jpeg',\n '.gif': 'image/gif',\n '.ico': 'image/x-icon',\n '.webp': 'image/webp',\n '.woff': 'font/woff',\n '.woff2': 'font/woff2',\n};\n\nexport function getMimeType(\n filePath: string,\n overrides?: Record<string, string>,\n): string {\n const lastDot = filePath.lastIndexOf('.');\n if (lastDot === -1) return 'application/octet-stream';\n const ext = filePath.slice(lastDot).toLowerCase();\n return (\n overrides?.[ext] || DEFAULT_MIME_TYPES[ext] || 'application/octet-stream'\n );\n}\n","import type { Transformer } from '@walkeros/core';\nimport type { RespondFn } from '@walkeros/core';\nimport { getMimeType } from './mime';\nimport type { FileSettings, FileEnv, Types } from './types';\n\nexport const transformerFile: Transformer.Init<Types> = (context) => {\n const { config } = context;\n const settings = (config.settings || {}) as Partial<FileSettings>;\n const prefix = settings.prefix;\n const defaultHeaders = settings.headers;\n const mimeOverrides = settings.mimeTypes;\n\n const store = (context.env as FileEnv).store;\n\n return {\n type: 'file',\n config: config as Transformer.Config<Types>,\n\n async push(event, context) {\n const { logger } = context;\n const ingest = (context.ingest || {}) as Record<string, unknown>;\n const envRespond = context.env.respond as RespondFn | undefined;\n\n const rawPath = ingest.path as string | undefined;\n if (!rawPath) return;\n\n if (!store) {\n logger.warn('No store provided to file transformer');\n return;\n }\n\n // Apply prefix stripping\n let filePath = rawPath;\n if (prefix) {\n if (!filePath.startsWith(prefix)) return; // Not our path\n filePath = filePath.slice(prefix.length);\n }\n\n // Strip leading slash for store key\n if (filePath.startsWith('/')) filePath = filePath.slice(1);\n if (!filePath) return;\n\n // Fetch from store\n const content = await store.get(filePath);\n if (content == null) return;\n\n // Derive Content-Type\n const contentType = getMimeType(filePath, mimeOverrides);\n const contentLength =\n content instanceof Buffer\n ? content.length\n : typeof content === 'string'\n ? Buffer.byteLength(content)\n : undefined;\n\n const headers: Record<string, string> = {\n 'Content-Type': contentType,\n ...defaultHeaders,\n };\n if (contentLength !== undefined) {\n headers['Content-Length'] = String(contentLength);\n }\n\n envRespond?.({\n body: content,\n status: 200,\n headers,\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AAI,SAAS,WAAW,GAAG,EAAG,YAAW,SAAS,MAAM,CAAC;AACzD,UAAI,CAAC,SAAU;AAGf,YAAM,UAAU,MAAM,MAAM,IAAI,QAAQ;AACxC,UAAI,WAAW,KAAM;AAGrB,YAAM,cAAc,YAAY,UAAU,aAAa;AACvD,YAAM,gBACJ,mBAAmB,SACf,QAAQ,SACR,OAAO,YAAY,WACjB,OAAO,WAAW,OAAO,IACzB;AAER,YAAM,UAAkC;AAAA,QACtC,gBAAgB;AAAA,QAChB,GAAG;AAAA,MACL;AACA,UAAI,kBAAkB,QAAW;AAC/B,gBAAQ,gBAAgB,IAAI,OAAO,aAAa;AAAA,MAClD;AAEA,+CAAa;AAAA,QACX,MAAM;AAAA,QACN,QAAQ;AAAA,QACR;AAAA,MACF;AAEA,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["context"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@walkeros/server-transformer-file",
|
|
3
|
+
"description": "File serving transformer for walkerOS - serves static files via pluggable Store backend",
|
|
4
|
+
"version": "2.2.0-next-1772811722420",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.mjs",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.mjs",
|
|
13
|
+
"require": "./dist/index.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist/**"
|
|
18
|
+
],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsup --silent",
|
|
21
|
+
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist",
|
|
22
|
+
"dev": "jest --watchAll --colors",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"lint": "eslint \"**/*.ts*\"",
|
|
25
|
+
"test": "jest",
|
|
26
|
+
"update": "npx npm-check-updates -u && npm update"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@walkeros/core": "2.2.0-next-1772811722420"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"@walkeros/core": "2.2.0-next-1772811722420",
|
|
33
|
+
"@walkeros/store-memory": "2.2.0-next-1772811722420"
|
|
34
|
+
},
|
|
35
|
+
"repository": {
|
|
36
|
+
"url": "git+https://github.com/elbwalker/walkerOS.git",
|
|
37
|
+
"directory": "packages/server/transformers/file"
|
|
38
|
+
},
|
|
39
|
+
"author": "elbwalker <hello@elbwalker.com>",
|
|
40
|
+
"homepage": "https://github.com/elbwalker/walkerOS#readme",
|
|
41
|
+
"bugs": {
|
|
42
|
+
"url": "https://github.com/elbwalker/walkerOS/issues"
|
|
43
|
+
},
|
|
44
|
+
"walkerOS": {
|
|
45
|
+
"type": "transformer",
|
|
46
|
+
"platform": "server"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"walkerOS",
|
|
50
|
+
"transformer",
|
|
51
|
+
"file",
|
|
52
|
+
"static",
|
|
53
|
+
"server"
|
|
54
|
+
],
|
|
55
|
+
"funding": [
|
|
56
|
+
{
|
|
57
|
+
"type": "GitHub Sponsors",
|
|
58
|
+
"url": "https://github.com/sponsors/elbwalker"
|
|
59
|
+
}
|
|
60
|
+
]
|
|
61
|
+
}
|