@structured-world/gitlab-mcp-db 8.0.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.
- package/dist/generated/prisma/client.d.ts +13 -0
- package/dist/generated/prisma/client.js +46 -0
- package/dist/generated/prisma/client.js.map +1 -0
- package/dist/generated/prisma/commonInputTypes.d.ts +245 -0
- package/dist/generated/prisma/commonInputTypes.js +3 -0
- package/dist/generated/prisma/commonInputTypes.js.map +1 -0
- package/dist/generated/prisma/enums.d.ts +1 -0
- package/dist/generated/prisma/enums.js +3 -0
- package/dist/generated/prisma/enums.js.map +1 -0
- package/dist/generated/prisma/internal/class.d.ts +49 -0
- package/dist/generated/prisma/internal/class.js +75 -0
- package/dist/generated/prisma/internal/class.js.map +1 -0
- package/dist/generated/prisma/internal/prismaNamespace.d.ts +715 -0
- package/dist/generated/prisma/internal/prismaNamespace.js +141 -0
- package/dist/generated/prisma/internal/prismaNamespace.js.map +1 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.d.ts +512 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.js +3 -0
- package/dist/generated/prisma/models/AuthCodeFlowState.js.map +1 -0
- package/dist/generated/prisma/models/AuthorizationCode.d.ts +640 -0
- package/dist/generated/prisma/models/AuthorizationCode.js +3 -0
- package/dist/generated/prisma/models/AuthorizationCode.js.map +1 -0
- package/dist/generated/prisma/models/DeviceFlowState.d.ts +602 -0
- package/dist/generated/prisma/models/DeviceFlowState.js +3 -0
- package/dist/generated/prisma/models/DeviceFlowState.js.map +1 -0
- package/dist/generated/prisma/models/McpSessionMapping.d.ts +437 -0
- package/dist/generated/prisma/models/McpSessionMapping.js +3 -0
- package/dist/generated/prisma/models/McpSessionMapping.js.map +1 -0
- package/dist/generated/prisma/models/OAuthSession.d.ts +1036 -0
- package/dist/generated/prisma/models/OAuthSession.js +3 -0
- package/dist/generated/prisma/models/OAuthSession.js.map +1 -0
- package/dist/generated/prisma/models.d.ts +6 -0
- package/dist/generated/prisma/models.js +3 -0
- package/dist/generated/prisma/models.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/logger.d.ts +10 -0
- package/dist/logger.js +14 -0
- package/dist/logger.js.map +1 -0
- package/dist/postgresql.d.ts +53 -0
- package/dist/postgresql.js +467 -0
- package/dist/postgresql.js.map +1 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +6 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/logger.d.ts +5 -0
- package/dist/src/logger.js +14 -0
- package/dist/src/logger.js.map +1 -0
- package/dist/src/postgresql.d.ts +40 -0
- package/dist/src/postgresql.js +444 -0
- package/dist/src/postgresql.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +34 -0
- package/prisma/schema.prisma +113 -0
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@structured-world/gitlab-mcp-db",
|
|
3
|
+
"version": "8.0.0",
|
|
4
|
+
"description": "Optional PostgreSQL/Prisma OAuth-storage backend for @structured-world/gitlab-mcp",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"main": "./dist/src/index.js",
|
|
8
|
+
"types": "./dist/src/index.d.ts",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist",
|
|
11
|
+
"prisma"
|
|
12
|
+
],
|
|
13
|
+
"scripts": {
|
|
14
|
+
"prisma:generate": "prisma generate",
|
|
15
|
+
"build": "prisma generate && tsc -p tsconfig.json",
|
|
16
|
+
"test": "jest",
|
|
17
|
+
"postinstall": "node -e \"if (require('fs').existsSync('prisma/schema.prisma')) require('child_process').execSync('prisma generate', { stdio: 'inherit' })\""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@prisma/client": "^7.8.0",
|
|
21
|
+
"prisma": "^7.8.0"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@structured-world/gitlab-mcp": "^8.0.0",
|
|
25
|
+
"@types/jest": "^30.0.0",
|
|
26
|
+
"@types/node": "^25.9.2",
|
|
27
|
+
"jest": "^30.4.2",
|
|
28
|
+
"ts-jest": "^29.4.11",
|
|
29
|
+
"typescript": "^6.0.0"
|
|
30
|
+
},
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
// Prisma schema for gitlab-mcp OAuth session storage
|
|
2
|
+
// Supports PostgreSQL for multi-instance deployments
|
|
3
|
+
|
|
4
|
+
generator client {
|
|
5
|
+
provider = "prisma-client"
|
|
6
|
+
output = "../generated/prisma"
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
datasource db {
|
|
10
|
+
provider = "postgresql"
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
// OAuth session representing an authenticated user
|
|
14
|
+
model OAuthSession {
|
|
15
|
+
id String @id @default(uuid())
|
|
16
|
+
|
|
17
|
+
// MCP tokens (issued by gitlab-mcp to Claude)
|
|
18
|
+
mcpAccessToken String @map("mcp_access_token")
|
|
19
|
+
mcpRefreshToken String @map("mcp_refresh_token")
|
|
20
|
+
mcpTokenExpiry BigInt @map("mcp_token_expiry")
|
|
21
|
+
|
|
22
|
+
// GitLab tokens (obtained from GitLab OAuth)
|
|
23
|
+
gitlabAccessToken String @map("gitlab_access_token")
|
|
24
|
+
gitlabRefreshToken String @map("gitlab_refresh_token")
|
|
25
|
+
gitlabTokenExpiry BigInt @map("gitlab_token_expiry")
|
|
26
|
+
|
|
27
|
+
// User info from GitLab
|
|
28
|
+
gitlabUserId Int @map("gitlab_user_id")
|
|
29
|
+
gitlabUsername String @map("gitlab_username")
|
|
30
|
+
|
|
31
|
+
// Multi-instance support
|
|
32
|
+
gitlabApiUrl String? @map("gitlab_api_url")
|
|
33
|
+
instanceLabel String? @map("instance_label")
|
|
34
|
+
|
|
35
|
+
// Session metadata
|
|
36
|
+
clientId String @map("client_id")
|
|
37
|
+
scopes String[] @default([])
|
|
38
|
+
createdAt BigInt @map("created_at")
|
|
39
|
+
updatedAt BigInt @map("updated_at")
|
|
40
|
+
|
|
41
|
+
// Relations
|
|
42
|
+
authorizationCodes AuthorizationCode[]
|
|
43
|
+
mcpSessionMappings McpSessionMapping[]
|
|
44
|
+
|
|
45
|
+
@@map("oauth_sessions")
|
|
46
|
+
@@index([mcpAccessToken], map: "idx_oauth_sessions_mcp_access_token")
|
|
47
|
+
@@index([mcpRefreshToken], map: "idx_oauth_sessions_mcp_refresh_token")
|
|
48
|
+
@@index([gitlabUserId], map: "idx_oauth_sessions_gitlab_user_id")
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// State for tracking in-progress Device Flow authorization
|
|
52
|
+
model DeviceFlowState {
|
|
53
|
+
state String @id
|
|
54
|
+
deviceCode String @map("device_code")
|
|
55
|
+
userCode String @map("user_code")
|
|
56
|
+
verificationUri String @map("verification_uri")
|
|
57
|
+
verificationUriComplete String? @map("verification_uri_complete")
|
|
58
|
+
expiresAt BigInt @map("expires_at")
|
|
59
|
+
interval Int
|
|
60
|
+
clientId String @map("client_id")
|
|
61
|
+
codeChallenge String @map("code_challenge")
|
|
62
|
+
codeChallengeMethod String @map("code_challenge_method")
|
|
63
|
+
redirectUri String? @map("redirect_uri")
|
|
64
|
+
|
|
65
|
+
@@map("oauth_device_flows")
|
|
66
|
+
@@index([deviceCode], map: "idx_oauth_device_flows_device_code")
|
|
67
|
+
@@index([expiresAt], map: "idx_oauth_device_flows_expires_at")
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// State for tracking in-progress Authorization Code Flow
|
|
71
|
+
model AuthCodeFlowState {
|
|
72
|
+
internalState String @id @map("internal_state")
|
|
73
|
+
clientId String @map("client_id")
|
|
74
|
+
codeChallenge String @map("code_challenge")
|
|
75
|
+
codeChallengeMethod String @map("code_challenge_method")
|
|
76
|
+
clientState String @map("client_state")
|
|
77
|
+
clientRedirectUri String @map("client_redirect_uri")
|
|
78
|
+
callbackUri String @map("callback_uri")
|
|
79
|
+
expiresAt BigInt @map("expires_at")
|
|
80
|
+
|
|
81
|
+
@@map("oauth_auth_code_flows")
|
|
82
|
+
@@index([expiresAt], map: "idx_oauth_auth_code_flows_expires_at")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Authorization code for OAuth code exchange
|
|
86
|
+
model AuthorizationCode {
|
|
87
|
+
code String @id
|
|
88
|
+
sessionId String @map("session_id")
|
|
89
|
+
clientId String @map("client_id")
|
|
90
|
+
codeChallenge String @map("code_challenge")
|
|
91
|
+
codeChallengeMethod String @map("code_challenge_method")
|
|
92
|
+
redirectUri String? @map("redirect_uri")
|
|
93
|
+
expiresAt BigInt @map("expires_at")
|
|
94
|
+
|
|
95
|
+
// Relations
|
|
96
|
+
session OAuthSession @relation(fields: [sessionId], references: [id], onDelete: Cascade)
|
|
97
|
+
|
|
98
|
+
@@map("oauth_authorization_codes")
|
|
99
|
+
@@index([sessionId], map: "idx_oauth_authorization_codes_session_id")
|
|
100
|
+
@@index([expiresAt], map: "idx_oauth_authorization_codes_expires_at")
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// MCP session to OAuth session mapping
|
|
104
|
+
model McpSessionMapping {
|
|
105
|
+
mcpSessionId String @id @map("mcp_session_id")
|
|
106
|
+
oauthSessionId String @map("oauth_session_id")
|
|
107
|
+
|
|
108
|
+
// Relations
|
|
109
|
+
oauthSession OAuthSession @relation(fields: [oauthSessionId], references: [id], onDelete: Cascade)
|
|
110
|
+
|
|
111
|
+
@@map("oauth_mcp_session_mappings")
|
|
112
|
+
@@index([oauthSessionId], map: "idx_oauth_mcp_session_mappings_oauth_session_id")
|
|
113
|
+
}
|