@owlmeans/storage-common 0.1.18-rc.7 → 0.1.18-rc.8
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/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/storage-common",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-
|
|
4
|
+
"version": "0.1.18-rc.8",
|
|
5
|
+
"generatedAt": "2026-09-01T16:28:56.994Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,30 +8,42 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/storage-common
|
|
9
9
|
|
|
10
10
|
**Layer:** Infra
|
|
11
|
-
**Install:** `"@owlmeans/storage-common": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/storage-common": "^0.1.18-rc.8"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
15
15
|
| Export | Description |
|
|
16
16
|
|--------|-------------|
|
|
17
|
-
| `
|
|
18
|
-
| `
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
17
|
+
| `StoredFileMeta` | What a stored file is *about*: `alias`, `mimeType`, `scopes`, `status`, plus optional `entityId`, `sourceName`, `name`, `title` |
|
|
18
|
+
| `StoredFileInstance` | One rendition — `{ size, alias, url }`. A file carries a map of them under `instances` |
|
|
19
|
+
| `StoredFile`, `StoredFileWithData` | The metadata plus its instances; the `WithData` form adds the inline payload (`format`, `bytes`, `base64`) |
|
|
20
|
+
| `StoredFileMetaSchema`, `StoredFileInstanceSchema`, `StoredFilePayloadSchema`, `StoredFileSchema`, `StoredFileWithDataSchema` | The matching AJV schemas |
|
|
21
|
+
| `StoredFileStatus`, `StoredFileFormat` | `uploaded` / `processing-ready` / `processed` / `cached` / `unknown`; `bytes` / `base64` |
|
|
22
|
+
| Errors | `StoredFileError`, `OrphanFileError`, `FilePropertyError`, `FileStreamError`, `StorageApiError`, `FileTypeError` |
|
|
22
23
|
|
|
23
24
|
## Usage
|
|
24
25
|
|
|
26
|
+
The shared vocabulary, not a resource: nothing here talks to a bucket or a database. A file record
|
|
27
|
+
is stored in whatever resource an app registers for it, so criteria, sorting and paging are that
|
|
28
|
+
resource's ([[resource]]) — this package only says what the record *is*.
|
|
29
|
+
|
|
25
30
|
```typescript
|
|
26
|
-
import
|
|
31
|
+
import { StoredFileStatus, StoredFileSchema } from '@owlmeans/storage-common'
|
|
32
|
+
import type { StoredFile } from '@owlmeans/storage-common'
|
|
27
33
|
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
apiKey: '/etc/master-secret/s3-storage',
|
|
31
|
-
basePrefix: 'uploads/',
|
|
32
|
-
}
|
|
34
|
+
const files = ctx.resource<Resource<StoredFile>>('files')
|
|
35
|
+
await files.list({ entityId, status: StoredFileStatus.Processed }, { sort: ['name'] })
|
|
33
36
|
```
|
|
34
37
|
|
|
38
|
+
A record is one logical file with **several instances** keyed by alias — the original, a thumbnail,
|
|
39
|
+
a converted format — each with its own url and size. A screen picks the instance it wants; nothing
|
|
40
|
+
re-derives a url by string surgery.
|
|
41
|
+
|
|
42
|
+
`StoredFileWithData` is the shape that carries bytes, and it is the wire shape only while a payload
|
|
43
|
+
is genuinely in flight. Strip it with `stripData` from [[storage-resource]] before a file record
|
|
44
|
+
goes into a response that only needs urls.
|
|
45
|
+
|
|
35
46
|
## Depends On
|
|
36
47
|
|
|
37
|
-
- `@owlmeans/error`, `@owlmeans/
|
|
48
|
+
- `@owlmeans/error`, `@owlmeans/auth` (the shared `entityId` / id / scope value schemas)
|
|
49
|
+
- peer `ajv`
|
package/build/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,qBAAa,eAAgB,SAAQ,cAAc;IACjD,OAAuB,QAAQ,EAAE,MAAM,CAAoB;
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,qBAAa,eAAgB,SAAQ,cAAc;IACjD,OAAuB,QAAQ,EAAE,MAAM,CAAoB;gBAE/C,OAAO,GAAE,MAAgB;CAGtC;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAuB,QAAQ,EAAE,MAAM,CAAsC;gBAEjE,OAAO,GAAE,MAAgB;CAItC;AAED,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,OAAuB,QAAQ,EAAE,MAAM,CAAwC;gBAEnE,OAAO,GAAE,MAAgB;CAItC;AAED,qBAAa,eAAgB,SAAQ,iBAAiB;IACpD,OAAuB,QAAQ,EAAE,MAAM,CAA0C;gBAErE,OAAO,GAAE,MAAgB;CAItC;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAuB,QAAQ,EAAE,MAAM,CAAmC;gBAE9D,OAAO,GAAE,MAAgB;CAItC;AAED,qBAAa,aAAc,SAAQ,eAAe;IAChD,OAAuB,QAAQ,EAAE,MAAM,CAAoC;gBAE/D,OAAO,GAAE,MAAgB;CAItC"}
|
package/build/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAEhD,MAAM,OAAO,eAAgB,SAAQ,cAAc;IAC1C,MAAM,CAAU,QAAQ,GAAW,iBAAiB,CAAA;IAE3D,YAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../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AI,CAAC,IAAI,GAAG,eAAe,CAAC,QAAQ,CAAA;IACtC,CAAC;;AAGH,MAAM,OAAO,aAAc,SAAQ,eAAe;IACzC,MAAM,CAAU,QAAQ,GAAW,GAAG,eAAe,CAAC,QAAQ,MAAM,CAAA;IAE3E,YAAY,UAAkB,OAAO;QACnC,KAAK,CAAC,QAAQ,OAAO,EAAE,CAAC,CAAA;QACxB,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,QAAQ,CAAA;IACpC,CAAC;;AAGH,cAAc,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;AAClD,cAAc,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;AAClD,cAAc,CAAC,kBAAkB,CAAC,iBAAiB,CAAC,CAAA;AACpD,cAAc,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;AAClD,cAAc,CAAC,kBAAkB,CAAC,eAAe,CAAC,CAAA;AAClD,cAAc,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/storage-common",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
4
|
+
"version": "0.1.18-rc.8",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc -b",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"ajv": "*"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@owlmeans/auth": "^0.1.18-rc.
|
|
28
|
-
"@owlmeans/error": "^0.1.18-rc.
|
|
27
|
+
"@owlmeans/auth": "^0.1.18-rc.8",
|
|
28
|
+
"@owlmeans/error": "^0.1.18-rc.7"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@owlmeans/dep-config": "workspace:*",
|
package/build/.gitkeep
DELETED
|
File without changes
|