@happyvertical/smrt-secrets 0.51.9 → 0.51.11
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/chunks/{SecretService-CYWHgo5V.js → SecretService-BJU1nYmu.js} +2 -2
- package/dist/chunks/{SecretService-CYWHgo5V.js.map → SecretService-BJU1nYmu.js.map} +1 -1
- package/dist/chunks/TenantKey-CGQ0UQ12.js +355 -0
- package/dist/chunks/TenantKey-CGQ0UQ12.js.map +1 -0
- package/dist/index.js +2 -2
- package/dist/manifest.json +3 -1
- package/dist/models/Secret.d.ts.map +1 -1
- package/dist/models/TenantKey.d.ts.map +1 -1
- package/dist/models/index.js +1 -1
- package/dist/services/SecretService.js +1 -1
- package/dist/smrt-knowledge.json +3 -3
- package/package.json +4 -4
- package/dist/chunks/TenantKey-BZRImpVR.js +0 -353
- package/dist/chunks/TenantKey-BZRImpVR.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as createAuditEntry, n as Secret, r as SecretAuditLog, t as TenantKey } from "./chunks/TenantKey-
|
|
2
|
-
import { a as SecretAuditLogCollection, i as SecretCollection, n as SecretService, r as TenantKeyCollection, t as SecretKeyDriftError } from "./chunks/SecretService-
|
|
1
|
+
import { i as createAuditEntry, n as Secret, r as SecretAuditLog, t as TenantKey } from "./chunks/TenantKey-CGQ0UQ12.js";
|
|
2
|
+
import { a as SecretAuditLogCollection, i as SecretCollection, n as SecretService, r as TenantKeyCollection, t as SecretKeyDriftError } from "./chunks/SecretService-BJU1nYmu.js";
|
|
3
3
|
import { AMKUnavailableError, DecryptionError, EncryptionError, InvalidKeyFormatError, KeyNotFoundError, KeyRotationError, SecretError, StoreNotInitializedError, TenantKeyMissingError } from "@happyvertical/secrets";
|
|
4
4
|
//#region src/index.ts
|
|
5
5
|
/** @internal */
|
package/dist/manifest.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "1.0.0",
|
|
3
3
|
"timestamp": 0,
|
|
4
4
|
"packageName": "@happyvertical/smrt-secrets",
|
|
5
|
-
"packageVersion": "0.51.
|
|
5
|
+
"packageVersion": "0.51.11",
|
|
6
6
|
"objects": {
|
|
7
7
|
"@happyvertical/smrt-secrets:SecretAuditLogCollection": {
|
|
8
8
|
"name": "secretauditlogcollection",
|
|
@@ -940,6 +940,7 @@
|
|
|
940
940
|
}
|
|
941
941
|
},
|
|
942
942
|
"decoratorConfig": {
|
|
943
|
+
"sensitive": true,
|
|
943
944
|
"tenantScoped": true,
|
|
944
945
|
"api": {
|
|
945
946
|
"include": []
|
|
@@ -1447,6 +1448,7 @@
|
|
|
1447
1448
|
}
|
|
1448
1449
|
},
|
|
1449
1450
|
"decoratorConfig": {
|
|
1451
|
+
"sensitive": true,
|
|
1450
1452
|
"api": {
|
|
1451
1453
|
"include": []
|
|
1452
1454
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Secret.d.ts","sourceRoot":"","sources":["../../src/models/Secret.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAQ,MAAM,0BAA0B,CAAC;AAE5D;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D;;;;GAIG;AACH,MAAM,WAAW,aAAc,SAAQ,iBAAiB;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,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OAEG;IACH,OAAO,EAAE,MAAM,CAAK;IAEpB;;OAEG;IACH,WAAW,EAAE,IAAI,GAAG,IAAI,CAAQ;IAEhC;;OAEG;IACH,SAAS,EAAE,IAAI,GAAG,IAAI,CAAQ;gBAElB,OAAO,GAAE,gBAAqB;IAyB1C;;OAEG;IACH,QAAQ,IAAI,OAAO;IAInB;;OAEG;IACH,aAAa,IAAI,OAAO;IAKxB;;OAEG;IACH,SAAS,IAAI,OAAO;IAIpB;;OAEG;IACH,aAAa,IAAI,OAAO;IAIxB;;;OAGG;IACH,UAAU,IAAI,OAAO;IAIrB;;;OAGG;IACH,UAAU,IAAI,OAAO;IAIrB;;OAEG;IACH,MAAM,IAAI,IAAI;IAKd;;OAEG;IACH,eAAe,IAAI,IAAI;CAGxB"}
|
package/dist/models/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as createAuditEntry, n as Secret, r as SecretAuditLog, t as TenantKey } from "../chunks/TenantKey-
|
|
1
|
+
import { i as createAuditEntry, n as Secret, r as SecretAuditLog, t as TenantKey } from "../chunks/TenantKey-CGQ0UQ12.js";
|
|
2
2
|
export { Secret, SecretAuditLog, TenantKey, createAuditEntry };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SecretService, t as SecretKeyDriftError } from "../chunks/SecretService-
|
|
1
|
+
import { n as SecretService, t as SecretKeyDriftError } from "../chunks/SecretService-BJU1nYmu.js";
|
|
2
2
|
export { SecretKeyDriftError, SecretService };
|
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-secrets",
|
|
6
|
-
"packageVersion": "0.51.
|
|
6
|
+
"packageVersion": "0.51.11",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "8f527b261f795cb126da0999c13167e2a1605fe61b77a9f6da0fdec5bece53ad",
|
|
11
|
+
"packageJson": "aa9895d5d82b979470ad275e2cad09d13c557d5778451200a60c9a3632a98893",
|
|
12
12
|
"agents": "96fe8095cb8a2673fb8752fdc2940b53ce09d83c42715396ba6812ce215e990b"
|
|
13
13
|
},
|
|
14
14
|
"exports": [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-secrets",
|
|
3
|
-
"version": "0.51.
|
|
3
|
+
"version": "0.51.11",
|
|
4
4
|
"description": "Per-tenant secret management with envelope encryption for SMRT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@happyvertical/logger": "^0.89.11",
|
|
31
31
|
"@happyvertical/secrets": "^0.89.11",
|
|
32
|
-
"@happyvertical/smrt-core": "0.51.
|
|
33
|
-
"@happyvertical/smrt-tenancy": "0.51.
|
|
32
|
+
"@happyvertical/smrt-core": "0.51.11",
|
|
33
|
+
"@happyvertical/smrt-tenancy": "0.51.11",
|
|
34
34
|
"@happyvertical/sql": "^0.89.11",
|
|
35
35
|
"@happyvertical/utils": "^0.89.11"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@happyvertical/smrt-vitest": "0.51.
|
|
38
|
+
"@happyvertical/smrt-vitest": "0.51.11",
|
|
39
39
|
"@types/node": "24.13.2",
|
|
40
40
|
"typescript": "5.9.3",
|
|
41
41
|
"vite": "8.1.4",
|
|
@@ -1,353 +0,0 @@
|
|
|
1
|
-
import { ObjectRegistry, SmrtObject, crossPackageRef, foreignKey, smrt } from "@happyvertical/smrt-core";
|
|
2
|
-
//#region src/__smrt-register__.ts
|
|
3
|
-
ObjectRegistry.registerPackageManifest(JSON.parse("{\"version\":\"1.0.0\",\"timestamp\":0,\"packageName\":\"@happyvertical/smrt-secrets\",\"packageVersion\":\"0.51.9\",\"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,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"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,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"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,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"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,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"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,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"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,\"unionBranches\":[{\"type\":\"string\"},{\"type\":\"null\"}]},{\"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_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,\"nullsNotDistinct\":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\"},\"importPath\":\"@happyvertical/smrt-secrets\"},\"@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\":\"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,\"nullsNotDistinct\":true},{\"name\":\"secrets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"6298a980\"},\"importPath\":\"@happyvertical/smrt-secrets\"},\"@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_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\"},\"importPath\":\"@happyvertical/smrt-secrets\"},\"@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,\"nullsNotDistinct\":true},{\"name\":\"secrets_tenant_id_created_at_idx\",\"columns\":[\"tenant_id\",\"created_at\"]}],\"version\":\"6298a980\"},\"importPath\":\"@happyvertical/smrt-secrets/models\"},\"@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\",\"_meta\":{\"constraint\":false}},\"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,\"nullsNotDistinct\":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\"},\"importPath\":\"@happyvertical/smrt-secrets/models\"},\"@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\"},\"importPath\":\"@happyvertical/smrt-secrets/models\"}},\"moduleType\":\"smrt\",\"smrtDependencies\":[\"@happyvertical/smrt-core\",\"@happyvertical/smrt-tenancy\"]}"));
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region \0@oxc-project+runtime@0.138.0/helpers/esm/decorate.js
|
|
6
|
-
function __decorate(decorators, target, key, desc) {
|
|
7
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
9
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
10
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/models/SecretAuditLog.ts
|
|
14
|
-
var SecretAuditLog = class SecretAuditLog extends SmrtObject {
|
|
15
|
-
/**
|
|
16
|
-
* Tenant associated with the audited secret operation.
|
|
17
|
-
*/
|
|
18
|
-
tenantId = null;
|
|
19
|
-
/**
|
|
20
|
-
* ID of the secret (may identify a secret that has since been deleted).
|
|
21
|
-
*
|
|
22
|
-
* Compliance audit rows intentionally outlive their source secret, so this
|
|
23
|
-
* remains an app-side relationship without a physical database constraint.
|
|
24
|
-
*/
|
|
25
|
-
secretId = null;
|
|
26
|
-
/**
|
|
27
|
-
* Name of the secret at the time of the operation
|
|
28
|
-
*/
|
|
29
|
-
secretName = "";
|
|
30
|
-
/**
|
|
31
|
-
* ID of the user who performed the action, or `null` for system-initiated
|
|
32
|
-
* operations with no authenticated user. Stored as a native `uuid` column on
|
|
33
|
-
* Postgres, so a non-UUID actor sentinel must never reach it —
|
|
34
|
-
* {@link createAuditEntry} normalizes the `'system'` sentinel to null (#1444).
|
|
35
|
-
*/
|
|
36
|
-
userId = null;
|
|
37
|
-
/**
|
|
38
|
-
* The action that was performed
|
|
39
|
-
*/
|
|
40
|
-
action = "read";
|
|
41
|
-
/**
|
|
42
|
-
* Result of the operation
|
|
43
|
-
*/
|
|
44
|
-
result = "success";
|
|
45
|
-
/**
|
|
46
|
-
* IP address of the client (if available)
|
|
47
|
-
*/
|
|
48
|
-
ipAddress = "";
|
|
49
|
-
/**
|
|
50
|
-
* User agent string (if available)
|
|
51
|
-
*/
|
|
52
|
-
userAgent = "";
|
|
53
|
-
/**
|
|
54
|
-
* Additional context about the operation
|
|
55
|
-
*/
|
|
56
|
-
details = {};
|
|
57
|
-
constructor(options = {}) {
|
|
58
|
-
super(options);
|
|
59
|
-
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
60
|
-
if (options.secretId !== void 0) this.secretId = options.secretId;
|
|
61
|
-
if (options.secretName !== void 0) this.secretName = options.secretName;
|
|
62
|
-
if (options.userId !== void 0) this.userId = options.userId;
|
|
63
|
-
if (options.action !== void 0) this.action = options.action;
|
|
64
|
-
if (options.result !== void 0) this.result = options.result;
|
|
65
|
-
if (options.ipAddress !== void 0) this.ipAddress = options.ipAddress;
|
|
66
|
-
if (options.userAgent !== void 0) this.userAgent = options.userAgent;
|
|
67
|
-
if (options.details !== void 0) this.details = options.details;
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Check if this was a successful operation
|
|
71
|
-
*/
|
|
72
|
-
isSuccess() {
|
|
73
|
-
return this.result === "success";
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Check if this was a failed operation
|
|
77
|
-
*/
|
|
78
|
-
isFailure() {
|
|
79
|
-
return this.result === "failure";
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* Check if this was a denied operation (permission denied)
|
|
83
|
-
*/
|
|
84
|
-
isDenied() {
|
|
85
|
-
return this.result === "denied";
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* Check if this is a read operation
|
|
89
|
-
*/
|
|
90
|
-
isReadAction() {
|
|
91
|
-
return this.action === "read";
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Check if this is a write operation (create, update, delete)
|
|
95
|
-
*/
|
|
96
|
-
isWriteAction() {
|
|
97
|
-
return [
|
|
98
|
-
"create",
|
|
99
|
-
"update",
|
|
100
|
-
"delete"
|
|
101
|
-
].includes(this.action);
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Check if this is a key operation
|
|
105
|
-
*/
|
|
106
|
-
isKeyOperation() {
|
|
107
|
-
return this.action === "rotate_key";
|
|
108
|
-
}
|
|
109
|
-
};
|
|
110
|
-
__decorate([foreignKey("Secret", { constraint: false })], SecretAuditLog.prototype, "secretId", void 0);
|
|
111
|
-
__decorate([crossPackageRef("@happyvertical/smrt-users:User")], SecretAuditLog.prototype, "userId", void 0);
|
|
112
|
-
SecretAuditLog = __decorate([smrt({
|
|
113
|
-
tenantScoped: true,
|
|
114
|
-
api: { include: [] },
|
|
115
|
-
mcp: { include: [] },
|
|
116
|
-
cli: {
|
|
117
|
-
include: ["list"],
|
|
118
|
-
skipApiCheck: true
|
|
119
|
-
}
|
|
120
|
-
})], SecretAuditLog);
|
|
121
|
-
/**
|
|
122
|
-
* Create an audit log entry for a secret operation
|
|
123
|
-
*/
|
|
124
|
-
function createAuditEntry(params) {
|
|
125
|
-
const tenantId = params.tenantId === void 0 || params.tenantId === "system" ? null : params.tenantId;
|
|
126
|
-
const userId = params.userId == null || params.userId === "system" || params.userId === "" ? null : params.userId;
|
|
127
|
-
return {
|
|
128
|
-
secretId: params.secretId ?? null,
|
|
129
|
-
secretName: params.secretName,
|
|
130
|
-
userId,
|
|
131
|
-
action: params.action,
|
|
132
|
-
result: params.result,
|
|
133
|
-
ipAddress: params.ipAddress ?? "",
|
|
134
|
-
userAgent: params.userAgent ?? "",
|
|
135
|
-
details: params.details ?? {},
|
|
136
|
-
tenantId
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region src/models/Secret.ts
|
|
141
|
-
var Secret = class Secret extends SmrtObject {
|
|
142
|
-
/**
|
|
143
|
-
* Tenant that owns this secret. Also stored in context for per-tenant name uniqueness.
|
|
144
|
-
*/
|
|
145
|
-
tenantId = "";
|
|
146
|
-
/**
|
|
147
|
-
* Unique name for the secret within the tenant
|
|
148
|
-
*/
|
|
149
|
-
name = "";
|
|
150
|
-
/**
|
|
151
|
-
* Human-readable description
|
|
152
|
-
*/
|
|
153
|
-
description = "";
|
|
154
|
-
/**
|
|
155
|
-
* Category for organization (e.g., 'database', 'api-key', 'oauth')
|
|
156
|
-
*/
|
|
157
|
-
category = "";
|
|
158
|
-
/**
|
|
159
|
-
* JSON-encoded EncryptedEnvelope from @happyvertical/secrets
|
|
160
|
-
*/
|
|
161
|
-
encryptedValue = "";
|
|
162
|
-
/**
|
|
163
|
-
* Version of the tenant key used to encrypt this secret
|
|
164
|
-
*/
|
|
165
|
-
keyVersion = 1;
|
|
166
|
-
/**
|
|
167
|
-
* Current status of the secret
|
|
168
|
-
*/
|
|
169
|
-
status = "active";
|
|
170
|
-
/**
|
|
171
|
-
* Optional expiration date
|
|
172
|
-
*/
|
|
173
|
-
expiresAt = null;
|
|
174
|
-
/**
|
|
175
|
-
* Last time this secret was accessed (decrypted)
|
|
176
|
-
*/
|
|
177
|
-
lastAccessedAt = null;
|
|
178
|
-
/**
|
|
179
|
-
* Number of times this secret has been accessed
|
|
180
|
-
*/
|
|
181
|
-
accessCount = 0;
|
|
182
|
-
/**
|
|
183
|
-
* Additional metadata stored with the secret
|
|
184
|
-
*/
|
|
185
|
-
metadata = {};
|
|
186
|
-
constructor(options = {}) {
|
|
187
|
-
super(options);
|
|
188
|
-
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
189
|
-
if (options.name !== void 0) this.name = options.name;
|
|
190
|
-
if (options.description !== void 0) this.description = options.description;
|
|
191
|
-
if (options.category !== void 0) this.category = options.category;
|
|
192
|
-
if (options.encryptedValue !== void 0) this.encryptedValue = options.encryptedValue;
|
|
193
|
-
if (options.keyVersion !== void 0) this.keyVersion = options.keyVersion;
|
|
194
|
-
if (options.status !== void 0) this.status = options.status;
|
|
195
|
-
if (options.expiresAt !== void 0) this.expiresAt = options.expiresAt instanceof Date ? options.expiresAt : options.expiresAt ? new Date(options.expiresAt) : null;
|
|
196
|
-
if (options.lastAccessedAt !== void 0) this.lastAccessedAt = options.lastAccessedAt instanceof Date ? options.lastAccessedAt : options.lastAccessedAt ? new Date(options.lastAccessedAt) : null;
|
|
197
|
-
if (options.accessCount !== void 0) this.accessCount = options.accessCount;
|
|
198
|
-
if (options.metadata !== void 0) this.metadata = options.metadata;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Check if the secret is currently active
|
|
202
|
-
*/
|
|
203
|
-
isActive() {
|
|
204
|
-
return this.status === "active";
|
|
205
|
-
}
|
|
206
|
-
/**
|
|
207
|
-
* Check if the secret has expired
|
|
208
|
-
*/
|
|
209
|
-
isExpired() {
|
|
210
|
-
if (!this.expiresAt) return false;
|
|
211
|
-
return /* @__PURE__ */ new Date() >= this.expiresAt;
|
|
212
|
-
}
|
|
213
|
-
/**
|
|
214
|
-
* Check if the secret can be used (active and not expired)
|
|
215
|
-
*/
|
|
216
|
-
isUsable() {
|
|
217
|
-
return this.isActive() && !this.isExpired();
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Record an access to this secret
|
|
221
|
-
*/
|
|
222
|
-
recordAccess() {
|
|
223
|
-
this.lastAccessedAt = /* @__PURE__ */ new Date();
|
|
224
|
-
this.accessCount += 1;
|
|
225
|
-
}
|
|
226
|
-
/**
|
|
227
|
-
* Disable the secret
|
|
228
|
-
*/
|
|
229
|
-
disable() {
|
|
230
|
-
this.status = "disabled";
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Enable the secret
|
|
234
|
-
*/
|
|
235
|
-
enable() {
|
|
236
|
-
this.status = "active";
|
|
237
|
-
}
|
|
238
|
-
};
|
|
239
|
-
Secret = __decorate([smrt({
|
|
240
|
-
tenantScoped: true,
|
|
241
|
-
api: { include: [] },
|
|
242
|
-
mcp: { include: [] },
|
|
243
|
-
cli: {
|
|
244
|
-
include: ["list"],
|
|
245
|
-
skipApiCheck: true
|
|
246
|
-
}
|
|
247
|
-
})], Secret);
|
|
248
|
-
//#endregion
|
|
249
|
-
//#region src/models/TenantKey.ts
|
|
250
|
-
var TenantKey = class TenantKey extends SmrtObject {
|
|
251
|
-
/**
|
|
252
|
-
* Tenant ID this key belongs to
|
|
253
|
-
*/
|
|
254
|
-
tenantId = "";
|
|
255
|
-
/**
|
|
256
|
-
* Wrapped key data (format: wrappedKey:iv:authTag)
|
|
257
|
-
*/
|
|
258
|
-
wrappedKey = "";
|
|
259
|
-
/**
|
|
260
|
-
* ID of the AMK used to wrap this key
|
|
261
|
-
*/
|
|
262
|
-
amkKeyId = "";
|
|
263
|
-
/**
|
|
264
|
-
* Current status of the key
|
|
265
|
-
*/
|
|
266
|
-
status = "active";
|
|
267
|
-
/**
|
|
268
|
-
* Version number (increments on rotation)
|
|
269
|
-
*/
|
|
270
|
-
version = 1;
|
|
271
|
-
/**
|
|
272
|
-
* Recommended rotation date
|
|
273
|
-
*/
|
|
274
|
-
rotateAfter = null;
|
|
275
|
-
/**
|
|
276
|
-
* When the key was retired (if applicable)
|
|
277
|
-
*/
|
|
278
|
-
retiredAt = null;
|
|
279
|
-
constructor(options = {}) {
|
|
280
|
-
super(options);
|
|
281
|
-
if (options.tenantId !== void 0) this.tenantId = options.tenantId;
|
|
282
|
-
if (options.wrappedKey !== void 0) this.wrappedKey = options.wrappedKey;
|
|
283
|
-
if (options.amkKeyId !== void 0) this.amkKeyId = options.amkKeyId;
|
|
284
|
-
if (options.status !== void 0) this.status = options.status;
|
|
285
|
-
if (options.version !== void 0) this.version = options.version;
|
|
286
|
-
if (options.rotateAfter !== void 0) this.rotateAfter = options.rotateAfter instanceof Date ? options.rotateAfter : options.rotateAfter ? new Date(options.rotateAfter) : null;
|
|
287
|
-
if (options.retiredAt !== void 0) this.retiredAt = options.retiredAt instanceof Date ? options.retiredAt : options.retiredAt ? new Date(options.retiredAt) : null;
|
|
288
|
-
}
|
|
289
|
-
/**
|
|
290
|
-
* Check if this key is currently active
|
|
291
|
-
*/
|
|
292
|
-
isActive() {
|
|
293
|
-
return this.status === "active";
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* Check if this key needs rotation
|
|
297
|
-
*/
|
|
298
|
-
needsRotation() {
|
|
299
|
-
if (!this.rotateAfter) return false;
|
|
300
|
-
return /* @__PURE__ */ new Date() >= this.rotateAfter;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Check if this key is retired
|
|
304
|
-
*/
|
|
305
|
-
isRetired() {
|
|
306
|
-
return this.status === "retired";
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Check if this key is compromised
|
|
310
|
-
*/
|
|
311
|
-
isCompromised() {
|
|
312
|
-
return this.status === "compromised";
|
|
313
|
-
}
|
|
314
|
-
/**
|
|
315
|
-
* Check if this key can be used for decryption
|
|
316
|
-
* (active or retired keys can decrypt)
|
|
317
|
-
*/
|
|
318
|
-
canDecrypt() {
|
|
319
|
-
return this.status === "active" || this.status === "retired";
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Check if this key can be used for encryption
|
|
323
|
-
* (only active keys should encrypt)
|
|
324
|
-
*/
|
|
325
|
-
canEncrypt() {
|
|
326
|
-
return this.status === "active";
|
|
327
|
-
}
|
|
328
|
-
/**
|
|
329
|
-
* Mark this key as retired
|
|
330
|
-
*/
|
|
331
|
-
retire() {
|
|
332
|
-
this.status = "retired";
|
|
333
|
-
this.retiredAt = /* @__PURE__ */ new Date();
|
|
334
|
-
}
|
|
335
|
-
/**
|
|
336
|
-
* Mark this key as compromised
|
|
337
|
-
*/
|
|
338
|
-
markCompromised() {
|
|
339
|
-
this.status = "compromised";
|
|
340
|
-
}
|
|
341
|
-
};
|
|
342
|
-
TenantKey = __decorate([smrt({
|
|
343
|
-
api: { include: [] },
|
|
344
|
-
mcp: { include: [] },
|
|
345
|
-
cli: {
|
|
346
|
-
include: ["list", "get"],
|
|
347
|
-
skipApiCheck: true
|
|
348
|
-
}
|
|
349
|
-
})], TenantKey);
|
|
350
|
-
//#endregion
|
|
351
|
-
export { createAuditEntry as i, Secret as n, SecretAuditLog as r, TenantKey as t };
|
|
352
|
-
|
|
353
|
-
//# sourceMappingURL=TenantKey-BZRImpVR.js.map
|