@antelopejs/dms-media 0.5.1 → 0.6.1
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 +3 -3
- 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 +14 -80
- 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 +2 -30
- package/dist/declared/records.js +3 -33
- package/dist/declared/records.js.map +1 -1
- package/dist/derivatives.js +5 -17
- package/dist/derivatives.js.map +1 -1
- package/dist/frontend-module.d.ts +4 -0
- package/dist/frontend-module.js +24 -0
- package/dist/frontend-module.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/index.d.ts +1 -3
- package/dist/index.js +3 -19
- package/dist/index.js.map +1 -1
- package/dist/library/realtime.js +8 -1
- package/dist/library/realtime.js.map +1 -1
- package/dist/pages/activity.d.ts +1 -0
- package/dist/pages/activity.js +3 -0
- package/dist/pages/activity.js.map +1 -1
- package/dist/pages/overview.d.ts +1 -0
- package/dist/pages/overview.js +3 -2
- package/dist/pages/overview.js.map +1 -1
- package/dist/pages/toolbar.d.ts +3 -0
- package/dist/pages/toolbar.js +19 -0
- package/dist/pages/toolbar.js.map +1 -0
- package/dist/pages/uploads.d.ts +1 -0
- package/dist/pages/uploads.js +4 -0
- package/dist/pages/uploads.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/manage.d.ts +23 -0
- package/dist/routes/media/manage.js +7 -4
- package/dist/routes/media/manage.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 +9 -4
- package/dist/test/antelope.test.js.map +1 -1
- package/dist/test/integration/media-activity-overview.test.js +6 -0
- package/dist/test/integration/media-activity-overview.test.js.map +1 -1
- package/dist/test/integration/media-declared-content.test.js +17 -317
- package/dist/test/integration/media-declared-content.test.js.map +1 -1
- package/dist/test/integration/media-linked-subfolders.test.js +2 -2
- package/dist/test/integration/media-linked-subfolders.test.js.map +1 -1
- package/dist/test/integration/media-storage-origin-unreachable.test.js +79 -0
- package/dist/test/integration/media-storage-origin-unreachable.test.js.map +1 -0
- package/dist/test/unit/declared.test.js +0 -66
- package/dist/test/unit/declared.test.js.map +1 -1
- package/dist/test/unit/library/realtime.test.d.ts +1 -0
- package/dist/test/unit/library/realtime.test.js +44 -0
- package/dist/test/unit/library/realtime.test.js.map +1 -0
- package/dist/test/unit/pages/toolbar.test.d.ts +1 -0
- package/dist/test/unit/pages/toolbar.test.js +64 -0
- package/dist/test/unit/pages/toolbar.test.js.map +1 -0
- package/dist/test/unit/routes/preset-row.test.d.ts +1 -0
- package/dist/test/unit/routes/preset-row.test.js +36 -0
- package/dist/test/unit/routes/preset-row.test.js.map +1 -0
- package/dist/validation/declared.schema.d.ts +7 -36
- package/dist/validation/declared.schema.js +1 -12
- package/dist/validation/declared.schema.js.map +1 -1
- package/frontend-vue/app/components/Explorer.vue +2 -0
- package/frontend-vue/app/components/FirstRun.vue +3 -1
- package/frontend-vue/app/components/PresetCards.vue +28 -5
- package/frontend-vue/app/components/RecentFiles.vue +11 -5
- package/frontend-vue/app/components/UploadQueue.vue +3 -1
- package/frontend-vue/app/components/UploadStrip.vue +3 -1
- package/frontend-vue/app/components/explorer/ExplorerDetailsDrawer.vue +10 -0
- package/frontend-vue/app/components/explorer/ExplorerInspector.vue +19 -14
- package/frontend-vue/app/components/explorer/ExplorerShell.vue +1 -11
- package/frontend-vue/app/composables/library/useExplorerCommands.ts +7 -1
- package/frontend-vue/app/composables/library/useExplorerDetailsDrawer.ts +75 -0
- package/frontend-vue/i18n/locales/media-en-GB.json +9 -2
- package/frontend-vue/i18n/locales/media-fr-FR.json +9 -2
- package/frontend-vue/package.json +1 -1
- package/frontend-vue/tests/detailsDrawer.test.ts +150 -0
- package/frontend-vue/tests/fixtures/serverRender.ts +70 -0
- package/frontend-vue/tests/locales.test.ts +17 -0
- package/frontend-vue/tests/serverRender.test.ts +47 -2
- package/package.json +10 -9
- package/skills/dms-media/SKILL.md +17 -24
- 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 +22 -135
- package/src/declared/index.ts +0 -2
- package/src/declared/records.ts +8 -82
- package/src/derivatives.ts +7 -17
- package/src/frontend-module.ts +35 -0
- package/src/implementations/interface-dms-media/index.ts +1 -8
- package/src/index.ts +4 -28
- package/src/library/realtime.ts +12 -3
- package/src/pages/activity.ts +4 -0
- package/src/pages/overview.ts +4 -3
- package/src/pages/toolbar.ts +28 -0
- package/src/pages/uploads.ts +5 -0
- package/src/routes/media/delivery-stream.ts +12 -28
- package/src/routes/media/manage.ts +17 -4
- package/src/routes/media/upload.ts +4 -6
- package/src/test/antelope.test.ts +13 -4
- package/src/test/integration/media-activity-overview.test.ts +5 -0
- package/src/test/integration/media-declared-content.test.ts +17 -360
- package/src/test/integration/media-linked-subfolders.test.ts +2 -2
- package/src/test/integration/media-storage-origin-unreachable.test.ts +110 -0
- package/src/test/unit/declared.test.ts +0 -87
- package/src/test/unit/library/realtime.test.ts +55 -0
- package/src/test/unit/pages/toolbar.test.ts +92 -0
- package/src/test/unit/routes/preset-row.test.ts +39 -0
- package/src/validation/declared.schema.ts +0 -13
- 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/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
|
@@ -1,75 +1,12 @@
|
|
|
1
1
|
import { setTimeout as delay } from "node:timers/promises";
|
|
2
2
|
import { expect } from "chai";
|
|
3
3
|
import {
|
|
4
|
-
hashState,
|
|
5
|
-
judgeDeclaredRow,
|
|
6
|
-
judgeMemberChange,
|
|
7
4
|
MediaDeclarationError,
|
|
8
5
|
parseDeclaration,
|
|
9
6
|
withDeclarationLock,
|
|
10
7
|
} from "../../declared/records";
|
|
11
|
-
import { writeWhenReachable } from "../../declared/readiness";
|
|
12
|
-
import type { MediaDeclaration } from "../../db";
|
|
13
8
|
import { declaredFolderSchema } from "../../validation/declared.schema";
|
|
14
9
|
|
|
15
|
-
const ROW = { _id: "row-1" };
|
|
16
|
-
const APPLIED = hashState({ name: "Procedures" });
|
|
17
|
-
const DECLARED = hashState({ declared: 1 });
|
|
18
|
-
|
|
19
|
-
function record(): MediaDeclaration {
|
|
20
|
-
return {
|
|
21
|
-
_id: "declaration-1",
|
|
22
|
-
kind: "folder",
|
|
23
|
-
key: "helio.procedures",
|
|
24
|
-
targetId: ROW._id,
|
|
25
|
-
declaredHash: DECLARED,
|
|
26
|
-
appliedHash: APPLIED,
|
|
27
|
-
} as MediaDeclaration;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
describe("[unit] declared content — the refresh rule", () => {
|
|
31
|
-
it("keeps a deleted row deleted", () => {
|
|
32
|
-
expect(
|
|
33
|
-
judgeDeclaredRow(record(), undefined, undefined, DECLARED),
|
|
34
|
-
).to.deep.equal({ status: "deleted" });
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it("preserves a row whose state moved away from the applied one", () => {
|
|
38
|
-
const edited = hashState({ name: "Our procedures" });
|
|
39
|
-
expect(
|
|
40
|
-
judgeDeclaredRow(record(), ROW, edited, hashState({ declared: 2 })),
|
|
41
|
-
).to.deep.equal({ status: "preserved", id: ROW._id });
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("reports an untouched row declared the same way as unchanged", () => {
|
|
45
|
-
expect(judgeDeclaredRow(record(), ROW, APPLIED, DECLARED)).to.deep.equal({
|
|
46
|
-
status: "unchanged",
|
|
47
|
-
id: ROW._id,
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("lets an untouched row with a new declaration be refreshed", () => {
|
|
52
|
-
expect(
|
|
53
|
-
judgeDeclaredRow(record(), ROW, APPLIED, hashState({ declared: 2 })),
|
|
54
|
-
).to.equal(undefined);
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
it("judges a member's change without a new declaration", () => {
|
|
58
|
-
expect(judgeMemberChange(record(), undefined, undefined)).to.deep.equal({
|
|
59
|
-
status: "deleted",
|
|
60
|
-
});
|
|
61
|
-
expect(
|
|
62
|
-
judgeMemberChange(record(), ROW, hashState({ name: "Ours" })),
|
|
63
|
-
).to.deep.equal({ status: "preserved", id: ROW._id });
|
|
64
|
-
expect(judgeMemberChange(record(), ROW, APPLIED)).to.equal(undefined);
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it("hashes equal states equally and different states differently", () => {
|
|
68
|
-
expect(hashState({ a: 1, b: null })).to.equal(hashState({ a: 1, b: null }));
|
|
69
|
-
expect(hashState({ a: 1 })).to.not.equal(hashState({ a: 2 }));
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
|
|
73
10
|
describe("[unit] declared content — declarations", () => {
|
|
74
11
|
it("keeps an explicit default tenant and defaults the visibility", () => {
|
|
75
12
|
const parsed = parseDeclaration(
|
|
@@ -132,27 +69,3 @@ describe("[unit] declared content — declarations", () => {
|
|
|
132
69
|
expect(await next).to.equal("ok");
|
|
133
70
|
});
|
|
134
71
|
});
|
|
135
|
-
|
|
136
|
-
describe("[unit] declared content — storage writes at startup", () => {
|
|
137
|
-
it("retries a write while its endpoint does not answer", async function () {
|
|
138
|
-
this.timeout(10_000);
|
|
139
|
-
let attempts = 0;
|
|
140
|
-
const result = await writeWhenReachable(async () => {
|
|
141
|
-
attempts += 1;
|
|
142
|
-
if (attempts < 3) throw new TypeError("fetch failed");
|
|
143
|
-
return "stored";
|
|
144
|
-
});
|
|
145
|
-
expect(result).to.equal("stored");
|
|
146
|
-
expect(attempts).to.equal(3);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
it("does not retry a refused write", async () => {
|
|
150
|
-
let attempts = 0;
|
|
151
|
-
const refusal = await writeWhenReachable(async () => {
|
|
152
|
-
attempts += 1;
|
|
153
|
-
throw new Error("Failed to upload logo.png: 413");
|
|
154
|
-
}).catch((error: Error) => error.message);
|
|
155
|
-
expect(refusal).to.contain("413");
|
|
156
|
-
expect(attempts).to.equal(1);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import {
|
|
3
|
+
type RealtimeMessage,
|
|
4
|
+
SubscribeMessage,
|
|
5
|
+
} from "@antelopejs/interface-dms";
|
|
6
|
+
import { MEDIA_LIBRARY_TOPIC } from "../../../constants";
|
|
7
|
+
import {
|
|
8
|
+
announceLibraryChange,
|
|
9
|
+
cancelLibraryChange,
|
|
10
|
+
} from "../../../library/realtime";
|
|
11
|
+
|
|
12
|
+
const SHORT_WINDOW_MS = 20;
|
|
13
|
+
const SETTLE_MS = 150;
|
|
14
|
+
|
|
15
|
+
function wait(ms: number): Promise<void> {
|
|
16
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
describe("[unit] library — realtime", () => {
|
|
20
|
+
let messages: RealtimeMessage[];
|
|
21
|
+
let unsubscribe: () => void;
|
|
22
|
+
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
// Changes the integration suites made may still be waiting to be announced.
|
|
25
|
+
cancelLibraryChange();
|
|
26
|
+
messages = [];
|
|
27
|
+
unsubscribe = SubscribeMessage(MEDIA_LIBRARY_TOPIC, (message) => {
|
|
28
|
+
messages.push(message);
|
|
29
|
+
});
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
afterEach(() => {
|
|
33
|
+
unsubscribe();
|
|
34
|
+
cancelLibraryChange();
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("announces a burst of changes once, with how many it stands for", async () => {
|
|
38
|
+
announceLibraryChange(SHORT_WINDOW_MS);
|
|
39
|
+
announceLibraryChange(SHORT_WINDOW_MS);
|
|
40
|
+
announceLibraryChange(SHORT_WINDOW_MS);
|
|
41
|
+
await wait(SETTLE_MS);
|
|
42
|
+
expect(messages).to.have.length(1);
|
|
43
|
+
expect(messages[0]?.payload).to.deep.equal({ count: 3 });
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
it("starts counting again after an announcement", async () => {
|
|
47
|
+
announceLibraryChange(SHORT_WINDOW_MS);
|
|
48
|
+
await wait(SETTLE_MS);
|
|
49
|
+
announceLibraryChange(SHORT_WINDOW_MS);
|
|
50
|
+
await wait(SETTLE_MS);
|
|
51
|
+
expect(messages.map((message) => message.payload?.count)).to.deep.equal([
|
|
52
|
+
1, 1,
|
|
53
|
+
]);
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import type { ComponentBuilder } from "@antelopejs/interface-dms/component";
|
|
3
|
+
import { MEDIA_LIBRARY_TOPIC } from "../../../constants";
|
|
4
|
+
import { MediaActivityPage } from "../../../pages/activity";
|
|
5
|
+
import { MediaOverviewPage } from "../../../pages/overview";
|
|
6
|
+
import { MEDIA_LIVE, mediaPageToolbar } from "../../../pages/toolbar";
|
|
7
|
+
import { MediaUploadsPage } from "../../../pages/uploads";
|
|
8
|
+
|
|
9
|
+
const TOOLBAR_COMPONENT = "dms-page-toolbar-block";
|
|
10
|
+
const LIVE_PAGES = {
|
|
11
|
+
overview: MediaOverviewPage,
|
|
12
|
+
activity: MediaActivityPage,
|
|
13
|
+
uploads: MediaUploadsPage,
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
type LivePage = (typeof LIVE_PAGES)[keyof typeof LIVE_PAGES];
|
|
17
|
+
|
|
18
|
+
/** The blocks a page declares, in the order it renders them. */
|
|
19
|
+
function pageBlocks(page: LivePage): ComponentBuilder<unknown>[] {
|
|
20
|
+
return Object.values(page) as ComponentBuilder<unknown>[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** What a block serializes to, as far as reading its data goes. */
|
|
24
|
+
interface SerializedBlock {
|
|
25
|
+
componentName: string;
|
|
26
|
+
options?: Record<string, unknown>;
|
|
27
|
+
children?: { id: string; component: SerializedBlock }[];
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* The blocks under `block` that read data, `block` included: a `fetchUrl`, or
|
|
32
|
+
* a table, which reads through a route of its own and only says its topic.
|
|
33
|
+
*/
|
|
34
|
+
function fetchingBlocks(block: SerializedBlock): SerializedBlock[] {
|
|
35
|
+
const own =
|
|
36
|
+
block.options &&
|
|
37
|
+
("fetchUrl" in block.options || "realtimeTopic" in block.options)
|
|
38
|
+
? [block]
|
|
39
|
+
: [];
|
|
40
|
+
return [
|
|
41
|
+
...own,
|
|
42
|
+
...(block.children ?? []).flatMap((child: { component: SerializedBlock }) =>
|
|
43
|
+
fetchingBlocks(child.component),
|
|
44
|
+
),
|
|
45
|
+
];
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
describe("[unit] pages — toolbar", () => {
|
|
49
|
+
it("shows when the page last read the library and Direct / Pause, without a period", () => {
|
|
50
|
+
const serialized = mediaPageToolbar().serializeSync();
|
|
51
|
+
expect(serialized.componentName).to.equal(TOOLBAR_COMPONENT);
|
|
52
|
+
expect(serialized.children?.map((child) => child.id)).to.deep.equal([
|
|
53
|
+
"live",
|
|
54
|
+
]);
|
|
55
|
+
expect(serialized.children?.[0]?.component.options).to.include({
|
|
56
|
+
missedLabel: "$dms_media.live.missed",
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it("shares one Direct / Pause choice between the media pages", () => {
|
|
61
|
+
expect(MEDIA_LIVE.rememberKey).to.equal("media");
|
|
62
|
+
expect(MEDIA_LIVE.maxRate).to.be.greaterThan(0);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
for (const [name, page] of Object.entries(LIVE_PAGES)) {
|
|
66
|
+
it(`puts the toolbar first on the ${name} page`, () => {
|
|
67
|
+
const [first] = pageBlocks(page);
|
|
68
|
+
expect(first?.serializeSync().componentName).to.equal(TOOLBAR_COMPONENT);
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
for (const [name, page] of Object.entries(LIVE_PAGES)) {
|
|
73
|
+
it(`reads every block of the ${name} page again on library changes`, () => {
|
|
74
|
+
const blocks = pageBlocks(page).flatMap((block) =>
|
|
75
|
+
fetchingBlocks(block.serializeSync() as SerializedBlock),
|
|
76
|
+
);
|
|
77
|
+
expect(blocks).to.have.length.greaterThan(0);
|
|
78
|
+
for (const block of blocks) {
|
|
79
|
+
expect(
|
|
80
|
+
block.options?.realtimeTopic,
|
|
81
|
+
`${block.componentName} ${JSON.stringify(block.options?.fetchUrl)}`,
|
|
82
|
+
).to.equal(MEDIA_LIBRARY_TOPIC);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
it("holds the upload history while the page is paused", () => {
|
|
88
|
+
expect(MediaUploadsPage.history.serializeSync().options).to.include({
|
|
89
|
+
liveHold: true,
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { expect } from "chai";
|
|
2
|
+
import type { MediaAsset } from "../../../db";
|
|
3
|
+
import type { MediaPresetConfig } from "../../../presets";
|
|
4
|
+
import { presetRow } from "../../../routes/media/manage";
|
|
5
|
+
|
|
6
|
+
const ORIGIN = "http://127.0.0.1:5010";
|
|
7
|
+
const ASSET_ID = "7554eb0a-c6fb-4518-a8b9-65c6e8a3e6a9";
|
|
8
|
+
const THUMB: MediaPresetConfig = { id: "thumb", width: 300, height: 300 };
|
|
9
|
+
const EXAMPLE = { _id: ASSET_ID, name: "Été à Liège.jpg" } as MediaAsset;
|
|
10
|
+
const EXAMPLE_PATH = `/media/${ASSET_ID}/thumb/%C3%89t%C3%A9%20%C3%A0%20Li%C3%A8ge.jpg`;
|
|
11
|
+
|
|
12
|
+
describe("[unit] routes/manage — image size cards", () => {
|
|
13
|
+
it("previews the example relative to the dashboard, which carries the session", () => {
|
|
14
|
+
const row = presetRow({
|
|
15
|
+
preset: THUMB,
|
|
16
|
+
origin: ORIGIN,
|
|
17
|
+
renderedKeys: [],
|
|
18
|
+
example: EXAMPLE,
|
|
19
|
+
});
|
|
20
|
+
expect(row.examplePreviewUrl).to.equal(EXAMPLE_PATH);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it("keeps the copied example link and pattern absolute on the public origin", () => {
|
|
24
|
+
const row = presetRow({
|
|
25
|
+
preset: THUMB,
|
|
26
|
+
origin: ORIGIN,
|
|
27
|
+
renderedKeys: [],
|
|
28
|
+
example: EXAMPLE,
|
|
29
|
+
});
|
|
30
|
+
expect(row.exampleUrl).to.equal(`${ORIGIN}${EXAMPLE_PATH}`);
|
|
31
|
+
expect(row.urlPattern).to.equal(`${ORIGIN}/media/{asset}/thumb/{filename}`);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it("has no example links without an example image", () => {
|
|
35
|
+
const row = presetRow({ preset: THUMB, origin: ORIGIN, renderedKeys: [] });
|
|
36
|
+
expect(row.exampleUrl).to.equal(null);
|
|
37
|
+
expect(row.examplePreviewUrl).to.equal(null);
|
|
38
|
+
});
|
|
39
|
+
});
|
|
@@ -64,23 +64,10 @@ export const declaredAssetSchema = z.object({
|
|
|
64
64
|
name: fileNameSchema,
|
|
65
65
|
mimetype: z.string().trim().min(1),
|
|
66
66
|
source: sourceSchema,
|
|
67
|
-
version: keySchema.optional(),
|
|
68
67
|
alt: altSchema.optional(),
|
|
69
68
|
tenantId: tenantSchema,
|
|
70
69
|
});
|
|
71
70
|
|
|
72
|
-
export const declarationRetirementSchema = z.object({
|
|
73
|
-
kind: z.enum(["folder", "asset"]),
|
|
74
|
-
key: keySchema,
|
|
75
|
-
tenantId: tenantSchema,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
export const declarationPruneSchema = z.object({
|
|
79
|
-
prefix: keySchema,
|
|
80
|
-
keep: z.array(keySchema),
|
|
81
|
-
tenantId: tenantSchema,
|
|
82
|
-
});
|
|
83
|
-
|
|
84
71
|
export type DeclaredFolderInput = z.output<typeof declaredFolderSchema>;
|
|
85
72
|
export type DeclaredAssetInput = z.output<typeof declaredAssetSchema>;
|
|
86
73
|
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitForTenant = waitForTenant;
|
|
4
|
-
exports.writeWhenReachable = writeWhenReachable;
|
|
5
|
-
const promises_1 = require("node:timers/promises");
|
|
6
|
-
const interface_database_1 = require("@antelopejs/interface-database");
|
|
7
|
-
const constants_1 = require("@antelopejs/interface-dms/constants");
|
|
8
|
-
const POLL_INTERVAL_MS = 500;
|
|
9
|
-
const MAX_RETRY_DELAY_MS = 5_000;
|
|
10
|
-
const TENANT_WAIT_MS = 5 * 60_000;
|
|
11
|
-
const STORAGE_WAIT_MS = 2 * 60_000;
|
|
12
|
-
const readyTenants = new Set();
|
|
13
|
-
async function hasTenantInstance(tenantId) {
|
|
14
|
-
try {
|
|
15
|
-
const schema = interface_database_1.Schema.get(constants_1.TENANT_SCHEMA_NAME);
|
|
16
|
-
if (!schema)
|
|
17
|
-
return false;
|
|
18
|
-
const instances = await schema.listInstances();
|
|
19
|
-
return instances.includes(tenantId);
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
return false;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async function waitForTenant(tenantId) {
|
|
26
|
-
if (readyTenants.has(tenantId))
|
|
27
|
-
return;
|
|
28
|
-
const deadline = Date.now() + TENANT_WAIT_MS;
|
|
29
|
-
while (!(await hasTenantInstance(tenantId))) {
|
|
30
|
-
if (Date.now() > deadline)
|
|
31
|
-
throw new Error(`Media tenant '${tenantId}' was not ready after ${TENANT_WAIT_MS / 1000}s: declare content from start() or a Hook.DATABASE_INITIALIZED handler, never awaited in construct()`);
|
|
32
|
-
await (0, promises_1.setTimeout)(POLL_INTERVAL_MS);
|
|
33
|
-
}
|
|
34
|
-
readyTenants.add(tenantId);
|
|
35
|
-
}
|
|
36
|
-
async function writeWhenReachable(write) {
|
|
37
|
-
const deadline = Date.now() + STORAGE_WAIT_MS;
|
|
38
|
-
let retryDelay = POLL_INTERVAL_MS;
|
|
39
|
-
for (;;) {
|
|
40
|
-
try {
|
|
41
|
-
return await write();
|
|
42
|
-
}
|
|
43
|
-
catch (error) {
|
|
44
|
-
const isUnreachable = error instanceof TypeError;
|
|
45
|
-
if (!isUnreachable || Date.now() > deadline)
|
|
46
|
-
throw error;
|
|
47
|
-
}
|
|
48
|
-
await (0, promises_1.setTimeout)(retryDelay);
|
|
49
|
-
retryDelay = Math.min(retryDelay * 2, MAX_RETRY_DELAY_MS);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
//# sourceMappingURL=readiness.js.map
|
|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,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC;AAOM,KAAK,UAAU,kBAAkB,CACtC,KAAuB;IAEvB,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,eAAe,CAAC;IAC9C,IAAI,UAAU,GAAG,gBAAgB,CAAC;IAClC,SAAS,CAAC;QACR,IAAI,CAAC;YACH,OAAO,MAAM,KAAK,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAEf,MAAM,aAAa,GAAG,KAAK,YAAY,SAAS,CAAC;YACjD,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,QAAQ;gBAAE,MAAM,KAAK,CAAC;QAC3D,CAAC;QACD,MAAM,IAAA,qBAAK,EAAC,UAAU,CAAC,CAAC;QACxB,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,GAAG,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { MediaDeclarationPrune, MediaDeclarationRetirement, MediaRetirementResult } from "@antelopejs/interface-dms-media";
|
|
2
|
-
export declare function retireDeclaration(input: MediaDeclarationRetirement): Promise<MediaRetirementResult>;
|
|
3
|
-
export declare function pruneDeclarations(input: MediaDeclarationPrune): Promise<MediaRetirementResult[]>;
|
package/dist/declared/retire.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.retireDeclaration = retireDeclaration;
|
|
4
|
-
exports.pruneDeclarations = pruneDeclarations;
|
|
5
|
-
const asset_lifecycle_1 = require("../asset-lifecycle");
|
|
6
|
-
const events_1 = require("../library/events");
|
|
7
|
-
const favorites_1 = require("../library/favorites");
|
|
8
|
-
const declared_schema_1 = require("../validation/declared.schema");
|
|
9
|
-
const assets_1 = require("./assets");
|
|
10
|
-
const folders_1 = require("./folders");
|
|
11
|
-
const readiness_1 = require("./readiness");
|
|
12
|
-
const records_1 = require("./records");
|
|
13
|
-
async function retireAsset(models, record) {
|
|
14
|
-
const { assetModel } = models;
|
|
15
|
-
const stored = await assetModel.get(record.targetId);
|
|
16
|
-
const asset = stored && !stored.isDeleting ? stored : undefined;
|
|
17
|
-
const change = (0, records_1.judgeMemberChange)(record, asset, asset && (0, assets_1.assetStateHash)(asset));
|
|
18
|
-
if (change || !asset)
|
|
19
|
-
return change ?? { status: "deleted" };
|
|
20
|
-
const isTombstoned = await (0, asset_lifecycle_1.updateAssetMedia)(assetModel, asset, { isDeleting: true }, { preserveDetails: true });
|
|
21
|
-
if (!isTombstoned) {
|
|
22
|
-
const current = await assetModel.get(asset._id);
|
|
23
|
-
return current && !current.isDeleting
|
|
24
|
-
? { status: "preserved", id: asset._id }
|
|
25
|
-
: { status: "deleted" };
|
|
26
|
-
}
|
|
27
|
-
await (0, asset_lifecycle_1.cleanupAssetFiles)(assetModel, asset._id);
|
|
28
|
-
await (0, favorites_1.forgetFavorites)(models.tenantId, [asset._id]);
|
|
29
|
-
await (0, events_1.recordMediaEvent)({ tenantId: models.tenantId, user: records_1.DECLARED_CONTENT_AUTHOR }, {
|
|
30
|
-
kind: "asset.delete",
|
|
31
|
-
targetName: asset.name,
|
|
32
|
-
folderId: asset.folderId,
|
|
33
|
-
assetId: asset._id,
|
|
34
|
-
size: asset.size,
|
|
35
|
-
});
|
|
36
|
-
return { status: "removed", id: asset._id };
|
|
37
|
-
}
|
|
38
|
-
async function holdsContent(models, folder) {
|
|
39
|
-
const [children, assets] = await Promise.all([
|
|
40
|
-
models.folderModel.getChildren(folder._id),
|
|
41
|
-
models.assetModel.getByFolder(folder._id),
|
|
42
|
-
]);
|
|
43
|
-
return children.length > 0 || assets.length > 0;
|
|
44
|
-
}
|
|
45
|
-
async function retireFolder(models, record) {
|
|
46
|
-
const { folderModel } = models;
|
|
47
|
-
const folder = await folderModel.get(record.targetId);
|
|
48
|
-
const change = (0, records_1.judgeMemberChange)(record, folder, folder && (0, folders_1.folderStateHash)(folder));
|
|
49
|
-
if (change || !folder)
|
|
50
|
-
return change ?? { status: "deleted" };
|
|
51
|
-
if (await holdsContent(models, folder))
|
|
52
|
-
return { status: "preserved", id: folder._id };
|
|
53
|
-
if (!(await folderModel.deleteDeclared(folder))) {
|
|
54
|
-
const current = await folderModel.get(folder._id);
|
|
55
|
-
return current
|
|
56
|
-
? { status: "preserved", id: folder._id }
|
|
57
|
-
: { status: "deleted" };
|
|
58
|
-
}
|
|
59
|
-
await (0, favorites_1.forgetFavorites)(models.tenantId, [folder._id]);
|
|
60
|
-
await (0, events_1.recordMediaEvent)({ tenantId: models.tenantId, user: records_1.DECLARED_CONTENT_AUTHOR }, {
|
|
61
|
-
kind: "folder.delete",
|
|
62
|
-
targetName: folder.name,
|
|
63
|
-
folderId: folder.parentId,
|
|
64
|
-
count: 0,
|
|
65
|
-
size: 0,
|
|
66
|
-
details: { files: 0, folders: 1 },
|
|
67
|
-
});
|
|
68
|
-
return { status: "removed", id: folder._id };
|
|
69
|
-
}
|
|
70
|
-
const RETIRERS = {
|
|
71
|
-
asset: retireAsset,
|
|
72
|
-
folder: retireFolder,
|
|
73
|
-
};
|
|
74
|
-
function retireKey(models, kind, key) {
|
|
75
|
-
return (0, records_1.withDeclarationLock)(models.tenantId, kind, key, async () => {
|
|
76
|
-
const record = await models.declarationModel.findByKey(kind, key);
|
|
77
|
-
if (!record)
|
|
78
|
-
return { kind, key, status: "unknown" };
|
|
79
|
-
const outcome = await RETIRERS[kind](models, record);
|
|
80
|
-
await models.declarationModel.delete(record._id);
|
|
81
|
-
return { kind, key, ...outcome };
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
async function retireDeclaration(input) {
|
|
85
|
-
const kind = input?.kind;
|
|
86
|
-
const retirement = (0, records_1.parseDeclaration)(kind === "folder" ? "folder" : "asset", input, declared_schema_1.declarationRetirementSchema);
|
|
87
|
-
await (0, readiness_1.waitForTenant)(retirement.tenantId);
|
|
88
|
-
return retireKey((0, records_1.declaredModels)(retirement.tenantId), retirement.kind, retirement.key);
|
|
89
|
-
}
|
|
90
|
-
async function retirementOrder(models, records) {
|
|
91
|
-
const depths = new Map();
|
|
92
|
-
for (const record of records) {
|
|
93
|
-
if (record.kind !== "folder")
|
|
94
|
-
continue;
|
|
95
|
-
const folder = await models.folderModel.get(record.targetId);
|
|
96
|
-
depths.set(record._id, folder?.path.length ?? 0);
|
|
97
|
-
}
|
|
98
|
-
const assets = records.filter((record) => record.kind === "asset");
|
|
99
|
-
const folders = records
|
|
100
|
-
.filter((record) => record.kind === "folder")
|
|
101
|
-
.sort((a, b) => (depths.get(b._id) ?? 0) - (depths.get(a._id) ?? 0));
|
|
102
|
-
return [...assets, ...folders];
|
|
103
|
-
}
|
|
104
|
-
async function pruneDeclarations(input) {
|
|
105
|
-
const parsed = declared_schema_1.declarationPruneSchema.safeParse(input);
|
|
106
|
-
if (!parsed.success)
|
|
107
|
-
throw new Error(`Media declarations prune: ${(0, declared_schema_1.describeDeclarationIssues)(parsed.error)}`);
|
|
108
|
-
const { prefix, tenantId } = parsed.data;
|
|
109
|
-
const keep = new Set(parsed.data.keep);
|
|
110
|
-
await (0, readiness_1.waitForTenant)(tenantId);
|
|
111
|
-
const models = (0, records_1.declaredModels)(tenantId);
|
|
112
|
-
const stale = (await models.declarationModel.getAll()).filter((record) => record.key.startsWith(prefix) && !keep.has(record.key));
|
|
113
|
-
const results = [];
|
|
114
|
-
for (const record of await retirementOrder(models, stale))
|
|
115
|
-
results.push(await retireKey(models, record.kind, record.key));
|
|
116
|
-
return results;
|
|
117
|
-
}
|
|
118
|
-
//# sourceMappingURL=retire.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"retire.js","sourceRoot":"","sources":["../../src/declared/retire.ts"],"names":[],"mappings":";;AAsJA,8CAeC;AAqBD,8CAmBC;AAvMD,wDAAyE;AAEzE,8CAAqD;A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