@walkeros/server-store-s3 4.8.2 → 4.8.3-next-1793115089237
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/CHANGELOG.md +18 -0
- package/README.md +7 -6
- package/dist/dev.js +1 -1
- package/dist/dev.js.map +1 -1
- package/dist/dev.mjs +1 -1
- package/dist/dev.mjs.map +1 -1
- package/dist/walkerOS.json +9 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @walkeros/server-store-s3
|
|
2
2
|
|
|
3
|
+
## 4.8.3-next-1793115089237
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5313635: The GCS, Sheets and S3 store examples now reference their credentials
|
|
8
|
+
with `$secret.` instead of `$env.`. A missing secret stops the flow at startup
|
|
9
|
+
with `required secret "<NAME>" is not set`; a missing `$env` service account
|
|
10
|
+
makes the GCS and Sheets stores fall back to the metadata server credentials.
|
|
11
|
+
- Updated dependencies [34fd225]
|
|
12
|
+
- Updated dependencies [5313635]
|
|
13
|
+
- Updated dependencies [5313635]
|
|
14
|
+
- Updated dependencies [5313635]
|
|
15
|
+
- Updated dependencies [5313635]
|
|
16
|
+
- Updated dependencies [5313635]
|
|
17
|
+
- Updated dependencies [34fd225]
|
|
18
|
+
- Updated dependencies [5313635]
|
|
19
|
+
- @walkeros/core@4.8.3-next-1793115089237
|
|
20
|
+
|
|
3
21
|
## 4.8.2
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# @walkeros/server-store-s3
|
|
8
8
|
|
|
9
|
-
S3-compatible object storage store using s3mini (
|
|
10
|
-
|
|
11
|
-
MinIO, and any S3-compatible provider.
|
|
9
|
+
S3-compatible object storage store using s3mini (about 26 KB minified, no
|
|
10
|
+
dependencies). It works with AWS S3, Cloudflare R2, Scaleway, DigitalOcean
|
|
11
|
+
Spaces, Backblaze B2, MinIO, and any S3-compatible provider.
|
|
12
12
|
|
|
13
13
|
[Documentation](https://www.walkeros.io/docs/stores/server/s3) •
|
|
14
14
|
[NPM Package](https://www.npmjs.com/package/@walkeros/server-store-s3) •
|
|
@@ -31,12 +31,13 @@ npm install @walkeros/server-store-s3
|
|
|
31
31
|
"stores": {
|
|
32
32
|
"assets": {
|
|
33
33
|
"package": "@walkeros/server-store-s3",
|
|
34
|
+
"import": "storeS3Init",
|
|
34
35
|
"config": {
|
|
35
36
|
"settings": {
|
|
36
37
|
"bucket": "my-assets",
|
|
37
38
|
"endpoint": "https://s3.eu-west-1.amazonaws.com",
|
|
38
|
-
"accessKeyId": "
|
|
39
|
-
"secretAccessKey": "
|
|
39
|
+
"accessKeyId": "$secret.S3_ACCESS_KEY",
|
|
40
|
+
"secretAccessKey": "$secret.S3_SECRET_KEY"
|
|
40
41
|
}
|
|
41
42
|
}
|
|
42
43
|
}
|
|
@@ -48,7 +49,7 @@ npm install @walkeros/server-store-s3
|
|
|
48
49
|
|
|
49
50
|
## Documentation
|
|
50
51
|
|
|
51
|
-
Full configuration
|
|
52
|
+
Full configuration and examples live in the docs:
|
|
52
53
|
**https://www.walkeros.io/docs/stores/server/s3**
|
|
53
54
|
|
|
54
55
|
## Contribute
|
package/dist/dev.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,
|
|
1
|
+
"use strict";var e,t=Object.defineProperty,s=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,o=Object.prototype.hasOwnProperty,n=(e,s)=>{for(var r in s)t(e,r,{get:s[r],enumerable:!0})},i={};n(i,{examples:()=>h,hints:()=>A,schemas:()=>a}),module.exports=(e=i,((e,n,i,a)=>{if(n&&"object"==typeof n||"function"==typeof n)for(let c of r(n))o.call(e,c)||c===i||t(e,c,{get:()=>n[c],enumerable:!(a=s(n,c))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e));var a={};n(a,{SettingsSchema:()=>l,SetupSchema:()=>d,settings:()=>f,setup:()=>g});var c=require("@walkeros/core/dev"),u=require("@walkeros/core/dev"),l=u.z.object({bucket:u.z.string().min(1).describe("S3 bucket name"),endpoint:u.z.string().url().describe("S3-compatible endpoint URL (like https://s3.eu-west-1.amazonaws.com)"),accessKeyId:u.z.string().min(1).describe("S3 access key ID"),secretAccessKey:u.z.string().min(1).describe("S3 secret access key"),region:u.z.string().default("auto").describe("AWS region for SigV4 signing"),prefix:u.z.string().optional().describe("Key prefix prepended to all store keys for scoping")}).strict(),p=require("@walkeros/core/dev"),d=p.z.object({region:p.z.string().default("eu-central-1").describe('Region the bucket is created in. Defaults to settings.region when concrete (not "auto"), otherwise eu-central-1.')}).describe('Provisioning options for "walkeros setup store.<id>". Idempotent: only the bucket is created. Encryption, public-access block, versioning, lifecycle rules, and tags are not applied here (s3mini does not expose those operations); configure them once via the AWS Console or "aws s3api".'),f=(0,c.zodToSchema)(l),g=(0,c.zodToSchema)(d),h={};n(h,{awsAssets:()=>j,env:()=>w,r2Bucket:()=>R,step:()=>S,structuredKv:()=>K});var w={};function m(){const e=new Map;return async(t,s)=>{const{pathname:r}=new URL(function(e){return"string"==typeof e?e:e instanceof URL?e.toString():e.url}(t)),o=s?.method??"GET";if(r.replace(/\/+$/,"").split("/").length<=2)return new Response(null,{status:200});if("PUT"===o)return e.set(r,(n=s?.body,"string"==typeof n?(new TextEncoder).encode(n):n instanceof Uint8Array?new Uint8Array(n):new Uint8Array)),new Response(null,{status:200,headers:{etag:'"mock"'}});var n;if("DELETE"===o)return e.delete(r),new Response(null,{status:204});const i=e.get(r);return i?new Response(i,{status:200}):new Response(null,{status:404})}}n(w,{createS3Fetch:()=>m,push:()=>y,simulation:()=>b});var y={get fetch(){return m()}},b=["fetch"],S={};n(S,{failedRead:()=>E,prefixScoping:()=>v,readAwsS3:()=>k});var k={title:"Read from S3",description:"Read object from S3 and receive its raw bytes byte-exact",in:{operation:"get",key:"walker.js"},out:[["get","walker.js","Bytes<(function(){...})()>"]]},v={title:"Prefix scoping",description:'Key "walker.js" with prefix "public/" resolves to S3 path "public/walker.js"',in:{operation:"get",key:"walker.js",settings:{bucket:"my-assets",prefix:"public"}},out:[["get","public/walker.js","Bytes<...>"]]},E={public:!1,description:"The request fails (no connection, a refused or forbidden read): get throws a StepError instead of answering a miss, and the collector reports it.",in:{operation:"get",key:"walker.js"},respond:{error:"network"},outcome:{status:"failed",code:"transport"}},j={settings:{bucket:"my-assets",endpoint:"https://s3.eu-west-1.amazonaws.com",accessKeyId:"$secret.S3_ACCESS_KEY",secretAccessKey:"$secret.S3_SECRET_KEY",region:"eu-west-1",prefix:"public"},file:!0},K={settings:{bucket:"my-state",endpoint:"https://s3.eu-west-1.amazonaws.com",accessKeyId:"$secret.S3_ACCESS_KEY",secretAccessKey:"$secret.S3_SECRET_KEY",region:"eu-west-1"}},R={settings:{bucket:"my-bucket",endpoint:"https://ACCOUNT_ID.r2.cloudflarestorage.com",accessKeyId:"$secret.R2_ACCESS_KEY",secretAccessKey:"$secret.R2_SECRET_KEY"},file:!0},A={"file-mode":{text:"Default mode is structured: values are StoreValue data round-tripped through the shared core codec and stored with Content-Type application/json, good for session state, lookups, and cached responses. Set config.file: true to persist raw bytes byte-exact with the real mime derived from the key (set accepts Uint8Array or string), the mode for serving assets such as walker.js via the file transformer. One store instance is exactly one mode. Do not pair file: true with a cache; the cache wraps structured stores and flow_validate flags the combination."}};//# sourceMappingURL=dev.js.map
|
package/dist/dev.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/hints.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\nexport { hints } from './hints';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n bucket: z.string().min(1).describe('S3 bucket name'),\n endpoint: z\n .string()\n .url()\n .describe(\n 'S3-compatible endpoint URL (like https://s3.eu-west-1.amazonaws.com)',\n ),\n accessKeyId: z.string().min(1).describe('S3 access key ID'),\n secretAccessKey: z.string().min(1).describe('S3 secret access key'),\n region: z.string().default('auto').describe('AWS region for SigV4 signing'),\n prefix: z\n .string()\n .optional()\n .describe('Key prefix prepended to all store keys for scoping'),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSchema = z\n .object({\n region: z\n .string()\n .default('eu-central-1')\n .describe(\n 'Region the bucket is created in. Defaults to settings.region when concrete (not \"auto\"), otherwise eu-central-1.',\n ),\n })\n .describe(\n 'Provisioning options for \"walkeros setup store.<id>\". Idempotent: only the bucket is created. Encryption, public-access block, versioning, lifecycle rules, and tags are not applied here (s3mini does not expose those operations); configure them once via the AWS Console or \"aws s3api\".',\n );\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","import type { Store } from '@walkeros/core';\n\nexport * as env from './env';\n\n/** AWS S3 bucket for serving static files byte-exact (file mode) */\nexport const awsAssets: Store.Config = {\n settings: {\n bucket: 'my-assets',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$env.S3_ACCESS_KEY',\n secretAccessKey: '$env.S3_SECRET_KEY',\n region: 'eu-west-1',\n prefix: 'public',\n },\n file: true,\n};\n\n/** S3 as a structured key-value store (default mode, stored as JSON) */\nexport const structuredKv: Store.Config = {\n settings: {\n bucket: 'my-state',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$env.S3_ACCESS_KEY',\n secretAccessKey: '$env.S3_SECRET_KEY',\n region: 'eu-west-1',\n },\n};\n\n/** Cloudflare R2 bucket, no egress fees */\nexport const r2Bucket: Store.Config = {\n settings: {\n bucket: 'my-bucket',\n endpoint: 'https://ACCOUNT_ID.r2.cloudflarestorage.com',\n accessKeyId: '$env.R2_ACCESS_KEY',\n secretAccessKey: '$env.R2_SECRET_KEY',\n },\n file: true,\n};\n\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Mock env for the S3 store: an in-memory bucket behind `fetch`.\n *\n * The store's S3 client (s3mini) signs each request and sends it through the\n * injected `fetch`. This mock answers the bucket existence check at start\n * and object get, put and delete. Objects live in a `Map` keyed by the\n * request path, so a `get` after a `set` returns what was written. Any\n * bucket exists; no credentials are checked.\n */\n\nfunction requestUrl(input: Parameters<typeof fetch>[0]): string {\n if (typeof input === 'string') return input;\n if (input instanceof URL) return input.toString();\n return input.url;\n}\n\nfunction bodyBytes(body: RequestInit['body']): Uint8Array<ArrayBuffer> {\n if (typeof body === 'string') return new TextEncoder().encode(body);\n if (body instanceof Uint8Array) return new Uint8Array(body);\n return new Uint8Array();\n}\n\n/** Create a fresh in-memory S3 backend. */\nexport function createS3Fetch(): typeof fetch {\n const objects = new Map<string, Uint8Array<ArrayBuffer>>();\n\n return async (input, init) => {\n const { pathname } = new URL(requestUrl(input));\n const method = init?.method ?? 'GET';\n // Path style: /<bucket> for the bucket, /<bucket>/<key> for an object.\n const isBucket = pathname.replace(/\\/+$/, '').split('/').length <= 2;\n\n if (isBucket) return new Response(null, { status: 200 });\n\n if (method === 'PUT') {\n objects.set(pathname, bodyBytes(init?.body));\n return new Response(null, { status: 200, headers: { etag: '\"mock\"' } });\n }\n if (method === 'DELETE') {\n objects.delete(pathname);\n return new Response(null, { status: 204 });\n }\n\n const bytes = objects.get(pathname);\n if (!bytes) return new Response(null, { status: 404 });\n return new Response(bytes, { status: 200 });\n };\n}\n\n/** Each read of `fetch` is a fresh backend, so runs never share writes. */\nexport const push: Env = {\n get fetch() {\n return createS3Fetch();\n },\n};\n\n/** Every request goes through `fetch`; `args[0]` is the signed URL. */\nexport const simulation = ['fetch'];\n","import type { Flow } from '@walkeros/core';\n\n/** Read an object from an AWS S3 bucket (file mode, byte-exact). */\nexport const readAwsS3: Flow.StepExample = {\n title: 'Read from S3',\n description: 'Read object from S3 and receive its raw bytes byte-exact',\n in: { operation: 'get', key: 'walker.js' },\n out: [['get', 'walker.js', 'Bytes<(function(){...})()>']],\n};\n\n/** Key is scoped to the configured prefix subdirectory. */\nexport const prefixScoping: Flow.StepExample = {\n title: 'Prefix scoping',\n description:\n 'Key \"walker.js\" with prefix \"public/\" resolves to S3 path \"public/walker.js\"',\n in: {\n operation: 'get',\n key: 'walker.js',\n settings: { bucket: 'my-assets', prefix: 'public' },\n },\n out: [['get', 'public/walker.js', 'Bytes<...>']],\n};\n\n/** A read that fails is reported, never answered as a miss. */\nexport const failedRead: Flow.StepExample = {\n public: false,\n description:\n 'The request fails (no connection, a refused or forbidden read): get throws a StepError instead of answering a miss, and the collector reports it.',\n in: { operation: 'get', key: 'walker.js' },\n respond: { error: 'network' },\n outcome: { status: 'failed', code: 'transport' },\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'file-mode': {\n text: 'Default mode is structured: values are StoreValue data round-tripped through the shared core codec and stored with Content-Type application/json, good for session state, lookups, and cached responses. Set config.file: true to persist raw bytes byte-exact with the real mime derived from the key (set accepts Uint8Array or string), the mode for serving assets such as walker.js via the file transformer. One store instance is exactly one mode. Do not pair file: true with a cache; the cache wraps structured stores and flow_validate flags the combination.',\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ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AO,KAAK,YAAY;AAAA,EACzC,SAAS,EAAE,OAAO,UAAU;AAAA,EAC5B,SAAS,EAAE,QAAQ,UAAU,MAAM,YAAY;AACjD;;;AF1BO,IAAM,YAA0B;AAAA,EACrC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,MAAM;AACR;AAGO,IAAM,eAA6B;AAAA,EACxC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,EACV;AACF;AAGO,IAAM,WAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,EACnB;AAAA,EACA,MAAM;AACR;;;AGnCO,IAAM,QAAoB;AAAA,EAC/B,aAAa;AAAA,IACX,MAAM;AAAA,EACR;AACF;","names":["import_dev","import_dev"]}
|
|
1
|
+
{"version":3,"sources":["../src/dev.ts","../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/hints.ts"],"sourcesContent":["export * as schemas from './schemas';\nexport * as examples from './examples';\nexport { hints } from './hints';\n","import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n bucket: z.string().min(1).describe('S3 bucket name'),\n endpoint: z\n .string()\n .url()\n .describe(\n 'S3-compatible endpoint URL (like https://s3.eu-west-1.amazonaws.com)',\n ),\n accessKeyId: z.string().min(1).describe('S3 access key ID'),\n secretAccessKey: z.string().min(1).describe('S3 secret access key'),\n region: z.string().default('auto').describe('AWS region for SigV4 signing'),\n prefix: z\n .string()\n .optional()\n .describe('Key prefix prepended to all store keys for scoping'),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSchema = z\n .object({\n region: z\n .string()\n .default('eu-central-1')\n .describe(\n 'Region the bucket is created in. Defaults to settings.region when concrete (not \"auto\"), otherwise eu-central-1.',\n ),\n })\n .describe(\n 'Provisioning options for \"walkeros setup store.<id>\". Idempotent: only the bucket is created. Encryption, public-access block, versioning, lifecycle rules, and tags are not applied here (s3mini does not expose those operations); configure them once via the AWS Console or \"aws s3api\".',\n );\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","import type { Store } from '@walkeros/core';\n\nexport * as env from './env';\n\n/** AWS S3 bucket for serving static files byte-exact (file mode) */\nexport const awsAssets: Store.Config = {\n settings: {\n bucket: 'my-assets',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$secret.S3_ACCESS_KEY',\n secretAccessKey: '$secret.S3_SECRET_KEY',\n region: 'eu-west-1',\n prefix: 'public',\n },\n file: true,\n};\n\n/** S3 as a structured key-value store (default mode, stored as JSON) */\nexport const structuredKv: Store.Config = {\n settings: {\n bucket: 'my-state',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$secret.S3_ACCESS_KEY',\n secretAccessKey: '$secret.S3_SECRET_KEY',\n region: 'eu-west-1',\n },\n};\n\n/** Cloudflare R2 bucket, no egress fees */\nexport const r2Bucket: Store.Config = {\n settings: {\n bucket: 'my-bucket',\n endpoint: 'https://ACCOUNT_ID.r2.cloudflarestorage.com',\n accessKeyId: '$secret.R2_ACCESS_KEY',\n secretAccessKey: '$secret.R2_SECRET_KEY',\n },\n file: true,\n};\n\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Mock env for the S3 store: an in-memory bucket behind `fetch`.\n *\n * The store's S3 client (s3mini) signs each request and sends it through the\n * injected `fetch`. This mock answers the bucket existence check at start\n * and object get, put and delete. Objects live in a `Map` keyed by the\n * request path, so a `get` after a `set` returns what was written. Any\n * bucket exists; no credentials are checked.\n */\n\nfunction requestUrl(input: Parameters<typeof fetch>[0]): string {\n if (typeof input === 'string') return input;\n if (input instanceof URL) return input.toString();\n return input.url;\n}\n\nfunction bodyBytes(body: RequestInit['body']): Uint8Array<ArrayBuffer> {\n if (typeof body === 'string') return new TextEncoder().encode(body);\n if (body instanceof Uint8Array) return new Uint8Array(body);\n return new Uint8Array();\n}\n\n/** Create a fresh in-memory S3 backend. */\nexport function createS3Fetch(): typeof fetch {\n const objects = new Map<string, Uint8Array<ArrayBuffer>>();\n\n return async (input, init) => {\n const { pathname } = new URL(requestUrl(input));\n const method = init?.method ?? 'GET';\n // Path style: /<bucket> for the bucket, /<bucket>/<key> for an object.\n const isBucket = pathname.replace(/\\/+$/, '').split('/').length <= 2;\n\n if (isBucket) return new Response(null, { status: 200 });\n\n if (method === 'PUT') {\n objects.set(pathname, bodyBytes(init?.body));\n return new Response(null, { status: 200, headers: { etag: '\"mock\"' } });\n }\n if (method === 'DELETE') {\n objects.delete(pathname);\n return new Response(null, { status: 204 });\n }\n\n const bytes = objects.get(pathname);\n if (!bytes) return new Response(null, { status: 404 });\n return new Response(bytes, { status: 200 });\n };\n}\n\n/** Each read of `fetch` is a fresh backend, so runs never share writes. */\nexport const push: Env = {\n get fetch() {\n return createS3Fetch();\n },\n};\n\n/** Every request goes through `fetch`; `args[0]` is the signed URL. */\nexport const simulation = ['fetch'];\n","import type { Flow } from '@walkeros/core';\n\n/** Read an object from an AWS S3 bucket (file mode, byte-exact). */\nexport const readAwsS3: Flow.StepExample = {\n title: 'Read from S3',\n description: 'Read object from S3 and receive its raw bytes byte-exact',\n in: { operation: 'get', key: 'walker.js' },\n out: [['get', 'walker.js', 'Bytes<(function(){...})()>']],\n};\n\n/** Key is scoped to the configured prefix subdirectory. */\nexport const prefixScoping: Flow.StepExample = {\n title: 'Prefix scoping',\n description:\n 'Key \"walker.js\" with prefix \"public/\" resolves to S3 path \"public/walker.js\"',\n in: {\n operation: 'get',\n key: 'walker.js',\n settings: { bucket: 'my-assets', prefix: 'public' },\n },\n out: [['get', 'public/walker.js', 'Bytes<...>']],\n};\n\n/** A read that fails is reported, never answered as a miss. */\nexport const failedRead: Flow.StepExample = {\n public: false,\n description:\n 'The request fails (no connection, a refused or forbidden read): get throws a StepError instead of answering a miss, and the collector reports it.',\n in: { operation: 'get', key: 'walker.js' },\n respond: { error: 'network' },\n outcome: { status: 'failed', code: 'transport' },\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'file-mode': {\n text: 'Default mode is structured: values are StoreValue data round-tripped through the shared core codec and stored with Content-Type application/json, good for session state, lookups, and cached responses. Set config.file: true to persist raw bytes byte-exact with the real mime derived from the key (set accepts Uint8Array or string), the mode for serving assets such as walker.js via the file transformer. One store instance is exactly one mode. Do not pair file: true with a cache; the cache wraps structured stores and flow_validate flags the combination.',\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAAA,cAA4B;;;ACA5B,iBAAkB;AAEX,IAAM,iBAAiB,aAC3B,OAAO;AAAA,EACN,QAAQ,aAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,gBAAgB;AAAA,EACnD,UAAU,aACP,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF;AAAA,EACF,aAAa,aAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,kBAAkB;AAAA,EAC1D,iBAAiB,aAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,sBAAsB;AAAA,EAClE,QAAQ,aAAE,OAAO,EAAE,QAAQ,MAAM,EAAE,SAAS,8BAA8B;AAAA,EAC1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AQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,EACV;AACF;AAGO,IAAM,WAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,EACnB;AAAA,EACA,MAAM;AACR;;;AGnCO,IAAM,QAAoB;AAAA,EAC/B,aAAa;AAAA,IACX,MAAM;AAAA,EACR;AACF;","names":["import_dev","import_dev"]}
|
package/dist/dev.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as e}from"module";e(import.meta.url);var t=Object.defineProperty,s=(e,s)=>{for(var r in s)t(e,r,{get:s[r],enumerable:!0})},r={};s(r,{SettingsSchema:()=>i,SetupSchema:()=>c,settings:()=>p,setup:()=>u});import{zodToSchema as
|
|
1
|
+
import{createRequire as e}from"module";e(import.meta.url);var t=Object.defineProperty,s=(e,s)=>{for(var r in s)t(e,r,{get:s[r],enumerable:!0})},r={};s(r,{SettingsSchema:()=>i,SetupSchema:()=>c,settings:()=>p,setup:()=>u});import{zodToSchema as o}from"@walkeros/core/dev";import{z as n}from"@walkeros/core/dev";var i=n.object({bucket:n.string().min(1).describe("S3 bucket name"),endpoint:n.string().url().describe("S3-compatible endpoint URL (like https://s3.eu-west-1.amazonaws.com)"),accessKeyId:n.string().min(1).describe("S3 access key ID"),secretAccessKey:n.string().min(1).describe("S3 secret access key"),region:n.string().default("auto").describe("AWS region for SigV4 signing"),prefix:n.string().optional().describe("Key prefix prepended to all store keys for scoping")}).strict();import{z as a}from"@walkeros/core/dev";var c=a.object({region:a.string().default("eu-central-1").describe('Region the bucket is created in. Defaults to settings.region when concrete (not "auto"), otherwise eu-central-1.')}).describe('Provisioning options for "walkeros setup store.<id>". Idempotent: only the bucket is created. Encryption, public-access block, versioning, lifecycle rules, and tags are not applied here (s3mini does not expose those operations); configure them once via the AWS Console or "aws s3api".'),p=o(i),u=o(c),l={};s(l,{awsAssets:()=>k,env:()=>d,r2Bucket:()=>v,step:()=>w,structuredKv:()=>S});var d={};function f(){const e=new Map;return async(t,s)=>{const{pathname:r}=new URL(function(e){return"string"==typeof e?e:e instanceof URL?e.toString():e.url}(t)),o=s?.method??"GET";if(r.replace(/\/+$/,"").split("/").length<=2)return new Response(null,{status:200});if("PUT"===o)return e.set(r,(n=s?.body,"string"==typeof n?(new TextEncoder).encode(n):n instanceof Uint8Array?new Uint8Array(n):new Uint8Array)),new Response(null,{status:200,headers:{etag:'"mock"'}});var n;if("DELETE"===o)return e.delete(r),new Response(null,{status:204});const i=e.get(r);return i?new Response(i,{status:200}):new Response(null,{status:404})}}s(d,{createS3Fetch:()=>f,push:()=>g,simulation:()=>m});var g={get fetch(){return f()}},m=["fetch"],w={};s(w,{failedRead:()=>b,prefixScoping:()=>y,readAwsS3:()=>h});var h={title:"Read from S3",description:"Read object from S3 and receive its raw bytes byte-exact",in:{operation:"get",key:"walker.js"},out:[["get","walker.js","Bytes<(function(){...})()>"]]},y={title:"Prefix scoping",description:'Key "walker.js" with prefix "public/" resolves to S3 path "public/walker.js"',in:{operation:"get",key:"walker.js",settings:{bucket:"my-assets",prefix:"public"}},out:[["get","public/walker.js","Bytes<...>"]]},b={public:!1,description:"The request fails (no connection, a refused or forbidden read): get throws a StepError instead of answering a miss, and the collector reports it.",in:{operation:"get",key:"walker.js"},respond:{error:"network"},outcome:{status:"failed",code:"transport"}},k={settings:{bucket:"my-assets",endpoint:"https://s3.eu-west-1.amazonaws.com",accessKeyId:"$secret.S3_ACCESS_KEY",secretAccessKey:"$secret.S3_SECRET_KEY",region:"eu-west-1",prefix:"public"},file:!0},S={settings:{bucket:"my-state",endpoint:"https://s3.eu-west-1.amazonaws.com",accessKeyId:"$secret.S3_ACCESS_KEY",secretAccessKey:"$secret.S3_SECRET_KEY",region:"eu-west-1"}},v={settings:{bucket:"my-bucket",endpoint:"https://ACCOUNT_ID.r2.cloudflarestorage.com",accessKeyId:"$secret.R2_ACCESS_KEY",secretAccessKey:"$secret.R2_SECRET_KEY"},file:!0},E={"file-mode":{text:"Default mode is structured: values are StoreValue data round-tripped through the shared core codec and stored with Content-Type application/json, good for session state, lookups, and cached responses. Set config.file: true to persist raw bytes byte-exact with the real mime derived from the key (set accepts Uint8Array or string), the mode for serving assets such as walker.js via the file transformer. One store instance is exactly one mode. Do not pair file: true with a cache; the cache wraps structured stores and flow_validate flags the combination."}};export{l as examples,E as hints,r as schemas};//# sourceMappingURL=dev.mjs.map
|
package/dist/dev.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/hints.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n bucket: z.string().min(1).describe('S3 bucket name'),\n endpoint: z\n .string()\n .url()\n .describe(\n 'S3-compatible endpoint URL (like https://s3.eu-west-1.amazonaws.com)',\n ),\n accessKeyId: z.string().min(1).describe('S3 access key ID'),\n secretAccessKey: z.string().min(1).describe('S3 secret access key'),\n region: z.string().default('auto').describe('AWS region for SigV4 signing'),\n prefix: z\n .string()\n .optional()\n .describe('Key prefix prepended to all store keys for scoping'),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSchema = z\n .object({\n region: z\n .string()\n .default('eu-central-1')\n .describe(\n 'Region the bucket is created in. Defaults to settings.region when concrete (not \"auto\"), otherwise eu-central-1.',\n ),\n })\n .describe(\n 'Provisioning options for \"walkeros setup store.<id>\". Idempotent: only the bucket is created. Encryption, public-access block, versioning, lifecycle rules, and tags are not applied here (s3mini does not expose those operations); configure them once via the AWS Console or \"aws s3api\".',\n );\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","import type { Store } from '@walkeros/core';\n\nexport * as env from './env';\n\n/** AWS S3 bucket for serving static files byte-exact (file mode) */\nexport const awsAssets: Store.Config = {\n settings: {\n bucket: 'my-assets',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$env.S3_ACCESS_KEY',\n secretAccessKey: '$env.S3_SECRET_KEY',\n region: 'eu-west-1',\n prefix: 'public',\n },\n file: true,\n};\n\n/** S3 as a structured key-value store (default mode, stored as JSON) */\nexport const structuredKv: Store.Config = {\n settings: {\n bucket: 'my-state',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$env.S3_ACCESS_KEY',\n secretAccessKey: '$env.S3_SECRET_KEY',\n region: 'eu-west-1',\n },\n};\n\n/** Cloudflare R2 bucket, no egress fees */\nexport const r2Bucket: Store.Config = {\n settings: {\n bucket: 'my-bucket',\n endpoint: 'https://ACCOUNT_ID.r2.cloudflarestorage.com',\n accessKeyId: '$env.R2_ACCESS_KEY',\n secretAccessKey: '$env.R2_SECRET_KEY',\n },\n file: true,\n};\n\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Mock env for the S3 store: an in-memory bucket behind `fetch`.\n *\n * The store's S3 client (s3mini) signs each request and sends it through the\n * injected `fetch`. This mock answers the bucket existence check at start\n * and object get, put and delete. Objects live in a `Map` keyed by the\n * request path, so a `get` after a `set` returns what was written. Any\n * bucket exists; no credentials are checked.\n */\n\nfunction requestUrl(input: Parameters<typeof fetch>[0]): string {\n if (typeof input === 'string') return input;\n if (input instanceof URL) return input.toString();\n return input.url;\n}\n\nfunction bodyBytes(body: RequestInit['body']): Uint8Array<ArrayBuffer> {\n if (typeof body === 'string') return new TextEncoder().encode(body);\n if (body instanceof Uint8Array) return new Uint8Array(body);\n return new Uint8Array();\n}\n\n/** Create a fresh in-memory S3 backend. */\nexport function createS3Fetch(): typeof fetch {\n const objects = new Map<string, Uint8Array<ArrayBuffer>>();\n\n return async (input, init) => {\n const { pathname } = new URL(requestUrl(input));\n const method = init?.method ?? 'GET';\n // Path style: /<bucket> for the bucket, /<bucket>/<key> for an object.\n const isBucket = pathname.replace(/\\/+$/, '').split('/').length <= 2;\n\n if (isBucket) return new Response(null, { status: 200 });\n\n if (method === 'PUT') {\n objects.set(pathname, bodyBytes(init?.body));\n return new Response(null, { status: 200, headers: { etag: '\"mock\"' } });\n }\n if (method === 'DELETE') {\n objects.delete(pathname);\n return new Response(null, { status: 204 });\n }\n\n const bytes = objects.get(pathname);\n if (!bytes) return new Response(null, { status: 404 });\n return new Response(bytes, { status: 200 });\n };\n}\n\n/** Each read of `fetch` is a fresh backend, so runs never share writes. */\nexport const push: Env = {\n get fetch() {\n return createS3Fetch();\n },\n};\n\n/** Every request goes through `fetch`; `args[0]` is the signed URL. */\nexport const simulation = ['fetch'];\n","import type { Flow } from '@walkeros/core';\n\n/** Read an object from an AWS S3 bucket (file mode, byte-exact). */\nexport const readAwsS3: Flow.StepExample = {\n title: 'Read from S3',\n description: 'Read object from S3 and receive its raw bytes byte-exact',\n in: { operation: 'get', key: 'walker.js' },\n out: [['get', 'walker.js', 'Bytes<(function(){...})()>']],\n};\n\n/** Key is scoped to the configured prefix subdirectory. */\nexport const prefixScoping: Flow.StepExample = {\n title: 'Prefix scoping',\n description:\n 'Key \"walker.js\" with prefix \"public/\" resolves to S3 path \"public/walker.js\"',\n in: {\n operation: 'get',\n key: 'walker.js',\n settings: { bucket: 'my-assets', prefix: 'public' },\n },\n out: [['get', 'public/walker.js', 'Bytes<...>']],\n};\n\n/** A read that fails is reported, never answered as a miss. */\nexport const failedRead: Flow.StepExample = {\n public: false,\n description:\n 'The request fails (no connection, a refused or forbidden read): get throws a StepError instead of answering a miss, and the collector reports it.',\n in: { operation: 'get', key: 'walker.js' },\n respond: { error: 'network' },\n outcome: { status: 'failed', code: 'transport' },\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'file-mode': {\n text: 'Default mode is structured: values are StoreValue data round-tripped through the shared core codec and stored with Content-Type application/json, good for session state, lookups, and cached responses. Set config.file: true to persist raw bytes byte-exact with the real mime derived from the key (set accepts Uint8Array or string), the mode for serving assets such as walker.js via the file transformer. One store instance is exactly one mode. Do not pair file: true with a cache; the cache wraps structured stores and flow_validate flags the combination.',\n },\n};\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,EACN,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,gBAAgB;AAAA,EACnD,UAAU,EACP,OAAO,EACP,IAAI,EACJ;AAAA,IACC;AAAA,EACF;AAAA,EACF,aAAa,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,kBAAkB;AAAA,EAC1D,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,SAAS,sBAAsB;AAAA,EAClE,QAAQ,EAAE,OAAO,EAAE,QAAQ,MAAM,EAAE,SAAS,8BAA8B;AAAA,EAC1E,QAAQ,EACL,OAAO,EACP,SAAS,EACT,SAAS,oDAAoD;AAClE,CAAC,EACA,OAAO;;;ACnBV,SAAS,KAAAA,UAAS;AAEX,IAAM,cAAcA,GACxB,OAAO;AAAA,EACN,QAAQA,GACL,OAAO,EACP,QAAQ,cAAc,EACtB;AAAA,IACC;AAAA,EACF;AACJ,CAAC,EACA;AAAA,EACC;AACF;;;AFNK,IAAM,WAAW,YAAY,cAAc;AAC3C,IAAM,QAAQ,YAAY,WAAW;;;AGR5C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,SAAS,WAAW,OAA4C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,IAAM,YAA8B;AAAA,EACzC,OAAO;AAAA,EACP,aAAa;AAAA,EACb,IAAI,EAAE,WAAW,OAAO,KAAK,YAAY;AAAA,EACzC,KAAK,CAAC,CAAC,OAAO,aAAa,4BAA4B,CAAC;AAC1D;AAGO,IAAM,gBAAkC;AAAA,EAC7C,OAAO;AAAA,EACP,aACE;AAAA,EACF,IAAI;AAAA,IACF,WAAW;AAAA,IACX,KAAK;AAAA,IACL,UAAU,EAAE,QAAQ,aAAa,QAAQ,SAAS;AAAA,EACpD;AAAA,EACA,KAAK,CAAC,CAAC,OAAO,oBAAoB,YAAY,CAAC;AACjD;AAGO,IAAM,aAA+B;AAAA,EAC1C,QAAQ;AAAA,EACR,aACE;AAAA,EACF,IAAI,EAAE,WAAW,OAAO,KAAK,YAAY;AAAA,EACzC,SAAS,EAAE,OAAO,UAAU;AAAA,EAC5B,SAAS,EAAE,QAAQ,UAAU,MAAM,YAAY;AACjD;;;AF1BO,IAAM,YAA0B;AAAA,EACrC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,MAAM;AACR;AAGO,IAAM,eAA6B;AAAA,EACxC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,EACV;AACF;AAGO,IAAM,WAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,EACnB;AAAA,EACA,MAAM;AACR;;;AGnCO,IAAM,QAAoB;AAAA,EAC/B,aAAa;AAAA,IACX,MAAM;AAAA,EACR;AACF;","names":["z"]}
|
|
1
|
+
{"version":3,"sources":["../src/schemas/index.ts","../src/schemas/settings.ts","../src/schemas/setup.ts","../src/examples/index.ts","../src/examples/env.ts","../src/examples/step.ts","../src/hints.ts"],"sourcesContent":["import { zodToSchema } from '@walkeros/core/dev';\nimport { SettingsSchema } from './settings';\nimport { SetupSchema } from './setup';\n\nexport { SettingsSchema, type Settings } from './settings';\nexport { SetupSchema, type Setup } from './setup';\n\nexport const settings = zodToSchema(SettingsSchema);\nexport const setup = zodToSchema(SetupSchema);\n","import { z } from '@walkeros/core/dev';\n\nexport const SettingsSchema = z\n .object({\n bucket: z.string().min(1).describe('S3 bucket name'),\n endpoint: z\n .string()\n .url()\n .describe(\n 'S3-compatible endpoint URL (like https://s3.eu-west-1.amazonaws.com)',\n ),\n accessKeyId: z.string().min(1).describe('S3 access key ID'),\n secretAccessKey: z.string().min(1).describe('S3 secret access key'),\n region: z.string().default('auto').describe('AWS region for SigV4 signing'),\n prefix: z\n .string()\n .optional()\n .describe('Key prefix prepended to all store keys for scoping'),\n })\n .strict();\n\nexport type Settings = z.infer<typeof SettingsSchema>;\n","import { z } from '@walkeros/core/dev';\n\nexport const SetupSchema = z\n .object({\n region: z\n .string()\n .default('eu-central-1')\n .describe(\n 'Region the bucket is created in. Defaults to settings.region when concrete (not \"auto\"), otherwise eu-central-1.',\n ),\n })\n .describe(\n 'Provisioning options for \"walkeros setup store.<id>\". Idempotent: only the bucket is created. Encryption, public-access block, versioning, lifecycle rules, and tags are not applied here (s3mini does not expose those operations); configure them once via the AWS Console or \"aws s3api\".',\n );\n\nexport type Setup = z.infer<typeof SetupSchema>;\n","import type { Store } from '@walkeros/core';\n\nexport * as env from './env';\n\n/** AWS S3 bucket for serving static files byte-exact (file mode) */\nexport const awsAssets: Store.Config = {\n settings: {\n bucket: 'my-assets',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$secret.S3_ACCESS_KEY',\n secretAccessKey: '$secret.S3_SECRET_KEY',\n region: 'eu-west-1',\n prefix: 'public',\n },\n file: true,\n};\n\n/** S3 as a structured key-value store (default mode, stored as JSON) */\nexport const structuredKv: Store.Config = {\n settings: {\n bucket: 'my-state',\n endpoint: 'https://s3.eu-west-1.amazonaws.com',\n accessKeyId: '$secret.S3_ACCESS_KEY',\n secretAccessKey: '$secret.S3_SECRET_KEY',\n region: 'eu-west-1',\n },\n};\n\n/** Cloudflare R2 bucket, no egress fees */\nexport const r2Bucket: Store.Config = {\n settings: {\n bucket: 'my-bucket',\n endpoint: 'https://ACCOUNT_ID.r2.cloudflarestorage.com',\n accessKeyId: '$secret.R2_ACCESS_KEY',\n secretAccessKey: '$secret.R2_SECRET_KEY',\n },\n file: true,\n};\n\nexport * as step from './step';\n","import type { Env } from '../types';\n\n/**\n * Mock env for the S3 store: an in-memory bucket behind `fetch`.\n *\n * The store's S3 client (s3mini) signs each request and sends it through the\n * injected `fetch`. This mock answers the bucket existence check at start\n * and object get, put and delete. Objects live in a `Map` keyed by the\n * request path, so a `get` after a `set` returns what was written. Any\n * bucket exists; no credentials are checked.\n */\n\nfunction requestUrl(input: Parameters<typeof fetch>[0]): string {\n if (typeof input === 'string') return input;\n if (input instanceof URL) return input.toString();\n return input.url;\n}\n\nfunction bodyBytes(body: RequestInit['body']): Uint8Array<ArrayBuffer> {\n if (typeof body === 'string') return new TextEncoder().encode(body);\n if (body instanceof Uint8Array) return new Uint8Array(body);\n return new Uint8Array();\n}\n\n/** Create a fresh in-memory S3 backend. */\nexport function createS3Fetch(): typeof fetch {\n const objects = new Map<string, Uint8Array<ArrayBuffer>>();\n\n return async (input, init) => {\n const { pathname } = new URL(requestUrl(input));\n const method = init?.method ?? 'GET';\n // Path style: /<bucket> for the bucket, /<bucket>/<key> for an object.\n const isBucket = pathname.replace(/\\/+$/, '').split('/').length <= 2;\n\n if (isBucket) return new Response(null, { status: 200 });\n\n if (method === 'PUT') {\n objects.set(pathname, bodyBytes(init?.body));\n return new Response(null, { status: 200, headers: { etag: '\"mock\"' } });\n }\n if (method === 'DELETE') {\n objects.delete(pathname);\n return new Response(null, { status: 204 });\n }\n\n const bytes = objects.get(pathname);\n if (!bytes) return new Response(null, { status: 404 });\n return new Response(bytes, { status: 200 });\n };\n}\n\n/** Each read of `fetch` is a fresh backend, so runs never share writes. */\nexport const push: Env = {\n get fetch() {\n return createS3Fetch();\n },\n};\n\n/** Every request goes through `fetch`; `args[0]` is the signed URL. */\nexport const simulation = ['fetch'];\n","import type { Flow } from '@walkeros/core';\n\n/** Read an object from an AWS S3 bucket (file mode, byte-exact). */\nexport const readAwsS3: Flow.StepExample = {\n title: 'Read from S3',\n description: 'Read object from S3 and receive its raw bytes byte-exact',\n in: { operation: 'get', key: 'walker.js' },\n out: [['get', 'walker.js', 'Bytes<(function(){...})()>']],\n};\n\n/** Key is scoped to the configured prefix subdirectory. */\nexport const prefixScoping: Flow.StepExample = {\n title: 'Prefix scoping',\n description:\n 'Key \"walker.js\" with prefix \"public/\" resolves to S3 path \"public/walker.js\"',\n in: {\n operation: 'get',\n key: 'walker.js',\n settings: { bucket: 'my-assets', prefix: 'public' },\n },\n out: [['get', 'public/walker.js', 'Bytes<...>']],\n};\n\n/** A read that fails is reported, never answered as a miss. */\nexport const failedRead: Flow.StepExample = {\n public: false,\n description:\n 'The request fails (no connection, a refused or forbidden read): get throws a StepError instead of answering a miss, and the collector reports it.',\n in: { operation: 'get', key: 'walker.js' },\n respond: { error: 'network' },\n outcome: { status: 'failed', code: 'transport' },\n};\n","import type { Hint } from '@walkeros/core';\n\nexport const hints: Hint.Hints = {\n 'file-mode': {\n text: 'Default mode is structured: values are StoreValue data round-tripped through the shared core codec and stored with Content-Type application/json, good for session state, lookups, and cached responses. Set config.file: true to persist raw bytes byte-exact with the real mime derived from the key (set accepts Uint8Array or string), the mode for serving assets such as walker.js via the file transformer. One store instance is exactly one mode. Do not pair file: true with a cache; the cache wraps structured stores and flow_validate flags the combination.',\n },\n};\n"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAS,mBAAmB;;;ACA5B,SAAS,SAAS;AAEX,IAAM,iBAAiB,EAC3B,OAAO;AAAA,E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AAE,WAAW,OAAO,KAAK,YAAY;AAAA,EACzC,SAAS,EAAE,OAAO,UAAU;AAAA,EAC5B,SAAS,EAAE,QAAQ,UAAU,MAAM,YAAY;AACjD;;;AF1BO,IAAM,YAA0B;AAAA,EACrC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,QAAQ;AAAA,EACV;AAAA,EACA,MAAM;AACR;AAGO,IAAM,eAA6B;AAAA,EACxC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,IACjB,QAAQ;AAAA,EACV;AACF;AAGO,IAAM,WAAyB;AAAA,EACpC,UAAU;AAAA,IACR,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,aAAa;AAAA,IACb,iBAAiB;AAAA,EACnB;AAAA,EACA,MAAM;AACR;;;AGnCO,IAAM,QAAoB;AAAA,EAC/B,aAAa;AAAA,IACX,MAAM;AAAA,EACR;AACF;","names":["z"]}
|
package/dist/walkerOS.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$meta": {
|
|
3
3
|
"package": "@walkeros/server-store-s3",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.3-next-1793115089237",
|
|
5
5
|
"type": "store",
|
|
6
6
|
"platform": [
|
|
7
7
|
"server"
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"settings": {
|
|
74
74
|
"bucket": "my-assets",
|
|
75
75
|
"endpoint": "https://s3.eu-west-1.amazonaws.com",
|
|
76
|
-
"accessKeyId": "$
|
|
77
|
-
"secretAccessKey": "$
|
|
76
|
+
"accessKeyId": "$secret.S3_ACCESS_KEY",
|
|
77
|
+
"secretAccessKey": "$secret.S3_SECRET_KEY",
|
|
78
78
|
"region": "eu-west-1",
|
|
79
79
|
"prefix": "public"
|
|
80
80
|
},
|
|
@@ -82,11 +82,11 @@
|
|
|
82
82
|
},
|
|
83
83
|
"env": {
|
|
84
84
|
"createS3Fetch": {
|
|
85
|
-
"$code": "function f(){const e=new Map;return async(t,s)=>{const{pathname:r}=new URL(function(e){return\"string\"==typeof e?e:e instanceof URL?e.toString():e.url}(t)),
|
|
85
|
+
"$code": "function f(){const e=new Map;return async(t,s)=>{const{pathname:r}=new URL(function(e){return\"string\"==typeof e?e:e instanceof URL?e.toString():e.url}(t)),o=s?.method??\"GET\";if(r.replace(/\\/+$/,\"\").split(\"/\").length<=2)return new Response(null,{status:200});if(\"PUT\"===o)return e.set(r,(n=s?.body,\"string\"==typeof n?(new TextEncoder).encode(n):n instanceof Uint8Array?new Uint8Array(n):new Uint8Array)),new Response(null,{status:200,headers:{etag:'\"mock\"'}});var n;if(\"DELETE\"===o)return e.delete(r),new Response(null,{status:204});const i=e.get(r);return i?new Response(i,{status:200}):new Response(null,{status:404})}}"
|
|
86
86
|
},
|
|
87
87
|
"push": {
|
|
88
88
|
"fetch": {
|
|
89
|
-
"$code": "async(t,s)=>{const{pathname:r}=new URL(function(e){return\"string\"==typeof e?e:e instanceof URL?e.toString():e.url}(t)),
|
|
89
|
+
"$code": "async(t,s)=>{const{pathname:r}=new URL(function(e){return\"string\"==typeof e?e:e instanceof URL?e.toString():e.url}(t)),o=s?.method??\"GET\";if(r.replace(/\\/+$/,\"\").split(\"/\").length<=2)return new Response(null,{status:200});if(\"PUT\"===o)return e.set(r,(n=s?.body,\"string\"==typeof n?(new TextEncoder).encode(n):n instanceof Uint8Array?new Uint8Array(n):new Uint8Array)),new Response(null,{status:200,headers:{etag:'\"mock\"'}});var n;if(\"DELETE\"===o)return e.delete(r),new Response(null,{status:204});const i=e.get(r);return i?new Response(i,{status:200}):new Response(null,{status:404})}"
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
92
|
"simulation": [
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"settings": {
|
|
98
98
|
"bucket": "my-bucket",
|
|
99
99
|
"endpoint": "https://ACCOUNT_ID.r2.cloudflarestorage.com",
|
|
100
|
-
"accessKeyId": "$
|
|
101
|
-
"secretAccessKey": "$
|
|
100
|
+
"accessKeyId": "$secret.R2_ACCESS_KEY",
|
|
101
|
+
"secretAccessKey": "$secret.R2_SECRET_KEY"
|
|
102
102
|
},
|
|
103
103
|
"file": true
|
|
104
104
|
},
|
|
@@ -157,8 +157,8 @@
|
|
|
157
157
|
"settings": {
|
|
158
158
|
"bucket": "my-state",
|
|
159
159
|
"endpoint": "https://s3.eu-west-1.amazonaws.com",
|
|
160
|
-
"accessKeyId": "$
|
|
161
|
-
"secretAccessKey": "$
|
|
160
|
+
"accessKeyId": "$secret.S3_ACCESS_KEY",
|
|
161
|
+
"secretAccessKey": "$secret.S3_SECRET_KEY",
|
|
162
162
|
"region": "eu-west-1"
|
|
163
163
|
}
|
|
164
164
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/server-store-s3",
|
|
3
3
|
"description": "S3-compatible object storage for walkerOS server flows",
|
|
4
|
-
"version": "4.8.
|
|
4
|
+
"version": "4.8.3-next-1793115089237",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"update": "npx npm-check-updates -u && npm update"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@walkeros/core": "4.8.
|
|
36
|
+
"@walkeros/core": "4.8.3-next-1793115089237",
|
|
37
37
|
"s3mini": "^0.9.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@walkeros/collector": "4.8.
|
|
40
|
+
"@walkeros/collector": "4.8.3-next-1793115089237"
|
|
41
41
|
},
|
|
42
42
|
"repository": {
|
|
43
43
|
"url": "git+https://github.com/elbwalker/walkerOS.git",
|