@app-vitals/agent-admin 1.15.0 → 1.17.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/openapi.json +15 -1
- package/openapi.platform.json +15 -1
- package/package.json +2 -2
- package/prisma/client/internal/class.ts +4 -4
- package/prisma/client/internal/prismaNamespace.ts +1 -0
- package/prisma/client/internal/prismaNamespaceBrowser.ts +1 -0
- package/prisma/client/models/Agent.ts +80 -1
- package/prisma/migrations/20261110010000_add_agent_github_username/migration.sql +3 -0
- package/prisma/schema/schema.prisma +4 -0
- package/src/agent-github-username.integration.test.ts +202 -0
- package/src/agents-api.smoke.test.ts +157 -0
- package/src/agents-api.ts +38 -1
- package/src/agents.ts +8 -0
- package/src/fixtures/github-lookup-cassette.json +499 -0
- package/src/github-lookup-client.integration.test.ts +313 -0
- package/src/github-lookup-client.ts +308 -0
- package/src/github-lookup-client.unit.test.ts +93 -0
- package/src/github-username.ts +20 -0
- package/src/github-username.unit.test.ts +34 -0
- package/src/openapi-schemas.ts +10 -0
|
@@ -0,0 +1,499 @@
|
|
|
1
|
+
{
|
|
2
|
+
"org_installation_success": {
|
|
3
|
+
"status": 200,
|
|
4
|
+
"body": {
|
|
5
|
+
"id": 7001,
|
|
6
|
+
"app_id": 555,
|
|
7
|
+
"app_slug": "example-lookup",
|
|
8
|
+
"target_type": "Organization",
|
|
9
|
+
"account": {
|
|
10
|
+
"login": "acme-eng",
|
|
11
|
+
"id": 11,
|
|
12
|
+
"type": "Organization"
|
|
13
|
+
},
|
|
14
|
+
"repository_selection": "all",
|
|
15
|
+
"permissions": {
|
|
16
|
+
"metadata": "read"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"org_installation_403": {
|
|
21
|
+
"status": 403,
|
|
22
|
+
"body": {
|
|
23
|
+
"message": "Resource not accessible by integration",
|
|
24
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"org_installation_404": {
|
|
28
|
+
"status": 404,
|
|
29
|
+
"body": {
|
|
30
|
+
"message": "Not Found",
|
|
31
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"org_installation_422": {
|
|
35
|
+
"status": 422,
|
|
36
|
+
"body": {
|
|
37
|
+
"message": "Validation Failed",
|
|
38
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
"org_installation_429": {
|
|
42
|
+
"status": 429,
|
|
43
|
+
"headers": {
|
|
44
|
+
"retry-after": "30"
|
|
45
|
+
},
|
|
46
|
+
"body": {
|
|
47
|
+
"message": "API rate limit exceeded",
|
|
48
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"org_installation_500": {
|
|
52
|
+
"status": 500,
|
|
53
|
+
"body": {
|
|
54
|
+
"message": "Server Error",
|
|
55
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"org_installation_503": {
|
|
59
|
+
"status": 503,
|
|
60
|
+
"body": {
|
|
61
|
+
"message": "Service Unavailable",
|
|
62
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"lookup_token_success": {
|
|
66
|
+
"status": 201,
|
|
67
|
+
"body": {
|
|
68
|
+
"token": "ghs_lookupInstallationTokenSecret",
|
|
69
|
+
"expires_at": "2026-11-09T13:00:00Z",
|
|
70
|
+
"permissions": {
|
|
71
|
+
"metadata": "read"
|
|
72
|
+
},
|
|
73
|
+
"repository_selection": "all"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"lookup_token_403": {
|
|
77
|
+
"status": 403,
|
|
78
|
+
"body": {
|
|
79
|
+
"message": "Resource not accessible by integration",
|
|
80
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
"lookup_token_404": {
|
|
84
|
+
"status": 404,
|
|
85
|
+
"body": {
|
|
86
|
+
"message": "Not Found",
|
|
87
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
"lookup_token_422": {
|
|
91
|
+
"status": 422,
|
|
92
|
+
"body": {
|
|
93
|
+
"message": "Validation Failed",
|
|
94
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
"lookup_token_429": {
|
|
98
|
+
"status": 429,
|
|
99
|
+
"headers": {
|
|
100
|
+
"retry-after": "30"
|
|
101
|
+
},
|
|
102
|
+
"body": {
|
|
103
|
+
"message": "API rate limit exceeded",
|
|
104
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
"lookup_token_500": {
|
|
108
|
+
"status": 500,
|
|
109
|
+
"body": {
|
|
110
|
+
"message": "Server Error",
|
|
111
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
"lookup_token_503": {
|
|
115
|
+
"status": 503,
|
|
116
|
+
"body": {
|
|
117
|
+
"message": "Service Unavailable",
|
|
118
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
"repos_success": {
|
|
122
|
+
"status": 200,
|
|
123
|
+
"body": {
|
|
124
|
+
"total_count": 2,
|
|
125
|
+
"repositories": [
|
|
126
|
+
{
|
|
127
|
+
"id": 1,
|
|
128
|
+
"name": "api",
|
|
129
|
+
"full_name": "acme-eng/api",
|
|
130
|
+
"private": false,
|
|
131
|
+
"archived": false
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"id": 2,
|
|
135
|
+
"name": "web",
|
|
136
|
+
"full_name": "acme-eng/web",
|
|
137
|
+
"private": true,
|
|
138
|
+
"archived": false
|
|
139
|
+
}
|
|
140
|
+
]
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"repos_page_1": {
|
|
144
|
+
"status": 200,
|
|
145
|
+
"headers": {
|
|
146
|
+
"link": "<https://ghe.test/installation/repositories?per_page=100&page=2>; rel=\"next\""
|
|
147
|
+
},
|
|
148
|
+
"body": {
|
|
149
|
+
"total_count": 3,
|
|
150
|
+
"repositories": [
|
|
151
|
+
{
|
|
152
|
+
"id": 1,
|
|
153
|
+
"name": "api",
|
|
154
|
+
"full_name": "acme-eng/api",
|
|
155
|
+
"private": false,
|
|
156
|
+
"archived": false
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"id": 2,
|
|
160
|
+
"name": "web",
|
|
161
|
+
"full_name": "acme-eng/web",
|
|
162
|
+
"private": true,
|
|
163
|
+
"archived": false
|
|
164
|
+
}
|
|
165
|
+
]
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"repos_page_2": {
|
|
169
|
+
"status": 200,
|
|
170
|
+
"body": {
|
|
171
|
+
"total_count": 3,
|
|
172
|
+
"repositories": [
|
|
173
|
+
{
|
|
174
|
+
"id": 3,
|
|
175
|
+
"name": "infra",
|
|
176
|
+
"full_name": "acme-eng/infra",
|
|
177
|
+
"private": false,
|
|
178
|
+
"archived": false
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
},
|
|
183
|
+
"repos_empty": {
|
|
184
|
+
"status": 200,
|
|
185
|
+
"body": {
|
|
186
|
+
"total_count": 0,
|
|
187
|
+
"repositories": []
|
|
188
|
+
}
|
|
189
|
+
},
|
|
190
|
+
"repos_403": {
|
|
191
|
+
"status": 403,
|
|
192
|
+
"body": {
|
|
193
|
+
"message": "Resource not accessible by integration",
|
|
194
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"repos_404": {
|
|
198
|
+
"status": 404,
|
|
199
|
+
"body": {
|
|
200
|
+
"message": "Not Found",
|
|
201
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
"repos_422": {
|
|
205
|
+
"status": 422,
|
|
206
|
+
"body": {
|
|
207
|
+
"message": "Validation Failed",
|
|
208
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
"repos_429": {
|
|
212
|
+
"status": 429,
|
|
213
|
+
"headers": {
|
|
214
|
+
"retry-after": "30"
|
|
215
|
+
},
|
|
216
|
+
"body": {
|
|
217
|
+
"message": "API rate limit exceeded",
|
|
218
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
219
|
+
}
|
|
220
|
+
},
|
|
221
|
+
"repos_500": {
|
|
222
|
+
"status": 500,
|
|
223
|
+
"body": {
|
|
224
|
+
"message": "Server Error",
|
|
225
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
226
|
+
}
|
|
227
|
+
},
|
|
228
|
+
"repos_503": {
|
|
229
|
+
"status": 503,
|
|
230
|
+
"body": {
|
|
231
|
+
"message": "Service Unavailable",
|
|
232
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"permission_admin": {
|
|
236
|
+
"status": 200,
|
|
237
|
+
"body": {
|
|
238
|
+
"permission": "admin",
|
|
239
|
+
"role_name": "admin",
|
|
240
|
+
"user": {
|
|
241
|
+
"login": "octocat",
|
|
242
|
+
"id": 583231,
|
|
243
|
+
"type": "User"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
"permission_maintain": {
|
|
248
|
+
"status": 200,
|
|
249
|
+
"body": {
|
|
250
|
+
"permission": "write",
|
|
251
|
+
"role_name": "maintain",
|
|
252
|
+
"user": {
|
|
253
|
+
"login": "octocat",
|
|
254
|
+
"id": 583231,
|
|
255
|
+
"type": "User"
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
"permission_write": {
|
|
260
|
+
"status": 200,
|
|
261
|
+
"body": {
|
|
262
|
+
"permission": "write",
|
|
263
|
+
"role_name": "write",
|
|
264
|
+
"user": {
|
|
265
|
+
"login": "octocat",
|
|
266
|
+
"id": 583231,
|
|
267
|
+
"type": "User"
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
},
|
|
271
|
+
"permission_triage": {
|
|
272
|
+
"status": 200,
|
|
273
|
+
"body": {
|
|
274
|
+
"permission": "read",
|
|
275
|
+
"role_name": "triage",
|
|
276
|
+
"user": {
|
|
277
|
+
"login": "octocat",
|
|
278
|
+
"id": 583231,
|
|
279
|
+
"type": "User"
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
"permission_read": {
|
|
284
|
+
"status": 200,
|
|
285
|
+
"body": {
|
|
286
|
+
"permission": "read",
|
|
287
|
+
"role_name": "read",
|
|
288
|
+
"user": {
|
|
289
|
+
"login": "octocat",
|
|
290
|
+
"id": 583231,
|
|
291
|
+
"type": "User"
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
"permission_none": {
|
|
296
|
+
"status": 200,
|
|
297
|
+
"body": {
|
|
298
|
+
"permission": "none",
|
|
299
|
+
"role_name": "none",
|
|
300
|
+
"user": {
|
|
301
|
+
"login": "octocat",
|
|
302
|
+
"id": 583231,
|
|
303
|
+
"type": "User"
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
"permission_legacy_only": {
|
|
308
|
+
"status": 200,
|
|
309
|
+
"body": {
|
|
310
|
+
"permission": "write",
|
|
311
|
+
"user": {
|
|
312
|
+
"login": "octocat",
|
|
313
|
+
"id": 583231,
|
|
314
|
+
"type": "User"
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"permission_unknown_role": {
|
|
319
|
+
"status": 200,
|
|
320
|
+
"body": {
|
|
321
|
+
"permission": "write",
|
|
322
|
+
"role_name": "custom-release-manager",
|
|
323
|
+
"user": {
|
|
324
|
+
"login": "octocat",
|
|
325
|
+
"id": 583231,
|
|
326
|
+
"type": "User"
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
},
|
|
330
|
+
"permission_403": {
|
|
331
|
+
"status": 403,
|
|
332
|
+
"body": {
|
|
333
|
+
"message": "Resource not accessible by integration",
|
|
334
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"permission_404": {
|
|
338
|
+
"status": 404,
|
|
339
|
+
"body": {
|
|
340
|
+
"message": "Not Found",
|
|
341
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
342
|
+
}
|
|
343
|
+
},
|
|
344
|
+
"permission_422": {
|
|
345
|
+
"status": 422,
|
|
346
|
+
"body": {
|
|
347
|
+
"message": "Validation Failed",
|
|
348
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
349
|
+
}
|
|
350
|
+
},
|
|
351
|
+
"permission_429": {
|
|
352
|
+
"status": 429,
|
|
353
|
+
"headers": {
|
|
354
|
+
"retry-after": "30"
|
|
355
|
+
},
|
|
356
|
+
"body": {
|
|
357
|
+
"message": "API rate limit exceeded",
|
|
358
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
"permission_500": {
|
|
362
|
+
"status": 500,
|
|
363
|
+
"body": {
|
|
364
|
+
"message": "Server Error",
|
|
365
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"permission_503": {
|
|
369
|
+
"status": 503,
|
|
370
|
+
"body": {
|
|
371
|
+
"message": "Service Unavailable",
|
|
372
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
"user_success": {
|
|
376
|
+
"status": 200,
|
|
377
|
+
"body": {
|
|
378
|
+
"login": "octocat",
|
|
379
|
+
"id": 583231,
|
|
380
|
+
"type": "User",
|
|
381
|
+
"name": "The Octocat"
|
|
382
|
+
}
|
|
383
|
+
},
|
|
384
|
+
"user_nonexistent": {
|
|
385
|
+
"status": 404,
|
|
386
|
+
"body": {
|
|
387
|
+
"message": "Not Found",
|
|
388
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
389
|
+
}
|
|
390
|
+
},
|
|
391
|
+
"user_403": {
|
|
392
|
+
"status": 403,
|
|
393
|
+
"body": {
|
|
394
|
+
"message": "Resource not accessible by integration",
|
|
395
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
"user_404": {
|
|
399
|
+
"status": 404,
|
|
400
|
+
"body": {
|
|
401
|
+
"message": "Not Found",
|
|
402
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
403
|
+
}
|
|
404
|
+
},
|
|
405
|
+
"user_422": {
|
|
406
|
+
"status": 422,
|
|
407
|
+
"body": {
|
|
408
|
+
"message": "Validation Failed",
|
|
409
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"user_429": {
|
|
413
|
+
"status": 429,
|
|
414
|
+
"headers": {
|
|
415
|
+
"retry-after": "30"
|
|
416
|
+
},
|
|
417
|
+
"body": {
|
|
418
|
+
"message": "API rate limit exceeded",
|
|
419
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
"user_500": {
|
|
423
|
+
"status": 500,
|
|
424
|
+
"body": {
|
|
425
|
+
"message": "Server Error",
|
|
426
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
427
|
+
}
|
|
428
|
+
},
|
|
429
|
+
"user_503": {
|
|
430
|
+
"status": 503,
|
|
431
|
+
"body": {
|
|
432
|
+
"message": "Service Unavailable",
|
|
433
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
"member_yes": {
|
|
437
|
+
"status": 204,
|
|
438
|
+
"body": null
|
|
439
|
+
},
|
|
440
|
+
"member_no": {
|
|
441
|
+
"status": 404,
|
|
442
|
+
"body": {
|
|
443
|
+
"message": "Not Found",
|
|
444
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"member_redirect": {
|
|
448
|
+
"status": 302,
|
|
449
|
+
"headers": {
|
|
450
|
+
"location": "https://api.github.com/orgs/acme-eng/public_members/octocat"
|
|
451
|
+
},
|
|
452
|
+
"body": null
|
|
453
|
+
},
|
|
454
|
+
"member_403": {
|
|
455
|
+
"status": 403,
|
|
456
|
+
"body": {
|
|
457
|
+
"message": "Resource not accessible by integration",
|
|
458
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
459
|
+
}
|
|
460
|
+
},
|
|
461
|
+
"member_404": {
|
|
462
|
+
"status": 404,
|
|
463
|
+
"body": {
|
|
464
|
+
"message": "Not Found",
|
|
465
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
"member_422": {
|
|
469
|
+
"status": 422,
|
|
470
|
+
"body": {
|
|
471
|
+
"message": "Validation Failed",
|
|
472
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
473
|
+
}
|
|
474
|
+
},
|
|
475
|
+
"member_429": {
|
|
476
|
+
"status": 429,
|
|
477
|
+
"headers": {
|
|
478
|
+
"retry-after": "30"
|
|
479
|
+
},
|
|
480
|
+
"body": {
|
|
481
|
+
"message": "API rate limit exceeded",
|
|
482
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
483
|
+
}
|
|
484
|
+
},
|
|
485
|
+
"member_500": {
|
|
486
|
+
"status": 500,
|
|
487
|
+
"body": {
|
|
488
|
+
"message": "Server Error",
|
|
489
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
490
|
+
}
|
|
491
|
+
},
|
|
492
|
+
"member_503": {
|
|
493
|
+
"status": 503,
|
|
494
|
+
"body": {
|
|
495
|
+
"message": "Service Unavailable",
|
|
496
|
+
"documentation_url": "https://docs.github.com/rest"
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
}
|