Skip to content

Commit f66d3d6

Browse files
author
Lasim
committed
feat(backend): rename device_name to device_id in API specifications
1 parent a709a37 commit f66d3d6

File tree

6 files changed

+138
-51
lines changed

6 files changed

+138
-51
lines changed

services/backend/api-spec.json

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19885,9 +19885,9 @@
1988519885
"schema": {
1988619886
"type": "object",
1988719887
"properties": {
19888-
"device_name": {
19888+
"device_id": {
1988919889
"type": "string",
19890-
"description": "Optional device name (e.g., \"MacBook Pro\", \"Work PC\")"
19890+
"description": "Optional device ID for device-specific configuration"
1989119891
},
1989219892
"user_args": {
1989319893
"type": "array",
@@ -19966,9 +19966,9 @@
1996619966
"type": "string",
1996719967
"description": "User ID"
1996819968
},
19969-
"device_name": {
19969+
"device_id": {
1997019970
"type": "string",
19971-
"description": "Device name"
19971+
"description": "Device ID"
1997219972
},
1997319973
"user_args": {
1997419974
"type": "array",
@@ -20221,9 +20221,9 @@
2022120221
"type": "string",
2022220222
"description": "User ID"
2022320223
},
20224-
"device_name": {
20224+
"device_id": {
2022520225
"type": "string",
20226-
"description": "Device name"
20226+
"description": "Device ID"
2022720227
},
2022820228
"user_args": {
2022920229
"type": "array",
@@ -20487,9 +20487,9 @@
2048720487
"type": "string",
2048820488
"description": "User ID"
2048920489
},
20490-
"device_name": {
20490+
"device_id": {
2049120491
"type": "string",
20492-
"description": "Device name"
20492+
"description": "Device ID"
2049320493
},
2049420494
"user_args": {
2049520495
"type": "array",
@@ -20684,9 +20684,9 @@
2068420684
"schema": {
2068520685
"type": "object",
2068620686
"properties": {
20687-
"device_name": {
20687+
"device_id": {
2068820688
"type": "string",
20689-
"description": "Optional device name (e.g., \"MacBook Pro\", \"Work PC\")"
20689+
"description": "Optional device ID for device-specific configuration"
2069020690
},
2069120691
"user_args": {
2069220692
"type": "array",
@@ -20775,9 +20775,9 @@
2077520775
"type": "string",
2077620776
"description": "User ID"
2077720777
},
20778-
"device_name": {
20778+
"device_id": {
2077920779
"type": "string",
20780-
"description": "Device name"
20780+
"description": "Device ID"
2078120781
},
2078220782
"user_args": {
2078320783
"type": "array",
@@ -21257,9 +21257,9 @@
2125721257
"type": "string",
2125821258
"description": "User ID"
2125921259
},
21260-
"device_name": {
21260+
"device_id": {
2126121261
"type": "string",
21262-
"description": "Device name"
21262+
"description": "Device ID"
2126321263
},
2126421264
"user_args": {
2126521265
"type": "array",
@@ -21540,9 +21540,9 @@
2154021540
"type": "string",
2154121541
"description": "User ID"
2154221542
},
21543-
"device_name": {
21543+
"device_id": {
2154421544
"type": "string",
21545-
"description": "Device name"
21545+
"description": "Device ID"
2154621546
},
2154721547
"user_args": {
2154821548
"type": "array",

services/backend/api-spec.yaml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13710,9 +13710,9 @@ paths:
1371013710
schema:
1371113711
type: object
1371213712
properties:
13713-
device_name:
13713+
device_id:
1371413714
type: string
13715-
description: Optional device name (e.g., "MacBook Pro", "Work PC")
13715+
description: Optional device ID for device-specific configuration
1371613716
user_args:
1371713717
type: array
1371813718
items:
@@ -13765,9 +13765,9 @@ paths:
1376513765
user_id:
1376613766
type: string
1376713767
description: User ID
13768-
device_name:
13768+
device_id:
1376913769
type: string
13770-
description: Device name
13770+
description: Device ID
1377113771
user_args:
1377213772
type: array
1377313773
items:
@@ -13947,9 +13947,9 @@ paths:
1394713947
user_id:
1394813948
type: string
1394913949
description: User ID
13950-
device_name:
13950+
device_id:
1395113951
type: string
13952-
description: Device name
13952+
description: Device ID
1395313953
user_args:
1395413954
type: array
1395513955
items:
@@ -14135,9 +14135,9 @@ paths:
1413514135
user_id:
1413614136
type: string
1413714137
description: User ID
14138-
device_name:
14138+
device_id:
1413914139
type: string
14140-
description: Device name
14140+
description: Device ID
1414114141
user_args:
1414214142
type: array
1414314143
items:
@@ -14272,9 +14272,9 @@ paths:
1427214272
schema:
1427314273
type: object
1427414274
properties:
14275-
device_name:
14275+
device_id:
1427614276
type: string
14277-
description: Optional device name (e.g., "MacBook Pro", "Work PC")
14277+
description: Optional device ID for device-specific configuration
1427814278
user_args:
1427914279
type: array
1428014280
items:
@@ -14334,9 +14334,9 @@ paths:
1433414334
user_id:
1433514335
type: string
1433614336
description: User ID
14337-
device_name:
14337+
device_id:
1433814338
type: string
14339-
description: Device name
14339+
description: Device ID
1434014340
user_args:
1434114341
type: array
1434214342
items:
@@ -14663,9 +14663,9 @@ paths:
1466314663
user_id:
1466414664
type: string
1466514665
description: User ID
14666-
device_name:
14666+
device_id:
1466714667
type: string
14668-
description: Device name
14668+
description: Device ID
1466914669
user_args:
1467014670
type: array
1467114671
items:
@@ -14858,9 +14858,9 @@ paths:
1485814858
user_id:
1485914859
type: string
1486014860
description: User ID
14861-
device_name:
14861+
device_id:
1486214862
type: string
14863-
description: Device name
14863+
description: Device ID
1486414864
user_args:
1486514865
type: array
1486614866
items:

services/backend/src/routes/mcp/user-configurations/create.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default async function createUserConfigRoute(server: FastifyInstance) {
6666
installationId,
6767
userId,
6868
authType,
69-
deviceName: configData.device_name,
69+
deviceId: configData.device_id,
7070
hasArgs: !!configData.user_args,
7171
hasEnv: !!configData.user_env
7272
}, 'Creating MCP user configuration');

services/backend/src/routes/mcp/user-configurations/list.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,17 @@ export default async function listUserConfigsRoute(server: FastifyInstance) {
8383

8484
const successResponse: UserConfigListResponse = {
8585
success: true,
86-
data: userConfigs.map(formatUserConfigResponse),
86+
data: userConfigs.map(config => ({
87+
id: config.id,
88+
installation_id: config.installation_id,
89+
user_id: config.user_id,
90+
device_id: config.device_id,
91+
user_args: config.user_args,
92+
user_env: config.user_env,
93+
created_at: config.created_at.toISOString(),
94+
updated_at: config.updated_at.toISOString(),
95+
last_used_at: config.last_used_at ? config.last_used_at.toISOString() : undefined
96+
})),
8797
message: `Retrieved ${userConfigs.length} user configuration(s)`
8898
};
8999
const jsonString = JSON.stringify(successResponse);

services/backend/src/routes/mcp/user-configurations/schemas.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ export const TEAM_AND_INSTALLATION_PARAMS_SCHEMA = {
4444
export const CREATE_USER_CONFIG_REQUEST_SCHEMA = {
4545
type: 'object',
4646
properties: {
47-
device_name: {
47+
device_id: {
4848
type: 'string',
49-
description: 'Optional device name (e.g., "MacBook Pro", "Work PC")'
49+
description: 'Optional device ID for device-specific configuration'
5050
},
5151
user_args: {
5252
type: 'array',
@@ -65,9 +65,9 @@ export const CREATE_USER_CONFIG_REQUEST_SCHEMA = {
6565
export const UPDATE_USER_CONFIG_REQUEST_SCHEMA = {
6666
type: 'object',
6767
properties: {
68-
device_name: {
68+
device_id: {
6969
type: 'string',
70-
description: 'Optional device name (e.g., "MacBook Pro", "Work PC")'
70+
description: 'Optional device ID for device-specific configuration'
7171
},
7272
user_args: {
7373
type: 'array',
@@ -116,7 +116,7 @@ export const USER_CONFIG_RESPONSE_SCHEMA = {
116116
id: { type: 'string', description: 'User configuration ID' },
117117
installation_id: { type: 'string', description: 'Installation ID' },
118118
user_id: { type: 'string', description: 'User ID' },
119-
device_name: { type: 'string', description: 'Device name' },
119+
device_id: { type: 'string', description: 'Device ID' },
120120
user_args: {
121121
type: 'array',
122122
items: { type: 'string' },
@@ -224,13 +224,13 @@ export interface TeamAndInstallationParams {
224224
}
225225

226226
export interface CreateUserConfigRequest {
227-
device_name?: string;
227+
device_id?: string;
228228
user_args?: string[];
229229
user_env?: Record<string, string>;
230230
}
231231

232232
export interface UpdateUserConfigRequest {
233-
device_name?: string;
233+
device_id?: string;
234234
user_args?: string[];
235235
user_env?: Record<string, string>;
236236
}
@@ -247,7 +247,7 @@ export interface UserConfigData {
247247
id: string;
248248
installation_id: string;
249249
user_id: string;
250-
device_name?: string;
250+
device_id?: string;
251251
user_args?: string[];
252252
user_env?: Record<string, string>;
253253
created_at: string;
@@ -394,7 +394,7 @@ export function formatUserConfigResponse(config: any): UserConfigData {
394394
id: config.id,
395395
installation_id: config.installation_id,
396396
user_id: config.user_id,
397-
device_name: config.device_name || undefined,
397+
device_id: config.device_id || undefined,
398398
user_args: config.user_args ? JSON.parse(config.user_args) : undefined,
399399
user_env: config.user_env ? JSON.parse(config.user_env) : undefined,
400400
created_at: config.created_at.toISOString(),

0 commit comments

Comments
 (0)