@basedigital/base-cms-payload-core 0.1.39 → 0.1.42
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/dist/cms/collections/page-templates.collection.js +1 -1
- package/dist/cms/collections/page-templates.collection.js.map +1 -1
- package/dist/cms/collections/pages.collection.js +1 -1
- package/dist/cms/collections/pages.collection.js.map +1 -1
- package/dist/cms/collections/reusable-blocks.collection.js +1 -1
- package/dist/cms/collections/reusable-blocks.collection.js.map +1 -1
- package/dist/cms/config/payload-storage.config.d.ts +1 -1
- package/dist/cms/config/payload-storage.config.d.ts.map +1 -1
- package/dist/cms/config/payload-storage.config.js +7 -3
- package/dist/cms/config/payload-storage.config.js.map +1 -1
- package/dist/cms/fields/factory/create-layout-blocks-field.d.ts +2 -2
- package/dist/cms/fields/factory/create-layout-blocks-field.d.ts.map +1 -1
- package/dist/cms/fields/factory/create-layout-blocks-field.js +4 -8
- package/dist/cms/fields/factory/create-layout-blocks-field.js.map +1 -1
- package/dist/cms/fields/references/discover-field-references.d.ts.map +1 -1
- package/dist/cms/fields/references/discover-field-references.js +5 -0
- package/dist/cms/fields/references/discover-field-references.js.map +1 -1
- package/dist/cms/layout-blocks/create-layout-field.d.ts +13 -0
- package/dist/cms/layout-blocks/create-layout-field.d.ts.map +1 -0
- package/dist/cms/layout-blocks/create-layout-field.js +264 -0
- package/dist/cms/layout-blocks/create-layout-field.js.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.collection.d.ts +10 -0
- package/dist/cms/layout-blocks/layout-blocks.collection.d.ts.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.collection.js +57 -0
- package/dist/cms/layout-blocks/layout-blocks.collection.js.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.constants.d.ts +4 -0
- package/dist/cms/layout-blocks/layout-blocks.constants.d.ts.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.constants.js +5 -0
- package/dist/cms/layout-blocks/layout-blocks.constants.js.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.plugin.d.ts +4 -0
- package/dist/cms/layout-blocks/layout-blocks.plugin.d.ts.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.plugin.js +161 -0
- package/dist/cms/layout-blocks/layout-blocks.plugin.js.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.types.d.ts +23 -0
- package/dist/cms/layout-blocks/layout-blocks.types.d.ts.map +1 -0
- package/dist/cms/layout-blocks/layout-blocks.types.js +2 -0
- package/dist/cms/layout-blocks/layout-blocks.types.js.map +1 -0
- package/dist/cms/layout-blocks/layout-ref-diff.d.ts +2 -0
- package/dist/cms/layout-blocks/layout-ref-diff.d.ts.map +1 -0
- package/dist/cms/layout-blocks/layout-ref-diff.js +5 -0
- package/dist/cms/layout-blocks/layout-ref-diff.js.map +1 -0
- package/dist/cms/layout-blocks/scripts/layout-blocks-gc.d.ts +3 -0
- package/dist/cms/layout-blocks/scripts/layout-blocks-gc.d.ts.map +1 -0
- package/dist/cms/layout-blocks/scripts/layout-blocks-gc.js +37 -0
- package/dist/cms/layout-blocks/scripts/layout-blocks-gc.js.map +1 -0
- package/dist/cms/layout-blocks/services/layout-entry.repository.d.ts +74 -0
- package/dist/cms/layout-blocks/services/layout-entry.repository.d.ts.map +1 -0
- package/dist/cms/layout-blocks/services/layout-entry.repository.js +263 -0
- package/dist/cms/layout-blocks/services/layout-entry.repository.js.map +1 -0
- package/dist/cms/layout-blocks/utils/block-fields.d.ts +4 -0
- package/dist/cms/layout-blocks/utils/block-fields.d.ts.map +1 -0
- package/dist/cms/layout-blocks/utils/block-fields.js +51 -0
- package/dist/cms/layout-blocks/utils/block-fields.js.map +1 -0
- package/dist/cms/layout-blocks/utils/layout-content.d.ts +10 -0
- package/dist/cms/layout-blocks/utils/layout-content.d.ts.map +1 -0
- package/dist/cms/layout-blocks/utils/layout-content.js +82 -0
- package/dist/cms/layout-blocks/utils/layout-content.js.map +1 -0
- package/dist/cms/layout-blocks/utils/layout-entry-ids.d.ts +12 -0
- package/dist/cms/layout-blocks/utils/layout-entry-ids.d.ts.map +1 -0
- package/dist/cms/layout-blocks/utils/layout-entry-ids.js +36 -0
- package/dist/cms/layout-blocks/utils/layout-entry-ids.js.map +1 -0
- package/dist/services/i18n/get-content-translations.js +1 -1
- package/dist/services/i18n/get-content-translations.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks.constants.d.ts","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-blocks.constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,qBAAqB,cAAc,CAAC;AAEjD,eAAO,MAAM,wBAAwB,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export const LAYOUT_FIELD_NAME = 'layout';
|
|
2
|
+
export const LAYOUT_REF_FIELD_NAME = 'layoutRef';
|
|
3
|
+
// Lets the plugin recognize owner collections without knowing the field name they chose.
|
|
4
|
+
export const LAYOUT_REF_CUSTOM_MARKER = 'isLayoutRef';
|
|
5
|
+
//# sourceMappingURL=layout-blocks.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks.constants.js","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-blocks.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,CAAC;AACjD,yFAAyF;AACzF,MAAM,CAAC,MAAM,wBAAwB,GAAG,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks.plugin.d.ts","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-blocks.plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAA8E,MAAM,EAAE,MAAM,SAAS,CAAC;AAWlH,wBAAgB,kBAAkB,IAAI,MAAM,CAiB3C;AAsJD,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAG7D"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { createLayoutBlocksCollection } from './layout-blocks.collection.js';
|
|
2
|
+
import { LAYOUT_FIELD_NAME, LAYOUT_REF_CUSTOM_MARKER, LAYOUT_REF_FIELD_NAME } from './layout-blocks.constants.js';
|
|
3
|
+
import { deleteLayoutEntries, listOwnerLayoutEntries } from './services/layout-entry.repository.js';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { fileURLToPath } from 'node:url';
|
|
6
|
+
const GC_BIN_KEY = 'layout-blocks-gc';
|
|
7
|
+
const GC_SCRIPT_NAME = 'layout-blocks-gc';
|
|
8
|
+
const UNION_DB_NAME_PREFIX = 'lb_';
|
|
9
|
+
// Finds every collection that uses createLayoutField, checks its drafts config and attaches the owner-level hooks;
|
|
10
|
+
// adds the `layout-blocks` collection with the union of the owners' blocks and registers the `layout-blocks-gc` bin script.
|
|
11
|
+
// Must run on the final config: the union is taken from the virtual fields after createBaseCollections/mergeBlocks.
|
|
12
|
+
export function layoutBlocksPlugin() {
|
|
13
|
+
return function applyLayoutBlocksPlugin(config) {
|
|
14
|
+
const bin = [...(config.bin ?? []), { key: GC_BIN_KEY, scriptPath: resolveGcScriptPath(import.meta.url) }];
|
|
15
|
+
const collections = config.collections?.map(attachOwnerHooks);
|
|
16
|
+
const ownersBlocks = collectOwnersLayoutBlocks(collections ?? []);
|
|
17
|
+
if (!ownersBlocks) {
|
|
18
|
+
return { ...config, bin, collections };
|
|
19
|
+
}
|
|
20
|
+
assertNoLocalizedField(ownersBlocks);
|
|
21
|
+
return {
|
|
22
|
+
...config,
|
|
23
|
+
bin,
|
|
24
|
+
collections: [...(collections ?? []), createLayoutBlocksCollection({ blocks: ownersBlocks })],
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function attachOwnerHooks(collection) {
|
|
29
|
+
if (!findLayoutRefSiblings(collection.fields)) {
|
|
30
|
+
return collection;
|
|
31
|
+
}
|
|
32
|
+
assertAutosaveOnlyDrafts(collection);
|
|
33
|
+
return {
|
|
34
|
+
...collection,
|
|
35
|
+
forceSelect: { ...collection.forceSelect, [LAYOUT_REF_FIELD_NAME]: true },
|
|
36
|
+
hooks: { ...collection.hooks, afterDelete: [...(collection.hooks?.afterDelete ?? []), deleteOwnerLayoutEntriesAfterDeleteHook] },
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
// Returns the field list that holds the owner's `layoutRef` (and so its virtual `layout`), walking unnamed containers only.
|
|
40
|
+
function findLayoutRefSiblings(fields) {
|
|
41
|
+
for (const field of fields) {
|
|
42
|
+
if (isLayoutRefField(field)) {
|
|
43
|
+
return fields;
|
|
44
|
+
}
|
|
45
|
+
for (const childFields of listUnnamedContainerFields(field)) {
|
|
46
|
+
const siblings = findLayoutRefSiblings(childFields);
|
|
47
|
+
if (siblings) {
|
|
48
|
+
return siblings;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
function listUnnamedContainerFields(field) {
|
|
55
|
+
if (field.type === 'tabs') {
|
|
56
|
+
return field.tabs.filter((tab) => !('name' in tab && tab.name)).map((tab) => tab.fields);
|
|
57
|
+
}
|
|
58
|
+
if ((field.type === 'row' || field.type === 'collapsible') && 'fields' in field) {
|
|
59
|
+
return [field.fields];
|
|
60
|
+
}
|
|
61
|
+
return [];
|
|
62
|
+
}
|
|
63
|
+
function isLayoutRefField(field) {
|
|
64
|
+
return 'custom' in field && field.custom?.[LAYOUT_REF_CUSTOM_MARKER] === true;
|
|
65
|
+
}
|
|
66
|
+
// The draft slot is rewritten by every autosave; a manual "save draft" would create versions that all point to it.
|
|
67
|
+
function assertAutosaveOnlyDrafts(collection) {
|
|
68
|
+
const drafts = typeof collection.versions === 'object' ? collection.versions.drafts : undefined;
|
|
69
|
+
if (!drafts) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const autosave = typeof drafts === 'object' ? drafts.autosave : undefined;
|
|
73
|
+
if (!autosave || (typeof autosave === 'object' && autosave.showSaveDraftButton === true)) {
|
|
74
|
+
throw new Error(`layout-blocks: collection "${collection.slug}" uses a layout field, so drafts require autosave without showSaveDraftButton`);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
// Union by slug, first occurrence wins. Owners share the stored data shape, so the same slug with different data fields
|
|
78
|
+
// is a config error. Blocks are copied: the owners keep their own objects and dbNames.
|
|
79
|
+
function collectOwnersLayoutBlocks(collections) {
|
|
80
|
+
const owners = collections.flatMap((collection) => {
|
|
81
|
+
const siblings = findLayoutRefSiblings(collection.fields);
|
|
82
|
+
return siblings ? [{ siblings, slug: collection.slug }] : [];
|
|
83
|
+
});
|
|
84
|
+
if (owners.length === 0) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
const union = new Map();
|
|
88
|
+
for (const { siblings, slug: ownerSlug } of owners) {
|
|
89
|
+
for (const block of findOwnerLayoutBlocks(siblings)) {
|
|
90
|
+
addToUnion(union, block, ownerSlug);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return [...union.values()].map(({ block }) => ({ ...block, dbName: `${UNION_DB_NAME_PREFIX}${block.slug.replace(/-/g, '_').toLowerCase()}` }));
|
|
94
|
+
}
|
|
95
|
+
function findOwnerLayoutBlocks(siblings) {
|
|
96
|
+
const layoutField = siblings.find((field) => field.type === 'blocks' && field.name === LAYOUT_FIELD_NAME);
|
|
97
|
+
return layoutField?.type === 'blocks' ? layoutField.blocks : [];
|
|
98
|
+
}
|
|
99
|
+
function addToUnion(union, block, ownerSlug) {
|
|
100
|
+
const dataFieldNames = listDataFieldNames(block.fields).sort();
|
|
101
|
+
const existing = union.get(block.slug);
|
|
102
|
+
if (!existing) {
|
|
103
|
+
union.set(block.slug, { block, dataFieldNames, ownerSlug });
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (existing.dataFieldNames.join(',') !== dataFieldNames.join(',')) {
|
|
107
|
+
throw new Error(`layout-blocks: block "${block.slug}" has different data fields in "${existing.ownerSlug}" and "${ownerSlug}"; owners must share the same block shape`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function listDataFieldNames(fields) {
|
|
111
|
+
return fields.flatMap((field) => {
|
|
112
|
+
if (field.type === 'tabs') {
|
|
113
|
+
return field.tabs.flatMap((tab) => ('name' in tab && tab.name ? [tab.name] : listDataFieldNames(tab.fields)));
|
|
114
|
+
}
|
|
115
|
+
if (field.type === 'ui') {
|
|
116
|
+
return [];
|
|
117
|
+
}
|
|
118
|
+
if ('name' in field && field.name) {
|
|
119
|
+
return [field.name];
|
|
120
|
+
}
|
|
121
|
+
return 'fields' in field ? listDataFieldNames(field.fields) : [];
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
// Localization lives on the owner's `layoutRef` (one entry per locale); a localized field inside a block would be silently dropped.
|
|
125
|
+
function assertNoLocalizedField(blocks) {
|
|
126
|
+
const localizedPath = findLocalizedFieldPath(blocks);
|
|
127
|
+
if (localizedPath) {
|
|
128
|
+
throw new Error(`layout-blocks: "${localizedPath}" is localized; fields inside layout blocks must not be localized`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
function findLocalizedFieldPath(node, path = []) {
|
|
132
|
+
if (Array.isArray(node)) {
|
|
133
|
+
for (const child of node) {
|
|
134
|
+
const found = findLocalizedFieldPath(child, path);
|
|
135
|
+
if (found) {
|
|
136
|
+
return found;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
}
|
|
141
|
+
if (typeof node !== 'object' || node === null) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
const { blocks, fields, localized, name, slug, tabs } = node;
|
|
145
|
+
const label = name ?? slug;
|
|
146
|
+
const nodePath = typeof label === 'string' ? [...path, label] : path;
|
|
147
|
+
if (localized === true) {
|
|
148
|
+
return nodePath.join('.');
|
|
149
|
+
}
|
|
150
|
+
return findLocalizedFieldPath([fields, tabs, blocks], nodePath);
|
|
151
|
+
}
|
|
152
|
+
// Payload has no field-level delete hook, so the plugin adds this one to every collection that owns a layout.
|
|
153
|
+
const deleteOwnerLayoutEntriesAfterDeleteHook = async function ({ collection, id, req }) {
|
|
154
|
+
const layoutEntries = await listOwnerLayoutEntries({ owner: { collection: collection.slug, id: String(id) }, req });
|
|
155
|
+
await deleteLayoutEntries({ ids: layoutEntries.map((entry) => entry.id), req });
|
|
156
|
+
};
|
|
157
|
+
export function resolveGcScriptPath(moduleUrl) {
|
|
158
|
+
const modulePath = fileURLToPath(moduleUrl);
|
|
159
|
+
return path.resolve(path.dirname(modulePath), 'scripts', `${GC_SCRIPT_NAME}${path.extname(modulePath)}`);
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=layout-blocks.plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks.plugin.js","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-blocks.plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,MAAM,iDAAiD,CAAC;AACrI,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AACvH,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC,MAAM,UAAU,GAAG,kBAAkB,CAAC;AACtC,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAInC,mHAAmH;AACnH,4HAA4H;AAC5H,oHAAoH;AACpH,MAAM,UAAU,kBAAkB;IAChC,OAAO,SAAS,uBAAuB,CAAC,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C;IAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;AAC3G,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type LayoutEntryState = 'draft' | 'published';
|
|
2
|
+
export type LayoutEntry = {
|
|
3
|
+
contentHash: string;
|
|
4
|
+
id: string;
|
|
5
|
+
ownerCollection: string;
|
|
6
|
+
ownerId: string | null;
|
|
7
|
+
state: LayoutEntryState;
|
|
8
|
+
};
|
|
9
|
+
export type LayoutEntryOwner = {
|
|
10
|
+
collection: string;
|
|
11
|
+
id: string | null;
|
|
12
|
+
locale: string | null;
|
|
13
|
+
};
|
|
14
|
+
export type OwnerReferences = {
|
|
15
|
+
entryIds: Set<string>;
|
|
16
|
+
ownerExists: boolean;
|
|
17
|
+
};
|
|
18
|
+
export type OwnerLayoutEntry = {
|
|
19
|
+
createdAt: string;
|
|
20
|
+
id: string;
|
|
21
|
+
state: LayoutEntryState;
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=layout-blocks.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks.types.d.ts","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-blocks.types.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,WAAW,CAAC;AAErD,MAAM,MAAM,WAAW,GAAG;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,gBAAgB,CAAC;CACzB,CAAC;AAGF,MAAM,MAAM,gBAAgB,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAGhG,MAAM,MAAM,eAAe,GAAG;IAAE,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAAC,WAAW,EAAE,OAAO,CAAA;CAAE,CAAC;AAE9E,MAAM,MAAM,gBAAgB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks.types.js","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-blocks.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-ref-diff.d.ts","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-ref-diff.tsx"],"names":[],"mappings":"AACA,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-ref-diff.js","sourceRoot":"","sources":["../../../src/cms/layout-blocks/layout-ref-diff.tsx"],"names":[],"mappings":"AAAA,kHAAkH;AAClH,MAAM,UAAU,mBAAmB;IACjC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-blocks-gc.d.ts","sourceRoot":"","sources":["../../../../src/cms/layout-blocks/scripts/layout-blocks-gc.ts"],"names":[],"mappings":"AAOA,OAAgB,EAAkB,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAOxE,eAAO,MAAM,MAAM,WAAkB,eAAe,KAAG,OAAO,CAAC,IAAI,CAgClE,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { deleteLayoutEntries, listAllLayoutEntryOwners, listOwnerLayoutEntries, loadOwnerReferences, } from '../services/layout-entry.repository.js';
|
|
2
|
+
import { selectOrphanLayoutEntryIds } from '../utils/layout-entry-ids.js';
|
|
3
|
+
import payload, { createLocalReq } from 'payload';
|
|
4
|
+
const HOURS_PER_DAY = 24;
|
|
5
|
+
const MS_PER_HOUR = 60 * 60 * 1000;
|
|
6
|
+
// 24 hours: an entry younger than this may still be about to be referenced by an in-flight save.
|
|
7
|
+
const ORPHAN_GRACE_PERIOD_MS = HOURS_PER_DAY * MS_PER_HOUR;
|
|
8
|
+
export const script = async (config) => {
|
|
9
|
+
await payload.init({ config });
|
|
10
|
+
try {
|
|
11
|
+
const req = await createLocalReq({}, payload);
|
|
12
|
+
const collectionSlugs = new Set(config.collections.map((collection) => collection.slug));
|
|
13
|
+
let deletedCount = 0;
|
|
14
|
+
for (const owner of await listAllLayoutEntryOwners({ req })) {
|
|
15
|
+
if (!collectionSlugs.has(owner.collection)) {
|
|
16
|
+
continue;
|
|
17
|
+
}
|
|
18
|
+
const references = owner.id === null
|
|
19
|
+
? { entryIds: new Set(), ownerExists: false }
|
|
20
|
+
: await loadOwnerReferences({ collection: owner.collection, id: owner.id, req });
|
|
21
|
+
const orphanIds = selectOrphanLayoutEntryIds({
|
|
22
|
+
gracePeriodMs: ORPHAN_GRACE_PERIOD_MS,
|
|
23
|
+
keepDraftSlots: references.ownerExists,
|
|
24
|
+
layoutEntries: await listOwnerLayoutEntries({ owner, req }),
|
|
25
|
+
now: new Date(),
|
|
26
|
+
referencedIds: references.entryIds,
|
|
27
|
+
});
|
|
28
|
+
await deleteLayoutEntries({ ids: orphanIds, req });
|
|
29
|
+
deletedCount += orphanIds.length;
|
|
30
|
+
}
|
|
31
|
+
payload.logger.info(`layout-blocks-gc: deleted ${deletedCount} orphan layout entry(s)`);
|
|
32
|
+
}
|
|
33
|
+
finally {
|
|
34
|
+
await payload.destroy();
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=layout-blocks-gc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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CAAC,EAAE,UAAU,EAAE,KAAK,CAAC,UAAU,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YACrF,MAAM,SAAS,GAAG,0BAA0B,CAAC;gBAC3C,aAAa,EAAE,sBAAsB;gBACrC,cAAc,EAAE,UAAU,CAAC,WAAW;gBACtC,aAAa,EAAE,MAAM,sBAAsB,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;gBAC3D,GAAG,EAAE,IAAI,IAAI,EAAE;gBACf,aAAa,EAAE,UAAU,CAAC,QAAQ;aACnC,CAAC,CAAC;YAEH,MAAM,mBAAmB,CAAC,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC;YACnD,YAAY,IAAI,SAAS,CAAC,MAAM,CAAC;QACnC,CAAC;QAED,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,6BAA6B,YAAY,yBAAyB,CAAC,CAAC;IAC1F,CAAC;YAAS,CAAC;QACT,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { LayoutEntry, LayoutEntryOwner, LayoutEntryState, OwnerLayoutEntry, OwnerReferences } from '../layout-blocks.types.js';
|
|
2
|
+
import type { Block, PayloadRequest } from 'payload';
|
|
3
|
+
type LayoutEntryWrite = {
|
|
4
|
+
blockItems: unknown[];
|
|
5
|
+
contentHash: string;
|
|
6
|
+
owner: LayoutEntryOwner;
|
|
7
|
+
req: PayloadRequest;
|
|
8
|
+
state: LayoutEntryState;
|
|
9
|
+
};
|
|
10
|
+
export declare function findLayoutEntry({ id, req }: {
|
|
11
|
+
id: string | null;
|
|
12
|
+
req: PayloadRequest;
|
|
13
|
+
}): Promise<LayoutEntry | null>;
|
|
14
|
+
export declare function findDraftSlot({ owner, req }: {
|
|
15
|
+
owner: LayoutEntryOwner;
|
|
16
|
+
req: PayloadRequest;
|
|
17
|
+
}): Promise<LayoutEntry | null>;
|
|
18
|
+
export declare function loadLayoutEntryBlockItems({ depth, draft, ids, overrideAccess, req, }: {
|
|
19
|
+
depth: number;
|
|
20
|
+
draft: boolean;
|
|
21
|
+
ids: string[];
|
|
22
|
+
overrideAccess: boolean;
|
|
23
|
+
req: PayloadRequest;
|
|
24
|
+
}): Promise<Map<string, unknown[]>>;
|
|
25
|
+
export declare function createLayoutEntry({ blockItems, contentHash, owner, req, state }: LayoutEntryWrite): Promise<string>;
|
|
26
|
+
export declare function updateLayoutEntryBlockItems({ blockItems, contentHash, id, req, }: {
|
|
27
|
+
blockItems: unknown[];
|
|
28
|
+
contentHash: string;
|
|
29
|
+
id: string;
|
|
30
|
+
req: PayloadRequest;
|
|
31
|
+
}): Promise<void>;
|
|
32
|
+
export declare function cloneLayoutEntry({ blocks, id, req }: {
|
|
33
|
+
blocks: Block[];
|
|
34
|
+
id: string;
|
|
35
|
+
req: PayloadRequest;
|
|
36
|
+
}): Promise<string>;
|
|
37
|
+
export declare function assignLayoutEntryOwner({ ids, ownerId, req }: {
|
|
38
|
+
ids: string[];
|
|
39
|
+
ownerId: string;
|
|
40
|
+
req: PayloadRequest;
|
|
41
|
+
}): Promise<void>;
|
|
42
|
+
export declare function freezeLayoutEntries({ ids, req }: {
|
|
43
|
+
ids: string[];
|
|
44
|
+
req: PayloadRequest;
|
|
45
|
+
}): Promise<void>;
|
|
46
|
+
export declare function deleteLayoutEntries({ ids, req }: {
|
|
47
|
+
ids: string[];
|
|
48
|
+
req: PayloadRequest;
|
|
49
|
+
}): Promise<void>;
|
|
50
|
+
export declare function rememberSubmittedRows({ entryId, req, rows }: {
|
|
51
|
+
entryId: string;
|
|
52
|
+
req: PayloadRequest;
|
|
53
|
+
rows: unknown[];
|
|
54
|
+
}): void;
|
|
55
|
+
export declare function loadOwnerReferences({ collection, id, req, }: {
|
|
56
|
+
collection: string;
|
|
57
|
+
id: string;
|
|
58
|
+
req: PayloadRequest;
|
|
59
|
+
}): Promise<OwnerReferences>;
|
|
60
|
+
export declare function listOwnerLayoutEntries({ owner, req, }: {
|
|
61
|
+
owner: {
|
|
62
|
+
collection: string;
|
|
63
|
+
id: string | null;
|
|
64
|
+
};
|
|
65
|
+
req: PayloadRequest;
|
|
66
|
+
}): Promise<OwnerLayoutEntry[]>;
|
|
67
|
+
export declare function listAllLayoutEntryOwners({ req }: {
|
|
68
|
+
req: PayloadRequest;
|
|
69
|
+
}): Promise<{
|
|
70
|
+
collection: string;
|
|
71
|
+
id: string | null;
|
|
72
|
+
}[]>;
|
|
73
|
+
export {};
|
|
74
|
+
//# sourceMappingURL=layout-entry.repository.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout-entry.repository.d.ts","sourceRoot":"","sources":["../../../../src/cms/layout-blocks/services/layout-entry.repository.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAItJ,OAAO,KAAK,EAAE,KAAK,EAAkB,cAAc,EAAS,MAAM,SAAS,CAAC;AAQ5E,KAAK,gBAAgB,GAAG;IAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAC;IAAC,GAAG,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,gBAAgB,CAAA;CAAE,CAAC;AAM9I,wBAAsB,eAAe,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,GAAG,EAAE,cAAc,CAAA;CAAE,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAe1H;AAED,wBAAsB,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;IAAE,KAAK,EAAE,gBAAgB,CAAC;IAAC,GAAG,EAAE,cAAc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