@rebasepro/common 0.2.4 → 0.2.5
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.
- package/dist/collections/default-collections.d.ts +5 -8
- package/dist/index.es.js +81 -26
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +81 -26
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/src/collections/default-collections.ts +58 -31
- package/src/data/buildRebaseData.ts +6 -0
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { PostgresCollection } from "@rebasepro/types";
|
|
1
|
+
import type { PostgresCollection } from "@rebasepro/types";
|
|
2
2
|
/**
|
|
3
|
-
* Default users collection
|
|
3
|
+
* Default users collection.
|
|
4
4
|
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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.
|
|
5
|
+
* Prepended to the developer's collections array by the admin and server.
|
|
6
|
+
* Slug-based dedup (Map keyed by slug, last-write-wins) lets developers
|
|
7
|
+
* override by defining their own collection with `slug: "users"`.
|
|
11
8
|
*/
|
|
12
9
|
export declare const defaultUsersCollection: PostgresCollection;
|
package/dist/index.es.js
CHANGED
|
@@ -1971,11 +1971,17 @@ const defaultUsersCollection = {
|
|
|
1971
1971
|
schema: "rebase",
|
|
1972
1972
|
icon: "Users",
|
|
1973
1973
|
group: "Settings",
|
|
1974
|
+
openEntityMode: "dialog",
|
|
1975
|
+
disableDefaultActions: ["copy"],
|
|
1976
|
+
sort: ["createdAt", "desc"],
|
|
1974
1977
|
properties: {
|
|
1975
1978
|
id: {
|
|
1976
1979
|
name: "ID",
|
|
1977
1980
|
type: "string",
|
|
1978
|
-
isId: "uuid"
|
|
1981
|
+
isId: "uuid",
|
|
1982
|
+
ui: {
|
|
1983
|
+
readOnly: true
|
|
1984
|
+
}
|
|
1979
1985
|
},
|
|
1980
1986
|
email: {
|
|
1981
1987
|
name: "Email",
|
|
@@ -1985,38 +1991,77 @@ const defaultUsersCollection = {
|
|
|
1985
1991
|
unique: true
|
|
1986
1992
|
}
|
|
1987
1993
|
},
|
|
1988
|
-
|
|
1989
|
-
name: "
|
|
1994
|
+
displayName: {
|
|
1995
|
+
name: "Name",
|
|
1990
1996
|
type: "string",
|
|
1991
|
-
|
|
1992
|
-
|
|
1997
|
+
columnName: "display_name",
|
|
1998
|
+
validation: {
|
|
1999
|
+
required: true
|
|
1993
2000
|
}
|
|
1994
2001
|
},
|
|
1995
|
-
|
|
1996
|
-
name: "Display Name",
|
|
1997
|
-
type: "string"
|
|
1998
|
-
},
|
|
1999
|
-
photo_url: {
|
|
2002
|
+
photoURL: {
|
|
2000
2003
|
name: "Photo URL",
|
|
2001
|
-
type: "string"
|
|
2004
|
+
type: "string",
|
|
2005
|
+
columnName: "photo_url",
|
|
2006
|
+
url: "image"
|
|
2002
2007
|
},
|
|
2003
|
-
|
|
2008
|
+
roles: {
|
|
2009
|
+
name: "Roles",
|
|
2010
|
+
type: "array",
|
|
2011
|
+
columnType: "text[]",
|
|
2012
|
+
of: {
|
|
2013
|
+
name: "Role",
|
|
2014
|
+
type: "string",
|
|
2015
|
+
enum: {
|
|
2016
|
+
admin: "Admin",
|
|
2017
|
+
editor: "Editor",
|
|
2018
|
+
viewer: "Viewer"
|
|
2019
|
+
}
|
|
2020
|
+
}
|
|
2021
|
+
},
|
|
2022
|
+
passwordHash: {
|
|
2023
|
+
name: "Password Hash",
|
|
2024
|
+
type: "string",
|
|
2025
|
+
columnName: "password_hash",
|
|
2026
|
+
ui: {
|
|
2027
|
+
hideFromCollection: true,
|
|
2028
|
+
disabled: {
|
|
2029
|
+
hidden: true
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
},
|
|
2033
|
+
emailVerified: {
|
|
2004
2034
|
name: "Email Verified",
|
|
2005
2035
|
type: "boolean",
|
|
2006
|
-
|
|
2036
|
+
columnName: "email_verified",
|
|
2037
|
+
defaultValue: false,
|
|
2038
|
+
ui: {
|
|
2039
|
+
hideFromCollection: true,
|
|
2040
|
+
disabled: {
|
|
2041
|
+
hidden: true
|
|
2042
|
+
}
|
|
2043
|
+
}
|
|
2007
2044
|
},
|
|
2008
|
-
|
|
2045
|
+
emailVerificationToken: {
|
|
2009
2046
|
name: "Email Verification Token",
|
|
2010
2047
|
type: "string",
|
|
2048
|
+
columnName: "email_verification_token",
|
|
2011
2049
|
ui: {
|
|
2012
|
-
hideFromCollection: true
|
|
2050
|
+
hideFromCollection: true,
|
|
2051
|
+
disabled: {
|
|
2052
|
+
hidden: true
|
|
2053
|
+
}
|
|
2013
2054
|
}
|
|
2014
2055
|
},
|
|
2015
|
-
|
|
2056
|
+
emailVerificationSentAt: {
|
|
2016
2057
|
name: "Email Verification Sent At",
|
|
2017
2058
|
type: "date",
|
|
2059
|
+
columnName: "email_verification_sent_at",
|
|
2018
2060
|
ui: {
|
|
2019
|
-
hideFromCollection: true
|
|
2061
|
+
hideFromCollection: true,
|
|
2062
|
+
disabled: {
|
|
2063
|
+
hidden: true
|
|
2064
|
+
}
|
|
2020
2065
|
}
|
|
2021
2066
|
},
|
|
2022
2067
|
metadata: {
|
|
@@ -2024,28 +2069,35 @@ const defaultUsersCollection = {
|
|
|
2024
2069
|
type: "map",
|
|
2025
2070
|
defaultValue: {},
|
|
2026
2071
|
ui: {
|
|
2027
|
-
hideFromCollection: true
|
|
2072
|
+
hideFromCollection: true,
|
|
2073
|
+
disabled: {
|
|
2074
|
+
hidden: true
|
|
2075
|
+
}
|
|
2028
2076
|
}
|
|
2029
2077
|
},
|
|
2030
|
-
|
|
2078
|
+
createdAt: {
|
|
2031
2079
|
name: "Created At",
|
|
2032
2080
|
type: "date",
|
|
2033
|
-
|
|
2081
|
+
columnName: "created_at",
|
|
2034
2082
|
ui: {
|
|
2035
|
-
readOnly: true
|
|
2036
|
-
hideFromCollection: true
|
|
2083
|
+
readOnly: true
|
|
2037
2084
|
}
|
|
2038
2085
|
},
|
|
2039
|
-
|
|
2086
|
+
updatedAt: {
|
|
2040
2087
|
name: "Updated At",
|
|
2041
2088
|
type: "date",
|
|
2089
|
+
columnName: "updated_at",
|
|
2042
2090
|
autoValue: "on_update",
|
|
2043
2091
|
ui: {
|
|
2044
|
-
|
|
2045
|
-
|
|
2092
|
+
hideFromCollection: true,
|
|
2093
|
+
disabled: {
|
|
2094
|
+
hidden: true
|
|
2095
|
+
}
|
|
2046
2096
|
}
|
|
2047
2097
|
}
|
|
2048
|
-
}
|
|
2098
|
+
},
|
|
2099
|
+
listProperties: ["displayName", "email", "roles", "createdAt"],
|
|
2100
|
+
propertiesOrder: ["id", "email", "displayName", "roles", "createdAt"]
|
|
2049
2101
|
};
|
|
2050
2102
|
function mapOperator(op) {
|
|
2051
2103
|
switch (op) {
|
|
@@ -2293,6 +2345,9 @@ function createDriverAccessor(driver, slug) {
|
|
|
2293
2345
|
}
|
|
2294
2346
|
});
|
|
2295
2347
|
},
|
|
2348
|
+
deleteAll: driver.deleteAll ? async () => {
|
|
2349
|
+
return driver.deleteAll(slug);
|
|
2350
|
+
} : void 0,
|
|
2296
2351
|
count: driver.countEntities ? async (params) => {
|
|
2297
2352
|
return driver.countEntities({
|
|
2298
2353
|
path: slug,
|