@rebasepro/common 0.9.1-canary.16c42e9 → 0.9.1-canary.26fe4b2

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.
@@ -56,6 +56,7 @@ export declare const defaultUsersCollection: import("@rebasepro/types").Postgres
56
56
  readonly name: "Password Hash";
57
57
  readonly type: "string";
58
58
  readonly columnName: "password_hash";
59
+ readonly excludeFromApi: true;
59
60
  readonly ui: {
60
61
  readonly hideFromCollection: true;
61
62
  readonly disabled: {
@@ -79,6 +80,7 @@ export declare const defaultUsersCollection: import("@rebasepro/types").Postgres
79
80
  readonly name: "Email Verification Token";
80
81
  readonly type: "string";
81
82
  readonly columnName: "email_verification_token";
83
+ readonly excludeFromApi: true;
82
84
  readonly ui: {
83
85
  readonly hideFromCollection: true;
84
86
  readonly disabled: {
@@ -183,6 +185,7 @@ export declare const defaultUsersCollection: import("@rebasepro/types").Postgres
183
185
  readonly name: "Password Hash";
184
186
  readonly type: "string";
185
187
  readonly columnName: "password_hash";
188
+ readonly excludeFromApi: true;
186
189
  readonly ui: {
187
190
  readonly hideFromCollection: true;
188
191
  readonly disabled: {
@@ -206,6 +209,7 @@ export declare const defaultUsersCollection: import("@rebasepro/types").Postgres
206
209
  readonly name: "Email Verification Token";
207
210
  readonly type: "string";
208
211
  readonly columnName: "email_verification_token";
212
+ readonly excludeFromApi: true;
209
213
  readonly ui: {
210
214
  readonly hideFromCollection: true;
211
215
  readonly disabled: {
package/dist/index.es.js CHANGED
@@ -788,7 +788,7 @@ function getSubcollections(collection) {
788
788
  * It handles:
789
789
  * - `field = 'literal'`
790
790
  * - `field != 'literal'`
791
- * - `field = current_setting('app.user_id')`
791
+ * - `field = current_setting('app.uid')` (or the legacy `app.user_id`)
792
792
  * - `A AND B`, `A OR B` — only where the keyword is at the top level
793
793
  * - `true`
794
794
  * - `IN (...)` (as optimistic true)
@@ -989,7 +989,7 @@ function findAnonymousGrants(expr) {
989
989
  return found;
990
990
  }
991
991
  function parseOperand(str) {
992
- if (/current_setting\s*\(\s*'app\.user_id'\s*\)/i.test(str) || /auth\.uid\(\)/i.test(str)) return policy.authUid();
992
+ if (/current_setting\s*\(\s*'app\.(uid|user_id)'\s*\)/i.test(str) || /auth\.uid\(\)/i.test(str)) return policy.authUid();
993
993
  const stringMatch = str.match(/^'(.+)'$/);
994
994
  if (stringMatch) return policy.literal(stringMatch[1]);
995
995
  if (/^\w+$/.test(str)) return policy.field(str);
@@ -2763,6 +2763,7 @@ var defaultUsersCollection = defineCollection({
2763
2763
  name: "Password Hash",
2764
2764
  type: "string",
2765
2765
  columnName: "password_hash",
2766
+ excludeFromApi: true,
2766
2767
  ui: {
2767
2768
  hideFromCollection: true,
2768
2769
  disabled: { hidden: true }
@@ -2782,6 +2783,7 @@ var defaultUsersCollection = defineCollection({
2782
2783
  name: "Email Verification Token",
2783
2784
  type: "string",
2784
2785
  columnName: "email_verification_token",
2786
+ excludeFromApi: true,
2785
2787
  ui: {
2786
2788
  hideFromCollection: true,
2787
2789
  disabled: { hidden: true }