@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.js CHANGED
@@ -12,9 +12,12 @@ var SysUser = data.ObjectSchema.create({
12
12
  icon: "user",
13
13
  isSystem: true,
14
14
  managedBy: "better-auth",
15
- // ADR-0010 — identity table is managed by better-auth, schema must not drift.
16
- _lock: "full",
17
- _lockReason: "Identity table managed by better-auth \u2014 see ADR-0010.",
15
+ // ADR-0010 §3.7 — identity table is managed by better-auth; schema must not drift.
16
+ protection: {
17
+ lock: "full",
18
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
19
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
20
+ },
18
21
  description: "User accounts for authentication",
19
22
  displayNameField: "name",
20
23
  titleFormat: "{name}",
@@ -427,6 +430,14 @@ var SysSession = data.ObjectSchema.create({
427
430
  icon: "key",
428
431
  isSystem: true,
429
432
  managedBy: "better-auth",
433
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
434
+ // but may add overlay row-level config. Use `no-overlay` if you need to
435
+ // forbid sys_metadata overlays entirely.
436
+ protection: {
437
+ lock: "full",
438
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
439
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
440
+ },
430
441
  description: "Active user sessions",
431
442
  displayNameField: "user_id",
432
443
  titleFormat: "Session \u2014 {user_id}",
@@ -582,6 +593,14 @@ var SysAccount = data.ObjectSchema.create({
582
593
  icon: "link",
583
594
  isSystem: true,
584
595
  managedBy: "better-auth",
596
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
597
+ // but may add overlay row-level config. Use `no-overlay` if you need to
598
+ // forbid sys_metadata overlays entirely.
599
+ protection: {
600
+ lock: "full",
601
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
602
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
603
+ },
585
604
  description: "OAuth and authentication provider accounts",
586
605
  titleFormat: "{provider_id} - {account_id}",
587
606
  compactLayout: ["provider_id", "user_id", "account_id"],
@@ -755,6 +774,14 @@ var SysVerification = data.ObjectSchema.create({
755
774
  icon: "shield-check",
756
775
  isSystem: true,
757
776
  managedBy: "better-auth",
777
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
778
+ // but may add overlay row-level config. Use `no-overlay` if you need to
779
+ // forbid sys_metadata overlays entirely.
780
+ protection: {
781
+ lock: "full",
782
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
783
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
784
+ },
758
785
  description: "Email and phone verification tokens",
759
786
  titleFormat: "Verification for {identifier}",
760
787
  compactLayout: ["identifier", "expires_at", "created_at"],
@@ -810,6 +837,14 @@ var SysOrganization = data.ObjectSchema.create({
810
837
  icon: "building-2",
811
838
  isSystem: true,
812
839
  managedBy: "better-auth",
840
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
841
+ // but may add overlay row-level config. Use `no-overlay` if you need to
842
+ // forbid sys_metadata overlays entirely.
843
+ protection: {
844
+ lock: "full",
845
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
846
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
847
+ },
813
848
  description: "Organizations for multi-tenant grouping",
814
849
  displayNameField: "name",
815
850
  titleFormat: "{name}",
@@ -1012,6 +1047,14 @@ var SysMember = data.ObjectSchema.create({
1012
1047
  icon: "user-check",
1013
1048
  isSystem: true,
1014
1049
  managedBy: "better-auth",
1050
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1051
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1052
+ // forbid sys_metadata overlays entirely.
1053
+ protection: {
1054
+ lock: "full",
1055
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1056
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1057
+ },
1015
1058
  description: "Organization membership records",
1016
1059
  titleFormat: "{user_id} in {organization_id}",
1017
1060
  compactLayout: ["user_id", "organization_id", "role"],
@@ -1161,6 +1204,14 @@ var SysInvitation = data.ObjectSchema.create({
1161
1204
  icon: "mail",
1162
1205
  isSystem: true,
1163
1206
  managedBy: "better-auth",
1207
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1208
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1209
+ // forbid sys_metadata overlays entirely.
1210
+ protection: {
1211
+ lock: "full",
1212
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1213
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1214
+ },
1164
1215
  description: "Organization invitations for user onboarding",
1165
1216
  titleFormat: "Invitation to {organization_id}",
1166
1217
  compactLayout: ["email", "organization_id", "status"],
@@ -1361,6 +1412,14 @@ var SysTeam = data.ObjectSchema.create({
1361
1412
  icon: "users",
1362
1413
  isSystem: true,
1363
1414
  managedBy: "better-auth",
1415
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1416
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1417
+ // forbid sys_metadata overlays entirely.
1418
+ protection: {
1419
+ lock: "full",
1420
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1421
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1422
+ },
1364
1423
  description: "Teams within organizations for fine-grained grouping",
1365
1424
  displayNameField: "name",
1366
1425
  titleFormat: "{name}",
@@ -1498,6 +1557,14 @@ var SysTeamMember = data.ObjectSchema.create({
1498
1557
  icon: "user-plus",
1499
1558
  isSystem: true,
1500
1559
  managedBy: "better-auth",
1560
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1561
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1562
+ // forbid sys_metadata overlays entirely.
1563
+ protection: {
1564
+ lock: "full",
1565
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1566
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1567
+ },
1501
1568
  description: "Team membership records linking users to teams",
1502
1569
  titleFormat: "{user_id} in {team_id}",
1503
1570
  compactLayout: ["user_id", "team_id", "created_at"],
@@ -1825,6 +1892,14 @@ var SysApiKey = data.ObjectSchema.create({
1825
1892
  icon: "key-round",
1826
1893
  isSystem: true,
1827
1894
  managedBy: "better-auth",
1895
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
1896
+ // but may add overlay row-level config. Use `no-overlay` if you need to
1897
+ // forbid sys_metadata overlays entirely.
1898
+ protection: {
1899
+ lock: "full",
1900
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
1901
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
1902
+ },
1828
1903
  description: "API keys for programmatic access",
1829
1904
  displayNameField: "name",
1830
1905
  titleFormat: "{name}",
@@ -2007,6 +2082,14 @@ var SysTwoFactor = data.ObjectSchema.create({
2007
2082
  icon: "smartphone",
2008
2083
  isSystem: true,
2009
2084
  managedBy: "better-auth",
2085
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2086
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2087
+ // forbid sys_metadata overlays entirely.
2088
+ protection: {
2089
+ lock: "full",
2090
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2091
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2092
+ },
2010
2093
  description: "Two-factor authentication credentials",
2011
2094
  titleFormat: "Two-factor for {user_id}",
2012
2095
  compactLayout: ["user_id", "created_at"],
@@ -2153,6 +2236,14 @@ var SysDeviceCode = data.ObjectSchema.create({
2153
2236
  icon: "key-round",
2154
2237
  isSystem: true,
2155
2238
  managedBy: "better-auth",
2239
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2240
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2241
+ // forbid sys_metadata overlays entirely.
2242
+ protection: {
2243
+ lock: "full",
2244
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2245
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2246
+ },
2156
2247
  description: "OAuth 2.0 Device Authorization Grant (RFC 8628) pending requests",
2157
2248
  titleFormat: "{user_code}",
2158
2249
  compactLayout: ["user_code", "status", "client_id", "expires_at"],
@@ -2332,6 +2423,14 @@ var SysOauthApplication = data.ObjectSchema.create({
2332
2423
  icon: "key-round",
2333
2424
  isSystem: true,
2334
2425
  managedBy: "better-auth",
2426
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2427
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2428
+ // forbid sys_metadata overlays entirely.
2429
+ protection: {
2430
+ lock: "full",
2431
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2432
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2433
+ },
2335
2434
  description: "Registered OAuth/OIDC client applications",
2336
2435
  displayNameField: "name",
2337
2436
  titleFormat: "{name}",
@@ -2726,6 +2825,14 @@ var SysOauthAccessToken = data.ObjectSchema.create({
2726
2825
  icon: "ticket",
2727
2826
  isSystem: true,
2728
2827
  managedBy: "better-auth",
2828
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2829
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2830
+ // forbid sys_metadata overlays entirely.
2831
+ protection: {
2832
+ lock: "full",
2833
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2834
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2835
+ },
2729
2836
  description: "Opaque OAuth access tokens issued to client applications",
2730
2837
  compactLayout: ["client_id", "user_id", "expires_at"],
2731
2838
  fields: {
@@ -2804,6 +2911,14 @@ var SysOauthRefreshToken = data.ObjectSchema.create({
2804
2911
  icon: "refresh-cw",
2805
2912
  isSystem: true,
2806
2913
  managedBy: "better-auth",
2914
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
2915
+ // but may add overlay row-level config. Use `no-overlay` if you need to
2916
+ // forbid sys_metadata overlays entirely.
2917
+ protection: {
2918
+ lock: "full",
2919
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
2920
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
2921
+ },
2807
2922
  description: "Opaque OAuth refresh tokens (linked to a session)",
2808
2923
  compactLayout: ["client_id", "user_id", "expires_at"],
2809
2924
  fields: {
@@ -2886,6 +3001,14 @@ var SysOauthConsent = data.ObjectSchema.create({
2886
3001
  icon: "shield-check",
2887
3002
  isSystem: true,
2888
3003
  managedBy: "better-auth",
3004
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
3005
+ // but may add overlay row-level config. Use `no-overlay` if you need to
3006
+ // forbid sys_metadata overlays entirely.
3007
+ protection: {
3008
+ lock: "full",
3009
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
3010
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3011
+ },
2889
3012
  description: "User consent records for OAuth client applications",
2890
3013
  compactLayout: ["client_id", "user_id", "scopes"],
2891
3014
  fields: {
@@ -2946,6 +3069,14 @@ var SysJwks = data.ObjectSchema.create({
2946
3069
  icon: "key",
2947
3070
  isSystem: true,
2948
3071
  managedBy: "better-auth",
3072
+ // ADR-0010 §3.7 — managed by better-auth; tenants may not edit schema,
3073
+ // but may add overlay row-level config. Use `no-overlay` if you need to
3074
+ // forbid sys_metadata overlays entirely.
3075
+ protection: {
3076
+ lock: "full",
3077
+ reason: "Identity table managed by better-auth \u2014 see ADR-0010.",
3078
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3079
+ },
2949
3080
  description: "Asymmetric key pairs used to sign and verify issued JWTs",
2950
3081
  compactLayout: ["id", "created_at", "expires_at"],
2951
3082
  fields: {
@@ -2993,6 +3124,13 @@ var SysRole = data.ObjectSchema.create({
2993
3124
  icon: "shield",
2994
3125
  isSystem: true,
2995
3126
  managedBy: "config",
3127
+ // ADR-0010 §3.7 — RBAC primitive; tenants may add custom rows
3128
+ // (created via UI / API) but the schema itself is locked.
3129
+ protection: {
3130
+ lock: "no-overlay",
3131
+ reason: "RBAC schema is platform-defined \u2014 see ADR-0010.",
3132
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3133
+ },
2996
3134
  description: "Role definitions for RBAC access control",
2997
3135
  displayNameField: "label",
2998
3136
  titleFormat: "{label}",
@@ -3196,6 +3334,13 @@ var SysPermissionSet = data.ObjectSchema.create({
3196
3334
  icon: "lock",
3197
3335
  isSystem: true,
3198
3336
  managedBy: "config",
3337
+ // ADR-0010 §3.7 — RBAC primitive; tenants may add custom rows
3338
+ // (created via UI / API) but the schema itself is locked.
3339
+ protection: {
3340
+ lock: "no-overlay",
3341
+ reason: "RBAC schema is platform-defined \u2014 see ADR-0010.",
3342
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
3343
+ },
3199
3344
  description: "Named permission groupings for fine-grained access control",
3200
3345
  displayNameField: "label",
3201
3346
  titleFormat: "{label}",
@@ -7449,9 +7594,13 @@ var SETUP_APP = {
7449
7594
  icon: "settings",
7450
7595
  active: true,
7451
7596
  isDefault: false,
7452
- // ADR-0010 — core admin UI must not be overlay-edited or deleted.
7453
- _lock: "full",
7454
- _lockReason: "Core admin UI shipped by @objectstack/platform-objects \u2014 see ADR-0010.",
7597
+ // ADR-0010 §3.7 author-facing protection block. Loader translates
7598
+ // this into the `_lock` envelope at registration time.
7599
+ protection: {
7600
+ lock: "full",
7601
+ reason: "Core admin UI shipped by @objectstack/platform-objects \u2014 see ADR-0010.",
7602
+ docsUrl: "https://docs.objectstack.ai/adr/0010-metadata-protection"
7603
+ },
7455
7604
  branding: {
7456
7605
  primaryColor: "#475569"
7457
7606
  // Slate-600 — neutral admin palette
@@ -7683,6 +7832,31 @@ var STUDIO_APP = {
7683
7832
  // Indigo-500 — distinct from Setup's slate
7684
7833
  },
7685
7834
  requiredPermissions: ["studio.access"],
7835
+ contextSelectors: [
7836
+ {
7837
+ // Package scope — pinned to the sidebar header. Selecting a package
7838
+ // injects `{active_package}` into every `metadata:resource` nav
7839
+ // item below, so the whole workbench filters to that package in
7840
+ // one click. Options come from the installed-packages REST surface,
7841
+ // narrowed to project-scoped packages: this dropdown exists so
7842
+ // third-party developers can scope to *their* custom package, so we
7843
+ // deliberately hide the platform's own system/cloud kernel packages
7844
+ // (auth, security, audit, queue, …) which are not user-authored.
7845
+ id: "active_package",
7846
+ label: "Package",
7847
+ icon: "package",
7848
+ optionsSource: {
7849
+ endpoint: "/api/v1/packages",
7850
+ valueKey: "manifest.id",
7851
+ labelKey: "manifest.name",
7852
+ filter: [{ key: "manifest.scope", op: "nin", value: ["system", "cloud"] }]
7853
+ },
7854
+ includeAll: true,
7855
+ allValue: "",
7856
+ persist: "query",
7857
+ placement: "sidebar_header"
7858
+ }
7859
+ ],
7686
7860
  navigation: [
7687
7861
  {
7688
7862
  id: "group_overview",
@@ -7713,7 +7887,7 @@ var STUDIO_APP = {
7713
7887
  type: "component",
7714
7888
  label: "Objects",
7715
7889
  componentRef: "metadata:resource",
7716
- params: { type: "object" },
7890
+ params: { type: "object", package: "{active_package}" },
7717
7891
  icon: "box"
7718
7892
  },
7719
7893
  {
@@ -7721,7 +7895,7 @@ var STUDIO_APP = {
7721
7895
  type: "component",
7722
7896
  label: "Validations",
7723
7897
  componentRef: "metadata:resource",
7724
- params: { type: "validation" },
7898
+ params: { type: "validation", package: "{active_package}" },
7725
7899
  icon: "check-square"
7726
7900
  }
7727
7901
  ]
@@ -7738,7 +7912,7 @@ var STUDIO_APP = {
7738
7912
  type: "component",
7739
7913
  label: "Apps",
7740
7914
  componentRef: "metadata:resource",
7741
- params: { type: "app" },
7915
+ params: { type: "app", package: "{active_package}" },
7742
7916
  icon: "app-window"
7743
7917
  },
7744
7918
  {
@@ -7746,7 +7920,7 @@ var STUDIO_APP = {
7746
7920
  type: "component",
7747
7921
  label: "Views",
7748
7922
  componentRef: "metadata:resource",
7749
- params: { type: "view" },
7923
+ params: { type: "view", package: "{active_package}" },
7750
7924
  icon: "table"
7751
7925
  },
7752
7926
  {
@@ -7754,7 +7928,7 @@ var STUDIO_APP = {
7754
7928
  type: "component",
7755
7929
  label: "Pages",
7756
7930
  componentRef: "metadata:resource",
7757
- params: { type: "page" },
7931
+ params: { type: "page", package: "{active_package}" },
7758
7932
  icon: "file-text"
7759
7933
  },
7760
7934
  {
@@ -7762,7 +7936,7 @@ var STUDIO_APP = {
7762
7936
  type: "component",
7763
7937
  label: "Dashboards",
7764
7938
  componentRef: "metadata:resource",
7765
- params: { type: "dashboard" },
7939
+ params: { type: "dashboard", package: "{active_package}" },
7766
7940
  icon: "layout-dashboard"
7767
7941
  },
7768
7942
  {
@@ -7770,7 +7944,7 @@ var STUDIO_APP = {
7770
7944
  type: "component",
7771
7945
  label: "Reports",
7772
7946
  componentRef: "metadata:resource",
7773
- params: { type: "report" },
7947
+ params: { type: "report", package: "{active_package}" },
7774
7948
  icon: "bar-chart-3"
7775
7949
  }
7776
7950
  ]
@@ -7787,7 +7961,7 @@ var STUDIO_APP = {
7787
7961
  type: "component",
7788
7962
  label: "Actions",
7789
7963
  componentRef: "metadata:resource",
7790
- params: { type: "action" },
7964
+ params: { type: "action", package: "{active_package}" },
7791
7965
  icon: "mouse-pointer-click"
7792
7966
  },
7793
7967
  {
@@ -7795,7 +7969,7 @@ var STUDIO_APP = {
7795
7969
  type: "component",
7796
7970
  label: "Hooks",
7797
7971
  componentRef: "metadata:resource",
7798
- params: { type: "hook" },
7972
+ params: { type: "hook", package: "{active_package}" },
7799
7973
  icon: "webhook"
7800
7974
  }
7801
7975
  ]
@@ -7812,7 +7986,7 @@ var STUDIO_APP = {
7812
7986
  type: "component",
7813
7987
  label: "Flows",
7814
7988
  componentRef: "metadata:resource",
7815
- params: { type: "flow" },
7989
+ params: { type: "flow", package: "{active_package}" },
7816
7990
  icon: "git-branch"
7817
7991
  },
7818
7992
  {
@@ -7820,7 +7994,7 @@ var STUDIO_APP = {
7820
7994
  type: "component",
7821
7995
  label: "Workflow Rules",
7822
7996
  componentRef: "metadata:resource",
7823
- params: { type: "workflow" },
7997
+ params: { type: "workflow", package: "{active_package}" },
7824
7998
  icon: "zap"
7825
7999
  },
7826
8000
  {
@@ -7828,7 +8002,7 @@ var STUDIO_APP = {
7828
8002
  type: "component",
7829
8003
  label: "Approval Processes",
7830
8004
  componentRef: "metadata:resource",
7831
- params: { type: "approval" },
8005
+ params: { type: "approval", package: "{active_package}" },
7832
8006
  icon: "check-circle"
7833
8007
  }
7834
8008
  ]
@@ -7847,7 +8021,7 @@ var STUDIO_APP = {
7847
8021
  type: "component",
7848
8022
  label: "Agents",
7849
8023
  componentRef: "metadata:resource",
7850
- params: { type: "agent" },
8024
+ params: { type: "agent", package: "{active_package}" },
7851
8025
  icon: "bot"
7852
8026
  },
7853
8027
  {
@@ -7855,7 +8029,7 @@ var STUDIO_APP = {
7855
8029
  type: "component",
7856
8030
  label: "Tools",
7857
8031
  componentRef: "metadata:resource",
7858
- params: { type: "tool" },
8032
+ params: { type: "tool", package: "{active_package}" },
7859
8033
  icon: "wrench"
7860
8034
  },
7861
8035
  {
@@ -7863,7 +8037,7 @@ var STUDIO_APP = {
7863
8037
  type: "component",
7864
8038
  label: "Skills",
7865
8039
  componentRef: "metadata:resource",
7866
- params: { type: "skill" },
8040
+ params: { type: "skill", package: "{active_package}" },
7867
8041
  icon: "brain"
7868
8042
  }
7869
8043
  ]
@@ -7916,7 +8090,7 @@ var STUDIO_APP = {
7916
8090
  type: "component",
7917
8091
  label: "Email Templates",
7918
8092
  componentRef: "metadata:resource",
7919
- params: { type: "email_template" },
8093
+ params: { type: "email_template", package: "{active_package}" },
7920
8094
  icon: "mail"
7921
8095
  }
7922
8096
  ]