@rebasepro/common 0.2.3 → 0.3.0

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.
@@ -0,0 +1,12 @@
1
+ import { PostgresCollection } from "@rebasepro/types";
2
+ /**
3
+ * Default users collection definition.
4
+ *
5
+ * Shared between the admin UI (for navigation/display) and the backend
6
+ * (for schema generation). Both consumers prepend this to the developer's
7
+ * collections array and rely on generic slug-based deduplication
8
+ * (Map keyed by slug, last-write-wins) so that developer-defined
9
+ * collections with the same slug override this default — no hardcoded
10
+ * string checks required.
11
+ */
12
+ export declare const defaultUsersCollection: PostgresCollection;
@@ -1 +1,2 @@
1
1
  export * from "./CollectionRegistry";
2
+ export * from "./default-collections";
package/dist/index.es.js CHANGED
@@ -1963,6 +1963,90 @@ class CollectionRegistry {
1963
1963
  };
1964
1964
  }
1965
1965
  }
1966
+ const defaultUsersCollection = {
1967
+ name: "Users",
1968
+ singularName: "User",
1969
+ slug: "users",
1970
+ table: "users",
1971
+ schema: "rebase",
1972
+ icon: "Users",
1973
+ group: "Settings",
1974
+ properties: {
1975
+ id: {
1976
+ name: "ID",
1977
+ type: "string",
1978
+ isId: "uuid"
1979
+ },
1980
+ email: {
1981
+ name: "Email",
1982
+ type: "string",
1983
+ validation: {
1984
+ required: true,
1985
+ unique: true
1986
+ }
1987
+ },
1988
+ password_hash: {
1989
+ name: "Password Hash",
1990
+ type: "string",
1991
+ ui: {
1992
+ hideFromCollection: true
1993
+ }
1994
+ },
1995
+ display_name: {
1996
+ name: "Display Name",
1997
+ type: "string"
1998
+ },
1999
+ photo_url: {
2000
+ name: "Photo URL",
2001
+ type: "string"
2002
+ },
2003
+ email_verified: {
2004
+ name: "Email Verified",
2005
+ type: "boolean",
2006
+ defaultValue: false
2007
+ },
2008
+ email_verification_token: {
2009
+ name: "Email Verification Token",
2010
+ type: "string",
2011
+ ui: {
2012
+ hideFromCollection: true
2013
+ }
2014
+ },
2015
+ email_verification_sent_at: {
2016
+ name: "Email Verification Sent At",
2017
+ type: "date",
2018
+ ui: {
2019
+ hideFromCollection: true
2020
+ }
2021
+ },
2022
+ metadata: {
2023
+ name: "Metadata",
2024
+ type: "map",
2025
+ defaultValue: {},
2026
+ ui: {
2027
+ hideFromCollection: true
2028
+ }
2029
+ },
2030
+ created_at: {
2031
+ name: "Created At",
2032
+ type: "date",
2033
+ autoValue: "on_create",
2034
+ ui: {
2035
+ readOnly: true,
2036
+ hideFromCollection: true
2037
+ }
2038
+ },
2039
+ updated_at: {
2040
+ name: "Updated At",
2041
+ type: "date",
2042
+ autoValue: "on_update",
2043
+ ui: {
2044
+ readOnly: true,
2045
+ hideFromCollection: true
2046
+ }
2047
+ }
2048
+ }
2049
+ };
1966
2050
  function mapOperator(op) {
1967
2051
  switch (op) {
1968
2052
  case "==":
@@ -2317,8 +2401,10 @@ export {
2317
2401
  canDeleteEntity,
2318
2402
  canEditEntity,
2319
2403
  canReadCollection,
2404
+ checkOperation,
2320
2405
  createRelationRef,
2321
2406
  createRelationRefWithData,
2407
+ defaultUsersCollection,
2322
2408
  enumToObjectEntries,
2323
2409
  evaluateCondition,
2324
2410
  findRelation,