@rebasepro/server-postgres 0.12.0 → 0.12.1-canary.g181d0fe

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 (35) hide show
  1. package/dist/auth/services.d.ts +16 -0
  2. package/dist/backup-service-DH9kPg-E.js +8866 -0
  3. package/dist/backup-service-DH9kPg-E.js.map +1 -0
  4. package/dist/connection-B5Wndbr1.js +196 -0
  5. package/dist/connection-B5Wndbr1.js.map +1 -0
  6. package/dist/ensure-collection-policies-CT-zIUWA.js +57 -0
  7. package/dist/ensure-collection-policies-CT-zIUWA.js.map +1 -0
  8. package/dist/{ensure-collection-tables-CNTcZGvn.js → ensure-collection-tables-Vu-GRELM.js} +83 -6
  9. package/dist/ensure-collection-tables-Vu-GRELM.js.map +1 -0
  10. package/dist/index.es.js +420 -9598
  11. package/dist/index.es.js.map +1 -1
  12. package/dist/schema/auth-schema.d.ts +83 -144
  13. package/dist/schema/ensure-collection-policies.d.ts +60 -0
  14. package/dist/schema/generate-postgres-ddl-logic.d.ts +43 -1
  15. package/dist/{src-BbFOPJ1S.js → src-DihrDFuP.js} +160 -150
  16. package/dist/src-DihrDFuP.js.map +1 -0
  17. package/dist/{src-Zqwaw3P5.js → src-DoU9yPqq.js} +3 -159
  18. package/dist/src-DoU9yPqq.js.map +1 -0
  19. package/dist/utils/pg-error-utils.d.ts +19 -0
  20. package/dist/websocket-BKcGvILX.js +528 -0
  21. package/dist/websocket-BKcGvILX.js.map +1 -0
  22. package/package.json +14 -14
  23. package/src/PostgresAdapter.ts +14 -0
  24. package/src/PostgresBootstrapper.ts +104 -12
  25. package/src/auth/ensure-tables.ts +164 -9
  26. package/src/auth/services.ts +21 -2
  27. package/src/schema/auth-schema.ts +30 -19
  28. package/src/schema/ensure-collection-policies.ts +105 -0
  29. package/src/schema/generate-drizzle-schema-logic.ts +7 -3
  30. package/src/schema/generate-postgres-ddl-logic.ts +100 -13
  31. package/src/utils/pg-error-utils.ts +46 -0
  32. package/dist/chunk-DSJWtz9O.js +0 -40
  33. package/dist/ensure-collection-tables-CNTcZGvn.js.map +0 -1
  34. package/dist/src-BbFOPJ1S.js.map +0 -1
  35. package/dist/src-Zqwaw3P5.js.map +0 -1
@@ -9,6 +9,22 @@ export interface AuthSchemaTables {
9
9
  appConfig: RebasePgTable;
10
10
  userIdentities: RebasePgTable;
11
11
  }
12
+ /**
13
+ * The single definition of what an email address looks like in storage.
14
+ *
15
+ * Reads have always folded case; writes did not, and normalising was left to
16
+ * each caller. That asymmetry is only ever one forgotten `.toLowerCase()` away
17
+ * from a row no lookup can find — the account exists, every sign-in path
18
+ * reports no such user, and the byte-exact UNIQUE on the column does not stop a
19
+ * duplicate differing only in case. Applied on both sides here so the guarantee
20
+ * belongs to the repository rather than to its callers' discipline; the
21
+ * `lower(email)` unique index added in `ensureAuthTablesExist` is the database
22
+ * half of the same rule.
23
+ *
24
+ * Whitespace goes too: a trailing space survives the fold and reproduces the
25
+ * problem exactly.
26
+ */
27
+ export declare function normalizeEmail<T>(email: T): T | string;
12
28
  /**
13
29
  * PostgreSQL implementation of UserRepository.
14
30
  * Handles all user-related database operations using Drizzle ORM.