@objectstack/platform-objects 6.9.0 → 7.1.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.
Files changed (51) hide show
  1. package/dist/apps/index.d.mts +30 -1
  2. package/dist/apps/index.d.ts +30 -1
  3. package/dist/apps/index.js +987 -37
  4. package/dist/apps/index.js.map +1 -1
  5. package/dist/apps/index.mjs +987 -38
  6. package/dist/apps/index.mjs.map +1 -1
  7. package/dist/audit/index.d.mts +240 -64
  8. package/dist/audit/index.d.ts +240 -64
  9. package/dist/identity/index.d.mts +900 -82
  10. package/dist/identity/index.d.ts +900 -82
  11. package/dist/identity/index.js +384 -8
  12. package/dist/identity/index.js.map +1 -1
  13. package/dist/identity/index.mjs +384 -8
  14. package/dist/identity/index.mjs.map +1 -1
  15. package/dist/index.d.mts +4 -1
  16. package/dist/index.d.ts +4 -1
  17. package/dist/index.js +6823 -99
  18. package/dist/index.js.map +1 -1
  19. package/dist/index.mjs +6818 -100
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/integration/index.d.mts +15 -4
  22. package/dist/integration/index.d.ts +15 -4
  23. package/dist/metadata/index.d.mts +30 -8
  24. package/dist/metadata/index.d.ts +30 -8
  25. package/dist/metadata-translations/index.d.mts +20 -0
  26. package/dist/metadata-translations/index.d.ts +20 -0
  27. package/dist/metadata-translations/index.js +4777 -0
  28. package/dist/metadata-translations/index.js.map +1 -0
  29. package/dist/metadata-translations/index.mjs +4775 -0
  30. package/dist/metadata-translations/index.mjs.map +1 -0
  31. package/dist/pages/index.d.mts +73 -0
  32. package/dist/pages/index.d.ts +73 -0
  33. package/dist/pages/index.js +371 -0
  34. package/dist/pages/index.js.map +1 -0
  35. package/dist/pages/index.mjs +368 -0
  36. package/dist/pages/index.mjs.map +1 -0
  37. package/dist/plugin.d.mts +35 -0
  38. package/dist/plugin.d.ts +35 -0
  39. package/dist/plugin.js +17562 -0
  40. package/dist/plugin.js.map +1 -0
  41. package/dist/plugin.mjs +17559 -0
  42. package/dist/plugin.mjs.map +1 -0
  43. package/dist/security/index.d.mts +806 -204
  44. package/dist/security/index.d.ts +806 -204
  45. package/dist/security/index.js +208 -1
  46. package/dist/security/index.js.map +1 -1
  47. package/dist/security/index.mjs +208 -1
  48. package/dist/security/index.mjs.map +1 -1
  49. package/dist/system/index.d.mts +45 -12
  50. package/dist/system/index.d.ts +45 -12
  51. package/package.json +17 -2
@@ -0,0 +1,368 @@
1
+ // src/pages/sys-organization.page.ts
2
+ var SysOrganizationDetailPage = {
3
+ name: "sys_organization_detail",
4
+ label: "Organization",
5
+ type: "record",
6
+ object: "sys_organization",
7
+ template: "default",
8
+ kind: "slotted",
9
+ isDefault: true,
10
+ // `regions` is required by the Page schema even for slotted pages —
11
+ // empty array lets the synthesizer fill in header/details/discussion
12
+ // while the `slots.tabs` override below replaces the synthesized
13
+ // tabs strip.
14
+ regions: [],
15
+ slots: {
16
+ tabs: {
17
+ type: "page:tabs",
18
+ properties: {
19
+ type: "line",
20
+ position: "top",
21
+ items: [
22
+ {
23
+ label: "Members",
24
+ icon: "users",
25
+ children: [
26
+ {
27
+ type: "record:related_list",
28
+ properties: {
29
+ objectName: "sys_member",
30
+ relationshipField: "organization_id",
31
+ columns: ["user_id", "role", "created_at"],
32
+ sort: [{ field: "created_at", order: "desc" }],
33
+ limit: 25,
34
+ showViewAll: true,
35
+ title: "Members"
36
+ }
37
+ }
38
+ ]
39
+ },
40
+ {
41
+ label: "Invitations",
42
+ icon: "mail",
43
+ children: [
44
+ {
45
+ type: "record:related_list",
46
+ properties: {
47
+ objectName: "sys_invitation",
48
+ relationshipField: "organization_id",
49
+ columns: ["email", "role", "status", "expires_at", "inviter_id"],
50
+ sort: [{ field: "created_at", order: "desc" }],
51
+ limit: 25,
52
+ showViewAll: true,
53
+ title: "Invitations"
54
+ }
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ label: "Teams",
60
+ icon: "users-round",
61
+ children: [
62
+ {
63
+ type: "record:related_list",
64
+ properties: {
65
+ objectName: "sys_team",
66
+ relationshipField: "organization_id",
67
+ columns: ["name", "created_at", "updated_at"],
68
+ sort: [{ field: "name", order: "asc" }],
69
+ limit: 25,
70
+ showViewAll: true,
71
+ title: "Teams"
72
+ }
73
+ }
74
+ ]
75
+ }
76
+ ]
77
+ }
78
+ }
79
+ }
80
+ };
81
+
82
+ // src/pages/sys-user.page.ts
83
+ var SysUserDetailPage = {
84
+ name: "sys_user_detail",
85
+ label: "User",
86
+ type: "record",
87
+ object: "sys_user",
88
+ template: "default",
89
+ kind: "slotted",
90
+ isDefault: true,
91
+ regions: [],
92
+ slots: {
93
+ // ── Alert banners ─────────────────────────────────────────────
94
+ // Conditional notices rendered between the page header and the
95
+ // highlight strip. The unverified-email banner only shows for the
96
+ // current user viewing their own profile (admins looking at other
97
+ // users see nothing — they can use Setup actions instead).
98
+ alerts: [
99
+ {
100
+ type: "record:alert",
101
+ properties: {
102
+ severity: "warning",
103
+ icon: "mail",
104
+ title: "\u90AE\u7BB1\u672A\u9A8C\u8BC1",
105
+ body: "\u9A8C\u8BC1\u4F60\u7684\u90AE\u7BB1\u4EE5\u63A5\u6536\u5BC6\u7801\u91CD\u7F6E\u548C\u91CD\u8981\u7684\u7CFB\u7EDF\u901A\u77E5\u3002",
106
+ visible: "record.id == ctx.user.id && record.email_verified == false",
107
+ dismissible: false,
108
+ action: {
109
+ actionName: "resend_verification_email",
110
+ label: "\u91CD\u65B0\u53D1\u9001\u9A8C\u8BC1\u90AE\u4EF6"
111
+ }
112
+ }
113
+ }
114
+ ],
115
+ // ── Highlight chips above the fold ────────────────────────────
116
+ highlights: {
117
+ type: "record:highlights",
118
+ properties: {
119
+ fields: ["email", "email_verified", "two_factor_enabled", "role"]
120
+ }
121
+ },
122
+ // ── Body / details grid ───────────────────────────────────────
123
+ details: {
124
+ type: "record:details",
125
+ properties: {
126
+ hideFields: [
127
+ "id",
128
+ "banned",
129
+ "ban_reason",
130
+ "ban_expires",
131
+ // already promoted to highlights:
132
+ "email",
133
+ "email_verified",
134
+ "two_factor_enabled",
135
+ "role"
136
+ ],
137
+ sections: [
138
+ {
139
+ label: "Identity",
140
+ fields: ["name", "image"]
141
+ },
142
+ {
143
+ label: "Audit",
144
+ fields: ["created_at", "updated_at"]
145
+ }
146
+ ]
147
+ }
148
+ },
149
+ // ── Tabs: curated related lists ───────────────────────────────
150
+ // Only the 4 lists that are semantically about THIS user account.
151
+ // Everything else (sys_role created_by, sys_email_template
152
+ // updated_by, …) is incidental authorship metadata and would only
153
+ // create noise.
154
+ tabs: {
155
+ type: "page:tabs",
156
+ properties: {
157
+ type: "line",
158
+ position: "top",
159
+ items: [
160
+ {
161
+ label: "Sessions",
162
+ icon: "monitor",
163
+ children: [
164
+ {
165
+ type: "record:related_list",
166
+ properties: {
167
+ objectName: "sys_session",
168
+ relationshipField: "user_id",
169
+ columns: ["user_agent", "ip_address", "created_at", "expires_at"],
170
+ sort: [{ field: "created_at", order: "desc" }],
171
+ limit: 25,
172
+ showViewAll: true,
173
+ title: "Sessions"
174
+ }
175
+ }
176
+ ]
177
+ },
178
+ {
179
+ label: "Linked Accounts",
180
+ icon: "link",
181
+ children: [
182
+ {
183
+ type: "record:related_list",
184
+ properties: {
185
+ objectName: "sys_account",
186
+ relationshipField: "user_id",
187
+ columns: ["provider_id", "account_id", "created_at"],
188
+ sort: [{ field: "created_at", order: "desc" }],
189
+ limit: 25,
190
+ showViewAll: true,
191
+ title: "Linked Accounts"
192
+ }
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ label: "Organizations",
198
+ icon: "building-2",
199
+ children: [
200
+ {
201
+ type: "record:related_list",
202
+ properties: {
203
+ objectName: "sys_member",
204
+ relationshipField: "user_id",
205
+ columns: ["organization_id", "role", "created_at"],
206
+ sort: [{ field: "created_at", order: "desc" }],
207
+ limit: 25,
208
+ showViewAll: true,
209
+ title: "Organizations"
210
+ }
211
+ }
212
+ ]
213
+ },
214
+ {
215
+ label: "OAuth Apps",
216
+ icon: "key-square",
217
+ children: [
218
+ {
219
+ type: "record:related_list",
220
+ properties: {
221
+ objectName: "sys_oauth_application",
222
+ relationshipField: "user_id",
223
+ columns: ["name", "client_id", "created_at"],
224
+ sort: [{ field: "created_at", order: "desc" }],
225
+ limit: 25,
226
+ showViewAll: true,
227
+ title: "OAuth Apps"
228
+ }
229
+ }
230
+ ]
231
+ },
232
+ // ── Security ──────────────────────────────────────────────
233
+ // Grouped self-service security controls. Each `record:quick_actions`
234
+ // pulls its actions by name from the sys_user object metadata
235
+ // (DRY — definitions stay on the object) and filters by
236
+ // `location: 'record_section'` so they only render here, not
237
+ // in the global header row.
238
+ {
239
+ label: "Security",
240
+ icon: "shield",
241
+ children: [
242
+ {
243
+ type: "element:text",
244
+ properties: {
245
+ variant: "subheading",
246
+ content: "Password & Sign-in"
247
+ }
248
+ },
249
+ {
250
+ type: "element:text",
251
+ properties: {
252
+ variant: "caption",
253
+ content: "Change your password or the email address associated with this account."
254
+ }
255
+ },
256
+ {
257
+ type: "record:quick_actions",
258
+ properties: {
259
+ location: "record_section",
260
+ align: "start",
261
+ actionNames: ["change_my_password", "change_my_email"]
262
+ }
263
+ },
264
+ { type: "element:divider" },
265
+ {
266
+ type: "element:text",
267
+ properties: {
268
+ variant: "subheading",
269
+ content: "Two-Factor Authentication"
270
+ }
271
+ },
272
+ {
273
+ type: "element:text",
274
+ properties: {
275
+ variant: "caption",
276
+ content: "Add a second layer of security using a TOTP authenticator app. Backup codes let you sign in if you lose your device."
277
+ }
278
+ },
279
+ {
280
+ type: "record:quick_actions",
281
+ properties: {
282
+ location: "record_section",
283
+ align: "start",
284
+ actionNames: ["enable_two_factor", "disable_two_factor", "generate_backup_codes"]
285
+ }
286
+ },
287
+ { type: "element:divider" },
288
+ {
289
+ type: "element:text",
290
+ properties: {
291
+ variant: "subheading",
292
+ content: "Email Verification"
293
+ }
294
+ },
295
+ {
296
+ type: "element:text",
297
+ properties: {
298
+ variant: "caption",
299
+ content: "Verify your email so password resets and notifications reach you. The button appears only while verification is pending."
300
+ }
301
+ },
302
+ {
303
+ type: "record:quick_actions",
304
+ properties: {
305
+ location: "record_section",
306
+ align: "start",
307
+ actionNames: ["resend_verification_email"]
308
+ }
309
+ },
310
+ { type: "element:divider" },
311
+ {
312
+ type: "element:text",
313
+ properties: {
314
+ variant: "subheading",
315
+ content: "Danger Zone"
316
+ },
317
+ className: "text-destructive"
318
+ },
319
+ {
320
+ type: "element:text",
321
+ properties: {
322
+ variant: "caption",
323
+ content: "Permanent. Once deleted, your account cannot be recovered."
324
+ }
325
+ },
326
+ {
327
+ type: "record:quick_actions",
328
+ properties: {
329
+ location: "record_section",
330
+ align: "start",
331
+ actionNames: ["delete_my_account"]
332
+ }
333
+ }
334
+ ]
335
+ },
336
+ // ── API Keys ──────────────────────────────────────────────
337
+ // Programmatic credentials issued for this user. Filtered by
338
+ // user_id FK; the sys_api_key object's own list-item actions
339
+ // (revoke / restore) handle row operations.
340
+ {
341
+ label: "API Keys",
342
+ icon: "key-round",
343
+ children: [
344
+ {
345
+ type: "record:related_list",
346
+ properties: {
347
+ objectName: "sys_api_key",
348
+ relationshipField: "user_id",
349
+ columns: ["name", "prefix", "expires_at", "revoked", "created_at"],
350
+ sort: [{ field: "created_at", order: "desc" }],
351
+ limit: 25,
352
+ showViewAll: true,
353
+ title: "API Keys"
354
+ }
355
+ }
356
+ ]
357
+ }
358
+ ]
359
+ }
360
+ },
361
+ // ── Suppress the Discussion / Chatter thread ──────────────────
362
+ discussion: []
363
+ }
364
+ };
365
+
366
+ export { SysOrganizationDetailPage, SysUserDetailPage };
367
+ //# sourceMappingURL=index.mjs.map
368
+ //# sourceMappingURL=index.mjs.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,QA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nC;AACF;AACF,WACF;AAAA;AAAA;AAAA;AAAA;AAAA,UAKA;AAAA,YACE,KAAA,EAAO,UAAA;AAAA,YACP,IAAA,EAAM,WAAA;AAAA,YACN,QAAA,EAAU;AAAA,cACR;AAAA,gBACE,IAAA,EAAM,qBAAA;AAAA,gBACN,UAAA,EAAY;AAAA,kBACV,UAAA,EAAY,aAAA;AAAA,kBACZ,iBAAA,EAAmB,SAAA;AAAA,kBACnB,SAAS,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.mjs","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 * **Audience**: admins browsing user records from Setup.\n *\n * The Account App's \"Profile\" entry no longer routes here — it points at\n * the `account:profile_card` Console component for a settings-form-style\n * personal profile. This page therefore optimizes for the admin\n * use case: scanning a user's signals (email/verification/2FA/role),\n * reviewing related sessions/orgs/oauth/api-keys, and triggering\n * admin actions (ban / impersonate / set_role).\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"]}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `PlatformObjectsPlugin`
3
+ *
4
+ * Owns the runtime contribution of platform-default translation bundles
5
+ * into the kernel's i18n service. Replaces the historical detour of
6
+ * piggy-backing on `plugin-auth` to load these bundles — translations
7
+ * belong with the package that defines them.
8
+ *
9
+ * Loaded on `kernel:ready` so the i18n service plugin (which may register
10
+ * later than ordinary services) is guaranteed to be present.
11
+ *
12
+ * Bundles contributed:
13
+ * - `SetupAppTranslations` — the static Setup App + sys_* dashboards.
14
+ * - `MetadataFormsTranslations` — `metadataForms.*` for object/field/
15
+ * agent/flow/view configuration forms.
16
+ *
17
+ * Gracefully degrades when no i18n service is registered (e.g. lean
18
+ * test / MSW kernels): the UI then falls back to the inline literals
19
+ * carried on each App / Dashboard / `*.form.ts` schema.
20
+ *
21
+ * Structurally typed against `@objectstack/core`'s `Plugin` contract so
22
+ * this package does not need to depend on the kernel at compile time.
23
+ */
24
+ declare class PlatformObjectsPlugin {
25
+ readonly name = "com.objectstack.platform-objects";
26
+ readonly type = "standard";
27
+ readonly version = "1.0.0";
28
+ readonly dependencies: string[];
29
+ init(_ctx: any): Promise<void>;
30
+ start(ctx: any): Promise<void>;
31
+ }
32
+ /** Convenience factory mirroring the rest of the plugin ecosystem. */
33
+ declare function createPlatformObjectsPlugin(): PlatformObjectsPlugin;
34
+
35
+ export { PlatformObjectsPlugin, createPlatformObjectsPlugin };
@@ -0,0 +1,35 @@
1
+ /**
2
+ * `PlatformObjectsPlugin`
3
+ *
4
+ * Owns the runtime contribution of platform-default translation bundles
5
+ * into the kernel's i18n service. Replaces the historical detour of
6
+ * piggy-backing on `plugin-auth` to load these bundles — translations
7
+ * belong with the package that defines them.
8
+ *
9
+ * Loaded on `kernel:ready` so the i18n service plugin (which may register
10
+ * later than ordinary services) is guaranteed to be present.
11
+ *
12
+ * Bundles contributed:
13
+ * - `SetupAppTranslations` — the static Setup App + sys_* dashboards.
14
+ * - `MetadataFormsTranslations` — `metadataForms.*` for object/field/
15
+ * agent/flow/view configuration forms.
16
+ *
17
+ * Gracefully degrades when no i18n service is registered (e.g. lean
18
+ * test / MSW kernels): the UI then falls back to the inline literals
19
+ * carried on each App / Dashboard / `*.form.ts` schema.
20
+ *
21
+ * Structurally typed against `@objectstack/core`'s `Plugin` contract so
22
+ * this package does not need to depend on the kernel at compile time.
23
+ */
24
+ declare class PlatformObjectsPlugin {
25
+ readonly name = "com.objectstack.platform-objects";
26
+ readonly type = "standard";
27
+ readonly version = "1.0.0";
28
+ readonly dependencies: string[];
29
+ init(_ctx: any): Promise<void>;
30
+ start(ctx: any): Promise<void>;
31
+ }
32
+ /** Convenience factory mirroring the rest of the plugin ecosystem. */
33
+ declare function createPlatformObjectsPlugin(): PlatformObjectsPlugin;
34
+
35
+ export { PlatformObjectsPlugin, createPlatformObjectsPlugin };