@owlmeans/image-resource 0.1.18-rc.0 → 0.1.18-rc.10

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/image-resource",
4
- "version": "0.1.18-rc.0",
5
- "generatedAt": "2026-08-16T22:20:50.507Z",
4
+ "version": "0.1.18-rc.10",
5
+ "generatedAt": "2026-09-01T16:28:56.990Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: image-resource
3
- description: How to use @owlmeans/image-resource — image-handling Resource extending @owlmeans/storage-resource with image-specific metadata (dimensions, MIME). Auto-invoked when handling image uploads.
3
+ description: How to use @owlmeans/image-resource — the image-shaped names and AJV schemas over the shared stored-file types from @owlmeans/storage-common. Auto-invoked when typing image records or validating an image upload.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,24 +8,41 @@ user-invocable: false
8
8
  # @owlmeans/image-resource
9
9
 
10
10
  **Layer:** Infra
11
- **Install:** `"@owlmeans/image-resource": "^0.1.18-rc.0"` in `dependencies`
11
+ **Install:** `"@owlmeans/image-resource": "^0.1.18-rc.10"` in `dependencies` (peer `ajv`)
12
+
13
+ Types and schemas only — no resource is registered here. An image *is* a stored file
14
+ ([[storage-common]]); this package gives that file image-shaped names so a signature says what it
15
+ carries, and re-emits the schemas so an image endpoint validates against its own.
12
16
 
13
17
  ## Key Exports
14
18
 
15
19
  | Export | Description |
16
20
  |--------|-------------|
17
- | `Image` types | Image metadata shape (dimensions, MIME, dominant color) |
18
- | `ImageModel` | Image-specific helpers (resize hints, derived sizes) |
21
+ | `ImageMeta`, `StoredImage`, `ImageData` | The image spellings of `StoredFileMeta`, `StoredFile` and `StoredFileWithData` |
22
+ | `ImageMetaSchema`, `StoredImageSchema`, `ImageDataSchema` | The matching AJV schemas |
19
23
 
20
24
  ## Usage
21
25
 
22
- Use in conjunction with `makeStorageResource` to type uploads as images:
26
+ Type the record that *describes* the image, and keep it in a database resource — that is what
27
+ answers criteria, sorting and paging. The bytes go to a bucket through
28
+ [[storage-resource]]'s upload-only `create`.
23
29
 
24
30
  ```typescript
25
- import type { Image } from '@owlmeans/image-resource'
26
- const images = ctx.getResource<StorageResource<Image>>('uploads')
31
+ import type { StoredImage } from '@owlmeans/image-resource'
32
+
33
+ const images = ctx.resource<Resource<StoredImage>>('images')
34
+ await images.list({ entityId, mimeType: { $startsWith: 'image/' } }, { sort: ['name'], size: 20 })
27
35
  ```
28
36
 
37
+ `instances` carries the renditions — original, thumbnail, converted format — each with its own
38
+ `url` and `size`. Pick the one a screen needs from that map; never rebuild a url by string surgery.
39
+
29
40
  ## Depends On
30
41
 
31
42
  - `@owlmeans/storage-resource`, `@owlmeans/storage-common`
43
+ - peer `ajv`
44
+
45
+ ## Related
46
+
47
+ - [[storage-common]] — the stored-file types and schemas these specialize
48
+ - [[storage-resource]] — the bucket upload · [[resource]] — the record store behind it
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@owlmeans/image-resource",
3
3
  "type": "module",
4
- "version": "0.1.18-rc.0",
4
+ "version": "0.1.18-rc.10",
5
5
  "license": "MIT",
6
6
  "scripts": {
7
7
  "build": "tsc -b",
@@ -24,7 +24,7 @@
24
24
  "ajv": "*"
25
25
  },
26
26
  "dependencies": {
27
- "@owlmeans/storage-resource": "^0.1.18-rc.0"
27
+ "@owlmeans/storage-resource": "^0.1.18-rc.10"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@owlmeans/dep-config": "workspace:*",