@epure-sh/cli 0.0.0-stage → 0.1.8

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.
@@ -0,0 +1,470 @@
1
+ [
2
+ {
3
+ "method": "GET",
4
+ "path": "/api/v1/agent/queue"
5
+ },
6
+ {
7
+ "method": "GET",
8
+ "path": "/api/v1/agent/issues/{id}"
9
+ },
10
+ {
11
+ "method": "PATCH",
12
+ "path": "/api/v1/agent/issues/{id}"
13
+ },
14
+ {
15
+ "method": "GET",
16
+ "path": "/api/v1/agent/issues/{id}/context"
17
+ },
18
+ {
19
+ "method": "POST",
20
+ "path": "/api/v1/agent/issues/{id}/snooze"
21
+ },
22
+ {
23
+ "method": "POST",
24
+ "path": "/api/v1/agent/issues/{id}/unsnooze"
25
+ },
26
+ {
27
+ "method": "GET",
28
+ "path": "/api/v1/agent/alerts"
29
+ },
30
+ {
31
+ "method": "GET",
32
+ "path": "/api/v1/agent/whoami"
33
+ },
34
+ {
35
+ "method": "GET",
36
+ "path": "/api/v1/agent-tokens"
37
+ },
38
+ {
39
+ "method": "POST",
40
+ "path": "/api/v1/agent-tokens"
41
+ },
42
+ {
43
+ "method": "POST",
44
+ "path": "/api/v1/agent-tokens/{id}/revoke"
45
+ },
46
+ {
47
+ "method": "GET",
48
+ "path": "/api/v1/alert-rules"
49
+ },
50
+ {
51
+ "method": "POST",
52
+ "path": "/api/v1/alert-rules"
53
+ },
54
+ {
55
+ "method": "PATCH",
56
+ "path": "/api/v1/alert-rules/{id}"
57
+ },
58
+ {
59
+ "method": "DELETE",
60
+ "path": "/api/v1/alert-rules/{id}"
61
+ },
62
+ {
63
+ "method": "GET",
64
+ "path": "/api/v1/alert-channels"
65
+ },
66
+ {
67
+ "method": "POST",
68
+ "path": "/api/v1/alert-channels"
69
+ },
70
+ {
71
+ "method": "DELETE",
72
+ "path": "/api/v1/alert-channels/{id}"
73
+ },
74
+ {
75
+ "method": "PATCH",
76
+ "path": "/api/v1/alert-channels/{id}"
77
+ },
78
+ {
79
+ "method": "POST",
80
+ "path": "/api/v1/alert-channels/{id}/test"
81
+ },
82
+ {
83
+ "method": "POST",
84
+ "path": "/api/v1/alert-channels/{id}/ping"
85
+ },
86
+ {
87
+ "method": "GET",
88
+ "path": "/api/v1/alerts/rules"
89
+ },
90
+ {
91
+ "method": "POST",
92
+ "path": "/api/v1/alerts/rules"
93
+ },
94
+ {
95
+ "method": "PATCH",
96
+ "path": "/api/v1/alerts/rules/{id}"
97
+ },
98
+ {
99
+ "method": "DELETE",
100
+ "path": "/api/v1/alerts/rules/{id}"
101
+ },
102
+ {
103
+ "method": "GET",
104
+ "path": "/api/v1/alerts"
105
+ },
106
+ {
107
+ "method": "POST",
108
+ "path": "/api/v1/alerts/simulate"
109
+ },
110
+ {
111
+ "method": "PATCH",
112
+ "path": "/api/v1/alerts/{id}"
113
+ },
114
+ {
115
+ "method": "POST",
116
+ "path": "/api/v1/alerts/test-email"
117
+ },
118
+ {
119
+ "method": "POST",
120
+ "path": "/api/v1/projects/{project_id}/alerts/simulate"
121
+ },
122
+ {
123
+ "method": "GET",
124
+ "path": "/api/v1/projects/{project_id}/email-alerts"
125
+ },
126
+ {
127
+ "method": "PATCH",
128
+ "path": "/api/v1/projects/{project_id}/email-alerts"
129
+ },
130
+ {
131
+ "method": "POST",
132
+ "path": "/api/v1/projects/{project_id}/alerts/test-email"
133
+ },
134
+ {
135
+ "method": "POST",
136
+ "path": "/api/v1/auth/register"
137
+ },
138
+ {
139
+ "method": "POST",
140
+ "path": "/api/v1/auth/login"
141
+ },
142
+ {
143
+ "method": "GET",
144
+ "path": "/api/v1/auth/config"
145
+ },
146
+ {
147
+ "method": "GET",
148
+ "path": "/api/v1/auth/google"
149
+ },
150
+ {
151
+ "method": "GET",
152
+ "path": "/api/v1/auth/google/callback"
153
+ },
154
+ {
155
+ "method": "GET",
156
+ "path": "/api/v1/auth/github"
157
+ },
158
+ {
159
+ "method": "GET",
160
+ "path": "/api/v1/auth/github/callback"
161
+ },
162
+ {
163
+ "method": "POST",
164
+ "path": "/api/v1/auth/magic-link"
165
+ },
166
+ {
167
+ "method": "GET",
168
+ "path": "/api/v1/auth/magic-link/verify"
169
+ },
170
+ {
171
+ "method": "GET",
172
+ "path": "/api/v1/auth/me"
173
+ },
174
+ {
175
+ "method": "GET",
176
+ "path": "/api/v1/auth/organizations"
177
+ },
178
+ {
179
+ "method": "POST",
180
+ "path": "/api/v1/auth/switch-org"
181
+ },
182
+ {
183
+ "method": "PATCH",
184
+ "path": "/api/v1/auth/profile"
185
+ },
186
+ {
187
+ "method": "PATCH",
188
+ "path": "/api/v1/auth/password"
189
+ },
190
+ {
191
+ "method": "GET",
192
+ "path": "/api/v1/auth/account/export"
193
+ },
194
+ {
195
+ "method": "DELETE",
196
+ "path": "/api/v1/auth/account"
197
+ },
198
+ {
199
+ "method": "POST",
200
+ "path": "/api/v1/auth/accept-invitation"
201
+ },
202
+ {
203
+ "method": "POST",
204
+ "path": "/api/v1/auth/logout"
205
+ },
206
+ {
207
+ "method": "GET",
208
+ "path": "/api/v1/projects/{project_id}/dsn-keys"
209
+ },
210
+ {
211
+ "method": "POST",
212
+ "path": "/api/v1/projects/{project_id}/dsn-keys"
213
+ },
214
+ {
215
+ "method": "POST",
216
+ "path": "/api/v1/dsn-keys/{id}/revoke"
217
+ },
218
+ {
219
+ "method": "POST",
220
+ "path": "/api/v1/projects/{project_id}/dsn-keys/rotate"
221
+ },
222
+ {
223
+ "method": "GET",
224
+ "path": "/api/v1/issues/{issue_id}/events"
225
+ },
226
+ {
227
+ "method": "GET",
228
+ "path": "/api/v1/issues/{issue_id}/releases"
229
+ },
230
+ {
231
+ "method": "GET",
232
+ "path": "/api/v1/issues/{issue_id}/timeline"
233
+ },
234
+ {
235
+ "method": "GET",
236
+ "path": "/api/v1/events/{event_id}/feedback"
237
+ },
238
+ {
239
+ "method": "GET",
240
+ "path": "/api/v1/issues"
241
+ },
242
+ {
243
+ "method": "POST",
244
+ "path": "/api/v1/issues/trends"
245
+ },
246
+ {
247
+ "method": "PATCH",
248
+ "path": "/api/v1/issues/bulk"
249
+ },
250
+ {
251
+ "method": "DELETE",
252
+ "path": "/api/v1/issues/bulk"
253
+ },
254
+ {
255
+ "method": "POST",
256
+ "path": "/api/v1/issues/merge"
257
+ },
258
+ {
259
+ "method": "POST",
260
+ "path": "/api/v1/issues/split"
261
+ },
262
+ {
263
+ "method": "GET",
264
+ "path": "/api/v1/issues/{id}/merged"
265
+ },
266
+ {
267
+ "method": "PATCH",
268
+ "path": "/api/v1/issues/{id}"
269
+ },
270
+ {
271
+ "method": "POST",
272
+ "path": "/api/v1/issues/{id}/snooze"
273
+ },
274
+ {
275
+ "method": "POST",
276
+ "path": "/api/v1/issues/{id}/unsnooze"
277
+ },
278
+ {
279
+ "method": "POST",
280
+ "path": "/api/v1/mcp"
281
+ },
282
+ {
283
+ "method": "GET",
284
+ "path": "/api/v1/mcp"
285
+ },
286
+ {
287
+ "method": "POST",
288
+ "path": "/api/v1/api/mcp"
289
+ },
290
+ {
291
+ "method": "GET",
292
+ "path": "/api/v1/api/mcp"
293
+ },
294
+ {
295
+ "method": "GET",
296
+ "path": "/api/v1/members"
297
+ },
298
+ {
299
+ "method": "PATCH",
300
+ "path": "/api/v1/members/{user_id}"
301
+ },
302
+ {
303
+ "method": "DELETE",
304
+ "path": "/api/v1/members/{user_id}"
305
+ },
306
+ {
307
+ "method": "GET",
308
+ "path": "/api/v1/invitations"
309
+ },
310
+ {
311
+ "method": "POST",
312
+ "path": "/api/v1/invitations"
313
+ },
314
+ {
315
+ "method": "DELETE",
316
+ "path": "/api/v1/invitations/{id}"
317
+ },
318
+ {
319
+ "method": "GET",
320
+ "path": "/api/v1/monitors"
321
+ },
322
+ {
323
+ "method": "POST",
324
+ "path": "/api/v1/monitors"
325
+ },
326
+ {
327
+ "method": "GET",
328
+ "path": "/api/v1/monitors/{id}"
329
+ },
330
+ {
331
+ "method": "PATCH",
332
+ "path": "/api/v1/monitors/{id}"
333
+ },
334
+ {
335
+ "method": "DELETE",
336
+ "path": "/api/v1/monitors/{id}"
337
+ },
338
+ {
339
+ "method": "POST",
340
+ "path": "/api/v1/monitors/{id}/check-ins"
341
+ },
342
+ {
343
+ "method": "GET",
344
+ "path": "/api/v1/oauth/info"
345
+ },
346
+ {
347
+ "method": "POST",
348
+ "path": "/api/v1/oauth/authorize"
349
+ },
350
+ {
351
+ "method": "GET",
352
+ "path": "/api/v1/oauth/device/verify"
353
+ },
354
+ {
355
+ "method": "POST",
356
+ "path": "/api/v1/oauth/device/approve"
357
+ },
358
+ {
359
+ "method": "GET",
360
+ "path": "/api/v1/user/connected-apps"
361
+ },
362
+ {
363
+ "method": "DELETE",
364
+ "path": "/api/v1/user/connected-apps/{id}"
365
+ },
366
+ {
367
+ "method": "GET",
368
+ "path": "/api/v1/privacy"
369
+ },
370
+ {
371
+ "method": "GET",
372
+ "path": "/api/v1/projects/{id}/privacy/export"
373
+ },
374
+ {
375
+ "method": "POST",
376
+ "path": "/api/v1/projects/{id}/privacy/erase"
377
+ },
378
+ {
379
+ "method": "POST",
380
+ "path": "/api/v1/projects/{id}/privacy/strip-identifiers"
381
+ },
382
+ {
383
+ "method": "GET",
384
+ "path": "/api/v1/projects"
385
+ },
386
+ {
387
+ "method": "POST",
388
+ "path": "/api/v1/projects"
389
+ },
390
+ {
391
+ "method": "PATCH",
392
+ "path": "/api/v1/projects/{id}"
393
+ },
394
+ {
395
+ "method": "DELETE",
396
+ "path": "/api/v1/projects/{id}"
397
+ },
398
+ {
399
+ "method": "GET",
400
+ "path": "/api/v1/projects/{id}/activity"
401
+ },
402
+ {
403
+ "method": "GET",
404
+ "path": "/api/v1/projects/{id}/velocity"
405
+ },
406
+ {
407
+ "method": "GET",
408
+ "path": "/api/v1/projects/{id}/noise-policy"
409
+ },
410
+ {
411
+ "method": "PUT",
412
+ "path": "/api/v1/projects/{id}/noise-policy"
413
+ },
414
+ {
415
+ "method": "POST",
416
+ "path": "/api/v1/projects/{id}/noise-policy/preview"
417
+ },
418
+ {
419
+ "method": "GET",
420
+ "path": "/api/v1/projects/{id}/ingest-outcomes"
421
+ },
422
+ {
423
+ "method": "GET",
424
+ "path": "/api/v1/releases"
425
+ },
426
+ {
427
+ "method": "GET",
428
+ "path": "/api/v1/setup"
429
+ },
430
+ {
431
+ "method": "PATCH",
432
+ "path": "/api/v1/setup"
433
+ },
434
+ {
435
+ "method": "GET",
436
+ "path": "/api/v1/setup/dsn"
437
+ },
438
+ {
439
+ "method": "POST",
440
+ "path": "/api/v1/setup/test-event"
441
+ },
442
+ {
443
+ "method": "GET",
444
+ "path": "/api/v1/stats"
445
+ },
446
+ {
447
+ "method": "GET",
448
+ "path": "/api/v1/webhooks"
449
+ },
450
+ {
451
+ "method": "POST",
452
+ "path": "/api/v1/webhooks"
453
+ },
454
+ {
455
+ "method": "PATCH",
456
+ "path": "/api/v1/webhooks/{id}"
457
+ },
458
+ {
459
+ "method": "DELETE",
460
+ "path": "/api/v1/webhooks/{id}"
461
+ },
462
+ {
463
+ "method": "POST",
464
+ "path": "/api/v1/webhooks/{id}/test"
465
+ },
466
+ {
467
+ "method": "POST",
468
+ "path": "/api/v1/webhooks/{id}/rotate-secret"
469
+ }
470
+ ]
package/lib/api.js ADDED
@@ -0,0 +1,17 @@
1
+ // REST transport remains available when the optional hosted MCP endpoint is disabled.
2
+ async function apiRequest(endpoint, token, {method='GET', path, query={}, body, files}={}) {
3
+ if (!token) throw new Error('Authentication required: run epure-mcp login or provide EPURE_TOKEN');
4
+ if (typeof path !== 'string' || !path.startsWith('/api/v1/') || path.includes('\\')) throw new Error('path must start with /api/v1/');
5
+ const base = new URL(endpoint);const url = new URL(path,base);
6
+ if (url.origin !== base.origin) throw new Error('Cross-origin API requests are forbidden');
7
+ method=method.toUpperCase();if (!['GET','POST','PUT','PATCH','DELETE','HEAD'].includes(method)) throw new Error('Unsupported method');
8
+ for (const [key,value] of Object.entries(query)) if(value!=null)url.searchParams.set(key,String(value));
9
+ const headers={Authorization:`Bearer ${token}`};let payload;
10
+ if(files){payload=new FormData();for(const [key,value] of Object.entries(body||{}))payload.append(key,String(value));for(const f of files)payload.append(f.field||'file',new Blob([Buffer.from(f.base64,'base64')],{type:f.contentType||'application/octet-stream'}),f.filename);}
11
+ else if(body!==undefined){headers['Content-Type']='application/json';payload=JSON.stringify(body);}
12
+ const response=await fetch(url,{method,headers,body:payload,redirect:'error',signal:AbortSignal.timeout(30000)});
13
+ const text=await response.text();let data;try{data=JSON.parse(text)}catch{data=text||null}
14
+ if(!response.ok)throw new Error(`HTTP ${response.status}: ${JSON.stringify(data)}`);
15
+ return {status:response.status,data};
16
+ }
17
+ module.exports={apiRequest};