create-vexcms 0.0.20 → 0.1.0-alpha.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.
Files changed (153) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +93 -83
  3. package/dist/index.js +246 -81
  4. package/dist/index.mjs +30976 -0
  5. package/package.json +35 -15
  6. package/templates/base-nextjs/README.md +53 -205
  7. package/templates/base-nextjs/_env.example +7 -9
  8. package/templates/base-nextjs/_gitignore +41 -1
  9. package/templates/base-nextjs/convex/_generated/api.d.ts +6 -62
  10. package/templates/base-nextjs/convex/_generated/server.d.ts +19 -0
  11. package/templates/base-nextjs/convex/_generated/server.js +8 -0
  12. package/templates/base-nextjs/convex/auth/api.ts +49 -3
  13. package/templates/base-nextjs/convex/auth/db.ts +42 -300
  14. package/templates/base-nextjs/convex/auth/index.ts +11 -7
  15. package/templates/base-nextjs/convex/auth/options.ts +5 -29
  16. package/templates/base-nextjs/convex/auth/plugins/index.ts +15 -5
  17. package/templates/base-nextjs/convex/auth/sessions.ts +9 -15
  18. package/templates/base-nextjs/convex/http.ts +18 -3
  19. package/templates/base-nextjs/convex/schema.ts +104 -2
  20. package/templates/base-nextjs/convex/vex/firstUser.ts +10 -84
  21. package/templates/base-nextjs/convex/vex/globals.ts +19 -82
  22. package/templates/base-nextjs/convex/vex/media.ts +19 -246
  23. package/templates/base-nextjs/convex/vex.schema.ts +138 -0
  24. package/templates/base-nextjs/convex/vex.ts +19 -0
  25. package/templates/base-nextjs/convex.json +6 -0
  26. package/templates/base-nextjs/eslint.config.mjs +1 -21
  27. package/templates/base-nextjs/next.config.ts +10 -0
  28. package/templates/base-nextjs/package.json +47 -48
  29. package/templates/base-nextjs/src/app/(frontend)/@auth/(...)auth/[pathname]/view.tsx +17 -5
  30. package/templates/base-nextjs/src/app/(frontend)/auth/[pathname]/view.tsx +2 -4
  31. package/templates/base-nextjs/src/app/(frontend)/layout.tsx +12 -2
  32. package/templates/base-nextjs/src/app/(frontend)/page.tsx +2 -113
  33. package/templates/base-nextjs/src/app/(vexcms)/admin/[[...path]]/page.tsx +40 -0
  34. package/templates/base-nextjs/src/app/(vexcms)/admin/clientProviders.tsx +22 -0
  35. package/templates/base-nextjs/src/app/(vexcms)/admin/layout.tsx +19 -0
  36. package/templates/base-nextjs/src/app/globals.css +240 -104
  37. package/templates/base-nextjs/src/app/layout.tsx +23 -13
  38. package/templates/base-nextjs/src/app/unauthorized/page.tsx +24 -0
  39. package/templates/base-nextjs/src/auth/access.ts +46 -0
  40. package/templates/base-nextjs/src/auth/client.tsx +17 -5
  41. package/templates/base-nextjs/src/auth/hasPermission.ts +39 -0
  42. package/templates/base-nextjs/src/auth/serverUtils.ts +15 -25
  43. package/templates/base-nextjs/src/components/WelcomePage.tsx +116 -0
  44. package/templates/base-nextjs/src/components/component-example.tsx +56 -464
  45. package/templates/base-nextjs/src/components/providers/auth.tsx +13 -0
  46. package/templates/base-nextjs/src/components/providers/client.tsx +6 -1
  47. package/templates/base-nextjs/src/components/providers/convex.tsx +53 -21
  48. package/templates/base-nextjs/src/components/providers/server.tsx +10 -7
  49. package/templates/{marketing-site → base-nextjs}/src/components/ui/accordion.tsx +30 -32
  50. package/templates/base-nextjs/src/components/ui/badge.tsx +10 -13
  51. package/templates/base-nextjs/src/components/ui/input.tsx +35 -5
  52. package/templates/base-nextjs/src/context/AuthContext.tsx +29 -0
  53. package/templates/base-nextjs/src/db/constants/auth.ts +0 -1
  54. package/templates/base-nextjs/src/db/constants/index.ts +22 -35
  55. package/templates/base-nextjs/src/lib/utils.ts +0 -12
  56. package/templates/base-nextjs/src/proxy.ts +97 -12
  57. package/templates/base-nextjs/src/vex.config.ts +35 -0
  58. package/templates/base-nextjs/src/vex.types.ts +293 -0
  59. package/templates/base-nextjs/src/vexcms/collections/images.ts +15 -0
  60. package/templates/base-nextjs/src/vexcms/collections/index.ts +2 -1
  61. package/templates/base-nextjs/src/vexcms/collections/users.ts +7 -35
  62. package/templates/base-nextjs/tsconfig.json +3 -0
  63. package/templates/marketing-site/convex/_generated/api.d.ts +81 -0
  64. package/templates/marketing-site/convex/_generated/api.js +23 -0
  65. package/templates/marketing-site/convex/_generated/dataModel.d.ts +60 -0
  66. package/templates/marketing-site/convex/_generated/server.d.ts +162 -0
  67. package/templates/marketing-site/convex/_generated/server.js +101 -0
  68. package/templates/marketing-site/convex/footers.ts +11 -7
  69. package/templates/marketing-site/convex/headers.ts +15 -5
  70. package/templates/marketing-site/convex/pages.ts +20 -35
  71. package/templates/marketing-site/convex/schema.ts +119 -0
  72. package/templates/marketing-site/convex/seed.ts +582 -35
  73. package/templates/marketing-site/convex/siteSettings.ts +19 -5
  74. package/templates/marketing-site/convex/theme.ts +55 -61
  75. package/templates/marketing-site/convex/vex.schema.ts +355 -0
  76. package/templates/marketing-site/src/app/(frontend)/PageContent.tsx +27 -160
  77. package/templates/marketing-site/src/app/(frontend)/[slug]/page.tsx +6 -9
  78. package/templates/marketing-site/src/app/(frontend)/layout.tsx +4 -2
  79. package/templates/marketing-site/src/app/(frontend)/page.tsx +2 -5
  80. package/templates/marketing-site/src/components/SiteFooter.tsx +6 -3
  81. package/templates/marketing-site/src/components/SiteHeader.tsx +6 -3
  82. package/templates/marketing-site/src/components/ThemeLive.tsx +59 -0
  83. package/templates/marketing-site/src/components/ThemeStyle.tsx +45 -89
  84. package/templates/marketing-site/src/lib/metadata.ts +51 -72
  85. package/templates/marketing-site/src/vex.config.ts +35 -0
  86. package/templates/marketing-site/src/vex.types.ts +634 -0
  87. package/templates/marketing-site/src/vexcms/api.ts +23 -0
  88. package/templates/marketing-site/src/vexcms/blocks/CTA/config.ts +3 -3
  89. package/templates/marketing-site/src/vexcms/blocks/CTA/index.tsx +2 -2
  90. package/templates/marketing-site/src/vexcms/blocks/FAQ/config.ts +4 -4
  91. package/templates/marketing-site/src/vexcms/blocks/FAQ/index.tsx +2 -2
  92. package/templates/marketing-site/src/vexcms/blocks/Features/config.ts +4 -8
  93. package/templates/marketing-site/src/vexcms/blocks/Features/index.tsx +2 -2
  94. package/templates/marketing-site/src/vexcms/blocks/Footer/config.ts +7 -11
  95. package/templates/marketing-site/src/vexcms/blocks/Footer/index.tsx +1 -1
  96. package/templates/marketing-site/src/vexcms/blocks/Header/config.ts +9 -9
  97. package/templates/marketing-site/src/vexcms/blocks/Header/index.tsx +4 -5
  98. package/templates/marketing-site/src/vexcms/blocks/Hero/config.ts +3 -4
  99. package/templates/marketing-site/src/vexcms/blocks/Hero/index.tsx +10 -19
  100. package/templates/marketing-site/src/vexcms/blocks/HowItWorks/config.ts +4 -9
  101. package/templates/marketing-site/src/vexcms/blocks/HowItWorks/index.tsx +3 -6
  102. package/templates/marketing-site/src/vexcms/blocks/Roadmap/config.ts +28 -68
  103. package/templates/marketing-site/src/vexcms/blocks/Roadmap/index.tsx +13 -43
  104. package/templates/marketing-site/src/vexcms/blocks/config.ts +7 -22
  105. package/templates/marketing-site/src/vexcms/blocks/constants.ts +2 -3
  106. package/templates/marketing-site/src/vexcms/blocks/index.ts +9 -8
  107. package/templates/marketing-site/src/vexcms/collections/footers.ts +1 -1
  108. package/templates/marketing-site/src/vexcms/collections/headers.ts +1 -1
  109. package/templates/marketing-site/src/vexcms/collections/index.ts +2 -1
  110. package/templates/marketing-site/src/vexcms/collections/pages.ts +12 -21
  111. package/templates/marketing-site/src/vexcms/collections/themeColors.ts +118 -0
  112. package/templates/marketing-site/src/vexcms/collections/themes.ts +29 -111
  113. package/templates/marketing-site/src/vexcms/globals/index.ts +1 -1
  114. package/templates/marketing-site/src/vexcms/globals/siteSettings.ts +43 -27
  115. package/templates/base-nextjs/convex/auth/adapter/index.ts +0 -230
  116. package/templates/base-nextjs/convex/auth/adapter/utils.ts +0 -547
  117. package/templates/base-nextjs/convex/auth/config.ts +0 -10
  118. package/templates/base-nextjs/convex/vex/auth.ts +0 -38
  119. package/templates/base-nextjs/convex/vex/collections.ts +0 -333
  120. package/templates/base-nextjs/convex/vex/helpers.ts +0 -33
  121. package/templates/base-nextjs/convex/vex/impersonation.ts +0 -51
  122. package/templates/base-nextjs/convex/vex/migrate.ts +0 -74
  123. package/templates/base-nextjs/convex/vex/model/collections.ts +0 -196
  124. package/templates/base-nextjs/convex/vex/model/media.ts +0 -87
  125. package/templates/base-nextjs/convex/vex/model/versions.ts +0 -254
  126. package/templates/base-nextjs/convex/vex/previewSnapshot.ts +0 -53
  127. package/templates/base-nextjs/convex/vex/versions.ts +0 -648
  128. package/templates/base-nextjs/src/app/admin/AdminLayoutWrapper.tsx +0 -33
  129. package/templates/base-nextjs/src/app/admin/AdminPageWrapper.tsx +0 -38
  130. package/templates/base-nextjs/src/app/admin/RichTextFieldWithMedia.tsx +0 -101
  131. package/templates/base-nextjs/src/app/admin/[[...path]]/page.tsx +0 -15
  132. package/templates/base-nextjs/src/app/admin/layout.tsx +0 -51
  133. package/templates/base-nextjs/src/app/favicon.ico +0 -0
  134. package/templates/base-nextjs/src/components/providers/theme.tsx +0 -11
  135. package/templates/base-nextjs/src/components/ui/theme-toggle.tsx +0 -67
  136. package/templates/base-nextjs/src/db/types.ts +0 -6
  137. package/templates/base-nextjs/src/vexcms/access.ts +0 -44
  138. package/templates/base-nextjs/src/vexcms/auth.ts +0 -4
  139. package/templates/base-nextjs/src/vexcms/collections/media.ts +0 -15
  140. package/templates/base-nextjs/vex.config.ts +0 -25
  141. package/templates/marketing-site/public/favicons/favicon.ico +0 -0
  142. package/templates/marketing-site/src/app/(frontend)/preview/[slug]/PreviewPageContent.tsx +0 -55
  143. package/templates/marketing-site/src/app/(frontend)/preview/[slug]/page.tsx +0 -27
  144. package/templates/marketing-site/src/app/(frontend)/preview/layout.tsx +0 -18
  145. package/templates/marketing-site/src/app/admin/AdminLayoutWrapper.tsx +0 -71
  146. package/templates/marketing-site/src/components/ThemeInjector.tsx +0 -128
  147. package/templates/marketing-site/src/components/admin/IconPickerField.tsx +0 -134
  148. package/templates/marketing-site/src/components/admin/ThemeImport.tsx +0 -174
  149. package/templates/marketing-site/src/components/admin/ThemeImportField.tsx +0 -33
  150. package/templates/marketing-site/src/db/constants/index.ts +0 -52
  151. package/templates/marketing-site/src/lib/colorConvert.ts +0 -171
  152. package/templates/marketing-site/src/vexcms/access.ts +0 -36
  153. package/templates/marketing-site/vex.config.ts +0 -32
@@ -0,0 +1,293 @@
1
+ // ⚠️ AUTO-GENERATED BY VEX CMS — DO NOT EDIT ⚠️
2
+ // Run 'vex dev' or 'vex generate' to update this file.
3
+
4
+ /* eslint-disable perfectionist/sort-union-types */
5
+ /* eslint-disable perfectionist/sort-interfaces */
6
+ /* eslint-disable perfectionist/sort-modules */
7
+
8
+ import type { Id } from "@convex/_generated/dataModel"
9
+ import type { VexDocument, VexDocumentGlobal } from "@vexcms/core"
10
+
11
+ export interface UserDocument extends VexDocument {
12
+ _id: Id<"user">
13
+ name: string
14
+ email: string
15
+ emailVerified: boolean
16
+ image?: string
17
+ createdAt: number
18
+ updatedAt: number
19
+ role?: string
20
+ banned?: boolean
21
+ banReason?: string
22
+ banExpires?: number
23
+ isAnonymous?: boolean
24
+ userId?: string
25
+ roles: string[]
26
+ }
27
+
28
+ export interface SessionDocument extends VexDocument {
29
+ _id: Id<"session">
30
+ expiresAt: number
31
+ token: string
32
+ createdAt: number
33
+ updatedAt: number
34
+ ipAddress?: string
35
+ userAgent?: string
36
+ userId: string
37
+ impersonatedBy?: string
38
+ activeOrganizationId?: string
39
+ }
40
+
41
+ export interface AccountDocument extends VexDocument {
42
+ _id: Id<"account">
43
+ accountId: string
44
+ providerId: string
45
+ userId: string
46
+ accessToken?: string
47
+ refreshToken?: string
48
+ idToken?: string
49
+ accessTokenExpiresAt?: number
50
+ refreshTokenExpiresAt?: number
51
+ scope?: string
52
+ password?: string
53
+ createdAt: number
54
+ updatedAt: number
55
+ }
56
+
57
+ export interface VerificationDocument extends VexDocument {
58
+ _id: Id<"verification">
59
+ identifier: string
60
+ value: string
61
+ expiresAt: number
62
+ createdAt: number
63
+ updatedAt: number
64
+ }
65
+
66
+ export interface ApikeyDocument extends VexDocument {
67
+ _id: Id<"apikey">
68
+ configId: string
69
+ name?: string
70
+ start?: string
71
+ referenceId: string
72
+ prefix?: string
73
+ key: string
74
+ refillInterval?: number
75
+ refillAmount?: number
76
+ lastRefillAt?: number
77
+ enabled?: boolean
78
+ rateLimitEnabled?: boolean
79
+ rateLimitTimeWindow?: number
80
+ rateLimitMax?: number
81
+ requestCount?: number
82
+ remaining?: number
83
+ lastRequest?: number
84
+ expiresAt?: number
85
+ createdAt: number
86
+ updatedAt: number
87
+ permissions?: string
88
+ metadata?: string
89
+ }
90
+
91
+ export interface JwksDocument extends VexDocument {
92
+ _id: Id<"jwks">
93
+ publicKey: string
94
+ privateKey: string
95
+ createdAt: number
96
+ expiresAt?: number
97
+ }
98
+
99
+ export interface OrganizationDocument extends VexDocument {
100
+ _id: Id<"organization">
101
+ name: string
102
+ slug: string
103
+ logo?: string
104
+ createdAt: number
105
+ metadata?: string
106
+ }
107
+
108
+ export interface MemberDocument extends VexDocument {
109
+ _id: Id<"member">
110
+ organizationId: string
111
+ userId: string
112
+ role: string
113
+ createdAt: number
114
+ }
115
+
116
+ export interface InvitationDocument extends VexDocument {
117
+ _id: Id<"invitation">
118
+ organizationId: string
119
+ email: string
120
+ role?: string
121
+ status: string
122
+ expiresAt: number
123
+ createdAt: number
124
+ inviterId: string
125
+ }
126
+
127
+ export interface Image extends VexDocument {
128
+ _id: Id<"images">
129
+ filename: string
130
+ alt: string
131
+ mimeType: string
132
+ size: number
133
+ storageId: string
134
+ deleted?: boolean
135
+ src: string
136
+ width?: number
137
+ height?: number
138
+ }
139
+
140
+ export type CollectionSlug =
141
+ | "user"
142
+ | "session"
143
+ | "account"
144
+ | "verification"
145
+ | "apikey"
146
+ | "jwks"
147
+ | "organization"
148
+ | "member"
149
+ | "invitation"
150
+ | "images"
151
+
152
+ export type GlobalSlug = never
153
+
154
+ export type MediaCollectionSlug = "images"
155
+
156
+ export type StorageAdapterSlug = "convex"
157
+
158
+ export type DocumentBySlug = {
159
+ user: UserDocument
160
+ session: SessionDocument
161
+ account: AccountDocument
162
+ verification: VerificationDocument
163
+ apikey: ApikeyDocument
164
+ jwks: JwksDocument
165
+ organization: OrganizationDocument
166
+ member: MemberDocument
167
+ invitation: InvitationDocument
168
+ images: Image
169
+ }
170
+
171
+ declare module "@vexcms/core" {
172
+ interface GeneratedVexTypes {
173
+ CollectionSlug:
174
+ | "user"
175
+ | "session"
176
+ | "account"
177
+ | "verification"
178
+ | "apikey"
179
+ | "jwks"
180
+ | "organization"
181
+ | "member"
182
+ | "invitation"
183
+ | "images"
184
+ GlobalSlug: never
185
+ MediaCollectionSlug: "images"
186
+ StorageAdapterSlug: "convex"
187
+ DocumentBySlug: {
188
+ user: UserDocument
189
+ session: SessionDocument
190
+ account: AccountDocument
191
+ verification: VerificationDocument
192
+ apikey: ApikeyDocument
193
+ jwks: JwksDocument
194
+ organization: OrganizationDocument
195
+ member: MemberDocument
196
+ invitation: InvitationDocument
197
+ images: Image
198
+ }
199
+ GlobalDocumentBySlug: {}
200
+ CollectionsFieldTypeMap: {
201
+ user: {
202
+ text: "name" | "email" | "image" | "role" | "banReason" | "userId"
203
+ checkbox: "emailVerified" | "banned" | "isAnonymous"
204
+ date: "createdAt" | "updatedAt" | "banExpires"
205
+ array: "roles"
206
+ }
207
+ session: {
208
+ date: "expiresAt" | "createdAt" | "updatedAt"
209
+ text:
210
+ "token" | "ipAddress" | "userAgent" | "userId" | "impersonatedBy" | "activeOrganizationId"
211
+ }
212
+ account: {
213
+ text:
214
+ | "accountId"
215
+ | "providerId"
216
+ | "userId"
217
+ | "accessToken"
218
+ | "refreshToken"
219
+ | "idToken"
220
+ | "scope"
221
+ | "password"
222
+ date: "accessTokenExpiresAt" | "refreshTokenExpiresAt" | "createdAt" | "updatedAt"
223
+ }
224
+ verification: {
225
+ text: "identifier" | "value"
226
+ date: "expiresAt" | "createdAt" | "updatedAt"
227
+ }
228
+ apikey: {
229
+ text:
230
+ | "configId"
231
+ | "name"
232
+ | "start"
233
+ | "referenceId"
234
+ | "prefix"
235
+ | "key"
236
+ | "permissions"
237
+ | "metadata"
238
+ number:
239
+ | "refillInterval"
240
+ | "refillAmount"
241
+ | "rateLimitTimeWindow"
242
+ | "rateLimitMax"
243
+ | "requestCount"
244
+ | "remaining"
245
+ date: "lastRefillAt" | "lastRequest" | "expiresAt" | "createdAt" | "updatedAt"
246
+ checkbox: "enabled" | "rateLimitEnabled"
247
+ }
248
+ jwks: {
249
+ text: "publicKey" | "privateKey"
250
+ date: "createdAt" | "expiresAt"
251
+ }
252
+ organization: {
253
+ text: "name" | "slug" | "logo" | "metadata"
254
+ date: "createdAt"
255
+ }
256
+ member: {
257
+ text: "organizationId" | "userId" | "role"
258
+ date: "createdAt"
259
+ }
260
+ invitation: {
261
+ text: "organizationId" | "email" | "role" | "status" | "inviterId"
262
+ date: "expiresAt" | "createdAt"
263
+ }
264
+ images: {
265
+ text: "filename" | "alt" | "mimeType" | "storageId" | "src"
266
+ number: "size" | "width" | "height"
267
+ checkbox: "deleted"
268
+ }
269
+ }
270
+ GlobalsFieldTypeMap: {}
271
+ IndexFieldsBySlug: {
272
+ user: { by_email: readonly ["email"] }
273
+ session: { by_token: readonly ["token"]; by_userId: readonly ["userId"] }
274
+ account: { by_userId: readonly ["userId"] }
275
+ verification: { by_identifier: readonly ["identifier"] }
276
+ apikey: {
277
+ by_configId: readonly ["configId"]
278
+ by_referenceId: readonly ["referenceId"]
279
+ by_key: readonly ["key"]
280
+ }
281
+ jwks: {}
282
+ organization: { by_slug: readonly ["slug"] }
283
+ member: { by_organizationId: readonly ["organizationId"]; by_userId: readonly ["userId"] }
284
+ invitation: { by_organizationId: readonly ["organizationId"]; by_email: readonly ["email"] }
285
+ images: { by_deleted: readonly ["deleted"] }
286
+ }
287
+ CustomActionsBySlug: {}
288
+ AuthSlugs: {
289
+ user: "user"
290
+ organization: "organization"
291
+ }
292
+ }
293
+ }
@@ -0,0 +1,15 @@
1
+ import { defineMediaCollection } from "@vexcms/file-storage-convex";
2
+
3
+ import { TABLE_SLUG_IMAGES } from "~/db/constants";
4
+
5
+ export const images = defineMediaCollection({
6
+ slug: TABLE_SLUG_IMAGES,
7
+ admin: {
8
+ icon: "Image",
9
+ },
10
+ labels: {
11
+ singular: "Image",
12
+ plural: "Images",
13
+ },
14
+ interfaceName: "Image",
15
+ });
@@ -1 +1,2 @@
1
- // Add your collection exports here
1
+ export * from "./images"
2
+ export * from "./users"
@@ -1,46 +1,18 @@
1
- import { checkbox, defineCollection, imageUrl, select, text } from "@vexcms/core"
1
+ import { defineCollection } from "@vexcms/core"
2
2
 
3
3
  import { TABLE_SLUG_USERS } from "~/db/constants"
4
- import { auth } from "~/vexcms/auth"
5
4
 
6
5
  export const users = defineCollection({
7
6
  slug: TABLE_SLUG_USERS,
8
7
  admin: {
9
- defaultColumns: ["name", "email", "createdAt", "role"],
10
- group: "Admin",
11
- useAsTitle: "name",
12
- },
13
- auth,
14
- fields: {
15
- name: text({
16
- label: "Name",
17
- required: true,
18
- }),
19
- image: imageUrl({
20
- label: "Image",
21
- }),
22
- role: select({
23
- defaultValue: "user",
24
- hasMany: true,
25
- labels: {
26
- plural: "Roles",
27
- singular: "Role",
28
- },
29
- options: [
30
- { label: "Admin", value: "admin" },
31
- { label: "Editor", value: "editor" },
32
- { label: "User", value: "user" },
33
- ],
34
- required: true,
35
- }),
36
- vex_onboarding_complete: checkbox({
37
- admin: { hidden: true },
38
- defaultValue: false,
39
- label: "Onboarding Complete",
40
- }),
8
+ icon: "Users",
41
9
  },
42
10
  labels: {
43
- plural: "Users",
44
11
  singular: "User",
12
+ plural: "Users",
13
+ },
14
+ fields: {
15
+ // Add custom user fields here — the auth adapter already contributes
16
+ // name/email/roles/etc. from Better Auth's schema.
45
17
  },
46
18
  })
@@ -22,6 +22,9 @@
22
22
  "name": "next"
23
23
  }
24
24
  ],
25
+ "customConditions": [
26
+ "source"
27
+ ],
25
28
  "paths": {
26
29
  "~/*": [
27
30
  "./src/*"
@@ -0,0 +1,81 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type * as auth_api from "../auth/api.js";
12
+ import type * as auth_db from "../auth/db.js";
13
+ import type * as auth_index from "../auth/index.js";
14
+ import type * as auth_options from "../auth/options.js";
15
+ import type * as auth_plugins_index from "../auth/plugins/index.js";
16
+ import type * as auth_sessions from "../auth/sessions.js";
17
+ import type * as footers from "../footers.js";
18
+ import type * as headers from "../headers.js";
19
+ import type * as http from "../http.js";
20
+ import type * as pages from "../pages.js";
21
+ import type * as seed from "../seed.js";
22
+ import type * as siteSettings from "../siteSettings.js";
23
+ import type * as theme from "../theme.js";
24
+ import type * as vex from "../vex.js";
25
+ import type * as vex_firstUser from "../vex/firstUser.js";
26
+ import type * as vex_globals from "../vex/globals.js";
27
+ import type * as vex_media from "../vex/media.js";
28
+
29
+ import type {
30
+ ApiFromModules,
31
+ FilterApi,
32
+ FunctionReference,
33
+ } from "convex/server";
34
+
35
+ declare const fullApi: ApiFromModules<{
36
+ "auth/api": typeof auth_api;
37
+ "auth/db": typeof auth_db;
38
+ "auth/index": typeof auth_index;
39
+ "auth/options": typeof auth_options;
40
+ "auth/plugins/index": typeof auth_plugins_index;
41
+ "auth/sessions": typeof auth_sessions;
42
+ footers: typeof footers;
43
+ headers: typeof headers;
44
+ http: typeof http;
45
+ pages: typeof pages;
46
+ seed: typeof seed;
47
+ siteSettings: typeof siteSettings;
48
+ theme: typeof theme;
49
+ vex: typeof vex;
50
+ "vex/firstUser": typeof vex_firstUser;
51
+ "vex/globals": typeof vex_globals;
52
+ "vex/media": typeof vex_media;
53
+ }>;
54
+
55
+ /**
56
+ * A utility for referencing Convex functions in your app's public API.
57
+ *
58
+ * Usage:
59
+ * ```js
60
+ * const myFunctionReference = api.myModule.myFunction;
61
+ * ```
62
+ */
63
+ export declare const api: FilterApi<
64
+ typeof fullApi,
65
+ FunctionReference<any, "public">
66
+ >;
67
+
68
+ /**
69
+ * A utility for referencing Convex functions in your app's internal API.
70
+ *
71
+ * Usage:
72
+ * ```js
73
+ * const myFunctionReference = internal.myModule.myFunction;
74
+ * ```
75
+ */
76
+ export declare const internal: FilterApi<
77
+ typeof fullApi,
78
+ FunctionReference<any, "internal">
79
+ >;
80
+
81
+ export declare const components: {};
@@ -0,0 +1,23 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated `api` utility.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import { anyApi, componentsGeneric } from "convex/server";
12
+
13
+ /**
14
+ * A utility for referencing Convex functions in your app's API.
15
+ *
16
+ * Usage:
17
+ * ```js
18
+ * const myFunctionReference = api.myModule.myFunction;
19
+ * ```
20
+ */
21
+ export const api = anyApi;
22
+ export const internal = anyApi;
23
+ export const components = componentsGeneric();
@@ -0,0 +1,60 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated data model types.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import type {
12
+ DataModelFromSchemaDefinition,
13
+ DocumentByName,
14
+ TableNamesInDataModel,
15
+ SystemTableNames,
16
+ } from "convex/server";
17
+ import type { GenericId } from "convex/values";
18
+ import schema from "../schema.js";
19
+
20
+ /**
21
+ * The names of all of your Convex tables.
22
+ */
23
+ export type TableNames = TableNamesInDataModel<DataModel>;
24
+
25
+ /**
26
+ * The type of a document stored in Convex.
27
+ *
28
+ * @typeParam TableName - A string literal type of the table name (like "users").
29
+ */
30
+ export type Doc<TableName extends TableNames> = DocumentByName<
31
+ DataModel,
32
+ TableName
33
+ >;
34
+
35
+ /**
36
+ * An identifier for a document in Convex.
37
+ *
38
+ * Convex documents are uniquely identified by their `Id`, which is accessible
39
+ * on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
40
+ *
41
+ * Documents can be loaded using `db.get(tableName, id)` in query and mutation functions.
42
+ *
43
+ * IDs are just strings at runtime, but this type can be used to distinguish them from other
44
+ * strings when type checking.
45
+ *
46
+ * @typeParam TableName - A string literal type of the table name (like "users").
47
+ */
48
+ export type Id<TableName extends TableNames | SystemTableNames> =
49
+ GenericId<TableName>;
50
+
51
+ /**
52
+ * A type describing your Convex data model.
53
+ *
54
+ * This type includes information about what tables you have, the type of
55
+ * documents stored in those tables, and the indexes defined on them.
56
+ *
57
+ * This type is used to parameterize methods like `queryGeneric` and
58
+ * `mutationGeneric` to make them type-safe.
59
+ */
60
+ export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
@@ -0,0 +1,162 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * Generated utilities for implementing server-side Convex query and mutation functions.
4
+ *
5
+ * THIS CODE IS AUTOMATICALLY GENERATED.
6
+ *
7
+ * To regenerate, run `npx convex dev`.
8
+ * @module
9
+ */
10
+
11
+ import {
12
+ ActionBuilder,
13
+ HttpActionBuilder,
14
+ MutationBuilder,
15
+ QueryBuilder,
16
+ GenericActionCtx,
17
+ GenericMutationCtx,
18
+ GenericQueryCtx,
19
+ GenericDatabaseReader,
20
+ GenericDatabaseWriter,
21
+ } from "convex/server";
22
+ import type { DataModel } from "./dataModel.js";
23
+
24
+ /**
25
+ * Typesafe environment variables.
26
+ *
27
+ * This includes platform-provided env vars and any variables declared in
28
+ * `convex.config.ts`.
29
+ */
30
+ type Env = {
31
+ readonly CONVEX_CLOUD_URL: string;
32
+ readonly CONVEX_SITE_URL: string;
33
+ };
34
+
35
+ /**
36
+ * Define a query in this Convex app's public API.
37
+ *
38
+ * This function will be allowed to read your Convex database and will be accessible from the client.
39
+ *
40
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
41
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
42
+ */
43
+ export declare const query: QueryBuilder<DataModel, "public">;
44
+
45
+ /**
46
+ * Define a query that is only accessible from other Convex functions (but not from the client).
47
+ *
48
+ * This function will be allowed to read from your Convex database. It will not be accessible from the client.
49
+ *
50
+ * @param func - The query function. It receives a {@link QueryCtx} as its first argument.
51
+ * @returns The wrapped query. Include this as an `export` to name it and make it accessible.
52
+ */
53
+ export declare const internalQuery: QueryBuilder<DataModel, "internal">;
54
+
55
+ /**
56
+ * Define a mutation in this Convex app's public API.
57
+ *
58
+ * This function will be allowed to modify your Convex database and will be accessible from the client.
59
+ *
60
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
61
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
62
+ */
63
+ export declare const mutation: MutationBuilder<DataModel, "public">;
64
+
65
+ /**
66
+ * Define a mutation that is only accessible from other Convex functions (but not from the client).
67
+ *
68
+ * This function will be allowed to modify your Convex database. It will not be accessible from the client.
69
+ *
70
+ * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument.
71
+ * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible.
72
+ */
73
+ export declare const internalMutation: MutationBuilder<DataModel, "internal">;
74
+
75
+ /**
76
+ * Define an action in this Convex app's public API.
77
+ *
78
+ * An action is a function which can execute any JavaScript code, including non-deterministic
79
+ * code and code with side-effects, like calling third-party services.
80
+ * They can be run in Convex's JavaScript environment or in Node.js using the "use node" directive.
81
+ * They can interact with the database indirectly by calling queries and mutations using the {@link ActionCtx}.
82
+ *
83
+ * @param func - The action. It receives an {@link ActionCtx} as its first argument.
84
+ * @returns The wrapped action. Include this as an `export` to name it and make it accessible.
85
+ */
86
+ export declare const action: ActionBuilder<DataModel, "public">;
87
+
88
+ /**
89
+ * Define an action that is only accessible from other Convex functions (but not from the client).
90
+ *
91
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument.
92
+ * @returns The wrapped function. Include this as an `export` to name it and make it accessible.
93
+ */
94
+ export declare const internalAction: ActionBuilder<DataModel, "internal">;
95
+
96
+ /**
97
+ * Define an HTTP action.
98
+ *
99
+ * The wrapped function will be used to respond to HTTP requests received
100
+ * by a Convex deployment if the requests matches the path and method where
101
+ * this action is routed. Be sure to route your httpAction in `convex/http.js`.
102
+ *
103
+ * @param func - The function. It receives an {@link ActionCtx} as its first argument
104
+ * and a Fetch API `Request` object as its second.
105
+ * @returns The wrapped function. Import this function from `convex/http.js` and route it to hook it up.
106
+ */
107
+ export declare const httpAction: HttpActionBuilder;
108
+
109
+ /**
110
+ * Typesafe environment variables.
111
+ *
112
+ * This includes platform-provided env vars and any variables declared in
113
+ * `convex.config.ts`.
114
+ */
115
+ export declare const env: Env;
116
+
117
+ /**
118
+ * A set of services for use within Convex query functions.
119
+ *
120
+ * The query context is passed as the first argument to any Convex query
121
+ * function run on the server.
122
+ *
123
+ * This differs from the {@link MutationCtx} because all of the services are
124
+ * read-only.
125
+ */
126
+ export type QueryCtx = GenericQueryCtx<DataModel>;
127
+
128
+ /**
129
+ * A set of services for use within Convex mutation functions.
130
+ *
131
+ * The mutation context is passed as the first argument to any Convex mutation
132
+ * function run on the server.
133
+ */
134
+ export type MutationCtx = GenericMutationCtx<DataModel>;
135
+
136
+ /**
137
+ * A set of services for use within Convex action functions.
138
+ *
139
+ * The action context is passed as the first argument to any Convex action
140
+ * function run on the server.
141
+ */
142
+ export type ActionCtx = GenericActionCtx<DataModel>;
143
+
144
+ /**
145
+ * An interface to read from the database within Convex query functions.
146
+ *
147
+ * The two entry points are {@link DatabaseReader.get}, which fetches a single
148
+ * document by its {@link Id}, or {@link DatabaseReader.query}, which starts
149
+ * building a query.
150
+ */
151
+ export type DatabaseReader = GenericDatabaseReader<DataModel>;
152
+
153
+ /**
154
+ * An interface to read from and write to the database within Convex mutation
155
+ * functions.
156
+ *
157
+ * Convex guarantees that all writes within a single mutation are
158
+ * executed atomically, so you never have to worry about partial writes leaving
159
+ * your data in an inconsistent state. See [the Convex Guide](https://docs.convex.dev/understanding/convex-fundamentals/functions#atomicity-and-optimistic-concurrency-control)
160
+ * for the guarantees Convex provides your functions.
161
+ */
162
+ export type DatabaseWriter = GenericDatabaseWriter<DataModel>;