Skip to content

Commit 272ed8f

Browse files
Copilothotlong
andcommitted
fix: address code review feedback - improve namespace and audit log documentation
Co-authored-by: hotlong <50353452+hotlong@users.noreply.github.com>
1 parent 382e9c6 commit 272ed8f

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

packages/plugins/plugin-audit/src/objects/sys-audit-log.object.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export const SysAuditLog = ObjectSchema.create({
4444
action: Field.select(['create', 'update', 'delete', 'restore', 'login', 'logout', 'permission_change', 'config_change', 'export', 'import'], {
4545
label: 'Action',
4646
required: true,
47+
description: 'Action type (snake_case). Values: create, update, delete, restore, login, logout, permission_change, config_change, export, import',
4748
}),
4849

4950
object_name: Field.text({
@@ -107,7 +108,7 @@ export const SysAuditLog = ObjectSchema.create({
107108
trackHistory: false, // Audit logs are themselves the audit trail
108109
searchable: true,
109110
apiEnabled: true,
110-
apiMethods: ['get', 'list'], // Read-only — audit logs are immutable
111+
apiMethods: ['get', 'list'], // Read-only — audit logs are immutable; creation happens via internal system hooks only
111112
trash: false, // Never soft-delete audit logs
112113
mru: false,
113114
clone: false,

packages/spec/src/data/object.zod.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,13 @@ const ObjectSchemaBase = z.object({
253253
* When set, `tableName` is auto-derived as `{namespace}_{name}` by
254254
* `ObjectSchema.create()` unless an explicit `tableName` is provided.
255255
*
256+
* Namespace must be a single lowercase word (no underscores or hyphens)
257+
* to ensure clean auto-derivation of `{namespace}_{name}` table names.
258+
*
256259
* @example namespace: 'sys' → tableName defaults to 'sys_user'
257260
* @example namespace: 'crm' → tableName defaults to 'crm_account'
258261
*/
259-
namespace: z.string().regex(/^[a-z][a-z0-9]*$/).optional().describe('Logical domain namespace (e.g. "sys", "crm"). Used for routing, permissions, and auto-deriving tableName.'),
262+
namespace: z.string().regex(/^[a-z][a-z0-9]*$/).optional().describe('Logical domain namespace — single lowercase word (e.g. "sys", "crm"). Used for routing, permissions, and auto-deriving tableName as {namespace}_{name}.'),
260263

261264
/**
262265
* Taxonomy & Organization

0 commit comments

Comments
 (0)