@javalabs/prisma-client 1.0.12 → 1.0.14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@javalabs/prisma-client",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Shared Prisma client for Tupay microservices",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -7,6 +7,45 @@ datasource db {
7
7
  url = env("DATABASE_URL")
8
8
  }
9
9
 
10
+ model ClientsApiKeys {
11
+ id String @id @default(uuid())
12
+ key String @unique
13
+ clientId String @unique
14
+ clientSecret String @unique
15
+ isActive Boolean @default(true)
16
+ expiresAt DateTime
17
+ createdAt DateTime @default(now())
18
+ updatedAt DateTime @updatedAt
19
+ lastUsedAt DateTime?
20
+ ipWhitelist String[] @default([])
21
+ rateLimit Int? @default(1000) // requests per day
22
+ usage ClientsApiKeyUsage[]
23
+ metadata Json? // Para almacenar información adicional como nombre del cliente, propósito, etc.
24
+ revokedAt DateTime? // Para revocar API keys
25
+ revokedBy String? // Quién revocó la API key
26
+ revokedReason String? // Razón de la revocación
27
+ allowedEndpoints String[] @default([]) // Endpoints permitidos para esta API key
28
+ maxRequestsPerMinute Int? @default(60) // Rate limiting por minuto
29
+ environment String @default("development") // development, staging, production
30
+ version String @default("1.0.0") // Versión de la API key
31
+ }
32
+
33
+ model ClientsApiKeyUsage {
34
+ id String @id @default(uuid())
35
+ apiKeyId String
36
+ clientId String
37
+ ipAddress String
38
+ endpoint String
39
+ method String
40
+ status Int
41
+ usedAt DateTime @default(now())
42
+ apiKey ClientsApiKeys @relation(fields: [apiKeyId], references: [id])
43
+
44
+ @@index([apiKeyId])
45
+ @@index([clientId])
46
+ @@index([usedAt])
47
+ }
48
+
10
49
  model api_keys {
11
50
  id Int @id @default(autoincrement())
12
51
  name String @db.VarChar(255)