@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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/storage-common",
4
- "version": "0.1.18-rc.6",
5
- "generatedAt": "2026-08-18T14:48:00.536Z",
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.6"` in `dependencies`
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
- | `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` | 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 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`
@@ -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;IAE3D,YAAY,OAAO,GAAE,MAAgB,EAEpC;CACF;AAED,qBAAa,eAAgB,SAAQ,eAAe;IAClD,OAAuB,QAAQ,EAAE,MAAM,CAAsC;IAE7E,YAAY,OAAO,GAAE,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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.7",
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.7",
28
- "@owlmeans/error": "^0.1.18-rc.6"
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