From ea61937239b10d2f0db8a80956ebeef42fab771c Mon Sep 17 00:00:00 2001 From: Richard Ward Date: Tue, 30 Dec 2025 14:59:12 +0000 Subject: [PATCH] update: types,packages,lua (6 files) --- .../codegen_studio/seed/scripts/types.lua | 89 +++++++++++++++++ packages/role_editor/seed/scripts/types.lua | 71 ++++++++++++++ packages/smtp_config/seed/scripts/types.lua | 97 ++++++++++++++++++ packages/ui_auth/seed/scripts/types.lua | 58 +++++++++++ packages/ui_dialogs/seed/scripts/types.lua | 83 ++++++++++++++++ packages/ui_login/seed/scripts/types.lua | 98 +++++++++++++++++++ 6 files changed, 496 insertions(+) create mode 100644 packages/codegen_studio/seed/scripts/types.lua create mode 100644 packages/role_editor/seed/scripts/types.lua create mode 100644 packages/smtp_config/seed/scripts/types.lua create mode 100644 packages/ui_auth/seed/scripts/types.lua create mode 100644 packages/ui_dialogs/seed/scripts/types.lua create mode 100644 packages/ui_login/seed/scripts/types.lua diff --git a/packages/codegen_studio/seed/scripts/types.lua b/packages/codegen_studio/seed/scripts/types.lua new file mode 100644 index 000000000..b9b91eb5c --- /dev/null +++ b/packages/codegen_studio/seed/scripts/types.lua @@ -0,0 +1,89 @@ +-- Type definitions for codegen_studio package +-- Central types for code generation and blueprint management +-- @meta + +---@alias TemplateLanguage "typescript"|"javascript"|"python"|"lua"|"rust"|"go"|"java"|"csharp" + +---@alias FileType "component"|"service"|"model"|"util"|"test"|"config"|"schema"|"api" + +---@class BlueprintFile +---@field path string File path relative to output directory +---@field content string File content (may be template) +---@field type FileType File type category +---@field language TemplateLanguage Target language +---@field overwrite boolean Whether to overwrite if exists + +---@class BlueprintVariable +---@field name string Variable name +---@field type "string"|"number"|"boolean"|"array"|"object" Variable type +---@field default any Default value +---@field required boolean Whether variable is required +---@field description string Variable description +---@field validation? string Validation regex pattern + +---@class Blueprint +---@field id string Blueprint identifier +---@field name string Blueprint name +---@field description string Blueprint description +---@field version string Blueprint version +---@field author string Blueprint author +---@field category string Blueprint category +---@field tags string[] Blueprint tags +---@field variables BlueprintVariable[] Template variables +---@field files BlueprintFile[] Files to generate +---@field dependencies? string[] Required package dependencies +---@field postGenerate? string[] Post-generation commands + +---@class GenerationContext +---@field blueprint Blueprint Blueprint being generated +---@field variables table Variable values +---@field outputDir string Output directory path +---@field dryRun boolean Whether to simulate generation + +---@class GenerationResult +---@field success boolean Whether generation succeeded +---@field files string[] Generated file paths +---@field errors string[] Error messages +---@field warnings string[] Warning messages +---@field duration number Generation duration in ms + +---@class ZipPlan +---@field name string Archive name +---@field files BlueprintFile[] Files to include +---@field includeReadme boolean Include README +---@field includeManifest boolean Include manifest.json + +---@class ZipResult +---@field success boolean Whether zip creation succeeded +---@field path string Output zip path +---@field size number Archive size in bytes +---@field error? string Error message if failed + +---@class CodegenPermissions +---@field canCreate boolean Can create blueprints +---@field canEdit boolean Can edit blueprints +---@field canDelete boolean Can delete blueprints +---@field canExport boolean Can export blueprints +---@field canImport boolean Can import blueprints +---@field maxBlueprints number Maximum blueprints allowed + +---@class CodegenStudioConfig +---@field blueprints Blueprint[] Available blueprints +---@field permissions CodegenPermissions User permissions +---@field defaultLanguage TemplateLanguage Default target language +---@field outputDirectory string Default output directory +---@field templateEngine "mustache"|"handlebars"|"ejs" Template engine + +---@class CodegenStudioProps +---@field config CodegenStudioConfig Studio configuration +---@field onGenerate? fun(result: GenerationResult): void Generation callback +---@field onExport? fun(result: ZipResult): void Export callback +---@field onImport? fun(blueprint: Blueprint): void Import callback + +---@class UIComponent +---@field type string Component type +---@field props? table Component props +---@field children? UIComponent[] Child components + +-- Export all types (no runtime exports, types only) +return {} diff --git a/packages/role_editor/seed/scripts/types.lua b/packages/role_editor/seed/scripts/types.lua new file mode 100644 index 000000000..53461b86f --- /dev/null +++ b/packages/role_editor/seed/scripts/types.lua @@ -0,0 +1,71 @@ +-- Type definitions for role_editor package +-- Central types file re-exporting all module types +-- @meta + +-- Re-export role module types +local role_types = require("role.types") + +---@alias UserRole "public"|"user"|"moderator"|"admin"|"god"|"supergod" + +---@alias PermissionLevel 0|1|2|3|4|5|6 + +-- Permission level mapping +-- Level 0: Public (anonymous) +-- Level 1: User (authenticated) +-- Level 2: Moderator +-- Level 3: Admin +-- Level 4: God +-- Level 5: Supergod + +---@class RoleInfo +---@field label string Display label for the role +---@field blurb string Short description +---@field highlights string[] Feature highlights for this role +---@field badge string Badge icon name +---@field variant "default"|"secondary" Visual variant +---@field level PermissionLevel Permission level number + +---@class RoleConfig +---@field roles table Role definitions + +---@class Permission +---@field id string Permission identifier +---@field name string Permission display name +---@field description string Permission description +---@field category string Permission category +---@field minLevel PermissionLevel Minimum level required + +---@class RolePermissions +---@field role UserRole Role identifier +---@field permissions string[] Granted permission IDs +---@field inherited string[] Inherited permission IDs from lower roles + +---@class RoleEditorProps +---@field currentRole UserRole Current user's role +---@field targetRole UserRole Role being edited +---@field allowedRoles? UserRole[] Roles the current user can assign +---@field permissions Permission[] Available permissions +---@field rolePermissions RolePermissions[] Permission assignments +---@field onSave? fun(role: UserRole, permissions: string[]): void Save callback +---@field onCancel? fun(): void Cancel callback +---@field readonly? boolean Read-only mode + +---@class RoleCardProps +---@field role UserRole Role to display +---@field info RoleInfo Role information +---@field selected? boolean Whether card is selected +---@field onClick? fun(role: UserRole): void Click callback +---@field showBadge? boolean Show role badge + +---@class RoleEditorState +---@field selectedRole UserRole Currently selected role +---@field modifiedPermissions table Modified permission states +---@field isDirty boolean Has unsaved changes + +---@class UIComponent +---@field type string Component type +---@field props? table Component props +---@field children? UIComponent[] Child components + +-- Export all types (no runtime exports, types only) +return {} diff --git a/packages/smtp_config/seed/scripts/types.lua b/packages/smtp_config/seed/scripts/types.lua new file mode 100644 index 000000000..c874eeecb --- /dev/null +++ b/packages/smtp_config/seed/scripts/types.lua @@ -0,0 +1,97 @@ +-- Type definitions for smtp_config package +-- Central types for SMTP email configuration +-- @meta + +---@alias SMTPEncryption "none"|"tls"|"ssl"|"starttls" + +---@alias SMTPAuthMethod "plain"|"login"|"cram-md5"|"oauth2" + +---@class SMTPConfig +---@field host string SMTP server hostname +---@field port number SMTP server port (25, 465, 587) +---@field encryption SMTPEncryption Encryption method +---@field username string SMTP username +---@field password string SMTP password (encrypted) +---@field authMethod SMTPAuthMethod Authentication method +---@field fromEmail string Default sender email +---@field fromName string Default sender name +---@field replyTo? string Reply-to email address +---@field timeout number Connection timeout in seconds +---@field maxRetries number Maximum retry attempts + +---@class SMTPField +---@field id string Field identifier +---@field name string Field name +---@field type "text"|"password"|"number"|"select" Field type +---@field label string Display label +---@field placeholder? string Placeholder text +---@field required boolean Whether field is required +---@field helpText? string Help text +---@field options? SMTPFieldOption[] Options for select fields + +---@class SMTPFieldOption +---@field value string|number Option value +---@field label string Option label + +---@class ValidationResult +---@field valid boolean Whether validation passed +---@field errors table Field errors +---@field warnings? table Field warnings + +---@class SMTPTestResult +---@field success boolean Whether test succeeded +---@field message string Result message +---@field duration number Test duration in ms +---@field details? SMTPTestDetails Detailed results + +---@class SMTPTestDetails +---@field connected boolean Connection established +---@field authenticated boolean Authentication succeeded +---@field tlsEnabled boolean TLS enabled +---@field serverResponse string Server response +---@field capabilities string[] Server capabilities + +---@class EmailTemplate +---@field id string Template identifier +---@field name string Template name +---@field subject string Email subject +---@field body string Email body (HTML or text) +---@field isHtml boolean Whether body is HTML +---@field variables string[] Template variables + +---@class SendEmailRequest +---@field to string|string[] Recipient(s) +---@field cc? string|string[] CC recipient(s) +---@field bcc? string|string[] BCC recipient(s) +---@field subject string Email subject +---@field body string Email body +---@field isHtml? boolean Whether body is HTML +---@field attachments? EmailAttachment[] File attachments +---@field template? string Template ID to use +---@field templateData? table Template variable values + +---@class EmailAttachment +---@field filename string Attachment filename +---@field content string Base64 encoded content +---@field contentType string MIME type + +---@class SendEmailResult +---@field success boolean Whether send succeeded +---@field messageId? string Message ID from server +---@field error? string Error message if failed +---@field timestamp number Send timestamp + +---@class SMTPConfigProps +---@field config SMTPConfig Current configuration +---@field onSave fun(config: SMTPConfig): void Save callback +---@field onTest fun(): Promise Test callback +---@field onCancel? fun(): void Cancel callback +---@field readonly? boolean Read-only mode + +---@class UIComponent +---@field type string Component type +---@field props? table Component props +---@field children? UIComponent[] Child components + +-- Export all types (no runtime exports, types only) +return {} diff --git a/packages/ui_auth/seed/scripts/types.lua b/packages/ui_auth/seed/scripts/types.lua new file mode 100644 index 000000000..385e8ffc4 --- /dev/null +++ b/packages/ui_auth/seed/scripts/types.lua @@ -0,0 +1,58 @@ +-- Type definitions for ui_auth package +-- Central types for authentication UI components +-- @meta + +---@alias AuthState "unauthenticated"|"authenticating"|"authenticated"|"error" + +---@alias GateAction "allow"|"deny"|"redirect"|"challenge" + +---@class AuthUser +---@field id string User identifier +---@field username string Username +---@field email string Email address +---@field level number Permission level (0-6) +---@field role string Role name +---@field avatar? string Avatar URL +---@field tenantId string Tenant identifier + +---@class AuthContext +---@field user? AuthUser Current user +---@field state AuthState Authentication state +---@field error? string Error message +---@field isLoading boolean Whether auth is loading + +---@class GateConfig +---@field minLevel number Minimum permission level required +---@field allowedRoles? string[] Specific roles allowed +---@field deniedMessage? string Custom denied message +---@field redirectUrl? string Redirect URL when denied +---@field showLoginPrompt boolean Show login prompt when denied + +---@class GateResult +---@field action GateAction Gate decision +---@field reason? string Reason for denial +---@field redirectUrl? string Where to redirect + +---@class DeniedPageProps +---@field title? string Page title +---@field message? string Denial message +---@field requiredLevel? number Level required +---@field currentLevel? number User's current level +---@field showLoginButton boolean Show login button +---@field showBackButton boolean Show back button +---@field onLogin? fun(): void Login callback +---@field onBack? fun(): void Back callback + +---@class AuthGuardProps +---@field minLevel number Minimum level required +---@field fallback? UIComponent Component to show when denied +---@field children UIComponent[] Children to protect +---@field onDenied? fun(reason: string): void Denied callback + +---@class UIComponent +---@field type string Component type +---@field props? table Component props +---@field children? UIComponent[] Child components + +-- Export all types (no runtime exports, types only) +return {} diff --git a/packages/ui_dialogs/seed/scripts/types.lua b/packages/ui_dialogs/seed/scripts/types.lua new file mode 100644 index 000000000..220ba4d0a --- /dev/null +++ b/packages/ui_dialogs/seed/scripts/types.lua @@ -0,0 +1,83 @@ +-- Type definitions for ui_dialogs package +-- Central types for dialog components +-- @meta + +---@alias DialogType "alert"|"confirm"|"prompt"|"custom" + +---@alias DialogSize "xs"|"sm"|"md"|"lg"|"xl"|"fullscreen" + +---@alias DialogSeverity "info"|"success"|"warning"|"error" + +---@class DialogButton +---@field label string Button label +---@field variant? "text"|"outlined"|"contained" Button variant +---@field color? "primary"|"secondary"|"error"|"warning"|"info"|"success" Button color +---@field onClick fun(): void Click handler +---@field autoFocus? boolean Auto-focus this button +---@field disabled? boolean Whether button is disabled + +---@class AlertDialogProps +---@field open boolean Whether dialog is open +---@field title string Dialog title +---@field message string Alert message +---@field severity? DialogSeverity Alert severity +---@field confirmLabel? string Confirm button label +---@field onClose fun(): void Close callback +---@field onConfirm fun(): void Confirm callback + +---@class ConfirmDialogProps +---@field open boolean Whether dialog is open +---@field title string Dialog title +---@field message string Confirmation message +---@field confirmLabel? string Confirm button label +---@field cancelLabel? string Cancel button label +---@field severity? DialogSeverity Dialog severity +---@field onClose fun(): void Close callback +---@field onConfirm fun(): void Confirm callback +---@field onCancel fun(): void Cancel callback + +---@class PromptDialogProps +---@field open boolean Whether dialog is open +---@field title string Dialog title +---@field message string Prompt message +---@field placeholder? string Input placeholder +---@field defaultValue? string Default input value +---@field inputType? "text"|"password"|"email"|"number" Input type +---@field confirmLabel? string Confirm button label +---@field cancelLabel? string Cancel button label +---@field validation? fun(value: string): string|nil Validation function +---@field onClose fun(): void Close callback +---@field onConfirm fun(value: string): void Confirm callback +---@field onCancel fun(): void Cancel callback + +---@class CustomDialogProps +---@field open boolean Whether dialog is open +---@field title? string Dialog title +---@field size? DialogSize Dialog size +---@field fullWidth? boolean Full width dialog +---@field hideCloseButton? boolean Hide close button +---@field disableBackdropClick? boolean Disable closing on backdrop click +---@field disableEscapeKey? boolean Disable closing on Escape key +---@field actions? DialogButton[] Dialog action buttons +---@field children UIComponent[] Dialog content +---@field onClose fun(): void Close callback + +---@class DialogState +---@field type DialogType Dialog type +---@field open boolean Whether dialog is open +---@field props table Dialog props + +---@class DialogManager +---@field alert fun(props: AlertDialogProps): void Show alert dialog +---@field confirm fun(props: ConfirmDialogProps): Promise Show confirm dialog +---@field prompt fun(props: PromptDialogProps): Promise Show prompt dialog +---@field custom fun(props: CustomDialogProps): void Show custom dialog +---@field close fun(): void Close current dialog + +---@class UIComponent +---@field type string Component type +---@field props? table Component props +---@field children? UIComponent[] Child components + +-- Export all types (no runtime exports, types only) +return {} diff --git a/packages/ui_login/seed/scripts/types.lua b/packages/ui_login/seed/scripts/types.lua new file mode 100644 index 000000000..a36bdd018 --- /dev/null +++ b/packages/ui_login/seed/scripts/types.lua @@ -0,0 +1,98 @@ +-- Type definitions for ui_login package +-- Central types for login UI components +-- @meta + +---@alias LoginState "idle"|"loading"|"success"|"error" + +---@alias LoginMethod "password"|"oauth"|"sso"|"magic-link"|"2fa" + +---@class LoginCredentials +---@field username string Username or email +---@field password string Password +---@field rememberMe? boolean Remember login +---@field tenantId? string Tenant identifier + +---@class LoginResult +---@field success boolean Whether login succeeded +---@field user? AuthUser Authenticated user +---@field token? string Auth token +---@field error? string Error message +---@field requiresTwoFactor? boolean Whether 2FA is needed +---@field twoFactorToken? string Token for 2FA verification + +---@class AuthUser +---@field id string User identifier +---@field username string Username +---@field email string Email address +---@field level number Permission level (0-6) +---@field role string Role name +---@field avatar? string Avatar URL +---@field tenantId string Tenant identifier + +---@class TwoFactorRequest +---@field code string 2FA code +---@field token string 2FA token from login +---@field method "totp"|"sms"|"email" 2FA method + +---@class RegisterCredentials +---@field username string Desired username +---@field email string Email address +---@field password string Password +---@field confirmPassword string Password confirmation +---@field acceptTerms boolean Accept terms and conditions +---@field tenantId? string Tenant identifier + +---@class RegisterResult +---@field success boolean Whether registration succeeded +---@field user? AuthUser Created user +---@field error? string Error message +---@field requiresVerification? boolean Email verification needed +---@field verificationSent? boolean Verification email sent + +---@class PasswordResetRequest +---@field email string Email address + +---@class PasswordResetResult +---@field success boolean Whether reset was initiated +---@field message string Result message + +---@class LoginFormProps +---@field onSubmit fun(credentials: LoginCredentials): void Submit callback +---@field onRegister? fun(): void Navigate to register +---@field onForgotPassword? fun(): void Navigate to forgot password +---@field loading? boolean Loading state +---@field error? string Error message +---@field methods? LoginMethod[] Available login methods +---@field showRememberMe? boolean Show remember me checkbox +---@field showTenantSelect? boolean Show tenant selector +---@field tenants? TenantOption[] Available tenants + +---@class TenantOption +---@field id string Tenant identifier +---@field name string Tenant name +---@field logo? string Tenant logo URL + +---@class RegisterFormProps +---@field onSubmit fun(credentials: RegisterCredentials): void Submit callback +---@field onLogin? fun(): void Navigate to login +---@field loading? boolean Loading state +---@field error? string Error message +---@field requireAcceptTerms? boolean Require terms acceptance +---@field termsUrl? string Terms of service URL +---@field privacyUrl? string Privacy policy URL + +---@class LoginPageConfig +---@field title? string Page title +---@field subtitle? string Page subtitle +---@field logo? string Logo URL +---@field showRegister boolean Show register link +---@field showForgotPassword boolean Show forgot password link +---@field backgroundImage? string Background image URL + +---@class UIComponent +---@field type string Component type +---@field props? table Component props +---@field children? UIComponent[] Child components + +-- Export all types (no runtime exports, types only) +return {}