@objectstack/platform-objects 7.2.0 → 7.2.1

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/index.mjs CHANGED
@@ -10,9 +10,12 @@ var SysUser = ObjectSchema.create({
10
10
  icon: "user",
11
11
  isSystem: true,
12
12
  managedBy: "better-auth",
13
- // ADR-0010 — identity table is managed by better-auth, schema must not drift.
14
- _lock: "full",
15
- _lockReason: "Identity table managed by better-auth \u2014 see ADR-0010.",
13
+ // ADR-0010 §3.7 — identity table is managed by better-auth; schema must not drift.
14
+ protection: {
15
+ lock: "full",
16
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
17
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
18
+ },
16
19
  description: "User accounts for authentication",
17
20
  displayNameField: "name",
18
21
  titleFormat: "{name}",
@@ -425,6 +428,14 @@ var SysSession = ObjectSchema.create({
425
428
  icon: "key",
426
429
  isSystem: true,
427
430
  managedBy: "better-auth",
431
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
432
+ // but may add overlay row-level config. Use `no-overlay` if you need to
433
+ // forbid sys_metadata overlays entirely.
434
+ protection: {
435
+ lock: "full",
436
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
437
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
438
+ },
428
439
  description: "Active user sessions",
429
440
  displayNameField: "user_id",
430
441
  titleFormat: "Session \u2014 {user_id}",
@@ -580,6 +591,14 @@ var SysAccount = ObjectSchema.create({
580
591
  icon: "link",
581
592
  isSystem: true,
582
593
  managedBy: "better-auth",
594
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
595
+ // but may add overlay row-level config. Use `no-overlay` if you need to
596
+ // forbid sys_metadata overlays entirely.
597
+ protection: {
598
+ lock: "full",
599
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
600
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
601
+ },
583
602
  description: "OAuth and authentication provider accounts",
584
603
  titleFormat: "{provider_id} - {account_id}",
585
604
  compactLayout: ["provider_id", "user_id", "account_id"],
@@ -753,6 +772,14 @@ var SysVerification = ObjectSchema.create({
753
772
  icon: "shield-check",
754
773
  isSystem: true,
755
774
  managedBy: "better-auth",
775
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
776
+ // but may add overlay row-level config. Use `no-overlay` if you need to
777
+ // forbid sys_metadata overlays entirely.
778
+ protection: {
779
+ lock: "full",
780
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
781
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
782
+ },
756
783
  description: "Email and phone verification tokens",
757
784
  titleFormat: "Verification for {identifier}",
758
785
  compactLayout: ["identifier", "expires_at", "created_at"],
@@ -808,6 +835,14 @@ var SysOrganization = ObjectSchema.create({
808
835
  icon: "building-2",
809
836
  isSystem: true,
810
837
  managedBy: "better-auth",
838
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
839
+ // but may add overlay row-level config. Use `no-overlay` if you need to
840
+ // forbid sys_metadata overlays entirely.
841
+ protection: {
842
+ lock: "full",
843
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
844
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
845
+ },
811
846
  description: "Organizations for multi-tenant grouping",
812
847
  displayNameField: "name",
813
848
  titleFormat: "{name}",
@@ -1010,6 +1045,14 @@ var SysMember = ObjectSchema.create({
1010
1045
  icon: "user-check",
1011
1046
  isSystem: true,
1012
1047
  managedBy: "better-auth",
1048
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1049
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1050
+ // forbid sys_metadata overlays entirely.
1051
+ protection: {
1052
+ lock: "full",
1053
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1054
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1055
+ },
1013
1056
  description: "Organization membership records",
1014
1057
  titleFormat: "{user_id} in {organization_id}",
1015
1058
  compactLayout: ["user_id", "organization_id", "role"],
@@ -1159,6 +1202,14 @@ var SysInvitation = ObjectSchema.create({
1159
1202
  icon: "mail",
1160
1203
  isSystem: true,
1161
1204
  managedBy: "better-auth",
1205
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1206
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1207
+ // forbid sys_metadata overlays entirely.
1208
+ protection: {
1209
+ lock: "full",
1210
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1211
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1212
+ },
1162
1213
  description: "Organization invitations for user onboarding",
1163
1214
  titleFormat: "Invitation to {organization_id}",
1164
1215
  compactLayout: ["email", "organization_id", "status"],
@@ -1359,6 +1410,14 @@ var SysTeam = ObjectSchema.create({
1359
1410
  icon: "users",
1360
1411
  isSystem: true,
1361
1412
  managedBy: "better-auth",
1413
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1414
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1415
+ // forbid sys_metadata overlays entirely.
1416
+ protection: {
1417
+ lock: "full",
1418
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1419
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1420
+ },
1362
1421
  description: "Teams within organizations for fine-grained grouping",
1363
1422
  displayNameField: "name",
1364
1423
  titleFormat: "{name}",
@@ -1496,6 +1555,14 @@ var SysTeamMember = ObjectSchema.create({
1496
1555
  icon: "user-plus",
1497
1556
  isSystem: true,
1498
1557
  managedBy: "better-auth",
1558
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1559
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1560
+ // forbid sys_metadata overlays entirely.
1561
+ protection: {
1562
+ lock: "full",
1563
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1564
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1565
+ },
1499
1566
  description: "Team membership records linking users to teams",
1500
1567
  titleFormat: "{user_id} in {team_id}",
1501
1568
  compactLayout: ["user_id", "team_id", "created_at"],
@@ -1823,6 +1890,14 @@ var SysApiKey = ObjectSchema.create({
1823
1890
  icon: "key-round",
1824
1891
  isSystem: true,
1825
1892
  managedBy: "better-auth",
1893
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1894
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1895
+ // forbid sys_metadata overlays entirely.
1896
+ protection: {
1897
+ lock: "full",
1898
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1899
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1900
+ },
1826
1901
  description: "API keys for programmatic access",
1827
1902
  displayNameField: "name",
1828
1903
  titleFormat: "{name}",
@@ -2005,6 +2080,14 @@ var SysTwoFactor = ObjectSchema.create({
2005
2080
  icon: "smartphone",
2006
2081
  isSystem: true,
2007
2082
  managedBy: "better-auth",
2083
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2084
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2085
+ // forbid sys_metadata overlays entirely.
2086
+ protection: {
2087
+ lock: "full",
2088
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2089
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2090
+ },
2008
2091
  description: "Two-factor authentication credentials",
2009
2092
  titleFormat: "Two-factor for {user_id}",
2010
2093
  compactLayout: ["user_id", "created_at"],
@@ -2151,6 +2234,14 @@ var SysDeviceCode = ObjectSchema.create({
2151
2234
  icon: "key-round",
2152
2235
  isSystem: true,
2153
2236
  managedBy: "better-auth",
2237
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2238
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2239
+ // forbid sys_metadata overlays entirely.
2240
+ protection: {
2241
+ lock: "full",
2242
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2243
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2244
+ },
2154
2245
  description: "OAuth 2.0 Device Authorization Grant (RFC 8628) pending requests",
2155
2246
  titleFormat: "{user_code}",
2156
2247
  compactLayout: ["user_code", "status", "client_id", "expires_at"],
@@ -2330,6 +2421,14 @@ var SysOauthApplication = ObjectSchema.create({
2330
2421
  icon: "key-round",
2331
2422
  isSystem: true,
2332
2423
  managedBy: "better-auth",
2424
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2425
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2426
+ // forbid sys_metadata overlays entirely.
2427
+ protection: {
2428
+ lock: "full",
2429
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2430
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2431
+ },
2333
2432
  description: "Registered OAuth/OIDC client applications",
2334
2433
  displayNameField: "name",
2335
2434
  titleFormat: "{name}",
@@ -2724,6 +2823,14 @@ var SysOauthAccessToken = ObjectSchema.create({
2724
2823
  icon: "ticket",
2725
2824
  isSystem: true,
2726
2825
  managedBy: "better-auth",
2826
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2827
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2828
+ // forbid sys_metadata overlays entirely.
2829
+ protection: {
2830
+ lock: "full",
2831
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2832
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2833
+ },
2727
2834
  description: "Opaque OAuth access tokens issued to client applications",
2728
2835
  compactLayout: ["client_id", "user_id", "expires_at"],
2729
2836
  fields: {
@@ -2802,6 +2909,14 @@ var SysOauthRefreshToken = ObjectSchema.create({
2802
2909
  icon: "refresh-cw",
2803
2910
  isSystem: true,
2804
2911
  managedBy: "better-auth",
2912
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2913
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2914
+ // forbid sys_metadata overlays entirely.
2915
+ protection: {
2916
+ lock: "full",
2917
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2918
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2919
+ },
2805
2920
  description: "Opaque OAuth refresh tokens (linked to a session)",
2806
2921
  compactLayout: ["client_id", "user_id", "expires_at"],
2807
2922
  fields: {
@@ -2884,6 +2999,14 @@ var SysOauthConsent = ObjectSchema.create({
2884
2999
  icon: "shield-check",
2885
3000
  isSystem: true,
2886
3001
  managedBy: "better-auth",
3002
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
3003
+ // but may add overlay row-level config. Use `no-overlay` if you need to
3004
+ // forbid sys_metadata overlays entirely.
3005
+ protection: {
3006
+ lock: "full",
3007
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
3008
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3009
+ },
2887
3010
  description: "User consent records for OAuth client applications",
2888
3011
  compactLayout: ["client_id", "user_id", "scopes"],
2889
3012
  fields: {
@@ -2944,6 +3067,14 @@ var SysJwks = ObjectSchema.create({
2944
3067
  icon: "key",
2945
3068
  isSystem: true,
2946
3069
  managedBy: "better-auth",
3070
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
3071
+ // but may add overlay row-level config. Use `no-overlay` if you need to
3072
+ // forbid sys_metadata overlays entirely.
3073
+ protection: {
3074
+ lock: "full",
3075
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
3076
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3077
+ },
2947
3078
  description: "Asymmetric key pairs used to sign and verify issued JWTs",
2948
3079
  compactLayout: ["id", "created_at", "expires_at"],
2949
3080
  fields: {
@@ -2991,6 +3122,13 @@ var SysRole = ObjectSchema.create({
2991
3122
  icon: "shield",
2992
3123
  isSystem: true,
2993
3124
  managedBy: "config",
3125
+ // ADR-0010 §3.7 — RBAC primitive; tenants may add custom rows
3126
+ // (created via UI / API) but the schema itself is locked.
3127
+ protection: {
3128
+ lock: "no-overlay",
3129
+ reason: "RBAC schema is platform-defined \u2014 see ADR-0010.",
3130
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3131
+ },
2994
3132
  description: "Role definitions for RBAC access control",
2995
3133
  displayNameField: "label",
2996
3134
  titleFormat: "{label}",
@@ -3194,6 +3332,13 @@ var SysPermissionSet = ObjectSchema.create({
3194
3332
  icon: "lock",
3195
3333
  isSystem: true,
3196
3334
  managedBy: "config",
3335
+ // ADR-0010 §3.7 — RBAC primitive; tenants may add custom rows
3336
+ // (created via UI / API) but the schema itself is locked.
3337
+ protection: {
3338
+ lock: "no-overlay",
3339
+ reason: "RBAC schema is platform-defined \u2014 see ADR-0010.",
3340
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3341
+ },
3197
3342
  description: "Named permission groupings for fine-grained access control",
3198
3343
  displayNameField: "label",
3199
3344
  titleFormat: "{label}",
@@ -7447,9 +7592,13 @@ var SETUP_APP = {
7447
7592
  icon: "settings",
7448
7593
  active: true,
7449
7594
  isDefault: false,
7450
- // ADR-0010 — core admin UI must not be overlay-edited or deleted.
7451
- _lock: "full",
7452
- _lockReason: "Core admin UI shipped by @objectstack/platform-objects \u2014 see ADR-0010.",
7595
+ // ADR-0010 §3.7 author-facing protection block. Loader translates
7596
+ // this into the `_lock` envelope at registration time.
7597
+ protection: {
7598
+ lock: "full",
7599
+ reason: "Core admin UI shipped by @objectstack/platform-objects \u2014 see ADR-0010.",
7600
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
7601
+ },
7453
7602
  branding: {
7454
7603
  primaryColor: "#475569"
7455
7604
  // Slate-600 — neutral admin palette
@@ -7681,6 +7830,31 @@ var STUDIO_APP = {
7681
7830
  // Indigo-500 — distinct from Setup's slate
7682
7831
  },
7683
7832
  requiredPermissions: ["studio.access"],
7833
+ contextSelectors: [
7834
+ {
7835
+ // Package scope — pinned to the sidebar header. Selecting a package
7836
+ // injects `{active_package}` into every `metadata:resource` nav
7837
+ // item below, so the whole workbench filters to that package in
7838
+ // one click. Options come from the installed-packages REST surface,
7839
+ // narrowed to project-scoped packages: this dropdown exists so
7840
+ // third-party developers can scope to *their* custom package, so we
7841
+ // deliberately hide the platform's own system/cloud kernel packages
7842
+ // (auth, security, audit, queue, …) which are not user-authored.
7843
+ id: "active_package",
7844
+ label: "Package",
7845
+ icon: "package",
7846
+ optionsSource: {
7847
+ endpoint: "/api/v1/packages",
7848
+ valueKey: "manifest.id",
7849
+ labelKey: "manifest.name",
7850
+ filter: [{ key: "manifest.scope", op: "nin", value: ["system", "cloud"] }]
7851
+ },
7852
+ includeAll: true,
7853
+ allValue: "",
7854
+ persist: "query",
7855
+ placement: "sidebar_header"
7856
+ }
7857
+ ],
7684
7858
  navigation: [
7685
7859
  {
7686
7860
  id: "group_overview",
@@ -7711,7 +7885,7 @@ var STUDIO_APP = {
7711
7885
  type: "component",
7712
7886
  label: "Objects",
7713
7887
  componentRef: "metadata:resource",
7714
- params: { type: "object" },
7888
+ params: { type: "object", package: "{active_package}" },
7715
7889
  icon: "box"
7716
7890
  },
7717
7891
  {
@@ -7719,7 +7893,7 @@ var STUDIO_APP = {
7719
7893
  type: "component",
7720
7894
  label: "Validations",
7721
7895
  componentRef: "metadata:resource",
7722
- params: { type: "validation" },
7896
+ params: { type: "validation", package: "{active_package}" },
7723
7897
  icon: "check-square"
7724
7898
  }
7725
7899
  ]
@@ -7736,7 +7910,7 @@ var STUDIO_APP = {
7736
7910
  type: "component",
7737
7911
  label: "Apps",
7738
7912
  componentRef: "metadata:resource",
7739
- params: { type: "app" },
7913
+ params: { type: "app", package: "{active_package}" },
7740
7914
  icon: "app-window"
7741
7915
  },
7742
7916
  {
@@ -7744,7 +7918,7 @@ var STUDIO_APP = {
7744
7918
  type: "component",
7745
7919
  label: "Views",
7746
7920
  componentRef: "metadata:resource",
7747
- params: { type: "view" },
7921
+ params: { type: "view", package: "{active_package}" },
7748
7922
  icon: "table"
7749
7923
  },
7750
7924
  {
@@ -7752,7 +7926,7 @@ var STUDIO_APP = {
7752
7926
  type: "component",
7753
7927
  label: "Pages",
7754
7928
  componentRef: "metadata:resource",
7755
- params: { type: "page" },
7929
+ params: { type: "page", package: "{active_package}" },
7756
7930
  icon: "file-text"
7757
7931
  },
7758
7932
  {
@@ -7760,7 +7934,7 @@ var STUDIO_APP = {
7760
7934
  type: "component",
7761
7935
  label: "Dashboards",
7762
7936
  componentRef: "metadata:resource",
7763
- params: { type: "dashboard" },
7937
+ params: { type: "dashboard", package: "{active_package}" },
7764
7938
  icon: "layout-dashboard"
7765
7939
  },
7766
7940
  {
@@ -7768,7 +7942,7 @@ var STUDIO_APP = {
7768
7942
  type: "component",
7769
7943
  label: "Reports",
7770
7944
  componentRef: "metadata:resource",
7771
- params: { type: "report" },
7945
+ params: { type: "report", package: "{active_package}" },
7772
7946
  icon: "bar-chart-3"
7773
7947
  }
7774
7948
  ]
@@ -7785,7 +7959,7 @@ var STUDIO_APP = {
7785
7959
  type: "component",
7786
7960
  label: "Actions",
7787
7961
  componentRef: "metadata:resource",
7788
- params: { type: "action" },
7962
+ params: { type: "action", package: "{active_package}" },
7789
7963
  icon: "mouse-pointer-click"
7790
7964
  },
7791
7965
  {
@@ -7793,7 +7967,7 @@ var STUDIO_APP = {
7793
7967
  type: "component",
7794
7968
  label: "Hooks",
7795
7969
  componentRef: "metadata:resource",
7796
- params: { type: "hook" },
7970
+ params: { type: "hook", package: "{active_package}" },
7797
7971
  icon: "webhook"
7798
7972
  }
7799
7973
  ]
@@ -7810,7 +7984,7 @@ var STUDIO_APP = {
7810
7984
  type: "component",
7811
7985
  label: "Flows",
7812
7986
  componentRef: "metadata:resource",
7813
- params: { type: "flow" },
7987
+ params: { type: "flow", package: "{active_package}" },
7814
7988
  icon: "git-branch"
7815
7989
  },
7816
7990
  {
@@ -7818,7 +7992,7 @@ var STUDIO_APP = {
7818
7992
  type: "component",
7819
7993
  label: "Workflow Rules",
7820
7994
  componentRef: "metadata:resource",
7821
- params: { type: "workflow" },
7995
+ params: { type: "workflow", package: "{active_package}" },
7822
7996
  icon: "zap"
7823
7997
  },
7824
7998
  {
@@ -7826,7 +8000,7 @@ var STUDIO_APP = {
7826
8000
  type: "component",
7827
8001
  label: "Approval Processes",
7828
8002
  componentRef: "metadata:resource",
7829
- params: { type: "approval" },
8003
+ params: { type: "approval", package: "{active_package}" },
7830
8004
  icon: "check-circle"
7831
8005
  }
7832
8006
  ]
@@ -7845,7 +8019,7 @@ var STUDIO_APP = {
7845
8019
  type: "component",
7846
8020
  label: "Agents",
7847
8021
  componentRef: "metadata:resource",
7848
- params: { type: "agent" },
8022
+ params: { type: "agent", package: "{active_package}" },
7849
8023
  icon: "bot"
7850
8024
  },
7851
8025
  {
@@ -7853,7 +8027,7 @@ var STUDIO_APP = {
7853
8027
  type: "component",
7854
8028
  label: "Tools",
7855
8029
  componentRef: "metadata:resource",
7856
- params: { type: "tool" },
8030
+ params: { type: "tool", package: "{active_package}" },
7857
8031
  icon: "wrench"
7858
8032
  },
7859
8033
  {
@@ -7861,7 +8035,7 @@ var STUDIO_APP = {
7861
8035
  type: "component",
7862
8036
  label: "Skills",
7863
8037
  componentRef: "metadata:resource",
7864
- params: { type: "skill" },
8038
+ params: { type: "skill", package: "{active_package}" },
7865
8039
  icon: "brain"
7866
8040
  }
7867
8041
  ]
@@ -7914,7 +8088,7 @@ var STUDIO_APP = {
7914
8088
  type: "component",
7915
8089
  label: "Email Templates",
7916
8090
  componentRef: "metadata:resource",
7917
- params: { type: "email_template" },
8091
+ params: { type: "email_template", package: "{active_package}" },
7918
8092
  icon: "mail"
7919
8093
  }
7920
8094
  ]