@rebasepro/server 0.24.0 → 0.24.1-canary.g56af4a4

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 (181) hide show
  1. package/dist/GCSStorageController-DivE9bAx.js +402 -0
  2. package/dist/GCSStorageController-DivE9bAx.js.map +1 -0
  3. package/dist/S3StorageController-D_vKs4kP.js +480 -0
  4. package/dist/S3StorageController-D_vKs4kP.js.map +1 -0
  5. package/dist/api/rest/api-generator.d.ts +53 -1
  6. package/dist/api/rest/auth-collection-writes.d.ts +28 -21
  7. package/dist/api/rest/field-access-query.d.ts +28 -8
  8. package/dist/api/rest/field-ops.d.ts +19 -7
  9. package/dist/api/rest/query-body.d.ts +10 -0
  10. package/dist/api/rest/write-validation.d.ts +7 -5
  11. package/dist/api/schema-editor-routes.d.ts +10 -1
  12. package/dist/api/sql-export-routes.d.ts +8 -0
  13. package/dist/api/types.d.ts +11 -0
  14. package/dist/{ast-schema-editor-CWqS_sLJ.js → ast-schema-editor-CSdL0iCk.js} +2 -2
  15. package/dist/{ast-schema-editor-CWqS_sLJ.js.map → ast-schema-editor-CSdL0iCk.js.map} +1 -1
  16. package/dist/auth/access.d.ts +16 -0
  17. package/dist/auth/admin-user-ops.d.ts +24 -2
  18. package/dist/auth/admin-users-route.d.ts +1 -0
  19. package/dist/auth/expired-token-sweep.d.ts +5 -1
  20. package/dist/auth/interfaces.d.ts +10 -0
  21. package/dist/auth/jwt-crypto.d.ts +7 -0
  22. package/dist/auth/jwt-keys.d.ts +4 -0
  23. package/dist/auth/jwt.d.ts +6 -1
  24. package/dist/auth/rate-limiter.d.ts +13 -1
  25. package/dist/auth/registration-policy.d.ts +17 -0
  26. package/dist/auth/user-picking.d.ts +35 -0
  27. package/dist/{auth-DMLngxn_.js → auth-OPq_FeMs.js} +972 -85
  28. package/dist/auth-OPq_FeMs.js.map +1 -0
  29. package/dist/auth_adapter-CIItCTc8.js +21 -0
  30. package/dist/auth_adapter-CIItCTc8.js.map +1 -0
  31. package/dist/backend-DTAOsLQc.js.map +1 -1
  32. package/dist/backup/backup-common.d.ts +14 -3
  33. package/dist/backup/backup-routes.d.ts +23 -2
  34. package/dist/backup/backup-storage.d.ts +3 -1
  35. package/dist/backup/index.d.ts +3 -1
  36. package/dist/{backup-CN0s50D2.js → backup-5d7XhLX3.js} +170 -33
  37. package/dist/backup-5d7XhLX3.js.map +1 -0
  38. package/dist/boot/driver.d.ts +3 -0
  39. package/dist/boot/env.d.ts +7 -0
  40. package/dist/boot/http-server.d.ts +22 -0
  41. package/dist/boot/options.d.ts +16 -1
  42. package/dist/boot/runtime-cors.d.ts +17 -0
  43. package/dist/boot/static-routing.d.ts +9 -0
  44. package/dist/{contract-routes-fz8i4pxs.js → contract-routes-02lASyJI.js} +3 -19
  45. package/dist/contract-routes-02lASyJI.js.map +1 -0
  46. package/dist/cron/cron-routes.d.ts +1 -1
  47. package/dist/cron/cron-scheduler.d.ts +69 -3
  48. package/dist/cron/cron-store.d.ts +27 -4
  49. package/dist/cron/define-cron.d.ts +6 -2
  50. package/dist/cron/index.d.ts +1 -1
  51. package/dist/{cron-loader-CwaANlOG.js → cron-loader-D7OmleAb.js} +8 -4
  52. package/dist/cron-loader-D7OmleAb.js.map +1 -0
  53. package/dist/{cron-routes-Bc-SB0Se.js → cron-routes-CBfiaqEL.js} +27 -4
  54. package/dist/cron-routes-CBfiaqEL.js.map +1 -0
  55. package/dist/{cron-scheduler-CYQgco86.js → cron-scheduler-C2vbETMo.js} +298 -32
  56. package/dist/cron-scheduler-C2vbETMo.js.map +1 -0
  57. package/dist/cron-store-B2Ih0gCN.js +540 -0
  58. package/dist/cron-store-B2Ih0gCN.js.map +1 -0
  59. package/dist/email/smtp-email-service.d.ts +23 -0
  60. package/dist/email/types.d.ts +18 -0
  61. package/dist/env.d.ts +0 -37
  62. package/dist/filter-dialect-REl-TjZr.js +1628 -0
  63. package/dist/filter-dialect-REl-TjZr.js.map +1 -0
  64. package/dist/{function-loader-D7o5Epjj.js → function-loader-BDKKiBmy.js} +4 -3
  65. package/dist/function-loader-BDKKiBmy.js.map +1 -0
  66. package/dist/{function-routes-CaNG4waN.js → function-routes-DWB7BBsi.js} +2 -2
  67. package/dist/function-routes-DWB7BBsi.js.map +1 -0
  68. package/dist/functions/context.d.ts +9 -0
  69. package/dist/functions/define-function.d.ts +7 -4
  70. package/dist/functions/index.d.ts +1 -1
  71. package/dist/functions/index.js +25 -2
  72. package/dist/functions/index.js.map +1 -1
  73. package/dist/functions/request-timeout.d.ts +7 -5
  74. package/dist/history/history-routes.d.ts +9 -0
  75. package/dist/history/retention-sweep.d.ts +81 -0
  76. package/dist/{history-recorder-Nr8zLvoU.js → history-recorder-DHenr3lm.js} +2 -2
  77. package/dist/{history-recorder-Nr8zLvoU.js.map → history-recorder-DHenr3lm.js.map} +1 -1
  78. package/dist/{history-store-rcAm_xFR.js → history-store-DPofGVDp.js} +2 -2
  79. package/dist/{history-store-rcAm_xFR.js.map → history-store-DPofGVDp.js.map} +1 -1
  80. package/dist/index.d.ts +6 -5
  81. package/dist/index.es.js +22671 -19191
  82. package/dist/index.es.js.map +1 -1
  83. package/dist/init/shutdown.d.ts +12 -2
  84. package/dist/init.d.ts +16 -6
  85. package/dist/internal-tables-L2t39RdT.js +136 -0
  86. package/dist/internal-tables-L2t39RdT.js.map +1 -0
  87. package/dist/jobs/job-queue.d.ts +8 -0
  88. package/dist/jobs/job-store.d.ts +24 -0
  89. package/dist/jobs/types.d.ts +25 -4
  90. package/dist/{jobs-DqYNfquG.js → jobs-BpD4Q0qR.js} +232 -22
  91. package/dist/jobs-BpD4Q0qR.js.map +1 -0
  92. package/dist/{jwt-R6bSPMjk.js → jwt-Bqcu7cGt.js} +171 -65
  93. package/dist/jwt-Bqcu7cGt.js.map +1 -0
  94. package/dist/load-failure-UvzZgGXT.js +48 -0
  95. package/dist/load-failure-UvzZgGXT.js.map +1 -0
  96. package/dist/mcp/mcp-tools.d.ts +8 -0
  97. package/dist/metrics/index.d.ts +18 -0
  98. package/dist/metrics/pool-wait.d.ts +50 -0
  99. package/dist/offline-8Ks3yp9n-CadBKm2D.js +3305 -0
  100. package/dist/offline-8Ks3yp9n-CadBKm2D.js.map +1 -0
  101. package/dist/offline-store-D9ytNNaa-BCr2vsFB.js +1903 -0
  102. package/dist/offline-store-D9ytNNaa-BCr2vsFB.js.map +1 -0
  103. package/dist/{openapi-generator-DAq_XVDu.js → openapi-generator-BqoUh4Ij.js} +365 -81
  104. package/dist/openapi-generator-BqoUh4Ij.js.map +1 -0
  105. package/dist/policy-PdzX-Opd.js +121 -0
  106. package/dist/policy-PdzX-Opd.js.map +1 -0
  107. package/dist/project_manifest-R6y_KHms.js +59 -0
  108. package/dist/project_manifest-R6y_KHms.js.map +1 -0
  109. package/dist/{query-parser-BgiKJKvc.js → query-parser-DK9eMkb9.js} +510 -15
  110. package/dist/query-parser-DK9eMkb9.js.map +1 -0
  111. package/dist/{request-timeout-DgH7j8qO.js → request-timeout-Dnl2_OBc.js} +15 -8
  112. package/dist/request-timeout-Dnl2_OBc.js.map +1 -0
  113. package/dist/resumable-upload-threshold-CKv-Ry0l.js +24 -0
  114. package/dist/resumable-upload-threshold-CKv-Ry0l.js.map +1 -0
  115. package/dist/schema-edit/apply-schema-change.d.ts +10 -0
  116. package/dist/schema-edit/local-source.d.ts +29 -0
  117. package/dist/schema-edit/remote-source.d.ts +13 -3
  118. package/dist/schema-edit/source-editor.d.ts +28 -0
  119. package/dist/{schema-editor-routes-oIyuWl3L.js → schema-editor-routes-BFf3i8jm.js} +53 -9
  120. package/dist/schema-editor-routes-BFf3i8jm.js.map +1 -0
  121. package/dist/services/outbound-post.d.ts +50 -0
  122. package/dist/services/outbound-url-guard.d.ts +34 -5
  123. package/dist/services/routed-realtime-service.d.ts +5 -0
  124. package/dist/services/webhook-service.d.ts +66 -14
  125. package/dist/soft-delete-params-47yBGs3_.js +668 -0
  126. package/dist/soft-delete-params-47yBGs3_.js.map +1 -0
  127. package/dist/sql-export-routes-BNNuGGLP.js +240 -0
  128. package/dist/sql-export-routes-BNNuGGLP.js.map +1 -0
  129. package/dist/src-CatHFUym.js.map +1 -1
  130. package/dist/storage/GCSStorageController.d.ts +46 -2
  131. package/dist/storage/LocalStorageController.d.ts +67 -2
  132. package/dist/storage/S3StorageController.d.ts +37 -3
  133. package/dist/storage/image-transform.d.ts +5 -0
  134. package/dist/storage/maintenance-routes.d.ts +23 -0
  135. package/dist/storage/maintenance.d.ts +126 -0
  136. package/dist/storage/rendition-cache.d.ts +9 -11
  137. package/dist/storage/request-principals.d.ts +30 -0
  138. package/dist/storage/routes.d.ts +20 -0
  139. package/dist/storage/source-variables.d.ts +10 -0
  140. package/dist/storage/streams.d.ts +42 -0
  141. package/dist/storage/tus-handler.d.ts +46 -2
  142. package/dist/storage/types.d.ts +82 -7
  143. package/dist/storage/upload-validation.d.ts +13 -0
  144. package/dist/storage-resumable-VO-cMpse-C_YX71pO.js +125 -0
  145. package/dist/storage-resumable-VO-cMpse-C_YX71pO.js.map +1 -0
  146. package/dist/strings.es-BeZWAodn.js +256 -0
  147. package/dist/strings.es-BeZWAodn.js.map +1 -0
  148. package/dist/upload-validation-Dd-fnsbA.js +172 -0
  149. package/dist/upload-validation-Dd-fnsbA.js.map +1 -0
  150. package/dist/utils/byte-size.d.ts +10 -0
  151. package/dist/utils/compression.d.ts +6 -0
  152. package/dist/utils/load-failure.d.ts +14 -0
  153. package/package.json +5 -5
  154. package/dist/GCSStorageController-BSiP1c-f.js +0 -256
  155. package/dist/GCSStorageController-BSiP1c-f.js.map +0 -1
  156. package/dist/S3StorageController-CAwFRgjV.js +0 -276
  157. package/dist/S3StorageController-CAwFRgjV.js.map +0 -1
  158. package/dist/auth-DMLngxn_.js.map +0 -1
  159. package/dist/backup-CN0s50D2.js.map +0 -1
  160. package/dist/contract-routes-fz8i4pxs.js.map +0 -1
  161. package/dist/cron-loader-CwaANlOG.js.map +0 -1
  162. package/dist/cron-routes-Bc-SB0Se.js.map +0 -1
  163. package/dist/cron-scheduler-CYQgco86.js.map +0 -1
  164. package/dist/cron-store-D2Q9-Aco.js +0 -300
  165. package/dist/cron-store-D2Q9-Aco.js.map +0 -1
  166. package/dist/dynamic-import-X40pTZUQ.js +0 -23
  167. package/dist/dynamic-import-X40pTZUQ.js.map +0 -1
  168. package/dist/function-loader-D7o5Epjj.js.map +0 -1
  169. package/dist/function-routes-CaNG4waN.js.map +0 -1
  170. package/dist/jobs-DqYNfquG.js.map +0 -1
  171. package/dist/jwt-R6bSPMjk.js.map +0 -1
  172. package/dist/openapi-generator-DAq_XVDu.js.map +0 -1
  173. package/dist/query-parser-BgiKJKvc.js.map +0 -1
  174. package/dist/request-timeout-DgH7j8qO.js.map +0 -1
  175. package/dist/schema-editor-routes-oIyuWl3L.js.map +0 -1
  176. package/dist/soft-delete-params-BWPilMPF.js +0 -59
  177. package/dist/soft-delete-params-BWPilMPF.js.map +0 -1
  178. package/dist/src-I3aG1PcY.js +0 -6870
  179. package/dist/src-I3aG1PcY.js.map +0 -1
  180. package/dist/types-BfKcm9do.js +0 -39
  181. package/dist/types-BfKcm9do.js.map +0 -1
@@ -1,3 +1,4 @@
1
+ import type { AuthRepository } from "./interfaces.js";
1
2
  /**
2
3
  * Whether a registration may proceed — computed in exactly one place.
3
4
  *
@@ -66,6 +67,21 @@ export interface RegistrationPolicy {
66
67
  export declare function isBootstrapWindowOpen(env?: {
67
68
  NODE_ENV?: string;
68
69
  }): boolean;
70
+ type UserPresenceRepository = Pick<AuthRepository, "firstUserIds" | "listUsersPaginated">;
71
+ /**
72
+ * Whether the users table is empty — the question behind the bootstrap window.
73
+ *
74
+ * Through `AuthRepository.firstUserIds` when the repository has it: one
75
+ * unordered `LIMIT 1` read. Otherwise through `listUsersPaginated`, which also
76
+ * counts and sorts the whole table, so it is only the fallback.
77
+ */
78
+ export declare function isUserTableEmpty(repo: UserPresenceRepository): Promise<boolean>;
79
+ /**
80
+ * Whether the account just created is the only one there is. Two ids at most:
81
+ * whether anyone else exists, and, when nobody does, whether it is this one.
82
+ * Same fallback as {@link isUserTableEmpty}.
83
+ */
84
+ export declare function isOnlyUser(repo: UserPresenceRepository, uid: string): Promise<boolean>;
69
85
  /**
70
86
  * What to tell a caller who hit an empty production database with the window
71
87
  * shut. Named here so the register route and the bootstrap route say the same
@@ -113,3 +129,4 @@ export declare function isAnonymousAuthOpen(policy: {
113
129
  allowAnonymous?: boolean;
114
130
  disableSelfRegistration?: boolean;
115
131
  }): boolean;
132
+ export {};
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Who may read the user picker (`GET /api/admin/users/pick`).
3
+ *
4
+ * A `userSelect` field stores a user's id, and the person filling it in picks
5
+ * that user from a list. Listing the users is an admin-plane read
6
+ * (`users:read`), which an editor does not hold — so the picker answers a
7
+ * narrower question for a wider audience: id, name, email and avatar, to
8
+ * anyone who may write a collection that has such a field.
9
+ *
10
+ * "May write" is the collection's `securityRules` for an insert or an update,
11
+ * evaluated the way the admin panel decides whether to offer the form, with
12
+ * one difference. A rule that depends only on the row (an owner field) counts
13
+ * as allowing, since the person may write some row. A rule written as SQL the
14
+ * policy model cannot read cannot be judged ahead, and here it counts as
15
+ * refusing: read optimistically, it would let any signed-in person list every
16
+ * user's name and email. A key or token narrowed by scopes must also hold
17
+ * `data:write` on that collection.
18
+ *
19
+ * The collections are read through a getter configured at boot, so a schema
20
+ * edited live is what is judged.
21
+ *
22
+ * @module
23
+ */
24
+ import type { Context } from "hono";
25
+ import { type CollectionConfig, type Properties } from "@rebasepro/types";
26
+ import type { HonoEnv } from "../api/types.js";
27
+ /** Tell the picker which collections this backend serves. Called once at boot. */
28
+ export declare function configureUserPicking(collections: () => readonly CollectionConfig[]): void;
29
+ /** Whether any property, at any depth, is a `userSelect` field. */
30
+ export declare function propertiesReferenceUsers(properties: Properties | undefined): boolean;
31
+ /**
32
+ * Whether this request's caller may read the user picker: they hold
33
+ * `users:read`, or they may write a collection with a `userSelect` field.
34
+ */
35
+ export declare function mayPickUsers(c: Context<HonoEnv>): boolean;