devanvil 0.0.0-stage → 2.1.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/LICENSE +21 -0
- package/README.ar.md +113 -0
- package/README.md +272 -2
- package/SECURITY.md +49 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +659 -0
- package/dist/core/contract-drift.d.ts +49 -0
- package/dist/core/contract-drift.js +302 -0
- package/dist/core/converters.d.ts +18 -0
- package/dist/core/converters.js +981 -0
- package/dist/core/cron.d.ts +33 -0
- package/dist/core/cron.js +306 -0
- package/dist/core/crypto.d.ts +59 -0
- package/dist/core/crypto.js +250 -0
- package/dist/core/curl.d.ts +17 -0
- package/dist/core/curl.js +170 -0
- package/dist/core/diff.d.ts +36 -0
- package/dist/core/diff.js +148 -0
- package/dist/core/encoding.d.ts +3 -0
- package/dist/core/encoding.js +143 -0
- package/dist/core/importers.d.ts +65 -0
- package/dist/core/importers.js +361 -0
- package/dist/core/jwt.d.ts +39 -0
- package/dist/core/jwt.js +256 -0
- package/dist/core/llm-tokens.d.ts +38 -0
- package/dist/core/llm-tokens.js +125 -0
- package/dist/core/log-analyzer.d.ts +30 -0
- package/dist/core/log-analyzer.js +155 -0
- package/dist/core/network.d.ts +72 -0
- package/dist/core/network.js +185 -0
- package/dist/core/oauth-protobuf.d.ts +74 -0
- package/dist/core/oauth-protobuf.js +390 -0
- package/dist/core/openapi.d.ts +27 -0
- package/dist/core/openapi.js +257 -0
- package/dist/core/pipeline.d.ts +28 -0
- package/dist/core/pipeline.js +154 -0
- package/dist/core/regex.d.ts +50 -0
- package/dist/core/regex.js +351 -0
- package/dist/core/runner.d.ts +53 -0
- package/dist/core/runner.js +250 -0
- package/dist/core/secrets.d.ts +87 -0
- package/dist/core/secrets.js +599 -0
- package/dist/core/security.d.ts +34 -0
- package/dist/core/security.js +284 -0
- package/dist/core/sql-explain.d.ts +50 -0
- package/dist/core/sql-explain.js +259 -0
- package/dist/core/tls.d.ts +44 -0
- package/dist/core/tls.js +166 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +31 -0
- package/dist/server/app.d.ts +31 -0
- package/dist/server/app.js +348 -0
- package/dist/server/http-proxy.d.ts +55 -0
- package/dist/server/http-proxy.js +364 -0
- package/dist/server/http-utils.d.ts +28 -0
- package/dist/server/http-utils.js +106 -0
- package/dist/server/load-tester.d.ts +53 -0
- package/dist/server/load-tester.js +134 -0
- package/dist/server/mcp.d.ts +35 -0
- package/dist/server/mcp.js +466 -0
- package/dist/server/mock-store.d.ts +38 -0
- package/dist/server/mock-store.js +197 -0
- package/dist/server/plugin-loader.d.ts +60 -0
- package/dist/server/plugin-loader.js +285 -0
- package/dist/server/recorder-store.d.ts +35 -0
- package/dist/server/recorder-store.js +146 -0
- package/dist/server/routes/network-routes.d.ts +3 -0
- package/dist/server/routes/network-routes.js +391 -0
- package/dist/server/routes/tools-routes.d.ts +3 -0
- package/dist/server/routes/tools-routes.js +292 -0
- package/dist/server/routes/workspace-routes.d.ts +3 -0
- package/dist/server/routes/workspace-routes.js +240 -0
- package/dist/server/webhook-store.d.ts +29 -0
- package/dist/server/webhook-store.js +90 -0
- package/dist/server/workspace-store.d.ts +91 -0
- package/dist/server/workspace-store.js +447 -0
- package/dist/server/ws-probe.d.ts +34 -0
- package/dist/server/ws-probe.js +283 -0
- package/dist/ui/app.js +274 -0
- package/dist/ui/favicon.svg +14 -0
- package/dist/ui/index.html +83 -0
- package/dist/ui/logo.png +0 -0
- package/dist/ui/styles.css +694 -0
- package/dist/ui/tools-data.js +704 -0
- package/dist/ui/tools-network.js +727 -0
- package/dist/ui/tools-ops.js +295 -0
- package/dist/ui/tools-pro.js +500 -0
- package/dist/ui/tools-security.js +389 -0
- package/dist/ui/tools-v12.js +745 -0
- package/dist/ui/tools-v13.js +321 -0
- package/dist/ui/tools-v20.js +563 -0
- package/dist/ui/tools-v21.js +395 -0
- package/package.json +75 -4
|
@@ -0,0 +1,395 @@
|
|
|
1
|
+
(function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
const { h, api, toast, copyText, registerTool } = window.DevAnvil;
|
|
4
|
+
|
|
5
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
6
|
+
// 18. Contract Drift, Traffic Recorder, OAuth2 PKCE & Protobuf Wire Inspector
|
|
7
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
8
|
+
registerTool({
|
|
9
|
+
id: 'contract-auth-proto',
|
|
10
|
+
group: 'Performance & DB',
|
|
11
|
+
name: 'Contract, Auth & Protobuf',
|
|
12
|
+
icon: '🛰️',
|
|
13
|
+
subtitle: 'OpenAPI Contract Drift Detector + Traffic Recorder -> OpenAPI/Mocks + OAuth 2.0/OIDC PKCE + Protobuf Wire Decoder',
|
|
14
|
+
keywords: ['contract', 'drift', 'openapi', 'recorder', 'oauth', 'oidc', 'pkce', 'protobuf', 'proto', 'grpc', 'wire'],
|
|
15
|
+
render(root) {
|
|
16
|
+
let activeTab = 'contract';
|
|
17
|
+
const tabBar = h('div', { class: 'tabs' });
|
|
18
|
+
const paneContract = h('div', { class: 'stack' });
|
|
19
|
+
const paneOAuth = h('div', { class: 'stack' });
|
|
20
|
+
const paneProto = h('div', { class: 'stack' });
|
|
21
|
+
|
|
22
|
+
// ─── Tab 1: OpenAPI Contract Drift Detector & Live Traffic Recorder ───
|
|
23
|
+
const sampleSpec = [
|
|
24
|
+
'openapi: 3.0.3',
|
|
25
|
+
'info:',
|
|
26
|
+
' title: Orders API',
|
|
27
|
+
' version: 1.0.0',
|
|
28
|
+
'paths:',
|
|
29
|
+
' /orders/{id}:',
|
|
30
|
+
' get:',
|
|
31
|
+
' responses:',
|
|
32
|
+
' "200":',
|
|
33
|
+
' content:',
|
|
34
|
+
' application/json:',
|
|
35
|
+
' schema:',
|
|
36
|
+
' type: object',
|
|
37
|
+
' required: [id, status, amount]',
|
|
38
|
+
' properties:',
|
|
39
|
+
' id: { type: integer }',
|
|
40
|
+
' status: { type: string, enum: [pending, paid, shipped] }',
|
|
41
|
+
' amount: { type: number }',
|
|
42
|
+
' customerEmail: { type: string, format: email }',
|
|
43
|
+
].join('\n');
|
|
44
|
+
|
|
45
|
+
const sampleResp = JSON.stringify(
|
|
46
|
+
{
|
|
47
|
+
id: 'ord-42',
|
|
48
|
+
status: 'cancelled',
|
|
49
|
+
customerEmail: 'not-an-email',
|
|
50
|
+
extraInternalFlag: true,
|
|
51
|
+
},
|
|
52
|
+
null,
|
|
53
|
+
2,
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
const driftMethod = h(
|
|
57
|
+
'select',
|
|
58
|
+
{ style: { width: '95px', flexShrink: '0' } },
|
|
59
|
+
['GET', 'POST', 'PUT', 'PATCH', 'DELETE'].map((m) => h('option', { value: m }, m)),
|
|
60
|
+
);
|
|
61
|
+
const driftPath = h('input', { type: 'text', value: '/orders/42', placeholder: '/orders/42' });
|
|
62
|
+
const driftStatus = h('input', { type: 'number', value: '200', style: { width: '80px' } });
|
|
63
|
+
const driftSpecIn = h('textarea', { rows: 10, value: sampleSpec });
|
|
64
|
+
const driftBodyIn = h('textarea', { rows: 10, value: sampleResp });
|
|
65
|
+
const driftBadges = h('div', { class: 'row' });
|
|
66
|
+
const driftIssuesBox = h('div', { class: 'stack' });
|
|
67
|
+
|
|
68
|
+
async function runContractCheck() {
|
|
69
|
+
try {
|
|
70
|
+
const rep = await api('/api/contract/check', {
|
|
71
|
+
body: {
|
|
72
|
+
spec: driftSpecIn.value,
|
|
73
|
+
method: driftMethod.value,
|
|
74
|
+
path: driftPath.value.trim(),
|
|
75
|
+
status: Number(driftStatus.value) || 200,
|
|
76
|
+
body: driftBodyIn.value,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
driftBadges.textContent = '';
|
|
80
|
+
driftBadges.appendChild(h('span', { class: rep.compatible ? 'badge badge-ok' : 'badge badge-err' }, rep.compatible ? 'COMPATIBLE' : 'BREAKING DRIFT'));
|
|
81
|
+
driftBadges.appendChild(h('span', { class: 'badge badge-info' }, `Score ${rep.score}/100`));
|
|
82
|
+
driftBadges.appendChild(h('span', { class: rep.summary.breaking ? 'badge badge-err' : 'badge badge-ok' }, `${rep.summary.breaking} breaking`));
|
|
83
|
+
driftBadges.appendChild(h('span', { class: rep.summary.warning ? 'badge badge-warn' : 'badge badge-subtle' }, `${rep.summary.warning} warnings`));
|
|
84
|
+
|
|
85
|
+
driftIssuesBox.textContent = '';
|
|
86
|
+
if (!rep.issues.length) {
|
|
87
|
+
driftIssuesBox.appendChild(h('div', { class: 'finding pass' }, `Response matches "${rep.matchedTemplate}" with zero contract drift!`));
|
|
88
|
+
} else {
|
|
89
|
+
for (const iss of rep.issues) {
|
|
90
|
+
const cls = iss.severity === 'breaking' ? 'fail' : 'warn';
|
|
91
|
+
driftIssuesBox.appendChild(
|
|
92
|
+
h(
|
|
93
|
+
'div',
|
|
94
|
+
{ class: `finding ${cls}` },
|
|
95
|
+
h('span', { class: iss.severity === 'breaking' ? 'badge badge-err' : 'badge badge-warn' }, iss.code),
|
|
96
|
+
` ${iss.message}`,
|
|
97
|
+
),
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
} catch (err) {
|
|
102
|
+
toast(err.message, 'err');
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// Traffic Recorder Panel
|
|
107
|
+
const recBadge = h('span', { class: 'badge badge-subtle' }, '0 captured');
|
|
108
|
+
const recOut = h('pre', { class: 'code-box' }, 'Send requests via API Studio — DevAnvil automatically records them (with Authorization/Cookie redacted) so you can infer OpenAPI 3.0, mount Live Mocks, or save a Collection in 1 click.');
|
|
109
|
+
|
|
110
|
+
async function refreshRecorder() {
|
|
111
|
+
try {
|
|
112
|
+
const data = await api('/api/recorder');
|
|
113
|
+
recBadge.textContent = `${data.entries.length} captured (${data.enabled ? 'ON' : 'PAUSED'})`;
|
|
114
|
+
if (data.entries.length) {
|
|
115
|
+
recOut.textContent = JSON.stringify(
|
|
116
|
+
data.entries.slice(0, 10).map((e) => ({
|
|
117
|
+
method: e.method,
|
|
118
|
+
pathname: e.pathname,
|
|
119
|
+
status: e.status,
|
|
120
|
+
durationMs: e.durationMs,
|
|
121
|
+
recordedAt: e.recordedAt,
|
|
122
|
+
})),
|
|
123
|
+
null,
|
|
124
|
+
2,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
} catch (err) {
|
|
128
|
+
toast(err.message, 'err');
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
paneContract.appendChild(
|
|
133
|
+
h(
|
|
134
|
+
'div',
|
|
135
|
+
{ class: 'card' },
|
|
136
|
+
h(
|
|
137
|
+
'div',
|
|
138
|
+
{ class: 'row-between' },
|
|
139
|
+
h('h2', { class: 'card-title' }, 'OpenAPI Contract Drift Detector'),
|
|
140
|
+
h('div', { class: 'row' }, driftMethod, driftPath, driftStatus, h('button', { type: 'button', class: 'btn btn-primary btn-sm', onClick: runContractCheck }, 'Check Drift')),
|
|
141
|
+
),
|
|
142
|
+
h('div', { class: 'grid-2' }, driftSpecIn, driftBodyIn),
|
|
143
|
+
driftBadges,
|
|
144
|
+
driftIssuesBox,
|
|
145
|
+
),
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
paneContract.appendChild(
|
|
149
|
+
h(
|
|
150
|
+
'div',
|
|
151
|
+
{ class: 'card' },
|
|
152
|
+
h(
|
|
153
|
+
'div',
|
|
154
|
+
{ class: 'row-between' },
|
|
155
|
+
h('div', { class: 'row' }, h('h2', { class: 'card-title' }, 'Live Traffic Recorder -> OpenAPI / Mocks / Collection'), recBadge),
|
|
156
|
+
h(
|
|
157
|
+
'div',
|
|
158
|
+
{ class: 'row' },
|
|
159
|
+
h('button', { type: 'button', class: 'btn btn-xs btn-ghost', onClick: refreshRecorder }, 'Refresh'),
|
|
160
|
+
h(
|
|
161
|
+
'button',
|
|
162
|
+
{
|
|
163
|
+
type: 'button',
|
|
164
|
+
class: 'btn btn-xs btn-primary',
|
|
165
|
+
onClick: async () => {
|
|
166
|
+
const res = await api('/api/recorder/export', { body: { mode: 'openapi' } });
|
|
167
|
+
recOut.textContent = JSON.stringify(res.spec, null, 2);
|
|
168
|
+
await copyText(recOut.textContent, 'Inferred OpenAPI 3.0.3 copied to clipboard!');
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
'Infer OpenAPI 3.0',
|
|
172
|
+
),
|
|
173
|
+
h(
|
|
174
|
+
'button',
|
|
175
|
+
{
|
|
176
|
+
type: 'button',
|
|
177
|
+
class: 'btn btn-xs',
|
|
178
|
+
onClick: async () => {
|
|
179
|
+
const res = await api('/api/recorder/export', { body: { mode: 'mocks' } });
|
|
180
|
+
toast(`Mounted ${res.mountedCount} recorded route(s) at /mock/*`, 'ok');
|
|
181
|
+
},
|
|
182
|
+
},
|
|
183
|
+
'Mount as Mocks',
|
|
184
|
+
),
|
|
185
|
+
h(
|
|
186
|
+
'button',
|
|
187
|
+
{
|
|
188
|
+
type: 'button',
|
|
189
|
+
class: 'btn btn-xs',
|
|
190
|
+
onClick: async () => {
|
|
191
|
+
const res = await api('/api/recorder/export', { body: { mode: 'collection' } });
|
|
192
|
+
toast(`Saved ${res.requestCount} recorded request(s) to Workspace Collection`, 'ok');
|
|
193
|
+
},
|
|
194
|
+
},
|
|
195
|
+
'Save Collection',
|
|
196
|
+
),
|
|
197
|
+
h(
|
|
198
|
+
'button',
|
|
199
|
+
{
|
|
200
|
+
type: 'button',
|
|
201
|
+
class: 'btn btn-xs btn-ghost',
|
|
202
|
+
onClick: async () => {
|
|
203
|
+
await api('/api/recorder', { method: 'DELETE' });
|
|
204
|
+
recOut.textContent = 'Recorder cleared.';
|
|
205
|
+
await refreshRecorder();
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
'Clear',
|
|
209
|
+
),
|
|
210
|
+
),
|
|
211
|
+
),
|
|
212
|
+
recOut,
|
|
213
|
+
),
|
|
214
|
+
);
|
|
215
|
+
|
|
216
|
+
// ─── Tab 2: OAuth 2.0 / OIDC PKCE Studio & Callback Debugger ──────────
|
|
217
|
+
const authEpIn = h('input', { type: 'text', value: 'https://auth.example.com/oauth2/authorize', placeholder: 'Authorization Endpoint URL' });
|
|
218
|
+
const clientIdIn = h('input', { type: 'text', value: 'devanvil-cli', placeholder: 'client_id' });
|
|
219
|
+
const redirectIn = h('input', { type: 'text', value: 'http://localhost:4321/callback', placeholder: 'redirect_uri' });
|
|
220
|
+
const scopeIn = h('input', { type: 'text', value: 'openid profile email', placeholder: 'scope' });
|
|
221
|
+
const pkceOut = h('pre', { class: 'code-box' }, '');
|
|
222
|
+
let lastPkce = null;
|
|
223
|
+
|
|
224
|
+
async function generatePkce() {
|
|
225
|
+
try {
|
|
226
|
+
const b = await api('/api/oauth/pkce', {
|
|
227
|
+
body: {
|
|
228
|
+
authorizationEndpoint: authEpIn.value.trim(),
|
|
229
|
+
clientId: clientIdIn.value.trim(),
|
|
230
|
+
redirectUri: redirectIn.value.trim(),
|
|
231
|
+
scope: scopeIn.value.trim(),
|
|
232
|
+
},
|
|
233
|
+
});
|
|
234
|
+
lastPkce = b;
|
|
235
|
+
pkceOut.textContent = JSON.stringify(b, null, 2);
|
|
236
|
+
} catch (err) {
|
|
237
|
+
toast(err.message, 'err');
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
const callbackIn = h('textarea', {
|
|
242
|
+
rows: 3,
|
|
243
|
+
placeholder: 'Paste OAuth redirect callback URL (e.g. http://localhost:4321/callback?code=abc&state=...&id_token=eyJ...)',
|
|
244
|
+
});
|
|
245
|
+
const callbackFindings = h('div', { class: 'stack' });
|
|
246
|
+
const callbackJson = h('pre', { class: 'code-box' }, 'Paste a callback URL and click "Analyze Callback" to verify state, PKCE S256 verifier/challenge, nonce, and decode JWT id_token.');
|
|
247
|
+
|
|
248
|
+
paneOAuth.appendChild(
|
|
249
|
+
h(
|
|
250
|
+
'div',
|
|
251
|
+
{ class: 'grid-2' },
|
|
252
|
+
h(
|
|
253
|
+
'div',
|
|
254
|
+
{ class: 'card' },
|
|
255
|
+
h(
|
|
256
|
+
'div',
|
|
257
|
+
{ class: 'row-between' },
|
|
258
|
+
h('h2', { class: 'card-title' }, 'RFC 7636 PKCE (S256) Generator'),
|
|
259
|
+
h('button', { type: 'button', class: 'btn btn-primary btn-sm', onClick: generatePkce }, 'Regenerate PKCE'),
|
|
260
|
+
),
|
|
261
|
+
authEpIn,
|
|
262
|
+
h('div', { class: 'grid-2' }, clientIdIn, redirectIn),
|
|
263
|
+
scopeIn,
|
|
264
|
+
pkceOut,
|
|
265
|
+
),
|
|
266
|
+
h(
|
|
267
|
+
'div',
|
|
268
|
+
{ class: 'card' },
|
|
269
|
+
h(
|
|
270
|
+
'div',
|
|
271
|
+
{ class: 'row-between' },
|
|
272
|
+
h('h2', { class: 'card-title' }, 'OAuth / OIDC Callback & Token Debugger'),
|
|
273
|
+
h(
|
|
274
|
+
'button',
|
|
275
|
+
{
|
|
276
|
+
type: 'button',
|
|
277
|
+
class: 'btn btn-primary btn-sm',
|
|
278
|
+
onClick: async () => {
|
|
279
|
+
try {
|
|
280
|
+
const rep = await api('/api/oauth/analyze-callback', {
|
|
281
|
+
body: {
|
|
282
|
+
callbackUrl: callbackIn.value,
|
|
283
|
+
expectedState: lastPkce ? lastPkce.state : undefined,
|
|
284
|
+
expectedNonce: lastPkce ? lastPkce.nonce : undefined,
|
|
285
|
+
codeVerifier: lastPkce ? lastPkce.codeVerifier : undefined,
|
|
286
|
+
codeChallenge: lastPkce ? lastPkce.codeChallenge : undefined,
|
|
287
|
+
},
|
|
288
|
+
});
|
|
289
|
+
callbackFindings.textContent = '';
|
|
290
|
+
for (const f of rep.securityFindings || []) {
|
|
291
|
+
callbackFindings.appendChild(h('div', { class: `finding ${f.severity}` }, f.message));
|
|
292
|
+
}
|
|
293
|
+
callbackJson.textContent = JSON.stringify(rep, null, 2);
|
|
294
|
+
} catch (err) {
|
|
295
|
+
toast(err.message, 'err');
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
'Analyze Callback',
|
|
300
|
+
),
|
|
301
|
+
),
|
|
302
|
+
callbackIn,
|
|
303
|
+
callbackFindings,
|
|
304
|
+
callbackJson,
|
|
305
|
+
),
|
|
306
|
+
),
|
|
307
|
+
);
|
|
308
|
+
|
|
309
|
+
// ─── Tab 3: Zero-Dependency Protobuf Binary Wire Decoder ──────────────
|
|
310
|
+
// Sample message: { id: 150 (varint), name: "DevAnvil", active: true } -> 08 96 01 12 08 446576416e76696c 18 01
|
|
311
|
+
const sampleProtoHex = '0896011208446576416e76696c1801';
|
|
312
|
+
const sampleProtoSchema = [
|
|
313
|
+
'syntax = "proto3";',
|
|
314
|
+
'message ServiceStatus {',
|
|
315
|
+
' int32 id = 1;',
|
|
316
|
+
' string name = 2;',
|
|
317
|
+
' bool active = 3;',
|
|
318
|
+
'}',
|
|
319
|
+
].join('\n');
|
|
320
|
+
|
|
321
|
+
const protoPayloadIn = h('textarea', { rows: 4, value: sampleProtoHex, placeholder: 'Paste Protobuf binary payload as Hex or Base64…' });
|
|
322
|
+
const protoSchemaIn = h('textarea', { rows: 8, value: sampleProtoSchema, placeholder: 'Optional .proto schema to map field numbers to names & types…' });
|
|
323
|
+
const protoOut = h('pre', { class: 'code-box' }, '');
|
|
324
|
+
|
|
325
|
+
async function runProtoDecode() {
|
|
326
|
+
try {
|
|
327
|
+
const res = await api('/api/protobuf/decode', {
|
|
328
|
+
body: {
|
|
329
|
+
input: protoPayloadIn.value.trim(),
|
|
330
|
+
protoSchema: protoSchemaIn.value.trim() || undefined,
|
|
331
|
+
},
|
|
332
|
+
});
|
|
333
|
+
protoOut.textContent = JSON.stringify(res, null, 2);
|
|
334
|
+
} catch (err) {
|
|
335
|
+
protoOut.textContent = err.message;
|
|
336
|
+
toast(err.message, 'err');
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
paneProto.appendChild(
|
|
341
|
+
h(
|
|
342
|
+
'div',
|
|
343
|
+
{ class: 'grid-2' },
|
|
344
|
+
h(
|
|
345
|
+
'div',
|
|
346
|
+
{ class: 'card' },
|
|
347
|
+
h(
|
|
348
|
+
'div',
|
|
349
|
+
{ class: 'row-between' },
|
|
350
|
+
h('h2', { class: 'card-title' }, 'Protobuf Wire Payload (Hex or Base64)'),
|
|
351
|
+
h('button', { type: 'button', class: 'btn btn-primary btn-sm', onClick: runProtoDecode }, 'Decode Wire'),
|
|
352
|
+
),
|
|
353
|
+
protoPayloadIn,
|
|
354
|
+
h('label', { class: 'field-label' }, 'Optional .proto Schema (auto-maps field names, bool, sint ZigZag, float/double)'),
|
|
355
|
+
protoSchemaIn,
|
|
356
|
+
),
|
|
357
|
+
h(
|
|
358
|
+
'div',
|
|
359
|
+
{ class: 'card' },
|
|
360
|
+
h(
|
|
361
|
+
'div',
|
|
362
|
+
{ class: 'row-between' },
|
|
363
|
+
h('h2', { class: 'card-title' }, 'Decoded Wire Fields & Mapped Object'),
|
|
364
|
+
h('button', { type: 'button', class: 'btn btn-ghost btn-xs', onClick: () => copyText(protoOut.textContent) }, 'Copy JSON'),
|
|
365
|
+
),
|
|
366
|
+
protoOut,
|
|
367
|
+
),
|
|
368
|
+
),
|
|
369
|
+
);
|
|
370
|
+
|
|
371
|
+
function showTab(id) {
|
|
372
|
+
activeTab = id;
|
|
373
|
+
paneContract.style.display = id === 'contract' ? '' : 'none';
|
|
374
|
+
paneOAuth.style.display = id === 'oauth' ? '' : 'none';
|
|
375
|
+
paneProto.style.display = id === 'proto' ? '' : 'none';
|
|
376
|
+
Array.from(tabBar.children).forEach((b) => b.classList.toggle('active', b.dataset.tab === id));
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
[
|
|
380
|
+
['contract', 'OpenAPI Contract Drift & Recorder'],
|
|
381
|
+
['oauth', 'OAuth 2.0 / OIDC PKCE Debugger'],
|
|
382
|
+
['proto', 'Protobuf Wire Decoder'],
|
|
383
|
+
].forEach(([id, label]) => {
|
|
384
|
+
tabBar.appendChild(h('button', { type: 'button', class: `tab-btn ${activeTab === id ? 'active' : ''}`, 'data-tab': id, onClick: () => showTab(id) }, label));
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
root.appendChild(h('div', { class: 'stack' }, tabBar, paneContract, paneOAuth, paneProto));
|
|
388
|
+
showTab('contract');
|
|
389
|
+
void runContractCheck();
|
|
390
|
+
void refreshRecorder();
|
|
391
|
+
void generatePkce();
|
|
392
|
+
void runProtoDecode();
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,77 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devanvil",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "2.1.0",
|
|
4
|
+
"description": "Local-first, zero-dependency offline Developer Studio, MCP Server & CLI — 14 local studios: OpenAPI-to-Mock, Workspaces + Postman/HAR Import, Record & Replay, SSE Stream Tester, Secret & .env Guard (SARIF), LLM Token Studio, JWT, Regex/ReDoS & Pipelines.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"developer-tools",
|
|
7
|
+
"dev-tools",
|
|
8
|
+
"local-first",
|
|
9
|
+
"offline",
|
|
10
|
+
"zero-dependency",
|
|
11
|
+
"mcp-server",
|
|
12
|
+
"openapi",
|
|
13
|
+
"api-client",
|
|
14
|
+
"mock-server",
|
|
15
|
+
"webhook-inspector",
|
|
16
|
+
"secret-scanner",
|
|
17
|
+
"sarif",
|
|
18
|
+
"postman-importer",
|
|
19
|
+
"jwt",
|
|
20
|
+
"regex",
|
|
21
|
+
"redos",
|
|
22
|
+
"json-yaml-toml",
|
|
23
|
+
"diff",
|
|
24
|
+
"crypto",
|
|
25
|
+
"cron",
|
|
26
|
+
"cli",
|
|
27
|
+
"privacy",
|
|
28
|
+
"self-hosted"
|
|
29
|
+
],
|
|
30
|
+
"homepage": "https://github.com/abd77o/devanvil#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/abd77o/devanvil/issues"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/abd77o/devanvil.git"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"author": "abd77o",
|
|
40
|
+
"type": "module",
|
|
41
|
+
"main": "./dist/index.js",
|
|
42
|
+
"types": "./dist/index.d.ts",
|
|
43
|
+
"exports": {
|
|
44
|
+
".": {
|
|
45
|
+
"types": "./dist/index.d.ts",
|
|
46
|
+
"import": "./dist/index.js"
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"bin": {
|
|
50
|
+
"devanvil": "dist/cli.js"
|
|
51
|
+
},
|
|
52
|
+
"files": [
|
|
53
|
+
"dist",
|
|
54
|
+
"README.md",
|
|
55
|
+
"LICENSE",
|
|
56
|
+
"SECURITY.md"
|
|
57
|
+
],
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=20.0.0"
|
|
60
|
+
},
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build": "tsc -p tsconfig.json && node scripts/postbuild.mjs",
|
|
63
|
+
"build:sea": "npm run build && node scripts/build-sea.mjs",
|
|
64
|
+
"typecheck": "tsc -p tsconfig.test.json --noEmit",
|
|
65
|
+
"test": "npm run build && tsc -p tsconfig.test.json && node --test --test-reporter=spec dist-test/tests/*.test.js",
|
|
66
|
+
"bench": "npm run build && node scripts/bench.mjs",
|
|
67
|
+
"start": "node dist/cli.js serve",
|
|
68
|
+
"dev": "npm run build && node dist/cli.js serve --port 4321",
|
|
69
|
+
"clean": "node -e \"import('node:fs').then(fs=>{fs.rmSync('dist',{recursive:true,force:true});fs.rmSync('dist-test',{recursive:true,force:true});})\"",
|
|
70
|
+
"prepublishOnly": "npm test"
|
|
71
|
+
},
|
|
72
|
+
"dependencies": {},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/node": "^20.17.0",
|
|
75
|
+
"typescript": "^5.7.2"
|
|
76
|
+
}
|
|
77
|
+
}
|