qarpeo 0.4.7 → 0.4.9
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/manifest.get.mjs +2 -158
- package/dist/cli/index.mjs +4 -5
- package/dist/module.d.ts +1 -1
- package/dist/module.mjs +1 -2
- package/dist/utils/cms-table-names.d.ts +4 -0
- package/package.json +1 -1
|
@@ -5,12 +5,11 @@ import { resolve, dirname, join, extname, basename, relative } from 'pathe';
|
|
|
5
5
|
import { stdin, stdout } from 'node:process';
|
|
6
6
|
import readline from 'node:readline/promises';
|
|
7
7
|
import { fileURLToPath } from 'node:url';
|
|
8
|
-
import { snakeCase, integer, text, index, uniqueIndex } from 'drizzle-orm/sqlite-core';
|
|
9
8
|
import { useRuntimeConfig, defineEventHandler } from 'nuxt/server';
|
|
10
9
|
import { mkdir, writeFile, readFile } from 'node:fs/promises';
|
|
11
10
|
import { defu } from 'defu';
|
|
12
11
|
|
|
13
|
-
const version = "0.4.
|
|
12
|
+
const version = "0.4.8";
|
|
14
13
|
|
|
15
14
|
function resolveBindingName(service, override, defaultName) {
|
|
16
15
|
if (override && typeof override === "string") {
|
|
@@ -1259,161 +1258,6 @@ function getActiveCmsTableNames(cms, prefixOrOptions) {
|
|
|
1259
1258
|
resolveTableName("cms_subscriber", prefixOrOptions)
|
|
1260
1259
|
];
|
|
1261
1260
|
}
|
|
1262
|
-
const collectionTbl = resolveTableName("cms_collection");
|
|
1263
|
-
const entryTbl = resolveTableName("cms_entry");
|
|
1264
|
-
const revisionTbl = resolveTableName("cms_revision");
|
|
1265
|
-
const categoryTbl = resolveTableName("cms_category");
|
|
1266
|
-
const tagTbl = resolveTableName("cms_tag");
|
|
1267
|
-
const bookmarkTbl = resolveTableName("cms_bookmark");
|
|
1268
|
-
const subscriberTbl = resolveTableName("cms_subscriber");
|
|
1269
|
-
const cmsCollection = snakeCase.table(collectionTbl, {
|
|
1270
|
-
id: text().primaryKey(),
|
|
1271
|
-
tenantId: text(),
|
|
1272
|
-
name: text().notNull(),
|
|
1273
|
-
description: text(),
|
|
1274
|
-
schemaJson: text().notNull().default("{}"),
|
|
1275
|
-
source: text().notNull().default("db"),
|
|
1276
|
-
order: integer().notNull().default(0),
|
|
1277
|
-
createdAt: integer().notNull(),
|
|
1278
|
-
updatedAt: integer().notNull()
|
|
1279
|
-
});
|
|
1280
|
-
const cmsCollections = cmsCollection;
|
|
1281
|
-
const cmsEntry = snakeCase.table(
|
|
1282
|
-
entryTbl,
|
|
1283
|
-
{
|
|
1284
|
-
id: text().primaryKey(),
|
|
1285
|
-
tenantId: text(),
|
|
1286
|
-
collectionId: text().notNull(),
|
|
1287
|
-
slug: text().notNull(),
|
|
1288
|
-
title: text().notNull(),
|
|
1289
|
-
description: text(),
|
|
1290
|
-
coverImage: text(),
|
|
1291
|
-
tags: text(),
|
|
1292
|
-
order: integer().notNull().default(0),
|
|
1293
|
-
contentMd: text().notNull().default(""),
|
|
1294
|
-
contentHtml: text().notNull().default(""),
|
|
1295
|
-
metadataJson: text().default("{}"),
|
|
1296
|
-
status: text().notNull().default("draft"),
|
|
1297
|
-
source: text().notNull().default("db"),
|
|
1298
|
-
path: text(),
|
|
1299
|
-
filePath: text(),
|
|
1300
|
-
contentHash: text(),
|
|
1301
|
-
authorId: text(),
|
|
1302
|
-
categoryId: text(),
|
|
1303
|
-
subCategoryId: text(),
|
|
1304
|
-
featured: integer({ mode: "boolean" }).notNull().default(false),
|
|
1305
|
-
viewCount: integer().notNull().default(0),
|
|
1306
|
-
readingTime: integer(),
|
|
1307
|
-
locale: text().notNull().default("en"),
|
|
1308
|
-
version: text().notNull().default("latest"),
|
|
1309
|
-
publishedAt: integer(),
|
|
1310
|
-
createdAt: integer().notNull(),
|
|
1311
|
-
updatedAt: integer().notNull()
|
|
1312
|
-
},
|
|
1313
|
-
(t) => [
|
|
1314
|
-
index(resolveIndexName(entryTbl, "collection")).on(t.collectionId),
|
|
1315
|
-
index(resolveIndexName(entryTbl, "tenant")).on(t.tenantId, t.collectionId),
|
|
1316
|
-
uniqueIndex(resolveIndexName(entryTbl, "slug")).on(t.collectionId, t.slug),
|
|
1317
|
-
index(resolveIndexName(entryTbl, "status")).on(t.status),
|
|
1318
|
-
index(resolveIndexName(entryTbl, "order")).on(t.collectionId, t.order),
|
|
1319
|
-
index(resolveIndexName(entryTbl, "path")).on(t.collectionId, t.path),
|
|
1320
|
-
index(resolveIndexName(entryTbl, "locale")).on(t.collectionId, t.locale),
|
|
1321
|
-
index(resolveIndexName(entryTbl, "path_locale")).on(t.path, t.locale),
|
|
1322
|
-
index(resolveIndexName(entryTbl, "category")).on(t.collectionId, t.categoryId),
|
|
1323
|
-
index(resolveIndexName(entryTbl, "featured")).on(t.collectionId, t.featured),
|
|
1324
|
-
index(resolveIndexName(entryTbl, "published_at")).on(t.publishedAt),
|
|
1325
|
-
index(resolveIndexName(entryTbl, "list")).on(t.collectionId, t.status, t.publishedAt)
|
|
1326
|
-
]
|
|
1327
|
-
);
|
|
1328
|
-
const cmsEntries = cmsEntry;
|
|
1329
|
-
const cmsRevision = snakeCase.table(
|
|
1330
|
-
revisionTbl,
|
|
1331
|
-
{
|
|
1332
|
-
id: text().primaryKey(),
|
|
1333
|
-
entryId: text().notNull(),
|
|
1334
|
-
title: text().notNull(),
|
|
1335
|
-
contentMd: text().notNull(),
|
|
1336
|
-
metadataJson: text().default("{}"),
|
|
1337
|
-
authorId: text(),
|
|
1338
|
-
createdAt: integer().notNull()
|
|
1339
|
-
},
|
|
1340
|
-
(t) => [index(resolveIndexName(revisionTbl, "entry")).on(t.entryId, t.createdAt)]
|
|
1341
|
-
);
|
|
1342
|
-
const cmsRevisions = cmsRevision;
|
|
1343
|
-
const cmsCategory = snakeCase.table(
|
|
1344
|
-
categoryTbl,
|
|
1345
|
-
{
|
|
1346
|
-
id: text().primaryKey(),
|
|
1347
|
-
tenantId: text(),
|
|
1348
|
-
name: text().notNull(),
|
|
1349
|
-
slug: text().notNull(),
|
|
1350
|
-
description: text(),
|
|
1351
|
-
icon: text(),
|
|
1352
|
-
parentId: text(),
|
|
1353
|
-
order: integer().notNull().default(0),
|
|
1354
|
-
metadataJson: text().default("{}"),
|
|
1355
|
-
createdAt: integer().notNull(),
|
|
1356
|
-
updatedAt: integer().notNull()
|
|
1357
|
-
},
|
|
1358
|
-
(t) => [
|
|
1359
|
-
uniqueIndex(resolveIndexName(categoryTbl, "slug")).on(t.tenantId, t.slug),
|
|
1360
|
-
index(resolveIndexName(categoryTbl, "parent")).on(t.parentId),
|
|
1361
|
-
index(resolveIndexName(categoryTbl, "tenant")).on(t.tenantId)
|
|
1362
|
-
]
|
|
1363
|
-
);
|
|
1364
|
-
const cmsCategories = cmsCategory;
|
|
1365
|
-
const cmsTag = snakeCase.table(
|
|
1366
|
-
tagTbl,
|
|
1367
|
-
{
|
|
1368
|
-
id: text().primaryKey(),
|
|
1369
|
-
tenantId: text(),
|
|
1370
|
-
name: text().notNull(),
|
|
1371
|
-
slug: text().notNull(),
|
|
1372
|
-
description: text(),
|
|
1373
|
-
count: integer().notNull().default(0),
|
|
1374
|
-
metadataJson: text().default("{}"),
|
|
1375
|
-
createdAt: integer().notNull(),
|
|
1376
|
-
updatedAt: integer().notNull()
|
|
1377
|
-
},
|
|
1378
|
-
(t) => [
|
|
1379
|
-
uniqueIndex(resolveIndexName(tagTbl, "slug")).on(t.tenantId, t.slug),
|
|
1380
|
-
index(resolveIndexName(tagTbl, "tenant")).on(t.tenantId)
|
|
1381
|
-
]
|
|
1382
|
-
);
|
|
1383
|
-
const cmsTags = cmsTag;
|
|
1384
|
-
const cmsBookmark = snakeCase.table(
|
|
1385
|
-
bookmarkTbl,
|
|
1386
|
-
{
|
|
1387
|
-
id: text().primaryKey(),
|
|
1388
|
-
tenantId: text(),
|
|
1389
|
-
userId: text().notNull(),
|
|
1390
|
-
entryId: text().notNull(),
|
|
1391
|
-
createdAt: integer().notNull()
|
|
1392
|
-
},
|
|
1393
|
-
(t) => [
|
|
1394
|
-
index(resolveIndexName(bookmarkTbl, "user")).on(t.userId),
|
|
1395
|
-
index(resolveIndexName(bookmarkTbl, "entry")).on(t.entryId),
|
|
1396
|
-
uniqueIndex(resolveIndexName(bookmarkTbl, "unique")).on(t.tenantId, t.userId, t.entryId)
|
|
1397
|
-
]
|
|
1398
|
-
);
|
|
1399
|
-
const cmsBookmarks = cmsBookmark;
|
|
1400
|
-
const cmsSubscriber = snakeCase.table(
|
|
1401
|
-
subscriberTbl,
|
|
1402
|
-
{
|
|
1403
|
-
id: text().primaryKey(),
|
|
1404
|
-
tenantId: text(),
|
|
1405
|
-
email: text().notNull(),
|
|
1406
|
-
status: text().notNull().default("active"),
|
|
1407
|
-
source: text().default("website"),
|
|
1408
|
-
createdAt: integer().notNull()
|
|
1409
|
-
},
|
|
1410
|
-
(t) => [
|
|
1411
|
-
uniqueIndex(resolveIndexName(subscriberTbl, "unique_email")).on(t.tenantId, t.email),
|
|
1412
|
-
index(resolveIndexName(subscriberTbl, "status")).on(t.status),
|
|
1413
|
-
index(resolveIndexName(subscriberTbl, "tenant")).on(t.tenantId)
|
|
1414
|
-
]
|
|
1415
|
-
);
|
|
1416
|
-
const cmsSubscribers = cmsSubscriber;
|
|
1417
1261
|
|
|
1418
1262
|
const ALL_STORE_TABLE_NAMES = [
|
|
1419
1263
|
"store_product",
|
|
@@ -2885,4 +2729,4 @@ defineEventHandler((event) => {
|
|
|
2885
2729
|
);
|
|
2886
2730
|
});
|
|
2887
2731
|
|
|
2888
|
-
export {
|
|
2732
|
+
export { ALL_CMS_TABLE_NAMES as A, buildDevWranglerConfig as B, generateAuthSchema as C, generateCommentsSchema as D, generateStoreSchema as E, findScheduledTasks as F, formatDlxCommand as G, resolveBindingName as H, createWranglerConfig as I, generateDevWranglerConfig as J, applyD1Migrations as K, findQueueFiles as L, findDurableObjectFiles as M, isPackageInstalled as N, getActiveCmsTableNames as O, getActiveCommentsTableNames as P, getActiveStoreTableNames as Q, hasDatabaseSchema as R, localDb as S, authSchema as T, wrangler as U, resolveBinaryPath as a, getActiveAuthTableNames as b, ALL_STORE_TABLE_NAMES as c, ALL_COMMENTS_TABLE_NAMES as d, ensurePackage as e, discoverDatabases as f, getLocalDatabaseContext as g, findLocalD1Database as h, spawnBinSync as i, getJiti as j, resolveProjectName as k, checkDrizzleVersion as l, findSchemaFiles as m, findAgentFiles as n, findToolFiles as o, findBotFiles as p, findMcpFiles as q, resolveDatabaseTarget as r, scanSchemaExports as s, findJobFiles as t, findWorkflowFiles as u, findEmailHandlerFiles as v, buildQarpeoManifest as w, version as x, resolveTableName as y, resolveIndexName as z };
|
package/dist/cli/index.mjs
CHANGED
|
@@ -11,7 +11,6 @@ import { hostname, homedir } from 'node:os';
|
|
|
11
11
|
import { randomBytes } from 'node:crypto';
|
|
12
12
|
import 'node:module';
|
|
13
13
|
import 'node:url';
|
|
14
|
-
import 'drizzle-orm/sqlite-core';
|
|
15
14
|
import 'nuxt/server';
|
|
16
15
|
import 'node:fs/promises';
|
|
17
16
|
import 'defu';
|
|
@@ -1489,7 +1488,7 @@ const migrate = defineCommand({
|
|
|
1489
1488
|
} else if (existsSync(resolve(cwd, ".nuxt/wrangler.json"))) {
|
|
1490
1489
|
wranglerConfigPath = resolve(cwd, ".nuxt/wrangler.json");
|
|
1491
1490
|
} else {
|
|
1492
|
-
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n
|
|
1491
|
+
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.U; });
|
|
1493
1492
|
const buildDir = resolve(cwd, ".nuxt");
|
|
1494
1493
|
wranglerConfigPath = await generateDevWranglerConfig(
|
|
1495
1494
|
{
|
|
@@ -1761,8 +1760,8 @@ const migrate = defineCommand({
|
|
|
1761
1760
|
if (args.prune && targets.some((t) => t.isPrimary)) {
|
|
1762
1761
|
const primaryTarget = targets.find((t) => t.isPrimary);
|
|
1763
1762
|
const primaryBinding = primaryTarget.binding;
|
|
1764
|
-
const { getActiveAuthTableNames, ALL_AUTH_TABLE_NAMES } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.
|
|
1765
|
-
const { findLocalD1Database } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.
|
|
1763
|
+
const { getActiveAuthTableNames, ALL_AUTH_TABLE_NAMES } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.T; });
|
|
1764
|
+
const { findLocalD1Database } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.S; });
|
|
1766
1765
|
const authConfig = nuxtConfig.qarpeo?.auth || nuxtConfig.auth;
|
|
1767
1766
|
const activeTables = getActiveAuthTableNames(authConfig);
|
|
1768
1767
|
const unusedTables = ALL_AUTH_TABLE_NAMES.filter(
|
|
@@ -2634,7 +2633,7 @@ const deploy = defineCommand({
|
|
|
2634
2633
|
if (!wranglerConfigPath) {
|
|
2635
2634
|
try {
|
|
2636
2635
|
const { loadNuxtConfig } = await import('@nuxt/kit');
|
|
2637
|
-
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n
|
|
2636
|
+
const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.U; });
|
|
2638
2637
|
const nuxtConfig = await loadNuxtConfig({ cwd });
|
|
2639
2638
|
const qarpeoOpts = nuxtConfig.qarpeo || {};
|
|
2640
2639
|
const buildDir = resolve(cwd, ".nuxt");
|
package/dist/module.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export { findMcpFiles } from "./utils/mcp";
|
|
|
14
14
|
export { findWorkflowFiles } from "./utils/workflows";
|
|
15
15
|
export { findDurableObjectFiles } from "./utils/durable-objects";
|
|
16
16
|
export { generateAuthSchema, getActiveAuthTableNames } from "./utils/auth-schema";
|
|
17
|
-
export {
|
|
17
|
+
export { ALL_CMS_TABLE_NAMES, getActiveCmsTableNames, } from "./utils/cms-table-names";
|
|
18
18
|
export { generatePaymentsSchema, getActivePaymentsTableNames } from "./utils/payments-schema";
|
|
19
19
|
export { generateNotificationsSchema, getActiveNotificationsTableNames, } from "./utils/notifications-schema";
|
|
20
20
|
export { generateCommentsSchema, getActiveCommentsTableNames, ALL_COMMENTS_TABLE_NAMES, } from "./utils/comments-schema";
|
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { dirname, resolve, normalize, relative, join } from 'pathe';
|
|
|
3
3
|
import { addTemplate, hasNuxtModule, addNitroPlugin, addServerImports, addImports, addTypeTemplate, updateTemplates, addServerImportsDir, addServerHandler, extendPages, addPlugin, addComponent, addImportsDir, addRouteMiddleware, installModule, defineNuxtModule, useLogger, createResolver } from '@nuxt/kit';
|
|
4
4
|
import { defu } from 'defu';
|
|
5
5
|
import { y as resolveTableName, z as resolveIndexName, B as buildDevWranglerConfig, l as checkDrizzleVersion, C as generateAuthSchema, D as generateCommentsSchema, E as generateStoreSchema, s as scanSchemaExports, f as discoverDatabases, F as findScheduledTasks, G as formatDlxCommand, H as resolveBindingName, I as createWranglerConfig, J as generateDevWranglerConfig, K as applyD1Migrations, x as version, L as findQueueFiles, t as findJobFiles, v as findEmailHandlerFiles, M as findDurableObjectFiles, u as findWorkflowFiles, e as ensurePackage, N as isPackageInstalled, n as findAgentFiles, o as findToolFiles, p as findBotFiles, q as findMcpFiles, m as findSchemaFiles, w as buildQarpeoManifest } from './chunks/manifest.get.mjs';
|
|
6
|
-
export { A as ALL_CMS_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES,
|
|
6
|
+
export { A as ALL_CMS_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES, b as getActiveAuthTableNames, O as getActiveCmsTableNames, P as getActiveCommentsTableNames, Q as getActiveStoreTableNames, R as hasDatabaseSchema, r as resolveDatabaseTarget, k as resolveProjectName } from './chunks/manifest.get.mjs';
|
|
7
7
|
import { createHash } from 'node:crypto';
|
|
8
8
|
import { readdir, readFile } from 'node:fs/promises';
|
|
9
9
|
import { createRequire } from 'node:module';
|
|
@@ -12,7 +12,6 @@ import { fileURLToPath } from 'node:url';
|
|
|
12
12
|
import 'node:child_process';
|
|
13
13
|
import 'node:process';
|
|
14
14
|
import 'node:readline/promises';
|
|
15
|
-
import 'drizzle-orm/sqlite-core';
|
|
16
15
|
import 'nuxt/server';
|
|
17
16
|
|
|
18
17
|
function getActivePaymentsTableNames(payments, prefixOrOptions) {
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { CMSOptions } from "../types";
|
|
2
|
+
import { type TableResolveOptions } from "../runtime/server/utils/table-names";
|
|
3
|
+
export declare const ALL_CMS_TABLE_NAMES: readonly ["cms_collection", "cms_entry", "cms_revision", "cms_category", "cms_tag", "cms_bookmark", "cms_subscriber"];
|
|
4
|
+
export declare function getActiveCmsTableNames(cms?: boolean | CMSOptions, prefixOrOptions?: boolean | string | TableResolveOptions): string[];
|