@objectstack/platform-objects 6.8.1 → 7.0.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.
- package/dist/apps/index.d.mts +30 -1
- package/dist/apps/index.d.ts +30 -1
- package/dist/apps/index.js +994 -37
- package/dist/apps/index.js.map +1 -1
- package/dist/apps/index.mjs +994 -38
- package/dist/apps/index.mjs.map +1 -1
- package/dist/audit/index.d.mts +320 -16
- package/dist/audit/index.d.ts +320 -16
- package/dist/identity/index.d.mts +1000 -22
- package/dist/identity/index.d.ts +1000 -22
- package/dist/identity/index.js +384 -8
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/index.mjs +384 -8
- package/dist/identity/index.mjs.map +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +7060 -154
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7054 -155
- package/dist/index.mjs.map +1 -1
- package/dist/integration/index.d.mts +20 -1
- package/dist/integration/index.d.ts +20 -1
- package/dist/metadata/index.d.mts +40 -2
- package/dist/metadata/index.d.ts +40 -2
- package/dist/metadata-translations/index.d.mts +20 -0
- package/dist/metadata-translations/index.d.ts +20 -0
- package/dist/metadata-translations/index.js +4777 -0
- package/dist/metadata-translations/index.js.map +1 -0
- package/dist/metadata-translations/index.mjs +4775 -0
- package/dist/metadata-translations/index.mjs.map +1 -0
- package/dist/pages/index.d.mts +68 -0
- package/dist/pages/index.d.ts +68 -0
- package/dist/pages/index.js +371 -0
- package/dist/pages/index.js.map +1 -0
- package/dist/pages/index.mjs +368 -0
- package/dist/pages/index.mjs.map +1 -0
- package/dist/plugin.d.mts +35 -0
- package/dist/plugin.d.ts +35 -0
- package/dist/plugin.js +17566 -0
- package/dist/plugin.js.map +1 -0
- package/dist/plugin.mjs +17563 -0
- package/dist/plugin.mjs.map +1 -0
- package/dist/security/index.d.mts +6376 -2094
- package/dist/security/index.d.ts +6376 -2094
- package/dist/security/index.js +383 -1
- package/dist/security/index.js.map +1 -1
- package/dist/security/index.mjs +383 -2
- package/dist/security/index.mjs.map +1 -1
- package/dist/system/index.d.mts +60 -3
- package/dist/system/index.d.ts +60 -3
- package/package.json +17 -2
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Page } from '@objectstack/spec/ui';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* sys_organization — Record Detail Page (slotted)
|
|
5
|
+
*
|
|
6
|
+
* Adds Members / Invitations / Teams tabs to the organization detail
|
|
7
|
+
* page so an admin can manage the membership graph from a single place
|
|
8
|
+
* instead of switching between three separate Setup list views.
|
|
9
|
+
*
|
|
10
|
+
* The page is `kind: 'slotted'` and overrides only the `tabs` slot —
|
|
11
|
+
* header, actions, highlights, details and discussion fall through to
|
|
12
|
+
* the synthesized default, so the organization's own fields and the
|
|
13
|
+
* existing record-header actions (Set Active, Edit, Delete, Leave) are
|
|
14
|
+
* preserved.
|
|
15
|
+
*
|
|
16
|
+
* Each tab is a `record:related_list` over a child object that already
|
|
17
|
+
* has `organization_id` as a `Field.lookup('sys_organization')` — the
|
|
18
|
+
* renderer scopes the list to the current organization automatically
|
|
19
|
+
* (the related-list runtime uses the parent record id from the page
|
|
20
|
+
* context as the filter value for `relationshipField`). The per-row
|
|
21
|
+
* actions defined on each child object (invite_user, cancel_invitation,
|
|
22
|
+
* remove_member, transfer_ownership, create_team, …) are inherited
|
|
23
|
+
* unchanged — no admin endpoint has to be re-declared here.
|
|
24
|
+
*
|
|
25
|
+
* Notable omissions:
|
|
26
|
+
* - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not
|
|
27
|
+
* `organization_id`. They surface on the user's Account → Developer
|
|
28
|
+
* section instead of the org detail.
|
|
29
|
+
* - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,
|
|
30
|
+
* add a fourth tab here.
|
|
31
|
+
*/
|
|
32
|
+
declare const SysOrganizationDetailPage: Page;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* sys_user — Record Detail Page (slotted, default for ALL sys_user records)
|
|
36
|
+
*
|
|
37
|
+
* Tailors the synthesized admin form into a layout that works for both:
|
|
38
|
+
* • the end user landing on their own profile from the Account App, and
|
|
39
|
+
* • an admin opening someone else's user record from Setup.
|
|
40
|
+
*
|
|
41
|
+
* Strategy
|
|
42
|
+
* --------
|
|
43
|
+
* - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,
|
|
44
|
+
* `details`, `tabs` and `discussion`. Header / actions fall through
|
|
45
|
+
* to the synthesizer so the object's declared actions
|
|
46
|
+
* (`update_my_profile / change_my_password / resend_verification_email
|
|
47
|
+
* / ban_user / set_user_role / impersonate_user / …`) still appear
|
|
48
|
+
* in the header overflow menu automatically.
|
|
49
|
+
* - `highlights` promotes the four signals worth scanning at the top:
|
|
50
|
+
* email, verification state, 2FA, platform role. Highlight fields
|
|
51
|
+
* are auto-dropped from the details grid below.
|
|
52
|
+
* - `details` re-groups remaining fields into sections and hides
|
|
53
|
+
* admin-internal audit columns. Banned / ban metadata is still
|
|
54
|
+
* editable from the header actions — we just don't show it in
|
|
55
|
+
* every user's body.
|
|
56
|
+
* - `tabs` is **explicitly curated** to the 4 related lists that matter
|
|
57
|
+
* on a user profile (Sessions / Linked Accounts / Organizations /
|
|
58
|
+
* Personal OAuth Apps). Without this override, the synthesizer
|
|
59
|
+
* auto-generates a tab per object that has a FK to sys_user
|
|
60
|
+
* (sys_role.created_by, sys_email.updated_by, sys_user_preference,
|
|
61
|
+
* sys_email_template.created_by, …) producing dozens of noisy
|
|
62
|
+
* "查看全部" cards on every profile.
|
|
63
|
+
* - `discussion: []` removes the Chatter feed — it has no business
|
|
64
|
+
* on a personal profile.
|
|
65
|
+
*/
|
|
66
|
+
declare const SysUserDetailPage: Page;
|
|
67
|
+
|
|
68
|
+
export { SysOrganizationDetailPage, SysUserDetailPage };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { Page } from '@objectstack/spec/ui';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* sys_organization — Record Detail Page (slotted)
|
|
5
|
+
*
|
|
6
|
+
* Adds Members / Invitations / Teams tabs to the organization detail
|
|
7
|
+
* page so an admin can manage the membership graph from a single place
|
|
8
|
+
* instead of switching between three separate Setup list views.
|
|
9
|
+
*
|
|
10
|
+
* The page is `kind: 'slotted'` and overrides only the `tabs` slot —
|
|
11
|
+
* header, actions, highlights, details and discussion fall through to
|
|
12
|
+
* the synthesized default, so the organization's own fields and the
|
|
13
|
+
* existing record-header actions (Set Active, Edit, Delete, Leave) are
|
|
14
|
+
* preserved.
|
|
15
|
+
*
|
|
16
|
+
* Each tab is a `record:related_list` over a child object that already
|
|
17
|
+
* has `organization_id` as a `Field.lookup('sys_organization')` — the
|
|
18
|
+
* renderer scopes the list to the current organization automatically
|
|
19
|
+
* (the related-list runtime uses the parent record id from the page
|
|
20
|
+
* context as the filter value for `relationshipField`). The per-row
|
|
21
|
+
* actions defined on each child object (invite_user, cancel_invitation,
|
|
22
|
+
* remove_member, transfer_ownership, create_team, …) are inherited
|
|
23
|
+
* unchanged — no admin endpoint has to be re-declared here.
|
|
24
|
+
*
|
|
25
|
+
* Notable omissions:
|
|
26
|
+
* - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not
|
|
27
|
+
* `organization_id`. They surface on the user's Account → Developer
|
|
28
|
+
* section instead of the org detail.
|
|
29
|
+
* - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,
|
|
30
|
+
* add a fourth tab here.
|
|
31
|
+
*/
|
|
32
|
+
declare const SysOrganizationDetailPage: Page;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* sys_user — Record Detail Page (slotted, default for ALL sys_user records)
|
|
36
|
+
*
|
|
37
|
+
* Tailors the synthesized admin form into a layout that works for both:
|
|
38
|
+
* • the end user landing on their own profile from the Account App, and
|
|
39
|
+
* • an admin opening someone else's user record from Setup.
|
|
40
|
+
*
|
|
41
|
+
* Strategy
|
|
42
|
+
* --------
|
|
43
|
+
* - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,
|
|
44
|
+
* `details`, `tabs` and `discussion`. Header / actions fall through
|
|
45
|
+
* to the synthesizer so the object's declared actions
|
|
46
|
+
* (`update_my_profile / change_my_password / resend_verification_email
|
|
47
|
+
* / ban_user / set_user_role / impersonate_user / …`) still appear
|
|
48
|
+
* in the header overflow menu automatically.
|
|
49
|
+
* - `highlights` promotes the four signals worth scanning at the top:
|
|
50
|
+
* email, verification state, 2FA, platform role. Highlight fields
|
|
51
|
+
* are auto-dropped from the details grid below.
|
|
52
|
+
* - `details` re-groups remaining fields into sections and hides
|
|
53
|
+
* admin-internal audit columns. Banned / ban metadata is still
|
|
54
|
+
* editable from the header actions — we just don't show it in
|
|
55
|
+
* every user's body.
|
|
56
|
+
* - `tabs` is **explicitly curated** to the 4 related lists that matter
|
|
57
|
+
* on a user profile (Sessions / Linked Accounts / Organizations /
|
|
58
|
+
* Personal OAuth Apps). Without this override, the synthesizer
|
|
59
|
+
* auto-generates a tab per object that has a FK to sys_user
|
|
60
|
+
* (sys_role.created_by, sys_email.updated_by, sys_user_preference,
|
|
61
|
+
* sys_email_template.created_by, …) producing dozens of noisy
|
|
62
|
+
* "查看全部" cards on every profile.
|
|
63
|
+
* - `discussion: []` removes the Chatter feed — it has no business
|
|
64
|
+
* on a personal profile.
|
|
65
|
+
*/
|
|
66
|
+
declare const SysUserDetailPage: Page;
|
|
67
|
+
|
|
68
|
+
export { SysOrganizationDetailPage, SysUserDetailPage };
|
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/pages/sys-organization.page.ts
|
|
4
|
+
var SysOrganizationDetailPage = {
|
|
5
|
+
name: "sys_organization_detail",
|
|
6
|
+
label: "Organization",
|
|
7
|
+
type: "record",
|
|
8
|
+
object: "sys_organization",
|
|
9
|
+
template: "default",
|
|
10
|
+
kind: "slotted",
|
|
11
|
+
isDefault: true,
|
|
12
|
+
// `regions` is required by the Page schema even for slotted pages —
|
|
13
|
+
// empty array lets the synthesizer fill in header/details/discussion
|
|
14
|
+
// while the `slots.tabs` override below replaces the synthesized
|
|
15
|
+
// tabs strip.
|
|
16
|
+
regions: [],
|
|
17
|
+
slots: {
|
|
18
|
+
tabs: {
|
|
19
|
+
type: "page:tabs",
|
|
20
|
+
properties: {
|
|
21
|
+
type: "line",
|
|
22
|
+
position: "top",
|
|
23
|
+
items: [
|
|
24
|
+
{
|
|
25
|
+
label: "Members",
|
|
26
|
+
icon: "users",
|
|
27
|
+
children: [
|
|
28
|
+
{
|
|
29
|
+
type: "record:related_list",
|
|
30
|
+
properties: {
|
|
31
|
+
objectName: "sys_member",
|
|
32
|
+
relationshipField: "organization_id",
|
|
33
|
+
columns: ["user_id", "role", "created_at"],
|
|
34
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
35
|
+
limit: 25,
|
|
36
|
+
showViewAll: true,
|
|
37
|
+
title: "Members"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: "Invitations",
|
|
44
|
+
icon: "mail",
|
|
45
|
+
children: [
|
|
46
|
+
{
|
|
47
|
+
type: "record:related_list",
|
|
48
|
+
properties: {
|
|
49
|
+
objectName: "sys_invitation",
|
|
50
|
+
relationshipField: "organization_id",
|
|
51
|
+
columns: ["email", "role", "status", "expires_at", "inviter_id"],
|
|
52
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
53
|
+
limit: 25,
|
|
54
|
+
showViewAll: true,
|
|
55
|
+
title: "Invitations"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "Teams",
|
|
62
|
+
icon: "users-round",
|
|
63
|
+
children: [
|
|
64
|
+
{
|
|
65
|
+
type: "record:related_list",
|
|
66
|
+
properties: {
|
|
67
|
+
objectName: "sys_team",
|
|
68
|
+
relationshipField: "organization_id",
|
|
69
|
+
columns: ["name", "created_at", "updated_at"],
|
|
70
|
+
sort: [{ field: "name", order: "asc" }],
|
|
71
|
+
limit: 25,
|
|
72
|
+
showViewAll: true,
|
|
73
|
+
title: "Teams"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
// src/pages/sys-user.page.ts
|
|
85
|
+
var SysUserDetailPage = {
|
|
86
|
+
name: "sys_user_detail",
|
|
87
|
+
label: "User",
|
|
88
|
+
type: "record",
|
|
89
|
+
object: "sys_user",
|
|
90
|
+
template: "default",
|
|
91
|
+
kind: "slotted",
|
|
92
|
+
isDefault: true,
|
|
93
|
+
regions: [],
|
|
94
|
+
slots: {
|
|
95
|
+
// ── Alert banners ─────────────────────────────────────────────
|
|
96
|
+
// Conditional notices rendered between the page header and the
|
|
97
|
+
// highlight strip. The unverified-email banner only shows for the
|
|
98
|
+
// current user viewing their own profile (admins looking at other
|
|
99
|
+
// users see nothing — they can use Setup actions instead).
|
|
100
|
+
alerts: [
|
|
101
|
+
{
|
|
102
|
+
type: "record:alert",
|
|
103
|
+
properties: {
|
|
104
|
+
severity: "warning",
|
|
105
|
+
icon: "mail",
|
|
106
|
+
title: "\u90AE\u7BB1\u672A\u9A8C\u8BC1",
|
|
107
|
+
body: "\u9A8C\u8BC1\u4F60\u7684\u90AE\u7BB1\u4EE5\u63A5\u6536\u5BC6\u7801\u91CD\u7F6E\u548C\u91CD\u8981\u7684\u7CFB\u7EDF\u901A\u77E5\u3002",
|
|
108
|
+
visible: "record.id == ctx.user.id && record.email_verified == false",
|
|
109
|
+
dismissible: false,
|
|
110
|
+
action: {
|
|
111
|
+
actionName: "resend_verification_email",
|
|
112
|
+
label: "\u91CD\u65B0\u53D1\u9001\u9A8C\u8BC1\u90AE\u4EF6"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
// ── Highlight chips above the fold ────────────────────────────
|
|
118
|
+
highlights: {
|
|
119
|
+
type: "record:highlights",
|
|
120
|
+
properties: {
|
|
121
|
+
fields: ["email", "email_verified", "two_factor_enabled", "role"]
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
// ── Body / details grid ───────────────────────────────────────
|
|
125
|
+
details: {
|
|
126
|
+
type: "record:details",
|
|
127
|
+
properties: {
|
|
128
|
+
hideFields: [
|
|
129
|
+
"id",
|
|
130
|
+
"banned",
|
|
131
|
+
"ban_reason",
|
|
132
|
+
"ban_expires",
|
|
133
|
+
// already promoted to highlights:
|
|
134
|
+
"email",
|
|
135
|
+
"email_verified",
|
|
136
|
+
"two_factor_enabled",
|
|
137
|
+
"role"
|
|
138
|
+
],
|
|
139
|
+
sections: [
|
|
140
|
+
{
|
|
141
|
+
label: "Identity",
|
|
142
|
+
fields: ["name", "image"]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
label: "Audit",
|
|
146
|
+
fields: ["created_at", "updated_at"]
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
// ── Tabs: curated related lists ───────────────────────────────
|
|
152
|
+
// Only the 4 lists that are semantically about THIS user account.
|
|
153
|
+
// Everything else (sys_role created_by, sys_email_template
|
|
154
|
+
// updated_by, …) is incidental authorship metadata and would only
|
|
155
|
+
// create noise.
|
|
156
|
+
tabs: {
|
|
157
|
+
type: "page:tabs",
|
|
158
|
+
properties: {
|
|
159
|
+
type: "line",
|
|
160
|
+
position: "top",
|
|
161
|
+
items: [
|
|
162
|
+
{
|
|
163
|
+
label: "Sessions",
|
|
164
|
+
icon: "monitor",
|
|
165
|
+
children: [
|
|
166
|
+
{
|
|
167
|
+
type: "record:related_list",
|
|
168
|
+
properties: {
|
|
169
|
+
objectName: "sys_session",
|
|
170
|
+
relationshipField: "user_id",
|
|
171
|
+
columns: ["user_agent", "ip_address", "created_at", "expires_at"],
|
|
172
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
173
|
+
limit: 25,
|
|
174
|
+
showViewAll: true,
|
|
175
|
+
title: "Sessions"
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
label: "Linked Accounts",
|
|
182
|
+
icon: "link",
|
|
183
|
+
children: [
|
|
184
|
+
{
|
|
185
|
+
type: "record:related_list",
|
|
186
|
+
properties: {
|
|
187
|
+
objectName: "sys_account",
|
|
188
|
+
relationshipField: "user_id",
|
|
189
|
+
columns: ["provider_id", "account_id", "created_at"],
|
|
190
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
191
|
+
limit: 25,
|
|
192
|
+
showViewAll: true,
|
|
193
|
+
title: "Linked Accounts"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
]
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: "Organizations",
|
|
200
|
+
icon: "building-2",
|
|
201
|
+
children: [
|
|
202
|
+
{
|
|
203
|
+
type: "record:related_list",
|
|
204
|
+
properties: {
|
|
205
|
+
objectName: "sys_member",
|
|
206
|
+
relationshipField: "user_id",
|
|
207
|
+
columns: ["organization_id", "role", "created_at"],
|
|
208
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
209
|
+
limit: 25,
|
|
210
|
+
showViewAll: true,
|
|
211
|
+
title: "Organizations"
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
label: "OAuth Apps",
|
|
218
|
+
icon: "key-square",
|
|
219
|
+
children: [
|
|
220
|
+
{
|
|
221
|
+
type: "record:related_list",
|
|
222
|
+
properties: {
|
|
223
|
+
objectName: "sys_oauth_application",
|
|
224
|
+
relationshipField: "user_id",
|
|
225
|
+
columns: ["name", "client_id", "created_at"],
|
|
226
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
227
|
+
limit: 25,
|
|
228
|
+
showViewAll: true,
|
|
229
|
+
title: "OAuth Apps"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
// ── Security ──────────────────────────────────────────────
|
|
235
|
+
// Grouped self-service security controls. Each `record:quick_actions`
|
|
236
|
+
// pulls its actions by name from the sys_user object metadata
|
|
237
|
+
// (DRY — definitions stay on the object) and filters by
|
|
238
|
+
// `location: 'record_section'` so they only render here, not
|
|
239
|
+
// in the global header row.
|
|
240
|
+
{
|
|
241
|
+
label: "Security",
|
|
242
|
+
icon: "shield",
|
|
243
|
+
children: [
|
|
244
|
+
{
|
|
245
|
+
type: "element:text",
|
|
246
|
+
properties: {
|
|
247
|
+
variant: "subheading",
|
|
248
|
+
content: "Password & Sign-in"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
type: "element:text",
|
|
253
|
+
properties: {
|
|
254
|
+
variant: "caption",
|
|
255
|
+
content: "Change your password or the email address associated with this account."
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
type: "record:quick_actions",
|
|
260
|
+
properties: {
|
|
261
|
+
location: "record_section",
|
|
262
|
+
align: "start",
|
|
263
|
+
actionNames: ["change_my_password", "change_my_email"]
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
{ type: "element:divider" },
|
|
267
|
+
{
|
|
268
|
+
type: "element:text",
|
|
269
|
+
properties: {
|
|
270
|
+
variant: "subheading",
|
|
271
|
+
content: "Two-Factor Authentication"
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
{
|
|
275
|
+
type: "element:text",
|
|
276
|
+
properties: {
|
|
277
|
+
variant: "caption",
|
|
278
|
+
content: "Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device."
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
type: "record:quick_actions",
|
|
283
|
+
properties: {
|
|
284
|
+
location: "record_section",
|
|
285
|
+
align: "start",
|
|
286
|
+
actionNames: ["enable_two_factor", "disable_two_factor", "generate_backup_codes"]
|
|
287
|
+
}
|
|
288
|
+
},
|
|
289
|
+
{ type: "element:divider" },
|
|
290
|
+
{
|
|
291
|
+
type: "element:text",
|
|
292
|
+
properties: {
|
|
293
|
+
variant: "subheading",
|
|
294
|
+
content: "Email Verification"
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
type: "element:text",
|
|
299
|
+
properties: {
|
|
300
|
+
variant: "caption",
|
|
301
|
+
content: "Verify your email so password resets and notifications reach you. The button appears only while verification is pending."
|
|
302
|
+
}
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
type: "record:quick_actions",
|
|
306
|
+
properties: {
|
|
307
|
+
location: "record_section",
|
|
308
|
+
align: "start",
|
|
309
|
+
actionNames: ["resend_verification_email"]
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
{ type: "element:divider" },
|
|
313
|
+
{
|
|
314
|
+
type: "element:text",
|
|
315
|
+
properties: {
|
|
316
|
+
variant: "subheading",
|
|
317
|
+
content: "Danger Zone"
|
|
318
|
+
},
|
|
319
|
+
className: "text-destructive"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
type: "element:text",
|
|
323
|
+
properties: {
|
|
324
|
+
variant: "caption",
|
|
325
|
+
content: "Permanent. Once deleted, your account cannot be recovered."
|
|
326
|
+
}
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
type: "record:quick_actions",
|
|
330
|
+
properties: {
|
|
331
|
+
location: "record_section",
|
|
332
|
+
align: "start",
|
|
333
|
+
actionNames: ["delete_my_account"]
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
// ── API Keys ──────────────────────────────────────────────
|
|
339
|
+
// Programmatic credentials issued for this user. Filtered by
|
|
340
|
+
// user_id FK; the sys_api_key object's own list-item actions
|
|
341
|
+
// (revoke / restore) handle row operations.
|
|
342
|
+
{
|
|
343
|
+
label: "API Keys",
|
|
344
|
+
icon: "key-round",
|
|
345
|
+
children: [
|
|
346
|
+
{
|
|
347
|
+
type: "record:related_list",
|
|
348
|
+
properties: {
|
|
349
|
+
objectName: "sys_api_key",
|
|
350
|
+
relationshipField: "user_id",
|
|
351
|
+
columns: ["name", "prefix", "expires_at", "revoked", "created_at"],
|
|
352
|
+
sort: [{ field: "created_at", order: "desc" }],
|
|
353
|
+
limit: 25,
|
|
354
|
+
showViewAll: true,
|
|
355
|
+
title: "API Keys"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
]
|
|
359
|
+
}
|
|
360
|
+
]
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
// ── Suppress the Discussion / Chatter thread ──────────────────
|
|
364
|
+
discussion: []
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
exports.SysOrganizationDetailPage = SysOrganizationDetailPage;
|
|
369
|
+
exports.SysUserDetailPage = SysUserDetailPage;
|
|
370
|
+
//# sourceMappingURL=index.js.map
|
|
371
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/pages/sys-organization.page.ts","../../src/pages/sys-user.page.ts"],"names":[],"mappings":";;;AAiCO,IAAM,yBAAA,GAAkC;AAAA,EAC7C,IAAA,EAAM,yBAAA;AAAA,EACN,KAAA,EAAO,cAAA;AAAA,EACP,IAAA,EAAM,QAAA;AAAA,EACN,MAAA,EAAQ,kBAAA;AAAA,EACR,QAAA,EAAU,SAAA;AAAA,EACV,IAAA,EAAM,SAAA;AAAA,EACN,SAAA,EAAW,IAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKX,SAAS,EAAC;AAAA,EACV,KAAA,EAAO;AAAA,IACL,IAAA,EAAM;AAAA,MACJ,IAAA,EAAM,WAAA;AAAA,MACN,UAAA,EAAY;AAAA,QACV,IA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S,CAAC,MAAA,EAAQ,QAAA,EAAU,YAAA,EAAc,WAAW,YAAY,CAAA;AAAA,kBACjE,MAAM,CAAC,EAAE,OAAO,YAAA,EAAc,KAAA,EAAO,QAAQ,CAAA;AAAA,kBAC7C,KAAA,EAAO,EAAA;AAAA,kBACP,WAAA,EAAa,IAAA;AAAA,kBACb,KAAA,EAAO;AAAA;AACT;AACF;AACF;AACF;AACF;AACF,KACF;AAAA;AAAA,IAGA,YAAY;AAAC;AAEjB","file":"index.js","sourcesContent":["// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_organization — Record Detail Page (slotted)\n *\n * Adds Members / Invitations / Teams tabs to the organization detail\n * page so an admin can manage the membership graph from a single place\n * instead of switching between three separate Setup list views.\n *\n * The page is `kind: 'slotted'` and overrides only the `tabs` slot —\n * header, actions, highlights, details and discussion fall through to\n * the synthesized default, so the organization's own fields and the\n * existing record-header actions (Set Active, Edit, Delete, Leave) are\n * preserved.\n *\n * Each tab is a `record:related_list` over a child object that already\n * has `organization_id` as a `Field.lookup('sys_organization')` — the\n * renderer scopes the list to the current organization automatically\n * (the related-list runtime uses the parent record id from the page\n * context as the filter value for `relationshipField`). The per-row\n * actions defined on each child object (invite_user, cancel_invitation,\n * remove_member, transfer_ownership, create_team, …) are inherited\n * unchanged — no admin endpoint has to be re-declared here.\n *\n * Notable omissions:\n * - **OAuth Apps**: `sys_oauth_application` is owned by `user_id`, not\n * `organization_id`. They surface on the user's Account → Developer\n * section instead of the org detail.\n * - **SSO**: no `sys_sso*` object exists yet. When the SSO plugin lands,\n * add a fourth tab here.\n */\nexport const SysOrganizationDetailPage: Page = {\n name: 'sys_organization_detail',\n label: 'Organization',\n type: 'record',\n object: 'sys_organization',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n // `regions` is required by the Page schema even for slotted pages —\n // empty array lets the synthesizer fill in header/details/discussion\n // while the `slots.tabs` override below replaces the synthesized\n // tabs strip.\n regions: [],\n slots: {\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Members',\n icon: 'users',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'organization_id',\n columns: ['user_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Members',\n },\n },\n ],\n },\n {\n label: 'Invitations',\n icon: 'mail',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_invitation',\n relationshipField: 'organization_id',\n columns: ['email', 'role', 'status', 'expires_at', 'inviter_id'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Invitations',\n },\n },\n ],\n },\n {\n label: 'Teams',\n icon: 'users-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_team',\n relationshipField: 'organization_id',\n columns: ['name', 'created_at', 'updated_at'],\n sort: [{ field: 'name', order: 'asc' }],\n limit: 25,\n showViewAll: true,\n title: 'Teams',\n },\n },\n ],\n },\n ],\n },\n },\n },\n};\n","// Copyright (c) 2025 ObjectStack. Licensed under the Apache-2.0 license.\n\nimport type { Page } from '@objectstack/spec/ui';\n\n/**\n * sys_user — Record Detail Page (slotted, default for ALL sys_user records)\n *\n * Tailors the synthesized admin form into a layout that works for both:\n * • the end user landing on their own profile from the Account App, and\n * • an admin opening someone else's user record from Setup.\n *\n * Strategy\n * --------\n * - `kind: 'slotted'` + `isDefault: true`: overrides `highlights`,\n * `details`, `tabs` and `discussion`. Header / actions fall through\n * to the synthesizer so the object's declared actions\n * (`update_my_profile / change_my_password / resend_verification_email\n * / ban_user / set_user_role / impersonate_user / …`) still appear\n * in the header overflow menu automatically.\n * - `highlights` promotes the four signals worth scanning at the top:\n * email, verification state, 2FA, platform role. Highlight fields\n * are auto-dropped from the details grid below.\n * - `details` re-groups remaining fields into sections and hides\n * admin-internal audit columns. Banned / ban metadata is still\n * editable from the header actions — we just don't show it in\n * every user's body.\n * - `tabs` is **explicitly curated** to the 4 related lists that matter\n * on a user profile (Sessions / Linked Accounts / Organizations /\n * Personal OAuth Apps). Without this override, the synthesizer\n * auto-generates a tab per object that has a FK to sys_user\n * (sys_role.created_by, sys_email.updated_by, sys_user_preference,\n * sys_email_template.created_by, …) producing dozens of noisy\n * \"查看全部\" cards on every profile.\n * - `discussion: []` removes the Chatter feed — it has no business\n * on a personal profile.\n */\nexport const SysUserDetailPage: Page = {\n name: 'sys_user_detail',\n label: 'User',\n type: 'record',\n object: 'sys_user',\n template: 'default',\n kind: 'slotted',\n isDefault: true,\n\n regions: [],\n\n slots: {\n // ── Alert banners ─────────────────────────────────────────────\n // Conditional notices rendered between the page header and the\n // highlight strip. The unverified-email banner only shows for the\n // current user viewing their own profile (admins looking at other\n // users see nothing — they can use Setup actions instead).\n alerts: [\n {\n type: 'record:alert',\n properties: {\n severity: 'warning',\n icon: 'mail',\n title: '邮箱未验证',\n body: '验证你的邮箱以接收密码重置和重要的系统通知。',\n visible: 'record.id == ctx.user.id && record.email_verified == false',\n dismissible: false,\n action: {\n actionName: 'resend_verification_email',\n label: '重新发送验证邮件',\n },\n },\n },\n ],\n\n // ── Highlight chips above the fold ────────────────────────────\n highlights: {\n type: 'record:highlights',\n properties: {\n fields: ['email', 'email_verified', 'two_factor_enabled', 'role'],\n },\n },\n\n // ── Body / details grid ───────────────────────────────────────\n details: {\n type: 'record:details',\n properties: {\n hideFields: [\n 'id',\n 'banned',\n 'ban_reason',\n 'ban_expires',\n // already promoted to highlights:\n 'email',\n 'email_verified',\n 'two_factor_enabled',\n 'role',\n ],\n sections: [\n {\n label: 'Identity',\n fields: ['name', 'image'],\n },\n {\n label: 'Audit',\n fields: ['created_at', 'updated_at'],\n },\n ],\n },\n },\n\n // ── Tabs: curated related lists ───────────────────────────────\n // Only the 4 lists that are semantically about THIS user account.\n // Everything else (sys_role created_by, sys_email_template\n // updated_by, …) is incidental authorship metadata and would only\n // create noise.\n tabs: {\n type: 'page:tabs',\n properties: {\n type: 'line',\n position: 'top',\n items: [\n {\n label: 'Sessions',\n icon: 'monitor',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_session',\n relationshipField: 'user_id',\n columns: ['user_agent', 'ip_address', 'created_at', 'expires_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Sessions',\n },\n },\n ],\n },\n {\n label: 'Linked Accounts',\n icon: 'link',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_account',\n relationshipField: 'user_id',\n columns: ['provider_id', 'account_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Linked Accounts',\n },\n },\n ],\n },\n {\n label: 'Organizations',\n icon: 'building-2',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_member',\n relationshipField: 'user_id',\n columns: ['organization_id', 'role', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'Organizations',\n },\n },\n ],\n },\n {\n label: 'OAuth Apps',\n icon: 'key-square',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_oauth_application',\n relationshipField: 'user_id',\n columns: ['name', 'client_id', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'OAuth Apps',\n },\n },\n ],\n },\n // ── Security ──────────────────────────────────────────────\n // Grouped self-service security controls. Each `record:quick_actions`\n // pulls its actions by name from the sys_user object metadata\n // (DRY — definitions stay on the object) and filters by\n // `location: 'record_section'` so they only render here, not\n // in the global header row.\n {\n label: 'Security',\n icon: 'shield',\n children: [\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Password & Sign-in',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Change your password or the email address associated with this account.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['change_my_password', 'change_my_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Two-Factor Authentication',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['enable_two_factor', 'disable_two_factor', 'generate_backup_codes'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Email Verification',\n },\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Verify your email so password resets and notifications reach you. The button appears only while verification is pending.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['resend_verification_email'],\n },\n },\n { type: 'element:divider' },\n {\n type: 'element:text',\n properties: {\n variant: 'subheading',\n content: 'Danger Zone',\n },\n className: 'text-destructive',\n },\n {\n type: 'element:text',\n properties: {\n variant: 'caption',\n content: 'Permanent. Once deleted, your account cannot be recovered.',\n },\n },\n {\n type: 'record:quick_actions',\n properties: {\n location: 'record_section',\n align: 'start',\n actionNames: ['delete_my_account'],\n },\n },\n ],\n },\n // ── API Keys ──────────────────────────────────────────────\n // Programmatic credentials issued for this user. Filtered by\n // user_id FK; the sys_api_key object's own list-item actions\n // (revoke / restore) handle row operations.\n {\n label: 'API Keys',\n icon: 'key-round',\n children: [\n {\n type: 'record:related_list',\n properties: {\n objectName: 'sys_api_key',\n relationshipField: 'user_id',\n columns: ['name', 'prefix', 'expires_at', 'revoked', 'created_at'],\n sort: [{ field: 'created_at', order: 'desc' }],\n limit: 25,\n showViewAll: true,\n title: 'API Keys',\n },\n },\n ],\n },\n ],\n },\n },\n\n // ── Suppress the Discussion / Chatter thread ──────────────────\n discussion: [],\n },\n};\n"]}
|