@lupinum/ginko-server 0.0.0-stage → 0.18.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 (95) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +176 -2
  4. package/convex/_generated/api.d.ts +185 -0
  5. package/convex/_generated/api.js +23 -0
  6. package/convex/_generated/dataModel.d.ts +60 -0
  7. package/convex/_generated/server.d.ts +162 -0
  8. package/convex/_generated/server.js +101 -0
  9. package/convex/account.ts +110 -0
  10. package/convex/agent.ts +814 -0
  11. package/convex/auth.config.ts +4 -0
  12. package/convex/auth.ts +62 -0
  13. package/convex/backup.ts +94 -0
  14. package/convex/betterAuth/_generated/api.ts +56 -0
  15. package/convex/betterAuth/_generated/component.ts +431 -0
  16. package/convex/betterAuth/_generated/dataModel.ts +60 -0
  17. package/convex/betterAuth/_generated/server.ts +169 -0
  18. package/convex/betterAuth/adapter.ts +7 -0
  19. package/convex/betterAuth/convex.config.ts +3 -0
  20. package/convex/betterAuth/schema.ts +102 -0
  21. package/convex/betterAuth/schemaMetadata.ts +697 -0
  22. package/convex/betterAuth/schemaOptions.ts +13 -0
  23. package/convex/betterAuth/schemaPlugins.ts +13 -0
  24. package/convex/bundle.ts +183 -0
  25. package/convex/changes.ts +136 -0
  26. package/convex/cleanup.ts +44 -0
  27. package/convex/connect.ts +143 -0
  28. package/convex/convex.config.ts +7 -0
  29. package/convex/crons.ts +14 -0
  30. package/convex/demo.ts +72 -0
  31. package/convex/entries.ts +1770 -0
  32. package/convex/facts.ts +129 -0
  33. package/convex/files.ts +631 -0
  34. package/convex/http.ts +21 -0
  35. package/convex/image.ts +45 -0
  36. package/convex/images.ts +54 -0
  37. package/convex/invites.ts +227 -0
  38. package/convex/lib/access.ts +180 -0
  39. package/convex/lib/agentTools.ts +331 -0
  40. package/convex/lib/content.ts +317 -0
  41. package/convex/lib/corpus.ts +83 -0
  42. package/convex/lib/diff.ts +50 -0
  43. package/convex/lib/fail.ts +27 -0
  44. package/convex/lib/files.ts +70 -0
  45. package/convex/lib/history.ts +103 -0
  46. package/convex/lib/i18n.ts +52 -0
  47. package/convex/lib/input.ts +57 -0
  48. package/convex/lib/library.ts +28 -0
  49. package/convex/lib/lifecycle.ts +100 -0
  50. package/convex/lib/list.ts +112 -0
  51. package/convex/lib/migrations.ts +126 -0
  52. package/convex/lib/names.ts +56 -0
  53. package/convex/lib/pending.ts +84 -0
  54. package/convex/lib/policy.ts +155 -0
  55. package/convex/lib/publicness.ts +87 -0
  56. package/convex/lib/reminders.ts +27 -0
  57. package/convex/lib/search.ts +132 -0
  58. package/convex/lib/siteUrl.ts +95 -0
  59. package/convex/lib/status.ts +109 -0
  60. package/convex/lib/translation.ts +56 -0
  61. package/convex/lib/trees.ts +43 -0
  62. package/convex/lib/write.ts +296 -0
  63. package/convex/mail.ts +136 -0
  64. package/convex/members.ts +129 -0
  65. package/convex/migrations.ts +105 -0
  66. package/convex/navigation.ts +276 -0
  67. package/convex/ops.ts +50 -0
  68. package/convex/proposals.ts +753 -0
  69. package/convex/refresh.ts +163 -0
  70. package/convex/release.ts +435 -0
  71. package/convex/reminders.ts +116 -0
  72. package/convex/retention.ts +121 -0
  73. package/convex/routes/bundle.ts +62 -0
  74. package/convex/routes/connect.ts +80 -0
  75. package/convex/routes/export.ts +23 -0
  76. package/convex/routes/file.ts +34 -0
  77. package/convex/routes/key.ts +53 -0
  78. package/convex/routes/mcp.ts +300 -0
  79. package/convex/routes/release.ts +66 -0
  80. package/convex/routes/upload.ts +94 -0
  81. package/convex/schema.ts +443 -0
  82. package/convex/search.ts +58 -0
  83. package/convex/seed.ts +624 -0
  84. package/convex/siteDeletion.ts +78 -0
  85. package/convex/sites.ts +393 -0
  86. package/convex/tasks.ts +51 -0
  87. package/convex/tsconfig.json +27 -0
  88. package/convex/uploads.ts +429 -0
  89. package/convex/uploadsNode.ts +86 -0
  90. package/convex/views.ts +111 -0
  91. package/i18n/de.json +364 -0
  92. package/i18n/en.json +364 -0
  93. package/i18n/es.json +364 -0
  94. package/i18n/fr.json +364 -0
  95. package/package.json +45 -3
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # @lupinum/ginko-server
2
+
3
+ ## 0.18.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#148](https://github.com/lupinum-dev/ginko/pull/148) [`38dd667`](https://github.com/lupinum-dev/ginko/commit/38dd667394ceb1134bcd7d0f627c7004cee08841) Thanks [@Mat4m0](https://github.com/Mat4m0)! - Add `@lupinum/ginko-server`, `@lupinum/ginko-studio` and `@lupinum/ginko-editor` to npm, so people can host the Ginko platform themselves.
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [[`05c6945`](https://github.com/lupinum-dev/ginko/commit/05c69459b076ca87e9fee376098c10f3b15f66f7), [`ab3b70e`](https://github.com/lupinum-dev/ginko/commit/ab3b70e6ceb230f2de490c818553a4cde78d626c), [`ed2eb8e`](https://github.com/lupinum-dev/ginko/commit/ed2eb8ebc757f20bbfee8077fc6a3ecc690c38e5), [`d89413d`](https://github.com/lupinum-dev/ginko/commit/d89413d2b7ab21863e349bd91c3704587f44b808), [`ab3b70e`](https://github.com/lupinum-dev/ginko/commit/ab3b70e6ceb230f2de490c818553a4cde78d626c), [`103d424`](https://github.com/lupinum-dev/ginko/commit/103d4243c63e3ad0e9507a9efb0173eb1b3b4573), [`d89413d`](https://github.com/lupinum-dev/ginko/commit/d89413d2b7ab21863e349bd91c3704587f44b808), [`ab3b70e`](https://github.com/lupinum-dev/ginko/commit/ab3b70e6ceb230f2de490c818553a4cde78d626c), [`d89413d`](https://github.com/lupinum-dev/ginko/commit/d89413d2b7ab21863e349bd91c3704587f44b808), [`d89413d`](https://github.com/lupinum-dev/ginko/commit/d89413d2b7ab21863e349bd91c3704587f44b808)]:
12
+ - @lupinum/ginko@0.18.0
13
+ - @lupinum/ginko-i18n@0.18.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Lupinum OG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,177 @@
1
- # Temporary Holding Version
1
+ # @lupinum/ginko-server
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ You do not install this package by hand. A platform project from `npm create ginko@latest my-cms -- --platform`
4
+ depends on it, and `ginko-platform setup` deploys it to Convex: the guide [Host the platform](https://ginko.lupinum.com/docs/host-the-platform) has the steps.
5
+ The sections below are the operator reference for Lupinum's own platform and for work on this repository.
6
+
7
+ The Ginko platform backend for [Convex](https://convex.dev): sites, entries, releases, uploads and
8
+ sign-in (Better Auth). It ships its Convex source in `convex/`; Convex bundles it when a host deploys.
9
+ Together with [`@lupinum/ginko-studio`](../ginko-studio) it forms the platform. `apps/platform` is the
10
+ reference host.
11
+
12
+ ## Deploy the platform (Lupinum operators)
13
+
14
+ This package is the Convex project: its `convex.json` points the Convex CLI at `convex/` (with `sharp` as an
15
+ external package). `apps/platform` is the host for the UI; it extends `@lupinum/ginko-studio`. Function names
16
+ stay the same (`api.sites.meta` and so on), so existing deployments and data stay valid.
17
+
18
+ Every Convex command of the platform runs in `packages/ginko-server`, never in another folder. The Convex CLI
19
+ keeps `sharp` out of the bundle only when it runs next to the `package.json` that lists it; from `apps/platform` it
20
+ bundles `sharp`, and the deploy fails on Convex's Linux runtime.
21
+
22
+ **Releases.** Every production build on Vercel deploys the Convex functions first and then builds the Studio
23
+ (`apps/platform/vercel.json` runs `ginko-platform build --convex ../../packages/ginko-server`, the command every
24
+ platform project builds with). A failed Convex deploy fails the build, and the previous release stays live. Preview
25
+ builds deploy nothing; a build outside Vercel deploys only when `CONVEX_DEPLOY_KEY` holds a production key. The
26
+ Vercel project's root directory is `apps/platform`. A deploy key made in the Convex dashboard needs the rights
27
+ `deployment:deploy` and `deployment:functions:runInternalMutations`; without the second, the build deploys but only
28
+ warns that it could not start the data migrations.
29
+
30
+ **Preview builds** still run the Nuxt build, and it stops without `SITE_URL` and the Convex URLs. So choose one:
31
+ add **Preview** variables in Vercel that point at a separate staging Convex project (see
32
+ [Preview deployments](https://github.com/lupinum-dev/better-convex/blob/main/docs/content/docs/6.operations/3.deploy-to-vercel.md#preview-deployments)
33
+ in the better-convex docs), or turn off preview builds for this Vercel project. Never point a preview at the
34
+ production deployment or reuse production secrets.
35
+
36
+ **Operator commands** use `pnpm exec better-convex-nuxt convex env|run …`. The wrapper reads the target deployment only
37
+ from `.env.local` in the current folder; it ignores `CONVEX_*` variables in the shell and refuses `--prod`. For
38
+ production, keep a separate checkout of this repository with the dependencies installed, and put only a key for
39
+ admin tasks into its `packages/ginko-server/.env.local` (never commit it, check it before every command):
40
+
41
+ ```dotenv
42
+ CONVEX_DEPLOY_KEY=prod:<deployment name>|<key>
43
+ ```
44
+
45
+ Create that key in the Convex dashboard, in the production deployment's settings: a production deploy key that can
46
+ set environment variables and run functions. Your working checkout's `.env.local` selects the local backend.
47
+
48
+ First launch, in this order:
49
+
50
+ 1. In the production checkout, set the Convex environment variables (table below). Give secrets on standard input,
51
+ and make the proxy secret once, because Vercel needs the same value in step 2:
52
+
53
+ ```bash
54
+ export BCN_AUTH_PROXY_IP_SECRET="$(openssl rand -base64 32)"
55
+ pnpm exec better-convex-nuxt convex env set SITE_URL https://platform.example
56
+ printf '1:%s' "$(openssl rand -base64 32)" | pnpm exec better-convex-nuxt convex env set BETTER_AUTH_SECRETS
57
+ printf '%s' "$BCN_AUTH_PROXY_IP_SECRET" | pnpm exec better-convex-nuxt convex env set BCN_AUTH_PROXY_IP_SECRET
58
+ ```
59
+
60
+ Do not print or commit the proxy secret.
61
+ 2. In Vercel, set the Studio's environment variables (see the [`ginko-studio` README](../ginko-studio/README.md)),
62
+ with `BCN_AUTH_PROXY_IP_SECRET` from step 1 (Sensitive), and `CONVEX_DEPLOY_KEY`: a deploy-only key (only the
63
+ `deployment:deploy` permission), in the **Production** environment only and marked Sensitive. A preview build
64
+ runs the code of any branch; with this key it could deploy that code to production. `SITE_URL` and
65
+ `BCN_AUTH_PROXY_IP_SECRET` must be the same in Convex and Vercel, or sign-in fails with 403.
66
+ 3. Deploy the production branch on Vercel. The build log shows the Convex deploy first, then the Nuxt build.
67
+ 4. Create the auth signing key once, before the first sign-in:
68
+ `pnpm exec better-convex-nuxt convex run auth:ensureSigningKey '{}'`. Check that
69
+ `https://platform.example/api/auth/jwks` lists the returned `kid`.
70
+ 5. For each new site:
71
+ - `pnpm exec better-convex-nuxt convex run sites:bootstrap '{"slug":"linde","name":"Gasthaus zur Linde","url":"https://linde.example"}'`
72
+ - `pnpm exec better-convex-nuxt convex run release:bootstrapKey '{"site":"linde","label":"CI","scopes":["release","check","pull","export"]}'`
73
+ prints the push key once. It goes into the site's CI as `GINKO_KEY`. To revoke a leaked key, find its id
74
+ with `release:pushKeys '{"site":"linde"}'` (it also shows `lastUsedAt`, stamped at most once an hour) and run
75
+ `release:revokePushKeyAsOperator '{"key":"<id>"}'`. Owners and admins see the live keys on the Studio's Team
76
+ page and can revoke them there. A developer can also run `npx ginko connect <Studio address>` in the website
77
+ and confirm its code on the Studio's `/connect` page; the key it gets is labelled `connect: <folder>`.
78
+ - `pnpm exec better-convex-nuxt convex run sites:setRefreshToken '{"slug":"linde","token":"<NUXT_GINKO_REVALIDATE_TOKEN of the site>"}'`
79
+ (at least 32 characters). "Update website now" sends it to the site. A bundle request that carries it
80
+ in `x-ginko-site-token` is not counted in the public rate limit.
81
+ 6. Sign in once with an address from `GINKO_ADMIN_EMAILS`: that makes the first admin, who invites owners.
82
+
83
+ Later releases need no manual step, except the one-time runs listed in
84
+ [`internals/migrations.md`](../../internals/migrations.md). Before such a release reaches the production branch, back
85
+ up production; after it, run the step in the production checkout (order in `internals/migrations.md`). Keep each
86
+ Convex change compatible with the previous Studio: open tabs call the new functions until they reload.
87
+
88
+ `pnpm ops:import <folder> --site <slug> --prod` (repository root) is the one operator command that does not use the
89
+ wrapper: it calls `npx convex run --prod` in this folder, and the Convex CLI takes the credentials from the shell or
90
+ from this folder's `.env.local`. Run it only in the production checkout. It takes a site that nobody has edited yet:
91
+ the singles the first release created from their defaults give way to the export's, and a single the export lacks gets
92
+ its defaults back when the import closes. With `--reset` it first clears the site; only a deployment with
93
+ `GINKO_DEMO=1` allows that.
94
+
95
+ ## Uploads stuck or failed
96
+
97
+ Every upload is `processing` until its run finishes, then `ready` or `failed`:
98
+
99
+ - `processing`: the file is stored and waits for the check (and, for photos, the processing). Normally done within
100
+ seconds. A run that is lost (crash, timeout, a write that failed) is queued again by the `stuck uploads` cron every
101
+ 10 minutes; after three attempts the upload is `failed`.
102
+ - `ready`: done; the file is in the library.
103
+ - `failed`: the check or processing failed for good (`error` is the message key the uploader saw) or the attempts ran
104
+ out. A retry makes sense after a service problem, not for a broken or forbidden file.
105
+
106
+ Members see failed uploads in the Studio under Files, "Problems", with a "Try again" button. Operators can do the same
107
+ for a whole site. Run these in `packages/ginko-server` like the other operator commands (the plain `npx convex run`
108
+ form works on a local backend):
109
+
110
+ ```bash
111
+ pnpm exec better-convex-nuxt convex run ops:status '{}' # counts, stuck and failed rows (add "site":"<slug>"), migrations
112
+ pnpm exec better-convex-nuxt convex run uploads:retry '{"site":"<slug>"}' # dry run: lists what would be queued
113
+ pnpm exec better-convex-nuxt convex run uploads:retry '{"site":"<slug>","dryRun":false}'
114
+ ```
115
+
116
+ `uploads:retry` takes failed and stuck uploads, or `"ids":[...]` for single rows. It sets them back to `processing`
117
+ with 0 attempts and schedules one run per row, 2 seconds apart. A row whose stored original is gone is not touched; it
118
+ is listed in `missing`. The daily sweep removes failed uploads that no content uses after 24 hours.
119
+
120
+ ## Data migrations
121
+
122
+ One-time data migrations run by themselves after a deploy: the production build calls
123
+ `npx convex run --prod migrations:runPending` right after `convex deploy` and prints one line, for example
124
+ `Migrations: all 5 done.` or `Migrations: started <name> (2 pending)`. They run in the background, one after the
125
+ other, and nobody runs them by hand. A fresh deployment records them all as done without running any. If you deploy
126
+ without `ginko-platform build`, run the same two commands:
127
+
128
+ ```bash
129
+ npx convex deploy
130
+ npx convex run --prod migrations:runPending
131
+ ```
132
+
133
+ `ops:status` shows `migrations`: how many are done, which are pending, the running one, and a stopped one with its
134
+ error. A stopped migration starts again from where it stopped with the next deploy. Take a backup in the Convex
135
+ dashboard before an update whose changelog names a migration. Rules for writing one:
136
+ [internals/migrations.md](../../internals/migrations.md).
137
+
138
+ ## Image variants (srcset)
139
+
140
+ New image uploads get WebP copies at 480, 960 and 1600 px wide (only those narrower than the image). Images
141
+ uploaded before that get them from a data migration after the deploy (20 files per page).
142
+
143
+ ## Markdown trees
144
+
145
+ Every live entry stores the parsed trees of its Markdown texts in the `entryTrees` table, so the public bundle parses
146
+ nothing. An entry keeps the trees of the parser it was saved with. A release that changes the parser's output (comark, its
147
+ plugins or Ginko's Markdown rules) adds a data migration that writes them again (`entries:migrateStorage`, 10 entries
148
+ per page, then the byte counters are recounted), so every deployment gets it with its next deploy.
149
+ `pnpm exec better-convex-nuxt convex run entries:storageStatus '{}'` checks the result, one site per call (pass the
150
+ returned `cursor`).
151
+
152
+ ## Environment variables
153
+
154
+ Set them in the Convex deployment (not in `.env.local`).
155
+
156
+ | Name | Purpose |
157
+ | --- | --- |
158
+ | `SITE_URL` | Public origin of the platform UI, the same value as the UI's `SITE_URL`. Used for sign-in, mail links and the upload CORS check. |
159
+ | `BETTER_AUTH_SECRETS` | Required. Signing secrets for sessions, as `<version>:<secret>`, for example `1:` followed by `openssl rand -base64 32`; rotate as `2:new,1:old`. Only Convex needs it, not Vercel. |
160
+ | `BCN_AUTH_PROXY_IP_SECRET` | Required. The same secret as in the UI: it proves that the UI set the client IP header. |
161
+ | `GINKO_ADMIN_EMAILS` | Comma-separated addresses. The first sign-in with one of them makes an admin. |
162
+ | `GINKO_MAIL` | How mail is sent: `resend` (hosted) or `outbox` (local and test sink). |
163
+ | `GINKO_MAIL_FROM` | Sender address for mail sent through Resend. |
164
+ | `RESEND_API_KEY` | API key for Resend when `GINKO_MAIL=resend`. |
165
+ | `GINKO_LOCAL` | `1` only on a local deployment: enables the demo seed and `devPush`. Never set it on a hosted one. |
166
+ | `GINKO_DEMO` | `1` only on the demo platform (lupinum-ginko-demo): lets `pnpm ops:import … --reset` and `pnpm templates demo-reset` clear a site before they load its content again. Never set it on a platform with client sites. |
167
+
168
+ ## Local backend
169
+
170
+ `pnpm --filter @ginko/platform convex` starts `better-convex-nuxt convex dev --anonymous` in this folder: a local backend (no
171
+ account, no cloud). It writes the deployment and its URLs to `packages/ginko-server/.env.local` (git-ignored); the
172
+ scripts in `scripts/` and `apps/platform` (`pnpm dev`, the e2e tests) read that one file. State lives in
173
+ `packages/ginko-server/.convex`.
174
+
175
+ ## Tests
176
+
177
+ `pnpm exec vitest run --project convex` from the repo root runs the tests in `test/` with `convex-test`.
@@ -0,0 +1,185 @@
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 account from "../account.js";
12
+ import type * as agent from "../agent.js";
13
+ import type * as auth from "../auth.js";
14
+ import type * as backup from "../backup.js";
15
+ import type * as bundle from "../bundle.js";
16
+ import type * as changes from "../changes.js";
17
+ import type * as cleanup from "../cleanup.js";
18
+ import type * as connect from "../connect.js";
19
+ import type * as crons from "../crons.js";
20
+ import type * as demo from "../demo.js";
21
+ import type * as entries from "../entries.js";
22
+ import type * as facts from "../facts.js";
23
+ import type * as files from "../files.js";
24
+ import type * as http from "../http.js";
25
+ import type * as image from "../image.js";
26
+ import type * as images from "../images.js";
27
+ import type * as invites from "../invites.js";
28
+ import type * as lib_access from "../lib/access.js";
29
+ import type * as lib_agentTools from "../lib/agentTools.js";
30
+ import type * as lib_content from "../lib/content.js";
31
+ import type * as lib_corpus from "../lib/corpus.js";
32
+ import type * as lib_diff from "../lib/diff.js";
33
+ import type * as lib_fail from "../lib/fail.js";
34
+ import type * as lib_files from "../lib/files.js";
35
+ import type * as lib_history from "../lib/history.js";
36
+ import type * as lib_i18n from "../lib/i18n.js";
37
+ import type * as lib_input from "../lib/input.js";
38
+ import type * as lib_library from "../lib/library.js";
39
+ import type * as lib_lifecycle from "../lib/lifecycle.js";
40
+ import type * as lib_list from "../lib/list.js";
41
+ import type * as lib_migrations from "../lib/migrations.js";
42
+ import type * as lib_names from "../lib/names.js";
43
+ import type * as lib_pending from "../lib/pending.js";
44
+ import type * as lib_policy from "../lib/policy.js";
45
+ import type * as lib_publicness from "../lib/publicness.js";
46
+ import type * as lib_reminders from "../lib/reminders.js";
47
+ import type * as lib_search from "../lib/search.js";
48
+ import type * as lib_siteUrl from "../lib/siteUrl.js";
49
+ import type * as lib_status from "../lib/status.js";
50
+ import type * as lib_translation from "../lib/translation.js";
51
+ import type * as lib_trees from "../lib/trees.js";
52
+ import type * as lib_write from "../lib/write.js";
53
+ import type * as mail from "../mail.js";
54
+ import type * as members from "../members.js";
55
+ import type * as migrations from "../migrations.js";
56
+ import type * as navigation from "../navigation.js";
57
+ import type * as ops from "../ops.js";
58
+ import type * as proposals from "../proposals.js";
59
+ import type * as refresh from "../refresh.js";
60
+ import type * as release from "../release.js";
61
+ import type * as reminders from "../reminders.js";
62
+ import type * as retention from "../retention.js";
63
+ import type * as routes_bundle from "../routes/bundle.js";
64
+ import type * as routes_connect from "../routes/connect.js";
65
+ import type * as routes_export from "../routes/export.js";
66
+ import type * as routes_file from "../routes/file.js";
67
+ import type * as routes_key from "../routes/key.js";
68
+ import type * as routes_mcp from "../routes/mcp.js";
69
+ import type * as routes_release from "../routes/release.js";
70
+ import type * as routes_upload from "../routes/upload.js";
71
+ import type * as search from "../search.js";
72
+ import type * as seed from "../seed.js";
73
+ import type * as siteDeletion from "../siteDeletion.js";
74
+ import type * as sites from "../sites.js";
75
+ import type * as tasks from "../tasks.js";
76
+ import type * as uploads from "../uploads.js";
77
+ import type * as uploadsNode from "../uploadsNode.js";
78
+ import type * as views from "../views.js";
79
+
80
+ import type {
81
+ ApiFromModules,
82
+ FilterApi,
83
+ FunctionReference,
84
+ } from "convex/server";
85
+
86
+ declare const fullApi: ApiFromModules<{
87
+ account: typeof account;
88
+ agent: typeof agent;
89
+ auth: typeof auth;
90
+ backup: typeof backup;
91
+ bundle: typeof bundle;
92
+ changes: typeof changes;
93
+ cleanup: typeof cleanup;
94
+ connect: typeof connect;
95
+ crons: typeof crons;
96
+ demo: typeof demo;
97
+ entries: typeof entries;
98
+ facts: typeof facts;
99
+ files: typeof files;
100
+ http: typeof http;
101
+ image: typeof image;
102
+ images: typeof images;
103
+ invites: typeof invites;
104
+ "lib/access": typeof lib_access;
105
+ "lib/agentTools": typeof lib_agentTools;
106
+ "lib/content": typeof lib_content;
107
+ "lib/corpus": typeof lib_corpus;
108
+ "lib/diff": typeof lib_diff;
109
+ "lib/fail": typeof lib_fail;
110
+ "lib/files": typeof lib_files;
111
+ "lib/history": typeof lib_history;
112
+ "lib/i18n": typeof lib_i18n;
113
+ "lib/input": typeof lib_input;
114
+ "lib/library": typeof lib_library;
115
+ "lib/lifecycle": typeof lib_lifecycle;
116
+ "lib/list": typeof lib_list;
117
+ "lib/migrations": typeof lib_migrations;
118
+ "lib/names": typeof lib_names;
119
+ "lib/pending": typeof lib_pending;
120
+ "lib/policy": typeof lib_policy;
121
+ "lib/publicness": typeof lib_publicness;
122
+ "lib/reminders": typeof lib_reminders;
123
+ "lib/search": typeof lib_search;
124
+ "lib/siteUrl": typeof lib_siteUrl;
125
+ "lib/status": typeof lib_status;
126
+ "lib/translation": typeof lib_translation;
127
+ "lib/trees": typeof lib_trees;
128
+ "lib/write": typeof lib_write;
129
+ mail: typeof mail;
130
+ members: typeof members;
131
+ migrations: typeof migrations;
132
+ navigation: typeof navigation;
133
+ ops: typeof ops;
134
+ proposals: typeof proposals;
135
+ refresh: typeof refresh;
136
+ release: typeof release;
137
+ reminders: typeof reminders;
138
+ retention: typeof retention;
139
+ "routes/bundle": typeof routes_bundle;
140
+ "routes/connect": typeof routes_connect;
141
+ "routes/export": typeof routes_export;
142
+ "routes/file": typeof routes_file;
143
+ "routes/key": typeof routes_key;
144
+ "routes/mcp": typeof routes_mcp;
145
+ "routes/release": typeof routes_release;
146
+ "routes/upload": typeof routes_upload;
147
+ search: typeof search;
148
+ seed: typeof seed;
149
+ siteDeletion: typeof siteDeletion;
150
+ sites: typeof sites;
151
+ tasks: typeof tasks;
152
+ uploads: typeof uploads;
153
+ uploadsNode: typeof uploadsNode;
154
+ views: typeof views;
155
+ }>;
156
+
157
+ /**
158
+ * A utility for referencing Convex functions in your app's public API.
159
+ *
160
+ * Usage:
161
+ * ```js
162
+ * const myFunctionReference = api.myModule.myFunction;
163
+ * ```
164
+ */
165
+ export declare const api: FilterApi<
166
+ typeof fullApi,
167
+ FunctionReference<any, "public">
168
+ >;
169
+
170
+ /**
171
+ * A utility for referencing Convex functions in your app's internal API.
172
+ *
173
+ * Usage:
174
+ * ```js
175
+ * const myFunctionReference = internal.myModule.myFunction;
176
+ * ```
177
+ */
178
+ export declare const internal: FilterApi<
179
+ typeof fullApi,
180
+ FunctionReference<any, "internal">
181
+ >;
182
+
183
+ export declare const components: {
184
+ betterAuth: import("../betterAuth/_generated/component.js").ComponentApi<"betterAuth">;
185
+ };
@@ -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>;