@owlmeans/storage-resource 0.1.18-rc.11 → 0.1.18-rc.13
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
CHANGED
|
@@ -14,7 +14,7 @@ S3-compatible object storage resource for OwlMeans server applications.
|
|
|
14
14
|
## Installation
|
|
15
15
|
|
|
16
16
|
```bash
|
|
17
|
-
bun add @owlmeans/storage-resource
|
|
17
|
+
bun add @owlmeans/storage-resource@^0.1.18-rc.11
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
## Usage
|
|
@@ -102,7 +102,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
102
102
|
your project's skill store (`.agents/skills/`):
|
|
103
103
|
|
|
104
104
|
```sh
|
|
105
|
-
npx @owlmeans/agent-skills
|
|
105
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.13
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/storage-resource",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.13",
|
|
5
|
+
"generatedAt": "2026-09-10T18:54:42.487Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/storage-resource
|
|
9
9
|
|
|
10
10
|
**Layer:** Infra
|
|
11
|
-
**Install:** `"@owlmeans/storage-resource": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/storage-resource": "^0.1.18-rc.13"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ user-invocable: false
|
|
|
16
16
|
|--------|-------------|
|
|
17
17
|
| `appendStorageResource(context, alias?, configKey?)` | Register the upload resource on a server context |
|
|
18
18
|
| `createStorageResource(alias?, configKey?)` | The bare resource, when you register it yourself |
|
|
19
|
-
| `StorageResource` | `Pick<Resource<StoredRecord>, 'create'>` — **an upload and nothing else** |
|
|
19
|
+
| `StorageResource` | `Pick<Resource<StoredRecord>, 'create'>` plus `BasicResource` — **an upload and nothing else** |
|
|
20
20
|
| `StoredRecord`, `StorageConfig`, `StoredConfigAppend` | The uploaded object, one bucket's config, and the `cfg.storageBuckets` shape |
|
|
21
21
|
| `stripData` | Drop the inline payload from a `StoredFileWithData` before it goes on the wire |
|
|
22
22
|
| `supportedMimeTypes`, `DEFAULT_ALIAS` (`s3-storage`) | Constants |
|
|
@@ -26,16 +26,26 @@ user-invocable: false
|
|
|
26
26
|
```typescript
|
|
27
27
|
import { appendStorageResource } from '@owlmeans/storage-resource'
|
|
28
28
|
|
|
29
|
-
appendStorageResource(context, 'uploads',
|
|
29
|
+
appendStorageResource(context, 'uploads', 'media-bucket')
|
|
30
30
|
|
|
31
31
|
const uploads = context.resource<StorageResource>('uploads')
|
|
32
32
|
const stored = await uploads.create({ stream, size, type: 'image/png', prefix: `${entityId}/${id}` })
|
|
33
33
|
stored.url // the public URL the bucket answers on
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
`configKey` selects the entry in `cfg.storageBuckets
|
|
37
|
-
`{ url, apiKey, basePrefix }
|
|
38
|
-
|
|
36
|
+
`configKey` selects the entry in `cfg.storageBuckets`, defaulting to the alias. The entry is
|
|
37
|
+
`{ url, apiKey, basePrefix }`:
|
|
38
|
+
|
|
39
|
+
| Key | Value |
|
|
40
|
+
|---|---|
|
|
41
|
+
| `url` | **`<bucket>.<endpoint-host>`, no scheme and no path** — the first dot-label is the S3 `Bucket`, everything after it is the endpoint (`https://<rest>`), e.g. `media.s3.eu-central-1.amazonaws.com` uploads to bucket `media` |
|
|
42
|
+
| `apiKey` | `"<keyId>:<keySecret>"` — one string, split on **every** colon with only the first two parts read, so a secret containing a colon is silently truncated at the next one |
|
|
43
|
+
| `basePrefix` | prepended to every key; the object lands at `<basePrefix>/<record.prefix>` and answers on `https://<url>/<basePrefix>/<record.prefix>` |
|
|
44
|
+
|
|
45
|
+
A `url` written as a plain endpoint (`https://s3.amazonaws.com`) uploads to a bucket literally named
|
|
46
|
+
`https://s3` and fails against the endpoint `amazonaws.com` — bucket-prefixed virtual-host style is
|
|
47
|
+
the only shape this reads. The region is fixed at `eu-central-1`, so a bucket elsewhere must be
|
|
48
|
+
addressed by an endpoint host that already carries its region.
|
|
39
49
|
|
|
40
50
|
## A bucket is not a record store
|
|
41
51
|
|
|
@@ -56,6 +66,8 @@ here: a bucket object never expires on its own.
|
|
|
56
66
|
- `@owlmeans/storage-common`, `@owlmeans/resource`, `@owlmeans/context`, `@owlmeans/server-context`,
|
|
57
67
|
`@owlmeans/error`
|
|
58
68
|
- `@aws-sdk/client-s3`, `file-type` (runtime)
|
|
69
|
+
- The manifest also carries a `react` peer that nothing here imports — this is a server-side
|
|
70
|
+
package, and a consumer without React can ignore the peer warning.
|
|
59
71
|
|
|
60
72
|
## Related
|
|
61
73
|
|
package/build/helper.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE9E,eAAO,MAAM,SAAS,GACpB,KAAK,SAAS,kBAAkB,EAChC,MAAM,SAAS,UAAU,
|
|
1
|
+
{"version":3,"file":"helper.d.ts","sourceRoot":"","sources":["../src/helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE9E,eAAO,MAAM,SAAS,GACpB,KAAK,SAAS,kBAAkB,EAChC,MAAM,SAAS,UAAU,QACnB,KAAK,KAAG,MAgBf,CAAA"}
|
package/build/resource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAA;AAOhF,eAAO,MAAM,qBAAqB,
|
|
1
|
+
{"version":3,"file":"resource.d.ts","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAgB,MAAM,YAAY,CAAA;AAOhF,eAAO,MAAM,qBAAqB,WAAW,MAAM,cAA8B,MAAM,oBAwEtF,CAAA;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,MAAM,EAAE,CAAC,SAAS,OAAO,CAAC,CAAC,CAAC,OACrE,CAAC,UAAS,MAAM,cAA8B,MAAM,KACxD,CAMF,CAAA"}
|
package/build/resource.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../src/resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAG3C,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAC7G,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,
|
|
1
|
+
{"version":3,"file":"resource.js","sourceRoot":"","sources":["../src/resource.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E,OAAO,MAAM,CAAC,MAAM,CAAA;gBAEpB,MAAM,CAAC,OAAO,EAAE,CAAA;YAClB,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,IAAI,CAAC,YAAY,cAAc,EAAE,CAAC;oBAChC,MAAM,CAAC,CAAA;gBACT,CAAC;gBACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAChB,MAAM,IAAI,eAAe,EAAE,CAAA;YAC7B,CAAC;YAED,OAAO,MAAsB,CAAA;QAC/B,CAAC;KACF,CAAC,CAAA;IAEF,OAAO,QAAQ,CAAA;AACjB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,GAAM,EAAE,KAAK,GAAW,aAAa,EAAE,SAAkB,EACtD,EAAE;IACL,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAA;IAExD,GAAG,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAA;IAE9B,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/storage-resource",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.13",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@aws-sdk/client-s3": "^3.701.0",
|
|
28
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
29
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
30
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
31
|
-
"@owlmeans/server-context": "^0.1.18-rc.
|
|
32
|
-
"@owlmeans/storage-common": "^0.1.18-rc.
|
|
28
|
+
"@owlmeans/context": "^0.1.18-rc.9",
|
|
29
|
+
"@owlmeans/error": "^0.1.18-rc.9",
|
|
30
|
+
"@owlmeans/resource": "^0.1.18-rc.10",
|
|
31
|
+
"@owlmeans/server-context": "^0.1.18-rc.13",
|
|
32
|
+
"@owlmeans/storage-common": "^0.1.18-rc.10",
|
|
33
33
|
"file-type": "^22.0.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|