qarpeo 0.3.1 → 0.3.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/dist/chunks/tools.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { useRuntimeConfig } from 'nuxt/server';
|
|
|
11
11
|
import { mkdir, writeFile, readFile } from 'node:fs/promises';
|
|
12
12
|
import { defu } from 'defu';
|
|
13
13
|
|
|
14
|
-
const version = "0.3.
|
|
14
|
+
const version = "0.3.2";
|
|
15
15
|
|
|
16
16
|
function resolveBindingName(service, override, defaultName) {
|
|
17
17
|
if (override && typeof override === "string") {
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
cmsCollectionTbl,
|
|
8
8
|
cmsEntryTbl
|
|
9
9
|
} from "./common.mjs";
|
|
10
|
+
import { getCMSEntry } from "./queries.mjs";
|
|
10
11
|
const userTbl = (e) => resolveTableName("user", e);
|
|
11
12
|
export function isReferenceValue(v) {
|
|
12
13
|
return !!v && typeof v === "object" && !Array.isArray(v) && typeof v.collectionId === "string" && typeof v.slug === "string";
|
|
@@ -86,7 +87,6 @@ async function resolveReferenceInput(event, input, defaultTargetCollectionId, fi
|
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
if (filter && Object.keys(filter).length > 0) {
|
|
89
|
-
const { getCMSEntry } = await import("./queries.mjs");
|
|
90
90
|
const fullEntry = await getCMSEntry(event, collectionId, resolved.id, { preview: true });
|
|
91
91
|
if (fullEntry) {
|
|
92
92
|
for (const [key, expected] of Object.entries(filter)) {
|
|
@@ -210,7 +210,6 @@ export async function resolveReference(event, ref) {
|
|
|
210
210
|
if (!collectionId) return null;
|
|
211
211
|
const slugOrId = ref.id || ref.slug;
|
|
212
212
|
if (!slugOrId) return null;
|
|
213
|
-
const { getCMSEntry } = await import("./queries.mjs");
|
|
214
213
|
return getCMSEntry(event, collectionId, slugOrId);
|
|
215
214
|
}
|
|
216
215
|
export async function populateReferenceFields(event, entry, populate) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createError } from "nuxt/server";
|
|
2
2
|
import { getCMSDb, getCMSTenantId, cmsEntryTbl, cmsRevisionTbl } from "./common.mjs";
|
|
3
|
+
import { updateCMSEntry } from "./mutations.mjs";
|
|
3
4
|
export async function pruneRevisions(event, entryId, max) {
|
|
4
5
|
const db = getCMSDb(event);
|
|
5
6
|
await db.prepare(
|
|
@@ -51,7 +52,6 @@ export async function restoreCMSRevision(event, entryId, revisionId) {
|
|
|
51
52
|
delete meta._ast;
|
|
52
53
|
delete meta._toc;
|
|
53
54
|
delete meta._nav;
|
|
54
|
-
const { updateCMSEntry } = await import("./mutations.mjs");
|
|
55
55
|
return await updateCMSEntry(event, entryId, {
|
|
56
56
|
title: rev.title,
|
|
57
57
|
contentMd: rev.content_md,
|