file meta

This commit is contained in:
seb
2026-09-18 05:19:47 +02:00
parent e10a8d10e7
commit 9e9d3154ca
17 changed files with 896 additions and 623 deletions

View File

@@ -26,10 +26,11 @@ Attaches a file to an existing manifest.
| `[input.thumbavif]` | `Buffer` | Optional AVIF thumbnail buffer. |
| `[input.thumbx]` | `number` | Optional thumbnail width. |
| `[input.thumby]` | `number` | Optional thumbnail height. |
| `[input.meta]` | `object` | Optional string key/value metadata stored on the file row. |
**Returns**
`Promise<{id: number, manifestId: number, fileId: number, sort: number, hash: string, mimetype: string, name: string, size: number, created: Date, modified: Date, thumbavif: Buffer|null, thumbx: number|null, thumby: number|null}>` — The created attachment record.
`Promise<{id: number, manifestId: number, fileId: number, sort: number, hash: string, mimetype: string, name: string, size: number, created: Date, modified: Date, thumbavif: Buffer|null, thumbx: number|null, thumby: number|null, meta: object|null}>` — The created attachment record.
**Throws**
@@ -62,7 +63,7 @@ Gets an attachment for a manifest by its attachment ID or file ID, including ful
**Returns**
`Promise<{id: number, manifestId: number, fileId: number, sort: number, hash: string, mimetype: string, name: string, size: number, created: Date, modified: Date, content: Buffer, thumbavif: Buffer|null, thumbx: number|null, thumby: number|null}>` — The attachment record with binary content.
`Promise<{id: number, manifestId: number, fileId: number, sort: number, hash: string, mimetype: string, name: string, size: number, created: Date, modified: Date, content: Buffer, thumbavif: Buffer|null, thumbx: number|null, thumby: number|null, meta: object|null}>` — The attachment record with binary content.
**Throws**
@@ -79,29 +80,7 @@ const attachment = await store.manifestattachment.getById(42, 1, 5);
*Source: `src/store/manifestattachment/listByManifestId.js`*
Lists all attachments for a given manifest, without loading their full binary content.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `manifestId` | `number` | The manifest ID. |
**Returns**
`Promise<Array<{id: number, manifestId: number, fileId: number, sort: number, hash: string, mimetype: string, name: string, size: number, created: Date, modified: Date, thumbavif: Buffer|null, thumbx: number|null, thumby: number|null}>>` — A list of attachment metadata objects.
**Throws**
`Error` — If the manifest is not found or the user is not authorized.
**Example**
```js
const attachments = await store.manifestattachment.listByManifestId(42, 1);
// => [{ id, manifestId, fileId, sort, hash, mimetype, name, size, created, modified, thumbavif, thumbx, thumby }]
```
Parse the file.meta JSON text column into an object (string key/value).
## `manifestattachment.order`