qarpeo 0.3.5 → 0.4.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.
Files changed (106) hide show
  1. package/dist/chunks/{tools.mjs → manifest.get.mjs} +229 -3
  2. package/dist/cli/index.mjs +74 -5
  3. package/dist/features/console.d.ts +4 -0
  4. package/dist/module.mjs +299 -57
  5. package/dist/runtime/app/components/{BlobImage.vue → QImg.vue} +5 -4
  6. package/dist/runtime/app/composables/console.d.ts +60 -0
  7. package/dist/runtime/app/composables/console.mjs +169 -0
  8. package/dist/runtime/app/composables/pwa.d.ts +34 -0
  9. package/dist/runtime/app/composables/pwa.mjs +86 -0
  10. package/dist/runtime/app/composables/rbac.d.ts +33 -0
  11. package/dist/runtime/app/composables/rbac.mjs +60 -0
  12. package/dist/runtime/app/composables/site.d.ts +73 -0
  13. package/dist/runtime/app/composables/site.mjs +174 -1
  14. package/dist/runtime/app/middleware/console.global.d.ts +2 -0
  15. package/dist/runtime/app/middleware/console.global.mjs +37 -0
  16. package/dist/runtime/app/plugins/pwa.client.d.ts +2 -0
  17. package/dist/runtime/app/plugins/pwa.client.mjs +28 -0
  18. package/dist/runtime/app/plugins/pwa.d.ts +2 -0
  19. package/dist/runtime/app/plugins/pwa.mjs +42 -0
  20. package/dist/runtime/app/plugins/seo.mjs +39 -10
  21. package/dist/runtime/schema.d.ts +32 -12
  22. package/dist/runtime/schema.mjs +47 -125
  23. package/dist/runtime/server/routes/__qarpeo/cloud/agents/run.post.d.ts +13 -0
  24. package/dist/runtime/server/routes/__qarpeo/cloud/agents/run.post.mjs +46 -0
  25. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.get.d.ts +22 -0
  26. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.get.mjs +40 -0
  27. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.post.d.ts +20 -0
  28. package/dist/runtime/server/routes/__qarpeo/cloud/cms/entry.post.mjs +52 -0
  29. package/dist/runtime/server/routes/__qarpeo/cloud/cms.get.d.ts +26 -0
  30. package/dist/runtime/server/routes/__qarpeo/cloud/cms.get.mjs +80 -0
  31. package/dist/runtime/server/routes/__qarpeo/cloud/comments/moderate.post.d.ts +16 -0
  32. package/dist/runtime/server/routes/__qarpeo/cloud/comments/moderate.post.mjs +30 -0
  33. package/dist/runtime/server/routes/__qarpeo/cloud/comments.get.d.ts +21 -0
  34. package/dist/runtime/server/routes/__qarpeo/cloud/comments.get.mjs +49 -0
  35. package/dist/runtime/server/routes/__qarpeo/cloud/extras.get.d.ts +22 -0
  36. package/dist/runtime/server/routes/__qarpeo/cloud/extras.get.mjs +65 -0
  37. package/dist/runtime/server/routes/__qarpeo/cloud/mail/unsuppress.post.d.ts +12 -0
  38. package/dist/runtime/server/routes/__qarpeo/cloud/mail/unsuppress.post.mjs +17 -0
  39. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/cms.post.d.ts +22 -0
  40. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/cms.post.mjs +87 -0
  41. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/products.post.d.ts +25 -0
  42. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/products.post.mjs +119 -0
  43. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/users.post.d.ts +19 -0
  44. package/dist/runtime/server/routes/__qarpeo/cloud/migrate/users.post.mjs +86 -0
  45. package/dist/runtime/server/routes/__qarpeo/cloud/migrate.post.d.ts +21 -0
  46. package/dist/runtime/server/routes/__qarpeo/cloud/migrate.post.mjs +91 -0
  47. package/dist/runtime/server/routes/__qarpeo/cloud/notifications/test.post.d.ts +13 -0
  48. package/dist/runtime/server/routes/__qarpeo/cloud/notifications/test.post.mjs +49 -0
  49. package/dist/runtime/server/routes/__qarpeo/cloud/operations.get.d.ts +43 -0
  50. package/dist/runtime/server/routes/__qarpeo/cloud/operations.get.mjs +111 -0
  51. package/dist/runtime/server/routes/__qarpeo/cloud/overview.get.d.ts +22 -0
  52. package/dist/runtime/server/routes/__qarpeo/cloud/overview.get.mjs +44 -0
  53. package/dist/runtime/server/routes/__qarpeo/cloud/store/order-status.post.d.ts +9 -0
  54. package/dist/runtime/server/routes/__qarpeo/cloud/store/order-status.post.mjs +27 -0
  55. package/dist/runtime/server/routes/__qarpeo/cloud/store/orders.get.d.ts +23 -0
  56. package/dist/runtime/server/routes/__qarpeo/cloud/store/orders.get.mjs +56 -0
  57. package/dist/runtime/server/routes/__qarpeo/cloud/store/products.get.d.ts +21 -0
  58. package/dist/runtime/server/routes/__qarpeo/cloud/store/products.get.mjs +50 -0
  59. package/dist/runtime/server/routes/__qarpeo/cloud/tasks/run.post.d.ts +12 -0
  60. package/dist/runtime/server/routes/__qarpeo/cloud/tasks/run.post.mjs +24 -0
  61. package/dist/runtime/server/routes/__qarpeo/cloud/users/action.post.d.ts +26 -0
  62. package/dist/runtime/server/routes/__qarpeo/cloud/users/action.post.mjs +40 -0
  63. package/dist/runtime/server/routes/__qarpeo/cloud/users.get.d.ts +39 -0
  64. package/dist/runtime/server/routes/__qarpeo/cloud/users.get.mjs +69 -0
  65. package/dist/runtime/server/routes/__qarpeo/manifest.get.d.ts +39 -0
  66. package/dist/runtime/server/routes/__qarpeo/manifest.get.mjs +226 -0
  67. package/dist/runtime/server/routes/__qarpeo/og.get.d.ts +15 -0
  68. package/dist/runtime/server/routes/__qarpeo/og.get.mjs +109 -0
  69. package/dist/runtime/server/routes/__qarpeo/rbac/me.get.d.ts +26 -0
  70. package/dist/runtime/server/routes/__qarpeo/rbac/me.get.mjs +23 -0
  71. package/dist/runtime/server/routes/__qarpeo/rbac/roles.delete.d.ts +12 -0
  72. package/dist/runtime/server/routes/__qarpeo/rbac/roles.delete.mjs +12 -0
  73. package/dist/runtime/server/routes/__qarpeo/rbac/roles.get.d.ts +16 -0
  74. package/dist/runtime/server/routes/__qarpeo/rbac/roles.get.mjs +15 -0
  75. package/dist/runtime/server/routes/__qarpeo/rbac/roles.post.d.ts +11 -0
  76. package/dist/runtime/server/routes/__qarpeo/rbac/roles.post.mjs +16 -0
  77. package/dist/runtime/server/routes/__qarpeo/rbac/users.post.d.ts +14 -0
  78. package/dist/runtime/server/routes/__qarpeo/rbac/users.post.mjs +19 -0
  79. package/dist/runtime/server/routes/manifest.webmanifest.get.d.ts +2 -0
  80. package/dist/runtime/server/routes/manifest.webmanifest.get.mjs +31 -0
  81. package/dist/runtime/server/routes/robots.txt.get.mjs +20 -4
  82. package/dist/runtime/server/routes/sitemap.xml.get.mjs +47 -6
  83. package/dist/runtime/server/routes/sw.js.get.d.ts +8 -0
  84. package/dist/runtime/server/routes/sw.js.get.mjs +141 -0
  85. package/dist/runtime/server/utils/auth.d.ts +2 -14
  86. package/dist/runtime/server/utils/auth.mjs +32 -36
  87. package/dist/runtime/server/utils/cloud-auth.d.ts +8 -0
  88. package/dist/runtime/server/utils/cloud-auth.mjs +23 -0
  89. package/dist/runtime/server/utils/console.d.ts +19 -0
  90. package/dist/runtime/server/utils/console.mjs +34 -0
  91. package/dist/runtime/server/utils/legacy-hash.d.ts +76 -0
  92. package/dist/runtime/server/utils/legacy-hash.mjs +96 -0
  93. package/dist/runtime/server/utils/rbac.d.ts +89 -0
  94. package/dist/runtime/server/utils/rbac.mjs +427 -0
  95. package/dist/runtime/server/utils/role-env.d.ts +19 -0
  96. package/dist/runtime/server/utils/role-env.mjs +34 -0
  97. package/dist/runtime/server.d.ts +2 -0
  98. package/dist/runtime/server.mjs +2 -0
  99. package/dist/types/console.d.ts +67 -0
  100. package/dist/types/index.d.ts +1 -0
  101. package/dist/types/options.d.ts +9 -0
  102. package/dist/types/site.d.ts +102 -0
  103. package/dist/types/storage.d.ts +5 -11
  104. package/package.json +1 -1
  105. package/dist/runtime/providers/qarpeo.d.ts +0 -23
  106. package/dist/runtime/providers/qarpeo.mjs +0 -46
@@ -7,11 +7,11 @@ import { stdin, stdout } from 'node:process';
7
7
  import readline from 'node:readline/promises';
8
8
  import { fileURLToPath } from 'node:url';
9
9
  import { snakeCase, integer, text, index, uniqueIndex } from 'drizzle-orm/sqlite-core';
10
- import { useRuntimeConfig } from 'nuxt/server';
10
+ import { useRuntimeConfig, defineEventHandler } 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.5";
14
+ const version = "0.4.1";
15
15
 
16
16
  function resolveBindingName(service, override, defaultName) {
17
17
  if (override && typeof override === "string") {
@@ -2639,4 +2639,230 @@ function findToolFiles(layers, customDir) {
2639
2639
  return Array.from(toolsMap.values());
2640
2640
  }
2641
2641
 
2642
- export { ALL_CMS_TABLE_NAMES as A, generateAuthSchema as B, generateCommentsSchema as C, generateStoreSchema as D, findScheduledTasks as E, formatDlxCommand as F, resolveBindingName as G, createWranglerConfig as H, generateDevWranglerConfig as I, applyD1Migrations as J, findQueueFiles as K, findDurableObjectFiles as L, cmsBookmarks as M, cmsCategories as N, cmsCollections as O, cmsEntries as P, cmsRevisions as Q, cmsSubscribers as R, cmsTags as S, getActiveCmsTableNames as T, getActiveCommentsTableNames as U, getActiveStoreTableNames as V, hasDatabaseSchema as W, localDb as X, authSchema as Y, wrangler as Z, 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, version as w, resolveTableName as x, resolveIndexName as y, buildDevWranglerConfig as z };
2642
+ function buildQarpeoManifest(options, qarpeoVersion = "0.0.0") {
2643
+ const opts = options;
2644
+ const hasDb = Boolean(opts.db || opts.d1);
2645
+ const hasKv = Boolean(opts.kv);
2646
+ const hasBlob = Boolean(opts.blob || opts.r2);
2647
+ const hasAi = Boolean(opts.ai);
2648
+ const hasVectorize = Boolean(opts.vectorize);
2649
+ const hasQueue = Boolean(opts.queue);
2650
+ const hasHyperdrive = Boolean(opts.hyperdrive);
2651
+ const hasBrowser = Boolean(opts.browser);
2652
+ const hasAnalytics = Boolean(opts.analytics);
2653
+ const hasDo = Boolean(opts.do || opts.agents);
2654
+ const hasAuth = Boolean(opts.auth);
2655
+ const hasEmail = Boolean(opts.email || opts.mail);
2656
+ const hasPayments = Boolean(opts.payments);
2657
+ const hasNotifications = Boolean(opts.notifications || opts.notify);
2658
+ const hasComments = Boolean(opts.comments);
2659
+ const hasCms = Boolean(opts.cms);
2660
+ const hasStore = Boolean(opts.store);
2661
+ const hasAgents = Boolean(opts.agents);
2662
+ const hasMultitenant = Boolean(opts.multitenant);
2663
+ const hasSite = Boolean(opts.site || opts.seo);
2664
+ const hasPwa = Boolean(opts.pwa || typeof opts.site === "object" && opts.site?.pwa);
2665
+ const features = {
2666
+ db: hasDb,
2667
+ kv: hasKv,
2668
+ blob: hasBlob,
2669
+ ai: hasAi,
2670
+ vectorize: hasVectorize,
2671
+ queue: hasQueue,
2672
+ workflows: Boolean(opts.workflows),
2673
+ hyperdrive: hasHyperdrive,
2674
+ browser: hasBrowser,
2675
+ analytics: hasAnalytics,
2676
+ ratelimit: Boolean(opts.ratelimit),
2677
+ do: hasDo,
2678
+ auth: hasAuth,
2679
+ email: hasEmail,
2680
+ payments: hasPayments,
2681
+ notifications: hasNotifications,
2682
+ comments: hasComments,
2683
+ cms: hasCms,
2684
+ store: hasStore,
2685
+ agents: hasAgents,
2686
+ multitenant: hasMultitenant,
2687
+ site: hasSite,
2688
+ pwa: hasPwa
2689
+ };
2690
+ const expectedBindings = [];
2691
+ if (hasDb) {
2692
+ expectedBindings.push({
2693
+ type: "d1",
2694
+ name: typeof opts.db === "object" && opts.db.binding ? opts.db.binding : "DB",
2695
+ feature: "db",
2696
+ required: true
2697
+ });
2698
+ }
2699
+ if (hasKv) {
2700
+ expectedBindings.push({
2701
+ type: "kv_namespace",
2702
+ name: typeof opts.kv === "object" && opts.kv.binding ? opts.kv.binding : "KV",
2703
+ feature: "kv",
2704
+ required: true
2705
+ });
2706
+ }
2707
+ if (hasBlob) {
2708
+ expectedBindings.push({
2709
+ type: "r2_bucket",
2710
+ name: typeof opts.blob === "object" && opts.blob.binding ? opts.blob.binding : "BLOB",
2711
+ feature: "blob",
2712
+ required: true
2713
+ });
2714
+ }
2715
+ if (hasAi) {
2716
+ expectedBindings.push({ type: "ai", name: "AI", feature: "ai", required: true });
2717
+ }
2718
+ if (hasVectorize) {
2719
+ expectedBindings.push({
2720
+ type: "vectorize",
2721
+ name: typeof opts.vectorize === "object" && opts.vectorize.binding ? opts.vectorize.binding : "VECTORIZE",
2722
+ feature: "vectorize",
2723
+ required: true
2724
+ });
2725
+ }
2726
+ if (hasQueue) {
2727
+ expectedBindings.push({
2728
+ type: "queue",
2729
+ name: typeof opts.queue === "object" && opts.queue.binding ? opts.queue.binding : "QUEUE",
2730
+ feature: "queue",
2731
+ required: true
2732
+ });
2733
+ }
2734
+ if (hasHyperdrive) {
2735
+ expectedBindings.push({
2736
+ type: "hyperdrive",
2737
+ name: typeof opts.hyperdrive === "object" && opts.hyperdrive.binding ? opts.hyperdrive.binding : "HYPERDRIVE",
2738
+ feature: "hyperdrive",
2739
+ required: true
2740
+ });
2741
+ }
2742
+ if (hasBrowser) {
2743
+ expectedBindings.push({
2744
+ type: "browser",
2745
+ name: "BROWSER",
2746
+ feature: "browser",
2747
+ required: false
2748
+ });
2749
+ }
2750
+ if (hasAnalytics) {
2751
+ expectedBindings.push({
2752
+ type: "analytics_engine",
2753
+ name: "ANALYTICS",
2754
+ feature: "analytics",
2755
+ required: false
2756
+ });
2757
+ }
2758
+ const expectedSecrets = [];
2759
+ if (hasAuth || hasBlob || hasStore) {
2760
+ expectedSecrets.push({
2761
+ key: "NUXT_APP_SECRET",
2762
+ feature: hasAuth ? "auth" : hasBlob ? "blob" : "store",
2763
+ required: true,
2764
+ description: "Signing secret for auth sessions, preview tokens, and signed R2 URLs.",
2765
+ generatable: "secret"
2766
+ });
2767
+ }
2768
+ if (hasNotifications) {
2769
+ expectedSecrets.push(
2770
+ {
2771
+ key: "VAPID_PUBLIC_KEY",
2772
+ feature: "notifications",
2773
+ required: false,
2774
+ description: "Web Push VAPID public key.",
2775
+ generatable: "vapid"
2776
+ },
2777
+ {
2778
+ key: "VAPID_PRIVATE_KEY",
2779
+ feature: "notifications",
2780
+ required: false,
2781
+ description: "Web Push VAPID private key.",
2782
+ generatable: "vapid"
2783
+ }
2784
+ );
2785
+ }
2786
+ if (hasPayments) {
2787
+ expectedSecrets.push(
2788
+ {
2789
+ key: "STRIPE_SECRET_KEY",
2790
+ feature: "payments",
2791
+ required: true,
2792
+ description: "Stripe API secret key for checkout & portal."
2793
+ },
2794
+ {
2795
+ key: "STRIPE_WEBHOOK_SECRET",
2796
+ feature: "payments",
2797
+ required: true,
2798
+ description: "Stripe webhook signing secret."
2799
+ }
2800
+ );
2801
+ }
2802
+ if (hasEmail) {
2803
+ expectedSecrets.push({
2804
+ key: "RESEND_API_KEY",
2805
+ feature: "email",
2806
+ required: false,
2807
+ description: "Transactional email provider API key (when not using CF Email Routing)."
2808
+ });
2809
+ }
2810
+ const endpoints = {};
2811
+ if (hasSite) {
2812
+ endpoints.robots = "/robots.txt";
2813
+ endpoints.sitemap = "/sitemap.xml";
2814
+ endpoints.og = "/__qarpeo/og";
2815
+ }
2816
+ if (hasPwa) {
2817
+ endpoints.manifest = "/manifest.webmanifest";
2818
+ endpoints.sw = "/sw.js";
2819
+ }
2820
+ return {
2821
+ qarpeoVersion,
2822
+ workerName: typeof opts.workerName === "string" ? opts.workerName : null,
2823
+ features,
2824
+ expectedBindings,
2825
+ expectedSecrets,
2826
+ endpoints
2827
+ };
2828
+ }
2829
+ defineEventHandler((event) => {
2830
+ const config = useRuntimeConfig();
2831
+ const baseManifest = config.qarpeo?.manifest;
2832
+ const cfEnv = event.context?.cloudflare?.env;
2833
+ const manifest = baseManifest || {
2834
+ qarpeoVersion: config.public?.qarpeoVersion || "0.0.0",
2835
+ workerName: null,
2836
+ features: {},
2837
+ expectedBindings: [],
2838
+ expectedSecrets: [],
2839
+ endpoints: {}
2840
+ };
2841
+ const bindingPresence = {};
2842
+ for (const b of manifest.expectedBindings) {
2843
+ bindingPresence[b.name] = Boolean(cfEnv && b.name in cfEnv && cfEnv[b.name] !== void 0);
2844
+ }
2845
+ const secretPresence = {};
2846
+ for (const s of manifest.expectedSecrets) {
2847
+ secretPresence[s.key] = Boolean(
2848
+ cfEnv && typeof cfEnv[s.key] === "string" && cfEnv[s.key].length > 0 || typeof process !== "undefined" && typeof process.env?.[s.key] === "string" && process.env[s.key].length > 0
2849
+ );
2850
+ }
2851
+ return new Response(
2852
+ JSON.stringify({
2853
+ ...manifest,
2854
+ liveEnvPresence: {
2855
+ bindings: bindingPresence,
2856
+ secrets: secretPresence
2857
+ }
2858
+ }),
2859
+ {
2860
+ headers: {
2861
+ "Content-Type": "application/json; charset=UTF-8",
2862
+ "Cache-Control": "no-store"
2863
+ }
2864
+ }
2865
+ );
2866
+ });
2867
+
2868
+ 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, cmsBookmarks as N, cmsCategories as O, cmsCollections as P, cmsEntries as Q, cmsRevisions as R, cmsSubscribers as S, cmsTags as T, getActiveCmsTableNames as U, getActiveCommentsTableNames as V, getActiveStoreTableNames as W, hasDatabaseSchema as X, localDb as Y, authSchema as Z, wrangler as _, 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 };
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { defineCommand, runMain } from 'citty';
3
- import { r as resolveDatabaseTarget, a as resolveBinaryPath, e as ensurePackage, g as getLocalDatabaseContext, b as getActiveAuthTableNames, A as ALL_CMS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, s as scanSchemaExports, f as discoverDatabases, h as findLocalD1Database, i as spawnBinSync, j as getJiti, k as resolveProjectName, l as checkDrizzleVersion, m as findSchemaFiles, n as findAgentFiles, o as findToolFiles, p as findBotFiles, q as findMcpFiles, t as findJobFiles, u as findWorkflowFiles, v as findEmailHandlerFiles, w as version } from '../chunks/tools.mjs';
3
+ import { r as resolveDatabaseTarget, a as resolveBinaryPath, e as ensurePackage, g as getLocalDatabaseContext, b as getActiveAuthTableNames, A as ALL_CMS_TABLE_NAMES, c as ALL_STORE_TABLE_NAMES, d as ALL_COMMENTS_TABLE_NAMES, s as scanSchemaExports, f as discoverDatabases, h as findLocalD1Database, i as spawnBinSync, j as getJiti, k as resolveProjectName, l as checkDrizzleVersion, m as findSchemaFiles, n as findAgentFiles, o as findToolFiles, p as findBotFiles, q as findMcpFiles, t as findJobFiles, u as findWorkflowFiles, v as findEmailHandlerFiles, w as buildQarpeoManifest, x as version } from '../chunks/manifest.get.mjs';
4
4
  import { spawnSync, spawn } from 'node:child_process';
5
5
  import { existsSync, mkdirSync, writeFileSync, readFileSync, rmSync, readdirSync, statSync } from 'node:fs';
6
6
  import { loadNuxtConfig } from '@nuxt/kit';
@@ -9,6 +9,7 @@ import { reset, seed } from 'drizzle-seed';
9
9
  import { stdin, stdout } from 'node:process';
10
10
  import readline from 'node:readline/promises';
11
11
  import { hostname, homedir } from 'node:os';
12
+ import { randomBytes } from 'node:crypto';
12
13
  import 'node:module';
13
14
  import 'drizzle-orm/node-sqlite';
14
15
  import 'node:url';
@@ -1324,7 +1325,7 @@ const migrate = defineCommand({
1324
1325
  } else if (existsSync(resolve(cwd, ".nuxt/wrangler.json"))) {
1325
1326
  wranglerConfigPath = resolve(cwd, ".nuxt/wrangler.json");
1326
1327
  } else {
1327
- const { generateDevWranglerConfig } = await import('../chunks/tools.mjs').then(function (n) { return n.Z; });
1328
+ const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n._; });
1328
1329
  const buildDir = resolve(cwd, ".nuxt");
1329
1330
  wranglerConfigPath = await generateDevWranglerConfig(
1330
1331
  {
@@ -1596,8 +1597,8 @@ const migrate = defineCommand({
1596
1597
  if (args.prune && targets.some((t) => t.isPrimary)) {
1597
1598
  const primaryTarget = targets.find((t) => t.isPrimary);
1598
1599
  const primaryBinding = primaryTarget.binding;
1599
- const { getActiveAuthTableNames, ALL_AUTH_TABLE_NAMES } = await import('../chunks/tools.mjs').then(function (n) { return n.Y; });
1600
- const { findLocalD1Database } = await import('../chunks/tools.mjs').then(function (n) { return n.X; });
1600
+ const { getActiveAuthTableNames, ALL_AUTH_TABLE_NAMES } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.Z; });
1601
+ const { findLocalD1Database } = await import('../chunks/manifest.get.mjs').then(function (n) { return n.Y; });
1601
1602
  const authConfig = nuxtConfig.qarpeo?.auth || nuxtConfig.auth;
1602
1603
  const activeTables = getActiveAuthTableNames(authConfig);
1603
1604
  const unusedTables = ALL_AUTH_TABLE_NAMES.filter(
@@ -2468,7 +2469,7 @@ const deploy = defineCommand({
2468
2469
  if (!wranglerConfigPath) {
2469
2470
  try {
2470
2471
  const { loadNuxtConfig } = await import('@nuxt/kit');
2471
- const { generateDevWranglerConfig } = await import('../chunks/tools.mjs').then(function (n) { return n.Z; });
2472
+ const { generateDevWranglerConfig } = await import('../chunks/manifest.get.mjs').then(function (n) { return n._; });
2472
2473
  const nuxtConfig = await loadNuxtConfig({ cwd });
2473
2474
  const qarpeoOpts = nuxtConfig.qarpeo || {};
2474
2475
  const buildDir = resolve(cwd, ".nuxt");
@@ -3894,6 +3895,73 @@ const logs = defineCommand({
3894
3895
  }
3895
3896
  });
3896
3897
 
3898
+ const inspect = defineCommand({
3899
+ meta: {
3900
+ name: "inspect",
3901
+ description: "Inspect enabled Qarpeo features, expected bindings, and secrets for Qarpeo Cloud"
3902
+ },
3903
+ args: {
3904
+ cwd: { type: "string", description: "Project root directory", default: "." },
3905
+ json: { type: "boolean", description: "Output raw manifest JSON", default: false }
3906
+ },
3907
+ async run({ args }) {
3908
+ const cwd = resolve(args.cwd);
3909
+ const nuxtConfig = await loadNuxtConfig({ cwd }).catch(() => ({}));
3910
+ const qarpeoOpts = nuxtConfig.qarpeo || {};
3911
+ const manifest = buildQarpeoManifest(qarpeoOpts, version);
3912
+ if (args.json) {
3913
+ console.log(JSON.stringify(manifest, null, 2));
3914
+ return;
3915
+ }
3916
+ const enabled = Object.entries(manifest.features).filter(([, on]) => on).map(([k]) => k);
3917
+ console.log(`
3918
+ Qarpeo Cloud Manifest (v${manifest.qarpeoVersion})`);
3919
+ console.log(`Enabled features (${enabled.length}): ${enabled.join(", ") || "none"}`);
3920
+ if (manifest.expectedBindings.length > 0) {
3921
+ console.log("\nExpected Cloudflare Bindings:");
3922
+ for (const b of manifest.expectedBindings) {
3923
+ console.log(` - ${b.name} (${b.type}) [${b.feature}]${b.required ? " *required" : ""}`);
3924
+ }
3925
+ }
3926
+ if (manifest.expectedSecrets.length > 0) {
3927
+ console.log("\nExpected Secrets:");
3928
+ for (const s of manifest.expectedSecrets) {
3929
+ console.log(` - ${s.key} [${s.feature}] \u2014 ${s.description}`);
3930
+ }
3931
+ }
3932
+ const envPath = join(cwd, ".env");
3933
+ const hasCloudSecret = Boolean(process.env.QARPEO_CLOUD_SECRET) || existsSync(envPath) && readFileSync(envPath, "utf8").includes("QARPEO_CLOUD_SECRET=");
3934
+ console.log(
3935
+ `
3936
+ QARPEO_CLOUD_SECRET: ${hasCloudSecret ? "detected locally" : "not set (use Qarpeo Cloud -> Connect Runtime or 'qp cloud keygen')"}`
3937
+ );
3938
+ console.log("");
3939
+ }
3940
+ });
3941
+ const keygen = defineCommand({
3942
+ meta: {
3943
+ name: "keygen",
3944
+ description: "Generate a cryptographically random QARPEO_CLOUD_SECRET token"
3945
+ },
3946
+ run() {
3947
+ const token = `qpc_${randomBytes(32).toString("hex")}`;
3948
+ console.log(`
3949
+ QARPEO_CLOUD_SECRET=${token}
3950
+ `);
3951
+ console.log("Add this to your Worker secrets via `qp secret push` or Qarpeo Cloud -> Connect Runtime.");
3952
+ }
3953
+ });
3954
+ const cloud = defineCommand({
3955
+ meta: {
3956
+ name: "cloud",
3957
+ description: "Qarpeo Cloud inspection and runtime bridge utilities"
3958
+ },
3959
+ subCommands: {
3960
+ inspect,
3961
+ keygen
3962
+ }
3963
+ });
3964
+
3897
3965
  function getWranglerBin$2(cwd) {
3898
3966
  return resolveBinaryPath("wrangler", cwd) || resolveBinaryPath("wrangler") || (process.platform === "win32" ? "wrangler.cmd" : "wrangler");
3899
3967
  }
@@ -5289,6 +5357,7 @@ const main = defineCommand({
5289
5357
  description: "Cloudflare-native powerhouse module for Nuxt"
5290
5358
  },
5291
5359
  subCommands: {
5360
+ cloud,
5292
5361
  db,
5293
5362
  kv,
5294
5363
  storage,
@@ -0,0 +1,4 @@
1
+ import type { Nuxt } from "@nuxt/schema";
2
+ import type { createResolver, useLogger } from "@nuxt/kit";
3
+ import type { QarpeoOptions } from "../types";
4
+ export declare function setupConsole(options: QarpeoOptions, nuxt: Nuxt, resolver: ReturnType<typeof createResolver>, logger: ReturnType<typeof useLogger>): Promise<void>;