create-questpie 2.0.3 → 2.1.0

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 (153) hide show
  1. package/dist/index.mjs +544 -87
  2. package/package.json +2 -3
  3. package/templates/elysia/AGENTS.md +56 -0
  4. package/templates/elysia/CLAUDE.md +39 -0
  5. package/templates/elysia/Dockerfile +24 -0
  6. package/templates/elysia/README.md +148 -0
  7. package/templates/elysia/docker/init-extensions.sql +11 -0
  8. package/templates/elysia/docker-compose.yml +21 -0
  9. package/templates/elysia/env.example +16 -0
  10. package/templates/elysia/gitignore +6 -0
  11. package/templates/elysia/package.json +47 -0
  12. package/templates/elysia/questpie.config.ts +12 -0
  13. package/templates/elysia/src/index.ts +21 -0
  14. package/templates/elysia/src/lib/auth-client.ts +32 -0
  15. package/templates/elysia/src/lib/client.ts +13 -0
  16. package/templates/elysia/src/lib/env.ts +24 -0
  17. package/templates/elysia/src/lib/query-client.ts +18 -0
  18. package/templates/elysia/src/lib/query.ts +18 -0
  19. package/templates/elysia/src/questpie/server/.generated/context.gen.ts +200 -0
  20. package/templates/elysia/src/questpie/server/.generated/entities.gen.ts +84 -0
  21. package/templates/elysia/src/questpie/server/.generated/factories.ts +65 -0
  22. package/templates/elysia/src/questpie/server/.generated/index.ts +131 -0
  23. package/templates/elysia/src/questpie/server/.generated/names.gen.ts +25 -0
  24. package/templates/elysia/src/questpie/server/app.ts +10 -0
  25. package/templates/elysia/src/questpie/server/collections/index.ts +1 -0
  26. package/templates/elysia/src/questpie/server/collections/posts.collection.ts +10 -0
  27. package/templates/elysia/src/questpie/server/config/auth.ts +8 -0
  28. package/templates/elysia/src/questpie/server/config/openapi.ts +10 -0
  29. package/templates/elysia/src/questpie/server/globals/index.ts +1 -0
  30. package/templates/elysia/src/questpie/server/globals/site-settings.global.ts +10 -0
  31. package/templates/elysia/src/questpie/server/modules.ts +8 -0
  32. package/templates/elysia/src/questpie/server/questpie.config.ts +21 -0
  33. package/templates/elysia/tsconfig.json +28 -0
  34. package/templates/hono/AGENTS.md +56 -0
  35. package/templates/hono/CLAUDE.md +39 -0
  36. package/templates/hono/Dockerfile +24 -0
  37. package/templates/hono/README.md +148 -0
  38. package/templates/hono/docker/init-extensions.sql +11 -0
  39. package/templates/hono/docker-compose.yml +21 -0
  40. package/templates/hono/env.example +16 -0
  41. package/templates/hono/gitignore +6 -0
  42. package/templates/hono/package.json +47 -0
  43. package/templates/hono/questpie.config.ts +12 -0
  44. package/templates/hono/src/index.ts +30 -0
  45. package/templates/hono/src/lib/auth-client.ts +32 -0
  46. package/templates/hono/src/lib/client.ts +13 -0
  47. package/templates/hono/src/lib/env.ts +24 -0
  48. package/templates/hono/src/lib/query-client.ts +18 -0
  49. package/templates/hono/src/lib/query.ts +18 -0
  50. package/templates/hono/src/questpie/server/.generated/context.gen.ts +200 -0
  51. package/templates/hono/src/questpie/server/.generated/entities.gen.ts +84 -0
  52. package/templates/hono/src/questpie/server/.generated/factories.ts +65 -0
  53. package/templates/hono/src/questpie/server/.generated/index.ts +131 -0
  54. package/templates/hono/src/questpie/server/.generated/names.gen.ts +25 -0
  55. package/templates/hono/src/questpie/server/app.ts +10 -0
  56. package/templates/hono/src/questpie/server/collections/index.ts +1 -0
  57. package/templates/hono/src/questpie/server/collections/posts.collection.ts +10 -0
  58. package/templates/hono/src/questpie/server/config/auth.ts +8 -0
  59. package/templates/hono/src/questpie/server/config/openapi.ts +10 -0
  60. package/templates/hono/src/questpie/server/globals/index.ts +1 -0
  61. package/templates/hono/src/questpie/server/globals/site-settings.global.ts +10 -0
  62. package/templates/hono/src/questpie/server/modules.ts +8 -0
  63. package/templates/hono/src/questpie/server/questpie.config.ts +21 -0
  64. package/templates/hono/tsconfig.json +28 -0
  65. package/templates/next/AGENTS.md +55 -0
  66. package/templates/next/CLAUDE.md +39 -0
  67. package/templates/next/Dockerfile +25 -0
  68. package/templates/next/README.md +148 -0
  69. package/templates/next/components.json +22 -0
  70. package/templates/next/docker/init-extensions.sql +11 -0
  71. package/templates/next/docker-compose.yml +21 -0
  72. package/templates/next/env.example +16 -0
  73. package/templates/next/gitignore +10 -0
  74. package/templates/next/next-env.d.ts +5 -0
  75. package/templates/next/next.config.ts +20 -0
  76. package/templates/next/package.json +54 -0
  77. package/templates/next/postcss.config.mjs +8 -0
  78. package/templates/next/public/.gitkeep +0 -0
  79. package/templates/next/questpie.config.ts +12 -0
  80. package/templates/next/src/app/admin/[[...all]]/page.tsx +34 -0
  81. package/templates/next/src/app/admin/admin.css +4 -0
  82. package/templates/next/src/app/admin/layout.tsx +63 -0
  83. package/templates/next/src/app/api/[...all]/route.ts +24 -0
  84. package/templates/next/src/app/layout.tsx +24 -0
  85. package/templates/next/src/app/not-found.tsx +18 -0
  86. package/templates/next/src/app/page.tsx +74 -0
  87. package/templates/next/src/app/providers.tsx +11 -0
  88. package/templates/next/src/lib/auth-client.ts +12 -0
  89. package/templates/next/src/lib/client.ts +13 -0
  90. package/templates/next/src/lib/env.ts +24 -0
  91. package/templates/next/src/lib/query-client.ts +18 -0
  92. package/templates/next/src/lib/query.ts +18 -0
  93. package/templates/next/src/questpie/admin/.generated/client.ts +13 -0
  94. package/templates/next/src/questpie/admin/admin.ts +9 -0
  95. package/templates/next/src/questpie/admin/modules.ts +3 -0
  96. package/templates/next/src/questpie/server/.generated/context.gen.ts +204 -0
  97. package/templates/next/src/questpie/server/.generated/entities.gen.ts +100 -0
  98. package/templates/next/src/questpie/server/.generated/factories.ts +204 -0
  99. package/templates/next/src/questpie/server/.generated/index.ts +139 -0
  100. package/templates/next/src/questpie/server/.generated/names.gen.ts +31 -0
  101. package/templates/next/src/questpie/server/app.ts +10 -0
  102. package/templates/next/src/questpie/server/collections/index.ts +1 -0
  103. package/templates/next/src/questpie/server/collections/posts.collection.ts +58 -0
  104. package/templates/next/src/questpie/server/config/admin.ts +80 -0
  105. package/templates/next/src/questpie/server/config/auth.ts +8 -0
  106. package/templates/next/src/questpie/server/config/openapi.ts +10 -0
  107. package/templates/next/src/questpie/server/globals/index.ts +1 -0
  108. package/templates/next/src/questpie/server/globals/site-settings.global.ts +19 -0
  109. package/templates/next/src/questpie/server/modules.ts +9 -0
  110. package/templates/next/src/questpie/server/questpie.config.ts +21 -0
  111. package/templates/next/src/styles.css +125 -0
  112. package/templates/next/tsconfig.json +37 -0
  113. package/templates/tanstack-start/AGENTS.md +35 -600
  114. package/templates/tanstack-start/CLAUDE.md +26 -127
  115. package/templates/tanstack-start/README.md +20 -7
  116. package/templates/tanstack-start/docker/init-extensions.sql +11 -0
  117. package/templates/tanstack-start/docker-compose.yml +1 -0
  118. package/templates/tanstack-start/package.json +1 -0
  119. package/templates/tanstack-start/src/lib/auth-client.ts +1 -1
  120. package/templates/tanstack-start/src/lib/client.ts +1 -1
  121. package/templates/tanstack-start/src/lib/query.ts +18 -0
  122. package/templates/tanstack-start/src/questpie/admin/modules.ts +3 -1
  123. package/templates/tanstack-start/src/questpie/server/.generated/factories.ts +10 -9
  124. package/templates/tanstack-start/src/questpie/server/collections/index.ts +1 -1
  125. package/templates/tanstack-start/src/questpie/server/config/auth.ts +1 -1
  126. package/templates/tanstack-start/src/questpie/server/globals/index.ts +1 -1
  127. package/templates/tanstack-start/src/questpie/server/modules.ts +4 -5
  128. package/templates/tanstack-start/src/questpie/server/questpie.config.ts +3 -2
  129. package/templates/tanstack-start/src/routes/__root.tsx +31 -1
  130. package/templates/tanstack-start/src/routes/api/$.ts +2 -3
  131. package/templates/tanstack-start/src/routes/index.tsx +97 -0
  132. package/templates/tanstack-start/vite.config.ts +2 -2
  133. package/skills/questpie/AGENTS.md +0 -2670
  134. package/skills/questpie/SKILL.md +0 -260
  135. package/skills/questpie/references/auth.md +0 -121
  136. package/skills/questpie/references/business-logic.md +0 -550
  137. package/skills/questpie/references/codegen-plugin-api.md +0 -382
  138. package/skills/questpie/references/crud-api.md +0 -378
  139. package/skills/questpie/references/data-modeling.md +0 -493
  140. package/skills/questpie/references/extend.md +0 -557
  141. package/skills/questpie/references/field-types.md +0 -386
  142. package/skills/questpie/references/infrastructure-adapters.md +0 -545
  143. package/skills/questpie/references/multi-tenancy.md +0 -364
  144. package/skills/questpie/references/production.md +0 -475
  145. package/skills/questpie/references/query-operators.md +0 -125
  146. package/skills/questpie/references/quickstart.md +0 -564
  147. package/skills/questpie/references/rules.md +0 -389
  148. package/skills/questpie/references/tanstack-query.md +0 -520
  149. package/skills/questpie-admin/AGENTS.md +0 -1508
  150. package/skills/questpie-admin/SKILL.md +0 -436
  151. package/skills/questpie-admin/references/blocks.md +0 -331
  152. package/skills/questpie-admin/references/custom-ui.md +0 -305
  153. package/skills/questpie-admin/references/views.md +0 -449
@@ -0,0 +1,74 @@
1
+ import Link from "next/link";
2
+
3
+ export default function Home() {
4
+ return (
5
+ <main className="mx-auto flex min-h-screen max-w-3xl flex-col items-center justify-center px-6 py-16 text-center">
6
+ <span className="text-muted-foreground mb-4 text-xs font-medium uppercase tracking-widest">
7
+ Powered by QUESTPIE
8
+ </span>
9
+ <h1 className="text-4xl font-bold tracking-tight sm:text-5xl">
10
+ {"{{projectName}}"}
11
+ </h1>
12
+ <p className="text-muted-foreground mt-4 text-lg">
13
+ Your QUESTPIE app is running. Here is where to go next.
14
+ </p>
15
+
16
+ <div className="mt-12 grid w-full grid-cols-1 gap-4 text-left sm:grid-cols-3">
17
+ <Link
18
+ href="/admin"
19
+ className="group hover:border-primary/30 block rounded-lg border p-5 transition-all hover:shadow-md"
20
+ >
21
+ <h2 className="group-hover:text-primary font-semibold transition-colors">
22
+ Admin panel
23
+ </h2>
24
+ <p className="text-muted-foreground mt-1 text-sm">
25
+ Manage your content and settings.
26
+ </p>
27
+ <span className="text-primary mt-3 inline-block text-sm font-medium">
28
+ Open /admin →
29
+ </span>
30
+ </Link>
31
+
32
+ <a
33
+ href="/api/docs"
34
+ className="group hover:border-primary/30 block rounded-lg border p-5 transition-all hover:shadow-md"
35
+ >
36
+ <h2 className="group-hover:text-primary font-semibold transition-colors">
37
+ API docs
38
+ </h2>
39
+ <p className="text-muted-foreground mt-1 text-sm">
40
+ Explore the REST API in Scalar.
41
+ </p>
42
+ <span className="text-primary mt-3 inline-block text-sm font-medium">
43
+ Open /api/docs →
44
+ </span>
45
+ </a>
46
+
47
+ <a
48
+ href="https://questpie.com/docs"
49
+ target="_blank"
50
+ rel="noreferrer"
51
+ className="group hover:border-primary/30 block rounded-lg border p-5 transition-all hover:shadow-md"
52
+ >
53
+ <h2 className="group-hover:text-primary font-semibold transition-colors">
54
+ Documentation
55
+ </h2>
56
+ <p className="text-muted-foreground mt-1 text-sm">
57
+ Learn the framework and patterns.
58
+ </p>
59
+ <span className="text-primary mt-3 inline-block text-sm font-medium">
60
+ questpie.com/docs →
61
+ </span>
62
+ </a>
63
+ </div>
64
+
65
+ <p className="text-muted-foreground mt-12 text-sm">
66
+ Edit{" "}
67
+ <code className="bg-muted rounded px-1.5 py-0.5 font-mono text-xs">
68
+ src/app/page.tsx
69
+ </code>{" "}
70
+ to change this page.
71
+ </p>
72
+ </main>
73
+ );
74
+ }
@@ -0,0 +1,11 @@
1
+ "use client";
2
+
3
+ import { QueryClientProvider } from "@tanstack/react-query";
4
+
5
+ import { queryClient } from "@/lib/query-client";
6
+
7
+ export function Providers({ children }: { children: React.ReactNode }) {
8
+ return (
9
+ <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
10
+ );
11
+ }
@@ -0,0 +1,12 @@
1
+ import type { AppConfig } from "@/questpie/server/app";
2
+ import { createAdminAuthClient } from "@questpie/admin/client";
3
+
4
+ export const authClient = createAdminAuthClient<AppConfig>({
5
+ baseURL:
6
+ typeof window !== "undefined"
7
+ ? window.location.origin
8
+ : process.env.APP_URL || "http://localhost:3000",
9
+ basePath: "/api/auth",
10
+ });
11
+
12
+ export type AuthClient = typeof authClient;
@@ -0,0 +1,13 @@
1
+ import { createClient } from "questpie/client";
2
+
3
+ import type { AppConfig } from "@/questpie/server/app";
4
+
5
+ export const client = createClient<AppConfig>({
6
+ baseURL:
7
+ typeof window !== "undefined"
8
+ ? window.location.origin
9
+ : process.env.APP_URL || "http://localhost:3000",
10
+ basePath: "/api",
11
+ });
12
+
13
+ export type AppClient = typeof client;
@@ -0,0 +1,24 @@
1
+ import { createEnv } from "@t3-oss/env-core";
2
+ import { z } from "zod";
3
+
4
+ export const env = createEnv({
5
+ server: {
6
+ DATABASE_URL: z.string().url(),
7
+ APP_URL: z.string().url().default("http://localhost:3000"),
8
+ PORT: z
9
+ .string()
10
+ .transform(Number)
11
+ .pipe(z.number().int().positive())
12
+ .default(3000),
13
+ BETTER_AUTH_SECRET: z.string().min(1).default("change-me-in-production"),
14
+ MAIL_ADAPTER: z.enum(["console", "smtp"]).default("console"),
15
+ SMTP_HOST: z.string().optional(),
16
+ SMTP_PORT: z
17
+ .string()
18
+ .transform(Number)
19
+ .pipe(z.number().int().positive())
20
+ .optional(),
21
+ },
22
+ runtimeEnv: process.env,
23
+ emptyStringAsUndefined: true,
24
+ });
@@ -0,0 +1,18 @@
1
+ import { QueryClient } from "@tanstack/react-query";
2
+
3
+ const ONE_MINUTE = 60 * 1000;
4
+ const FIVE_MINUTES = 5 * ONE_MINUTE;
5
+
6
+ export const queryClient = new QueryClient({
7
+ defaultOptions: {
8
+ queries: {
9
+ staleTime: ONE_MINUTE,
10
+ gcTime: FIVE_MINUTES,
11
+ refetchOnWindowFocus: false,
12
+ retry: 1,
13
+ },
14
+ mutations: {
15
+ retry: 0,
16
+ },
17
+ },
18
+ });
@@ -0,0 +1,18 @@
1
+ import { createQuestpieQueryOptions } from "@questpie/tanstack-query";
2
+
3
+ import { client } from "@/lib/client";
4
+
5
+ /**
6
+ * Typed TanStack Query option builders for this project.
7
+ *
8
+ * `q.collections.*`, `q.globals.*`, and `q.routes.*` return `queryOptions()` /
9
+ * `mutationOptions()` objects you pass straight into `useQuery` / `useMutation`.
10
+ * Full type inference flows from the server schema via `AppConfig`.
11
+ *
12
+ * @example
13
+ * const { data } = useQuery(q.collections.posts.find({ limit: 10 }));
14
+ * const create = useMutation(q.collections.posts.create());
15
+ */
16
+ export const q = createQuestpieQueryOptions(client);
17
+
18
+ export type QueryOptions = typeof q;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Admin Client Config
3
+ *
4
+ * Auto-generated by questpie codegen — do not edit.
5
+ *
6
+ * Pass this directly to <AdminLayoutProvider admin={admin} />
7
+ */
8
+
9
+ import { default as _modules } from "../modules";
10
+
11
+ const admin = _modules;
12
+
13
+ export default admin;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Admin Configuration
3
+ *
4
+ * Re-exports the generated admin config.
5
+ * Import directly from "./.generated/client" in new code.
6
+ */
7
+ export { default as admin } from "./.generated/client";
8
+
9
+ export type AdminConfig = typeof import("./.generated/client").default;
@@ -0,0 +1,3 @@
1
+ import { adminClientModule } from "@questpie/admin/client/modules/admin";
2
+
3
+ export default [adminClientModule] as const;
@@ -0,0 +1,204 @@
1
+ /* oxlint-disable */
2
+ // AUTO-GENERATED by questpie codegen — DO NOT EDIT
3
+ // Regenerate with: questpie generate
4
+
5
+ // ── Runtime ────────────────────────────────────────────────
6
+ import _runtime from "../questpie.config";
7
+
8
+ // ── Modules ────────────────────────────────────────────────
9
+ import _modules from "../modules";
10
+
11
+ // ── Collections ────────────────────────────────────────────
12
+ import { posts as _coll_posts } from "../collections/posts.collection";
13
+
14
+ // ── Globals ────────────────────────────────────────────────
15
+ import { siteSettings as _glob_siteSettings } from "../globals/site-settings.global";
16
+
17
+ // ── Core Singles ───────────────────────────────────────────
18
+ import _authConfig from "../config/auth";
19
+
20
+ // ── Plugin Singles ─────────────────────────────────────────
21
+ import _adminConfig from "../config/admin";
22
+ import _openapi from "../config/openapi";
23
+
24
+ import type { AppCollections, AppGlobals, AppJobs, _ModuleCollections, _AppDefaultServices, _AppServicesSeam, _AppTopLevelServices, _AppCustomServiceNamespaces, _Registry_Collections, _Registry_Globals, _Registry_Jobs, _Registry_Routes, _Registry_Services, _Registry_Emails, _Registry_FieldTypes, _Registry_Views, _Registry_Components, _Registry_Blocks, _AllModuleFields } from "./entities.gen";
25
+ import type { AnyCollectionOrBuilder, AnyGlobalOrBuilder, CollectionAPI, DrizzleClientFromQuestpieConfig, InferContextExtensionsFromAppConfig, InferSessionFromAuthConfig, MailerService, Questpie, QuestpieConfig, QueueClient, QueueJobType, ServiceInstancesInNamespace, TablesFromConfig, z } from "questpie/types";
26
+
27
+ type _MPConfigSub<A extends readonly any[], K extends string> = A extends readonly [infer H, ...infer T extends readonly any[]] ? (H extends { config: infer C } ? (C extends Record<K, infer V> ? V : {}) : {}) & _MPConfigSub<T, K> : {};
28
+ type _AppAppConfig = {};
29
+ type _AppContextExtensions = Partial<InferContextExtensionsFromAppConfig<_AppAppConfig>>;
30
+ type _AppAuthConfig = _MPConfigSub<typeof _modules, "auth"> & typeof _authConfig;
31
+ type _AppSessionAuthConfig = _AppAuthConfig;
32
+ type _AppSession = NonNullable<InferSessionFromAuthConfig<_AppSessionAuthConfig>> | null;
33
+
34
+ type _CollectionsAPI = { [K in keyof AppCollections]: CollectionAPI<AppCollections[K], AppCollections> };
35
+ type _JobHandlerCollections = _ModuleCollections & {
36
+ posts: typeof _coll_posts;
37
+ };
38
+ type _JobHandlerCollectionsAPI = {
39
+ posts: CollectionAPI<typeof _coll_posts, _JobHandlerCollections>;
40
+ };
41
+ type _ExecutionContextJob<T> = T extends { name: infer TName extends string; schema: z.ZodSchema<infer TPayload> } ? QueueJobType<TPayload, TName> : never;
42
+ type _ExecutionContextJobs = {};
43
+ type _ExecutionContextServiceDefinitions = {};
44
+ type _ExecutionContextDefaultServices = ServiceInstancesInNamespace<_ExecutionContextServiceDefinitions, "services">;
45
+ type _AppCollectionDefinitions = AppCollections & Record<string, AnyCollectionOrBuilder>;
46
+ type _AppGlobalDefinitions = AppGlobals & Record<string, AnyGlobalOrBuilder>;
47
+ type _AppQuestpieConfig = Omit<QuestpieConfig, "app" | "db" | "collections" | "globals" | "auth" | "~contextExtensions"> & {
48
+ app: (typeof _runtime)["app"];
49
+ db: (typeof _runtime)["db"];
50
+ collections: _AppCollectionDefinitions;
51
+ globals: _AppGlobalDefinitions;
52
+ auth: _AppAuthConfig;
53
+ storage: (typeof _runtime)["storage"];
54
+ "~contextExtensions": _AppContextExtensions;
55
+ };
56
+ type _AppQuestpieBase = Questpie<_AppQuestpieConfig>;
57
+ type _AppDb = DrizzleClientFromQuestpieConfig<_AppQuestpieConfig>;
58
+ type _AppGlobalsAPI = _AppQuestpieBase["globals"];
59
+ type _AppStorage = _AppQuestpieBase["storage"];
60
+ type _AppTables = TablesFromConfig<_AppQuestpieConfig>;
61
+ export type _AppQuestpie = Omit<_AppQuestpieBase, "collections" | "globals"> & {
62
+ collections: _CollectionsAPI;
63
+ globals: _AppGlobalsAPI;
64
+ };
65
+
66
+ // ── AppContext augmentation — auto-types ALL handlers ──────
67
+ type _AppInfraRecord = {
68
+ // Infrastructure
69
+ app: _AppQuestpie;
70
+ db: _AppDb;
71
+ email: _AppQuestpie["email"];
72
+ queue: QueueClient<AppJobs>;
73
+ storage: _AppStorage;
74
+ kv: _AppQuestpie["kv"];
75
+ logger: _AppQuestpie["logger"];
76
+ search: _AppQuestpie["search"];
77
+ realtime: _AppQuestpie["realtime"];
78
+
79
+ // Entity APIs
80
+ collections: _CollectionsAPI;
81
+ globals: _AppGlobalsAPI;
82
+ tables: _AppTables;
83
+
84
+ // Request-scoped
85
+ session: _AppSession;
86
+ t: (key: string, params?: Record<string, unknown>, locale?: string) => string;
87
+
88
+ // User services
89
+ services: _AppDefaultServices;
90
+ };
91
+ type _AppInfraContext = _AppInfraRecord & _AppCustomServiceNamespaces;
92
+ type _AppCoreContext = _AppContextExtensions & _AppInfraContext;
93
+ type _ServiceCreateInfra = Omit<_AppInfraRecord, "services"> & { services: Questpie.Services };
94
+
95
+ declare global {
96
+ namespace Questpie {
97
+ interface AppContext extends _AppCoreContext, _AppTopLevelServices {}
98
+
99
+ interface JobHandlerContext {
100
+ // Infrastructure
101
+ db: _AppDb;
102
+ email: _AppQuestpie["email"];
103
+ queue: QueueClient<_ExecutionContextJobs>;
104
+ storage: _AppStorage;
105
+ kv: _AppQuestpie["kv"];
106
+ logger: _AppQuestpie["logger"];
107
+ search: _AppQuestpie["search"];
108
+ realtime: _AppQuestpie["realtime"];
109
+
110
+ // Entity APIs
111
+ collections: _JobHandlerCollectionsAPI;
112
+ globals: _AppGlobalsAPI;
113
+ tables: _AppTables;
114
+
115
+ // Request-scoped
116
+ session: _AppSession;
117
+ t: (key: string, params?: Record<string, unknown>, locale?: string) => string;
118
+
119
+ // Top-level services (namespace: null)
120
+ workflows?: _AppTopLevelServices extends { workflows: infer W } ? W : never;
121
+
122
+ // User services
123
+ services: _ExecutionContextDefaultServices;
124
+ }
125
+
126
+ interface WorkflowContext {
127
+ // Infrastructure
128
+ db: _AppDb;
129
+ email: _AppQuestpie["email"];
130
+ queue: QueueClient<_ExecutionContextJobs>;
131
+ storage: _AppStorage;
132
+ kv: _AppQuestpie["kv"];
133
+ logger: _AppQuestpie["logger"];
134
+ search: _AppQuestpie["search"];
135
+ realtime: _AppQuestpie["realtime"];
136
+
137
+ // Entity APIs
138
+ collections: _JobHandlerCollectionsAPI;
139
+ globals: _AppGlobalsAPI;
140
+ tables: _AppTables;
141
+
142
+ // Request-scoped
143
+ session: _AppSession;
144
+ t: (key: string, params?: Record<string, unknown>, locale?: string) => string;
145
+
146
+ // Top-level services (namespace: null)
147
+ workflows?: _AppTopLevelServices extends { workflows: infer W } ? W : never;
148
+
149
+ // User services
150
+ services: _ExecutionContextDefaultServices;
151
+ }
152
+
153
+ interface Services extends _AppServicesSeam {}
154
+ interface ServiceCreateContext extends _AppContextExtensions, _ServiceCreateInfra {}
155
+ // Names-only marker — the `ServiceCreateContext` fallback conditional
156
+ // probes THIS interface's keys instead of the real one (whose base
157
+ // resolves through module service definitions and would cycle).
158
+ interface ServiceCreateContextGenerated { generated: unknown }
159
+
160
+ // Typed service surface for appConfig({ context }) resolvers.
161
+ // Excludes _AppContextExtensions — the resolver produces them.
162
+ interface ContextResolverContext {
163
+ collections: _CollectionsAPI;
164
+ globals: _AppGlobalsAPI;
165
+ logger: _AppQuestpie["logger"];
166
+ kv: _AppQuestpie["kv"];
167
+ queue: QueueClient<AppJobs>;
168
+ t: (key: string, params?: Record<string, unknown>, locale?: string) => string;
169
+ services: _AppDefaultServices;
170
+ }
171
+
172
+ // App-level hook / default-access ctx infra seams (CL-05).
173
+ // Filled with the real infra MINUS _AppContextExtensions, so the
174
+ // app-level hooks/access predicates get precise db/session/
175
+ // collections/globals/queue WITHOUT re-entering the extensions cycle.
176
+ interface AppHookContext extends _AppInfraContext {}
177
+ interface AppDefaultAccessContext extends _AppInfraContext {}
178
+
179
+ // appConfig({ context }) resolver session/db — off the cyclic edge.
180
+ interface ContextResolverBase {
181
+ session: _AppSession;
182
+ db: _AppDb;
183
+ }
184
+
185
+ interface Registry {
186
+ collections: _Registry_Collections;
187
+ globals: _Registry_Globals;
188
+ jobs: _Registry_Jobs;
189
+ routes: _Registry_Routes;
190
+ services: _Registry_Services;
191
+ emails: _Registry_Emails;
192
+ "~fieldTypes": _Registry_FieldTypes & _AllModuleFields;
193
+ views: _Registry_Views;
194
+ components: _Registry_Components;
195
+ blocks: _Registry_Blocks;
196
+ }
197
+ }
198
+ }
199
+
200
+ /** Resolved auth session for this app (`{ user, session } | null`). */
201
+ export type AppSession = _AppSession;
202
+
203
+ /** Authenticated user shape from the app session. */
204
+ export type AppSessionUser = NonNullable<_AppSession>["user"];
@@ -0,0 +1,100 @@
1
+ /* oxlint-disable */
2
+ // AUTO-GENERATED by questpie codegen — DO NOT EDIT
3
+ // Regenerate with: questpie generate
4
+
5
+ import "./names.gen";
6
+ // ── Runtime ────────────────────────────────────────────────
7
+ import _runtime from "../questpie.config";
8
+
9
+ // ── Modules ────────────────────────────────────────────────
10
+ import _modules from "../modules";
11
+
12
+ // ── Collections ────────────────────────────────────────────
13
+ import { posts as _coll_posts } from "../collections/posts.collection";
14
+
15
+ // ── Globals ────────────────────────────────────────────────
16
+ import { siteSettings as _glob_siteSettings } from "../globals/site-settings.global";
17
+
18
+ // ── Core Singles ───────────────────────────────────────────
19
+ import _authConfig from "../config/auth";
20
+
21
+ // ── Plugin Singles ─────────────────────────────────────────
22
+ import _adminConfig from "../config/admin";
23
+ import _openapi from "../config/openapi";
24
+
25
+ import type { RouteParamsFromKey, RouteWithParams } from "questpie/types";
26
+
27
+ // ════════════════════════════════════════════════════════════
28
+ // TYPES — composed from typeof references (zero inference cost)
29
+ // ════════════════════════════════════════════════════════════
30
+
31
+ import type { ExtractModulePropArr, ExtractModulePropArrOverride, ServiceCustomNamespaceInstances, ServiceInstanceOf, ServiceInstancesInNamespace, ServiceTopLevelInstances } from "questpie/types";
32
+ type _RouteDefinitionWithoutHandler<T> = T extends { mode: "raw" } ? Omit<T, "handler"> & { handler: (args: unknown) => Response | Promise<Response> } : Omit<T, "handler"> & { handler: (args: unknown) => unknown | Promise<unknown> };
33
+ export type _ModuleCollections = ExtractModulePropArrOverride<typeof _modules, "collections">;
34
+ export type _ModuleGlobals = ExtractModulePropArr<typeof _modules, "globals">;
35
+ export type _ModuleJobs = ExtractModulePropArr<typeof _modules, "jobs">;
36
+ export type _ModuleRoutes = ExtractModulePropArr<typeof _modules, "routes">;
37
+ export type _ModuleServices = {};
38
+ export type _ModuleFieldTypes = ExtractModulePropArr<typeof _modules, "fieldTypes">;
39
+ export type _ModuleViews = ExtractModulePropArr<typeof _modules, "views">;
40
+ export type _ModuleComponents = ExtractModulePropArr<typeof _modules, "components">;
41
+ export type _ModuleBlocks = ExtractModulePropArr<typeof _modules, "blocks">;
42
+ // Registry category extraction from modules
43
+ export type _Registry_Collections = ExtractModulePropArrOverride<typeof _modules, "collections">;
44
+ export type _Registry_Globals = ExtractModulePropArr<typeof _modules, "globals">;
45
+ export type _Registry_Jobs = ExtractModulePropArr<typeof _modules, "jobs">;
46
+ export type _Registry_Routes = ExtractModulePropArr<typeof _modules, "routes">;
47
+ export type _Registry_Services = {};
48
+ export type _Registry_Emails = ExtractModulePropArr<typeof _modules, "emails">;
49
+ export type _Registry_FieldTypes = ExtractModulePropArr<typeof _modules, "fieldTypes">;
50
+ export type _Registry_Views = ExtractModulePropArr<typeof _modules, "views">;
51
+ export type _Registry_Components = ExtractModulePropArr<typeof _modules, "components">;
52
+ export type _Registry_Blocks = ExtractModulePropArr<typeof _modules, "blocks">;
53
+
54
+ // Recursive module property extraction (for fields contributed at each level)
55
+ import type { ExtractModuleProp } from "questpie/types";
56
+
57
+ export type _AllModuleFields = ExtractModuleProp<{ modules: typeof _modules }, "fields">;
58
+
59
+ /** All collections in the app (modules + user, user overrides) */
60
+ export type AppCollections = _ModuleCollections & {
61
+ posts: typeof _coll_posts;
62
+ };
63
+
64
+ /** All globals in the app (modules + user, user overrides) */
65
+ export type AppGlobals = _ModuleGlobals & {
66
+ siteSettings: typeof _glob_siteSettings;
67
+ };
68
+
69
+ /** All jobs in the app (modules + user, user overrides) */
70
+ export type AppJobs = _ModuleJobs;
71
+
72
+ /** All routes in the app (modules + user, user overrides) */
73
+ export type AppRoutes = _ModuleRoutes;
74
+
75
+ /** All service definitions in the app (modules + user, user overrides). */
76
+ type _AppServiceDefinitions = _ModuleServices;
77
+
78
+ /** All services in the app as resolved service instances. */
79
+ export type AppServices = {
80
+ [K in keyof _AppServiceDefinitions]: ServiceInstanceOf<_AppServiceDefinitions[K]>;
81
+ };
82
+ export type _AppDefaultServices = ServiceInstancesInNamespace<_AppServiceDefinitions, "services">;
83
+ export type _AppServicesSeam = { [K in keyof _AppServiceDefinitions]: ServiceInstanceOf<_AppServiceDefinitions[K]> };
84
+ export type _AppTopLevelServices = ServiceTopLevelInstances<_AppServiceDefinitions>;
85
+ export type _AppCustomServiceNamespaces = ServiceCustomNamespaceInstances<_AppServiceDefinitions>;
86
+
87
+ /** All email templates in the app — use with email.sendTemplate() */
88
+ export type AppEmailTemplates = Record<string, never>;
89
+
90
+ /** All fieldtypes in the app (modules + user, user overrides) */
91
+ export type AppFieldTypes = _ModuleFieldTypes;
92
+
93
+ /** All views in the app (modules + user, user overrides) */
94
+ export type AppViews = _ModuleViews;
95
+
96
+ /** All components in the app (modules + user, user overrides) */
97
+ export type AppComponents = _ModuleComponents;
98
+
99
+ /** All blocks in the app (modules + user, user overrides) */
100
+ export type AppBlocks = _ModuleBlocks;