@javalabs/prisma-client 1.0.13 → 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 +1 -1
- package/prisma/schema.prisma +27 -7
package/package.json
CHANGED
package/prisma/schema.prisma
CHANGED
|
@@ -8,13 +8,26 @@ datasource db {
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
model ClientsApiKeys {
|
|
11
|
-
id
|
|
12
|
-
key
|
|
13
|
-
clientId
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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
|
|
18
31
|
}
|
|
19
32
|
|
|
20
33
|
model ClientsApiKeyUsage {
|
|
@@ -22,8 +35,15 @@ model ClientsApiKeyUsage {
|
|
|
22
35
|
apiKeyId String
|
|
23
36
|
clientId String
|
|
24
37
|
ipAddress String
|
|
38
|
+
endpoint String
|
|
39
|
+
method String
|
|
40
|
+
status Int
|
|
25
41
|
usedAt DateTime @default(now())
|
|
26
42
|
apiKey ClientsApiKeys @relation(fields: [apiKeyId], references: [id])
|
|
43
|
+
|
|
44
|
+
@@index([apiKeyId])
|
|
45
|
+
@@index([clientId])
|
|
46
|
+
@@index([usedAt])
|
|
27
47
|
}
|
|
28
48
|
|
|
29
49
|
model api_keys {
|