@rebasepro/server 0.16.0 → 0.16.1-canary.g0d7af95

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 (219) hide show
  1. package/dist/{GCSStorageController-BEmDYFKc.js → GCSStorageController-Bl7nmhdv.js} +7 -6
  2. package/dist/{GCSStorageController-BEmDYFKc.js.map → GCSStorageController-Bl7nmhdv.js.map} +1 -1
  3. package/dist/{S3StorageController-B2EDXXMH.js → S3StorageController-CWvvrRpF.js} +7 -6
  4. package/dist/{S3StorageController-B2EDXXMH.js.map → S3StorageController-CWvvrRpF.js.map} +1 -1
  5. package/dist/{admin_block-DLILvzle.js → admin_block-BeypnEfb.js} +6 -6
  6. package/dist/admin_block-BeypnEfb.js.map +1 -0
  7. package/dist/api/ast-schema-editor.d.ts +23 -0
  8. package/dist/api/contract-routes.d.ts +1 -1
  9. package/dist/api/errors.d.ts +1 -1
  10. package/dist/api/index.d.ts +3 -3
  11. package/dist/api/live-schema-routes.d.ts +122 -0
  12. package/dist/api/logs-routes.d.ts +1 -1
  13. package/dist/api/mount.d.ts +41 -0
  14. package/dist/api/rest/api-generator.d.ts +2 -2
  15. package/dist/api/rest/index.d.ts +1 -1
  16. package/dist/api/rest/query-parser.d.ts +1 -1
  17. package/dist/api/schema-editor-routes.d.ts +1 -1
  18. package/dist/api/types.d.ts +12 -4
  19. package/dist/{schema-editor-routes-CV9k0w3G.js → ast-schema-editor-BrarYZCq.js} +37 -45
  20. package/dist/ast-schema-editor-BrarYZCq.js.map +1 -0
  21. package/dist/auth/adapter-middleware.d.ts +2 -2
  22. package/dist/auth/admin-roles-route.d.ts +2 -2
  23. package/dist/auth/admin-user-ops.d.ts +3 -3
  24. package/dist/auth/admin-users-route.d.ts +4 -6
  25. package/dist/auth/api-keys/api-key-middleware.d.ts +2 -2
  26. package/dist/auth/api-keys/api-key-permission-guard.d.ts +1 -1
  27. package/dist/auth/api-keys/api-key-routes.d.ts +2 -2
  28. package/dist/auth/api-keys/api-key-store.d.ts +1 -1
  29. package/dist/auth/api-keys/index.d.ts +9 -9
  30. package/dist/auth/apple-oauth.d.ts +2 -2
  31. package/dist/auth/auth-hooks.d.ts +4 -4
  32. package/dist/auth/bitbucket-oauth.d.ts +2 -2
  33. package/dist/auth/builtin-auth-adapter.d.ts +8 -4
  34. package/dist/auth/capabilities.d.ts +51 -0
  35. package/dist/auth/captcha.d.ts +86 -0
  36. package/dist/auth/cookie-utils.d.ts +2 -2
  37. package/dist/auth/discord-oauth.d.ts +2 -2
  38. package/dist/auth/facebook-oauth.d.ts +2 -2
  39. package/dist/auth/github-oauth.d.ts +2 -2
  40. package/dist/auth/gitlab-oauth.d.ts +2 -2
  41. package/dist/auth/google-oauth.d.ts +1 -1
  42. package/dist/auth/index.d.ts +58 -54
  43. package/dist/auth/jwks-routes.d.ts +1 -1
  44. package/dist/auth/jwt.d.ts +1 -1
  45. package/dist/auth/linkedin-oauth.d.ts +2 -2
  46. package/dist/auth/magic-link-routes.d.ts +10 -3
  47. package/dist/auth/mfa-gate.d.ts +1 -1
  48. package/dist/auth/mfa-routes.d.ts +3 -3
  49. package/dist/auth/microsoft-oauth.d.ts +2 -2
  50. package/dist/auth/middleware.d.ts +6 -7
  51. package/dist/auth/otp-routes.d.ts +89 -0
  52. package/dist/auth/rate-limiter.d.ts +2 -2
  53. package/dist/auth/require-auth.d.ts +1 -1
  54. package/dist/auth/reset-password-admin.d.ts +4 -4
  55. package/dist/auth/routes.d.ts +18 -10
  56. package/dist/auth/session-routes.d.ts +3 -3
  57. package/dist/auth/slack-oauth.d.ts +2 -2
  58. package/dist/auth/spotify-oauth.d.ts +2 -2
  59. package/dist/auth/token-revocation.d.ts +2 -2
  60. package/dist/auth/twitter-oauth.d.ts +2 -2
  61. package/dist/{auth-5Et5mnUA.js → auth-DU-nUjPp.js} +604 -4376
  62. package/dist/auth-DU-nUjPp.js.map +1 -0
  63. package/dist/backup/backup-common.d.ts +1 -1
  64. package/dist/backup/backup-routes.d.ts +3 -3
  65. package/dist/backup/index.d.ts +3 -3
  66. package/dist/{backup-C6ljYVTp.js → backup-CRdZkA6c.js} +7 -6
  67. package/dist/{backup-C6ljYVTp.js.map → backup-CRdZkA6c.js.map} +1 -1
  68. package/dist/boot/boot.d.ts +5 -5
  69. package/dist/boot/bundle.d.ts +10 -1
  70. package/dist/boot/driver.d.ts +1 -1
  71. package/dist/boot/env.d.ts +28 -1
  72. package/dist/boot/fetch-bundle.d.ts +144 -1
  73. package/dist/boot/options.d.ts +30 -6
  74. package/dist/boot/resource-adapters.d.ts +31 -0
  75. package/dist/boot/resource-loading.d.ts +10 -0
  76. package/dist/boot/role.d.ts +3 -2
  77. package/dist/boot/sources.d.ts +8 -2
  78. package/dist/boot/version-skew.d.ts +1 -1
  79. package/dist/collections/BackendCollectionRegistry.d.ts +1 -1
  80. package/dist/collections/loader.d.ts +1 -1
  81. package/dist/collections/validate-config.d.ts +13 -0
  82. package/dist/{contract-routes-DZ-LBpSL.js → contract-routes-D8TvxPLo.js} +8 -7
  83. package/dist/contract-routes-D8TvxPLo.js.map +1 -0
  84. package/dist/cron/cron-routes.d.ts +2 -2
  85. package/dist/cron/cron-scheduler.d.ts +3 -3
  86. package/dist/cron/index.d.ts +8 -8
  87. package/dist/{cron-loader-YhhQeVBM.js → cron-loader-d9WMFENB.js} +8 -7
  88. package/dist/{cron-loader-YhhQeVBM.js.map → cron-loader-d9WMFENB.js.map} +1 -1
  89. package/dist/{cron-routes-maM_RlUu.js → cron-routes-BsukhMGm.js} +9 -8
  90. package/dist/cron-routes-BsukhMGm.js.map +1 -0
  91. package/dist/{cron-scheduler-DIpYBmZP.js → cron-scheduler-BB82dWuU.js} +9 -9
  92. package/dist/cron-scheduler-BB82dWuU.js.map +1 -0
  93. package/dist/{cron-store-DfH_4Cd9.js → cron-store-CbFfQhbg.js} +11 -9
  94. package/dist/{cron-store-DfH_4Cd9.js.map → cron-store-CbFfQhbg.js.map} +1 -1
  95. package/dist/ddl-bootstrap-5YZCZ8qk.js +146 -0
  96. package/dist/ddl-bootstrap-5YZCZ8qk.js.map +1 -0
  97. package/dist/deploy/pod-contract.d.ts +139 -0
  98. package/dist/dev-secrets.d.ts +52 -0
  99. package/dist/{dynamic-import-Dvh-K5fl.js → dynamic-import-X40pTZUQ.js} +5 -4
  100. package/dist/{dynamic-import-Dvh-K5fl.js.map → dynamic-import-X40pTZUQ.js.map} +1 -1
  101. package/dist/email/dev-sink.d.ts +88 -0
  102. package/dist/email/index.d.ts +9 -7
  103. package/dist/email/link-base.d.ts +1 -1
  104. package/dist/email/smtp-email-service.d.ts +2 -2
  105. package/dist/email/templates.d.ts +12 -0
  106. package/dist/email/types.d.ts +18 -6
  107. package/dist/env.d.ts +1 -1
  108. package/dist/{errors-EBYiaJ2E.js → errors-DBwpj9N8.js} +8 -7
  109. package/dist/errors-DBwpj9N8.js.map +1 -0
  110. package/dist/{function-loader-DDS1v7YX.js → function-loader-LLdmBFoL.js} +9 -8
  111. package/dist/{function-loader-DDS1v7YX.js.map → function-loader-LLdmBFoL.js.map} +1 -1
  112. package/dist/{function-routes-Btcez1T-.js → function-routes-ClT6UQpD.js} +8 -7
  113. package/dist/function-routes-ClT6UQpD.js.map +1 -0
  114. package/dist/functions/context.d.ts +141 -0
  115. package/dist/functions/define-function.d.ts +1 -1
  116. package/dist/functions/function-routes.d.ts +9 -3
  117. package/dist/functions/guards.d.ts +76 -0
  118. package/dist/functions/index.d.ts +96 -5
  119. package/dist/functions/index.js +919 -0
  120. package/dist/functions/index.js.map +1 -0
  121. package/dist/functions/internal.d.ts +26 -0
  122. package/dist/functions/proxy.d.ts +1 -1
  123. package/dist/functions/request-timeout.d.ts +9 -1
  124. package/dist/functions/runtime-env.d.ts +92 -0
  125. package/dist/functions/wait-until.d.ts +74 -0
  126. package/dist/history/history-routes.d.ts +2 -2
  127. package/dist/history/index.d.ts +1 -1
  128. package/dist/history-recorder-B67maiTi.js +76 -0
  129. package/dist/history-recorder-B67maiTi.js.map +1 -0
  130. package/dist/history-store-oiqhb3HU.js +210 -0
  131. package/dist/history-store-oiqhb3HU.js.map +1 -0
  132. package/dist/index.d.ts +65 -54
  133. package/dist/index.es.js +3667 -328
  134. package/dist/index.es.js.map +1 -1
  135. package/dist/init/docs.d.ts +1 -1
  136. package/dist/init/middlewares.d.ts +1 -1
  137. package/dist/init/shutdown.d.ts +4 -0
  138. package/dist/init/storage.d.ts +1 -1
  139. package/dist/init/surfaces.d.ts +10 -0
  140. package/dist/init.d.ts +179 -22
  141. package/dist/internal-tables-DpxfPaEB.js +97 -0
  142. package/dist/internal-tables-DpxfPaEB.js.map +1 -0
  143. package/dist/jobs/index.d.ts +5 -5
  144. package/dist/{jobs-CyOKXXlu.js → jobs-B2ELModo.js} +11 -9
  145. package/dist/{jobs-CyOKXXlu.js.map → jobs-B2ELModo.js.map} +1 -1
  146. package/dist/{jwt-DxH9fLPt.js → jwt-DoHkMMWF.js} +9 -8
  147. package/dist/jwt-DoHkMMWF.js.map +1 -0
  148. package/dist/{logger-DfvF_8r-.js → logger-DS03e908.js} +104 -10
  149. package/dist/logger-DS03e908.js.map +1 -0
  150. package/dist/{logs-routes-CWBLQj2l.js → logs-routes-DB72iQSr.js} +36 -9
  151. package/dist/logs-routes-DB72iQSr.js.map +1 -0
  152. package/dist/metrics/history-recorder.d.ts +18 -0
  153. package/dist/metrics/history-store.d.ts +123 -0
  154. package/dist/metrics/index.d.ts +10 -2
  155. package/dist/{openapi-generator-BCKJRUS4.js → openapi-generator-FFGT0H6O.js} +7 -11
  156. package/dist/{openapi-generator-BCKJRUS4.js.map → openapi-generator-FFGT0H6O.js.map} +1 -1
  157. package/dist/{proxy-Bj5DVllb.js → proxy-CMymhnwG.js} +9 -6
  158. package/dist/{proxy-Bj5DVllb.js.map → proxy-CMymhnwG.js.map} +1 -1
  159. package/dist/query-parser--nstjRCh.js +355 -0
  160. package/dist/query-parser--nstjRCh.js.map +1 -0
  161. package/dist/{request-timeout-BuFoEKwT.js → request-timeout-C8gkc-j7.js} +21 -6
  162. package/dist/request-timeout-C8gkc-j7.js.map +1 -0
  163. package/dist/rls-audit/index.d.ts +111 -0
  164. package/dist/{rolldown-runtime-DSJWtz9O.js → rolldown-runtime-dW7B1o5h.js} +4 -3
  165. package/dist/schema-edit/apply-schema-change.d.ts +141 -0
  166. package/dist/schema-edit/github-repository.d.ts +67 -0
  167. package/dist/schema-edit/local-git-repository.d.ts +28 -0
  168. package/dist/schema-edit/project-root.d.ts +43 -0
  169. package/dist/schema-edit/remote-source.d.ts +25 -0
  170. package/dist/schema-edit/schema-edit-permissions.d.ts +129 -0
  171. package/dist/schema-editor-routes-Bf5h5Emf.js +87 -0
  172. package/dist/schema-editor-routes-Bf5h5Emf.js.map +1 -0
  173. package/dist/schemas-DBxgjM9A.js +4153 -0
  174. package/dist/schemas-DBxgjM9A.js.map +1 -0
  175. package/dist/{selection-_z6TM1DB.js → selection-CRpqKUbt.js} +6 -5
  176. package/dist/{selection-_z6TM1DB.js.map → selection-CRpqKUbt.js.map} +1 -1
  177. package/dist/services/webhook-service.d.ts +1 -1
  178. package/dist/singleton.d.ts +7 -0
  179. package/dist/{src-BPfYOeN4.js → src-B-CmIFMr.js} +8 -6
  180. package/dist/src-B-CmIFMr.js.map +1 -0
  181. package/dist/{src-CrCxd8km.js → src-Cdsw7DqV.js} +126 -5
  182. package/dist/src-Cdsw7DqV.js.map +1 -0
  183. package/dist/storage/GCSStorageController.d.ts +1 -1
  184. package/dist/storage/LocalStorageController.d.ts +1 -1
  185. package/dist/storage/S3StorageController.d.ts +1 -1
  186. package/dist/storage/cache-headers.d.ts +87 -0
  187. package/dist/storage/index.d.ts +11 -11
  188. package/dist/storage/path-pattern.d.ts +58 -0
  189. package/dist/storage/policies.d.ts +88 -0
  190. package/dist/storage/range.d.ts +63 -0
  191. package/dist/storage/rendition-cache.d.ts +45 -0
  192. package/dist/storage/routes.d.ts +17 -5
  193. package/dist/storage/storage-registry.d.ts +1 -1
  194. package/dist/storage/triggers.d.ts +66 -0
  195. package/dist/storage/tus-handler.d.ts +34 -3
  196. package/dist/topics/runtime.d.ts +68 -0
  197. package/dist/{types-DSnOC4mF.js → types-BfKcm9do.js} +5 -4
  198. package/dist/{types-DSnOC4mF.js.map → types-BfKcm9do.js.map} +1 -1
  199. package/dist/utils/host.d.ts +58 -0
  200. package/dist/utils/logger.d.ts +0 -15
  201. package/dist/utils/request-id.d.ts +1 -1
  202. package/functions/package.json +24 -0
  203. package/package.json +13 -7
  204. package/dist/admin_block-DLILvzle.js.map +0 -1
  205. package/dist/auth-5Et5mnUA.js.map +0 -1
  206. package/dist/contract-routes-DZ-LBpSL.js.map +0 -1
  207. package/dist/cron-routes-maM_RlUu.js.map +0 -1
  208. package/dist/cron-scheduler-DIpYBmZP.js.map +0 -1
  209. package/dist/ddl-bootstrap-Cywoj8Ta.js +0 -221
  210. package/dist/ddl-bootstrap-Cywoj8Ta.js.map +0 -1
  211. package/dist/errors-EBYiaJ2E.js.map +0 -1
  212. package/dist/function-routes-Btcez1T-.js.map +0 -1
  213. package/dist/jwt-DxH9fLPt.js.map +0 -1
  214. package/dist/logger-DfvF_8r-.js.map +0 -1
  215. package/dist/logs-routes-CWBLQj2l.js.map +0 -1
  216. package/dist/request-timeout-BuFoEKwT.js.map +0 -1
  217. package/dist/schema-editor-routes-CV9k0w3G.js.map +0 -1
  218. package/dist/src-BPfYOeN4.js.map +0 -1
  219. package/dist/src-CrCxd8km.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { Hono } from "hono";
2
2
  import { CollectionConfig } from "@rebasepro/types";
3
- import { HonoEnv } from "../api/types";
3
+ import { HonoEnv } from "../api/types.js";
4
4
  /**
5
5
  * Serve the OpenAPI document, and Swagger UI outside production.
6
6
  *
@@ -1,5 +1,5 @@
1
1
  import { Hono } from "hono";
2
- import { HonoEnv } from "../api/types";
2
+ import { HonoEnv } from "../api/types.js";
3
3
  interface MiddlewareConfig {
4
4
  maxBodySize?: number;
5
5
  compression?: boolean;
@@ -9,6 +9,10 @@ interface ShutdownConfig {
9
9
  jobQueue?: {
10
10
  stop(): Promise<void>;
11
11
  };
12
+ /** Structural, same reason. */
13
+ rlsAudit?: {
14
+ stop(): void;
15
+ };
12
16
  realtimeServices: Record<string, RealtimeProvider>;
13
17
  }
14
18
  /**
@@ -1,4 +1,4 @@
1
- import { BackendStorageConfig, StorageController, StorageRegistry } from "../storage";
1
+ import { BackendStorageConfig, StorageController, StorageRegistry } from "../storage/index.js";
2
2
  export declare function initializeStorage(storageConfig: BackendStorageConfig | StorageController | Record<string, BackendStorageConfig | StorageController> | undefined, isProduction: boolean): Promise<{
3
3
  storageRegistry?: StorageRegistry;
4
4
  storageController?: StorageController;
@@ -59,6 +59,16 @@ export interface RuntimeOwnership {
59
59
  cronScheduler: boolean;
60
60
  /** Start the durable job queue's workers. Only relevant when `jobs.enabled`. */
61
61
  jobWorkers: boolean;
62
+ /**
63
+ * Run the scheduled row-level-security audit. Only relevant when
64
+ * `rlsAudit.enabled`.
65
+ *
66
+ * Unlike the two above, this one is not claim-protected — every process that
67
+ * owns it introspects the catalog on its own timer. That is read-only and
68
+ * harmless, just wasteful, so a split deployment should give it to one
69
+ * process the same way it gives it cron.
70
+ */
71
+ rlsAudit: boolean;
62
72
  }
63
73
  /** A fully-resolved answer for every owned singleton. */
64
74
  export type ResolvedOwnership = RuntimeOwnership;
package/dist/init.d.ts CHANGED
@@ -1,17 +1,42 @@
1
- import { AuthAdapter, BackendBootstrapper, BootstrappedAuth, DatabaseAdapter, DataDriver, DataSourceDefinition, CollectionCallbacks, AnyCollectionConfig, HealthCheckResult, HistoryConfig, InitializedDriver, RealtimeProvider } from "@rebasepro/types";
2
- import { BackendCollectionRegistry } from "./collections/BackendCollectionRegistry";
3
- import { DriverRegistry } from "./services/driver-registry";
1
+ import { AuthAdapter, BackendBootstrapper, BootstrappedAuth, DatabaseAdapter, DataDriver, CollectionCallbacks, AnyCollectionConfig, HealthCheckResult, HistoryConfig, InitializedDriver, RealtimeProvider } from "@rebasepro/types";
2
+ import { BackendCollectionRegistry } from "./collections/BackendCollectionRegistry.js";
3
+ import { DriverRegistry } from "./services/driver-registry.js";
4
4
  import { Server } from "http";
5
5
  import { Hono } from "hono";
6
- import { HonoEnv } from "./api/types";
7
- import { type RuntimeOwnershipOptions, type RuntimeSurfaceOptions } from "./init/surfaces";
8
- import type { JwtSigningKeyConfig } from "./auth/jwt-keys";
9
- import type { JobQueueOptions } from "./jobs/types";
10
- import { BackendStorageConfig, StorageController, StorageRegistry } from "./storage";
11
- import { type DataRateLimitConfig } from "./auth/rate-limiter";
12
- import { EmailConfig } from "./email";
13
- import type { OAuthProvider } from "./auth/interfaces";
14
- import type { AuthHooks } from "./auth/auth-hooks";
6
+ import { HonoEnv } from "./api/types.js";
7
+ import type { SchemaEditPolicy, RemoteRepositoryConfig } from "./schema-edit/schema-edit-permissions.js";
8
+ /**
9
+ * Who may change this project's schema through a running backend.
10
+ *
11
+ * An alias rather than its own shape: the policy is defined next to the code
12
+ * that enforces it, and a second declaration here would be a second place for
13
+ * it to drift.
14
+ *
15
+ * @see `packages/server/src/schema-edit/schema-edit-permissions.ts`
16
+ */
17
+ export interface LiveSchemaConfig extends SchemaEditPolicy {
18
+ /**
19
+ * A repository to commit to when the source is not on this machine.
20
+ *
21
+ * A bundle deployment ships compiled output, so there is nothing for the
22
+ * collection editor to rewrite locally. Configure this and the change is
23
+ * read from the repository, rewritten, and committed back through the Git
24
+ * Data API — no clone, no working tree.
25
+ *
26
+ * Absent, live schema editing needs the project mounted and says so.
27
+ */
28
+ repository?: RemoteRepositoryConfig;
29
+ }
30
+ import { type RlsAuditConfig } from "./rls-audit/index.js";
31
+ import type { CaptchaConfig } from "./auth/captcha.js";
32
+ import { type RuntimeOwnershipOptions, type RuntimeSurfaceOptions } from "./init/surfaces.js";
33
+ import type { JwtSigningKeyConfig } from "./auth/jwt-keys.js";
34
+ import type { JobQueueOptions } from "./jobs/types.js";
35
+ import { BackendStorageConfig, StorageController, StorageRegistry } from "./storage/index.js";
36
+ import { type DataRateLimitConfig } from "./auth/rate-limiter.js";
37
+ import { EmailConfig } from "./email/index.js";
38
+ import type { OAuthProvider } from "./auth/interfaces.js";
39
+ import type { AuthHooks } from "./auth/auth-hooks.js";
15
40
  export interface RebaseAuthConfig {
16
41
  /**
17
42
  * The collection that represents auth users.
@@ -87,6 +112,22 @@ export interface RebaseAuthConfig {
87
112
  * by any signed-in user. Available on the client as `auth.findUserByEmail`.
88
113
  */
89
114
  allowUserLookup?: boolean;
115
+ /**
116
+ * Bot protection on the auth routes that cost something to hit.
117
+ *
118
+ * Off unless `enabled`. Rate limiting bounds one caller; a botnet of a
119
+ * thousand addresses sending one request each never touches a per-IP window,
120
+ * and `/register` and `/forgot-password` both send mail — so the bill for an
121
+ * unprotected form is paid in reputation on a sending domain.
122
+ *
123
+ * ```ts
124
+ * auth: { captcha: { enabled: true, provider: "turnstile", secret: process.env.TURNSTILE_SECRET } }
125
+ * ```
126
+ *
127
+ * Verification fails closed: if the provider cannot be reached, the request
128
+ * is refused. See `auth/captcha.ts` for why that is the safe direction.
129
+ */
130
+ captcha?: CaptchaConfig;
90
131
  /**
91
132
  * A static secret key for server-to-server / script authentication.
92
133
  *
@@ -218,6 +259,18 @@ export interface RebaseAuthConfig {
218
259
  * Requires email to be configured.
219
260
  */
220
261
  magicLink?: boolean;
262
+ /**
263
+ * Enable email one-time codes — six digits, typed in, instead of a link.
264
+ *
265
+ * A magic link opens the session on whichever device holds the mailbox,
266
+ * which is the wrong device whenever those are two different machines: a
267
+ * television, a terminal, a second browser. A code crosses that gap because
268
+ * a person carries it.
269
+ *
270
+ * `POST /auth/otp` sends one; `POST /auth/otp/verify` trades it for a
271
+ * session. Requires email to be configured, as magic link does.
272
+ */
273
+ emailOtp?: boolean;
221
274
  /**
222
275
  * Opt-in httpOnly cookie mode for refresh tokens.
223
276
  *
@@ -231,7 +284,7 @@ export interface RebaseAuthConfig {
231
284
  * **Requires** `credentials: "include"` on client-side fetch calls to
232
285
  * auth endpoints, and CORS must allow credentials (no `origin: "*"`).
233
286
  */
234
- cookieAuth?: import("./auth").CookieAuthConfig;
287
+ cookieAuth?: import("./auth/index.js").CookieAuthConfig;
235
288
  }
236
289
  /** @see RebaseBackendConfig.baas */
237
290
  export interface BaasOptions {
@@ -278,6 +331,15 @@ export interface RebaseBackendConfig {
278
331
  * `collectionsDir` to write to.
279
332
  */
280
333
  schemaEditor?: boolean;
334
+ /**
335
+ * Live schema editing — changing the database and committing the change.
336
+ *
337
+ * Distinct from `schemaEditor`, which only rewrites collection source.
338
+ * There is nothing to switch on here: the surface mounts whenever there is
339
+ * a `collectionsDir`, and refuses in its own words when it cannot act. What
340
+ * this configures is *who* may act.
341
+ */
342
+ liveSchema?: LiveSchemaConfig;
281
343
  /** Options that only apply when collections are derived from the database. */
282
344
  baas?: BaasOptions;
283
345
  /**
@@ -303,7 +365,6 @@ export interface RebaseBackendConfig {
303
365
  * still owns their schema/registry but does **not** generate server data
304
366
  * routes for them. Server-mediated sources (the default) need no entry.
305
367
  */
306
- dataSources?: DataSourceDefinition[];
307
368
  /**
308
369
  * Database bootstrappers.
309
370
  */
@@ -350,7 +411,6 @@ export interface RebaseBackendConfig {
350
411
  * only need explicit entries for "direct" transport sources (e.g.
351
412
  * external storage) that the backend does not proxy.
352
413
  */
353
- storageSources?: import("@rebasepro/types").StorageSourceDefinition[];
354
414
  /**
355
415
  * Per-object access control for storage — the analogue of a collection's
356
416
  * security rules, and the thing `requireAuth` / `publicRead` cannot
@@ -375,7 +435,31 @@ export interface RebaseBackendConfig {
375
435
  * {@link storagePublicRead}, or {@link storageInsecureAllowAnyAuthenticated}
376
436
  * is set — see `assertStorageAccessControlConfigured`.
377
437
  */
378
- storageAuthorize?: import("./storage/types").StorageAuthorize;
438
+ storageAuthorize?: import("./storage/types.js").StorageAuthorize;
439
+ /**
440
+ * Per-object access control, declared rather than coded.
441
+ *
442
+ * Storage is not under row-level security, so without this or
443
+ * {@link storageAuthorize} any authenticated caller may read, overwrite,
444
+ * delete or list any key they can name — the keys share one flat namespace.
445
+ *
446
+ * ```ts
447
+ * storagePolicies: [
448
+ * { path: "public/**", operations: ["read"], allow: "public" },
449
+ * { path: "users/:uid/**", allow: ({ params, user }) => user?.uid === params.uid }
450
+ * ]
451
+ * ```
452
+ *
453
+ * **A key matched by no policy is refused.** Every widening is an explicit
454
+ * line, and a mistake here denies rather than grants.
455
+ *
456
+ * `storageAuthorize` still runs when no policy matched, so ownership that
457
+ * lives in a row — which no path pattern can express — stays expressible.
458
+ * Neither can narrow the other: each only says yes.
459
+ *
460
+ * Satisfies the production boot guard on its own.
461
+ */
462
+ storagePolicies?: import("./storage/policies.js").StoragePolicy[];
379
463
  /**
380
464
  * Allow unauthenticated read access to stored files (default: false).
381
465
  *
@@ -385,6 +469,59 @@ export interface RebaseBackendConfig {
385
469
  * production storage boot guard (see {@link storageAuthorize}).
386
470
  */
387
471
  storagePublicRead?: boolean;
472
+ /**
473
+ * Keep derived image renditions — the results of `?width=`, `?format=` and
474
+ * friends — in the storage source rather than only in this process's
475
+ * memory.
476
+ *
477
+ * Without it a transform is recomputed by every instance, and again by all
478
+ * of them after every deploy: the cache is per-process and does not survive
479
+ * a restart. With it, the first instance to compute a variant writes it
480
+ * under a reserved prefix in the same bucket as the source, and every
481
+ * instance reads it from there.
482
+ *
483
+ * ```ts
484
+ * storageRenditionCache: { enabled: true }
485
+ * ```
486
+ *
487
+ * Off by default because turning it on makes a `GET` write to your bucket:
488
+ * it costs per object, and on read-only credentials it cannot work. When a
489
+ * write does fail the request still succeeds — the transform is served from
490
+ * memory and the failure is logged once.
491
+ *
492
+ * Renditions are keyed by the source object's version, so replacing an
493
+ * image serves the new one immediately; the superseded rendition is left
494
+ * behind. Set a lifecycle rule on `_rebase/renditions/` to collect them.
495
+ */
496
+ storageRenditionCache?: import("./storage/rendition-cache.js").RenditionCacheConfig;
497
+ /**
498
+ * Run something when an object lands, or when one goes.
499
+ *
500
+ * Every other write in the product can be reacted to — a row has
501
+ * `beforeSave` and `afterSave`, a schedule has a cron job — and an upload
502
+ * had nothing, so the work an upload implies had to be done by the client
503
+ * after the upload returned, which means it is not done at all when the
504
+ * client goes away between the two calls.
505
+ *
506
+ * ```ts
507
+ * storageTriggers: [
508
+ * {
509
+ * path: "uploads/:uid/**",
510
+ * events: ["finalize"],
511
+ * handler: async ({ key, params }) => { … }
512
+ * }
513
+ * ]
514
+ * ```
515
+ *
516
+ * Same pattern language as {@link storagePolicies}. Fires for the
517
+ * multipart and resumable paths alike, after the object is durably
518
+ * written, and never for internal writes such as the image-rendition cache.
519
+ * Handlers are awaited and a throwing one is logged rather than failing the
520
+ * request — the object is already stored, so telling the client otherwise
521
+ * would invite it to repeat a write that succeeded. Enqueue a job for
522
+ * anything that must happen or is slow.
523
+ */
524
+ storageTriggers?: import("./storage/triggers.js").StorageTrigger[];
388
525
  /**
389
526
  * Opt out of the storage access-control boot guard, keeping the legacy
390
527
  * behaviour where **any** authenticated user can read, overwrite, delete or
@@ -462,7 +599,7 @@ export interface RebaseBackendConfig {
462
599
  *
463
600
  * A name that is not in the bundle fails the boot — see `selectFunctions`.
464
601
  */
465
- functionsSelection?: import("./functions/selection").FunctionSelection;
602
+ functionsSelection?: import("./functions/selection.js").FunctionSelection;
466
603
  /**
467
604
  * Forward `/api/functions/*` to another process instead of serving it here.
468
605
  *
@@ -538,7 +675,7 @@ export interface RebaseBackendConfig {
538
675
  * Global lifecycle callbacks applied to every collection.
539
676
  *
540
677
  * Same type as per-collection `callbacks` — fires on **every** data path
541
- * (REST API, WebSocket / realtime, server-side `rebase.data`).
678
+ * (REST API, WebSocket / realtime, server-side `rebase.dataAsAdmin`).
542
679
  *
543
680
  * Execution order: global callbacks → collection callbacks → property callbacks.
544
681
  *
@@ -572,8 +709,20 @@ export interface RebaseBackendConfig {
572
709
  schemaVersion?: string;
573
710
  /** Runtime version reported by the contract endpoint. Informational. */
574
711
  runtimeVersion?: string;
712
+ /**
713
+ * Periodic row-level-security audit of the database this server uses.
714
+ *
715
+ * Off unless `enabled` is set. `@rebasepro/rls-check` is thorough and
716
+ * read-only, and the reason nobody runs it is that it is a command — so this
717
+ * runs it on a timer and serves the result at `GET /api/admin/rls-audit`.
718
+ *
719
+ * Needs the optional peer `@rebasepro/rls-check`, which is not a hard
720
+ * dependency because it carries a Postgres driver and this package is
721
+ * engine-agnostic.
722
+ */
723
+ rlsAudit?: RlsAuditConfig;
575
724
  }
576
- export { isAuthAdapter } from "./auth/require-auth";
725
+ export { isAuthAdapter } from "./auth/require-auth.js";
577
726
  /**
578
727
  * Type guard to detect whether `database` is a `DatabaseAdapter`.
579
728
  */
@@ -585,12 +734,20 @@ export interface RebaseBackendInstance {
585
734
  realtimeService: RealtimeProvider;
586
735
  auth?: BootstrappedAuth;
587
736
  history?: {
588
- historyService: import("./history/history-routes").HistoryService;
737
+ historyService: import("./history/history-routes.js").HistoryService;
589
738
  };
739
+ /**
740
+ * Stored metrics for this deployment, when it can keep any.
741
+ *
742
+ * Absent on a driver with no SQL admin. The `/metrics/history` route turns
743
+ * that absence into a named 501 rather than an empty series, because an
744
+ * empty chart and "this deployment keeps no history" look identical.
745
+ */
746
+ metricsHistory?: import("./metrics/history-recorder.js").MetricsHistory;
590
747
  storageRegistry?: StorageRegistry;
591
748
  storageController?: StorageController;
592
749
  collectionRegistry: BackendCollectionRegistry;
593
- cronScheduler?: import("./cron").CronScheduler;
750
+ cronScheduler?: import("./cron/index.js").CronScheduler;
594
751
  /**
595
752
  * The durable job queue, when `jobs.enabled` is set and the driver can run
596
753
  * SQL. Present on the instance because the *producers* live in application
@@ -603,7 +760,7 @@ export interface RebaseBackendInstance {
603
760
  * jobQueue?.register(WEBHOOK_DELIVERY_TASK, ctx => dispatcher.deliverQueuedJob(ctx.payload));
604
761
  * ```
605
762
  */
606
- jobQueue?: import("./jobs").JobQueue;
763
+ jobQueue?: import("./jobs/index.js").JobQueue;
607
764
  /**
608
765
  * Attach collection callbacks AFTER initialization.
609
766
  *
@@ -0,0 +1,97 @@
1
+ import { createRequire as __rebaseCreateRequire } from "module";
2
+ import __rebaseProcess from "process";
3
+ globalThis.process ??= __rebaseProcess;
4
+ __rebaseCreateRequire(import.meta.url);
5
+ //#region ../common/src/util/internal-tables.ts
6
+ /**
7
+ * The tables Rebase creates for its own bookkeeping, and the SQL that keeps the
8
+ * end-user role away from them.
9
+ *
10
+ * ## Why this exists
11
+ *
12
+ * Authenticated requests run as {@link REBASE_USER_ROLE}, and the boot-time role
13
+ * provisioning grants that role `SELECT, INSERT, UPDATE, DELETE` on every table
14
+ * in the schemas a project uses — including `rebase`, because a project's own
15
+ * collections are allowed to live there (the scaffold puts `users` there). It
16
+ * also sets `ALTER DEFAULT PRIVILEGES`, so a table created *later* by the
17
+ * migrating role inherits the same grant.
18
+ *
19
+ * Every framework-internal table is created later: auth's tables come up during
20
+ * `initializeAuth`, `api_keys` during route mounting, `cron_logs` when the first
21
+ * job registers, `idempotency_keys` on the first request that carries a key. So
22
+ * they all inherited full DML for the end-user role — and none of them enables
23
+ * row-level security, because none of them is a collection with
24
+ * `securityRules`. Measured on a freshly provisioned database, `SET ROLE
25
+ * rebase_user` could read `rebase.refresh_tokens` (session token hashes),
26
+ * `rebase.mfa_factors` (`secret_encrypted`), `rebase.recovery_codes`, and
27
+ * `rebase.api_keys` (including its `admin` flag), and insert into
28
+ * `rebase.app_config`.
29
+ *
30
+ * Nothing routes a user-context query at those tables today, so this was not
31
+ * reachable over the API. That is the wrong thing to depend on: the documented
32
+ * model is that RLS is the authorization boundary, and these tables sat outside
33
+ * it. The boundary is now a privilege boundary instead — the role simply cannot
34
+ * address them.
35
+ *
36
+ * ## Why REVOKE rather than ENABLE ROW LEVEL SECURITY
37
+ *
38
+ * RLS with no policy denies every row, which is the same outcome, but it is the
39
+ * *weaker* statement: it leaves the grant in place, so a later policy — or a
40
+ * `FORCE` flag cleared by some future migration — reopens the table. There is no
41
+ * row of `refresh_tokens` any end user should ever reach, so the honest encoding
42
+ * is "this role has no privilege here at all". It also keeps the owner
43
+ * connection (which auth actually runs on) completely unaffected.
44
+ *
45
+ * ## Keeping it true
46
+ *
47
+ * `packages/rls-check` scans the `rebase` schema — it used to skip it as a
48
+ * "platform" schema — and its `rls-disabled` check fires on exactly the
49
+ * condition this module removes: RLS off *and* a DML grant to a reachable role.
50
+ * So a table added here without a revoke is caught by `pnpm rls:check`, not by
51
+ * someone re-reading this file.
52
+ */
53
+ /**
54
+ * The Postgres role authenticated requests run as.
55
+ *
56
+ * Defined here rather than in the Postgres driver because both the driver (which
57
+ * provisions the role) and this module (which revokes on its behalf) need it,
58
+ * and a second spelling of a role name is a silent no-op waiting to happen.
59
+ */
60
+ var REBASE_USER_ROLE = "rebase_user";
61
+ /** Postgres identifiers this module is willing to interpolate. */
62
+ var SAFE_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_$]*$/;
63
+ /**
64
+ * A single statement that takes every privilege on `schema.table` away from the
65
+ * end-user role.
66
+ *
67
+ * Wrapped in a `DO` block guarded on `pg_roles` for two reasons, both of which
68
+ * happen in practice:
69
+ *
70
+ * - the role does not exist when the connection is unprivileged (Rebase then
71
+ * relies on native RLS rather than a role switch), and a bare `REVOKE` on a
72
+ * missing role is an error, not a no-op;
73
+ * - the table may not exist yet — `cron_logs` never appears in a project with
74
+ * no cron jobs — and `to_regclass` returning NULL has to be tolerated too.
75
+ *
76
+ * One command, so it is safe on handles that speak the extended query protocol
77
+ * and reject multi-statement strings.
78
+ */
79
+ function revokeInternalTableSql(schema, table) {
80
+ if (!SAFE_IDENTIFIER.test(schema)) throw new Error(`Refusing to build SQL with an unsafe schema name: ${JSON.stringify(schema)}`);
81
+ if (!SAFE_IDENTIFIER.test(table)) throw new Error(`Refusing to build SQL with an unsafe table name: ${JSON.stringify(table)}`);
82
+ const qualified = `"${schema}"."${table}"`;
83
+ return `
84
+ DO $rebase_revoke$
85
+ BEGIN
86
+ IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${REBASE_USER_ROLE}')
87
+ AND to_regclass('${qualified}') IS NOT NULL THEN
88
+ EXECUTE 'REVOKE ALL ON ${qualified} FROM ${REBASE_USER_ROLE}';
89
+ END IF;
90
+ END
91
+ $rebase_revoke$;
92
+ `.trim();
93
+ }
94
+ //#endregion
95
+ export { revokeInternalTableSql as t };
96
+
97
+ //# sourceMappingURL=internal-tables-DpxfPaEB.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"internal-tables-DpxfPaEB.js","names":[],"sources":["../../common/src/util/internal-tables.ts"],"sourcesContent":["/**\n * The tables Rebase creates for its own bookkeeping, and the SQL that keeps the\n * end-user role away from them.\n *\n * ## Why this exists\n *\n * Authenticated requests run as {@link REBASE_USER_ROLE}, and the boot-time role\n * provisioning grants that role `SELECT, INSERT, UPDATE, DELETE` on every table\n * in the schemas a project uses — including `rebase`, because a project's own\n * collections are allowed to live there (the scaffold puts `users` there). It\n * also sets `ALTER DEFAULT PRIVILEGES`, so a table created *later* by the\n * migrating role inherits the same grant.\n *\n * Every framework-internal table is created later: auth's tables come up during\n * `initializeAuth`, `api_keys` during route mounting, `cron_logs` when the first\n * job registers, `idempotency_keys` on the first request that carries a key. So\n * they all inherited full DML for the end-user role — and none of them enables\n * row-level security, because none of them is a collection with\n * `securityRules`. Measured on a freshly provisioned database, `SET ROLE\n * rebase_user` could read `rebase.refresh_tokens` (session token hashes),\n * `rebase.mfa_factors` (`secret_encrypted`), `rebase.recovery_codes`, and\n * `rebase.api_keys` (including its `admin` flag), and insert into\n * `rebase.app_config`.\n *\n * Nothing routes a user-context query at those tables today, so this was not\n * reachable over the API. That is the wrong thing to depend on: the documented\n * model is that RLS is the authorization boundary, and these tables sat outside\n * it. The boundary is now a privilege boundary instead — the role simply cannot\n * address them.\n *\n * ## Why REVOKE rather than ENABLE ROW LEVEL SECURITY\n *\n * RLS with no policy denies every row, which is the same outcome, but it is the\n * *weaker* statement: it leaves the grant in place, so a later policy — or a\n * `FORCE` flag cleared by some future migration — reopens the table. There is no\n * row of `refresh_tokens` any end user should ever reach, so the honest encoding\n * is \"this role has no privilege here at all\". It also keeps the owner\n * connection (which auth actually runs on) completely unaffected.\n *\n * ## Keeping it true\n *\n * `packages/rls-check` scans the `rebase` schema — it used to skip it as a\n * \"platform\" schema — and its `rls-disabled` check fires on exactly the\n * condition this module removes: RLS off *and* a DML grant to a reachable role.\n * So a table added here without a revoke is caught by `pnpm rls:check`, not by\n * someone re-reading this file.\n */\n\n/**\n * The Postgres role authenticated requests run as.\n *\n * Defined here rather than in the Postgres driver because both the driver (which\n * provisions the role) and this module (which revokes on its behalf) need it,\n * and a second spelling of a role name is a silent no-op waiting to happen.\n */\nexport const REBASE_USER_ROLE = \"rebase_user\";\n\n/**\n * Framework-internal table names, unqualified.\n *\n * Deliberately NOT including `users`: the auth user table is also a collection,\n * with `securityRules`, RLS enabled and policies applied. Users read their own\n * row through it — revoking there would break sign-in.\n *\n * `atlas_schema_revisions` is Atlas's migration ledger, which lands in `rebase`\n * because `db migrate apply` passes `--revisions-schema rebase`.\n *\n * Every entry here must also be revoked by whatever creates it, and vice versa:\n * the creation-time revoke fires once, on the boot that first makes the table,\n * so it cannot help a database provisioned before that revoke existed. This\n * list is what the boot-time sweep in `ensureAppRole` iterates, and the sweep\n * is the only thing that can repair an already-granted table. A table revoked\n * at creation but missing here is therefore permanently stranded on any\n * database that predates its revoke — which is exactly what happened to\n * `jobs`, added here after a scan of a pre-0.14 database found it.\n */\nexport const REBASE_INTERNAL_TABLES: readonly string[] = [\n // auth\n \"user_identities\",\n \"refresh_tokens\",\n \"password_reset_tokens\",\n \"magic_link_tokens\",\n \"mfa_factors\",\n \"mfa_challenges\",\n \"recovery_codes\",\n \"app_config\",\n \"schema_meta\",\n // platform services\n \"api_keys\",\n \"cron_logs\",\n \"cron_claims\",\n \"jobs\",\n \"rate_limit_hits\",\n \"idempotency_keys\",\n \"entity_history\",\n \"branches\",\n \"metric_samples\",\n // realtime channels — authorization for these lives in the channel rules the\n // server evaluates before it reads or writes, never in a row policy\n \"channel_messages\",\n \"channel_cursors\",\n \"channel_presence\",\n // migration bookkeeping\n \"atlas_schema_revisions\"\n];\n\n/** Postgres identifiers this module is willing to interpolate. */\nconst SAFE_IDENTIFIER = /^[A-Za-z_][A-Za-z0-9_$]*$/;\n\n/**\n * A single statement that takes every privilege on `schema.table` away from the\n * end-user role.\n *\n * Wrapped in a `DO` block guarded on `pg_roles` for two reasons, both of which\n * happen in practice:\n *\n * - the role does not exist when the connection is unprivileged (Rebase then\n * relies on native RLS rather than a role switch), and a bare `REVOKE` on a\n * missing role is an error, not a no-op;\n * - the table may not exist yet — `cron_logs` never appears in a project with\n * no cron jobs — and `to_regclass` returning NULL has to be tolerated too.\n *\n * One command, so it is safe on handles that speak the extended query protocol\n * and reject multi-statement strings.\n */\nexport function revokeInternalTableSql(schema: string, table: string): string {\n if (!SAFE_IDENTIFIER.test(schema)) {\n throw new Error(`Refusing to build SQL with an unsafe schema name: ${JSON.stringify(schema)}`);\n }\n if (!SAFE_IDENTIFIER.test(table)) {\n throw new Error(`Refusing to build SQL with an unsafe table name: ${JSON.stringify(table)}`);\n }\n const qualified = `\"${schema}\".\"${table}\"`;\n return `\n DO $rebase_revoke$\n BEGIN\n IF EXISTS (SELECT 1 FROM pg_roles WHERE rolname = '${REBASE_USER_ROLE}')\n AND to_regclass('${qualified}') IS NOT NULL THEN\n EXECUTE 'REVOKE ALL ON ${qualified} FROM ${REBASE_USER_ROLE}';\n END IF;\n END\n $rebase_revoke$;\n `.trim();\n}\n\n/**\n * Revoke on every internal table in `schema`, one statement at a time.\n *\n * Best-effort per table: a connection that does not own one of them (a\n * pre-provisioned database, a platform-managed ledger) cannot revoke on it, and\n * that must not take down a boot. The caller decides how loud to be — `onError`\n * exists so the driver can warn without this module importing a logger.\n */\nexport async function revokeInternalTableAccess(\n execute: (sql: string) => Promise<unknown>,\n schema: string,\n options?: { tables?: readonly string[]; onError?: (table: string, error: unknown) => void }\n): Promise<void> {\n for (const table of options?.tables ?? REBASE_INTERNAL_TABLES) {\n try {\n await execute(revokeInternalTableSql(schema, table));\n } catch (error) {\n options?.onError?.(table, error);\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAa,mBAAmB;;AAoDhC,IAAM,kBAAkB;;;;;;;;;;;;;;;;;AAkBxB,SAAgB,uBAAuB,QAAgB,OAAuB;CAC1E,IAAI,CAAC,gBAAgB,KAAK,MAAM,GAC5B,MAAM,IAAI,MAAM,qDAAqD,KAAK,UAAU,MAAM,GAAG;CAEjG,IAAI,CAAC,gBAAgB,KAAK,KAAK,GAC3B,MAAM,IAAI,MAAM,oDAAoD,KAAK,UAAU,KAAK,GAAG;CAE/F,MAAM,YAAY,IAAI,OAAO,KAAK,MAAM;CACxC,OAAO;;;iEAGsD,iBAAiB;kCAChD,UAAU;yCACH,UAAU,QAAQ,iBAAiB;;;;MAItE,KAAK;AACX"}
@@ -1,5 +1,5 @@
1
- export { createJobStore } from "./job-store";
2
- export type { JobStore } from "./job-store";
3
- export { createJobQueue, defaultBackoff } from "./job-queue";
4
- export type { JobQueue } from "./job-queue";
5
- export type { EnqueueOptions, JobContext, JobHandler, JobQueueClient, JobQueueOptions, JobRecord, JobStatus } from "./types";
1
+ export { createJobStore } from "./job-store.js";
2
+ export type { JobStore } from "./job-store.js";
3
+ export { createJobQueue, defaultBackoff } from "./job-queue.js";
4
+ export type { JobQueue } from "./job-queue.js";
5
+ export type { EnqueueOptions, JobContext, JobHandler, JobQueueClient, JobQueueOptions, JobRecord, JobStatus } from "./types.js";
@@ -1,11 +1,13 @@
1
- import { createRequire as __createRequire } from "module";
2
- import process from "process";
3
- __createRequire(import.meta.url);
4
- import { n as __exportAll } from "./rolldown-runtime-DSJWtz9O.js";
5
- import "./src-BPfYOeN4.js";
6
- import "./src-CrCxd8km.js";
7
- import { n as createDdlBootstrapper, o as revokeInternalTableSql, r as hasInCauseChain, s as isSQLAdmin } from "./ddl-bootstrap-Cywoj8Ta.js";
8
- import { t as logger } from "./logger-DfvF_8r-.js";
1
+ import { createRequire as __rebaseCreateRequire } from "module";
2
+ import __rebaseProcess from "process";
3
+ globalThis.process ??= __rebaseProcess;
4
+ __rebaseCreateRequire(import.meta.url);
5
+ import { n as __exportAll } from "./rolldown-runtime-dW7B1o5h.js";
6
+ import "./src-B-CmIFMr.js";
7
+ import "./src-Cdsw7DqV.js";
8
+ import { n as createDdlBootstrapper, o as isSQLAdmin, r as hasInCauseChain } from "./ddl-bootstrap-5YZCZ8qk.js";
9
+ import { t as revokeInternalTableSql } from "./internal-tables-DpxfPaEB.js";
10
+ import { t as logger } from "./logger-DS03e908.js";
9
11
  import { randomUUID } from "crypto";
10
12
  //#region src/jobs/job-store.ts
11
13
  /**
@@ -323,4 +325,4 @@ var jobs_exports = /* @__PURE__ */ __exportAll({
323
325
  //#endregion
324
326
  export { createJobStore as i, createJobQueue as n, defaultBackoff as r, jobs_exports as t };
325
327
 
326
- //# sourceMappingURL=jobs-CyOKXXlu.js.map
328
+ //# sourceMappingURL=jobs-B2ELModo.js.map