@objectstack/platform-objects 7.6.0 → 7.8.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/apps/index.d.mts +1 -1
- package/dist/apps/index.d.ts +1 -1
- package/dist/audit/index.d.mts +18 -18
- package/dist/audit/index.d.ts +18 -18
- package/dist/identity/index.d.mts +40 -40
- package/dist/identity/index.d.ts +40 -40
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -597
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -593
- package/dist/index.mjs.map +1 -1
- package/dist/metadata/index.d.mts +1 -15012
- package/dist/metadata/index.d.ts +1 -15012
- package/dist/metadata/index.js +19 -588
- package/dist/metadata/index.js.map +1 -1
- package/dist/metadata/index.mjs +1 -589
- package/dist/metadata/index.mjs.map +1 -1
- package/dist/security/index.d.mts +1 -2
- package/dist/security/index.d.ts +1 -2
- package/dist/system/index.d.mts +13 -17
- package/dist/system/index.d.ts +13 -17
- package/dist/system/index.js +4 -8
- package/dist/system/index.js.map +1 -1
- package/dist/system/index.mjs +4 -8
- package/dist/system/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var data = require('@objectstack/spec/data');
|
|
4
|
+
var metadataCore = require('@objectstack/metadata-core');
|
|
4
5
|
var ui = require('@objectstack/spec/ui');
|
|
5
6
|
|
|
6
7
|
// src/identity/sys-user.object.ts
|
|
@@ -4068,590 +4069,6 @@ var SysJobQueue = data.ObjectSchema.create({
|
|
|
4068
4069
|
{ fields: ["status"] }
|
|
4069
4070
|
]
|
|
4070
4071
|
});
|
|
4071
|
-
var SysMetadataObject = data.ObjectSchema.create({
|
|
4072
|
-
name: "sys_metadata",
|
|
4073
|
-
label: "System Metadata",
|
|
4074
|
-
pluralLabel: "System Metadata",
|
|
4075
|
-
icon: "settings",
|
|
4076
|
-
isSystem: true,
|
|
4077
|
-
// managedBy: 'system' — the metadata table backs every other config
|
|
4078
|
-
// object. Writing rows directly here bypasses the typed Zod APIs and
|
|
4079
|
-
// would let an admin inject malformed payloads. The "All Metadata"
|
|
4080
|
-
// menu is therefore a read-only debug surface (Export only); typed
|
|
4081
|
-
// edits flow through the dedicated per-type pages (Approval Process,
|
|
4082
|
-
// Sharing Rule, etc.).
|
|
4083
|
-
managedBy: "system",
|
|
4084
|
-
description: "Stores platform and user-scope metadata records (objects, views, flows, etc.)",
|
|
4085
|
-
fields: {
|
|
4086
|
-
/** Primary Key (UUID) */
|
|
4087
|
-
id: data.Field.text({
|
|
4088
|
-
label: "ID",
|
|
4089
|
-
required: true,
|
|
4090
|
-
readonly: true
|
|
4091
|
-
}),
|
|
4092
|
-
/** Machine name — unique identifier used in code references */
|
|
4093
|
-
name: data.Field.text({
|
|
4094
|
-
label: "Name",
|
|
4095
|
-
required: true,
|
|
4096
|
-
searchable: true,
|
|
4097
|
-
maxLength: 255
|
|
4098
|
-
}),
|
|
4099
|
-
/** Metadata type (e.g. "object", "view", "flow") */
|
|
4100
|
-
type: data.Field.text({
|
|
4101
|
-
label: "Metadata Type",
|
|
4102
|
-
required: true,
|
|
4103
|
-
searchable: true,
|
|
4104
|
-
maxLength: 100
|
|
4105
|
-
}),
|
|
4106
|
-
/** Namespace / module grouping (e.g. "crm", "core") */
|
|
4107
|
-
namespace: data.Field.text({
|
|
4108
|
-
label: "Namespace",
|
|
4109
|
-
required: false,
|
|
4110
|
-
defaultValue: "default",
|
|
4111
|
-
maxLength: 100
|
|
4112
|
-
}),
|
|
4113
|
-
/** Package that owns/delivered this metadata (legacy string identifier, kept for compat) */
|
|
4114
|
-
package_id: data.Field.text({
|
|
4115
|
-
label: "Package ID",
|
|
4116
|
-
required: false,
|
|
4117
|
-
maxLength: 255,
|
|
4118
|
-
description: "Legacy package manifest ID string. Use package_version_id for new records."
|
|
4119
|
-
}),
|
|
4120
|
-
/**
|
|
4121
|
-
* FK → sys_package_version (UUID). Set for metadata that belongs to a specific
|
|
4122
|
-
* package release snapshot. NULL = platform-built-in or environment override.
|
|
4123
|
-
*/
|
|
4124
|
-
package_version_id: data.Field.lookup("sys_package_version", {
|
|
4125
|
-
label: "Package Version",
|
|
4126
|
-
required: false,
|
|
4127
|
-
description: "Foreign key to sys_package_version (UUID). Null = platform-built-in or env-level override."
|
|
4128
|
-
}),
|
|
4129
|
-
/** Who manages this record: package, platform, or user */
|
|
4130
|
-
managed_by: data.Field.select(["package", "platform", "user"], {
|
|
4131
|
-
label: "Managed By",
|
|
4132
|
-
required: false
|
|
4133
|
-
}),
|
|
4134
|
-
/** Scope: system (code), platform (admin DB), user (personal DB) */
|
|
4135
|
-
scope: data.Field.select(["system", "platform", "user"], {
|
|
4136
|
-
label: "Scope",
|
|
4137
|
-
required: true,
|
|
4138
|
-
defaultValue: "platform"
|
|
4139
|
-
}),
|
|
4140
|
-
/** JSON payload — the actual metadata configuration */
|
|
4141
|
-
metadata: data.Field.textarea({
|
|
4142
|
-
label: "Metadata",
|
|
4143
|
-
required: true,
|
|
4144
|
-
description: "JSON-serialized metadata payload"
|
|
4145
|
-
}),
|
|
4146
|
-
/** Parent metadata name for extension/override */
|
|
4147
|
-
extends: data.Field.text({
|
|
4148
|
-
label: "Extends",
|
|
4149
|
-
required: false,
|
|
4150
|
-
maxLength: 255
|
|
4151
|
-
}),
|
|
4152
|
-
/** Merge strategy when extending parent metadata */
|
|
4153
|
-
strategy: data.Field.select(["merge", "replace"], {
|
|
4154
|
-
label: "Strategy",
|
|
4155
|
-
required: false,
|
|
4156
|
-
defaultValue: "merge"
|
|
4157
|
-
}),
|
|
4158
|
-
/** Owner user ID (for user-scope items) */
|
|
4159
|
-
owner: data.Field.text({
|
|
4160
|
-
label: "Owner",
|
|
4161
|
-
required: false,
|
|
4162
|
-
maxLength: 255
|
|
4163
|
-
}),
|
|
4164
|
-
/** Lifecycle state */
|
|
4165
|
-
state: data.Field.select(["draft", "active", "archived", "deprecated"], {
|
|
4166
|
-
label: "State",
|
|
4167
|
-
required: false,
|
|
4168
|
-
defaultValue: "active"
|
|
4169
|
-
}),
|
|
4170
|
-
/** Organization ID for multi-tenant isolation */
|
|
4171
|
-
organization_id: data.Field.lookup("sys_organization", {
|
|
4172
|
-
label: "Organization",
|
|
4173
|
-
required: false,
|
|
4174
|
-
description: "Organization for multi-tenant isolation."
|
|
4175
|
-
}),
|
|
4176
|
-
/**
|
|
4177
|
-
* @deprecated ADR-0005 (revised 2026-05): per-env DBs replace per-project
|
|
4178
|
-
* isolation. `environment_id` is no longer written by saveMetaItem and not
|
|
4179
|
-
* consulted by overlay reads. Kept for legacy rows; new writes leave it
|
|
4180
|
-
* NULL. Will be dropped in a future schema migration.
|
|
4181
|
-
*/
|
|
4182
|
-
environment_id: data.Field.lookup("sys_environment", {
|
|
4183
|
-
label: "Environment (deprecated)",
|
|
4184
|
-
required: false,
|
|
4185
|
-
description: "DEPRECATED. Use organization_id for tenant isolation."
|
|
4186
|
-
}),
|
|
4187
|
-
/** Version number for optimistic concurrency */
|
|
4188
|
-
version: data.Field.number({
|
|
4189
|
-
label: "Version",
|
|
4190
|
-
required: false,
|
|
4191
|
-
defaultValue: 1
|
|
4192
|
-
}),
|
|
4193
|
-
/** Content checksum for change detection (e.g. `sha256:<64 hex>` = 71 chars) */
|
|
4194
|
-
checksum: data.Field.text({
|
|
4195
|
-
label: "Checksum",
|
|
4196
|
-
required: false,
|
|
4197
|
-
maxLength: 71
|
|
4198
|
-
}),
|
|
4199
|
-
/** Origin of this metadata record */
|
|
4200
|
-
source: data.Field.select(["filesystem", "database", "api", "migration"], {
|
|
4201
|
-
label: "Source",
|
|
4202
|
-
required: false
|
|
4203
|
-
}),
|
|
4204
|
-
/** Classification tags (JSON array) */
|
|
4205
|
-
tags: data.Field.textarea({
|
|
4206
|
-
label: "Tags",
|
|
4207
|
-
required: false,
|
|
4208
|
-
description: "JSON-serialized array of classification tags"
|
|
4209
|
-
}),
|
|
4210
|
-
/** Audit fields */
|
|
4211
|
-
created_by: data.Field.lookup("sys_user", {
|
|
4212
|
-
label: "Created By",
|
|
4213
|
-
required: false,
|
|
4214
|
-
readonly: true
|
|
4215
|
-
}),
|
|
4216
|
-
created_at: data.Field.datetime({
|
|
4217
|
-
label: "Created At",
|
|
4218
|
-
required: false,
|
|
4219
|
-
readonly: true
|
|
4220
|
-
}),
|
|
4221
|
-
updated_by: data.Field.lookup("sys_user", {
|
|
4222
|
-
label: "Updated By",
|
|
4223
|
-
required: false
|
|
4224
|
-
}),
|
|
4225
|
-
updated_at: data.Field.datetime({
|
|
4226
|
-
label: "Updated At",
|
|
4227
|
-
required: false
|
|
4228
|
-
})
|
|
4229
|
-
},
|
|
4230
|
-
indexes: [
|
|
4231
|
-
// ADR-0005 (revised 2026-05): overlay uniqueness is scoped by
|
|
4232
|
-
// (type, name, organization_id), restricted to active rows so resets
|
|
4233
|
-
// / archived versions don't collide. environment_id is deprecated and
|
|
4234
|
-
// not part of the discriminator. The runtime layer (protocol.ts
|
|
4235
|
-
// ensureOverlayIndex) issues a DROP-then-CREATE migration to
|
|
4236
|
-
// replace any pre-existing legacy composite index in-place.
|
|
4237
|
-
{
|
|
4238
|
-
name: "idx_sys_metadata_overlay_active",
|
|
4239
|
-
fields: ["type", "name", "organization_id"],
|
|
4240
|
-
unique: true,
|
|
4241
|
-
partial: "state = 'active'"
|
|
4242
|
-
},
|
|
4243
|
-
{ name: "idx_sys_metadata_org_type", fields: ["organization_id", "type"] },
|
|
4244
|
-
{ fields: ["type", "scope"] },
|
|
4245
|
-
{ fields: ["package_version_id"] },
|
|
4246
|
-
{ fields: ["state"] },
|
|
4247
|
-
{ fields: ["namespace"] }
|
|
4248
|
-
],
|
|
4249
|
-
enable: {
|
|
4250
|
-
trackHistory: true,
|
|
4251
|
-
searchable: false,
|
|
4252
|
-
apiEnabled: true,
|
|
4253
|
-
apiMethods: ["get", "list", "create", "update", "delete"],
|
|
4254
|
-
trash: false
|
|
4255
|
-
},
|
|
4256
|
-
// Named list views — power the Setup App "Data Model" group so admins
|
|
4257
|
-
// can browse object/field metadata in a typed grid instead of the raw
|
|
4258
|
-
// `All Metadata` debug surface. Each entry pre-filters by `type` and
|
|
4259
|
-
// shows the columns that matter for that type. The dedicated visual
|
|
4260
|
-
// designer (objectui's <ObjectManager> / <FieldDesigner>) deep-links
|
|
4261
|
-
// from the row's `Edit in Designer` action; the grid stays useful for
|
|
4262
|
-
// search, audit (state / updated_at) and triage.
|
|
4263
|
-
listViews: {
|
|
4264
|
-
only_objects: {
|
|
4265
|
-
type: "grid",
|
|
4266
|
-
name: "only_objects",
|
|
4267
|
-
label: "Objects",
|
|
4268
|
-
data: { provider: "object", object: "sys_metadata" },
|
|
4269
|
-
columns: ["name", "namespace", "scope", "managed_by", "state", "updated_at"],
|
|
4270
|
-
filter: [{ field: "type", operator: "equals", value: "object" }],
|
|
4271
|
-
sort: [{ field: "name", order: "asc" }],
|
|
4272
|
-
pagination: { pageSize: 50 }
|
|
4273
|
-
},
|
|
4274
|
-
only_fields: {
|
|
4275
|
-
type: "grid",
|
|
4276
|
-
name: "only_fields",
|
|
4277
|
-
label: "Fields",
|
|
4278
|
-
data: { provider: "object", object: "sys_metadata" },
|
|
4279
|
-
columns: ["name", "namespace", "scope", "managed_by", "state", "updated_at"],
|
|
4280
|
-
filter: [{ field: "type", operator: "equals", value: "field" }],
|
|
4281
|
-
sort: [{ field: "name", order: "asc" }],
|
|
4282
|
-
pagination: { pageSize: 50 }
|
|
4283
|
-
},
|
|
4284
|
-
all_metadata: {
|
|
4285
|
-
type: "grid",
|
|
4286
|
-
name: "all_metadata",
|
|
4287
|
-
label: "All",
|
|
4288
|
-
data: { provider: "object", object: "sys_metadata" },
|
|
4289
|
-
columns: ["name", "type", "namespace", "scope", "state", "updated_at"],
|
|
4290
|
-
sort: [{ field: "updated_at", order: "desc" }],
|
|
4291
|
-
pagination: { pageSize: 50 }
|
|
4292
|
-
}
|
|
4293
|
-
}
|
|
4294
|
-
});
|
|
4295
|
-
var SysMetadataHistoryObject = data.ObjectSchema.create({
|
|
4296
|
-
name: "sys_metadata_history",
|
|
4297
|
-
label: "Metadata History",
|
|
4298
|
-
pluralLabel: "Metadata History",
|
|
4299
|
-
icon: "history",
|
|
4300
|
-
isSystem: true,
|
|
4301
|
-
managedBy: "system",
|
|
4302
|
-
description: "Durable event log of metadata overlay changes (per-org, append-only)",
|
|
4303
|
-
fields: {
|
|
4304
|
-
/** Primary Key (UUID) */
|
|
4305
|
-
id: data.Field.text({
|
|
4306
|
-
label: "ID",
|
|
4307
|
-
required: true,
|
|
4308
|
-
readonly: true
|
|
4309
|
-
}),
|
|
4310
|
-
/** Per-org monotonic event sequence (durable cursor for replay). */
|
|
4311
|
-
event_seq: data.Field.number({
|
|
4312
|
-
label: "Event Seq",
|
|
4313
|
-
required: true,
|
|
4314
|
-
readonly: true,
|
|
4315
|
-
description: "Per-organization monotonic event log cursor."
|
|
4316
|
-
}),
|
|
4317
|
-
/** Machine name (denormalized for easier querying) */
|
|
4318
|
-
name: data.Field.text({
|
|
4319
|
-
label: "Name",
|
|
4320
|
-
required: true,
|
|
4321
|
-
searchable: true,
|
|
4322
|
-
readonly: true,
|
|
4323
|
-
maxLength: 255
|
|
4324
|
-
}),
|
|
4325
|
-
/** Metadata type (denormalized for easier querying) */
|
|
4326
|
-
type: data.Field.text({
|
|
4327
|
-
label: "Metadata Type",
|
|
4328
|
-
required: true,
|
|
4329
|
-
searchable: true,
|
|
4330
|
-
readonly: true,
|
|
4331
|
-
maxLength: 100
|
|
4332
|
-
}),
|
|
4333
|
-
/** Per-(org,type,name) lineage counter at this snapshot. */
|
|
4334
|
-
version: data.Field.number({
|
|
4335
|
-
label: "Version",
|
|
4336
|
-
required: true,
|
|
4337
|
-
readonly: true
|
|
4338
|
-
}),
|
|
4339
|
-
/** Type of operation that created this history entry */
|
|
4340
|
-
operation_type: data.Field.select(["create", "update", "publish", "revert", "delete"], {
|
|
4341
|
-
label: "Operation Type",
|
|
4342
|
-
required: true,
|
|
4343
|
-
readonly: true
|
|
4344
|
-
}),
|
|
4345
|
-
/**
|
|
4346
|
-
* Historical metadata snapshot (JSON payload).
|
|
4347
|
-
* Null for `operation_type = 'delete'` — the row carries no body.
|
|
4348
|
-
*/
|
|
4349
|
-
metadata: data.Field.textarea({
|
|
4350
|
-
label: "Metadata",
|
|
4351
|
-
required: false,
|
|
4352
|
-
readonly: true,
|
|
4353
|
-
description: "JSON-serialized metadata snapshot at this version (null for deletes)."
|
|
4354
|
-
}),
|
|
4355
|
-
/** SHA-256 checksum of metadata content (null for deletes). */
|
|
4356
|
-
checksum: data.Field.text({
|
|
4357
|
-
label: "Checksum",
|
|
4358
|
-
required: false,
|
|
4359
|
-
readonly: true,
|
|
4360
|
-
maxLength: 80
|
|
4361
|
-
}),
|
|
4362
|
-
/** Checksum of the previous version (null for the first event). */
|
|
4363
|
-
previous_checksum: data.Field.text({
|
|
4364
|
-
label: "Previous Checksum",
|
|
4365
|
-
required: false,
|
|
4366
|
-
readonly: true,
|
|
4367
|
-
maxLength: 80
|
|
4368
|
-
}),
|
|
4369
|
-
/** Human-readable description of changes (= MetadataEvent.message). */
|
|
4370
|
-
change_note: data.Field.textarea({
|
|
4371
|
-
label: "Change Note",
|
|
4372
|
-
required: false,
|
|
4373
|
-
readonly: true,
|
|
4374
|
-
description: "Description of what changed in this version."
|
|
4375
|
-
}),
|
|
4376
|
-
/**
|
|
4377
|
-
* Producer of the event ('sys-metadata-repo', 'fs', 'studio',
|
|
4378
|
-
* 'api', …). Defaults to 'sys-metadata-repo' on the canonical
|
|
4379
|
-
* write path; preserved on history() reads as MetadataEvent.source.
|
|
4380
|
-
*/
|
|
4381
|
-
source: data.Field.text({
|
|
4382
|
-
label: "Source",
|
|
4383
|
-
required: false,
|
|
4384
|
-
readonly: true,
|
|
4385
|
-
maxLength: 64
|
|
4386
|
-
}),
|
|
4387
|
-
/** Organization ID for multi-tenant isolation */
|
|
4388
|
-
organization_id: data.Field.lookup("sys_organization", {
|
|
4389
|
-
label: "Organization",
|
|
4390
|
-
required: false,
|
|
4391
|
-
readonly: true,
|
|
4392
|
-
description: "Organization for multi-tenant isolation."
|
|
4393
|
-
}),
|
|
4394
|
-
/** User who made this change (= MetadataEvent.actor). */
|
|
4395
|
-
recorded_by: data.Field.lookup("sys_user", {
|
|
4396
|
-
label: "Recorded By",
|
|
4397
|
-
required: false,
|
|
4398
|
-
readonly: true
|
|
4399
|
-
}),
|
|
4400
|
-
/** When was this version recorded */
|
|
4401
|
-
recorded_at: data.Field.datetime({
|
|
4402
|
-
label: "Recorded At",
|
|
4403
|
-
required: true,
|
|
4404
|
-
readonly: true
|
|
4405
|
-
})
|
|
4406
|
-
},
|
|
4407
|
-
indexes: [
|
|
4408
|
-
{ fields: ["organization_id", "event_seq"], unique: true },
|
|
4409
|
-
{ fields: ["organization_id", "type", "name", "version"], unique: true },
|
|
4410
|
-
{ fields: ["organization_id", "type", "name", "recorded_at"] },
|
|
4411
|
-
// ADR-0009: getByHash() lookup — execution-pinned types resolve a
|
|
4412
|
-
// historical body by content hash via this index.
|
|
4413
|
-
{ fields: ["organization_id", "type", "name", "checksum"] },
|
|
4414
|
-
{ fields: ["type", "name"] },
|
|
4415
|
-
{ fields: ["recorded_at"] },
|
|
4416
|
-
{ fields: ["operation_type"] }
|
|
4417
|
-
],
|
|
4418
|
-
enable: {
|
|
4419
|
-
trackHistory: false,
|
|
4420
|
-
searchable: false,
|
|
4421
|
-
apiEnabled: true,
|
|
4422
|
-
apiMethods: ["get", "list"],
|
|
4423
|
-
trash: false
|
|
4424
|
-
}
|
|
4425
|
-
});
|
|
4426
|
-
var SysMetadataAuditObject = data.ObjectSchema.create({
|
|
4427
|
-
name: "sys_metadata_audit",
|
|
4428
|
-
label: "Metadata Audit",
|
|
4429
|
-
pluralLabel: "Metadata Audit",
|
|
4430
|
-
icon: "shield-check",
|
|
4431
|
-
isSystem: true,
|
|
4432
|
-
managedBy: "append-only",
|
|
4433
|
-
description: "Append-only audit trail of metadata write decisions (ADR-0010).",
|
|
4434
|
-
fields: {
|
|
4435
|
-
/** Primary Key (UUID) */
|
|
4436
|
-
id: data.Field.text({
|
|
4437
|
-
label: "ID",
|
|
4438
|
-
required: true,
|
|
4439
|
-
readonly: true
|
|
4440
|
-
}),
|
|
4441
|
-
/** When the decision was made (ISO-8601 UTC). */
|
|
4442
|
-
occurred_at: data.Field.datetime({
|
|
4443
|
-
label: "Occurred At",
|
|
4444
|
-
required: true,
|
|
4445
|
-
readonly: true
|
|
4446
|
-
}),
|
|
4447
|
-
/** Acting principal (user id, system id, or 'system'). */
|
|
4448
|
-
actor: data.Field.text({
|
|
4449
|
-
label: "Actor",
|
|
4450
|
-
required: true,
|
|
4451
|
-
readonly: true,
|
|
4452
|
-
maxLength: 255,
|
|
4453
|
-
description: 'Acting principal \u2014 user id, system id, or "system".'
|
|
4454
|
-
}),
|
|
4455
|
-
/** Code path that produced the decision (e.g. `protocol.saveMetaItem`). */
|
|
4456
|
-
source: data.Field.text({
|
|
4457
|
-
label: "Source",
|
|
4458
|
-
required: false,
|
|
4459
|
-
readonly: true,
|
|
4460
|
-
maxLength: 128
|
|
4461
|
-
}),
|
|
4462
|
-
/** Metadata type (singular, e.g. `app`, `object`, `view`). */
|
|
4463
|
-
type: data.Field.text({
|
|
4464
|
-
label: "Metadata Type",
|
|
4465
|
-
required: true,
|
|
4466
|
-
readonly: true,
|
|
4467
|
-
searchable: true,
|
|
4468
|
-
maxLength: 100
|
|
4469
|
-
}),
|
|
4470
|
-
/** Item machine name. */
|
|
4471
|
-
name: data.Field.text({
|
|
4472
|
-
label: "Name",
|
|
4473
|
-
required: true,
|
|
4474
|
-
readonly: true,
|
|
4475
|
-
searchable: true,
|
|
4476
|
-
maxLength: 255
|
|
4477
|
-
}),
|
|
4478
|
-
/** Organization for multi-tenant filtering. NULL for env-wide writes. */
|
|
4479
|
-
organization_id: data.Field.lookup("sys_organization", {
|
|
4480
|
-
label: "Organization",
|
|
4481
|
-
required: false,
|
|
4482
|
-
readonly: true
|
|
4483
|
-
}),
|
|
4484
|
-
/** Operation kind. */
|
|
4485
|
-
operation: data.Field.select(["save", "publish", "rollback", "delete", "reset"], {
|
|
4486
|
-
label: "Operation",
|
|
4487
|
-
required: true,
|
|
4488
|
-
readonly: true
|
|
4489
|
-
}),
|
|
4490
|
-
/** Decision outcome — allowed, denied (refused), or forced (bypassed via override). */
|
|
4491
|
-
outcome: data.Field.select(["allowed", "denied", "forced"], {
|
|
4492
|
-
label: "Outcome",
|
|
4493
|
-
required: true,
|
|
4494
|
-
readonly: true
|
|
4495
|
-
}),
|
|
4496
|
-
/**
|
|
4497
|
-
* Machine-readable code for the decision:
|
|
4498
|
-
* - on `allowed`: `'ok'`
|
|
4499
|
-
* - on `denied`: `'not_overridable'` | `'not_creatable'` |
|
|
4500
|
-
* `'item_locked'` | `'invalid_metadata'` | `'destructive_change'` |
|
|
4501
|
-
* `'metadata_conflict'`
|
|
4502
|
-
* - on `forced`: `'lock_override'` (Phase 3)
|
|
4503
|
-
*/
|
|
4504
|
-
code: data.Field.text({
|
|
4505
|
-
label: "Code",
|
|
4506
|
-
required: true,
|
|
4507
|
-
readonly: true,
|
|
4508
|
-
maxLength: 64
|
|
4509
|
-
}),
|
|
4510
|
-
/**
|
|
4511
|
-
* Lock state observed at the time of the decision (`none` if the
|
|
4512
|
-
* item carried no `_lock`). Captured even on `allowed` rows so
|
|
4513
|
-
* later compliance queries can see "what was the lock state when
|
|
4514
|
-
* this write succeeded".
|
|
4515
|
-
*/
|
|
4516
|
-
lock_state: data.Field.select(["none", "no-overlay", "no-delete", "full"], {
|
|
4517
|
-
label: "Lock State",
|
|
4518
|
-
required: false,
|
|
4519
|
-
readonly: true
|
|
4520
|
-
}),
|
|
4521
|
-
/** True when the write succeeded by bypassing a lock (Phase 3). */
|
|
4522
|
-
lock_overridden: data.Field.boolean({
|
|
4523
|
-
label: "Lock Overridden",
|
|
4524
|
-
required: false,
|
|
4525
|
-
readonly: true
|
|
4526
|
-
}),
|
|
4527
|
-
/** Optional request correlation id for tracing. */
|
|
4528
|
-
request_id: data.Field.text({
|
|
4529
|
-
label: "Request ID",
|
|
4530
|
-
required: false,
|
|
4531
|
-
readonly: true,
|
|
4532
|
-
maxLength: 128
|
|
4533
|
-
}),
|
|
4534
|
-
/** Optional free-form context (e.g. brief diff summary). */
|
|
4535
|
-
note: data.Field.textarea({
|
|
4536
|
-
label: "Note",
|
|
4537
|
-
required: false,
|
|
4538
|
-
readonly: true
|
|
4539
|
-
})
|
|
4540
|
-
},
|
|
4541
|
-
indexes: [
|
|
4542
|
-
{ fields: ["organization_id", "occurred_at"] },
|
|
4543
|
-
{ fields: ["type", "name", "occurred_at"] },
|
|
4544
|
-
{ fields: ["actor", "occurred_at"] },
|
|
4545
|
-
{ fields: ["outcome"] }
|
|
4546
|
-
],
|
|
4547
|
-
enable: {
|
|
4548
|
-
trackHistory: false,
|
|
4549
|
-
searchable: false,
|
|
4550
|
-
apiEnabled: true,
|
|
4551
|
-
apiMethods: ["get", "list"],
|
|
4552
|
-
trash: false
|
|
4553
|
-
}
|
|
4554
|
-
});
|
|
4555
|
-
var SysViewDefinitionObject = data.ObjectSchema.create({
|
|
4556
|
-
name: "sys_view_definition",
|
|
4557
|
-
label: "View Definition",
|
|
4558
|
-
pluralLabel: "View Definitions",
|
|
4559
|
-
icon: "layout-grid",
|
|
4560
|
-
isSystem: true,
|
|
4561
|
-
description: "Runtime-authored view definitions (shared / personal layers). The package layer ships from source.",
|
|
4562
|
-
fields: {
|
|
4563
|
-
/** Primary Key (UUID) */
|
|
4564
|
-
id: data.Field.text({ label: "ID", required: true, readonly: true }),
|
|
4565
|
-
/**
|
|
4566
|
-
* Globally-unique qualified view id, `<object>.<viewKey>`, matching the
|
|
4567
|
-
* spec `ViewItemSchema.name`. For personal views the runtime may suffix
|
|
4568
|
-
* to keep it unique per owner.
|
|
4569
|
-
*/
|
|
4570
|
-
name: data.Field.text({
|
|
4571
|
-
label: "Name",
|
|
4572
|
-
required: true,
|
|
4573
|
-
searchable: true,
|
|
4574
|
-
maxLength: 255
|
|
4575
|
-
}),
|
|
4576
|
-
/** Bound object — the foreign key used to aggregate views for the switcher. */
|
|
4577
|
-
object: data.Field.text({
|
|
4578
|
-
label: "Object",
|
|
4579
|
-
required: true,
|
|
4580
|
-
searchable: true,
|
|
4581
|
-
maxLength: 255
|
|
4582
|
-
}),
|
|
4583
|
-
/** Whether `config` is a ListView (list family) or a FormView. */
|
|
4584
|
-
view_kind: data.Field.select(["list", "form"], {
|
|
4585
|
-
label: "View Kind",
|
|
4586
|
-
required: true,
|
|
4587
|
-
defaultValue: "list"
|
|
4588
|
-
}),
|
|
4589
|
-
/** Display label (plain string; i18n keys also accepted). */
|
|
4590
|
-
label: data.Field.text({ label: "Label", required: false, maxLength: 255 }),
|
|
4591
|
-
/** Whether this is the object's default view in the switcher. */
|
|
4592
|
-
is_default: data.Field.boolean({ label: "Is Default", required: false, defaultValue: false }),
|
|
4593
|
-
/** Sort order within the object's switcher / left rail. */
|
|
4594
|
-
view_order: data.Field.number({ label: "Order", required: false, defaultValue: 0 }),
|
|
4595
|
-
/**
|
|
4596
|
-
* Identity layer. Only `shared` and `personal` are stored at runtime;
|
|
4597
|
-
* `package` views come from source.
|
|
4598
|
-
*/
|
|
4599
|
-
scope: data.Field.select(["shared", "personal"], {
|
|
4600
|
-
label: "Scope",
|
|
4601
|
-
required: true,
|
|
4602
|
-
defaultValue: "personal"
|
|
4603
|
-
}),
|
|
4604
|
-
/** Owner user id — set when scope = personal; null for shared. */
|
|
4605
|
-
owner: data.Field.text({ label: "Owner", required: false, maxLength: 255 }),
|
|
4606
|
-
/** Hidden from the switcher (per-user / per-org declutter). */
|
|
4607
|
-
hidden: data.Field.boolean({ label: "Hidden", required: false, defaultValue: false }),
|
|
4608
|
-
/** The ListView / FormView configuration payload. */
|
|
4609
|
-
config: data.Field.json({
|
|
4610
|
-
label: "Config",
|
|
4611
|
-
required: true,
|
|
4612
|
-
description: "ListView or FormView configuration (matches spec ViewItem.config)."
|
|
4613
|
-
}),
|
|
4614
|
-
/** Organization for multi-tenant isolation. */
|
|
4615
|
-
organization_id: data.Field.lookup("sys_organization", {
|
|
4616
|
-
label: "Organization",
|
|
4617
|
-
required: false,
|
|
4618
|
-
description: "Organization for multi-tenant isolation."
|
|
4619
|
-
}),
|
|
4620
|
-
/** Lifecycle state. */
|
|
4621
|
-
state: data.Field.select(["draft", "active", "archived"], {
|
|
4622
|
-
label: "State",
|
|
4623
|
-
required: false,
|
|
4624
|
-
defaultValue: "active"
|
|
4625
|
-
}),
|
|
4626
|
-
/** Audit fields. */
|
|
4627
|
-
created_by: data.Field.lookup("sys_user", { label: "Created By", required: false, readonly: true }),
|
|
4628
|
-
created_at: data.Field.datetime({ label: "Created At", required: false, readonly: true }),
|
|
4629
|
-
updated_by: data.Field.lookup("sys_user", { label: "Updated By", required: false }),
|
|
4630
|
-
updated_at: data.Field.datetime({ label: "Updated At", required: false })
|
|
4631
|
-
},
|
|
4632
|
-
indexes: [
|
|
4633
|
-
// A given view name is unique per (organization, owner) among active rows —
|
|
4634
|
-
// a shared view (owner NULL) and each user's personal views don't collide.
|
|
4635
|
-
{
|
|
4636
|
-
name: "idx_sys_view_def_active",
|
|
4637
|
-
fields: ["name", "organization_id", "owner"],
|
|
4638
|
-
unique: true,
|
|
4639
|
-
partial: "state = 'active'"
|
|
4640
|
-
},
|
|
4641
|
-
// The switcher query: views for one object within a tenant.
|
|
4642
|
-
{ name: "idx_sys_view_def_object", fields: ["organization_id", "object"] },
|
|
4643
|
-
{ fields: ["scope"] },
|
|
4644
|
-
{ fields: ["owner"] },
|
|
4645
|
-
{ fields: ["state"] }
|
|
4646
|
-
],
|
|
4647
|
-
enable: {
|
|
4648
|
-
trackHistory: true,
|
|
4649
|
-
searchable: false,
|
|
4650
|
-
apiEnabled: true,
|
|
4651
|
-
apiMethods: ["get", "list", "create", "update", "delete"],
|
|
4652
|
-
trash: false
|
|
4653
|
-
}
|
|
4654
|
-
});
|
|
4655
4072
|
var SysSetting = data.ObjectSchema.create({
|
|
4656
4073
|
name: "sys_setting",
|
|
4657
4074
|
label: "Setting",
|
|
@@ -4812,12 +4229,10 @@ var SysSecret = data.ObjectSchema.create({
|
|
|
4812
4229
|
isSystem: true,
|
|
4813
4230
|
managedBy: "system",
|
|
4814
4231
|
description: "Cipher store referenced by sys_setting handles. Never holds plaintext.",
|
|
4815
|
-
scope: "tenant",
|
|
4816
4232
|
compactLayout: ["namespace", "key", "kms_key_id", "version", "rotated_at"],
|
|
4817
|
-
|
|
4818
|
-
views: {
|
|
4233
|
+
listViews: {
|
|
4819
4234
|
all: {
|
|
4820
|
-
type: "
|
|
4235
|
+
type: "grid",
|
|
4821
4236
|
name: "all",
|
|
4822
4237
|
label: "All Secrets",
|
|
4823
4238
|
columns: ["namespace", "key", "kms_key_id", "version", "rotated_at", "created_at"]
|
|
@@ -4905,12 +4320,10 @@ var SysSettingAudit = data.ObjectSchema.create({
|
|
|
4905
4320
|
isSystem: true,
|
|
4906
4321
|
managedBy: "system",
|
|
4907
4322
|
description: "Append-only audit trail for SettingsService mutations.",
|
|
4908
|
-
scope: "tenant",
|
|
4909
4323
|
compactLayout: ["namespace", "key", "scope", "action", "actor_id", "created_at"],
|
|
4910
|
-
|
|
4911
|
-
views: {
|
|
4324
|
+
listViews: {
|
|
4912
4325
|
recent: {
|
|
4913
|
-
type: "
|
|
4326
|
+
type: "grid",
|
|
4914
4327
|
name: "recent",
|
|
4915
4328
|
label: "Recent",
|
|
4916
4329
|
columns: ["created_at", "namespace", "key", "scope", "action", "actor_id", "source"],
|
|
@@ -21893,6 +21306,26 @@ function createPlatformObjectsPlugin() {
|
|
|
21893
21306
|
return new PlatformObjectsPlugin();
|
|
21894
21307
|
}
|
|
21895
21308
|
|
|
21309
|
+
Object.defineProperty(exports, "SysMetadata", {
|
|
21310
|
+
enumerable: true,
|
|
21311
|
+
get: function () { return metadataCore.SysMetadata; }
|
|
21312
|
+
});
|
|
21313
|
+
Object.defineProperty(exports, "SysMetadataAuditObject", {
|
|
21314
|
+
enumerable: true,
|
|
21315
|
+
get: function () { return metadataCore.SysMetadataAuditObject; }
|
|
21316
|
+
});
|
|
21317
|
+
Object.defineProperty(exports, "SysMetadataHistoryObject", {
|
|
21318
|
+
enumerable: true,
|
|
21319
|
+
get: function () { return metadataCore.SysMetadataHistoryObject; }
|
|
21320
|
+
});
|
|
21321
|
+
Object.defineProperty(exports, "SysMetadataObject", {
|
|
21322
|
+
enumerable: true,
|
|
21323
|
+
get: function () { return metadataCore.SysMetadataObject; }
|
|
21324
|
+
});
|
|
21325
|
+
Object.defineProperty(exports, "SysViewDefinitionObject", {
|
|
21326
|
+
enumerable: true,
|
|
21327
|
+
get: function () { return metadataCore.SysViewDefinitionObject; }
|
|
21328
|
+
});
|
|
21896
21329
|
exports.ACCOUNT_APP = ACCOUNT_APP;
|
|
21897
21330
|
exports.MetadataFormsTranslations = MetadataFormsTranslations;
|
|
21898
21331
|
exports.PlatformObjectsPlugin = PlatformObjectsPlugin;
|
|
@@ -21914,10 +21347,6 @@ exports.SysJobQueue = SysJobQueue;
|
|
|
21914
21347
|
exports.SysJobRun = SysJobRun;
|
|
21915
21348
|
exports.SysJwks = SysJwks;
|
|
21916
21349
|
exports.SysMember = SysMember;
|
|
21917
|
-
exports.SysMetadata = SysMetadataObject;
|
|
21918
|
-
exports.SysMetadataAuditObject = SysMetadataAuditObject;
|
|
21919
|
-
exports.SysMetadataHistoryObject = SysMetadataHistoryObject;
|
|
21920
|
-
exports.SysMetadataObject = SysMetadataObject;
|
|
21921
21350
|
exports.SysNotification = SysNotification;
|
|
21922
21351
|
exports.SysOauthAccessToken = SysOauthAccessToken;
|
|
21923
21352
|
exports.SysOauthApplication = SysOauthApplication;
|
|
@@ -21938,7 +21367,6 @@ exports.SysUser = SysUser;
|
|
|
21938
21367
|
exports.SysUserDetailPage = SysUserDetailPage;
|
|
21939
21368
|
exports.SysUserPreference = SysUserPreference;
|
|
21940
21369
|
exports.SysVerification = SysVerification;
|
|
21941
|
-
exports.SysViewDefinitionObject = SysViewDefinitionObject;
|
|
21942
21370
|
exports.SystemOverviewDashboard = SystemOverviewDashboard;
|
|
21943
21371
|
exports.createPlatformObjectsPlugin = createPlatformObjectsPlugin;
|
|
21944
21372
|
exports.en = en;
|