@happyvertical/smrt-secrets 0.30.0

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.
Files changed (39) hide show
  1. package/AGENTS.md +66 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +7 -0
  4. package/README.md +144 -0
  5. package/dist/__smrt-register__.d.ts +2 -0
  6. package/dist/__smrt-register__.d.ts.map +1 -0
  7. package/dist/chunks/SecretService-C91H6WJK.js +1275 -0
  8. package/dist/chunks/SecretService-C91H6WJK.js.map +1 -0
  9. package/dist/chunks/TenantKey-DzglnpAV.js +377 -0
  10. package/dist/chunks/TenantKey-DzglnpAV.js.map +1 -0
  11. package/dist/collections/SecretAuditLogCollection.d.ts +71 -0
  12. package/dist/collections/SecretAuditLogCollection.d.ts.map +1 -0
  13. package/dist/collections/SecretCollection.d.ts +63 -0
  14. package/dist/collections/SecretCollection.d.ts.map +1 -0
  15. package/dist/collections/TenantKeyCollection.d.ts +42 -0
  16. package/dist/collections/TenantKeyCollection.d.ts.map +1 -0
  17. package/dist/collections/index.d.ts +8 -0
  18. package/dist/collections/index.d.ts.map +1 -0
  19. package/dist/index.d.ts +12 -0
  20. package/dist/index.d.ts.map +1 -0
  21. package/dist/index.js +26 -0
  22. package/dist/index.js.map +1 -0
  23. package/dist/manifest.json +1272 -0
  24. package/dist/models/Secret.d.ts +104 -0
  25. package/dist/models/Secret.d.ts.map +1 -0
  26. package/dist/models/SecretAuditLog.d.ts +123 -0
  27. package/dist/models/SecretAuditLog.d.ts.map +1 -0
  28. package/dist/models/TenantKey.d.ts +101 -0
  29. package/dist/models/TenantKey.d.ts.map +1 -0
  30. package/dist/models/index.d.ts +4 -0
  31. package/dist/models/index.d.ts.map +1 -0
  32. package/dist/models/index.js +8 -0
  33. package/dist/models/index.js.map +1 -0
  34. package/dist/services/SecretService.d.ts +266 -0
  35. package/dist/services/SecretService.d.ts.map +1 -0
  36. package/dist/services/SecretService.js +9 -0
  37. package/dist/services/SecretService.js.map +1 -0
  38. package/dist/smrt-knowledge.json +447 -0
  39. package/package.json +71 -0
@@ -0,0 +1,1272 @@
1
+ {
2
+ "version": "1.0.0",
3
+ "timestamp": 1782177077494,
4
+ "packageName": "@happyvertical/smrt-secrets",
5
+ "packageVersion": "0.30.0",
6
+ "objects": {
7
+ "@happyvertical/smrt-secrets:SecretAuditLogCollection": {
8
+ "name": "secretauditlogcollection",
9
+ "className": "SecretAuditLogCollection",
10
+ "qualifiedName": "@happyvertical/smrt-secrets:SecretAuditLogCollection",
11
+ "collection": "secretauditlogs",
12
+ "filePath": "/home/runner/_work/smrt/smrt/packages/secrets/src/collections/SecretAuditLogCollection.ts",
13
+ "packageName": "@happyvertical/smrt-secrets",
14
+ "fields": {},
15
+ "methods": {
16
+ "listLogs": {
17
+ "name": "listLogs",
18
+ "async": true,
19
+ "parameters": [
20
+ {
21
+ "name": "options",
22
+ "type": "ListAuditLogsOptions",
23
+ "optional": true
24
+ }
25
+ ],
26
+ "returnType": "Promise<SecretAuditLog[]>",
27
+ "isStatic": false,
28
+ "isPublic": true
29
+ },
30
+ "getSecretHistory": {
31
+ "name": "getSecretHistory",
32
+ "async": true,
33
+ "parameters": [
34
+ {
35
+ "name": "secretName",
36
+ "type": "string",
37
+ "optional": false
38
+ },
39
+ {
40
+ "name": "limit",
41
+ "type": "number",
42
+ "optional": true
43
+ }
44
+ ],
45
+ "returnType": "Promise<SecretAuditLog[]>",
46
+ "isStatic": false,
47
+ "isPublic": true
48
+ },
49
+ "getUserActivity": {
50
+ "name": "getUserActivity",
51
+ "async": true,
52
+ "parameters": [
53
+ {
54
+ "name": "userId",
55
+ "type": "string",
56
+ "optional": false
57
+ },
58
+ {
59
+ "name": "limit",
60
+ "type": "number",
61
+ "optional": true
62
+ }
63
+ ],
64
+ "returnType": "Promise<SecretAuditLog[]>",
65
+ "isStatic": false,
66
+ "isPublic": true
67
+ },
68
+ "getRecentFailures": {
69
+ "name": "getRecentFailures",
70
+ "async": true,
71
+ "parameters": [
72
+ {
73
+ "name": "limit",
74
+ "type": "number",
75
+ "optional": true
76
+ }
77
+ ],
78
+ "returnType": "Promise<SecretAuditLog[]>",
79
+ "isStatic": false,
80
+ "isPublic": true
81
+ },
82
+ "getRecentDenials": {
83
+ "name": "getRecentDenials",
84
+ "async": true,
85
+ "parameters": [
86
+ {
87
+ "name": "limit",
88
+ "type": "number",
89
+ "optional": true
90
+ }
91
+ ],
92
+ "returnType": "Promise<SecretAuditLog[]>",
93
+ "isStatic": false,
94
+ "isPublic": true
95
+ },
96
+ "countByAction": {
97
+ "name": "countByAction",
98
+ "async": true,
99
+ "parameters": [
100
+ {
101
+ "name": "since",
102
+ "type": "Date",
103
+ "optional": true
104
+ }
105
+ ],
106
+ "returnType": "Promise<Record<SecretAuditAction, number>>",
107
+ "isStatic": false,
108
+ "isPublic": true
109
+ },
110
+ "countByResult": {
111
+ "name": "countByResult",
112
+ "async": true,
113
+ "parameters": [
114
+ {
115
+ "name": "since",
116
+ "type": "Date",
117
+ "optional": true
118
+ }
119
+ ],
120
+ "returnType": "Promise<Record<SecretAuditResult, number>>",
121
+ "isStatic": false,
122
+ "isPublic": true
123
+ },
124
+ "cleanup": {
125
+ "name": "cleanup",
126
+ "async": true,
127
+ "parameters": [
128
+ {
129
+ "name": "olderThanDays",
130
+ "type": "number",
131
+ "optional": true
132
+ }
133
+ ],
134
+ "returnType": "Promise<number>",
135
+ "isStatic": false,
136
+ "isPublic": true
137
+ }
138
+ },
139
+ "decoratorConfig": {},
140
+ "extends": "SmrtCollection",
141
+ "extendsTypeArg": "SecretAuditLog",
142
+ "exportName": "SecretAuditLogCollection",
143
+ "collectionExportName": "SecretAuditLogCollectionCollection",
144
+ "schema": {
145
+ "tableName": "secret_audit_log_collections",
146
+ "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);",
147
+ "columns": {
148
+ "id": {
149
+ "type": "UUID",
150
+ "primaryKey": true,
151
+ "referenceKind": "id",
152
+ "notNull": true
153
+ },
154
+ "slug": {
155
+ "type": "TEXT",
156
+ "notNull": true
157
+ },
158
+ "context": {
159
+ "type": "TEXT",
160
+ "notNull": true,
161
+ "default": ""
162
+ },
163
+ "created_at": {
164
+ "type": "TIMESTAMP",
165
+ "notNull": true,
166
+ "default": "current_timestamp"
167
+ },
168
+ "updated_at": {
169
+ "type": "TIMESTAMP",
170
+ "notNull": true,
171
+ "default": "current_timestamp"
172
+ }
173
+ },
174
+ "indexes": [
175
+ {
176
+ "name": "secret_audit_log_collections_id_idx",
177
+ "columns": [
178
+ "id"
179
+ ]
180
+ },
181
+ {
182
+ "name": "secret_audit_log_collections_slug_context_idx",
183
+ "columns": [
184
+ "slug",
185
+ "context"
186
+ ],
187
+ "unique": true
188
+ }
189
+ ],
190
+ "version": "7bb61130"
191
+ }
192
+ },
193
+ "@happyvertical/smrt-secrets:SecretCollection": {
194
+ "name": "secretcollection",
195
+ "className": "SecretCollection",
196
+ "qualifiedName": "@happyvertical/smrt-secrets:SecretCollection",
197
+ "collection": "secrets",
198
+ "filePath": "/home/runner/_work/smrt/smrt/packages/secrets/src/collections/SecretCollection.ts",
199
+ "packageName": "@happyvertical/smrt-secrets",
200
+ "fields": {},
201
+ "methods": {
202
+ "findByName": {
203
+ "name": "findByName",
204
+ "async": true,
205
+ "parameters": [
206
+ {
207
+ "name": "tenantId",
208
+ "type": "string",
209
+ "optional": false
210
+ },
211
+ {
212
+ "name": "name",
213
+ "type": "string",
214
+ "optional": false
215
+ }
216
+ ],
217
+ "returnType": "Promise<Secret | null>",
218
+ "isStatic": false,
219
+ "isPublic": true
220
+ },
221
+ "listSecrets": {
222
+ "name": "listSecrets",
223
+ "async": true,
224
+ "parameters": [
225
+ {
226
+ "name": "tenantId",
227
+ "type": "string",
228
+ "optional": false
229
+ },
230
+ {
231
+ "name": "options",
232
+ "type": "ListSecretsOptions",
233
+ "optional": true
234
+ }
235
+ ],
236
+ "returnType": "Promise<Secret[]>",
237
+ "isStatic": false,
238
+ "isPublic": true
239
+ },
240
+ "listActive": {
241
+ "name": "listActive",
242
+ "async": true,
243
+ "parameters": [
244
+ {
245
+ "name": "tenantId",
246
+ "type": "string",
247
+ "optional": false
248
+ }
249
+ ],
250
+ "returnType": "Promise<Secret[]>",
251
+ "isStatic": false,
252
+ "isPublic": true
253
+ },
254
+ "listByCategory": {
255
+ "name": "listByCategory",
256
+ "async": true,
257
+ "parameters": [
258
+ {
259
+ "name": "tenantId",
260
+ "type": "string",
261
+ "optional": false
262
+ },
263
+ {
264
+ "name": "category",
265
+ "type": "string",
266
+ "optional": false
267
+ }
268
+ ],
269
+ "returnType": "Promise<Secret[]>",
270
+ "isStatic": false,
271
+ "isPublic": true
272
+ },
273
+ "listExpiring": {
274
+ "name": "listExpiring",
275
+ "async": true,
276
+ "parameters": [
277
+ {
278
+ "name": "tenantId",
279
+ "type": "string",
280
+ "optional": false
281
+ },
282
+ {
283
+ "name": "daysAhead",
284
+ "type": "number",
285
+ "optional": true
286
+ }
287
+ ],
288
+ "returnType": "Promise<Secret[]>",
289
+ "isStatic": false,
290
+ "isPublic": true
291
+ },
292
+ "getCategories": {
293
+ "name": "getCategories",
294
+ "async": true,
295
+ "parameters": [
296
+ {
297
+ "name": "tenantId",
298
+ "type": "string",
299
+ "optional": false
300
+ }
301
+ ],
302
+ "returnType": "Promise<string[]>",
303
+ "isStatic": false,
304
+ "isPublic": true
305
+ },
306
+ "countByStatus": {
307
+ "name": "countByStatus",
308
+ "async": true,
309
+ "parameters": [
310
+ {
311
+ "name": "tenantId",
312
+ "type": "string",
313
+ "optional": false
314
+ }
315
+ ],
316
+ "returnType": "Promise<Record<SecretStatus, number>>",
317
+ "isStatic": false,
318
+ "isPublic": true
319
+ },
320
+ "deleteByName": {
321
+ "name": "deleteByName",
322
+ "async": true,
323
+ "parameters": [
324
+ {
325
+ "name": "tenantId",
326
+ "type": "string",
327
+ "optional": false
328
+ },
329
+ {
330
+ "name": "name",
331
+ "type": "string",
332
+ "optional": false
333
+ }
334
+ ],
335
+ "returnType": "Promise<boolean>",
336
+ "isStatic": false,
337
+ "isPublic": true
338
+ }
339
+ },
340
+ "decoratorConfig": {},
341
+ "extends": "SmrtCollection",
342
+ "extendsTypeArg": "Secret",
343
+ "exportName": "SecretCollection",
344
+ "collectionExportName": "SecretCollectionCollection",
345
+ "schema": {
346
+ "tableName": "secret_collections",
347
+ "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);",
348
+ "columns": {
349
+ "id": {
350
+ "type": "UUID",
351
+ "primaryKey": true,
352
+ "referenceKind": "id",
353
+ "notNull": true
354
+ },
355
+ "slug": {
356
+ "type": "TEXT",
357
+ "notNull": true
358
+ },
359
+ "context": {
360
+ "type": "TEXT",
361
+ "notNull": true,
362
+ "default": ""
363
+ },
364
+ "created_at": {
365
+ "type": "TIMESTAMP",
366
+ "notNull": true,
367
+ "default": "current_timestamp"
368
+ },
369
+ "updated_at": {
370
+ "type": "TIMESTAMP",
371
+ "notNull": true,
372
+ "default": "current_timestamp"
373
+ }
374
+ },
375
+ "indexes": [
376
+ {
377
+ "name": "secret_collections_id_idx",
378
+ "columns": [
379
+ "id"
380
+ ]
381
+ },
382
+ {
383
+ "name": "secret_collections_slug_context_idx",
384
+ "columns": [
385
+ "slug",
386
+ "context"
387
+ ],
388
+ "unique": true
389
+ }
390
+ ],
391
+ "version": "5f18a721"
392
+ }
393
+ },
394
+ "@happyvertical/smrt-secrets:TenantKeyCollection": {
395
+ "name": "tenantkeycollection",
396
+ "className": "TenantKeyCollection",
397
+ "qualifiedName": "@happyvertical/smrt-secrets:TenantKeyCollection",
398
+ "collection": "tenantkeys",
399
+ "filePath": "/home/runner/_work/smrt/smrt/packages/secrets/src/collections/TenantKeyCollection.ts",
400
+ "packageName": "@happyvertical/smrt-secrets",
401
+ "fields": {},
402
+ "methods": {
403
+ "getActiveKey": {
404
+ "name": "getActiveKey",
405
+ "async": true,
406
+ "parameters": [
407
+ {
408
+ "name": "tenantId",
409
+ "type": "string",
410
+ "optional": false
411
+ }
412
+ ],
413
+ "returnType": "Promise<TenantKey | null>",
414
+ "isStatic": false,
415
+ "isPublic": true
416
+ },
417
+ "listKeyVersions": {
418
+ "name": "listKeyVersions",
419
+ "async": true,
420
+ "parameters": [
421
+ {
422
+ "name": "tenantId",
423
+ "type": "string",
424
+ "optional": false
425
+ }
426
+ ],
427
+ "returnType": "Promise<TenantKey[]>",
428
+ "isStatic": false,
429
+ "isPublic": true
430
+ },
431
+ "getKeyVersion": {
432
+ "name": "getKeyVersion",
433
+ "async": true,
434
+ "parameters": [
435
+ {
436
+ "name": "tenantId",
437
+ "type": "string",
438
+ "optional": false
439
+ },
440
+ {
441
+ "name": "version",
442
+ "type": "number",
443
+ "optional": false
444
+ }
445
+ ],
446
+ "returnType": "Promise<TenantKey | null>",
447
+ "isStatic": false,
448
+ "isPublic": true
449
+ },
450
+ "findKeysNeedingRotation": {
451
+ "name": "findKeysNeedingRotation",
452
+ "async": true,
453
+ "parameters": [],
454
+ "returnType": "Promise<TenantKey[]>",
455
+ "isStatic": false,
456
+ "isPublic": true
457
+ },
458
+ "listAllActiveKeys": {
459
+ "name": "listAllActiveKeys",
460
+ "async": true,
461
+ "parameters": [],
462
+ "returnType": "Promise<TenantKey[]>",
463
+ "isStatic": false,
464
+ "isPublic": true
465
+ },
466
+ "countByStatus": {
467
+ "name": "countByStatus",
468
+ "async": true,
469
+ "parameters": [],
470
+ "returnType": "Promise<Record<TenantKeyStatus, number>>",
471
+ "isStatic": false,
472
+ "isPublic": true
473
+ },
474
+ "markCompromised": {
475
+ "name": "markCompromised",
476
+ "async": true,
477
+ "parameters": [
478
+ {
479
+ "name": "tenantId",
480
+ "type": "string",
481
+ "optional": false
482
+ },
483
+ {
484
+ "name": "keyId",
485
+ "type": "string",
486
+ "optional": false
487
+ }
488
+ ],
489
+ "returnType": "Promise<boolean>",
490
+ "isStatic": false,
491
+ "isPublic": true
492
+ },
493
+ "cleanupRetiredKeys": {
494
+ "name": "cleanupRetiredKeys",
495
+ "async": true,
496
+ "parameters": [
497
+ {
498
+ "name": "olderThanDays",
499
+ "type": "number",
500
+ "optional": true
501
+ }
502
+ ],
503
+ "returnType": "Promise<number>",
504
+ "isStatic": false,
505
+ "isPublic": true
506
+ }
507
+ },
508
+ "decoratorConfig": {},
509
+ "extends": "SmrtCollection",
510
+ "extendsTypeArg": "TenantKey",
511
+ "exportName": "TenantKeyCollection",
512
+ "collectionExportName": "TenantKeyCollectionCollection",
513
+ "schema": {
514
+ "tableName": "tenant_key_collections",
515
+ "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);",
516
+ "columns": {
517
+ "id": {
518
+ "type": "UUID",
519
+ "primaryKey": true,
520
+ "referenceKind": "id",
521
+ "notNull": true
522
+ },
523
+ "slug": {
524
+ "type": "TEXT",
525
+ "notNull": true
526
+ },
527
+ "context": {
528
+ "type": "TEXT",
529
+ "notNull": true,
530
+ "default": ""
531
+ },
532
+ "created_at": {
533
+ "type": "TIMESTAMP",
534
+ "notNull": true,
535
+ "default": "current_timestamp"
536
+ },
537
+ "updated_at": {
538
+ "type": "TIMESTAMP",
539
+ "notNull": true,
540
+ "default": "current_timestamp"
541
+ }
542
+ },
543
+ "indexes": [
544
+ {
545
+ "name": "tenant_key_collections_id_idx",
546
+ "columns": [
547
+ "id"
548
+ ]
549
+ },
550
+ {
551
+ "name": "tenant_key_collections_slug_context_idx",
552
+ "columns": [
553
+ "slug",
554
+ "context"
555
+ ],
556
+ "unique": true
557
+ }
558
+ ],
559
+ "version": "26616d13"
560
+ }
561
+ },
562
+ "@happyvertical/smrt-secrets:Secret": {
563
+ "name": "secret",
564
+ "className": "Secret",
565
+ "qualifiedName": "@happyvertical/smrt-secrets:Secret",
566
+ "collection": "secrets",
567
+ "filePath": "/home/runner/_work/smrt/smrt/packages/secrets/src/models/Secret.ts",
568
+ "packageName": "@happyvertical/smrt-secrets",
569
+ "fields": {
570
+ "tenantId": {
571
+ "type": "text",
572
+ "required": false,
573
+ "default": "",
574
+ "_meta": {
575
+ "sqlType": "UUID",
576
+ "__tenancy": {
577
+ "isTenantIdField": true,
578
+ "mode": "required",
579
+ "field": "tenantId",
580
+ "autoFilter": true,
581
+ "autoPopulate": true,
582
+ "allowSuperAdminBypass": false
583
+ }
584
+ }
585
+ },
586
+ "name": {
587
+ "type": "text",
588
+ "required": false,
589
+ "default": ""
590
+ },
591
+ "description": {
592
+ "type": "text",
593
+ "required": false,
594
+ "default": ""
595
+ },
596
+ "category": {
597
+ "type": "text",
598
+ "required": false,
599
+ "default": ""
600
+ },
601
+ "encryptedValue": {
602
+ "type": "text",
603
+ "required": false,
604
+ "default": ""
605
+ },
606
+ "keyVersion": {
607
+ "type": "integer",
608
+ "required": false,
609
+ "default": 1
610
+ },
611
+ "status": {
612
+ "type": "text",
613
+ "required": false,
614
+ "default": "active"
615
+ },
616
+ "expiresAt": {
617
+ "type": "datetime",
618
+ "required": false
619
+ },
620
+ "lastAccessedAt": {
621
+ "type": "datetime",
622
+ "required": false
623
+ },
624
+ "accessCount": {
625
+ "type": "integer",
626
+ "required": false,
627
+ "default": 0
628
+ },
629
+ "metadata": {
630
+ "type": "json",
631
+ "required": false,
632
+ "default": {}
633
+ }
634
+ },
635
+ "methods": {
636
+ "isActive": {
637
+ "name": "isActive",
638
+ "async": false,
639
+ "parameters": [],
640
+ "returnType": "boolean",
641
+ "isStatic": false,
642
+ "isPublic": true
643
+ },
644
+ "isExpired": {
645
+ "name": "isExpired",
646
+ "async": false,
647
+ "parameters": [],
648
+ "returnType": "boolean",
649
+ "isStatic": false,
650
+ "isPublic": true
651
+ },
652
+ "isUsable": {
653
+ "name": "isUsable",
654
+ "async": false,
655
+ "parameters": [],
656
+ "returnType": "boolean",
657
+ "isStatic": false,
658
+ "isPublic": true
659
+ },
660
+ "recordAccess": {
661
+ "name": "recordAccess",
662
+ "async": false,
663
+ "parameters": [],
664
+ "returnType": "void",
665
+ "isStatic": false,
666
+ "isPublic": true
667
+ },
668
+ "disable": {
669
+ "name": "disable",
670
+ "async": false,
671
+ "parameters": [],
672
+ "returnType": "void",
673
+ "isStatic": false,
674
+ "isPublic": true
675
+ },
676
+ "enable": {
677
+ "name": "enable",
678
+ "async": false,
679
+ "parameters": [],
680
+ "returnType": "void",
681
+ "isStatic": false,
682
+ "isPublic": true
683
+ }
684
+ },
685
+ "decoratorConfig": {
686
+ "tenantScoped": true,
687
+ "api": {
688
+ "include": []
689
+ },
690
+ "mcp": {
691
+ "include": []
692
+ },
693
+ "cli": {
694
+ "include": [
695
+ "list"
696
+ ],
697
+ "skipApiCheck": true
698
+ }
699
+ },
700
+ "extends": "SmrtObject",
701
+ "exportName": "Secret",
702
+ "collectionExportName": "SecretCollection",
703
+ "schema": {
704
+ "tableName": "secrets",
705
+ "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);",
706
+ "columns": {
707
+ "id": {
708
+ "type": "UUID",
709
+ "primaryKey": true,
710
+ "referenceKind": "id",
711
+ "notNull": true
712
+ },
713
+ "slug": {
714
+ "type": "TEXT",
715
+ "notNull": true
716
+ },
717
+ "context": {
718
+ "type": "TEXT",
719
+ "notNull": true,
720
+ "default": ""
721
+ },
722
+ "created_at": {
723
+ "type": "TIMESTAMP",
724
+ "notNull": true,
725
+ "default": "current_timestamp"
726
+ },
727
+ "updated_at": {
728
+ "type": "TIMESTAMP",
729
+ "notNull": true,
730
+ "default": "current_timestamp"
731
+ },
732
+ "tenant_id": {
733
+ "type": "UUID",
734
+ "referenceKind": "tenantId",
735
+ "notNull": false,
736
+ "unique": false
737
+ },
738
+ "name": {
739
+ "type": "TEXT",
740
+ "notNull": false,
741
+ "unique": false,
742
+ "default": ""
743
+ },
744
+ "description": {
745
+ "type": "TEXT",
746
+ "notNull": false,
747
+ "unique": false,
748
+ "default": ""
749
+ },
750
+ "category": {
751
+ "type": "TEXT",
752
+ "notNull": false,
753
+ "unique": false,
754
+ "default": ""
755
+ },
756
+ "encrypted_value": {
757
+ "type": "TEXT",
758
+ "notNull": false,
759
+ "unique": false,
760
+ "default": ""
761
+ },
762
+ "key_version": {
763
+ "type": "INTEGER",
764
+ "notNull": false,
765
+ "unique": false,
766
+ "default": 1
767
+ },
768
+ "status": {
769
+ "type": "TEXT",
770
+ "notNull": false,
771
+ "unique": false,
772
+ "default": "active"
773
+ },
774
+ "expires_at": {
775
+ "type": "TIMESTAMP",
776
+ "notNull": false,
777
+ "unique": false
778
+ },
779
+ "last_accessed_at": {
780
+ "type": "TIMESTAMP",
781
+ "notNull": false,
782
+ "unique": false
783
+ },
784
+ "access_count": {
785
+ "type": "INTEGER",
786
+ "notNull": false,
787
+ "unique": false,
788
+ "default": 0
789
+ },
790
+ "metadata": {
791
+ "type": "JSON",
792
+ "notNull": false,
793
+ "unique": false,
794
+ "default": {}
795
+ }
796
+ },
797
+ "indexes": [
798
+ {
799
+ "name": "secrets_id_idx",
800
+ "columns": [
801
+ "id"
802
+ ]
803
+ },
804
+ {
805
+ "name": "secrets_slug_context_idx",
806
+ "columns": [
807
+ "slug",
808
+ "context"
809
+ ],
810
+ "unique": true
811
+ }
812
+ ],
813
+ "version": "6298a980"
814
+ }
815
+ },
816
+ "@happyvertical/smrt-secrets:SecretAuditLog": {
817
+ "name": "secretauditlog",
818
+ "className": "SecretAuditLog",
819
+ "qualifiedName": "@happyvertical/smrt-secrets:SecretAuditLog",
820
+ "collection": "secretauditlogs",
821
+ "filePath": "/home/runner/_work/smrt/smrt/packages/secrets/src/models/SecretAuditLog.ts",
822
+ "packageName": "@happyvertical/smrt-secrets",
823
+ "fields": {
824
+ "tenantId": {
825
+ "type": "text",
826
+ "required": false,
827
+ "_meta": {
828
+ "sqlType": "UUID",
829
+ "__tenancy": {
830
+ "isTenantIdField": true,
831
+ "mode": "required",
832
+ "field": "tenantId",
833
+ "autoFilter": true,
834
+ "autoPopulate": true,
835
+ "allowSuperAdminBypass": false
836
+ }
837
+ }
838
+ },
839
+ "secretId": {
840
+ "type": "foreignKey",
841
+ "required": false,
842
+ "related": "Secret"
843
+ },
844
+ "secretName": {
845
+ "type": "text",
846
+ "required": false,
847
+ "default": ""
848
+ },
849
+ "userId": {
850
+ "type": "crossPackageRef",
851
+ "required": false,
852
+ "related": "@happyvertical/smrt-users:User"
853
+ },
854
+ "action": {
855
+ "type": "text",
856
+ "required": false,
857
+ "default": "read"
858
+ },
859
+ "result": {
860
+ "type": "text",
861
+ "required": false,
862
+ "default": "success"
863
+ },
864
+ "ipAddress": {
865
+ "type": "text",
866
+ "required": false,
867
+ "default": ""
868
+ },
869
+ "userAgent": {
870
+ "type": "text",
871
+ "required": false,
872
+ "default": ""
873
+ },
874
+ "details": {
875
+ "type": "json",
876
+ "required": false,
877
+ "default": {}
878
+ }
879
+ },
880
+ "methods": {
881
+ "isSuccess": {
882
+ "name": "isSuccess",
883
+ "async": false,
884
+ "parameters": [],
885
+ "returnType": "boolean",
886
+ "isStatic": false,
887
+ "isPublic": true
888
+ },
889
+ "isFailure": {
890
+ "name": "isFailure",
891
+ "async": false,
892
+ "parameters": [],
893
+ "returnType": "boolean",
894
+ "isStatic": false,
895
+ "isPublic": true
896
+ },
897
+ "isDenied": {
898
+ "name": "isDenied",
899
+ "async": false,
900
+ "parameters": [],
901
+ "returnType": "boolean",
902
+ "isStatic": false,
903
+ "isPublic": true
904
+ },
905
+ "isReadAction": {
906
+ "name": "isReadAction",
907
+ "async": false,
908
+ "parameters": [],
909
+ "returnType": "boolean",
910
+ "isStatic": false,
911
+ "isPublic": true
912
+ },
913
+ "isWriteAction": {
914
+ "name": "isWriteAction",
915
+ "async": false,
916
+ "parameters": [],
917
+ "returnType": "boolean",
918
+ "isStatic": false,
919
+ "isPublic": true
920
+ },
921
+ "isKeyOperation": {
922
+ "name": "isKeyOperation",
923
+ "async": false,
924
+ "parameters": [],
925
+ "returnType": "boolean",
926
+ "isStatic": false,
927
+ "isPublic": true
928
+ }
929
+ },
930
+ "decoratorConfig": {
931
+ "tenantScoped": true,
932
+ "api": {
933
+ "include": []
934
+ },
935
+ "mcp": {
936
+ "include": []
937
+ },
938
+ "cli": {
939
+ "include": [
940
+ "list"
941
+ ],
942
+ "skipApiCheck": true
943
+ }
944
+ },
945
+ "extends": "SmrtObject",
946
+ "exportName": "SecretAuditLog",
947
+ "collectionExportName": "SecretAuditLogCollection",
948
+ "schema": {
949
+ "tableName": "secret_audit_logs",
950
+ "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);",
951
+ "columns": {
952
+ "id": {
953
+ "type": "UUID",
954
+ "primaryKey": true,
955
+ "referenceKind": "id",
956
+ "notNull": true
957
+ },
958
+ "slug": {
959
+ "type": "TEXT",
960
+ "notNull": true
961
+ },
962
+ "context": {
963
+ "type": "TEXT",
964
+ "notNull": true,
965
+ "default": ""
966
+ },
967
+ "created_at": {
968
+ "type": "TIMESTAMP",
969
+ "notNull": true,
970
+ "default": "current_timestamp"
971
+ },
972
+ "updated_at": {
973
+ "type": "TIMESTAMP",
974
+ "notNull": true,
975
+ "default": "current_timestamp"
976
+ },
977
+ "tenant_id": {
978
+ "type": "UUID",
979
+ "referenceKind": "tenantId",
980
+ "notNull": false,
981
+ "unique": false
982
+ },
983
+ "secret_id": {
984
+ "type": "UUID",
985
+ "referenceKind": "foreignKey",
986
+ "notNull": false,
987
+ "unique": false
988
+ },
989
+ "secret_name": {
990
+ "type": "TEXT",
991
+ "notNull": false,
992
+ "unique": false,
993
+ "default": ""
994
+ },
995
+ "user_id": {
996
+ "type": "UUID",
997
+ "referenceKind": "crossPackageRef",
998
+ "notNull": false,
999
+ "unique": false
1000
+ },
1001
+ "action": {
1002
+ "type": "TEXT",
1003
+ "notNull": false,
1004
+ "unique": false,
1005
+ "default": "read"
1006
+ },
1007
+ "result": {
1008
+ "type": "TEXT",
1009
+ "notNull": false,
1010
+ "unique": false,
1011
+ "default": "success"
1012
+ },
1013
+ "ip_address": {
1014
+ "type": "TEXT",
1015
+ "notNull": false,
1016
+ "unique": false,
1017
+ "default": ""
1018
+ },
1019
+ "user_agent": {
1020
+ "type": "TEXT",
1021
+ "notNull": false,
1022
+ "unique": false,
1023
+ "default": ""
1024
+ },
1025
+ "details": {
1026
+ "type": "JSON",
1027
+ "notNull": false,
1028
+ "unique": false,
1029
+ "default": {}
1030
+ }
1031
+ },
1032
+ "indexes": [
1033
+ {
1034
+ "name": "secret_audit_logs_id_idx",
1035
+ "columns": [
1036
+ "id"
1037
+ ]
1038
+ },
1039
+ {
1040
+ "name": "secret_audit_logs_slug_context_idx",
1041
+ "columns": [
1042
+ "slug",
1043
+ "context"
1044
+ ],
1045
+ "unique": true
1046
+ }
1047
+ ],
1048
+ "version": "af0d679d"
1049
+ }
1050
+ },
1051
+ "@happyvertical/smrt-secrets:TenantKey": {
1052
+ "name": "tenantkey",
1053
+ "className": "TenantKey",
1054
+ "qualifiedName": "@happyvertical/smrt-secrets:TenantKey",
1055
+ "collection": "tenantkeys",
1056
+ "filePath": "/home/runner/_work/smrt/smrt/packages/secrets/src/models/TenantKey.ts",
1057
+ "packageName": "@happyvertical/smrt-secrets",
1058
+ "fields": {
1059
+ "tenantId": {
1060
+ "type": "text",
1061
+ "required": false,
1062
+ "default": ""
1063
+ },
1064
+ "wrappedKey": {
1065
+ "type": "text",
1066
+ "required": false,
1067
+ "default": ""
1068
+ },
1069
+ "amkKeyId": {
1070
+ "type": "text",
1071
+ "required": false,
1072
+ "default": ""
1073
+ },
1074
+ "status": {
1075
+ "type": "text",
1076
+ "required": false,
1077
+ "default": "active"
1078
+ },
1079
+ "version": {
1080
+ "type": "integer",
1081
+ "required": false,
1082
+ "default": 1
1083
+ },
1084
+ "rotateAfter": {
1085
+ "type": "datetime",
1086
+ "required": false
1087
+ },
1088
+ "retiredAt": {
1089
+ "type": "datetime",
1090
+ "required": false
1091
+ }
1092
+ },
1093
+ "methods": {
1094
+ "isActive": {
1095
+ "name": "isActive",
1096
+ "async": false,
1097
+ "parameters": [],
1098
+ "returnType": "boolean",
1099
+ "isStatic": false,
1100
+ "isPublic": true
1101
+ },
1102
+ "needsRotation": {
1103
+ "name": "needsRotation",
1104
+ "async": false,
1105
+ "parameters": [],
1106
+ "returnType": "boolean",
1107
+ "isStatic": false,
1108
+ "isPublic": true
1109
+ },
1110
+ "isRetired": {
1111
+ "name": "isRetired",
1112
+ "async": false,
1113
+ "parameters": [],
1114
+ "returnType": "boolean",
1115
+ "isStatic": false,
1116
+ "isPublic": true
1117
+ },
1118
+ "isCompromised": {
1119
+ "name": "isCompromised",
1120
+ "async": false,
1121
+ "parameters": [],
1122
+ "returnType": "boolean",
1123
+ "isStatic": false,
1124
+ "isPublic": true
1125
+ },
1126
+ "canDecrypt": {
1127
+ "name": "canDecrypt",
1128
+ "async": false,
1129
+ "parameters": [],
1130
+ "returnType": "boolean",
1131
+ "isStatic": false,
1132
+ "isPublic": true
1133
+ },
1134
+ "canEncrypt": {
1135
+ "name": "canEncrypt",
1136
+ "async": false,
1137
+ "parameters": [],
1138
+ "returnType": "boolean",
1139
+ "isStatic": false,
1140
+ "isPublic": true
1141
+ },
1142
+ "retire": {
1143
+ "name": "retire",
1144
+ "async": false,
1145
+ "parameters": [],
1146
+ "returnType": "void",
1147
+ "isStatic": false,
1148
+ "isPublic": true
1149
+ },
1150
+ "markCompromised": {
1151
+ "name": "markCompromised",
1152
+ "async": false,
1153
+ "parameters": [],
1154
+ "returnType": "void",
1155
+ "isStatic": false,
1156
+ "isPublic": true
1157
+ }
1158
+ },
1159
+ "decoratorConfig": {
1160
+ "api": {
1161
+ "include": []
1162
+ },
1163
+ "mcp": {
1164
+ "include": []
1165
+ },
1166
+ "cli": {
1167
+ "include": [
1168
+ "list",
1169
+ "get"
1170
+ ],
1171
+ "skipApiCheck": true
1172
+ }
1173
+ },
1174
+ "extends": "SmrtObject",
1175
+ "exportName": "TenantKey",
1176
+ "collectionExportName": "TenantKeyCollection",
1177
+ "schema": {
1178
+ "tableName": "tenant_keys",
1179
+ "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);",
1180
+ "columns": {
1181
+ "id": {
1182
+ "type": "UUID",
1183
+ "primaryKey": true,
1184
+ "referenceKind": "id",
1185
+ "notNull": true
1186
+ },
1187
+ "slug": {
1188
+ "type": "TEXT",
1189
+ "notNull": true
1190
+ },
1191
+ "context": {
1192
+ "type": "TEXT",
1193
+ "notNull": true,
1194
+ "default": ""
1195
+ },
1196
+ "created_at": {
1197
+ "type": "TIMESTAMP",
1198
+ "notNull": true,
1199
+ "default": "current_timestamp"
1200
+ },
1201
+ "updated_at": {
1202
+ "type": "TIMESTAMP",
1203
+ "notNull": true,
1204
+ "default": "current_timestamp"
1205
+ },
1206
+ "tenant_id": {
1207
+ "type": "TEXT",
1208
+ "notNull": false,
1209
+ "unique": false,
1210
+ "default": ""
1211
+ },
1212
+ "wrapped_key": {
1213
+ "type": "TEXT",
1214
+ "notNull": false,
1215
+ "unique": false,
1216
+ "default": ""
1217
+ },
1218
+ "amk_key_id": {
1219
+ "type": "TEXT",
1220
+ "notNull": false,
1221
+ "unique": false,
1222
+ "default": ""
1223
+ },
1224
+ "status": {
1225
+ "type": "TEXT",
1226
+ "notNull": false,
1227
+ "unique": false,
1228
+ "default": "active"
1229
+ },
1230
+ "version": {
1231
+ "type": "INTEGER",
1232
+ "notNull": false,
1233
+ "unique": false,
1234
+ "default": 1
1235
+ },
1236
+ "rotate_after": {
1237
+ "type": "TIMESTAMP",
1238
+ "notNull": false,
1239
+ "unique": false
1240
+ },
1241
+ "retired_at": {
1242
+ "type": "TIMESTAMP",
1243
+ "notNull": false,
1244
+ "unique": false
1245
+ }
1246
+ },
1247
+ "indexes": [
1248
+ {
1249
+ "name": "tenant_keys_id_idx",
1250
+ "columns": [
1251
+ "id"
1252
+ ]
1253
+ },
1254
+ {
1255
+ "name": "tenant_keys_slug_context_idx",
1256
+ "columns": [
1257
+ "slug",
1258
+ "context"
1259
+ ],
1260
+ "unique": true
1261
+ }
1262
+ ],
1263
+ "version": "79fd7e46"
1264
+ }
1265
+ }
1266
+ },
1267
+ "moduleType": "smrt",
1268
+ "smrtDependencies": [
1269
+ "@happyvertical/smrt-core",
1270
+ "@happyvertical/smrt-tenancy"
1271
+ ]
1272
+ }