@objectstack/platform-objects 4.2.0 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit/index.d.mts +96 -0
- package/dist/audit/index.d.ts +96 -0
- package/dist/identity/index.d.mts +120 -0
- package/dist/identity/index.d.ts +120 -0
- package/dist/index.js +50 -34
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +50 -34
- package/dist/index.mjs.map +1 -1
- package/dist/integration/index.d.mts +6 -0
- package/dist/integration/index.d.ts +6 -0
- package/dist/metadata/index.d.mts +257 -33
- package/dist/metadata/index.d.ts +257 -33
- package/dist/metadata/index.js +50 -34
- package/dist/metadata/index.js.map +1 -1
- package/dist/metadata/index.mjs +50 -34
- package/dist/metadata/index.mjs.map +1 -1
- package/dist/security/index.d.mts +36 -0
- package/dist/security/index.d.ts +36 -0
- package/dist/system/index.d.mts +18 -0
- package/dist/system/index.d.ts +18 -0
- package/package.json +2 -2
package/dist/metadata/index.d.ts
CHANGED
|
@@ -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,43 @@ declare const SysMetadataObject: Omit<{
|
|
|
4763
4769
|
}, "fields">;
|
|
4764
4770
|
|
|
4765
4771
|
/**
|
|
4766
|
-
* sys_metadata_history — Metadata Version History
|
|
4772
|
+
* sys_metadata_history — Metadata Version History / Event Log
|
|
4767
4773
|
*
|
|
4768
|
-
*
|
|
4769
|
-
*
|
|
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
|
-
*
|
|
4772
|
-
*
|
|
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.
|
|
4785
|
+
*
|
|
4786
|
+
* • `event_seq` is the per-org monotonic event-log cursor. Producers
|
|
4787
|
+
* compute `MAX(event_seq) + 1 WHERE organization_id = X` inside the
|
|
4788
|
+
* same transaction as the parent `sys_metadata` write.
|
|
4789
|
+
*
|
|
4790
|
+
* • `version` is the per-(org,type,name) lineage counter. Producers
|
|
4791
|
+
* compute `MAX(version) + 1 WHERE organization_id = X AND type = T
|
|
4792
|
+
* AND name = N` so delete + recreate continues incrementing instead
|
|
4793
|
+
* of restarting at 1.
|
|
4794
|
+
*
|
|
4795
|
+
* • `metadata_id` is plain `text` (not a `lookup`) so DELETE rows can
|
|
4796
|
+
* keep the now-orphaned parent id for forensic auditing without a
|
|
4797
|
+
* foreign-key constraint blocking the hard delete.
|
|
4798
|
+
*
|
|
4799
|
+
* • `metadata` / `checksum` are nullable — DELETE rows have no body or
|
|
4800
|
+
* hash. Readers must tolerate null on both columns.
|
|
4773
4801
|
*
|
|
4774
|
-
*
|
|
4775
|
-
*
|
|
4802
|
+
* • `source` records the producer ('sys-metadata-repo', 'fs',
|
|
4803
|
+
* 'studio', …) and feeds MetadataEvent.source on history() reads.
|
|
4776
4804
|
*
|
|
4777
|
-
*
|
|
4805
|
+
* Indexes are purpose-built for the two dominant read patterns:
|
|
4806
|
+
* 1. per-item history view → `(organization_id, type, name, version)`
|
|
4807
|
+
* 2. org-wide event replay → `(organization_id, event_seq)`
|
|
4808
|
+
* ─────────────────────────────────────────────────────────────────────
|
|
4778
4809
|
*/
|
|
4779
4810
|
declare const SysMetadataHistoryObject: Omit<{
|
|
4780
4811
|
name: string;
|
|
@@ -5360,6 +5391,12 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
5360
5391
|
recordTypes?: string[] | undefined;
|
|
5361
5392
|
sharingModel?: "read" | "full" | "private" | "read_write" | undefined;
|
|
5362
5393
|
keyPrefix?: string | undefined;
|
|
5394
|
+
detail?: {
|
|
5395
|
+
[x: string]: unknown;
|
|
5396
|
+
renderViaSchema?: boolean | undefined;
|
|
5397
|
+
hideReferenceRail?: boolean | undefined;
|
|
5398
|
+
hideRelatedTab?: boolean | undefined;
|
|
5399
|
+
} | undefined;
|
|
5363
5400
|
actions?: {
|
|
5364
5401
|
name: string;
|
|
5365
5402
|
label: string;
|
|
@@ -5442,7 +5479,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
5442
5479
|
readonly icon: "history";
|
|
5443
5480
|
readonly isSystem: true;
|
|
5444
5481
|
readonly managedBy: "system";
|
|
5445
|
-
readonly description: "
|
|
5482
|
+
readonly description: "Durable event log of metadata overlay changes (per-org, append-only)";
|
|
5446
5483
|
readonly fields: {
|
|
5447
5484
|
/** Primary Key (UUID) */
|
|
5448
5485
|
readonly id: {
|
|
@@ -5620,7 +5657,188 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
5620
5657
|
readonly index?: boolean | undefined;
|
|
5621
5658
|
readonly type: "text";
|
|
5622
5659
|
};
|
|
5623
|
-
/**
|
|
5660
|
+
/** Per-org monotonic event sequence (durable cursor for replay). */
|
|
5661
|
+
readonly event_seq: {
|
|
5662
|
+
readonly readonly?: boolean | undefined;
|
|
5663
|
+
readonly format?: string | undefined;
|
|
5664
|
+
readonly options?: {
|
|
5665
|
+
label: string;
|
|
5666
|
+
value: string;
|
|
5667
|
+
color?: string | undefined;
|
|
5668
|
+
default?: boolean | undefined;
|
|
5669
|
+
}[] | undefined;
|
|
5670
|
+
readonly description?: string | undefined;
|
|
5671
|
+
readonly label?: string | undefined;
|
|
5672
|
+
readonly name?: string | undefined;
|
|
5673
|
+
readonly precision?: number | undefined;
|
|
5674
|
+
readonly required?: boolean | undefined;
|
|
5675
|
+
readonly multiple?: boolean | undefined;
|
|
5676
|
+
readonly dependencies?: string[] | undefined;
|
|
5677
|
+
readonly theme?: string | undefined;
|
|
5678
|
+
readonly externalId?: boolean | undefined;
|
|
5679
|
+
readonly system?: boolean | undefined;
|
|
5680
|
+
readonly min?: number | undefined;
|
|
5681
|
+
readonly max?: number | undefined;
|
|
5682
|
+
readonly group?: string | undefined;
|
|
5683
|
+
readonly encryptionConfig?: {
|
|
5684
|
+
enabled: boolean;
|
|
5685
|
+
algorithm: "aes-256-gcm" | "aes-256-cbc" | "chacha20-poly1305";
|
|
5686
|
+
keyManagement: {
|
|
5687
|
+
provider: "local" | "aws-kms" | "azure-key-vault" | "gcp-kms" | "hashicorp-vault";
|
|
5688
|
+
keyId?: string | undefined;
|
|
5689
|
+
rotationPolicy?: {
|
|
5690
|
+
enabled: boolean;
|
|
5691
|
+
frequencyDays: number;
|
|
5692
|
+
retainOldVersions: number;
|
|
5693
|
+
autoRotate: boolean;
|
|
5694
|
+
} | undefined;
|
|
5695
|
+
};
|
|
5696
|
+
scope: "record" | "field" | "table" | "database";
|
|
5697
|
+
deterministicEncryption: boolean;
|
|
5698
|
+
searchableEncryption: boolean;
|
|
5699
|
+
} | undefined;
|
|
5700
|
+
readonly columnName?: string | undefined;
|
|
5701
|
+
readonly searchable?: boolean | undefined;
|
|
5702
|
+
readonly unique?: boolean | undefined;
|
|
5703
|
+
readonly defaultValue?: unknown;
|
|
5704
|
+
readonly maxLength?: number | undefined;
|
|
5705
|
+
readonly minLength?: number | undefined;
|
|
5706
|
+
readonly scale?: number | undefined;
|
|
5707
|
+
readonly reference?: string | undefined;
|
|
5708
|
+
readonly referenceFilters?: string[] | undefined;
|
|
5709
|
+
readonly writeRequiresMasterRead?: boolean | undefined;
|
|
5710
|
+
readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
|
|
5711
|
+
readonly expression?: {
|
|
5712
|
+
dialect: "cel" | "js" | "cron" | "template";
|
|
5713
|
+
source?: string | undefined;
|
|
5714
|
+
ast?: unknown;
|
|
5715
|
+
meta?: {
|
|
5716
|
+
rationale?: string | undefined;
|
|
5717
|
+
generatedBy?: string | undefined;
|
|
5718
|
+
} | undefined;
|
|
5719
|
+
} | undefined;
|
|
5720
|
+
readonly summaryOperations?: {
|
|
5721
|
+
object: string;
|
|
5722
|
+
field: string;
|
|
5723
|
+
function: "min" | "max" | "count" | "sum" | "avg";
|
|
5724
|
+
} | undefined;
|
|
5725
|
+
readonly language?: string | undefined;
|
|
5726
|
+
readonly lineNumbers?: boolean | undefined;
|
|
5727
|
+
readonly maxRating?: number | undefined;
|
|
5728
|
+
readonly allowHalf?: boolean | undefined;
|
|
5729
|
+
readonly displayMap?: boolean | undefined;
|
|
5730
|
+
readonly allowGeocoding?: boolean | undefined;
|
|
5731
|
+
readonly addressFormat?: "us" | "uk" | "international" | undefined;
|
|
5732
|
+
readonly colorFormat?: "hex" | "rgb" | "rgba" | "hsl" | undefined;
|
|
5733
|
+
readonly allowAlpha?: boolean | undefined;
|
|
5734
|
+
readonly presetColors?: string[] | undefined;
|
|
5735
|
+
readonly step?: number | undefined;
|
|
5736
|
+
readonly showValue?: boolean | undefined;
|
|
5737
|
+
readonly marks?: Record<string, string> | undefined;
|
|
5738
|
+
readonly barcodeFormat?: "qr" | "ean13" | "ean8" | "code128" | "code39" | "upca" | "upce" | undefined;
|
|
5739
|
+
readonly qrErrorCorrection?: "L" | "M" | "Q" | "H" | undefined;
|
|
5740
|
+
readonly displayValue?: boolean | undefined;
|
|
5741
|
+
readonly allowScanning?: boolean | undefined;
|
|
5742
|
+
readonly currencyConfig?: {
|
|
5743
|
+
precision: number;
|
|
5744
|
+
currencyMode: "fixed" | "dynamic";
|
|
5745
|
+
defaultCurrency: string;
|
|
5746
|
+
} | undefined;
|
|
5747
|
+
readonly vectorConfig?: {
|
|
5748
|
+
dimensions: number;
|
|
5749
|
+
distanceMetric: "cosine" | "euclidean" | "dotProduct" | "manhattan";
|
|
5750
|
+
normalized: boolean;
|
|
5751
|
+
indexed: boolean;
|
|
5752
|
+
indexType?: "flat" | "hnsw" | "ivfflat" | undefined;
|
|
5753
|
+
} | undefined;
|
|
5754
|
+
readonly fileAttachmentConfig?: {
|
|
5755
|
+
virusScan: boolean;
|
|
5756
|
+
virusScanOnUpload: boolean;
|
|
5757
|
+
quarantineOnThreat: boolean;
|
|
5758
|
+
allowMultiple: boolean;
|
|
5759
|
+
allowReplace: boolean;
|
|
5760
|
+
allowDelete: boolean;
|
|
5761
|
+
requireUpload: boolean;
|
|
5762
|
+
extractMetadata: boolean;
|
|
5763
|
+
extractText: boolean;
|
|
5764
|
+
versioningEnabled: boolean;
|
|
5765
|
+
publicRead: boolean;
|
|
5766
|
+
presignedUrlExpiry: number;
|
|
5767
|
+
minSize?: number | undefined;
|
|
5768
|
+
maxSize?: number | undefined;
|
|
5769
|
+
allowedTypes?: string[] | undefined;
|
|
5770
|
+
blockedTypes?: string[] | undefined;
|
|
5771
|
+
allowedMimeTypes?: string[] | undefined;
|
|
5772
|
+
blockedMimeTypes?: string[] | undefined;
|
|
5773
|
+
virusScanProvider?: "custom" | "clamav" | "virustotal" | "metadefender" | undefined;
|
|
5774
|
+
storageProvider?: string | undefined;
|
|
5775
|
+
storageBucket?: string | undefined;
|
|
5776
|
+
storagePrefix?: string | undefined;
|
|
5777
|
+
imageValidation?: {
|
|
5778
|
+
generateThumbnails: boolean;
|
|
5779
|
+
preserveMetadata: boolean;
|
|
5780
|
+
autoRotate: boolean;
|
|
5781
|
+
minWidth?: number | undefined;
|
|
5782
|
+
maxWidth?: number | undefined;
|
|
5783
|
+
minHeight?: number | undefined;
|
|
5784
|
+
maxHeight?: number | undefined;
|
|
5785
|
+
aspectRatio?: string | undefined;
|
|
5786
|
+
thumbnailSizes?: {
|
|
5787
|
+
name: string;
|
|
5788
|
+
width: number;
|
|
5789
|
+
height: number;
|
|
5790
|
+
crop: boolean;
|
|
5791
|
+
}[] | undefined;
|
|
5792
|
+
} | undefined;
|
|
5793
|
+
maxVersions?: number | undefined;
|
|
5794
|
+
} | undefined;
|
|
5795
|
+
readonly maskingRule?: {
|
|
5796
|
+
field: string;
|
|
5797
|
+
strategy: "partial" | "hash" | "redact" | "tokenize" | "randomize" | "nullify" | "substitute";
|
|
5798
|
+
preserveFormat: boolean;
|
|
5799
|
+
preserveLength: boolean;
|
|
5800
|
+
pattern?: string | undefined;
|
|
5801
|
+
roles?: string[] | undefined;
|
|
5802
|
+
exemptRoles?: string[] | undefined;
|
|
5803
|
+
} | undefined;
|
|
5804
|
+
readonly auditTrail?: boolean | undefined;
|
|
5805
|
+
readonly cached?: {
|
|
5806
|
+
enabled: boolean;
|
|
5807
|
+
ttl: number;
|
|
5808
|
+
invalidateOn: string[];
|
|
5809
|
+
} | undefined;
|
|
5810
|
+
readonly dataQuality?: {
|
|
5811
|
+
uniqueness: boolean;
|
|
5812
|
+
completeness: number;
|
|
5813
|
+
accuracy?: {
|
|
5814
|
+
source: string;
|
|
5815
|
+
threshold: number;
|
|
5816
|
+
} | undefined;
|
|
5817
|
+
} | undefined;
|
|
5818
|
+
readonly conditionalRequired?: {
|
|
5819
|
+
dialect: "cel" | "js" | "cron" | "template";
|
|
5820
|
+
source?: string | undefined;
|
|
5821
|
+
ast?: unknown;
|
|
5822
|
+
meta?: {
|
|
5823
|
+
rationale?: string | undefined;
|
|
5824
|
+
generatedBy?: string | undefined;
|
|
5825
|
+
} | undefined;
|
|
5826
|
+
} | undefined;
|
|
5827
|
+
readonly hidden?: boolean | undefined;
|
|
5828
|
+
readonly sortable?: boolean | undefined;
|
|
5829
|
+
readonly inlineHelpText?: string | undefined;
|
|
5830
|
+
readonly trackFeedHistory?: boolean | undefined;
|
|
5831
|
+
readonly caseSensitive?: boolean | undefined;
|
|
5832
|
+
readonly autonumberFormat?: string | undefined;
|
|
5833
|
+
readonly index?: boolean | undefined;
|
|
5834
|
+
readonly type: "number";
|
|
5835
|
+
};
|
|
5836
|
+
/**
|
|
5837
|
+
* Parent `sys_metadata.id` at insertion time (plain text, no FK).
|
|
5838
|
+
* Null for events whose parent row no longer exists (e.g. some
|
|
5839
|
+
* delete records). Forensic only — joins should go through
|
|
5840
|
+
* `(organization_id, type, name)`.
|
|
5841
|
+
*/
|
|
5624
5842
|
readonly metadata_id: {
|
|
5625
5843
|
readonly readonly?: boolean | undefined;
|
|
5626
5844
|
readonly format?: string | undefined;
|
|
@@ -5667,7 +5885,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
5667
5885
|
readonly maxLength?: number | undefined;
|
|
5668
5886
|
readonly minLength?: number | undefined;
|
|
5669
5887
|
readonly scale?: number | undefined;
|
|
5670
|
-
reference
|
|
5888
|
+
readonly reference?: string | undefined;
|
|
5671
5889
|
readonly referenceFilters?: string[] | undefined;
|
|
5672
5890
|
readonly writeRequiresMasterRead?: boolean | undefined;
|
|
5673
5891
|
readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
|
|
@@ -5794,7 +6012,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
5794
6012
|
readonly caseSensitive?: boolean | undefined;
|
|
5795
6013
|
readonly autonumberFormat?: string | undefined;
|
|
5796
6014
|
readonly index?: boolean | undefined;
|
|
5797
|
-
readonly type: "
|
|
6015
|
+
readonly type: "text";
|
|
5798
6016
|
};
|
|
5799
6017
|
/** Machine name (denormalized for easier querying) */
|
|
5800
6018
|
readonly name: {
|
|
@@ -6148,7 +6366,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
6148
6366
|
readonly index?: boolean | undefined;
|
|
6149
6367
|
readonly type: "text";
|
|
6150
6368
|
};
|
|
6151
|
-
/**
|
|
6369
|
+
/** Per-(org,type,name) lineage counter at this snapshot. */
|
|
6152
6370
|
readonly version: {
|
|
6153
6371
|
readonly readonly?: boolean | undefined;
|
|
6154
6372
|
readonly format?: string | undefined;
|
|
@@ -6500,7 +6718,10 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
6500
6718
|
readonly index?: boolean | undefined;
|
|
6501
6719
|
readonly type: "select";
|
|
6502
6720
|
};
|
|
6503
|
-
/**
|
|
6721
|
+
/**
|
|
6722
|
+
* Historical metadata snapshot (JSON payload).
|
|
6723
|
+
* Null for `operation_type = 'delete'` — the row carries no body.
|
|
6724
|
+
*/
|
|
6504
6725
|
readonly metadata: {
|
|
6505
6726
|
readonly readonly?: boolean | undefined;
|
|
6506
6727
|
readonly format?: string | undefined;
|
|
@@ -6676,7 +6897,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
6676
6897
|
readonly index?: boolean | undefined;
|
|
6677
6898
|
readonly type: "textarea";
|
|
6678
6899
|
};
|
|
6679
|
-
/** SHA-256 checksum of metadata content */
|
|
6900
|
+
/** SHA-256 checksum of metadata content (null for deletes). */
|
|
6680
6901
|
readonly checksum: {
|
|
6681
6902
|
readonly readonly?: boolean | undefined;
|
|
6682
6903
|
readonly format?: string | undefined;
|
|
@@ -6852,7 +7073,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
6852
7073
|
readonly index?: boolean | undefined;
|
|
6853
7074
|
readonly type: "text";
|
|
6854
7075
|
};
|
|
6855
|
-
/** Checksum of the previous version */
|
|
7076
|
+
/** Checksum of the previous version (null for the first event). */
|
|
6856
7077
|
readonly previous_checksum: {
|
|
6857
7078
|
readonly readonly?: boolean | undefined;
|
|
6858
7079
|
readonly format?: string | undefined;
|
|
@@ -7028,7 +7249,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7028
7249
|
readonly index?: boolean | undefined;
|
|
7029
7250
|
readonly type: "text";
|
|
7030
7251
|
};
|
|
7031
|
-
/** Human-readable description of changes */
|
|
7252
|
+
/** Human-readable description of changes (= MetadataEvent.message). */
|
|
7032
7253
|
readonly change_note: {
|
|
7033
7254
|
readonly readonly?: boolean | undefined;
|
|
7034
7255
|
readonly format?: string | undefined;
|
|
@@ -7204,8 +7425,12 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7204
7425
|
readonly index?: boolean | undefined;
|
|
7205
7426
|
readonly type: "textarea";
|
|
7206
7427
|
};
|
|
7207
|
-
/**
|
|
7208
|
-
|
|
7428
|
+
/**
|
|
7429
|
+
* Producer of the event ('sys-metadata-repo', 'fs', 'studio',
|
|
7430
|
+
* 'api', …). Defaults to 'sys-metadata-repo' on the canonical
|
|
7431
|
+
* write path; preserved on history() reads as MetadataEvent.source.
|
|
7432
|
+
*/
|
|
7433
|
+
readonly source: {
|
|
7209
7434
|
readonly readonly?: boolean | undefined;
|
|
7210
7435
|
readonly format?: string | undefined;
|
|
7211
7436
|
readonly options?: {
|
|
@@ -7251,7 +7476,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7251
7476
|
readonly maxLength?: number | undefined;
|
|
7252
7477
|
readonly minLength?: number | undefined;
|
|
7253
7478
|
readonly scale?: number | undefined;
|
|
7254
|
-
reference
|
|
7479
|
+
readonly reference?: string | undefined;
|
|
7255
7480
|
readonly referenceFilters?: string[] | undefined;
|
|
7256
7481
|
readonly writeRequiresMasterRead?: boolean | undefined;
|
|
7257
7482
|
readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
|
|
@@ -7378,10 +7603,10 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7378
7603
|
readonly caseSensitive?: boolean | undefined;
|
|
7379
7604
|
readonly autonumberFormat?: string | undefined;
|
|
7380
7605
|
readonly index?: boolean | undefined;
|
|
7381
|
-
readonly type: "
|
|
7606
|
+
readonly type: "text";
|
|
7382
7607
|
};
|
|
7383
|
-
/**
|
|
7384
|
-
readonly
|
|
7608
|
+
/** Organization ID for multi-tenant isolation */
|
|
7609
|
+
readonly organization_id: {
|
|
7385
7610
|
readonly readonly?: boolean | undefined;
|
|
7386
7611
|
readonly format?: string | undefined;
|
|
7387
7612
|
readonly options?: {
|
|
@@ -7427,7 +7652,7 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7427
7652
|
readonly maxLength?: number | undefined;
|
|
7428
7653
|
readonly minLength?: number | undefined;
|
|
7429
7654
|
readonly scale?: number | undefined;
|
|
7430
|
-
|
|
7655
|
+
reference: string;
|
|
7431
7656
|
readonly referenceFilters?: string[] | undefined;
|
|
7432
7657
|
readonly writeRequiresMasterRead?: boolean | undefined;
|
|
7433
7658
|
readonly deleteBehavior?: "set_null" | "cascade" | "restrict" | undefined;
|
|
@@ -7554,9 +7779,9 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7554
7779
|
readonly caseSensitive?: boolean | undefined;
|
|
7555
7780
|
readonly autonumberFormat?: string | undefined;
|
|
7556
7781
|
readonly index?: boolean | undefined;
|
|
7557
|
-
readonly type: "
|
|
7782
|
+
readonly type: "lookup";
|
|
7558
7783
|
};
|
|
7559
|
-
/** User who made this change */
|
|
7784
|
+
/** User who made this change (= MetadataEvent.actor). */
|
|
7560
7785
|
readonly recorded_by: {
|
|
7561
7786
|
readonly readonly?: boolean | undefined;
|
|
7562
7787
|
readonly format?: string | undefined;
|
|
@@ -7910,20 +8135,19 @@ declare const SysMetadataHistoryObject: Omit<{
|
|
|
7910
8135
|
};
|
|
7911
8136
|
};
|
|
7912
8137
|
readonly indexes: [{
|
|
7913
|
-
readonly fields: ["
|
|
8138
|
+
readonly fields: ["organization_id", "event_seq"];
|
|
8139
|
+
readonly unique: true;
|
|
8140
|
+
}, {
|
|
8141
|
+
readonly fields: ["organization_id", "type", "name", "version"];
|
|
7914
8142
|
readonly unique: true;
|
|
7915
8143
|
}, {
|
|
7916
|
-
readonly fields: ["
|
|
8144
|
+
readonly fields: ["organization_id", "type", "name", "recorded_at"];
|
|
7917
8145
|
}, {
|
|
7918
8146
|
readonly fields: ["type", "name"];
|
|
7919
8147
|
}, {
|
|
7920
8148
|
readonly fields: ["recorded_at"];
|
|
7921
8149
|
}, {
|
|
7922
8150
|
readonly fields: ["operation_type"];
|
|
7923
|
-
}, {
|
|
7924
|
-
readonly fields: ["organization_id"];
|
|
7925
|
-
}, {
|
|
7926
|
-
readonly fields: ["project_id"];
|
|
7927
8151
|
}];
|
|
7928
8152
|
readonly enable: {
|
|
7929
8153
|
readonly trackHistory: false;
|
package/dist/metadata/index.js
CHANGED
|
@@ -125,11 +125,11 @@ var SysMetadataObject = data.ObjectSchema.create({
|
|
|
125
125
|
required: false,
|
|
126
126
|
defaultValue: 1
|
|
127
127
|
}),
|
|
128
|
-
/** Content checksum for change detection */
|
|
128
|
+
/** Content checksum for change detection (e.g. `sha256:<64 hex>` = 71 chars) */
|
|
129
129
|
checksum: data.Field.text({
|
|
130
130
|
label: "Checksum",
|
|
131
131
|
required: false,
|
|
132
|
-
maxLength:
|
|
132
|
+
maxLength: 71
|
|
133
133
|
}),
|
|
134
134
|
/** Origin of this metadata record */
|
|
135
135
|
source: data.Field.select(["filesystem", "database", "api", "migration"], {
|
|
@@ -196,7 +196,7 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
|
196
196
|
icon: "history",
|
|
197
197
|
isSystem: true,
|
|
198
198
|
managedBy: "system",
|
|
199
|
-
description: "
|
|
199
|
+
description: "Durable event log of metadata overlay changes (per-org, append-only)",
|
|
200
200
|
fields: {
|
|
201
201
|
/** Primary Key (UUID) */
|
|
202
202
|
id: data.Field.text({
|
|
@@ -204,11 +204,24 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
|
204
204
|
required: true,
|
|
205
205
|
readonly: true
|
|
206
206
|
}),
|
|
207
|
-
/**
|
|
208
|
-
|
|
209
|
-
label: "
|
|
207
|
+
/** Per-org monotonic event sequence (durable cursor for replay). */
|
|
208
|
+
event_seq: data.Field.number({
|
|
209
|
+
label: "Event Seq",
|
|
210
210
|
required: true,
|
|
211
|
-
readonly: true
|
|
211
|
+
readonly: true,
|
|
212
|
+
description: "Per-organization monotonic event log cursor."
|
|
213
|
+
}),
|
|
214
|
+
/**
|
|
215
|
+
* Parent `sys_metadata.id` at insertion time (plain text, no FK).
|
|
216
|
+
* Null for events whose parent row no longer exists (e.g. some
|
|
217
|
+
* delete records). Forensic only — joins should go through
|
|
218
|
+
* `(organization_id, type, name)`.
|
|
219
|
+
*/
|
|
220
|
+
metadata_id: data.Field.text({
|
|
221
|
+
label: "Metadata ID",
|
|
222
|
+
required: false,
|
|
223
|
+
readonly: true,
|
|
224
|
+
maxLength: 64
|
|
212
225
|
}),
|
|
213
226
|
/** Machine name (denormalized for easier querying) */
|
|
214
227
|
name: data.Field.text({
|
|
@@ -226,7 +239,7 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
|
226
239
|
readonly: true,
|
|
227
240
|
maxLength: 100
|
|
228
241
|
}),
|
|
229
|
-
/**
|
|
242
|
+
/** Per-(org,type,name) lineage counter at this snapshot. */
|
|
230
243
|
version: data.Field.number({
|
|
231
244
|
label: "Version",
|
|
232
245
|
required: true,
|
|
@@ -238,33 +251,47 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
|
238
251
|
required: true,
|
|
239
252
|
readonly: true
|
|
240
253
|
}),
|
|
241
|
-
/**
|
|
254
|
+
/**
|
|
255
|
+
* Historical metadata snapshot (JSON payload).
|
|
256
|
+
* Null for `operation_type = 'delete'` — the row carries no body.
|
|
257
|
+
*/
|
|
242
258
|
metadata: data.Field.textarea({
|
|
243
259
|
label: "Metadata",
|
|
244
|
-
required:
|
|
260
|
+
required: false,
|
|
245
261
|
readonly: true,
|
|
246
|
-
description: "JSON-serialized metadata snapshot at this version"
|
|
262
|
+
description: "JSON-serialized metadata snapshot at this version (null for deletes)."
|
|
247
263
|
}),
|
|
248
|
-
/** SHA-256 checksum of metadata content */
|
|
264
|
+
/** SHA-256 checksum of metadata content (null for deletes). */
|
|
249
265
|
checksum: data.Field.text({
|
|
250
266
|
label: "Checksum",
|
|
251
|
-
required:
|
|
267
|
+
required: false,
|
|
252
268
|
readonly: true,
|
|
253
|
-
maxLength:
|
|
269
|
+
maxLength: 80
|
|
254
270
|
}),
|
|
255
|
-
/** Checksum of the previous version */
|
|
271
|
+
/** Checksum of the previous version (null for the first event). */
|
|
256
272
|
previous_checksum: data.Field.text({
|
|
257
273
|
label: "Previous Checksum",
|
|
258
274
|
required: false,
|
|
259
275
|
readonly: true,
|
|
260
|
-
maxLength:
|
|
276
|
+
maxLength: 80
|
|
261
277
|
}),
|
|
262
|
-
/** Human-readable description of changes */
|
|
278
|
+
/** Human-readable description of changes (= MetadataEvent.message). */
|
|
263
279
|
change_note: data.Field.textarea({
|
|
264
280
|
label: "Change Note",
|
|
265
281
|
required: false,
|
|
266
282
|
readonly: true,
|
|
267
|
-
description: "Description of what changed in this version"
|
|
283
|
+
description: "Description of what changed in this version."
|
|
284
|
+
}),
|
|
285
|
+
/**
|
|
286
|
+
* Producer of the event ('sys-metadata-repo', 'fs', 'studio',
|
|
287
|
+
* 'api', …). Defaults to 'sys-metadata-repo' on the canonical
|
|
288
|
+
* write path; preserved on history() reads as MetadataEvent.source.
|
|
289
|
+
*/
|
|
290
|
+
source: data.Field.text({
|
|
291
|
+
label: "Source",
|
|
292
|
+
required: false,
|
|
293
|
+
readonly: true,
|
|
294
|
+
maxLength: 64
|
|
268
295
|
}),
|
|
269
296
|
/** Organization ID for multi-tenant isolation */
|
|
270
297
|
organization_id: data.Field.lookup("sys_organization", {
|
|
@@ -273,15 +300,7 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
|
273
300
|
readonly: true,
|
|
274
301
|
description: "Organization for multi-tenant isolation."
|
|
275
302
|
}),
|
|
276
|
-
/**
|
|
277
|
-
project_id: data.Field.text({
|
|
278
|
-
label: "Environment ID",
|
|
279
|
-
required: false,
|
|
280
|
-
readonly: true,
|
|
281
|
-
maxLength: 255,
|
|
282
|
-
description: "Scopes this history entry to a specific environment."
|
|
283
|
-
}),
|
|
284
|
-
/** User who made this change */
|
|
303
|
+
/** User who made this change (= MetadataEvent.actor). */
|
|
285
304
|
recorded_by: data.Field.lookup("sys_user", {
|
|
286
305
|
label: "Recorded By",
|
|
287
306
|
required: false,
|
|
@@ -295,21 +314,18 @@ var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
|
295
314
|
})
|
|
296
315
|
},
|
|
297
316
|
indexes: [
|
|
298
|
-
{ fields: ["
|
|
299
|
-
{ fields: ["
|
|
317
|
+
{ fields: ["organization_id", "event_seq"], unique: true },
|
|
318
|
+
{ fields: ["organization_id", "type", "name", "version"], unique: true },
|
|
319
|
+
{ fields: ["organization_id", "type", "name", "recorded_at"] },
|
|
300
320
|
{ fields: ["type", "name"] },
|
|
301
321
|
{ fields: ["recorded_at"] },
|
|
302
|
-
{ fields: ["operation_type"] }
|
|
303
|
-
{ fields: ["organization_id"] },
|
|
304
|
-
{ fields: ["project_id"] }
|
|
322
|
+
{ fields: ["operation_type"] }
|
|
305
323
|
],
|
|
306
324
|
enable: {
|
|
307
325
|
trackHistory: false,
|
|
308
|
-
// Don't track history of history records
|
|
309
326
|
searchable: false,
|
|
310
327
|
apiEnabled: true,
|
|
311
328
|
apiMethods: ["get", "list"],
|
|
312
|
-
// Read-only via API
|
|
313
329
|
trash: false
|
|
314
330
|
}
|
|
315
331
|
});
|