@antelopejs/dms-media 0.4.0 → 0.5.0
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 +58 -184
- package/dist/bindings.d.ts +4 -1
- package/dist/bindings.js +21 -0
- package/dist/bindings.js.map +1 -1
- package/dist/db/models/index.d.ts +1 -0
- package/dist/db/models/index.js +1 -0
- package/dist/db/models/index.js.map +1 -1
- package/dist/db/models/mediaAssets.model.d.ts +2 -0
- package/dist/db/models/mediaAssets.model.js +19 -0
- package/dist/db/models/mediaAssets.model.js.map +1 -1
- package/dist/db/models/mediaDeclarations.model.d.ts +24 -0
- package/dist/db/models/mediaDeclarations.model.js +13 -0
- package/dist/db/models/mediaDeclarations.model.js.map +1 -0
- package/dist/db/models/mediaEvents.model.d.ts +1 -0
- package/dist/db/models/mediaFavorites.model.d.ts +1 -0
- package/dist/db/models/mediaFolders.model.d.ts +4 -0
- package/dist/db/models/mediaFolders.model.js +29 -0
- package/dist/db/models/mediaFolders.model.js.map +1 -1
- package/dist/db/models/mediaUploads.model.d.ts +1 -0
- package/dist/db/tables/index.d.ts +1 -0
- package/dist/db/tables/index.js +1 -0
- package/dist/db/tables/index.js.map +1 -1
- package/dist/db/tables/mediaDeclarations.table.d.ts +15 -0
- package/dist/db/tables/mediaDeclarations.table.js +65 -0
- package/dist/db/tables/mediaDeclarations.table.js.map +1 -0
- package/dist/declared/assets.d.ts +4 -0
- package/dist/declared/assets.js +269 -0
- package/dist/declared/assets.js.map +1 -0
- package/dist/declared/folders.d.ts +10 -0
- package/dist/declared/folders.js +154 -0
- package/dist/declared/folders.js.map +1 -0
- package/dist/declared/index.d.ts +5 -0
- package/dist/declared/index.js +22 -0
- package/dist/declared/index.js.map +1 -0
- package/dist/declared/readiness.d.ts +2 -0
- package/dist/declared/readiness.js +52 -0
- package/dist/declared/readiness.js.map +1 -0
- package/dist/declared/records.d.ts +46 -0
- package/dist/declared/records.js +94 -0
- package/dist/declared/records.js.map +1 -0
- package/dist/declared/retire.d.ts +3 -0
- package/dist/declared/retire.js +118 -0
- package/dist/declared/retire.js.map +1 -0
- package/dist/implementations/interface-dms-media/index.d.ts +5 -0
- package/dist/implementations/interface-dms-media/index.js +5 -0
- package/dist/implementations/interface-dms-media/index.js.map +1 -1
- package/dist/library/events.d.ts +2 -1
- package/dist/library/events.js.map +1 -1
- package/dist/routes/media/assets.js +19 -4
- package/dist/routes/media/assets.js.map +1 -1
- package/dist/routes/media/context.d.ts +1 -1
- package/dist/routes/media/context.js.map +1 -1
- package/dist/routes/media/dto.d.ts +1 -0
- package/dist/routes/media/dto.js +3 -1
- package/dist/routes/media/dto.js.map +1 -1
- package/dist/routes/media/folders.d.ts +6 -0
- package/dist/routes/media/folders.js +25 -13
- package/dist/routes/media/folders.js.map +1 -1
- package/dist/routes/media/upload.d.ts +1 -1
- package/dist/routes/media/upload.js +26 -58
- package/dist/routes/media/upload.js.map +1 -1
- package/dist/test/antelope.test.js +5 -5
- package/dist/test/integration/media-declared-content.test.d.ts +1 -0
- package/dist/test/integration/media-declared-content.test.js +705 -0
- package/dist/test/integration/media-declared-content.test.js.map +1 -0
- package/dist/test/integration/media-declared-retire.test.d.ts +1 -0
- package/dist/test/integration/media-declared-retire.test.js +186 -0
- package/dist/test/integration/media-declared-retire.test.js.map +1 -0
- package/dist/test/integration/media-delivery-editing.test.js +26 -0
- package/dist/test/integration/media-delivery-editing.test.js.map +1 -1
- package/dist/test/integration/media-linked-subfolders.test.d.ts +1 -0
- package/dist/test/integration/media-linked-subfolders.test.js +192 -0
- package/dist/test/integration/media-linked-subfolders.test.js.map +1 -0
- package/dist/test/unit/declared.test.d.ts +1 -0
- package/dist/test/unit/declared.test.js +118 -0
- package/dist/test/unit/declared.test.js.map +1 -0
- package/dist/upload-checks.d.ts +18 -0
- package/dist/upload-checks.js +75 -0
- package/dist/upload-checks.js.map +1 -0
- package/dist/validation/declared.schema.d.ts +187 -0
- package/dist/validation/declared.schema.js +78 -0
- package/dist/validation/declared.schema.js.map +1 -0
- package/dist/validation/media.schema.d.ts +3 -0
- package/dist/validation/media.schema.js +12 -12
- package/dist/validation/media.schema.js.map +1 -1
- package/frontend-vue/app/components/ImageEditor.vue +2 -2
- package/frontend-vue/app/components/dialogs/DestinationDialog.vue +1 -1
- package/frontend-vue/app/components/dialogs/MoveDialog.vue +2 -2
- package/frontend-vue/app/components/explorer/ExplorerContent.vue +1 -1
- package/frontend-vue/app/components/explorer/ExplorerToolbar.vue +1 -1
- package/frontend-vue/app/components/shared/AssetThumb.vue +3 -1
- package/frontend-vue/app/composables/library/explorerMenus.ts +1 -1
- package/frontend-vue/app/composables/library/useExplorerCommands.ts +1 -1
- package/frontend-vue/app/composables/library/useExplorerDrop.ts +1 -1
- package/frontend-vue/app/types/media.ts +3 -1
- package/frontend-vue/package.json +1 -1
- package/frontend-vue/tests/serverRender.test.ts +2 -1
- package/package.json +33 -15
- package/skills/dms-media/SKILL.md +110 -0
- package/src/bindings.ts +28 -0
- package/src/db/models/index.ts +1 -0
- package/src/db/models/mediaAssets.model.ts +25 -0
- package/src/db/models/mediaDeclarations.model.ts +19 -0
- package/src/db/models/mediaFolders.model.ts +44 -0
- package/src/db/tables/index.ts +1 -0
- package/src/db/tables/mediaDeclarations.table.ts +59 -0
- package/src/declared/assets.ts +446 -0
- package/src/declared/folders.ts +273 -0
- package/src/declared/index.ts +5 -0
- package/src/declared/readiness.ts +64 -0
- package/src/declared/records.ts +185 -0
- package/src/declared/retire.ts +206 -0
- package/src/implementations/interface-dms-media/index.ts +10 -0
- package/src/library/events.ts +4 -1
- package/src/routes/media/assets.ts +34 -5
- package/src/routes/media/context.ts +1 -1
- package/src/routes/media/dto.ts +6 -2
- package/src/routes/media/folders.ts +47 -21
- package/src/routes/media/upload.ts +50 -121
- package/src/test/antelope.test.ts +5 -5
- package/src/test/integration/media-declared-content.test.ts +844 -0
- package/src/test/integration/media-declared-retire.test.ts +257 -0
- package/src/test/integration/media-delivery-editing.test.ts +45 -0
- package/src/test/integration/media-linked-subfolders.test.ts +256 -0
- package/src/test/unit/declared.test.ts +158 -0
- package/src/upload-checks.ts +126 -0
- package/src/validation/declared.schema.ts +104 -0
- package/src/validation/media.schema.ts +7 -6
- package/frontend-vue/pnpm-workspace.yaml +0 -2
package/README.md
CHANGED
|
@@ -1,218 +1,92 @@
|
|
|
1
|
-
# @antelopejs/dms-media
|
|
2
|
-
|
|
3
1
|
<div align="center">
|
|
4
|
-
<a href="https://www.npmjs.com/package/@antelopejs/dms-media"><img alt="NPM version" src="https://img.shields.io/npm/v/@antelopejs/dms-media.svg?style=for-the-badge&labelColor=000000"></a>
|
|
5
|
-
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/badge/license-Apache--2.0-blue?style=for-the-badge&labelColor=000000"></a>
|
|
6
|
-
<a href="https://discord.gg/sjK28QHrA7"><img src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000" alt="Discord"></a>
|
|
7
|
-
<a href="https://antelopejs.com"><img src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000" alt="Documentation"></a>
|
|
8
|
-
</div>
|
|
9
|
-
|
|
10
|
-
AntelopeJS DMS module providing an asset/media library: upload, folders, delivery derivatives and light image editing, with per-folder permissions that reuse the DMS authorization system. Ships a Finder-style file explorer (frontend) and an `AssetType` field to reference library assets from forms.
|
|
11
|
-
|
|
12
|
-
See [AGENTS.md](../../AGENTS.md) for code conventions.
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```bash
|
|
17
|
-
ajs project modules add @antelopejs/dms-media
|
|
18
|
-
```
|
|
19
2
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
- **Folder tree with per-folder ACL** — a linked folder carries the ACL (`AclEntry[]`) its binding derives, every other folder inherits from its parent (root falls back to the configurable `rootAcl`, which grants nothing by default). Entries grant `read`/`write`/`manage` rights to either a **permission id** (anyone holding e.g. `articles.page.table.edit`) or a **role id**. Rights imply weaker ones (`manage ⇒ write ⇒ read`). Ancestors of a readable folder are returned as **traverse-only shells** (name visible, content never listed).
|
|
23
|
-
- **Single data path** — listing, search, picker and delivery all resolve the same `readable`/`writable`/`manageable` sets per request; nothing bypasses the ACL.
|
|
24
|
-
- **Direct-to-storage uploads** — `presign` (type and quota checks, staged) → client `PUT` → `confirm` (type check again, sharp decode of declared images, promote + DB row). Bytes never transit through Node. The stored mimetype is the one sharp reads, and the dimensions follow the EXIF orientation. `abort` deletes a staged file, and an hourly cron deletes the ones never confirmed.
|
|
25
|
-
- **Stable delivery URLs** — `GET /media/:assetId/:filename` 302-redirects to a signed storage URL. The redirect itself is never cached (`Cache-Control: no-cache` for public assets, with `Access-Control-Allow-Origin: *`; `no-store` for private ones, after auth + folder read check), so an edit or a visibility change shows on the next request; the signed URL it points to is reused for half its lifetime. A link with a stale file name redirects to the canonical one. Active content is the exception: SVG (inline) and HTML, XHTML and XML files (as `attachment`) are served by the API itself with `Content-Security-Policy: sandbox`, `X-Content-Type-Options: nosniff`, ETag/304 and Range support. A browser that opens a private file without a token is redirected to the file's page in the dashboard (`/modules/media/file?asset=`), which signs in and comes back; when the dashboard URL is unknown it gets a 401 HTML page. Visibility (asset override → folder → private) is a flag flip; URLs never change.
|
|
26
|
-
- **Lazy image derivatives** — named presets (config) rendered by sharp on first request, cached in storage under a config-hashed cache key, served via `GET /media/:assetId/:presetId/:filename` and the authenticated `read-url` endpoint. Changing a preset invalidates naturally (new hash); a daily cron sweeps stale keys. An image sharp cannot read answers 422, a size that fails to render for another reason 503.
|
|
27
|
-
- **Server-side image editing** — `transform` (normalized crop, 90° rotations) overwrites the image everywhere it is used, `transform/copy` saves the edit as a new file next to the untouched source ("Save as copy"), and `revert` restores the original. The pristine original is preserved on first edit (its size counts in the storage), successive edits are rendered from it, and derivatives are invalidated.
|
|
28
|
-
- **`AssetType` form field** — registers the `asset` data type whose widget (`DmsMediaAssetPicker`) opens the Finder as a picker. Declaring a `binding` auto-provisions a linked folder under the `Content` root (idempotency key = binding id) whose ACL derives from the declared permission mapping; linked folders cannot be renamed, moved, deleted or re-ACLed through the API.
|
|
29
|
-
- **Media module** — registered with `RegisterModule` like every DMS module, so it is listed under Modules and its pages live under `/modules/media` (they are the owner's administration of the library, see [Access model](#access-model)): Library (Overview `/modules/media/overview`, Library `/modules/media/files`, Uploads `/modules/media/uploads`, plus the hidden File `/modules/media/file?asset=`, Edit image `/modules/media/editor?asset=` and Activity `/modules/media/activity` pages) and Settings (Image sizes `/modules/media/presets`). Every page is a backend block tree. Module pages are owner-only (see [Static permissions](#static-permissions)).
|
|
30
|
-
- **Explorer** — server-paged listings with facets (type, visibility, modification date, orientation), smart views (recents, starred, missing alt text, largest, public), server search over names, alt text and folders (accents, case and word order ignored), bulk move/visibility/delete, zip download of a selection or of a folder with its subfolders, drag and drop, keyboard shortcuts and a shared upload queue that survives navigation.
|
|
31
|
-
- **Unique names** — renaming a file, or creating, renaming or moving a folder, onto a name its folder already holds (case and Unicode form aside) answers 409, and an upload that collides offers "Keep both" (the next free name, `photo (2).jpg`, from `POST /api/media/upload/names`) or "Cancel". A name typed in the library that Windows or macOS cannot save is refused, a subfolder cannot be created in or moved into a linked folder (403), and validation errors answer `$dms_media.errors.*` keys the dashboard translates.
|
|
32
|
-
- **Activity** — every write is recorded in `media_events` (kept 90 days) and feeds the overview, the Activity page (filterable by kind of action), the file history and the upload batches.
|
|
3
|
+
# @antelopejs/dms-media
|
|
33
4
|
|
|
34
|
-
|
|
5
|
+
<a href="https://www.npmjs.com/package/@antelopejs/dms-media"><img alt="npm" src="https://img.shields.io/npm/v/@antelopejs/dms-media?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
6
|
+
<a href="./LICENSE"><img alt="License" src="https://img.shields.io/npm/l/@antelopejs/dms-media?style=for-the-badge&labelColor=000000&color=000000"></a>
|
|
7
|
+
<a href="https://discord.gg/sjK28QHrA7"><img alt="Discord" src="https://img.shields.io/badge/Discord-18181B?logo=discord&style=for-the-badge&color=000000"></a>
|
|
8
|
+
<a href="https://dms.antelopejs.com/docs/modules/media"><img alt="Documentation" src="https://img.shields.io/badge/Docs-18181B?style=for-the-badge&color=000000"></a>
|
|
35
9
|
|
|
36
|
-
|
|
10
|
+
A media library for the AntelopeJS DMS: uploads, folders, image sizes and light editing.
|
|
37
11
|
|
|
38
|
-
|
|
39
|
-
|---|---|
|
|
40
|
-
| `modules.media.library.files` | Page permission of Library. Like every module page permission it is owner-only: it is not listed in Roles and `HasPermission` refuses it to any non-owner. It grants no folder right |
|
|
12
|
+
</div>
|
|
41
13
|
|
|
42
|
-
|
|
14
|
+

|
|
43
15
|
|
|
44
|
-
##
|
|
16
|
+
## What it does
|
|
45
17
|
|
|
46
|
-
|
|
18
|
+
- Organises images, videos and documents in a Finder-style explorer, with smart views, search, drag and drop and bulk actions.
|
|
19
|
+
- Uploads files straight to the project's file storage and delivers them from stable `/media/<id>/<name>` URLs.
|
|
20
|
+
- Renders named image sizes on first request, with crop and rotation that can revert to the original.
|
|
21
|
+
- Applies per-folder rights built on the DMS permissions and roles.
|
|
22
|
+
- Adds an `AssetType` form field, from [`@antelopejs/interface-dms-media`](https://github.com/AntelopeJS/dms-media/tree/main/packages/interface-dms-media), that opens the library as a picker on your pages.
|
|
23
|
+
- Lets a project ship folders and files as code with `EnsureMediaFolder` and `ImportMediaAsset`, created once and never overwriting what members changed.
|
|
47
24
|
|
|
48
|
-
|
|
25
|
+
## Install
|
|
49
26
|
|
|
50
|
-
|
|
51
|
-
@RegisterPage()
|
|
52
|
-
export class ArticlesPage extends PageController("articles", { displayName: "Articles", category: pagesCategory }) {
|
|
53
|
-
static form = Form({
|
|
54
|
-
fields: [
|
|
55
|
-
{
|
|
56
|
-
id: "cover",
|
|
57
|
-
label: "Cover",
|
|
58
|
-
type: new AssetType({
|
|
59
|
-
mimetypes: ["image/*"],
|
|
60
|
-
binding: { id: "articles.cover", folderName: "Article covers", permissionsFromPage: ArticlesPage },
|
|
61
|
-
}),
|
|
62
|
-
},
|
|
63
|
-
],
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
```
|
|
27
|
+
Run the AntelopeJS CLI from the root of a project that already loads `@antelopejs/dms` and a file storage module:
|
|
67
28
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
## Module configuration
|
|
71
|
-
|
|
72
|
-
```json
|
|
73
|
-
{
|
|
74
|
-
"dms-media": {
|
|
75
|
-
"config": {
|
|
76
|
-
"storage": "media",
|
|
77
|
-
"rootAcl": [{ "subject": { "kind": "permission", "id": "articles.page" }, "rights": ["read"] }],
|
|
78
|
-
"allowedMimetypes": ["image/*", "application/pdf"],
|
|
79
|
-
"storageQuotaBytes": 10000000000,
|
|
80
|
-
"publicBaseUrl": "${@api.API_PUBLIC_BASE_URL}",
|
|
81
|
-
"presets": [
|
|
82
|
-
{ "id": "thumb", "width": 300, "height": 300, "fit": "cover", "format": "webp", "quality": 80 }
|
|
83
|
-
]
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
}
|
|
29
|
+
```bash
|
|
30
|
+
ajs project modules add @antelopejs/dms-media
|
|
87
31
|
```
|
|
88
32
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- `storage` selects a named `interface-file-storage` backend (default storage otherwise).
|
|
92
|
-
- `rootAcl` sets the rights every folder without its own ACL inherits. The default is empty: owners hold every right anyway, and members only reach the linked folders of their pages. An entry you add here opens the whole library to its subject.
|
|
93
|
-
- `allowedMimetypes` lists the file types the library accepts (`image/*` matches a prefix). The default is `image/*`, `video/*`, `audio/*`, `application/pdf`, the Office types (`application/msword`, `application/vnd.ms-excel`, `application/vnd.ms-powerpoint`, `application/vnd.openxmlformats-officedocument.*`), OpenDocument (`application/vnd.oasis.opendocument.*`), `application/rtf`, `text/plain`, `text/markdown` and `text/csv`. HTML, XHTML and PHP (`text/html`, `application/xhtml+xml`, the PHP types, and `.htm`, `.html`, `.xhtml`, `.xht`, `.shtml`, `.mht`, `.mhtml`, `.php`, `.php3`–`.php8`, `.phps`, `.pht`, `.phtml`, `.phar` files) are always refused, whatever the list says.
|
|
94
|
-
- `storageQuotaBytes` sets the storage plan: the overview measures usage against it, and `presign` refuses an upload that would go past it.
|
|
95
|
-
- `publicBaseUrl` is the public URL of the API, the origin serving `/media/...`: "Copy link" in the library and the links of the file page's Delivery tab start with it. Point it at the api module's public base URL (`"${@api.API_PUBLIC_BASE_URL}"`, as `file-storage-local`'s `baseUrl`). Without it, links start with the DMS `apiBaseUrl` (`GetApiBaseUrl`), and stay relative when neither is set; request headers (`Host`, `X-Forwarded-*`) are never read. Links do not use the dashboard's origin: it only relays non-HTML requests to `/media`, so a link opened in a tab would end on its 404.
|
|
96
|
-
- `presets` replaces the default `thumb`/`preview` presets. Keep a `thumb` preset — the Finder uses it for grid thumbnails.
|
|
97
|
-
|
|
98
|
-
A refused upload answers a JSON body `{ "reason": …, "message": … }` the upload queue explains in the member's language: `type_not_allowed` (415, not an accepted type), `field_type` (415, the linked folder feeds a field that accepts fewer types, listed in `accepted`), `quota` (413, the storage plan is full, with `remaining` and `quota`) or `invalid_image` (422 on `confirm`, a declared image that does not decode).
|
|
33
|
+
## Quick start
|
|
99
34
|
|
|
100
|
-
|
|
35
|
+
Point the module's links at the API's public URL, and allow the dashboard's origin, since the browser uploads straight to the storage:
|
|
101
36
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
"file-storage-local": {
|
|
116
|
-
"config": { "baseUrl": "${@api.API_PUBLIC_BASE_URL}" }
|
|
117
|
-
}
|
|
118
|
-
}
|
|
37
|
+
```ts
|
|
38
|
+
// antelope.config.ts
|
|
39
|
+
"dms-media": {
|
|
40
|
+
source: { type: "package", package: "@antelopejs/dms-media", version: "^0.5.0" },
|
|
41
|
+
config: {
|
|
42
|
+
publicBaseUrl: "${@api.API_PUBLIC_BASE_URL}",
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
api: {
|
|
46
|
+
config: {
|
|
47
|
+
cors: { allowedOrigins: ["https://dms.example.com"] },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
119
50
|
```
|
|
120
51
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
## Declaring an AssetType field
|
|
124
|
-
|
|
125
|
-
`AssetType` and the folder bindings it declares live in the interface package [`@antelopejs/interface-dms-media`](../interface-dms-media), which this module implements. Declare the interface in the consumer module's `dependencies` and import from it:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
pnpm add @antelopejs/interface-dms-media
|
|
129
|
-
```
|
|
52
|
+
Restart the backend, then the frontend, and open **Modules › Media** (`/modules/media/overview`). To let members pick files from your own pages, add an asset field:
|
|
130
53
|
|
|
131
54
|
```ts
|
|
132
55
|
import { AssetType } from "@antelopejs/interface-dms-media";
|
|
133
56
|
|
|
134
57
|
new AssetType({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
mimetypes: ["image/*"],
|
|
138
|
-
binding: {
|
|
139
|
-
id: "articles.cover",
|
|
140
|
-
folderName: "Article covers",
|
|
141
|
-
permissionMapping: {
|
|
142
|
-
read: ["articles.page"],
|
|
143
|
-
write: ["articles.page.table.edit", "articles.page.table.add"],
|
|
144
|
-
},
|
|
145
|
-
},
|
|
58
|
+
mimetypes: ["image/*"],
|
|
59
|
+
binding: { id: "articles.cover", folderName: "Article covers", permissionsFromPage: ArticlesPage },
|
|
146
60
|
});
|
|
147
61
|
```
|
|
148
62
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
A `binding` is registered through `RegisterAssetBinding` (also exported by the interface, together with `UnregisterAssetBinding`). The registration belongs to the module that declares the field: it is released when that module is destroyed, and replayed to dms-media whenever dms-media reloads.
|
|
152
|
-
|
|
153
|
-
## HTTP surface
|
|
154
|
-
|
|
155
|
-
- Library: `GET /api/media/tree` (folders, plus `allowedMimetypes`), `GET /api/media/folders/:id/assets|impact`, `GET /api/media/views/:view` (`recent`, `starred`, `missing-alt`, `largest`, `public`), `GET /api/media/search` (an empty `q` finds nothing), `POST /api/media/favorites`, `POST /api/media/folders/starter`. Folder listings and views take the `type`, `visibility`, `modified` and `orientation` facets; views also take a `folderId` to stay inside one folder
|
|
156
|
-
- Overview (owners only, 403 otherwise): `GET /api/media/stats/kpis|storage|attention|recent`, `GET /api/media/activity?type=`
|
|
157
|
-
- File: `GET /api/media/assets/:id/details|history|information|delivery|delivery/notice|tab-counts`, `GET /api/media/links/origin` (the origin copied links start with: `publicBaseUrl`, otherwise the DMS `apiBaseUrl`)
|
|
158
|
-
- Bulk: `POST /api/media/assets/bulk/move|visibility|delete`, `POST /api/media/assets/zip`, `POST /api/media/folders/:id/zip` (the folder and its subfolders, `read` right)
|
|
159
|
-
- Settings: `GET|POST /api/media/upload/batches`, `GET /api/media/presets`, `GET /api/media/presets/config`, `GET /api/media/presets/cache`
|
|
160
|
-
- `POST /api/media/folders`, `POST /api/media/folders/:id/rename|move|visibility`, `DELETE /api/media/folders/:id`
|
|
161
|
-
- `GET /api/media/assets`, `GET /api/media/assets/search`, `GET /api/media/assets/:id`, `GET /api/media/assets/:id/read-url?preset=`, `POST /api/media/previews`
|
|
162
|
-
- `POST /api/media/assets/:id/update|move|visibility|transform|transform/copy|revert`, `DELETE /api/media/assets/:id`
|
|
163
|
-
- Upload: `POST /api/media/upload/presign`, `POST /api/media/upload/confirm`, `POST /api/media/upload/abort` (deletes the staged file), `POST /api/media/upload/names` (free names for "Keep both")
|
|
164
|
-
- Public delivery: `GET /media/:assetId/:filename`, `GET /media/:assetId/:presetId/:filename`
|
|
165
|
-
|
|
166
|
-
`GET /api/media/stats/folders` and `GET /api/media/stats/largest` are removed: the overview no longer shows folder cards or the largest files, which the `largest` view lists.
|
|
167
|
-
|
|
168
|
-
Status codes worth handling:
|
|
169
|
-
|
|
170
|
-
| Route | Status | Body |
|
|
171
|
-
|---|---|---|
|
|
172
|
-
| `upload/presign` | 415 | `{ reason: "type_not_allowed", message }`: not in `allowedMimetypes`, or HTML/XHTML/PHP (by type or extension) |
|
|
173
|
-
| `upload/presign` | 415 | `{ reason: "field_type", message, accepted }`: the linked folder feeds a field that accepts fewer types |
|
|
174
|
-
| `upload/presign` | 413 | `{ reason: "quota", message, remaining, quota }`: the upload would go past `storageQuotaBytes` |
|
|
175
|
-
| `upload/confirm` | 422 | `{ reason: "invalid_image", message }`: a declared image that does not decode; the staged file is deleted |
|
|
176
|
-
| `assets/:id/update`, `folders`, `folders/:id/rename|move` | 409 | `$dms_media.errors.name_taken` or `folder_name_taken`: the name is taken in that folder, case aside |
|
|
177
|
-
| `folders`, `folders/:id/move` | 403 | `$dms_media.errors.bound_parent`: the parent is a linked folder |
|
|
178
|
-
| Folder, file and bulk writes | 400 | A `$dms_media.errors.*` key |
|
|
179
|
-
| `/media/:assetId/:filename` | 302 | To the signed storage URL (`no-cache` public, `no-store` private), to the canonical file name, or, for a browser without a token on a private file, to the dashboard's File page |
|
|
180
|
-
| `/media/:assetId/:filename` | 401 | Private file without a token: bare for scripts, an HTML page for a browser when the dashboard URL is unknown |
|
|
181
|
-
| `/media/:assetId/:presetId/:filename` | 422 / 503 | The image cannot be read / the size cannot be rendered right now |
|
|
182
|
-
|
|
183
|
-
## Development
|
|
184
|
-
|
|
185
|
-
The module lives in `packages/dms-media` of a pnpm workspace, next to the interface package it implements (`packages/interface-dms-media`). Run these from `packages/dms-media`:
|
|
186
|
-
|
|
187
|
-
```bash
|
|
188
|
-
pnpm install # whole workspace; the interface resolves to the sibling package
|
|
189
|
-
pnpm build # builds the interface, then the module
|
|
190
|
-
pnpm dev # backend, via playground (ajs project run -w -p playground)
|
|
191
|
-
pnpm frontend:dev # Vue 3 Inertia frontend, from playground (ajs dms dev)
|
|
192
|
-
pnpm test # build + full mocha suite (unit + HTTP integration)
|
|
193
|
-
pnpm test:unit # build + unit tests only (no HTTP)
|
|
194
|
-
pnpm test:reload # hot reload of a consumer and of the module, in a real project
|
|
195
|
-
```
|
|
63
|
+
## Compatibility
|
|
196
64
|
|
|
197
|
-
|
|
65
|
+
| Package | Version |
|
|
66
|
+
| --- | --- |
|
|
67
|
+
| `@antelopejs/dms` | `>=0.9.0 <1.0.0` |
|
|
68
|
+
| `@antelopejs/interface-dms` | `>=0.7.2 <1.0.0` |
|
|
69
|
+
| `@antelopejs/dms-frontend` (renderer) | `>=0.6.0 <0.7.0` |
|
|
70
|
+
| `@antelopejs/interface-dms-media` | `>=0.3.0 <0.4.0` |
|
|
71
|
+
| File storage | an `@antelopejs/interface-file-storage` implementation, such as `@antelopejs/file-storage-local` |
|
|
198
72
|
|
|
199
|
-
|
|
73
|
+
On DMS 0.8, use `@antelopejs/dms-media` 0.3.
|
|
200
74
|
|
|
201
|
-
|
|
75
|
+
## Documentation
|
|
202
76
|
|
|
203
|
-
|
|
77
|
+
- [Introduction](https://dms.antelopejs.com/docs/modules/media/introduction)
|
|
78
|
+
- [Installation](https://dms.antelopejs.com/docs/modules/media/installation)
|
|
79
|
+
- [Configuration](https://dms.antelopejs.com/docs/modules/media/configuration)
|
|
80
|
+
- [Usage](https://dms.antelopejs.com/docs/modules/media/usage/overview)
|
|
81
|
+
- [Extending](https://dms.antelopejs.com/docs/modules/media/extending)
|
|
82
|
+
- [FAQ](https://dms.antelopejs.com/docs/modules/media/faq)
|
|
204
83
|
|
|
205
|
-
The
|
|
84
|
+
The guide's sources live in [`packages/dms-media/docs`](https://github.com/AntelopeJS/dms-media/tree/main/packages/dms-media/docs). The module ships the `dms-media` Claude Code skill in [`packages/dms-media/skills`](https://github.com/AntelopeJS/dms-media/tree/main/packages/dms-media/skills), declared under `antelopeJs.skills`.
|
|
206
85
|
|
|
207
|
-
|
|
86
|
+
## Contributing
|
|
208
87
|
|
|
209
|
-
|
|
88
|
+
This package lives in the [`AntelopeJS/dms-media`](https://github.com/AntelopeJS/dms-media) pnpm workspace, next to `@antelopejs/interface-dms-media`. Read [CONTRIBUTING.md](https://github.com/AntelopeJS/dms-media/blob/main/CONTRIBUTING.md) and the [repository README](https://github.com/AntelopeJS/dms-media#contributing) for the development commands.
|
|
210
89
|
|
|
211
|
-
##
|
|
90
|
+
## License
|
|
212
91
|
|
|
213
|
-
-
|
|
214
|
-
- The DMS invite flow does not expose invite tokens over HTTP (see the DMS module's `TESTING.md`), so the multi-user HTTP integration tests seed their invites straight into the database (`src/test/helpers/members.ts`).
|
|
215
|
-
- Folder visibility applies to the folder's direct assets (no recursive visibility inheritance); assets inherit or override individually.
|
|
216
|
-
- Cover cropping is centred (no focal point), and reference counting ("used in N records") is not supported yet.
|
|
217
|
-
- The `AssetType` field has no crop button: editing an image changes it everywhere it is used, and a crop per usage comes later.
|
|
218
|
-
- Replacing a file, a trash for deleted files and the server-side validation of `AssetType` values are not there yet; each comes in its own release.
|
|
92
|
+
[Apache-2.0](./LICENSE)
|
package/dist/bindings.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { AssetBindingConfig } from "@antelopejs/interface-dms-media";
|
|
2
|
-
import type { MediaFolderModel } from "./db";
|
|
2
|
+
import type { MediaFolder, MediaFolderModel } from "./db";
|
|
3
3
|
import type { AclEntry } from "./types";
|
|
4
4
|
export declare const CONTENT_ROOT_BINDING = "dms-media.content-root";
|
|
5
5
|
export declare function addAssetBinding(id: string, config: AssetBindingConfig): void;
|
|
6
6
|
export declare function removeAssetBinding(id: string): void;
|
|
7
7
|
export declare function getRegisteredBindings(): AssetBindingConfig[];
|
|
8
|
+
export declare function bindingHoldsSubfolders(bindingId: string): boolean;
|
|
9
|
+
export declare function holdsSubfolders(folder: MediaFolder): boolean;
|
|
10
|
+
export declare function feedingBinding(folder: MediaFolder | undefined, foldersById: ReadonlyMap<string, MediaFolder>): string | undefined;
|
|
8
11
|
export declare function buildBindingAcl(config: AssetBindingConfig): AclEntry[];
|
|
9
12
|
export declare function ensureTenantBindings(tenantId: string, folderModel: MediaFolderModel): Promise<void>;
|
package/dist/bindings.js
CHANGED
|
@@ -4,6 +4,9 @@ exports.CONTENT_ROOT_BINDING = void 0;
|
|
|
4
4
|
exports.addAssetBinding = addAssetBinding;
|
|
5
5
|
exports.removeAssetBinding = removeAssetBinding;
|
|
6
6
|
exports.getRegisteredBindings = getRegisteredBindings;
|
|
7
|
+
exports.bindingHoldsSubfolders = bindingHoldsSubfolders;
|
|
8
|
+
exports.holdsSubfolders = holdsSubfolders;
|
|
9
|
+
exports.feedingBinding = feedingBinding;
|
|
7
10
|
exports.buildBindingAcl = buildBindingAcl;
|
|
8
11
|
exports.ensureTenantBindings = ensureTenantBindings;
|
|
9
12
|
const node_crypto_1 = require("node:crypto");
|
|
@@ -26,6 +29,24 @@ function removeAssetBinding(id) {
|
|
|
26
29
|
function getRegisteredBindings() {
|
|
27
30
|
return [...registeredBindings.values()];
|
|
28
31
|
}
|
|
32
|
+
function bindingHoldsSubfolders(bindingId) {
|
|
33
|
+
return registeredBindings.get(bindingId)?.subfolders === true;
|
|
34
|
+
}
|
|
35
|
+
function holdsSubfolders(folder) {
|
|
36
|
+
return !folder.binding || bindingHoldsSubfolders(folder.binding);
|
|
37
|
+
}
|
|
38
|
+
function feedingBinding(folder, foldersById) {
|
|
39
|
+
if (!folder)
|
|
40
|
+
return undefined;
|
|
41
|
+
if (folder.binding)
|
|
42
|
+
return folder.binding;
|
|
43
|
+
for (const ancestorId of [...folder.path].reverse()) {
|
|
44
|
+
const binding = foldersById.get(ancestorId)?.binding;
|
|
45
|
+
if (binding)
|
|
46
|
+
return binding;
|
|
47
|
+
}
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
29
50
|
function registryFingerprint() {
|
|
30
51
|
const entries = getRegisteredBindings()
|
|
31
52
|
.sort((a, b) => a.id.localeCompare(b.id))
|
package/dist/bindings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":";;;AAeA,0CAGC;AAED,gD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B,CAAC,GAAG,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC;AAEM,KAAK,UAAU,oBAAoB,CACxC,QAAgB,EAChB,WAA6B;IAE7B,MAAM,WAAW,GAAG,mBAAmB,EAAE,CAAC;IAC1C,IAAI,kBAAkB,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,WAAW;QAAE,OAAO;IAC7D,MAAM,OAAO,GAAG,iBAAiB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IAChD,IAAI,OAAO;QAAE,OAAO,OAAO,CAAC;IAC5B,MAAM,YAAY,GAAG,eAAe,CAClC,QAAQ,EACR,WAAW,EACX,WAAW,CACZ,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,iBAAiB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;IACpD,iBAAiB,CAAC,GAAG,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;IAC9C,OAAO,YAAY,CAAC;AACtB,CAAC"}
|
package/dist/db/models/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./mediaAssets.model"), exports);
|
|
18
|
+
__exportStar(require("./mediaDeclarations.model"), exports);
|
|
18
19
|
__exportStar(require("./mediaEvents.model"), exports);
|
|
19
20
|
__exportStar(require("./mediaFavorites.model"), exports);
|
|
20
21
|
__exportStar(require("./mediaFolders.model"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,sDAAoC;AACpC,yDAAuC;AACvC,uDAAqC;AACrC,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/models/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,4DAA0C;AAC1C,sDAAoC;AACpC,yDAAuC;AACvC,uDAAqC;AACrC,uDAAqC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { MediaAsset } from "../tables";
|
|
2
2
|
export interface MediaMutationOptions {
|
|
3
3
|
touchesAsset?: boolean;
|
|
4
|
+
preserveDetails?: boolean;
|
|
4
5
|
}
|
|
5
6
|
declare const MediaAssetModel_base: {
|
|
6
7
|
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
@@ -15,6 +16,7 @@ declare const MediaAssetModel_base: {
|
|
|
15
16
|
delete(id: string): Promise<number>;
|
|
16
17
|
};
|
|
17
18
|
readonly schemaName: string;
|
|
19
|
+
readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<MediaAsset>;
|
|
18
20
|
fromPlainData(obj: any): MediaAsset;
|
|
19
21
|
fromDatabase(obj: any): MediaAsset | undefined;
|
|
20
22
|
toDatabase(obj: any): Record<string, any>;
|
|
@@ -16,6 +16,25 @@ class MediaAssetModel extends (0, interface_database_decorators_1.BasicDataModel
|
|
|
16
16
|
if (options.touchesAsset !== false)
|
|
17
17
|
(0, common_1.triggerEvent)(instance, "update");
|
|
18
18
|
const payload = MediaAssetModel.toDatabase(instance);
|
|
19
|
+
if (options.preserveDetails) {
|
|
20
|
+
const count = await this.table
|
|
21
|
+
.filter((row) => row
|
|
22
|
+
.key("_id")
|
|
23
|
+
.eq(expected._id)
|
|
24
|
+
.and(row.key("mediaRevision").eq(expected.mediaRevision))
|
|
25
|
+
.and(row.key("isDeleting").default(false).eq(false))
|
|
26
|
+
.and(row.key("name").eq(expected.name))
|
|
27
|
+
.and(row.key("folderId").eq(expected.folderId))
|
|
28
|
+
.and(row
|
|
29
|
+
.key("alt")
|
|
30
|
+
.default("")
|
|
31
|
+
.eq(expected.alt || ""))
|
|
32
|
+
.and(row.key("visibility").eq(expected.visibility))
|
|
33
|
+
.and(row.key("storageKey").eq(expected.storageKey)))
|
|
34
|
+
.update({ ...payload, mediaRevision: (0, node_crypto_1.randomUUID)() })
|
|
35
|
+
.run();
|
|
36
|
+
return count === 1;
|
|
37
|
+
}
|
|
19
38
|
const outcome = await this.table
|
|
20
39
|
.atomicMutation(expected._id, {
|
|
21
40
|
type: "update",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaAssets.model.js","sourceRoot":"","sources":["../../../src/db/models/mediaAssets.model.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,6FAA2E;AAC3E,uFAA0F;AAC1F,sCAAgE;
|
|
1
|
+
{"version":3,"file":"mediaAssets.model.js","sourceRoot":"","sources":["../../../src/db/models/mediaAssets.model.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AAEzC,6FAA2E;AAC3E,uFAA0F;AAC1F,sCAAgE;AAShE,SAAS,eAAe,CAAC,OAA8B;IACrD,IAAI,OAAO,KAAK,SAAS;QACvB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC/D,OAAO,OAAO,KAAK,SAAS,CAAC;AAC/B,CAAC;AAED,MAAa,eAAgB,SAAQ,IAAA,8CAAc,EACjD,mBAAU,EACV,gCAAuB,CACxB;IAEC,KAAK,CAAC,YAAY,CAChB,QAAoB,EACpB,KAA0B,EAC1B,UAAgC,EAAE;QAElC,MAAM,QAAQ,GAAG,eAAe,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtD,IAAI,OAAO,CAAC,YAAY,KAAK,KAAK;YAAE,IAAA,qBAAY,EAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACrE,MAAM,OAAO,GAAG,eAAe,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QACrD,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC;YAC5B,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,KAAK;iBAC3B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CACd,GAAG;iBACA,GAAG,CAAC,KAAK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IAED,KAAK,CAAC,WAAW,CAAC,QAAgB;QAChC,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,MAAM,CACpD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,UAAU,CAC7B,CAAC;IACJ,CAAC;CACF;AAnFD,0CAmFC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { MediaDeclaration, type MediaDeclarationKind } from "../tables";
|
|
2
|
+
declare const MediaDeclarationModel_base: {
|
|
3
|
+
new (database: import("@antelopejs/interface-database").SchemaInstance<any>): {
|
|
4
|
+
readonly table: import("@antelopejs/interface-database").Table<MediaDeclaration>;
|
|
5
|
+
readonly database: import("@antelopejs/interface-database").SchemaInstance<any>;
|
|
6
|
+
get(id: string): PromiseLike<MediaDeclaration | undefined>;
|
|
7
|
+
getBy(index: keyof MediaDeclaration, ...keys: any[]): PromiseLike<MediaDeclaration[]>;
|
|
8
|
+
getAll(): PromiseLike<MediaDeclaration[]>;
|
|
9
|
+
insert(obj: import("@antelopejs/interface-database-decorators").DeepPartial<MediaDeclaration> | import("@antelopejs/interface-database-decorators").DeepPartial<MediaDeclaration>[], options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<string[]>;
|
|
10
|
+
update(id: string, obj: import("@antelopejs/interface-database-decorators").DeepPartial<MediaDeclaration>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
11
|
+
update(obj: import("@antelopejs/interface-database-decorators").DeepPartial<MediaDeclaration>, options?: import("@antelopejs/interface-database-decorators").ValidateOptions): Promise<number>;
|
|
12
|
+
delete(id: string): Promise<number>;
|
|
13
|
+
};
|
|
14
|
+
readonly schemaName: string;
|
|
15
|
+
readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<MediaDeclaration>;
|
|
16
|
+
fromPlainData(obj: any): MediaDeclaration;
|
|
17
|
+
fromDatabase(obj: any): MediaDeclaration | undefined;
|
|
18
|
+
toDatabase(obj: any): Record<string, any>;
|
|
19
|
+
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
20
|
+
};
|
|
21
|
+
export declare class MediaDeclarationModel extends MediaDeclarationModel_base {
|
|
22
|
+
findByKey(kind: MediaDeclarationKind, key: string): Promise<MediaDeclaration | undefined>;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MediaDeclarationModel = void 0;
|
|
4
|
+
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
+
const tables_1 = require("../tables");
|
|
6
|
+
class MediaDeclarationModel extends (0, interface_database_decorators_1.BasicDataModel)(tables_1.MediaDeclaration, tables_1.MEDIA_DECLARATIONS_TABLE_NAME) {
|
|
7
|
+
async findByKey(kind, key) {
|
|
8
|
+
const rows = await this.getBy("key", key);
|
|
9
|
+
return rows.find((row) => row.kind === kind);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.MediaDeclarationModel = MediaDeclarationModel;
|
|
13
|
+
//# sourceMappingURL=mediaDeclarations.model.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mediaDeclarations.model.js","sourceRoot":"","sources":["../../../src/db/models/mediaDeclarations.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,sCAImB;AAEnB,MAAa,qBAAsB,SAAQ,IAAA,8CAAc,EACvD,yBAAgB,EAChB,sCAA6B,CAC9B;IACC,KAAK,CAAC,SAAS,CACb,IAA0B,EAC1B,GAAW;QAEX,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;QAC1C,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IAC/C,CAAC;CACF;AAXD,sDAWC"}
|
|
@@ -12,6 +12,7 @@ declare const MediaEventModel_base: {
|
|
|
12
12
|
delete(id: string): Promise<number>;
|
|
13
13
|
};
|
|
14
14
|
readonly schemaName: string;
|
|
15
|
+
readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<MediaEvent>;
|
|
15
16
|
fromPlainData(obj: any): MediaEvent;
|
|
16
17
|
fromDatabase(obj: any): MediaEvent | undefined;
|
|
17
18
|
toDatabase(obj: any): Record<string, any>;
|
|
@@ -12,6 +12,7 @@ declare const MediaFavoriteModel_base: {
|
|
|
12
12
|
delete(id: string): Promise<number>;
|
|
13
13
|
};
|
|
14
14
|
readonly schemaName: string;
|
|
15
|
+
readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<MediaFavorite>;
|
|
15
16
|
fromPlainData(obj: any): MediaFavorite;
|
|
16
17
|
fromDatabase(obj: any): MediaFavorite | undefined;
|
|
17
18
|
toDatabase(obj: any): Record<string, any>;
|
|
@@ -12,12 +12,16 @@ declare const MediaFolderModel_base: {
|
|
|
12
12
|
delete(id: string): Promise<number>;
|
|
13
13
|
};
|
|
14
14
|
readonly schemaName: string;
|
|
15
|
+
readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<MediaFolder>;
|
|
15
16
|
fromPlainData(obj: any): MediaFolder;
|
|
16
17
|
fromDatabase(obj: any): MediaFolder | undefined;
|
|
17
18
|
toDatabase(obj: any): Record<string, any>;
|
|
18
19
|
validate(obj: unknown, options?: import("@antelopejs/interface-database-decorators").ValidateInputOptions): import("@antelopejs/interface-database-decorators").ValidationResult;
|
|
19
20
|
};
|
|
20
21
|
export declare class MediaFolderModel extends MediaFolderModel_base {
|
|
22
|
+
private whileAsObserved;
|
|
23
|
+
compareDeclared(expected: MediaFolder, patch: Partial<MediaFolder>): Promise<boolean>;
|
|
24
|
+
deleteDeclared(expected: MediaFolder): Promise<boolean>;
|
|
21
25
|
getChildren(parentId: string): Promise<MediaFolder[]>;
|
|
22
26
|
getByBinding(binding: string): Promise<MediaFolder | undefined>;
|
|
23
27
|
getDescendants(folderId: string): Promise<MediaFolder[]>;
|
|
@@ -2,8 +2,37 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.MediaFolderModel = void 0;
|
|
4
4
|
const interface_database_decorators_1 = require("@antelopejs/interface-database-decorators");
|
|
5
|
+
const common_1 = require("@antelopejs/interface-database-decorators/modifiers/common");
|
|
5
6
|
const tables_1 = require("../tables");
|
|
6
7
|
class MediaFolderModel extends (0, interface_database_decorators_1.BasicDataModel)(tables_1.MediaFolder, tables_1.MEDIA_FOLDERS_TABLE_NAME) {
|
|
8
|
+
whileAsObserved(expected) {
|
|
9
|
+
return this.table.filter((row) => row
|
|
10
|
+
.key("_id")
|
|
11
|
+
.eq(expected._id)
|
|
12
|
+
.and(row.key("name").eq(expected.name))
|
|
13
|
+
.and(row
|
|
14
|
+
.key("parentId")
|
|
15
|
+
.default("")
|
|
16
|
+
.eq(expected.parentId || ""))
|
|
17
|
+
.and(row.key("path").eq(expected.path))
|
|
18
|
+
.and(row.key("visibility").eq(expected.visibility))
|
|
19
|
+
.and(row
|
|
20
|
+
.key("json_acl")
|
|
21
|
+
.default("")
|
|
22
|
+
.eq(expected.json_acl || "")));
|
|
23
|
+
}
|
|
24
|
+
async compareDeclared(expected, patch) {
|
|
25
|
+
const instance = MediaFolderModel.fromPlainData(patch);
|
|
26
|
+
(0, common_1.triggerEvent)(instance, "update");
|
|
27
|
+
const count = await this.whileAsObserved(expected)
|
|
28
|
+
.update(MediaFolderModel.toDatabase(instance))
|
|
29
|
+
.run();
|
|
30
|
+
return count === 1;
|
|
31
|
+
}
|
|
32
|
+
async deleteDeclared(expected) {
|
|
33
|
+
const count = await this.whileAsObserved(expected).delete().run();
|
|
34
|
+
return count === 1;
|
|
35
|
+
}
|
|
7
36
|
async getChildren(parentId) {
|
|
8
37
|
return this.getBy("parentId", parentId);
|
|
9
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mediaFolders.model.js","sourceRoot":"","sources":["../../../src/db/models/mediaFolders.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,sCAAkE;AAElE,MAAa,gBAAiB,SAAQ,IAAA,8CAAc,EAClD,oBAAW,EACX,iCAAwB,CACzB;
|
|
1
|
+
{"version":3,"file":"mediaFolders.model.js","sourceRoot":"","sources":["../../../src/db/models/mediaFolders.model.ts"],"names":[],"mappings":";;;AAAA,6FAA2E;AAC3E,uFAA0F;AAC1F,sCAAkE;AAElE,MAAa,gBAAiB,SAAQ,IAAA,8CAAc,EAClD,oBAAW,EACX,iCAAwB,CACzB;IAES,eAAe,CAAC,QAAqB;QAC3C,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAC/B,GAAG;aACA,GAAG,CAAC,KAAK,CAAC;aACV,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC;aAChB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aACtC,GAAG,CACF,GAAG;aACA,GAAG,CAAC,UAAU,CAAC;aACf,OAAO,CAAC,EAAE,CAAC;aACX,EAAE,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC,CAC/B;aACA,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aACtC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;aAClD,GAAG,CACF,GAAG;aACA,GAAG,CAAC,UAAU,CAAC;aACf,OAAO,CAAC,EAAE,CAAC;aACX,EAAE,CAAC,QAAQ,CAAC,QAAQ,IAA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,GAAG,EAAE,CAAC;QACT,OAAO,OAAO;aACX,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,gBAAgB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;aACtD,MAAM,CAAC,CAAC,MAAM,EAAyB,EAAE,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC;IACrE,CAAC;CACF;AAnED,4CAmEC"}
|
|
@@ -12,6 +12,7 @@ declare const MediaUploadModel_base: {
|
|
|
12
12
|
delete(id: string): Promise<number>;
|
|
13
13
|
};
|
|
14
14
|
readonly schemaName: string;
|
|
15
|
+
readonly tableClass: import("@antelopejs/interface-database-decorators").Constructible<MediaUpload>;
|
|
15
16
|
fromPlainData(obj: any): MediaUpload;
|
|
16
17
|
fromDatabase(obj: any): MediaUpload | undefined;
|
|
17
18
|
toDatabase(obj: any): Record<string, any>;
|
package/dist/db/tables/index.js
CHANGED
|
@@ -15,6 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./mediaAssets.table"), exports);
|
|
18
|
+
__exportStar(require("./mediaDeclarations.table"), exports);
|
|
18
19
|
__exportStar(require("./mediaEvents.table"), exports);
|
|
19
20
|
__exportStar(require("./mediaFavorites.table"), exports);
|
|
20
21
|
__exportStar(require("./mediaFolders.table"), exports);
|