@objectstack/platform-objects 4.2.0 → 5.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.
@@ -609,6 +609,12 @@ declare const SysWebhook: Omit<{
609
609
  recordTypes?: string[] | undefined;
610
610
  sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
611
611
  keyPrefix?: string | undefined;
612
+ detail?: {
613
+ [x: string]: unknown;
614
+ renderViaSchema?: boolean | undefined;
615
+ hideReferenceRail?: boolean | undefined;
616
+ hideRelatedTab?: boolean | undefined;
617
+ } | undefined;
612
618
  actions?: {
613
619
  name: string;
614
620
  label: string;
@@ -609,6 +609,12 @@ declare const SysWebhook: Omit<{
609
609
  recordTypes?: string[] | undefined;
610
610
  sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
611
611
  keyPrefix?: string | undefined;
612
+ detail?: {
613
+ [x: string]: unknown;
614
+ renderViaSchema?: boolean | undefined;
615
+ hideReferenceRail?: boolean | undefined;
616
+ hideRelatedTab?: boolean | undefined;
617
+ } | undefined;
612
618
  actions?: {
613
619
  name: string;
614
620
  label: string;
@@ -598,6 +598,12 @@ declare const SysMetadataObject: Omit<{
598
598
  recordTypes?: string[] | undefined;
599
599
  sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
600
600
  keyPrefix?: string | undefined;
601
+ detail?: {
602
+ [x: string]: unknown;
603
+ renderViaSchema?: boolean | undefined;
604
+ hideReferenceRail?: boolean | undefined;
605
+ hideRelatedTab?: boolean | undefined;
606
+ } | undefined;
601
607
  actions?: {
602
608
  name: string;
603
609
  label: string;
@@ -3506,7 +3512,7 @@ declare const SysMetadataObject: Omit<{
3506
3512
  readonly index?: boolean | undefined;
3507
3513
  readonly type: "number";
3508
3514
  };
3509
- /** Content checksum for change detection */
3515
+ /** Content checksum for change detection (e.g. `sha256:<64 hex>` = 71 chars) */
3510
3516
  readonly checksum: {
3511
3517
  readonly readonly?: boolean | undefined;
3512
3518
  readonly format?: string | undefined;
@@ -4763,18 +4769,42 @@ declare const SysMetadataObject: Omit<{
4763
4769
  }, "fields">;
4764
4770
 
4765
4771
  /**
4766
- * sys_metadata_history — Metadata Version History Object
4772
+ * sys_metadata_history — Metadata Version History / Event Log
4767
4773
  *
4768
- * Stores historical snapshots of metadata changes for version tracking,
4769
- * audit trail, and rollback capabilities.
4774
+ * Append-only durable log of every overlay change made through
4775
+ * `SysMetadataRepository.put` / `delete` (ADR-0008 §10 M1). Each row is a
4776
+ * single event in the per-organisation event log; rows are NEVER
4777
+ * mutated after insertion. The legacy `DatabaseLoader` writes the same
4778
+ * shape from its own put/restore code paths.
4770
4779
  *
4771
- * This is a system object (isSystem: true) — protected from deletion and
4772
- * automatically provisioned when metadata history is enabled.
4780
+ * ─────────────────────────────────────────────────────────────────────
4781
+ * Key design points (ADR-0008 §0 amendment + M1):
4782
+ *
4783
+ * • Keyed by `(organization_id, type, name)` only — `project_id` was
4784
+ * removed in the branch/project-removal amendment. The original
4785
+ * `metadata_id` column (a downgraded plain-text version of the old
4786
+ * `sys_metadata.id` FK) was removed in the M1 follow-up — joins go
4787
+ * through `(organization_id, type, name, version)` exclusively.
4788
+ *
4789
+ * • `event_seq` is the per-org monotonic event-log cursor. Producers
4790
+ * compute `MAX(event_seq) + 1 WHERE organization_id = X` inside the
4791
+ * same transaction as the parent `sys_metadata` write.
4792
+ *
4793
+ * • `version` is the per-(org,type,name) lineage counter. Producers
4794
+ * compute `MAX(version) + 1 WHERE organization_id = X AND type = T
4795
+ * AND name = N` so delete + recreate continues incrementing instead
4796
+ * of restarting at 1.
4773
4797
  *
4774
- * Each record represents a single version snapshot of a metadata item,
4775
- * created whenever the metadata is modified, published, or reverted.
4798
+ * `metadata` / `checksum` are nullable DELETE rows have no body or
4799
+ * hash. Readers must tolerate null on both columns.
4776
4800
  *
4777
- * @see MetadataHistoryRecordSchema in metadata-persistence.zod.ts
4801
+ * `source` records the producer ('sys-metadata-repo', 'fs',
4802
+ * 'studio', …) and feeds MetadataEvent.source on history() reads.
4803
+ *
4804
+ * Indexes are purpose-built for the two dominant read patterns:
4805
+ * 1. per-item history view → `(organization_id, type, name, version)`
4806
+ * 2. org-wide event replay → `(organization_id, event_seq)`
4807
+ * ─────────────────────────────────────────────────────────────────────
4778
4808
  */
4779
4809
  declare const SysMetadataHistoryObject: Omit<{
4780
4810
  name: string;
@@ -5360,6 +5390,12 @@ declare const SysMetadataHistoryObject: Omit<{
5360
5390
  recordTypes?: string[] | undefined;
5361
5391
  sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
5362
5392
  keyPrefix?: string | undefined;
5393
+ detail?: {
5394
+ [x: string]: unknown;
5395
+ renderViaSchema?: boolean | undefined;
5396
+ hideReferenceRail?: boolean | undefined;
5397
+ hideRelatedTab?: boolean | undefined;
5398
+ } | undefined;
5363
5399
  actions?: {
5364
5400
  name: string;
5365
5401
  label: string;
@@ -5442,7 +5478,7 @@ declare const SysMetadataHistoryObject: Omit<{
5442
5478
  readonly icon: "history";
5443
5479
  readonly isSystem: true;
5444
5480
  readonly managedBy: "system";
5445
- readonly description: "Version history and audit trail for metadata changes";
5481
+ readonly description: "Durable event log of metadata overlay changes (per-org, append-only)";
5446
5482
  readonly fields: {
5447
5483
  /** Primary Key (UUID) */
5448
5484
  readonly id: {
@@ -5620,8 +5656,8 @@ declare const SysMetadataHistoryObject: Omit<{
5620
5656
  readonly index?: boolean | undefined;
5621
5657
  readonly type: "text";
5622
5658
  };
5623
- /** Foreign key to sys_metadata.id */
5624
- readonly metadata_id: {
5659
+ /** Per-org monotonic event sequence (durable cursor for replay). */
5660
+ readonly event_seq: {
5625
5661
  readonly readonly?: boolean | undefined;
5626
5662
  readonly format?: string | undefined;
5627
5663
  readonly options?: {
@@ -5667,7 +5703,7 @@ declare const SysMetadataHistoryObject: Omit<{
5667
5703
  readonly maxLength?: number | undefined;
5668
5704
  readonly minLength?: number | undefined;
5669
5705
  readonly scale?: number | undefined;
5670
- reference: string;
5706
+ readonly reference?: string | undefined;
5671
5707
  readonly referenceFilters?: string[] | undefined;
5672
5708
  readonly writeRequiresMasterRead?: boolean | undefined;
5673
5709
  readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
@@ -5794,7 +5830,7 @@ declare const SysMetadataHistoryObject: Omit<{
5794
5830
  readonly caseSensitive?: boolean | undefined;
5795
5831
  readonly autonumberFormat?: string | undefined;
5796
5832
  readonly index?: boolean | undefined;
5797
- readonly type: "lookup";
5833
+ readonly type: "number";
5798
5834
  };
5799
5835
  /** Machine name (denormalized for easier querying) */
5800
5836
  readonly name: {
@@ -6148,7 +6184,7 @@ declare const SysMetadataHistoryObject: Omit<{
6148
6184
  readonly index?: boolean | undefined;
6149
6185
  readonly type: "text";
6150
6186
  };
6151
- /** Version number at this snapshot */
6187
+ /** Per-(org,type,name) lineage counter at this snapshot. */
6152
6188
  readonly version: {
6153
6189
  readonly readonly?: boolean | undefined;
6154
6190
  readonly format?: string | undefined;
@@ -6500,7 +6536,10 @@ declare const SysMetadataHistoryObject: Omit<{
6500
6536
  readonly index?: boolean | undefined;
6501
6537
  readonly type: "select";
6502
6538
  };
6503
- /** Historical metadata snapshot (JSON payload) */
6539
+ /**
6540
+ * Historical metadata snapshot (JSON payload).
6541
+ * Null for `operation_type = 'delete'` — the row carries no body.
6542
+ */
6504
6543
  readonly metadata: {
6505
6544
  readonly readonly?: boolean | undefined;
6506
6545
  readonly format?: string | undefined;
@@ -6676,7 +6715,7 @@ declare const SysMetadataHistoryObject: Omit<{
6676
6715
  readonly index?: boolean | undefined;
6677
6716
  readonly type: "textarea";
6678
6717
  };
6679
- /** SHA-256 checksum of metadata content */
6718
+ /** SHA-256 checksum of metadata content (null for deletes). */
6680
6719
  readonly checksum: {
6681
6720
  readonly readonly?: boolean | undefined;
6682
6721
  readonly format?: string | undefined;
@@ -6852,7 +6891,7 @@ declare const SysMetadataHistoryObject: Omit<{
6852
6891
  readonly index?: boolean | undefined;
6853
6892
  readonly type: "text";
6854
6893
  };
6855
- /** Checksum of the previous version */
6894
+ /** Checksum of the previous version (null for the first event). */
6856
6895
  readonly previous_checksum: {
6857
6896
  readonly readonly?: boolean | undefined;
6858
6897
  readonly format?: string | undefined;
@@ -7028,7 +7067,7 @@ declare const SysMetadataHistoryObject: Omit<{
7028
7067
  readonly index?: boolean | undefined;
7029
7068
  readonly type: "text";
7030
7069
  };
7031
- /** Human-readable description of changes */
7070
+ /** Human-readable description of changes (= MetadataEvent.message). */
7032
7071
  readonly change_note: {
7033
7072
  readonly readonly?: boolean | undefined;
7034
7073
  readonly format?: string | undefined;
@@ -7204,8 +7243,12 @@ declare const SysMetadataHistoryObject: Omit<{
7204
7243
  readonly index?: boolean | undefined;
7205
7244
  readonly type: "textarea";
7206
7245
  };
7207
- /** Organization ID for multi-tenant isolation */
7208
- readonly organization_id: {
7246
+ /**
7247
+ * Producer of the event ('sys-metadata-repo', 'fs', 'studio',
7248
+ * 'api', …). Defaults to 'sys-metadata-repo' on the canonical
7249
+ * write path; preserved on history() reads as MetadataEvent.source.
7250
+ */
7251
+ readonly source: {
7209
7252
  readonly readonly?: boolean | undefined;
7210
7253
  readonly format?: string | undefined;
7211
7254
  readonly options?: {
@@ -7251,7 +7294,7 @@ declare const SysMetadataHistoryObject: Omit<{
7251
7294
  readonly maxLength?: number | undefined;
7252
7295
  readonly minLength?: number | undefined;
7253
7296
  readonly scale?: number | undefined;
7254
- reference: string;
7297
+ readonly reference?: string | undefined;
7255
7298
  readonly referenceFilters?: string[] | undefined;
7256
7299
  readonly writeRequiresMasterRead?: boolean | undefined;
7257
7300
  readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
@@ -7378,10 +7421,10 @@ declare const SysMetadataHistoryObject: Omit<{
7378
7421
  readonly caseSensitive?: boolean | undefined;
7379
7422
  readonly autonumberFormat?: string | undefined;
7380
7423
  readonly index?: boolean | undefined;
7381
- readonly type: "lookup";
7424
+ readonly type: "text";
7382
7425
  };
7383
- /** Environment ID null = platform-global, set = env-scoped */
7384
- readonly project_id: {
7426
+ /** Organization ID for multi-tenant isolation */
7427
+ readonly organization_id: {
7385
7428
  readonly readonly?: boolean | undefined;
7386
7429
  readonly format?: string | undefined;
7387
7430
  readonly options?: {
@@ -7427,7 +7470,7 @@ declare const SysMetadataHistoryObject: Omit<{
7427
7470
  readonly maxLength?: number | undefined;
7428
7471
  readonly minLength?: number | undefined;
7429
7472
  readonly scale?: number | undefined;
7430
- readonly reference?: string | undefined;
7473
+ reference: string;
7431
7474
  readonly referenceFilters?: string[] | undefined;
7432
7475
  readonly writeRequiresMasterRead?: boolean | undefined;
7433
7476
  readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
@@ -7554,9 +7597,9 @@ declare const SysMetadataHistoryObject: Omit<{
7554
7597
  readonly caseSensitive?: boolean | undefined;
7555
7598
  readonly autonumberFormat?: string | undefined;
7556
7599
  readonly index?: boolean | undefined;
7557
- readonly type: "text";
7600
+ readonly type: "lookup";
7558
7601
  };
7559
- /** User who made this change */
7602
+ /** User who made this change (= MetadataEvent.actor). */
7560
7603
  readonly recorded_by: {
7561
7604
  readonly readonly?: boolean | undefined;
7562
7605
  readonly format?: string | undefined;
@@ -7910,20 +7953,21 @@ declare const SysMetadataHistoryObject: Omit<{
7910
7953
  };
7911
7954
  };
7912
7955
  readonly indexes: [{
7913
- readonly fields: ["metadata_id", "version"];
7956
+ readonly fields: ["organization_id", "event_seq"];
7957
+ readonly unique: true;
7958
+ }, {
7959
+ readonly fields: ["organization_id", "type", "name", "version"];
7914
7960
  readonly unique: true;
7915
7961
  }, {
7916
- readonly fields: ["metadata_id", "recorded_at"];
7962
+ readonly fields: ["organization_id", "type", "name", "recorded_at"];
7963
+ }, {
7964
+ readonly fields: ["organization_id", "type", "name", "checksum"];
7917
7965
  }, {
7918
7966
  readonly fields: ["type", "name"];
7919
7967
  }, {
7920
7968
  readonly fields: ["recorded_at"];
7921
7969
  }, {
7922
7970
  readonly fields: ["operation_type"];
7923
- }, {
7924
- readonly fields: ["organization_id"];
7925
- }, {
7926
- readonly fields: ["project_id"];
7927
7971
  }];
7928
7972
  readonly enable: {
7929
7973
  readonly trackHistory: false;
@@ -598,6 +598,12 @@ declare const SysMetadataObject: Omit<{
598
598
  recordTypes?: string[] | undefined;
599
599
  sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
600
600
  keyPrefix?: string | undefined;
601
+ detail?: {
602
+ [x: string]: unknown;
603
+ renderViaSchema?: boolean | undefined;
604
+ hideReferenceRail?: boolean | undefined;
605
+ hideRelatedTab?: boolean | undefined;
606
+ } | undefined;
601
607
  actions?: {
602
608
  name: string;
603
609
  label: string;
@@ -3506,7 +3512,7 @@ declare const SysMetadataObject: Omit<{
3506
3512
  readonly index?: boolean | undefined;
3507
3513
  readonly type: "number";
3508
3514
  };
3509
- /** Content checksum for change detection */
3515
+ /** Content checksum for change detection (e.g. `sha256:<64 hex>` = 71 chars) */
3510
3516
  readonly checksum: {
3511
3517
  readonly readonly?: boolean | undefined;
3512
3518
  readonly format?: string | undefined;
@@ -4763,18 +4769,42 @@ declare const SysMetadataObject: Omit<{
4763
4769
  }, "fields">;
4764
4770
 
4765
4771
  /**
4766
- * sys_metadata_history — Metadata Version History Object
4772
+ * sys_metadata_history — Metadata Version History / Event Log
4767
4773
  *
4768
- * Stores historical snapshots of metadata changes for version tracking,
4769
- * audit trail, and rollback capabilities.
4774
+ * Append-only durable log of every overlay change made through
4775
+ * `SysMetadataRepository.put` / `delete` (ADR-0008 §10 M1). Each row is a
4776
+ * single event in the per-organisation event log; rows are NEVER
4777
+ * mutated after insertion. The legacy `DatabaseLoader` writes the same
4778
+ * shape from its own put/restore code paths.
4770
4779
  *
4771
- * This is a system object (isSystem: true) — protected from deletion and
4772
- * automatically provisioned when metadata history is enabled.
4780
+ * ─────────────────────────────────────────────────────────────────────
4781
+ * Key design points (ADR-0008 §0 amendment + M1):
4782
+ *
4783
+ * • Keyed by `(organization_id, type, name)` only — `project_id` was
4784
+ * removed in the branch/project-removal amendment. The original
4785
+ * `metadata_id` column (a downgraded plain-text version of the old
4786
+ * `sys_metadata.id` FK) was removed in the M1 follow-up — joins go
4787
+ * through `(organization_id, type, name, version)` exclusively.
4788
+ *
4789
+ * • `event_seq` is the per-org monotonic event-log cursor. Producers
4790
+ * compute `MAX(event_seq) + 1 WHERE organization_id = X` inside the
4791
+ * same transaction as the parent `sys_metadata` write.
4792
+ *
4793
+ * • `version` is the per-(org,type,name) lineage counter. Producers
4794
+ * compute `MAX(version) + 1 WHERE organization_id = X AND type = T
4795
+ * AND name = N` so delete + recreate continues incrementing instead
4796
+ * of restarting at 1.
4773
4797
  *
4774
- * Each record represents a single version snapshot of a metadata item,
4775
- * created whenever the metadata is modified, published, or reverted.
4798
+ * `metadata` / `checksum` are nullable DELETE rows have no body or
4799
+ * hash. Readers must tolerate null on both columns.
4776
4800
  *
4777
- * @see MetadataHistoryRecordSchema in metadata-persistence.zod.ts
4801
+ * `source` records the producer ('sys-metadata-repo', 'fs',
4802
+ * 'studio', …) and feeds MetadataEvent.source on history() reads.
4803
+ *
4804
+ * Indexes are purpose-built for the two dominant read patterns:
4805
+ * 1. per-item history view → `(organization_id, type, name, version)`
4806
+ * 2. org-wide event replay → `(organization_id, event_seq)`
4807
+ * ─────────────────────────────────────────────────────────────────────
4778
4808
  */
4779
4809
  declare const SysMetadataHistoryObject: Omit<{
4780
4810
  name: string;
@@ -5360,6 +5390,12 @@ declare const SysMetadataHistoryObject: Omit<{
5360
5390
  recordTypes?: string[] | undefined;
5361
5391
  sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
5362
5392
  keyPrefix?: string | undefined;
5393
+ detail?: {
5394
+ [x: string]: unknown;
5395
+ renderViaSchema?: boolean | undefined;
5396
+ hideReferenceRail?: boolean | undefined;
5397
+ hideRelatedTab?: boolean | undefined;
5398
+ } | undefined;
5363
5399
  actions?: {
5364
5400
  name: string;
5365
5401
  label: string;
@@ -5442,7 +5478,7 @@ declare const SysMetadataHistoryObject: Omit<{
5442
5478
  readonly icon: "history";
5443
5479
  readonly isSystem: true;
5444
5480
  readonly managedBy: "system";
5445
- readonly description: "Version history and audit trail for metadata changes";
5481
+ readonly description: "Durable event log of metadata overlay changes (per-org, append-only)";
5446
5482
  readonly fields: {
5447
5483
  /** Primary Key (UUID) */
5448
5484
  readonly id: {
@@ -5620,8 +5656,8 @@ declare const SysMetadataHistoryObject: Omit<{
5620
5656
  readonly index?: boolean | undefined;
5621
5657
  readonly type: "text";
5622
5658
  };
5623
- /** Foreign key to sys_metadata.id */
5624
- readonly metadata_id: {
5659
+ /** Per-org monotonic event sequence (durable cursor for replay). */
5660
+ readonly event_seq: {
5625
5661
  readonly readonly?: boolean | undefined;
5626
5662
  readonly format?: string | undefined;
5627
5663
  readonly options?: {
@@ -5667,7 +5703,7 @@ declare const SysMetadataHistoryObject: Omit<{
5667
5703
  readonly maxLength?: number | undefined;
5668
5704
  readonly minLength?: number | undefined;
5669
5705
  readonly scale?: number | undefined;
5670
- reference: string;
5706
+ readonly reference?: string | undefined;
5671
5707
  readonly referenceFilters?: string[] | undefined;
5672
5708
  readonly writeRequiresMasterRead?: boolean | undefined;
5673
5709
  readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
@@ -5794,7 +5830,7 @@ declare const SysMetadataHistoryObject: Omit<{
5794
5830
  readonly caseSensitive?: boolean | undefined;
5795
5831
  readonly autonumberFormat?: string | undefined;
5796
5832
  readonly index?: boolean | undefined;
5797
- readonly type: "lookup";
5833
+ readonly type: "number";
5798
5834
  };
5799
5835
  /** Machine name (denormalized for easier querying) */
5800
5836
  readonly name: {
@@ -6148,7 +6184,7 @@ declare const SysMetadataHistoryObject: Omit<{
6148
6184
  readonly index?: boolean | undefined;
6149
6185
  readonly type: "text";
6150
6186
  };
6151
- /** Version number at this snapshot */
6187
+ /** Per-(org,type,name) lineage counter at this snapshot. */
6152
6188
  readonly version: {
6153
6189
  readonly readonly?: boolean | undefined;
6154
6190
  readonly format?: string | undefined;
@@ -6500,7 +6536,10 @@ declare const SysMetadataHistoryObject: Omit<{
6500
6536
  readonly index?: boolean | undefined;
6501
6537
  readonly type: "select";
6502
6538
  };
6503
- /** Historical metadata snapshot (JSON payload) */
6539
+ /**
6540
+ * Historical metadata snapshot (JSON payload).
6541
+ * Null for `operation_type = 'delete'` — the row carries no body.
6542
+ */
6504
6543
  readonly metadata: {
6505
6544
  readonly readonly?: boolean | undefined;
6506
6545
  readonly format?: string | undefined;
@@ -6676,7 +6715,7 @@ declare const SysMetadataHistoryObject: Omit<{
6676
6715
  readonly index?: boolean | undefined;
6677
6716
  readonly type: "textarea";
6678
6717
  };
6679
- /** SHA-256 checksum of metadata content */
6718
+ /** SHA-256 checksum of metadata content (null for deletes). */
6680
6719
  readonly checksum: {
6681
6720
  readonly readonly?: boolean | undefined;
6682
6721
  readonly format?: string | undefined;
@@ -6852,7 +6891,7 @@ declare const SysMetadataHistoryObject: Omit<{
6852
6891
  readonly index?: boolean | undefined;
6853
6892
  readonly type: "text";
6854
6893
  };
6855
- /** Checksum of the previous version */
6894
+ /** Checksum of the previous version (null for the first event). */
6856
6895
  readonly previous_checksum: {
6857
6896
  readonly readonly?: boolean | undefined;
6858
6897
  readonly format?: string | undefined;
@@ -7028,7 +7067,7 @@ declare const SysMetadataHistoryObject: Omit<{
7028
7067
  readonly index?: boolean | undefined;
7029
7068
  readonly type: "text";
7030
7069
  };
7031
- /** Human-readable description of changes */
7070
+ /** Human-readable description of changes (= MetadataEvent.message). */
7032
7071
  readonly change_note: {
7033
7072
  readonly readonly?: boolean | undefined;
7034
7073
  readonly format?: string | undefined;
@@ -7204,8 +7243,12 @@ declare const SysMetadataHistoryObject: Omit<{
7204
7243
  readonly index?: boolean | undefined;
7205
7244
  readonly type: "textarea";
7206
7245
  };
7207
- /** Organization ID for multi-tenant isolation */
7208
- readonly organization_id: {
7246
+ /**
7247
+ * Producer of the event ('sys-metadata-repo', 'fs', 'studio',
7248
+ * 'api', …). Defaults to 'sys-metadata-repo' on the canonical
7249
+ * write path; preserved on history() reads as MetadataEvent.source.
7250
+ */
7251
+ readonly source: {
7209
7252
  readonly readonly?: boolean | undefined;
7210
7253
  readonly format?: string | undefined;
7211
7254
  readonly options?: {
@@ -7251,7 +7294,7 @@ declare const SysMetadataHistoryObject: Omit<{
7251
7294
  readonly maxLength?: number | undefined;
7252
7295
  readonly minLength?: number | undefined;
7253
7296
  readonly scale?: number | undefined;
7254
- reference: string;
7297
+ readonly reference?: string | undefined;
7255
7298
  readonly referenceFilters?: string[] | undefined;
7256
7299
  readonly writeRequiresMasterRead?: boolean | undefined;
7257
7300
  readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
@@ -7378,10 +7421,10 @@ declare const SysMetadataHistoryObject: Omit<{
7378
7421
  readonly caseSensitive?: boolean | undefined;
7379
7422
  readonly autonumberFormat?: string | undefined;
7380
7423
  readonly index?: boolean | undefined;
7381
- readonly type: "lookup";
7424
+ readonly type: "text";
7382
7425
  };
7383
- /** Environment ID null = platform-global, set = env-scoped */
7384
- readonly project_id: {
7426
+ /** Organization ID for multi-tenant isolation */
7427
+ readonly organization_id: {
7385
7428
  readonly readonly?: boolean | undefined;
7386
7429
  readonly format?: string | undefined;
7387
7430
  readonly options?: {
@@ -7427,7 +7470,7 @@ declare const SysMetadataHistoryObject: Omit<{
7427
7470
  readonly maxLength?: number | undefined;
7428
7471
  readonly minLength?: number | undefined;
7429
7472
  readonly scale?: number | undefined;
7430
- readonly reference?: string | undefined;
7473
+ reference: string;
7431
7474
  readonly referenceFilters?: string[] | undefined;
7432
7475
  readonly writeRequiresMasterRead?: boolean | undefined;
7433
7476
  readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
@@ -7554,9 +7597,9 @@ declare const SysMetadataHistoryObject: Omit<{
7554
7597
  readonly caseSensitive?: boolean | undefined;
7555
7598
  readonly autonumberFormat?: string | undefined;
7556
7599
  readonly index?: boolean | undefined;
7557
- readonly type: "text";
7600
+ readonly type: "lookup";
7558
7601
  };
7559
- /** User who made this change */
7602
+ /** User who made this change (= MetadataEvent.actor). */
7560
7603
  readonly recorded_by: {
7561
7604
  readonly readonly?: boolean | undefined;
7562
7605
  readonly format?: string | undefined;
@@ -7910,20 +7953,21 @@ declare const SysMetadataHistoryObject: Omit<{
7910
7953
  };
7911
7954
  };
7912
7955
  readonly indexes: [{
7913
- readonly fields: ["metadata_id", "version"];
7956
+ readonly fields: ["organization_id", "event_seq"];
7957
+ readonly unique: true;
7958
+ }, {
7959
+ readonly fields: ["organization_id", "type", "name", "version"];
7914
7960
  readonly unique: true;
7915
7961
  }, {
7916
- readonly fields: ["metadata_id", "recorded_at"];
7962
+ readonly fields: ["organization_id", "type", "name", "recorded_at"];
7963
+ }, {
7964
+ readonly fields: ["organization_id", "type", "name", "checksum"];
7917
7965
  }, {
7918
7966
  readonly fields: ["type", "name"];
7919
7967
  }, {
7920
7968
  readonly fields: ["recorded_at"];
7921
7969
  }, {
7922
7970
  readonly fields: ["operation_type"];
7923
- }, {
7924
- readonly fields: ["organization_id"];
7925
- }, {
7926
- readonly fields: ["project_id"];
7927
7971
  }];
7928
7972
  readonly enable: {
7929
7973
  readonly trackHistory: false;