@runlot/api 0.1.0-rc.180 → 0.1.0-rc.181

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schema.d.ts CHANGED
@@ -2568,9 +2568,10 @@ export interface paths {
2568
2568
  get: operations["getDatabase"];
2569
2569
  put?: never;
2570
2570
  /**
2571
- * Creates a new database after the previous one was deleted
2572
- * @description Every project has a database from the start; this creates a new, empty one after a
2573
- * delete, and clears the turn-off so later deploys keep it. It returns the connection
2571
+ * Creates the project's database
2572
+ * @description A database is created when your app uses one; this creates it by name, whether the
2573
+ * project never had one or its database was deleted. A new database starts empty. It
2574
+ * also clears the turn-off, so later deploys keep it. It returns the connection
2574
2575
  * details. Shortly afterwards
2575
2576
  * the running worker picks up a connected `env.db`. No redeploy is needed.
2576
2577
  *
@@ -3867,13 +3868,16 @@ export interface paths {
3867
3868
  get: operations["getAuth"];
3868
3869
  put?: never;
3869
3870
  /**
3870
- * Turns login back on after it was turned off
3871
+ * Turns login on
3871
3872
  * @description **This is idempotent** — calling it twice leaves the settings and login providers
3872
3873
  * unchanged. Auth is either on or off; there is no "on but disabled" state.
3873
3874
  *
3874
- * **A database is required.** Without one this returns 409 `database_required`, because
3875
- * the end-user tables live inside the project's database. Every project has one unless it
3876
- * was deleted, so you will see this only after a database delete.
3875
+ * **Login creates the database it needs.** The end-user tables live inside the
3876
+ * project's database, so a project without one gets it first, as if you had run
3877
+ * `runlot pg on`. Two cases are refused instead, each with a 409 that says why: the
3878
+ * project's database was deleted (`database_required`), or the live deployment's
3879
+ * `runlot.json` says `"database": false` (`database_disabled`). Create the database with
3880
+ * `POST …/database` (`runlot pg on`) and call this again.
3877
3881
  *
3878
3882
  * Once enabled, the built-in login endpoints start serving shortly afterwards. As with
3879
3883
  * `env.db` and `env.storage`, no redeploy is needed. Table initialization is idempotent,
@@ -9802,7 +9806,7 @@ export interface components {
9802
9806
  /** @description A deployment in the overview. Same shape as `Deployment`, including `actor`. */
9803
9807
  OverviewDeployment: components["schemas"]["Deployment"];
9804
9808
  OverviewDatabase: {
9805
- /** @description Whether the project has a database. Every project has one unless it was deleted. */
9809
+ /** @description Whether the project has a database. One is created when the app uses it, or by `runlot pg on`. */
9806
9810
  granted: boolean;
9807
9811
  /**
9808
9812
  * Format: date-time
@@ -11785,6 +11789,24 @@ export interface components {
11785
11789
  * while the class the worker exports has no objects under it.
11786
11790
  */
11787
11791
  migrations?: components["schemas"]["ManifestDurableObjectMigration"][];
11792
+ /**
11793
+ * @description Whether this code uses the project's database (`env.db`). A database is created
11794
+ * when your app uses one, not for every project.
11795
+ *
11796
+ * - **absent** — unspecified. The deployment grants nothing on its account; if the
11797
+ * app calls `env.db` anyway, the database is created on that first call, and calls
11798
+ * made while it is being created reject with the retryable `DatabaseStarting`.
11799
+ * - **`true`** — the app uses a database, and the deployment creates it before the
11800
+ * new version is published. `runlot deploy` writes this when the build reaches a
11801
+ * database: an import of `@runlot/pg`, of a driver or ORM it routes to `env.db`, or
11802
+ * of `@runlot/auth`; a `migrations/NNNN_*.sql` file; or `env.db` / `env.DB` in the
11803
+ * project's own sources. A value set in your `runlot.json` wins over that guess.
11804
+ * - **`false`** — never create one. Neither the deployment nor a call creates it, and
11805
+ * `env.db` rejects with `DatabaseNotEnabled`. `runlot pg on` still creates one,
11806
+ * because it asks by name. Declaring `queues` with `false` is refused with a 400:
11807
+ * queue messages are kept in the database.
11808
+ */
11809
+ database?: boolean;
11788
11810
  /**
11789
11811
  * @description Declares email sending and receiving. When `true`, the worker receives
11790
11812
  * `env.email`, and `export default { email() }` becomes the receiving handler.
@@ -20685,7 +20707,8 @@ export interface operations {
20685
20707
  404: components["responses"]["NotFound"];
20686
20708
  /**
20687
20709
  * @description `database_required` — this project's database was deleted.
20688
- * Create a new one with `POST …/database` (`runlot pg on`).
20710
+ * `database_disabled` — `runlot.json` says `"database": false`.
20711
+ * Either way, create the database with `POST …/database` (`runlot pg on`) first.
20689
20712
  */
20690
20713
  409: {
20691
20714
  headers: {