@owlmeans/storage-common 0.1.18-rc.2 → 0.1.18-rc.20

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
@@ -12,7 +12,7 @@ Shared types and schemas for OwlMeans object storage — file metadata, instance
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/storage-common
15
+ bun add @owlmeans/storage-common@^0.1.18-rc.19
16
16
  ```
17
17
 
18
18
  ## API
@@ -59,7 +59,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
59
59
  your project's skill store (`.agents/skills/`):
60
60
 
61
61
  ```sh
62
- npx @owlmeans/agent-skills
62
+ npx @owlmeans/agent-skills@^0.1.18-rc.23
63
63
  ```
64
64
 
65
65
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/storage-common",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.511Z",
4
+ "version": "0.1.18-rc.20",
5
+ "generatedAt": "2026-09-15T12:50:32.620Z",
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.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/storage-common": "^0.1.18-rc.20"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
15
15
  | Export | Description |
16
16
  |--------|-------------|
17
- | `StorageBucket` types | Bucket descriptor (URL, credentials, prefix) |
18
- | `StorageObject` types | Stored object metadata |
19
- | Errors | Typed storage errors (NotFound, Forbidden, etc.) |
20
- | Constants | Default content types, MIME categories |
21
- | Model | Path/key normalization helpers |
17
+ | `StoredFileMeta` | What a stored file is *about*: `alias`, `mimeType`, `scopes`, `status`, plus optional `entityId`, `sourceName`, `name`, `title` |
18
+ | `StoredFileInstance`, `StoredFilePayload` | One rendition `{ size, alias, url }` — and the same rendition carrying its bytes (`format`, `bytes`, `base64`) |
19
+ | `StoredFile`, `StoredFileWithData` | The metadata plus its `instances` map, which is required; the `WithData` form makes each instance a `StoredFilePayload` and adds a record-level `format` |
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 type { StorageBucket } from '@owlmeans/storage-common'
31
+ import { StoredFileStatus, StoredFileSchema } from '@owlmeans/storage-common'
32
+ import type { StoredFile } from '@owlmeans/storage-common'
27
33
 
28
- const bucket: StorageBucket = {
29
- url: '/etc/app-config/s3-bucket-url',
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/i18n`
48
+ - `@owlmeans/error`, `@owlmeans/auth` (the shared `entityId` / id / scope value schemas)
49
+ - peer `ajv`
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.2",
4
+ "version": "0.1.18-rc.20",
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.2",
28
- "@owlmeans/error": "^0.1.18-rc.2"
27
+ "@owlmeans/auth": "^0.1.18-rc.20",
28
+ "@owlmeans/error": "^0.1.18-rc.19"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@owlmeans/dep-config": "workspace:*",
package/build/.gitkeep DELETED
File without changes