mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
config: yaml,shared,dbal (4 files)
This commit is contained in:
98
dbal/shared/api/schema/entities/packages/audit_log.yaml
Normal file
98
dbal/shared/api/schema/entities/packages/audit_log.yaml
Normal file
@@ -0,0 +1,98 @@
|
||||
entity: AuditLog
|
||||
version: "1.0"
|
||||
description: "Audit log entry for tracking user and system actions"
|
||||
package: audit_log
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique audit log identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this log belongs to"
|
||||
|
||||
userId:
|
||||
type: uuid
|
||||
nullable: true
|
||||
index: true
|
||||
description: "User who performed the action"
|
||||
|
||||
username:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Username snapshot at time of action"
|
||||
|
||||
action:
|
||||
type: enum
|
||||
required: true
|
||||
values: [create, update, delete, login, logout, access, execute, export, import]
|
||||
index: true
|
||||
description: "Type of action performed"
|
||||
|
||||
entity:
|
||||
type: string
|
||||
required: true
|
||||
max_length: 100
|
||||
description: "Entity type affected (User, Workflow, Page, etc.)"
|
||||
|
||||
entityId:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "ID of the affected entity"
|
||||
|
||||
oldValue:
|
||||
type: json
|
||||
nullable: true
|
||||
description: "Previous state of the entity"
|
||||
|
||||
newValue:
|
||||
type: json
|
||||
nullable: true
|
||||
description: "New state of the entity"
|
||||
|
||||
ipAddress:
|
||||
type: string
|
||||
nullable: true
|
||||
max_length: 45
|
||||
description: "Client IP address"
|
||||
|
||||
userAgent:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Client user agent string"
|
||||
|
||||
details:
|
||||
type: json
|
||||
nullable: true
|
||||
description: "Additional context as JSON"
|
||||
|
||||
timestamp:
|
||||
type: bigint
|
||||
required: true
|
||||
index: true
|
||||
description: "Unix timestamp in milliseconds"
|
||||
|
||||
indexes:
|
||||
- fields: [tenantId, timestamp]
|
||||
name: tenant_time
|
||||
- fields: [entity, entityId]
|
||||
name: entity_lookup
|
||||
- fields: [tenantId, userId]
|
||||
name: tenant_user
|
||||
|
||||
acl:
|
||||
create:
|
||||
admin: true
|
||||
system: true
|
||||
read:
|
||||
admin: true
|
||||
god: true
|
||||
update:
|
||||
supergod: true
|
||||
delete:
|
||||
supergod: true
|
||||
255
dbal/shared/api/schema/entities/packages/forum.yaml
Normal file
255
dbal/shared/api/schema/entities/packages/forum.yaml
Normal file
@@ -0,0 +1,255 @@
|
||||
entity: ForumCategory
|
||||
version: "1.0"
|
||||
description: "Forum category for organizing discussion threads"
|
||||
package: forum_forge
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique category identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this category belongs to"
|
||||
|
||||
name:
|
||||
type: string
|
||||
required: true
|
||||
max_length: 100
|
||||
description: "Category name"
|
||||
|
||||
description:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Category description"
|
||||
|
||||
icon:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Category icon"
|
||||
|
||||
slug:
|
||||
type: string
|
||||
required: true
|
||||
max_length: 100
|
||||
pattern: "^[a-z0-9-]+$"
|
||||
description: "URL-friendly slug"
|
||||
|
||||
sortOrder:
|
||||
type: integer
|
||||
default: 0
|
||||
description: "Display order"
|
||||
|
||||
parentId:
|
||||
type: cuid
|
||||
nullable: true
|
||||
index: true
|
||||
description: "Parent category for nesting"
|
||||
|
||||
createdAt:
|
||||
type: bigint
|
||||
required: true
|
||||
description: "Creation timestamp"
|
||||
|
||||
indexes:
|
||||
- fields: [tenantId, slug]
|
||||
unique: true
|
||||
name: tenant_slug
|
||||
|
||||
acl:
|
||||
create:
|
||||
admin: true
|
||||
read:
|
||||
public: true
|
||||
update:
|
||||
admin: true
|
||||
delete:
|
||||
admin: true
|
||||
|
||||
---
|
||||
|
||||
entity: ForumThread
|
||||
version: "1.0"
|
||||
description: "Forum discussion thread"
|
||||
package: forum_forge
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique thread identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this thread belongs to"
|
||||
|
||||
categoryId:
|
||||
type: cuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Parent category"
|
||||
|
||||
authorId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Thread author"
|
||||
|
||||
title:
|
||||
type: string
|
||||
required: true
|
||||
max_length: 200
|
||||
description: "Thread title"
|
||||
|
||||
content:
|
||||
type: string
|
||||
required: true
|
||||
description: "First post content"
|
||||
|
||||
slug:
|
||||
type: string
|
||||
required: true
|
||||
pattern: "^[a-z0-9-]+$"
|
||||
description: "URL-friendly slug"
|
||||
|
||||
isPinned:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Whether thread is pinned"
|
||||
|
||||
isLocked:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Whether thread is locked"
|
||||
|
||||
viewCount:
|
||||
type: integer
|
||||
default: 0
|
||||
description: "Number of views"
|
||||
|
||||
replyCount:
|
||||
type: integer
|
||||
default: 0
|
||||
description: "Number of replies"
|
||||
|
||||
lastReplyAt:
|
||||
type: bigint
|
||||
nullable: true
|
||||
description: "Timestamp of last reply"
|
||||
|
||||
lastReplyBy:
|
||||
type: uuid
|
||||
nullable: true
|
||||
description: "User who last replied"
|
||||
|
||||
createdAt:
|
||||
type: bigint
|
||||
required: true
|
||||
description: "Creation timestamp"
|
||||
|
||||
updatedAt:
|
||||
type: bigint
|
||||
nullable: true
|
||||
description: "Last update timestamp"
|
||||
|
||||
indexes:
|
||||
- fields: [tenantId, slug]
|
||||
unique: true
|
||||
- fields: [isPinned, lastReplyAt]
|
||||
name: pinned_recent
|
||||
|
||||
acl:
|
||||
create:
|
||||
user: true
|
||||
read:
|
||||
public: true
|
||||
update:
|
||||
self: true
|
||||
row_level: "authorId = $user.id"
|
||||
moderator: true
|
||||
delete:
|
||||
self: true
|
||||
row_level: "authorId = $user.id"
|
||||
moderator: true
|
||||
|
||||
---
|
||||
|
||||
entity: ForumPost
|
||||
version: "1.0"
|
||||
description: "Forum reply/post within a thread"
|
||||
package: forum_forge
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique post identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this post belongs to"
|
||||
|
||||
threadId:
|
||||
type: cuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Parent thread"
|
||||
|
||||
authorId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Post author"
|
||||
|
||||
content:
|
||||
type: string
|
||||
required: true
|
||||
description: "Post content"
|
||||
|
||||
likes:
|
||||
type: integer
|
||||
default: 0
|
||||
description: "Like count"
|
||||
|
||||
isEdited:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "Whether post was edited"
|
||||
|
||||
createdAt:
|
||||
type: bigint
|
||||
required: true
|
||||
description: "Creation timestamp"
|
||||
|
||||
updatedAt:
|
||||
type: bigint
|
||||
nullable: true
|
||||
description: "Last update timestamp"
|
||||
|
||||
indexes:
|
||||
- fields: [threadId, createdAt]
|
||||
name: thread_time
|
||||
|
||||
acl:
|
||||
create:
|
||||
user: true
|
||||
read:
|
||||
public: true
|
||||
update:
|
||||
self: true
|
||||
row_level: "authorId = $user.id"
|
||||
moderator: true
|
||||
delete:
|
||||
self: true
|
||||
row_level: "authorId = $user.id"
|
||||
moderator: true
|
||||
205
dbal/shared/api/schema/entities/packages/media.yaml
Normal file
205
dbal/shared/api/schema/entities/packages/media.yaml
Normal file
@@ -0,0 +1,205 @@
|
||||
entity: MediaAsset
|
||||
version: "1.0"
|
||||
description: "Media file asset (images, videos, audio, documents)"
|
||||
package: media_center
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique media asset identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this asset belongs to"
|
||||
|
||||
userId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "User who uploaded the asset"
|
||||
|
||||
filename:
|
||||
type: string
|
||||
required: true
|
||||
description: "Stored filename"
|
||||
|
||||
originalName:
|
||||
type: string
|
||||
required: true
|
||||
description: "Original upload filename"
|
||||
|
||||
mimeType:
|
||||
type: string
|
||||
required: true
|
||||
index: true
|
||||
description: "MIME type (image/png, video/mp4, etc.)"
|
||||
|
||||
size:
|
||||
type: bigint
|
||||
required: true
|
||||
description: "File size in bytes"
|
||||
|
||||
path:
|
||||
type: string
|
||||
required: true
|
||||
description: "Storage path"
|
||||
|
||||
thumbnailPath:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Thumbnail image path"
|
||||
|
||||
width:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: "Image/video width"
|
||||
|
||||
height:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: "Image/video height"
|
||||
|
||||
duration:
|
||||
type: integer
|
||||
nullable: true
|
||||
description: "Audio/video duration in seconds"
|
||||
|
||||
metadata:
|
||||
type: json
|
||||
nullable: true
|
||||
description: "Additional metadata (EXIF, tags, etc.)"
|
||||
|
||||
createdAt:
|
||||
type: bigint
|
||||
required: true
|
||||
description: "Upload timestamp"
|
||||
|
||||
indexes:
|
||||
- fields: [tenantId, userId]
|
||||
name: tenant_user
|
||||
- fields: [tenantId, mimeType]
|
||||
name: tenant_type
|
||||
|
||||
acl:
|
||||
create:
|
||||
user: true
|
||||
read:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
admin: true
|
||||
update:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
delete:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
admin: true
|
||||
|
||||
---
|
||||
|
||||
entity: MediaJob
|
||||
version: "1.0"
|
||||
description: "Background media processing job"
|
||||
package: media_center
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique job identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this job belongs to"
|
||||
|
||||
userId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "User who initiated the job"
|
||||
|
||||
type:
|
||||
type: enum
|
||||
required: true
|
||||
values: [transcode, thumbnail, convert, compress, analyze]
|
||||
description: "Job type"
|
||||
|
||||
status:
|
||||
type: enum
|
||||
required: true
|
||||
values: [pending, processing, completed, failed, cancelled]
|
||||
default: pending
|
||||
index: true
|
||||
description: "Job status"
|
||||
|
||||
priority:
|
||||
type: integer
|
||||
default: 0
|
||||
description: "Job priority (higher = more urgent)"
|
||||
|
||||
inputPath:
|
||||
type: string
|
||||
required: true
|
||||
description: "Input file path"
|
||||
|
||||
outputPath:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Output file path"
|
||||
|
||||
params:
|
||||
type: json
|
||||
required: true
|
||||
description: "Job-specific parameters"
|
||||
|
||||
progress:
|
||||
type: integer
|
||||
default: 0
|
||||
description: "Progress percentage 0-100"
|
||||
|
||||
error:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Error message if failed"
|
||||
|
||||
startedAt:
|
||||
type: bigint
|
||||
nullable: true
|
||||
description: "Processing start timestamp"
|
||||
|
||||
completedAt:
|
||||
type: bigint
|
||||
nullable: true
|
||||
description: "Completion timestamp"
|
||||
|
||||
createdAt:
|
||||
type: bigint
|
||||
required: true
|
||||
description: "Creation timestamp"
|
||||
|
||||
indexes:
|
||||
- fields: [status, priority]
|
||||
name: queue_order
|
||||
- fields: [tenantId, userId]
|
||||
name: tenant_user
|
||||
|
||||
acl:
|
||||
create:
|
||||
user: true
|
||||
system: true
|
||||
read:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
admin: true
|
||||
update:
|
||||
system: true
|
||||
admin: true
|
||||
delete:
|
||||
admin: true
|
||||
88
dbal/shared/api/schema/entities/packages/notification.yaml
Normal file
88
dbal/shared/api/schema/entities/packages/notification.yaml
Normal file
@@ -0,0 +1,88 @@
|
||||
entity: Notification
|
||||
version: "1.0"
|
||||
description: "User notification for alerts, messages, and system events"
|
||||
package: notification_center
|
||||
|
||||
fields:
|
||||
id:
|
||||
type: cuid
|
||||
primary: true
|
||||
generated: true
|
||||
description: "Unique notification identifier"
|
||||
|
||||
tenantId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "Tenant this notification belongs to"
|
||||
|
||||
userId:
|
||||
type: uuid
|
||||
required: true
|
||||
index: true
|
||||
description: "User to receive the notification"
|
||||
|
||||
type:
|
||||
type: enum
|
||||
required: true
|
||||
values: [info, warning, success, error, mention, reply, follow, like, system]
|
||||
description: "Notification type for styling/filtering"
|
||||
|
||||
title:
|
||||
type: string
|
||||
required: true
|
||||
max_length: 200
|
||||
description: "Notification title"
|
||||
|
||||
message:
|
||||
type: string
|
||||
required: true
|
||||
description: "Notification message content"
|
||||
|
||||
icon:
|
||||
type: string
|
||||
nullable: true
|
||||
description: "Optional icon name"
|
||||
|
||||
read:
|
||||
type: boolean
|
||||
default: false
|
||||
index: true
|
||||
description: "Whether notification has been read"
|
||||
|
||||
data:
|
||||
type: json
|
||||
nullable: true
|
||||
description: "Additional data (action URLs, entity refs, etc.)"
|
||||
|
||||
createdAt:
|
||||
type: bigint
|
||||
required: true
|
||||
index: true
|
||||
description: "Creation timestamp"
|
||||
|
||||
expiresAt:
|
||||
type: bigint
|
||||
nullable: true
|
||||
index: true
|
||||
description: "Optional expiration timestamp"
|
||||
|
||||
indexes:
|
||||
- fields: [userId, read]
|
||||
name: user_unread
|
||||
- fields: [tenantId, createdAt]
|
||||
name: tenant_time
|
||||
|
||||
acl:
|
||||
create:
|
||||
system: true
|
||||
admin: true
|
||||
read:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
update:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
delete:
|
||||
self: true
|
||||
row_level: "userId = $user.id"
|
||||
Reference in New Issue
Block a user