{
  "version": "1.0.0",
  "timestamp": 0,
  "packageName": "@happyvertical/smrt-secrets",
  "packageVersion": "0.42.7",
  "objects": {
    "@happyvertical/smrt-secrets:SecretAuditLogCollection": {
      "name": "secretauditlogcollection",
      "className": "SecretAuditLogCollection",
      "qualifiedName": "@happyvertical/smrt-secrets:SecretAuditLogCollection",
      "collection": "secretauditlogs",
      "filePath": "/home/runner/work/smrt/smrt/packages/secrets/src/collections/SecretAuditLogCollection.ts",
      "packageName": "@happyvertical/smrt-secrets",
      "fields": {},
      "methods": {
        "listLogs": {
          "name": "listLogs",
          "async": true,
          "parameters": [
            {
              "name": "options",
              "type": "ListAuditLogsOptions",
              "optional": true
            }
          ],
          "returnType": "Promise<SecretAuditLog[]>",
          "isStatic": false,
          "isPublic": true
        },
        "getSecretHistory": {
          "name": "getSecretHistory",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string | null",
              "optional": false
            },
            {
              "name": "secretName",
              "type": "string",
              "optional": false
            },
            {
              "name": "limit",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<SecretAuditLog[]>",
          "isStatic": false,
          "isPublic": true
        },
        "getUserActivity": {
          "name": "getUserActivity",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string | null",
              "optional": false
            },
            {
              "name": "userId",
              "type": "string",
              "optional": false
            },
            {
              "name": "limit",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<SecretAuditLog[]>",
          "isStatic": false,
          "isPublic": true
        },
        "getRecentFailures": {
          "name": "getRecentFailures",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string | null",
              "optional": false
            },
            {
              "name": "limit",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<SecretAuditLog[]>",
          "isStatic": false,
          "isPublic": true
        },
        "getRecentDenials": {
          "name": "getRecentDenials",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string | null",
              "optional": false
            },
            {
              "name": "limit",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<SecretAuditLog[]>",
          "isStatic": false,
          "isPublic": true
        },
        "countByAction": {
          "name": "countByAction",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string | null",
              "optional": false
            },
            {
              "name": "since",
              "type": "Date",
              "optional": true
            }
          ],
          "returnType": "Promise<Record<SecretAuditAction, number>>",
          "isStatic": false,
          "isPublic": true
        },
        "countByResult": {
          "name": "countByResult",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string | null",
              "optional": false
            },
            {
              "name": "since",
              "type": "Date",
              "optional": true
            }
          ],
          "returnType": "Promise<Record<SecretAuditResult, number>>",
          "isStatic": false,
          "isPublic": true
        },
        "cleanup": {
          "name": "cleanup",
          "async": true,
          "parameters": [
            {
              "name": "olderThanDays",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<number>",
          "isStatic": false,
          "isPublic": true
        }
      },
      "decoratorConfig": {},
      "extends": "SmrtCollection",
      "extendsTypeArg": "SecretAuditLog",
      "exportName": "SecretAuditLogCollection",
      "collectionExportName": "SecretAuditLogCollectionCollection",
      "schema": {
        "tableName": "secret_audit_log_collections",
        "ddl": "CREATE TABLE IF NOT EXISTS \"secret_audit_log_collections\" (\n  \"id\" UUID PRIMARY KEY NOT NULL,\n  \"slug\" TEXT NOT NULL,\n  \"context\" TEXT NOT NULL DEFAULT '',\n  \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
        "columns": {
          "id": {
            "type": "UUID",
            "primaryKey": true,
            "referenceKind": "id",
            "notNull": true
          },
          "slug": {
            "type": "TEXT",
            "notNull": true
          },
          "context": {
            "type": "TEXT",
            "notNull": true,
            "default": ""
          },
          "created_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "updated_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          }
        },
        "indexes": [
          {
            "name": "secret_audit_log_collections_slug_context_idx",
            "columns": [
              "slug",
              "context"
            ],
            "unique": true
          },
          {
            "name": "secret_audit_log_collections_created_at_idx",
            "columns": [
              "created_at"
            ]
          }
        ],
        "version": "7bb61130"
      }
    },
    "@happyvertical/smrt-secrets:SecretCollection": {
      "name": "secretcollection",
      "className": "SecretCollection",
      "qualifiedName": "@happyvertical/smrt-secrets:SecretCollection",
      "collection": "secrets",
      "filePath": "/home/runner/work/smrt/smrt/packages/secrets/src/collections/SecretCollection.ts",
      "packageName": "@happyvertical/smrt-secrets",
      "fields": {},
      "methods": {
        "findByName": {
          "name": "findByName",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "name",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<Secret | null>",
          "isStatic": false,
          "isPublic": true
        },
        "listSecrets": {
          "name": "listSecrets",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "options",
              "type": "ListSecretsOptions",
              "optional": true
            }
          ],
          "returnType": "Promise<Secret[]>",
          "isStatic": false,
          "isPublic": true
        },
        "listActive": {
          "name": "listActive",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<Secret[]>",
          "isStatic": false,
          "isPublic": true
        },
        "listByCategory": {
          "name": "listByCategory",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "category",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<Secret[]>",
          "isStatic": false,
          "isPublic": true
        },
        "listExpiring": {
          "name": "listExpiring",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "daysAhead",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<Secret[]>",
          "isStatic": false,
          "isPublic": true
        },
        "getCategories": {
          "name": "getCategories",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<string[]>",
          "isStatic": false,
          "isPublic": true
        },
        "countByStatus": {
          "name": "countByStatus",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<Record<SecretStatus, number>>",
          "isStatic": false,
          "isPublic": true
        },
        "deleteByName": {
          "name": "deleteByName",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "name",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<boolean>",
          "isStatic": false,
          "isPublic": true
        }
      },
      "decoratorConfig": {},
      "extends": "SmrtCollection",
      "extendsTypeArg": "Secret",
      "exportName": "SecretCollection",
      "collectionExportName": "SecretCollectionCollection",
      "schema": {
        "tableName": "secret_collections",
        "ddl": "CREATE TABLE IF NOT EXISTS \"secret_collections\" (\n  \"id\" UUID PRIMARY KEY NOT NULL,\n  \"slug\" TEXT NOT NULL,\n  \"context\" TEXT NOT NULL DEFAULT '',\n  \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
        "columns": {
          "id": {
            "type": "UUID",
            "primaryKey": true,
            "referenceKind": "id",
            "notNull": true
          },
          "slug": {
            "type": "TEXT",
            "notNull": true
          },
          "context": {
            "type": "TEXT",
            "notNull": true,
            "default": ""
          },
          "created_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "updated_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          }
        },
        "indexes": [
          {
            "name": "secret_collections_slug_context_idx",
            "columns": [
              "slug",
              "context"
            ],
            "unique": true
          },
          {
            "name": "secret_collections_created_at_idx",
            "columns": [
              "created_at"
            ]
          }
        ],
        "version": "5f18a721"
      }
    },
    "@happyvertical/smrt-secrets:TenantKeyCollection": {
      "name": "tenantkeycollection",
      "className": "TenantKeyCollection",
      "qualifiedName": "@happyvertical/smrt-secrets:TenantKeyCollection",
      "collection": "tenantkeys",
      "filePath": "/home/runner/work/smrt/smrt/packages/secrets/src/collections/TenantKeyCollection.ts",
      "packageName": "@happyvertical/smrt-secrets",
      "fields": {},
      "methods": {
        "getActiveKey": {
          "name": "getActiveKey",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<TenantKey | null>",
          "isStatic": false,
          "isPublic": true
        },
        "listKeyVersions": {
          "name": "listKeyVersions",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<TenantKey[]>",
          "isStatic": false,
          "isPublic": true
        },
        "getKeyVersion": {
          "name": "getKeyVersion",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "version",
              "type": "number",
              "optional": false
            }
          ],
          "returnType": "Promise<TenantKey | null>",
          "isStatic": false,
          "isPublic": true
        },
        "findKeysNeedingRotation": {
          "name": "findKeysNeedingRotation",
          "async": true,
          "parameters": [],
          "returnType": "Promise<TenantKey[]>",
          "isStatic": false,
          "isPublic": true
        },
        "listAllActiveKeys": {
          "name": "listAllActiveKeys",
          "async": true,
          "parameters": [],
          "returnType": "Promise<TenantKey[]>",
          "isStatic": false,
          "isPublic": true
        },
        "countByStatus": {
          "name": "countByStatus",
          "async": true,
          "parameters": [],
          "returnType": "Promise<Record<TenantKeyStatus, number>>",
          "isStatic": false,
          "isPublic": true
        },
        "markCompromised": {
          "name": "markCompromised",
          "async": true,
          "parameters": [
            {
              "name": "tenantId",
              "type": "string",
              "optional": false
            },
            {
              "name": "keyId",
              "type": "string",
              "optional": false
            }
          ],
          "returnType": "Promise<boolean>",
          "isStatic": false,
          "isPublic": true
        },
        "cleanupRetiredKeys": {
          "name": "cleanupRetiredKeys",
          "async": true,
          "parameters": [
            {
              "name": "olderThanDays",
              "type": "number",
              "optional": true
            }
          ],
          "returnType": "Promise<number>",
          "isStatic": false,
          "isPublic": true
        }
      },
      "decoratorConfig": {},
      "extends": "SmrtCollection",
      "extendsTypeArg": "TenantKey",
      "exportName": "TenantKeyCollection",
      "collectionExportName": "TenantKeyCollectionCollection",
      "schema": {
        "tableName": "tenant_key_collections",
        "ddl": "CREATE TABLE IF NOT EXISTS \"tenant_key_collections\" (\n  \"id\" UUID PRIMARY KEY NOT NULL,\n  \"slug\" TEXT NOT NULL,\n  \"context\" TEXT NOT NULL DEFAULT '',\n  \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp\n);",
        "columns": {
          "id": {
            "type": "UUID",
            "primaryKey": true,
            "referenceKind": "id",
            "notNull": true
          },
          "slug": {
            "type": "TEXT",
            "notNull": true
          },
          "context": {
            "type": "TEXT",
            "notNull": true,
            "default": ""
          },
          "created_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "updated_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          }
        },
        "indexes": [
          {
            "name": "tenant_key_collections_slug_context_idx",
            "columns": [
              "slug",
              "context"
            ],
            "unique": true
          },
          {
            "name": "tenant_key_collections_created_at_idx",
            "columns": [
              "created_at"
            ]
          }
        ],
        "version": "26616d13"
      }
    },
    "@happyvertical/smrt-secrets:Secret": {
      "name": "secret",
      "className": "Secret",
      "qualifiedName": "@happyvertical/smrt-secrets:Secret",
      "collection": "secrets",
      "filePath": "/home/runner/work/smrt/smrt/packages/secrets/src/models/Secret.ts",
      "packageName": "@happyvertical/smrt-secrets",
      "fields": {
        "tenantId": {
          "type": "text",
          "required": false,
          "default": "",
          "_meta": {
            "sqlType": "UUID",
            "__tenancy": {
              "isTenantIdField": true,
              "mode": "required",
              "field": "tenantId",
              "autoFilter": true,
              "autoPopulate": true,
              "allowSuperAdminBypass": false
            }
          }
        },
        "name": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "description": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "category": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "encryptedValue": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "keyVersion": {
          "type": "integer",
          "required": false,
          "default": 1
        },
        "status": {
          "type": "text",
          "required": false,
          "default": "active"
        },
        "expiresAt": {
          "type": "datetime",
          "required": false
        },
        "lastAccessedAt": {
          "type": "datetime",
          "required": false
        },
        "accessCount": {
          "type": "integer",
          "required": false,
          "default": 0
        },
        "metadata": {
          "type": "json",
          "required": false,
          "default": {}
        }
      },
      "methods": {
        "isActive": {
          "name": "isActive",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isExpired": {
          "name": "isExpired",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isUsable": {
          "name": "isUsable",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "recordAccess": {
          "name": "recordAccess",
          "async": false,
          "parameters": [],
          "returnType": "void",
          "isStatic": false,
          "isPublic": true
        },
        "disable": {
          "name": "disable",
          "async": false,
          "parameters": [],
          "returnType": "void",
          "isStatic": false,
          "isPublic": true
        },
        "enable": {
          "name": "enable",
          "async": false,
          "parameters": [],
          "returnType": "void",
          "isStatic": false,
          "isPublic": true
        }
      },
      "decoratorConfig": {
        "tenantScoped": true,
        "api": {
          "include": []
        },
        "mcp": {
          "include": []
        },
        "cli": {
          "include": [
            "list"
          ],
          "skipApiCheck": true
        },
        "conflictColumns": [
          "tenant_id",
          "slug",
          "context"
        ]
      },
      "extends": "SmrtObject",
      "exportName": "Secret",
      "collectionExportName": "SecretCollection",
      "schema": {
        "tableName": "secrets",
        "ddl": "CREATE TABLE IF NOT EXISTS \"secrets\" (\n  \"id\" UUID PRIMARY KEY NOT NULL,\n  \"slug\" TEXT NOT NULL,\n  \"context\" TEXT NOT NULL DEFAULT '',\n  \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"tenant_id\" UUID,\n  \"name\" TEXT DEFAULT '',\n  \"description\" TEXT DEFAULT '',\n  \"category\" TEXT DEFAULT '',\n  \"encrypted_value\" TEXT DEFAULT '',\n  \"key_version\" INTEGER DEFAULT 1,\n  \"status\" TEXT DEFAULT 'active',\n  \"expires_at\" TIMESTAMP,\n  \"last_accessed_at\" TIMESTAMP,\n  \"access_count\" INTEGER DEFAULT 0,\n  \"metadata\" JSON DEFAULT '{}'\n);",
        "columns": {
          "id": {
            "type": "UUID",
            "primaryKey": true,
            "referenceKind": "id",
            "notNull": true
          },
          "slug": {
            "type": "TEXT",
            "notNull": true
          },
          "context": {
            "type": "TEXT",
            "notNull": true,
            "default": ""
          },
          "created_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "updated_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "tenant_id": {
            "type": "UUID",
            "referenceKind": "tenantId",
            "notNull": false,
            "unique": false
          },
          "name": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "description": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "category": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "encrypted_value": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "key_version": {
            "type": "INTEGER",
            "notNull": false,
            "unique": false,
            "default": 1
          },
          "status": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": "active"
          },
          "expires_at": {
            "type": "TIMESTAMP",
            "notNull": false,
            "unique": false
          },
          "last_accessed_at": {
            "type": "TIMESTAMP",
            "notNull": false,
            "unique": false
          },
          "access_count": {
            "type": "INTEGER",
            "notNull": false,
            "unique": false,
            "default": 0
          },
          "metadata": {
            "type": "JSON",
            "notNull": false,
            "unique": false,
            "default": {}
          }
        },
        "indexes": [
          {
            "name": "secrets_slug_context_idx",
            "columns": [
              "tenant_id",
              "slug",
              "context"
            ],
            "unique": true
          },
          {
            "name": "secrets_tenant_id_created_at_idx",
            "columns": [
              "tenant_id",
              "created_at"
            ]
          }
        ],
        "version": "6298a980"
      }
    },
    "@happyvertical/smrt-secrets:SecretAuditLog": {
      "name": "secretauditlog",
      "className": "SecretAuditLog",
      "qualifiedName": "@happyvertical/smrt-secrets:SecretAuditLog",
      "collection": "secretauditlogs",
      "filePath": "/home/runner/work/smrt/smrt/packages/secrets/src/models/SecretAuditLog.ts",
      "packageName": "@happyvertical/smrt-secrets",
      "fields": {
        "tenantId": {
          "type": "text",
          "required": false,
          "_meta": {
            "sqlType": "UUID",
            "__tenancy": {
              "isTenantIdField": true,
              "mode": "required",
              "field": "tenantId",
              "autoFilter": true,
              "autoPopulate": true,
              "allowSuperAdminBypass": false
            }
          }
        },
        "secretId": {
          "type": "foreignKey",
          "required": false,
          "related": "Secret"
        },
        "secretName": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "userId": {
          "type": "crossPackageRef",
          "required": false,
          "related": "@happyvertical/smrt-users:User"
        },
        "action": {
          "type": "text",
          "required": false,
          "default": "read"
        },
        "result": {
          "type": "text",
          "required": false,
          "default": "success"
        },
        "ipAddress": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "userAgent": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "details": {
          "type": "json",
          "required": false,
          "default": {}
        }
      },
      "methods": {
        "isSuccess": {
          "name": "isSuccess",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isFailure": {
          "name": "isFailure",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isDenied": {
          "name": "isDenied",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isReadAction": {
          "name": "isReadAction",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isWriteAction": {
          "name": "isWriteAction",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isKeyOperation": {
          "name": "isKeyOperation",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        }
      },
      "decoratorConfig": {
        "tenantScoped": true,
        "api": {
          "include": []
        },
        "mcp": {
          "include": []
        },
        "cli": {
          "include": [
            "list"
          ],
          "skipApiCheck": true
        },
        "conflictColumns": [
          "tenant_id",
          "slug",
          "context"
        ]
      },
      "extends": "SmrtObject",
      "exportName": "SecretAuditLog",
      "collectionExportName": "SecretAuditLogCollection",
      "schema": {
        "tableName": "secret_audit_logs",
        "ddl": "CREATE TABLE IF NOT EXISTS \"secret_audit_logs\" (\n  \"id\" UUID PRIMARY KEY NOT NULL,\n  \"slug\" TEXT NOT NULL,\n  \"context\" TEXT NOT NULL DEFAULT '',\n  \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"tenant_id\" UUID,\n  \"secret_id\" UUID,\n  \"secret_name\" TEXT DEFAULT '',\n  \"user_id\" UUID,\n  \"action\" TEXT DEFAULT 'read',\n  \"result\" TEXT DEFAULT 'success',\n  \"ip_address\" TEXT DEFAULT '',\n  \"user_agent\" TEXT DEFAULT '',\n  \"details\" JSON DEFAULT '{}'\n);",
        "columns": {
          "id": {
            "type": "UUID",
            "primaryKey": true,
            "referenceKind": "id",
            "notNull": true
          },
          "slug": {
            "type": "TEXT",
            "notNull": true
          },
          "context": {
            "type": "TEXT",
            "notNull": true,
            "default": ""
          },
          "created_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "updated_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "tenant_id": {
            "type": "UUID",
            "referenceKind": "tenantId",
            "notNull": false,
            "unique": false
          },
          "secret_id": {
            "type": "UUID",
            "referenceKind": "foreignKey",
            "notNull": false,
            "unique": false
          },
          "secret_name": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "user_id": {
            "type": "UUID",
            "referenceKind": "crossPackageRef",
            "notNull": false,
            "unique": false
          },
          "action": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": "read"
          },
          "result": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": "success"
          },
          "ip_address": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "user_agent": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "details": {
            "type": "JSON",
            "notNull": false,
            "unique": false,
            "default": {}
          }
        },
        "indexes": [
          {
            "name": "secret_audit_logs_slug_context_idx",
            "columns": [
              "tenant_id",
              "slug",
              "context"
            ],
            "unique": true
          },
          {
            "name": "secret_audit_logs_tenant_id_created_at_idx",
            "columns": [
              "tenant_id",
              "created_at"
            ]
          },
          {
            "name": "secret_audit_logs_secret_id_idx",
            "columns": [
              "secret_id"
            ]
          },
          {
            "name": "secret_audit_logs_user_id_idx",
            "columns": [
              "user_id"
            ]
          }
        ],
        "version": "af0d679d"
      }
    },
    "@happyvertical/smrt-secrets:TenantKey": {
      "name": "tenantkey",
      "className": "TenantKey",
      "qualifiedName": "@happyvertical/smrt-secrets:TenantKey",
      "collection": "tenantkeys",
      "filePath": "/home/runner/work/smrt/smrt/packages/secrets/src/models/TenantKey.ts",
      "packageName": "@happyvertical/smrt-secrets",
      "fields": {
        "tenantId": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "wrappedKey": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "amkKeyId": {
          "type": "text",
          "required": false,
          "default": ""
        },
        "status": {
          "type": "text",
          "required": false,
          "default": "active"
        },
        "version": {
          "type": "integer",
          "required": false,
          "default": 1
        },
        "rotateAfter": {
          "type": "datetime",
          "required": false
        },
        "retiredAt": {
          "type": "datetime",
          "required": false
        }
      },
      "methods": {
        "isActive": {
          "name": "isActive",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "needsRotation": {
          "name": "needsRotation",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isRetired": {
          "name": "isRetired",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "isCompromised": {
          "name": "isCompromised",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "canDecrypt": {
          "name": "canDecrypt",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "canEncrypt": {
          "name": "canEncrypt",
          "async": false,
          "parameters": [],
          "returnType": "boolean",
          "isStatic": false,
          "isPublic": true
        },
        "retire": {
          "name": "retire",
          "async": false,
          "parameters": [],
          "returnType": "void",
          "isStatic": false,
          "isPublic": true
        },
        "markCompromised": {
          "name": "markCompromised",
          "async": false,
          "parameters": [],
          "returnType": "void",
          "isStatic": false,
          "isPublic": true
        }
      },
      "decoratorConfig": {
        "api": {
          "include": []
        },
        "mcp": {
          "include": []
        },
        "cli": {
          "include": [
            "list",
            "get"
          ],
          "skipApiCheck": true
        }
      },
      "extends": "SmrtObject",
      "exportName": "TenantKey",
      "collectionExportName": "TenantKeyCollection",
      "schema": {
        "tableName": "tenant_keys",
        "ddl": "CREATE TABLE IF NOT EXISTS \"tenant_keys\" (\n  \"id\" UUID PRIMARY KEY NOT NULL,\n  \"slug\" TEXT NOT NULL,\n  \"context\" TEXT NOT NULL DEFAULT '',\n  \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n  \"tenant_id\" TEXT DEFAULT '',\n  \"wrapped_key\" TEXT DEFAULT '',\n  \"amk_key_id\" TEXT DEFAULT '',\n  \"status\" TEXT DEFAULT 'active',\n  \"version\" INTEGER DEFAULT 1,\n  \"rotate_after\" TIMESTAMP,\n  \"retired_at\" TIMESTAMP\n);",
        "columns": {
          "id": {
            "type": "UUID",
            "primaryKey": true,
            "referenceKind": "id",
            "notNull": true
          },
          "slug": {
            "type": "TEXT",
            "notNull": true
          },
          "context": {
            "type": "TEXT",
            "notNull": true,
            "default": ""
          },
          "created_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "updated_at": {
            "type": "TIMESTAMP",
            "notNull": true,
            "default": "current_timestamp"
          },
          "tenant_id": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "wrapped_key": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "amk_key_id": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": ""
          },
          "status": {
            "type": "TEXT",
            "notNull": false,
            "unique": false,
            "default": "active"
          },
          "version": {
            "type": "INTEGER",
            "notNull": false,
            "unique": false,
            "default": 1
          },
          "rotate_after": {
            "type": "TIMESTAMP",
            "notNull": false,
            "unique": false
          },
          "retired_at": {
            "type": "TIMESTAMP",
            "notNull": false,
            "unique": false
          }
        },
        "indexes": [
          {
            "name": "tenant_keys_slug_context_idx",
            "columns": [
              "slug",
              "context"
            ],
            "unique": true
          },
          {
            "name": "tenant_keys_created_at_idx",
            "columns": [
              "created_at"
            ]
          }
        ],
        "version": "79fd7e46"
      }
    }
  },
  "moduleType": "smrt",
  "smrtDependencies": [
    "@happyvertical/smrt-core",
    "@happyvertical/smrt-tenancy"
  ]
}