@antelopejs/dms-media 0.6.0 → 0.6.2
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 +18 -3
- package/dist/acl/entries.js +1 -2
- package/dist/acl/entries.js.map +1 -1
- package/dist/bindings.js +1 -3
- package/dist/bindings.js.map +1 -1
- package/dist/db/models/mediaFolders.model.d.ts +0 -3
- package/dist/db/models/mediaFolders.model.js +0 -29
- package/dist/db/models/mediaFolders.model.js.map +1 -1
- package/dist/db/tables/mediaDeclarations.table.d.ts +0 -4
- package/dist/db/tables/mediaDeclarations.table.js +0 -16
- package/dist/db/tables/mediaDeclarations.table.js.map +1 -1
- package/dist/declared/assets.d.ts +0 -2
- package/dist/declared/assets.js +12 -140
- package/dist/declared/assets.js.map +1 -1
- package/dist/declared/folders.d.ts +1 -5
- package/dist/declared/folders.js +17 -82
- package/dist/declared/folders.js.map +1 -1
- package/dist/declared/index.d.ts +0 -2
- package/dist/declared/index.js +0 -2
- package/dist/declared/index.js.map +1 -1
- package/dist/declared/records.d.ts +4 -32
- package/dist/declared/records.js +6 -35
- package/dist/declared/records.js.map +1 -1
- package/dist/derivatives.js +14 -23
- package/dist/derivatives.js.map +1 -1
- package/dist/guards.d.ts +4 -0
- package/dist/guards.js +19 -0
- package/dist/guards.js.map +1 -0
- package/dist/implementations/interface-dms-media/index.d.ts +1 -3
- package/dist/implementations/interface-dms-media/index.js +0 -2
- package/dist/implementations/interface-dms-media/index.js.map +1 -1
- package/dist/library/activity.js +7 -5
- package/dist/library/activity.js.map +1 -1
- package/dist/library/batches.js +6 -3
- package/dist/library/batches.js.map +1 -1
- package/dist/library/events.js +4 -4
- package/dist/library/events.js.map +1 -1
- package/dist/library/module-readout.js +5 -2
- package/dist/library/module-readout.js.map +1 -1
- package/dist/library/realtime.js.map +1 -1
- package/dist/pages/activity.js +1 -1
- package/dist/pages/activity.js.map +1 -1
- package/dist/routes/media/assets.d.ts +1 -1
- package/dist/routes/media/assets.js +5 -5
- package/dist/routes/media/assets.js.map +1 -1
- package/dist/routes/media/bulk.js +17 -13
- package/dist/routes/media/bulk.js.map +1 -1
- package/dist/routes/media/delivery-headers.js +9 -9
- package/dist/routes/media/delivery-headers.js.map +1 -1
- package/dist/routes/media/delivery-stream.js +7 -21
- package/dist/routes/media/delivery-stream.js.map +1 -1
- package/dist/routes/media/delivery.js.map +1 -1
- package/dist/routes/media/manage.js.map +1 -1
- package/dist/routes/media/transform.js +13 -8
- package/dist/routes/media/transform.js.map +1 -1
- package/dist/routes/media/upload.js +2 -5
- package/dist/routes/media/upload.js.map +1 -1
- package/dist/test/antelope.test.js +17 -16
- package/dist/test/antelope.test.js.map +1 -1
- package/dist/test/helpers/folders.d.ts +27 -0
- package/dist/test/helpers/folders.js +15 -0
- package/dist/test/helpers/folders.js.map +1 -1
- package/dist/test/helpers/pages.js +10 -6
- package/dist/test/helpers/pages.js.map +1 -1
- package/dist/test/helpers/permissions-world.d.ts +98 -0
- package/dist/test/helpers/permissions-world.js +205 -0
- package/dist/test/helpers/permissions-world.js.map +1 -0
- package/dist/test/helpers/prototype.d.ts +1 -0
- package/dist/test/helpers/prototype.js +11 -0
- package/dist/test/helpers/prototype.js.map +1 -0
- package/dist/test/integration/derivative-sweep-query.test.js +13 -16
- package/dist/test/integration/derivative-sweep-query.test.js.map +1 -1
- package/dist/test/integration/folder-query.test.js +5 -9
- package/dist/test/integration/folder-query.test.js.map +1 -1
- package/dist/test/integration/media-bindings.test.js +2 -2
- package/dist/test/integration/media-bindings.test.js.map +1 -1
- package/dist/test/integration/media-cleanup.test.js +14 -17
- package/dist/test/integration/media-cleanup.test.js.map +1 -1
- package/dist/test/integration/media-declared-content.test.js +19 -318
- package/dist/test/integration/media-declared-content.test.js.map +1 -1
- package/dist/test/integration/media-delivery-editing.test.js +7 -5
- package/dist/test/integration/media-delivery-editing.test.js.map +1 -1
- package/dist/test/integration/media-delivery.test.js +19 -5
- package/dist/test/integration/media-delivery.test.js.map +1 -1
- package/dist/test/integration/media-explorer-writes.test.js +2 -2
- package/dist/test/integration/media-explorer-writes.test.js.map +1 -1
- package/dist/test/integration/media-guards.test.js +18 -7
- package/dist/test/integration/media-guards.test.js.map +1 -1
- package/dist/test/integration/media-library.test.js +1 -1
- package/dist/test/integration/media-library.test.js.map +1 -1
- package/dist/test/integration/media-linked-subfolders.test.js +6 -6
- package/dist/test/integration/media-linked-subfolders.test.js.map +1 -1
- package/dist/test/integration/media-member-access.test.js +2 -5
- package/dist/test/integration/media-member-access.test.js.map +1 -1
- package/dist/test/integration/media-permissions.test.js +142 -473
- package/dist/test/integration/media-permissions.test.js.map +1 -1
- package/dist/test/integration/media-project-field.test.js +3 -5
- package/dist/test/integration/media-project-field.test.js.map +1 -1
- package/dist/test/integration/media-search-query.test.js +11 -16
- package/dist/test/integration/media-search-query.test.js.map +1 -1
- package/dist/test/integration/media-storage-origin-unreachable.test.js +80 -0
- package/dist/test/integration/media-storage-origin-unreachable.test.js.map +1 -0
- package/dist/test/integration/media-upload-policy.test.js +2 -2
- package/dist/test/integration/media-upload-policy.test.js.map +1 -1
- package/dist/test/integration/permissions-management.d.ts +2 -0
- package/dist/test/integration/permissions-management.js +189 -0
- package/dist/test/integration/permissions-management.js.map +1 -0
- package/dist/test/unit/acl/entries.test.js +2 -1
- package/dist/test/unit/acl/entries.test.js.map +1 -1
- package/dist/test/unit/acl/resolver.test.js +10 -3
- package/dist/test/unit/acl/resolver.test.js.map +1 -1
- package/dist/test/unit/declared.test.js +0 -66
- package/dist/test/unit/declared.test.js.map +1 -1
- package/dist/test/unit/library/fixtures.d.ts +1 -1
- package/dist/test/unit/library/fixtures.js +6 -1
- package/dist/test/unit/library/fixtures.js.map +1 -1
- package/dist/test/unit/library/library.test.js +0 -1
- package/dist/test/unit/library/library.test.js.map +1 -1
- package/dist/test/unit/library/realtime.test.js +1 -0
- package/dist/test/unit/library/realtime.test.js.map +1 -1
- package/dist/test/unit/library/search-facets.test.js +2 -2
- package/dist/test/unit/library/search-facets.test.js.map +1 -1
- package/dist/test/unit/pages/toolbar.test.js +24 -7
- package/dist/test/unit/pages/toolbar.test.js.map +1 -1
- package/dist/test/unit/routes/dto.test.js +7 -6
- package/dist/test/unit/routes/dto.test.js.map +1 -1
- package/dist/test/unit/routes/file-page.test.js +5 -7
- package/dist/test/unit/routes/file-page.test.js.map +1 -1
- package/dist/test/unit/routes/preset-row.test.js +2 -1
- package/dist/test/unit/routes/preset-row.test.js.map +1 -1
- package/dist/transform.js +6 -6
- package/dist/transform.js.map +1 -1
- package/dist/upload-checks.d.ts +8 -2
- package/dist/upload-checks.js.map +1 -1
- package/dist/upload-policy.js +8 -8
- package/dist/upload-policy.js.map +1 -1
- package/dist/validation/declared.schema.d.ts +7 -36
- package/dist/validation/declared.schema.js +15 -20
- package/dist/validation/declared.schema.js.map +1 -1
- package/dist/validation/media.schema.d.ts +1 -1
- package/dist/validation/media.schema.js +2 -2
- package/dist/validation/media.schema.js.map +1 -1
- package/frontend-vue/app/build/imageEditor/editorShapes.ts +118 -0
- package/frontend-vue/app/build/imageEditor/useEditorSaving.ts +86 -0
- package/frontend-vue/app/build/library/libraryActions.ts +444 -0
- package/frontend-vue/app/build/library/libraryCore.ts +136 -0
- package/frontend-vue/app/components/ImageEditor.vue +22 -179
- package/frontend-vue/app/composables/library/useMediaLibrary.ts +3 -575
- package/frontend-vue/app/composables/useMediaApi.ts +21 -5
- package/frontend-vue/build/backend-boundary.ts +122 -0
- package/frontend-vue/dms.frontend.build.ts +3 -0
- package/frontend-vue/eslint.config.mjs +13 -0
- package/frontend-vue/package.json +3 -1
- package/frontend-vue/pnpm-lock.yaml +217 -61
- package/frontend-vue/tests/backend-boundary.test.ts +203 -0
- package/frontend-vue/tests/mediaPreviews.test.ts +39 -0
- package/package.json +10 -16
- package/skills/dms-media/SKILL.md +12 -24
- package/skills/dms-media/cases.json +38 -0
- package/src/acl/entries.ts +6 -4
- package/src/bindings.ts +3 -3
- package/src/db/models/mediaFolders.model.ts +0 -44
- package/src/db/tables/mediaDeclarations.table.ts +3 -19
- package/src/declared/assets.ts +19 -210
- package/src/declared/folders.ts +25 -138
- package/src/declared/index.ts +0 -2
- package/src/declared/records.ts +17 -90
- package/src/derivatives.ts +17 -23
- package/src/guards.ts +19 -0
- package/src/implementations/interface-dms-media/index.ts +1 -8
- package/src/library/activity.ts +17 -9
- package/src/library/batches.ts +12 -9
- package/src/library/events.ts +7 -4
- package/src/library/module-readout.ts +6 -2
- package/src/library/realtime.ts +5 -1
- package/src/library/zip.ts +1 -1
- package/src/pages/activity.ts +6 -2
- package/src/routes/media/assets.ts +4 -3
- package/src/routes/media/bulk.ts +16 -14
- package/src/routes/media/delivery-headers.ts +9 -12
- package/src/routes/media/delivery-stream.ts +13 -28
- package/src/routes/media/delivery.ts +4 -2
- package/src/routes/media/manage.ts +4 -6
- package/src/routes/media/transform.ts +27 -23
- package/src/routes/media/upload.ts +4 -6
- package/src/test/antelope.test.ts +25 -21
- package/src/test/helpers/folders.ts +22 -0
- package/src/test/helpers/pages.ts +12 -5
- package/src/test/helpers/permissions-world.ts +326 -0
- package/src/test/helpers/prototype.ts +12 -0
- package/src/test/integration/derivative-sweep-query.test.ts +19 -21
- package/src/test/integration/folder-query.test.ts +11 -11
- package/src/test/integration/media-bindings.test.ts +7 -7
- package/src/test/integration/media-cleanup.test.ts +25 -37
- package/src/test/integration/media-declared-content.test.ts +35 -379
- package/src/test/integration/media-delivery-editing.test.ts +11 -7
- package/src/test/integration/media-delivery.test.ts +29 -8
- package/src/test/integration/media-explorer-writes.test.ts +2 -7
- package/src/test/integration/media-guards.test.ts +21 -7
- package/src/test/integration/media-library.test.ts +1 -1
- package/src/test/integration/media-linked-subfolders.test.ts +12 -21
- package/src/test/integration/media-member-access.test.ts +5 -9
- package/src/test/integration/media-permissions.test.ts +56 -570
- package/src/test/integration/media-project-field.test.ts +5 -7
- package/src/test/integration/media-search-query.test.ts +16 -20
- package/src/test/integration/media-storage-origin-unreachable.test.ts +111 -0
- package/src/test/integration/media-upload-policy.test.ts +2 -8
- package/src/test/integration/permissions-management.ts +292 -0
- package/src/test/unit/acl/entries.test.ts +2 -1
- package/src/test/unit/acl/resolver.test.ts +19 -7
- package/src/test/unit/declared.test.ts +0 -87
- package/src/test/unit/library/fixtures.ts +9 -3
- package/src/test/unit/library/library.test.ts +1 -7
- package/src/test/unit/library/realtime.test.ts +2 -0
- package/src/test/unit/library/search-facets.test.ts +2 -2
- package/src/test/unit/pages/toolbar.test.ts +42 -17
- package/src/test/unit/routes/dto.test.ts +7 -6
- package/src/test/unit/routes/file-page.test.ts +10 -9
- package/src/test/unit/routes/preset-row.test.ts +2 -2
- package/src/transform.ts +6 -6
- package/src/upload-checks.ts +12 -3
- package/src/upload-policy.ts +8 -8
- package/src/validation/declared.schema.ts +17 -25
- package/src/validation/media.schema.ts +6 -6
- package/dist/declared/readiness.d.ts +0 -2
- package/dist/declared/readiness.js +0 -52
- package/dist/declared/readiness.js.map +0 -1
- package/dist/declared/retire.d.ts +0 -3
- package/dist/declared/retire.js +0 -118
- package/dist/declared/retire.js.map +0 -1
- package/dist/test/integration/media-declared-retire.test.js +0 -186
- package/dist/test/integration/media-declared-retire.test.js.map +0 -1
- package/frontend-vue/tests/engines.test.ts +0 -20
- package/frontend-vue/tests/locales.test.ts +0 -61
- package/src/declared/readiness.ts +0 -64
- package/src/declared/retire.ts +0 -206
- package/src/test/integration/media-declared-retire.test.ts +0 -257
- /package/dist/test/integration/{media-declared-retire.test.d.ts → media-storage-origin-unreachable.test.d.ts} +0 -0
|
@@ -2,8 +2,8 @@ import { Query } from "@antelopejs/interface-database";
|
|
|
2
2
|
import { GetModel } from "@antelopejs/interface-database-decorators";
|
|
3
3
|
import { expect } from "chai";
|
|
4
4
|
import { MediaFolder, MediaFolderModel } from "../../db";
|
|
5
|
+
import { patchMethod } from "../helpers/prototype";
|
|
5
6
|
|
|
6
|
-
type RunQuery = (this: Query<unknown>) => Promise<unknown>;
|
|
7
7
|
const TENANT = "folder-query-a";
|
|
8
8
|
const OTHER = "folder-query-b";
|
|
9
9
|
|
|
@@ -71,16 +71,16 @@ describe("[integration] folder query pushdown", () => {
|
|
|
71
71
|
|
|
72
72
|
it("limits a binding lookup before transfer and keeps the existing first match", async () => {
|
|
73
73
|
const expected = (await model.getBy("binding", "shared"))[0];
|
|
74
|
-
const original = Object.getOwnPropertyDescriptor(Query.prototype, "run")!;
|
|
75
|
-
const run = original.value as RunQuery;
|
|
76
74
|
const stages: string[][] = [];
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
75
|
+
const restore = patchMethod<Query<unknown>, "run">(
|
|
76
|
+
Query.prototype,
|
|
77
|
+
"run",
|
|
78
|
+
(run) =>
|
|
79
|
+
function (this: Query<unknown>) {
|
|
80
|
+
stages.push(this.stages.slice(3).map((stage) => stage.stage));
|
|
81
|
+
return run.call(this);
|
|
82
|
+
},
|
|
83
|
+
);
|
|
84
84
|
try {
|
|
85
85
|
expect(await model.getByBinding("shared")).to.deep.equal(expected);
|
|
86
86
|
expect(await model.getByBinding("missing")).to.equal(undefined);
|
|
@@ -89,7 +89,7 @@ describe("[integration] folder query pushdown", () => {
|
|
|
89
89
|
["getAll", "slice"],
|
|
90
90
|
]);
|
|
91
91
|
} finally {
|
|
92
|
-
|
|
92
|
+
restore();
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
});
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "@antelopejs/interface-dms/page";
|
|
7
7
|
import { CustomComponent } from "@antelopejs/interface-dms/base/custom";
|
|
8
8
|
import type { AxiosInstance } from "axios";
|
|
9
|
-
import { expect } from "chai";
|
|
9
|
+
import { assert, expect } from "chai";
|
|
10
10
|
import { RegisterAssetBinding } from "@antelopejs/interface-dms-media";
|
|
11
11
|
import { readFolderAcl } from "../helpers/folders";
|
|
12
12
|
import { authorizedClient } from "../helpers/http";
|
|
@@ -66,13 +66,13 @@ describe("[integration] media bindings — linked folder provisioning", () => {
|
|
|
66
66
|
const contentRoot = folders.find(
|
|
67
67
|
(folder) => folder.name === "Content" && folder.parentId === null,
|
|
68
68
|
);
|
|
69
|
-
|
|
70
|
-
contentRootId =
|
|
69
|
+
assert.isDefined(contentRoot, "content root");
|
|
70
|
+
contentRootId = contentRoot.id;
|
|
71
71
|
const linked = folders.find((folder) => folder.name === "Article covers");
|
|
72
|
-
|
|
73
|
-
expect(
|
|
74
|
-
expect(
|
|
75
|
-
linkedFolderId =
|
|
72
|
+
assert.isDefined(linked, "linked folder");
|
|
73
|
+
expect(linked.parentId).to.equal(contentRootId);
|
|
74
|
+
expect(linked.bound).to.equal(true);
|
|
75
|
+
linkedFolderId = linked.id;
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
it("does not duplicate provisioned folders on later requests", async () => {
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
|
-
import {
|
|
3
|
-
type AtomicMutation,
|
|
4
|
-
type AtomicMutationOutcome,
|
|
5
|
-
Query,
|
|
6
|
-
Table,
|
|
7
|
-
} from "@antelopejs/interface-database";
|
|
2
|
+
import { type AtomicMutation, Table } from "@antelopejs/interface-database";
|
|
8
3
|
import { GetModel } from "@antelopejs/interface-database-decorators";
|
|
9
4
|
import * as storage from "@antelopejs/interface-file-storage";
|
|
10
5
|
import { expect } from "chai";
|
|
@@ -22,15 +17,10 @@ import { commitDerivative, uploadStorageBytes } from "../../derivatives";
|
|
|
22
17
|
import { presetCacheKey } from "../../presets";
|
|
23
18
|
import { parseDerivatives } from "../../routes/media/storage-keys";
|
|
24
19
|
import { applyImageTransform } from "../../transform";
|
|
20
|
+
import { patchMethod } from "../helpers/prototype";
|
|
25
21
|
|
|
26
22
|
const TENANT = "media-cleanup-concurrency";
|
|
27
23
|
const OLD_DATE = new Date("2020-01-01T00:00:00Z");
|
|
28
|
-
type AtomicMediaMutation = (
|
|
29
|
-
this: Table<MediaAsset>,
|
|
30
|
-
key: string,
|
|
31
|
-
request: AtomicMutation<MediaAsset>,
|
|
32
|
-
) => Query<AtomicMutationOutcome>;
|
|
33
|
-
|
|
34
24
|
function upload(): Promise<string> {
|
|
35
25
|
return uploadStorageBytes(
|
|
36
26
|
Buffer.from("cleanup"),
|
|
@@ -78,21 +68,18 @@ describe("[integration] replayable media cleanup", () => {
|
|
|
78
68
|
let model: MediaAssetModel;
|
|
79
69
|
let asset: MediaAsset;
|
|
80
70
|
let compare: MediaAssetModel["compareMedia"];
|
|
81
|
-
let
|
|
71
|
+
let restoreMutation: () => void = () => undefined;
|
|
82
72
|
|
|
83
73
|
beforeEach(async () => {
|
|
84
74
|
model = GetModel(MediaAssetModel, TENANT);
|
|
85
75
|
asset = await insertAsset(model);
|
|
86
76
|
compare = model.compareMedia.bind(model);
|
|
87
|
-
|
|
88
|
-
Table.prototype,
|
|
89
|
-
"atomicMutation",
|
|
90
|
-
)!;
|
|
77
|
+
restoreMutation = () => undefined;
|
|
91
78
|
});
|
|
92
79
|
|
|
93
80
|
afterEach(async () => {
|
|
94
81
|
model.compareMedia = compare;
|
|
95
|
-
|
|
82
|
+
restoreMutation();
|
|
96
83
|
await deleteMediaAsset(model, asset._id);
|
|
97
84
|
});
|
|
98
85
|
|
|
@@ -160,24 +147,25 @@ describe("[integration] replayable media cleanup", () => {
|
|
|
160
147
|
const key = await upload();
|
|
161
148
|
await commitDerivative(model, asset, "obsolete", key);
|
|
162
149
|
let calls = 0;
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
150
|
+
restoreMutation = patchMethod<Table<unknown>, "atomicMutation">(
|
|
151
|
+
Table.prototype,
|
|
152
|
+
"atomicMutation",
|
|
153
|
+
(original) =>
|
|
154
|
+
function (
|
|
155
|
+
this: Table<unknown>,
|
|
156
|
+
id: string,
|
|
157
|
+
request: AtomicMutation<unknown>,
|
|
158
|
+
) {
|
|
159
|
+
const query = original.call(this, id, request);
|
|
160
|
+
const run = query.run.bind(query);
|
|
161
|
+
query.run = async () => {
|
|
162
|
+
calls++;
|
|
163
|
+
await run();
|
|
164
|
+
return "unknown";
|
|
165
|
+
};
|
|
166
|
+
return query;
|
|
167
|
+
},
|
|
168
|
+
);
|
|
181
169
|
const error = await sweepAssetDerivatives(model, asset).catch(
|
|
182
170
|
(failure: unknown) => failure,
|
|
183
171
|
);
|
|
@@ -185,7 +173,7 @@ describe("[integration] replayable media cleanup", () => {
|
|
|
185
173
|
expect(calls).to.equal(1);
|
|
186
174
|
expect(await storage.FileExists(key)).to.equal(true);
|
|
187
175
|
expect(retiredFiles((await model.get(asset._id))!)).to.deep.equal([key]);
|
|
188
|
-
|
|
176
|
+
restoreMutation();
|
|
189
177
|
await sweepAssetDerivatives(model, asset);
|
|
190
178
|
expect(await storage.FileExists(key)).to.equal(false);
|
|
191
179
|
});
|