OverviewFilesCommitsIssuesDocsReleasesPeers

pgh-legacy commits / 5e74f19

Add issue close/reopen/comment, search, deploy config/log, client tests
CLI: pgh issue close/reopen/comment, pgh search, pgh deploy config/log Client: updateIssue, search, deployConfig, deployLog, adminStats/Users/Tokens 5 tests, 22 assertions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5e74f1900d30e98cd5cdcc95b979a8b6451ea833
by plankatron <fleeky@gmail.com> · 2026-03-30T18:07:44.000Z

Changed files (5) +1009 -7

bin/pgh.js +45 -5
……@@ -53,20 +53,54 @@ async function run () {
5353
5454 case 'issue': {
5555 if (sub === 'create') {
56 const repo = args[2]
57 const title = args[3]
56 const repo = args[2]; const title = args[3]
5857 if (!repo || !title) return usage('pgh issue create <repo> <title> [body]')
59 const body = args[4] || ''
60 return log(await client.createIssue(repo, { title, body, author: 'pgh' }))
58 return log(await client.createIssue(repo, { title, body: args[4] || '', author: 'pgh' }))
59 }
60 if (sub === 'close') {
61 const repo = args[2]; const id = args[3]
62 if (!repo || !id) return usage('pgh issue close <repo> <id>')
63 return log(await client.updateIssue(repo, id, { status: 'closed' }))
64 }
65 if (sub === 'reopen') {
66 const repo = args[2]; const id = args[3]
67 if (!repo || !id) return usage('pgh issue reopen <repo> <id>')
68 return log(await client.updateIssue(repo, id, { status: 'open' }))
6169 }
62 if (!sub) return usage('pgh issue <repo> <id> OR pgh issue create <repo> <title>')
70 if (sub === 'comment') {
71 const repo = args[2]; const id = args[3]; const text = args[4]
72 if (!repo || !id || !text) return usage('pgh issue comment <repo> <id> <text>')
73 return log(await client.addComment(repo, id, { body: text, author: 'pgh' }))
74 }
75 if (!sub) return usage('pgh issue <repo> <id>')
6376 const id = args[2]
6477 if (!id) return usage('pgh issue <repo> <id>')
6578 return log(await client.issue(sub, id))
6679 }
6780
81 case 'search': {
82 if (!sub) return usage('pgh search <query>')
83 const result = await client.search(sub)
84 console.log(`${result.total} results for "${result.query}"`)
85 for (const r of result.results) {
86 console.log(` ${r.repo}/${r.path}:${r.line} ${r.content}`)
87 }
88 return
89 }
90
6891 case 'deploy': {
6992 if (sub === 'status') return log(await client.deployStatus())
93 if (sub === 'config') {
94 const repo = args[2]
95 if (!repo) return usage('pgh deploy config <repo>')
96 return log(await client.deployConfig(repo))
97 }
98 if (sub === 'log') {
99 const repo = args[2]
100 if (!repo) return usage('pgh deploy log <repo>')
101 const entries = await client.deployLog(repo)
102 return logList(entries, e => `[${e.status}] ${e.commitHash?.slice(0, 8) || ''} ${e.timestamp ? ago(e.timestamp) : ''}`)
103 }
70104 if (!sub) return usage('pgh deploy <repo>')
71105 console.log(`Deploying ${sub}...`)
72106 return log(await client.deploy(sub))
……@@ -185,8 +219,14 @@ Commands:
185219 pgh issues <repo> List issues
186220 pgh issue <repo> <id> Issue details
187221 pgh issue create <repo> <title> [body] Create issue
222 pgh issue close <repo> <id> Close issue
223 pgh issue reopen <repo> <id> Reopen issue
224 pgh issue comment <repo> <id> <text> Add comment
225 pgh search <query> Search code across repos
188226 pgh deploy <repo> Trigger deploy
189227 pgh deploy status Deploy status
228 pgh deploy config <repo> Deploy config
229 pgh deploy log <repo> Deploy history
190230 pgh orgs List organizations
191231 pgh users List users
192232 pgh auth Start auth flow
lib/client.js +18 -1
……@@ -34,19 +34,36 @@ export class PghClient {
3434 return h
3535 }
3636
37 async patch (path, body) {
38 const res = await fetch(this.server + path, {
39 method: 'PATCH',
40 headers: { ...this._headers(), 'Content-Type': 'application/json' },
41 body: JSON.stringify(body)
42 })
43 if (!res.ok) throw new Error(`${res.status} ${await res.text()}`)
44 return res.json()
45 }
46
3747 // Convenience methods
3848 status () { return this.get('/api/status') }
3949 repos () { return this.get('/api/repos') }
4050 repo (name) { return this.get(`/api/repos/${name}`) }
41 issues (repo) { return this.get(`/api/repos/${repo}/issues`) }
51 issues (repo, status) { return this.get(`/api/repos/${repo}/issues${status ? '?status=' + status : ''}`) }
4252 issue (repo, id) { return this.get(`/api/repos/${repo}/issues/${id}`) }
4353 createIssue (repo, data) { return this.post(`/api/repos/${repo}/issues`, data) }
54 updateIssue (repo, id, data) { return this.patch(`/api/repos/${repo}/issues/${id}`, data) }
4455 comments (repo, id) { return this.get(`/api/repos/${repo}/issues/${id}/comments`) }
4556 addComment (repo, id, data) { return this.post(`/api/repos/${repo}/issues/${id}/comments`, data) }
4657 orgs () { return this.get('/api/orgs') }
4758 users () { return this.get('/api/users') }
4859 deploy (repo) { return this.post(`/api/deploy/${repo}`, {}) }
4960 deployStatus () { return this.get('/api/deploy/status') }
61 deployConfig (repo) { return this.get(`/api/deploy/config/${repo}`) }
62 deployLog (repo) { return this.get(`/api/deploy/log/${repo}`) }
5063 challenge () { return this.get('/api/auth/challenge') }
5164 verify (data) { return this.post('/api/auth/verify', data) }
65 search (q) { return this.get(`/api/search/code?q=${encodeURIComponent(q)}`) }
66 adminStats () { return this.get('/api/admin/stats') }
67 adminUsers () { return this.get('/api/admin/users') }
68 adminTokens () { return this.get('/api/admin/tokens') }
5269}
package-lock.json +895 -0
……@@ -0,0 +1,895 @@
1{
2 "name": "pgh",
3 "version": "1.0.0",
4 "lockfileVersion": 3,
5 "requires": true,
6 "packages": {
7 "": {
8 "name": "pgh",
9 "version": "1.0.0",
10 "bin": {
11 "pgh": "bin/pgh.js"
12 },
13 "devDependencies": {
14 "brittle": "^3.19.1"
15 }
16 },
17 "node_modules/@jridgewell/resolve-uri": {
18 "version": "3.1.2",
19 "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",
20 "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",
21 "dev": true,
22 "license": "MIT",
23 "engines": {
24 "node": ">=6.0.0"
25 }
26 },
27 "node_modules/@jridgewell/sourcemap-codec": {
28 "version": "1.5.5",
29 "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz",
30 "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==",
31 "dev": true,
32 "license": "MIT"
33 },
34 "node_modules/@jridgewell/trace-mapping": {
35 "version": "0.3.31",
36 "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz",
37 "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==",
38 "dev": true,
39 "license": "MIT",
40 "dependencies": {
41 "@jridgewell/resolve-uri": "^3.1.0",
42 "@jridgewell/sourcemap-codec": "^1.4.14"
43 }
44 },
45 "node_modules/@types/istanbul-lib-coverage": {
46 "version": "2.0.6",
47 "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.6.tgz",
48 "integrity": "sha512-2QF/t/auWm0lsy8XtKVPG19v3sSOQlJe/YHZgfjb/KBBHOGSV+J2q/S671rcq9uTBrLAXmZpqJiaQbMT+zNU1w==",
49 "dev": true,
50 "license": "MIT"
51 },
52 "node_modules/b4a": {
53 "version": "1.8.0",
54 "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.8.0.tgz",
55 "integrity": "sha512-qRuSmNSkGQaHwNbM7J78Wwy+ghLEYF1zNrSeMxj4Kgw6y33O3mXcQ6Ie9fRvfU/YnxWkOchPXbaLb73TkIsfdg==",
56 "dev": true,
57 "license": "Apache-2.0",
58 "peerDependencies": {
59 "react-native-b4a": "*"
60 },
61 "peerDependenciesMeta": {
62 "react-native-b4a": {
63 "optional": true
64 }
65 }
66 },
67 "node_modules/bare-abort": {
68 "version": "2.0.13",
69 "resolved": "https://registry.npmjs.org/bare-abort/-/bare-abort-2.0.13.tgz",
70 "integrity": "sha512-zdc8l88eB11Jsz5rDd6sCAgv2kUFXgdrZWoMlgU6JMkfAi1/uuGFC3IEHswKbIRQTk5H3T5CMuechsXYxiaHlQ==",
71 "dev": true,
72 "license": "Apache-2.0"
73 },
74 "node_modules/bare-addon-resolve": {
75 "version": "1.10.0",
76 "resolved": "https://registry.npmjs.org/bare-addon-resolve/-/bare-addon-resolve-1.10.0.tgz",
77 "integrity": "sha512-sSd0jieRJlDaODOzj0oe0RjFVC1QI0ZIjGIdPkbrTXsdVVtENg14c+lHHAhHwmWCZ2nQlMhy8jA3Y5LYPc/isA==",
78 "dev": true,
79 "license": "Apache-2.0",
80 "dependencies": {
81 "bare-module-resolve": "^1.10.0",
82 "bare-semver": "^1.0.0"
83 },
84 "peerDependencies": {
85 "bare-url": "*"
86 },
87 "peerDependenciesMeta": {
88 "bare-url": {
89 "optional": true
90 }
91 }
92 },
93 "node_modules/bare-ansi-escapes": {
94 "version": "2.2.3",
95 "resolved": "https://registry.npmjs.org/bare-ansi-escapes/-/bare-ansi-escapes-2.2.3.tgz",
96 "integrity": "sha512-02ES4/E2RbrtZSnHJ9LntBhYkLA6lPpSEeP8iqS3MccBIVhVBlEmruF1I7HZqx5Q8aiTeYfQVeqmrU9YO2yYoQ==",
97 "dev": true,
98 "license": "Apache-2.0",
99 "dependencies": {
100 "bare-stream": "^2.6.5"
101 },
102 "peerDependencies": {
103 "bare-buffer": "*"
104 },
105 "peerDependenciesMeta": {
106 "bare-buffer": {
107 "optional": true
108 }
109 }
110 },
111 "node_modules/bare-assert": {
112 "version": "1.2.0",
113 "resolved": "https://registry.npmjs.org/bare-assert/-/bare-assert-1.2.0.tgz",
114 "integrity": "sha512-c6uvgvTJBspTDxtVnPgrBKmLgcpW3Fp72NVKDLg6oT4QjQbhGtvrkHMhGYMK1sh4vjBHOBmuUalyt9hSzV37fQ==",
115 "dev": true,
116 "license": "Apache-2.0",
117 "dependencies": {
118 "bare-inspect": "^3.1.2"
119 }
120 },
121 "node_modules/bare-bundle": {
122 "version": "1.10.0",
123 "resolved": "https://registry.npmjs.org/bare-bundle/-/bare-bundle-1.10.0.tgz",
124 "integrity": "sha512-4LVlnJAHr00Hh6Vu6ZUJS38rcEtJT3b3vChXSsBsJ2mk1TN0lQ+gzd+Dw5L0aV7uqDZv84smuwW+O02X7PfDlw==",
125 "dev": true,
126 "license": "Apache-2.0",
127 "peerDependencies": {
128 "bare-buffer": "*",
129 "bare-url": "*"
130 },
131 "peerDependenciesMeta": {
132 "bare-buffer": {
133 "optional": true
134 },
135 "bare-url": {
136 "optional": true
137 }
138 }
139 },
140 "node_modules/bare-cov": {
141 "version": "1.2.1",
142 "resolved": "https://registry.npmjs.org/bare-cov/-/bare-cov-1.2.1.tgz",
143 "integrity": "sha512-SHNqb/WG9udUEj8m5qGSehoUQ9o0Xzv8nrf4HIdmG+KNU/XdhPLhTP5VPrHnSAMAXhAzEB4Q+2IYZ0x9qPzN1g==",
144 "dev": true,
145 "license": "Apache-2.0",
146 "dependencies": {
147 "bare-fs": "^4.1.2",
148 "bare-inspector": "^4.0.1",
149 "bare-path": "^3.0.0",
150 "bare-process": "^4.2.1",
151 "bare-url": "^2.1.5",
152 "bare-v8-to-istanbul": "^1.0.2",
153 "picomatch": "^4.0.2",
154 "which-runtime": "^1.2.1"
155 }
156 },
157 "node_modules/bare-crypto": {
158 "version": "1.13.4",
159 "resolved": "https://registry.npmjs.org/bare-crypto/-/bare-crypto-1.13.4.tgz",
160 "integrity": "sha512-JiCZ5l2YOG1y8J7yy1BCAKTCZrPnHLb7pDRIdurBTOn5oIwBQDIv8iH5Pl2V85vzjl1NZXRfNY4HZLsE942jJA==",
161 "dev": true,
162 "license": "Apache-2.0",
163 "dependencies": {
164 "bare-assert": "^1.2.0",
165 "bare-stream": "^2.6.3"
166 },
167 "peerDependencies": {
168 "bare-buffer": "*"
169 },
170 "peerDependenciesMeta": {
171 "bare-buffer": {
172 "optional": true
173 }
174 }
175 },
176 "node_modules/bare-debug-log": {
177 "version": "2.0.0",
178 "resolved": "https://registry.npmjs.org/bare-debug-log/-/bare-debug-log-2.0.0.tgz",
179 "integrity": "sha512-Vi42PkMQsNV9PUpx2Gl1hikshx5O9FzMJ6o9Nnopseg7qLBBK7Nl31d0RHcfwLEAfmcPApytpc0ZFfq68u22FQ==",
180 "dev": true,
181 "license": "Apache-2.0",
182 "dependencies": {
183 "bare-os": "^3.0.1"
184 }
185 },
186 "node_modules/bare-dns": {
187 "version": "2.1.4",
188 "resolved": "https://registry.npmjs.org/bare-dns/-/bare-dns-2.1.4.tgz",
189 "integrity": "sha512-abwjHmpWqSRNB7V5615QxPH92L71AVzFm/kKTs8VYiNTAi2xVdonpv0BjJ0hwXLwomoW+xsSOPjW6PZPO14asg==",
190 "dev": true,
191 "license": "Apache-2.0",
192 "engines": {
193 "bare": ">=1.7.0"
194 }
195 },
196 "node_modules/bare-encoding": {
197 "version": "1.0.3",
198 "resolved": "https://registry.npmjs.org/bare-encoding/-/bare-encoding-1.0.3.tgz",
199 "integrity": "sha512-Kqf+t/azs13lUeyK4Tb7ha4wdLRXKWCXQ8w1rVmt7KtoPCPdHD/Xwt7LBIsCSwwGglrcmblo5VOLa5avkJqULA==",
200 "dev": true,
201 "license": "Apache-2.0",
202 "peerDependencies": {
203 "bare-buffer": "*"
204 },
205 "peerDependenciesMeta": {
206 "bare-buffer": {
207 "optional": true
208 }
209 }
210 },
211 "node_modules/bare-env": {
212 "version": "3.0.0",
213 "resolved": "https://registry.npmjs.org/bare-env/-/bare-env-3.0.0.tgz",
214 "integrity": "sha512-0u964P5ZLAxTi+lW4Kjp7YRJQ5gZr9ycYOtjLxsSrupgMz3sn5Z9n4SH/JIifHwvadsf1brA2JAjP+9IOWwTiw==",
215 "dev": true,
216 "license": "Apache-2.0",
217 "dependencies": {
218 "bare-os": "^3.0.1"
219 }
220 },
221 "node_modules/bare-events": {
222 "version": "2.8.2",
223 "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.8.2.tgz",
224 "integrity": "sha512-riJjyv1/mHLIPX4RwiK+oW9/4c3TEUeORHKefKAKnZ5kyslbN+HXowtbaVEqt4IMUB7OXlfixcs6gsFeo/jhiQ==",
225 "dev": true,
226 "license": "Apache-2.0",
227 "peerDependencies": {
228 "bare-abort-controller": "*"
229 },
230 "peerDependenciesMeta": {
231 "bare-abort-controller": {
232 "optional": true
233 }
234 }
235 },
236 "node_modules/bare-format": {
237 "version": "1.0.2",
238 "resolved": "https://registry.npmjs.org/bare-format/-/bare-format-1.0.2.tgz",
239 "integrity": "sha512-GswdhnOnP9QtwRbrf4wLApw5widkaLMsLe2XOs35fQD2YfEN1ApoGka+cZ7PfvzxMgfYXmMhj/2OGlVn5/Dxgw==",
240 "dev": true,
241 "license": "Apache-2.0",
242 "dependencies": {
243 "bare-inspect": "^3.0.0"
244 }
245 },
246 "node_modules/bare-fs": {
247 "version": "4.5.6",
248 "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-4.5.6.tgz",
249 "integrity": "sha512-1QovqDrR80Pmt5HPAsMsXTCFcDYr+NSUKW6nd6WO5v0JBmnItc/irNRzm2KOQ5oZ69P37y+AMujNyNtG+1Rggw==",
250 "dev": true,
251 "license": "Apache-2.0",
252 "dependencies": {
253 "bare-events": "^2.5.4",
254 "bare-path": "^3.0.0",
255 "bare-stream": "^2.6.4",
256 "bare-url": "^2.2.2",
257 "fast-fifo": "^1.3.2"
258 },
259 "engines": {
260 "bare": ">=1.16.0"
261 },
262 "peerDependencies": {
263 "bare-buffer": "*"
264 },
265 "peerDependenciesMeta": {
266 "bare-buffer": {
267 "optional": true
268 }
269 }
270 },
271 "node_modules/bare-hrtime": {
272 "version": "2.1.1",
273 "resolved": "https://registry.npmjs.org/bare-hrtime/-/bare-hrtime-2.1.1.tgz",
274 "integrity": "sha512-VMb3tHo05gsnbu3OXTmkDiwTjMlOsbQmKoysKqKEyR09m77TuDrYFbj3Q5GGk10dAKsUHrnXmwCaeJqzVpB5ZA==",
275 "dev": true,
276 "license": "Apache-2.0"
277 },
278 "node_modules/bare-http-parser": {
279 "version": "1.1.3",
280 "resolved": "https://registry.npmjs.org/bare-http-parser/-/bare-http-parser-1.1.3.tgz",
281 "integrity": "sha512-+dhVvQi6brHq14L/XHNRQ+TLuVE76VjRmMt61wVEtS+Od8xUslfMHWJN/ZjIIt3RtTG6vPuA+x9cOh7KrkBJsA==",
282 "dev": true,
283 "license": "Apache-2.0"
284 },
285 "node_modules/bare-http1": {
286 "version": "4.5.5",
287 "resolved": "https://registry.npmjs.org/bare-http1/-/bare-http1-4.5.5.tgz",
288 "integrity": "sha512-ADITiRo0huP76JGMbv6Arsh9KehHqjEBoYcmjvAo67IY78+/9mV2MeKLLCkiJSFxA85T/m8cTaE44OwJQCcwdw==",
289 "dev": true,
290 "license": "Apache-2.0",
291 "dependencies": {
292 "bare-events": "^2.6.0",
293 "bare-http-parser": "^1.1.1",
294 "bare-stream": "^2.10.0",
295 "bare-tcp": "^2.2.0"
296 },
297 "peerDependencies": {
298 "bare-buffer": "*",
299 "bare-url": "*"
300 },
301 "peerDependenciesMeta": {
302 "bare-buffer": {
303 "optional": true
304 },
305 "bare-url": {
306 "optional": true
307 }
308 }
309 },
310 "node_modules/bare-https": {
311 "version": "2.1.3",
312 "resolved": "https://registry.npmjs.org/bare-https/-/bare-https-2.1.3.tgz",
313 "integrity": "sha512-0TI/mJXQGYXmG7UUyWEG+KCJusayIAQLywUjFAskDoKuxfqVnGF+M/mTMrEV8J64DaIdU+5x761FvgmT7M68tA==",
314 "dev": true,
315 "license": "Apache-2.0",
316 "dependencies": {
317 "bare-http1": "^4.4.0",
318 "bare-tcp": "^2.2.0",
319 "bare-tls": "^2.0.0"
320 }
321 },
322 "node_modules/bare-inspect": {
323 "version": "3.1.4",
324 "resolved": "https://registry.npmjs.org/bare-inspect/-/bare-inspect-3.1.4.tgz",
325 "integrity": "sha512-jfW5KRA84o3REpI6Vr4nbvMn+hqVAw8GU1mMdRwUsY5yJovQamxYeKGVKGqdzs+8ZbG4jRzGUXP/3Ji/DnqfPg==",
326 "dev": true,
327 "license": "Apache-2.0",
328 "dependencies": {
329 "bare-ansi-escapes": "^2.1.0",
330 "bare-type": "^1.0.0"
331 },
332 "engines": {
333 "bare": ">=1.18.0"
334 }
335 },
336 "node_modules/bare-inspector": {
337 "version": "4.0.3",
338 "resolved": "https://registry.npmjs.org/bare-inspector/-/bare-inspector-4.0.3.tgz",
339 "integrity": "sha512-yYk6+7tTVKJKHOja5+QBn989ETv8oVsmwoH0nCM+QYC6w5MC03GC4aQNK+lipAZSz1EaAj42WZ8Wewjpy0L9TA==",
340 "dev": true,
341 "license": "Apache-2.0",
342 "dependencies": {
343 "bare-events": "^2.1.0",
344 "bare-http1": "^4.0.0",
345 "bare-stream": "^2.0.0",
346 "bare-url": "^2.0.0",
347 "bare-ws": "^2.0.0"
348 },
349 "engines": {
350 "bare": ">=1.2.0"
351 },
352 "peerDependencies": {
353 "bare-tcp": "*"
354 },
355 "peerDependenciesMeta": {
356 "bare-tcp": {
357 "optional": true
358 }
359 }
360 },
361 "node_modules/bare-module": {
362 "version": "6.1.3",
363 "resolved": "https://registry.npmjs.org/bare-module/-/bare-module-6.1.3.tgz",
364 "integrity": "sha512-5XWsVHsvtWMH4tK4DQWgpNTV0t/sg3ZrAaQLIxrwjrS5+u8Q9vEgc/zQ4QaDPWDse/y/5h+d+YG1Q0JfSMt0zA==",
365 "dev": true,
366 "license": "Apache-2.0",
367 "dependencies": {
368 "bare-bundle": "^1.3.0",
369 "bare-module-lexer": "^1.0.0",
370 "bare-module-resolve": "^1.8.0",
371 "bare-path": "^3.0.0",
372 "bare-url": "^2.0.1"
373 },
374 "engines": {
375 "bare": ">=1.23.0"
376 },
377 "peerDependencies": {
378 "bare-buffer": "*"
379 },
380 "peerDependenciesMeta": {
381 "bare-buffer": {
382 "optional": true
383 }
384 }
385 },
386 "node_modules/bare-module-lexer": {
387 "version": "1.4.7",
388 "resolved": "https://registry.npmjs.org/bare-module-lexer/-/bare-module-lexer-1.4.7.tgz",
389 "integrity": "sha512-0klU4eMsjh/wcxi8FdHmNom2j2F4kmkXOhyJFL9qTaSFp2lE3m6BtbKgMHY8R5miqC9r8/IfA8wzXnC5Os14WA==",
390 "dev": true,
391 "license": "Apache-2.0",
392 "dependencies": {
393 "require-addon": "^1.0.2"
394 },
395 "peerDependencies": {
396 "bare-buffer": "*"
397 },
398 "peerDependenciesMeta": {
399 "bare-buffer": {
400 "optional": true
401 }
402 }
403 },
404 "node_modules/bare-module-resolve": {
405 "version": "1.12.1",
406 "resolved": "https://registry.npmjs.org/bare-module-resolve/-/bare-module-resolve-1.12.1.tgz",
407 "integrity": "sha512-hbmAPyFpEq8FoZMd5sFO3u6MC5feluWoGE8YKlA8fCrl6mNtx68Wjg4DTiDJcqRJaovTvOYKfYngoBUnbaT7eg==",
408 "dev": true,
409 "license": "Apache-2.0",
410 "dependencies": {
411 "bare-semver": "^1.0.0"
412 },
413 "peerDependencies": {
414 "bare-url": "*"
415 },
416 "peerDependenciesMeta": {
417 "bare-url": {
418 "optional": true
419 }
420 }
421 },
422 "node_modules/bare-net": {
423 "version": "2.3.1",
424 "resolved": "https://registry.npmjs.org/bare-net/-/bare-net-2.3.1.tgz",
425 "integrity": "sha512-MypSqDKpDU2Xt7FIfazn5yGvRnV09gFcIPHGWstW0gxuzA4tucTcwJSZeos97C4F89vtU5oGwXDN/HrGN6Y4Jw==",
426 "dev": true,
427 "license": "Apache-2.0",
428 "dependencies": {
429 "bare-events": "^2.2.2",
430 "bare-pipe": "^4.0.0",
431 "bare-stream": "^2.0.0",
432 "bare-tcp": "^2.0.0"
433 }
434 },
435 "node_modules/bare-os": {
436 "version": "3.8.6",
437 "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-3.8.6.tgz",
438 "integrity": "sha512-l8xaNWWb/bXuzgsrlF5jaa5QYDJ9S0ddd54cP6CH+081+5iPrbJiCfBWQqrWYzmUhCbsH+WR6qxo9MeHVCr0MQ==",
439 "dev": true,
440 "license": "Apache-2.0",
441 "engines": {
442 "bare": ">=1.14.0"
443 }
444 },
445 "node_modules/bare-path": {
446 "version": "3.0.0",
447 "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-3.0.0.tgz",
448 "integrity": "sha512-tyfW2cQcB5NN8Saijrhqn0Zh7AnFNsnczRcuWODH0eYAXBsJ5gVxAUuNr7tsHSC6IZ77cA0SitzT+s47kot8Mw==",
449 "dev": true,
450 "license": "Apache-2.0",
451 "dependencies": {
452 "bare-os": "^3.0.1"
453 }
454 },
455 "node_modules/bare-pipe": {
456 "version": "4.1.5",
457 "resolved": "https://registry.npmjs.org/bare-pipe/-/bare-pipe-4.1.5.tgz",
458 "integrity": "sha512-6OfxaG8JSkRh3Gc4hzHRsxNt+yu2PpN7lrv1V+T78GdknWQkVGwiEvu4m+1nbfk8cMVQ0TGxRvQ90XA4rhnTuw==",
459 "dev": true,
460 "license": "Apache-2.0",
461 "dependencies": {
462 "bare-events": "^2.0.0",
463 "bare-stream": "^2.0.0"
464 },
465 "engines": {
466 "bare": ">=1.16.0"
467 }
468 },
469 "node_modules/bare-process": {
470 "version": "4.4.0",
471 "resolved": "https://registry.npmjs.org/bare-process/-/bare-process-4.4.0.tgz",
472 "integrity": "sha512-G5O+Lk1lsPiYjVXP+xS8KUqNzFwibrwvqJ7DO6x8ceLSTwxyMq7NwpbmbGQQZiaiOsdZZHBFs9n+we7OuANhaw==",
473 "dev": true,
474 "license": "Apache-2.0",
475 "dependencies": {
476 "bare-abort": "^2.0.13",
477 "bare-env": "^3.0.0",
478 "bare-events": "^2.3.1",
479 "bare-fs": "^4.5.6",
480 "bare-hrtime": "^2.0.0",
481 "bare-os": "^3.7.1",
482 "bare-signals": "^4.0.0",
483 "bare-tty": "^5.0.0"
484 }
485 },
486 "node_modules/bare-semver": {
487 "version": "1.0.2",
488 "resolved": "https://registry.npmjs.org/bare-semver/-/bare-semver-1.0.2.tgz",
489 "integrity": "sha512-ESVaN2nzWhcI5tf3Zzcq9aqCZ676VWzqw07eEZ0qxAcEOAFYBa0pWq8sK34OQeHLY3JsfKXZS9mDyzyxGjeLzA==",
490 "dev": true,
491 "license": "Apache-2.0"
492 },
493 "node_modules/bare-signals": {
494 "version": "4.2.0",
495 "resolved": "https://registry.npmjs.org/bare-signals/-/bare-signals-4.2.0.tgz",
496 "integrity": "sha512-fNHMOdQIlYuTvMB3Oh9Apk99hLKn351+Ir8vz+khiPTcOqIyGG4uWWjdLTzxWdYGsA0eT+We3y0K74hjj2nq7A==",
497 "dev": true,
498 "license": "Apache-2.0",
499 "dependencies": {
500 "bare-events": "^2.5.3",
501 "bare-os": "^3.3.1"
502 },
503 "engines": {
504 "bare": ">=1.7.0"
505 }
506 },
507 "node_modules/bare-stream": {
508 "version": "2.11.0",
509 "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.11.0.tgz",
510 "integrity": "sha512-Y/+iQ49fL3rIn6w/AVxI/2+BRrpmzJvdWt5Jv8Za6Ngqc6V227c+pYjYYgLdpR3MwQ9ObVXD0ZrqoBztakM0rw==",
511 "dev": true,
512 "license": "Apache-2.0",
513 "dependencies": {
514 "streamx": "^2.25.0",
515 "teex": "^1.0.1"
516 },
517 "peerDependencies": {
518 "bare-abort-controller": "*",
519 "bare-buffer": "*",
520 "bare-events": "*"
521 },
522 "peerDependenciesMeta": {
523 "bare-abort-controller": {
524 "optional": true
525 },
526 "bare-buffer": {
527 "optional": true
528 },
529 "bare-events": {
530 "optional": true
531 }
532 }
533 },
534 "node_modules/bare-stylize": {
535 "version": "0.0.1",
536 "resolved": "https://registry.npmjs.org/bare-stylize/-/bare-stylize-0.0.1.tgz",
537 "integrity": "sha512-l3MjmIl476bWijYWf3RbE+osl4iuXSOMudzp0vAqzIK7gPgn/+G3oAxp8Oin9CFF911KBP0LO9kts8Ci8mGZaQ==",
538 "dev": true,
539 "license": "Apache-2.0",
540 "dependencies": {
541 "bare-ansi-escapes": "^2.2.3",
542 "bare-process": "^4.2.1"
543 }
544 },
545 "node_modules/bare-subprocess": {
546 "version": "5.2.3",
547 "resolved": "https://registry.npmjs.org/bare-subprocess/-/bare-subprocess-5.2.3.tgz",
548 "integrity": "sha512-07wwswlV7M3sC9IykbZRZ/jHAkrXFWVLqdBWGv1y0ojCimtRD9hGwxdHmR5FUFmDUZLNsBmTYJNQqgio5+A85Q==",
549 "dev": true,
550 "license": "Apache-2.0",
551 "dependencies": {
552 "bare-env": "^3.0.0",
553 "bare-events": "^2.5.4",
554 "bare-os": "^3.0.1",
555 "bare-pipe": "^4.0.0",
556 "bare-url": "^2.2.2"
557 },
558 "engines": {
559 "bare": ">=1.7.0"
560 },
561 "peerDependencies": {
562 "bare-buffer": "*"
563 },
564 "peerDependenciesMeta": {
565 "bare-buffer": {
566 "optional": true
567 }
568 }
569 },
570 "node_modules/bare-tcp": {
571 "version": "2.2.7",
572 "resolved": "https://registry.npmjs.org/bare-tcp/-/bare-tcp-2.2.7.tgz",
573 "integrity": "sha512-rjpqNQ2cOCkNo3NeYA/W4GTK3DRkl8sDHO3uos+AEswUjLC8XXMQF8WrJCSjlIowCbS6NUVxKE92X5RGXjyefg==",
574 "dev": true,
575 "license": "Apache-2.0",
576 "dependencies": {
577 "bare-dns": "^2.0.4",
578 "bare-events": "^2.5.4",
579 "bare-stream": "^2.6.4"
580 },
581 "engines": {
582 "bare": ">=1.16.0"
583 }
584 },
585 "node_modules/bare-tls": {
586 "version": "2.2.1",
587 "resolved": "https://registry.npmjs.org/bare-tls/-/bare-tls-2.2.1.tgz",
588 "integrity": "sha512-hZ+ZqwrUO4dyH7/6WYkYWjgAFNJKjzwEYJiDaMnMs+eRleBDjQ3CvNZawpkw0Ar9jnM9NZK6+f6GqjkZ2FLGmQ==",
589 "dev": true,
590 "license": "Apache-2.0",
591 "dependencies": {
592 "bare-net": "^2.0.1",
593 "bare-stream": "^2.6.4"
594 },
595 "engines": {
596 "bare": ">=1.7.0"
597 }
598 },
599 "node_modules/bare-tty": {
600 "version": "5.1.0",
601 "resolved": "https://registry.npmjs.org/bare-tty/-/bare-tty-5.1.0.tgz",
602 "integrity": "sha512-EZLvW4A+XiJgI3TW+e1pMME9PIJsfEXe/DA/WSKzIkq/v7Yarpv/rvG6Z5pGnpo4V/Bd+qopwnCLSR71hMMBYA==",
603 "dev": true,
604 "license": "Apache-2.0",
605 "dependencies": {
606 "bare-events": "^2.2.0",
607 "bare-signals": "^4.0.0",
608 "bare-stream": "^2.0.0"
609 },
610 "engines": {
611 "bare": ">=1.16.0"
612 }
613 },
614 "node_modules/bare-type": {
615 "version": "1.1.0",
616 "resolved": "https://registry.npmjs.org/bare-type/-/bare-type-1.1.0.tgz",
617 "integrity": "sha512-LdtnnEEYldOc87Dr4GpsKnStStZk3zfgoEMXy8yvEZkXrcCv9RtYDrUYWFsBQHtaB0s1EUWmcvS6XmEZYIj3Bw==",
618 "dev": true,
619 "license": "Apache-2.0",
620 "engines": {
621 "bare": ">=1.2.0"
622 }
623 },
624 "node_modules/bare-url": {
625 "version": "2.4.0",
626 "resolved": "https://registry.npmjs.org/bare-url/-/bare-url-2.4.0.tgz",
627 "integrity": "sha512-NSTU5WN+fy/L0DDenfE8SXQna4voXuW0FHM7wH8i3/q9khUSchfPbPezO4zSFMnDGIf9YE+mt/RWhZgNRKRIXA==",
628 "dev": true,
629 "license": "Apache-2.0",
630 "peer": true,
631 "dependencies": {
632 "bare-path": "^3.0.0"
633 }
634 },
635 "node_modules/bare-utils": {
636 "version": "1.6.0",
637 "resolved": "https://registry.npmjs.org/bare-utils/-/bare-utils-1.6.0.tgz",
638 "integrity": "sha512-WhQEIkkAxkSnW7u1QgrI0AfNm5JpMruETXeYsb5qnkBJ0TTfNKygZmsh6rkoHBANaV+C/7Jed7bJP9OmEHG7rQ==",
639 "dev": true,
640 "license": "Apache-2.0",
641 "dependencies": {
642 "bare-debug-log": "^2.0.0",
643 "bare-encoding": "^1.0.0",
644 "bare-format": "^1.0.0",
645 "bare-inspect": "^3.0.0",
646 "bare-stylize": "^0.0.1",
647 "bare-type": "^1.0.6"
648 }
649 },
650 "node_modules/bare-v8-to-istanbul": {
651 "version": "1.0.2",
652 "resolved": "https://registry.npmjs.org/bare-v8-to-istanbul/-/bare-v8-to-istanbul-1.0.2.tgz",
653 "integrity": "sha512-CM0wPgyQtXTQ7h4q8NjbTZ/FH5he0Jkiwgpq0lFZZA5tkVZzmQ/9ul4R7E+cNlGZJIZlQZ9v4CwbgVaFG3zOAA==",
654 "dev": true,
655 "license": "Apache-2.0",
656 "dependencies": {
657 "bare-assert": "^1.0.2",
658 "bare-fs": "^4.1.2",
659 "bare-module": "^6.1.2",
660 "bare-path": "^3.0.0",
661 "bare-process": "^4.2.0",
662 "bare-url": "^2.1.5",
663 "bare-utils": "^1.2.0",
664 "v8-to-istanbul": "^9.3.0",
665 "which-runtime": "^1.2.1"
666 }
667 },
668 "node_modules/bare-ws": {
669 "version": "2.1.0",
670 "resolved": "https://registry.npmjs.org/bare-ws/-/bare-ws-2.1.0.tgz",
671 "integrity": "sha512-2gEWlPK9iyBchACdIY6oQXgmDz3KLrChdwrPgmU3IVXOFTnxTqSUT27WE/+izd4QojHj/SsqDkQiD2HDvuTdAA==",
672 "dev": true,
673 "license": "Apache-2.0",
674 "dependencies": {
675 "bare-crypto": "^1.2.0",
676 "bare-events": "^2.3.1",
677 "bare-http1": "^4.0.0",
678 "bare-https": "^2.0.0",
679 "bare-stream": "^2.1.2"
680 },
681 "peerDependencies": {
682 "bare-buffer": "*",
683 "bare-url": "*"
684 },
685 "peerDependenciesMeta": {
686 "bare-buffer": {
687 "optional": true
688 },
689 "bare-url": {
690 "optional": true
691 }
692 }
693 },
694 "node_modules/brittle": {
695 "version": "3.19.1",
696 "resolved": "https://registry.npmjs.org/brittle/-/brittle-3.19.1.tgz",
697 "integrity": "sha512-4Ted1Mt9o9B6oIA6ImJJCtB/Fv++ZO3IDNQgRcHOXWSYGRUidgxchaGrUBaRn+4mlneXrgInPkCPzi0jO8qKbA==",
698 "dev": true,
699 "license": "Apache-2.0",
700 "dependencies": {
701 "b4a": "^1.6.0",
702 "bare-assert": "^1.0.2",
703 "bare-cov": "^1.1.0",
704 "bare-fs": "^4.1.6",
705 "bare-os": "^3.6.1",
706 "bare-path": "^3.0.0",
707 "bare-process": "^4.2.1",
708 "bare-subprocess": "^5.0.0",
709 "bare-url": "^2.1.6",
710 "error-stack-parser": "^2.1.4",
711 "globbie": "^1.0.2",
712 "paparam": "^1.6.2",
713 "same-object": "^1.0.2",
714 "test-tmp": "^1.4.0",
715 "tmatch": "^5.0.0"
716 },
717 "bin": {
718 "brittle": "bin/node.js",
719 "brittle-bare": "bin/bare.js",
720 "brittle-node": "bin/node.js",
721 "brittle-pear": "bin/pear.js"
722 }
723 },
724 "node_modules/convert-source-map": {
725 "version": "2.0.0",
726 "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz",
727 "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==",
728 "dev": true,
729 "license": "MIT"
730 },
731 "node_modules/error-stack-parser": {
732 "version": "2.1.4",
733 "resolved": "https://registry.npmjs.org/error-stack-parser/-/error-stack-parser-2.1.4.tgz",
734 "integrity": "sha512-Sk5V6wVazPhq5MhpO+AUxJn5x7XSXGl1R93Vn7i+zS15KDVxQijejNCrz8340/2bgLBjR9GtEG8ZVKONDjcqGQ==",
735 "dev": true,
736 "license": "MIT",
737 "dependencies": {
738 "stackframe": "^1.3.4"
739 }
740 },
741 "node_modules/events-universal": {
742 "version": "1.0.1",
743 "resolved": "https://registry.npmjs.org/events-universal/-/events-universal-1.0.1.tgz",
744 "integrity": "sha512-LUd5euvbMLpwOF8m6ivPCbhQeSiYVNb8Vs0fQ8QjXo0JTkEHpz8pxdQf0gStltaPpw0Cca8b39KxvK9cfKRiAw==",
745 "dev": true,
746 "license": "Apache-2.0",
747 "dependencies": {
748 "bare-events": "^2.7.0"
749 }
750 },
751 "node_modules/fast-fifo": {
752 "version": "1.3.2",
753 "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz",
754 "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==",
755 "dev": true,
756 "license": "MIT"
757 },
758 "node_modules/globbie": {
759 "version": "1.0.3",
760 "resolved": "https://registry.npmjs.org/globbie/-/globbie-1.0.3.tgz",
761 "integrity": "sha512-hcryJmKcftf82xfBWTWxuUITWIIoYO3ec104V17SMHGFl6VLbm1d1Ju9LX9L+jyJTwICpemX/dmPI/HGYoKr1A==",
762 "dev": true,
763 "license": "Apache-2.0",
764 "dependencies": {
765 "bare-fs": "^4.1.2",
766 "bare-path": "^3.0.0",
767 "bare-process": "^4.2.1",
768 "picomatch": "^4.0.2"
769 }
770 },
771 "node_modules/paparam": {
772 "version": "1.10.1",
773 "resolved": "https://registry.npmjs.org/paparam/-/paparam-1.10.1.tgz",
774 "integrity": "sha512-viyQI64VIja0Za3njIzhoEP8ZVkgPowhZPuG0E96NwBfYJ6ZIyrrlhWGtFPkdN7eYLl2L8CTWL+wla0evm1KKQ==",
775 "dev": true,
776 "license": "Apache-2.0"
777 },
778 "node_modules/picomatch": {
779 "version": "4.0.4",
780 "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
781 "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
782 "dev": true,
783 "license": "MIT",
784 "engines": {
785 "node": ">=12"
786 },
787 "funding": {
788 "url": "https://github.com/sponsors/jonschlinkert"
789 }
790 },
791 "node_modules/require-addon": {
792 "version": "1.2.0",
793 "resolved": "https://registry.npmjs.org/require-addon/-/require-addon-1.2.0.tgz",
794 "integrity": "sha512-VNPDZlYgIYQwWp9jMTzljx+k0ZtatKlcvOhktZ/anNPI3dQ9NXk7cq2U4iJ1wd9IrytRnYhyEocFWbkdPb+MYA==",
795 "dev": true,
796 "license": "Apache-2.0",
797 "dependencies": {
798 "bare-addon-resolve": "^1.3.0"
799 },
800 "engines": {
801 "bare": ">=1.10.0"
802 }
803 },
804 "node_modules/same-object": {
805 "version": "1.0.2",
806 "resolved": "https://registry.npmjs.org/same-object/-/same-object-1.0.2.tgz",
807 "integrity": "sha512-csHWhvUsLbIOHDM/nP+KHWM+BLPsIzWkFa8HbzaI0G7BqKXgx+7FJpKTGgLXyz5amfdY2OVBcmXTqYOMEk04og==",
808 "dev": true,
809 "license": "MIT"
810 },
811 "node_modules/stackframe": {
812 "version": "1.3.4",
813 "resolved": "https://registry.npmjs.org/stackframe/-/stackframe-1.3.4.tgz",
814 "integrity": "sha512-oeVtt7eWQS+Na6F//S4kJ2K2VbRlS9D43mAlMyVpVWovy9o+jfgH8O9agzANzaiLjclA0oYzUXEM4PurhSUChw==",
815 "dev": true,
816 "license": "MIT"
817 },
818 "node_modules/streamx": {
819 "version": "2.25.0",
820 "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.25.0.tgz",
821 "integrity": "sha512-0nQuG6jf1w+wddNEEXCF4nTg3LtufWINB5eFEN+5TNZW7KWJp6x87+JFL43vaAUPyCfH1wID+mNVyW6OHtFamg==",
822 "dev": true,
823 "license": "MIT",
824 "dependencies": {
825 "events-universal": "^1.0.0",
826 "fast-fifo": "^1.3.2",
827 "text-decoder": "^1.1.0"
828 }
829 },
830 "node_modules/teex": {
831 "version": "1.0.1",
832 "resolved": "https://registry.npmjs.org/teex/-/teex-1.0.1.tgz",
833 "integrity": "sha512-eYE6iEI62Ni1H8oIa7KlDU6uQBtqr4Eajni3wX7rpfXD8ysFx8z0+dri+KWEPWpBsxXfxu58x/0jvTVT1ekOSg==",
834 "dev": true,
835 "license": "MIT",
836 "dependencies": {
837 "streamx": "^2.12.5"
838 }
839 },
840 "node_modules/test-tmp": {
841 "version": "1.4.0",
842 "resolved": "https://registry.npmjs.org/test-tmp/-/test-tmp-1.4.0.tgz",
843 "integrity": "sha512-GVggxGg+jXqP2Wbju50JVLo+9E+nIOPPyWqgr63EbOnNItIKu1cEbJpTWAJeflnyGqXOtcMI7ijHRp88GUkfDA==",
844 "dev": true,
845 "license": "MIT",
846 "dependencies": {
847 "bare-fs": "^4.0.1",
848 "bare-os": "^3.3.0",
849 "bare-path": "^3.0.0"
850 }
851 },
852 "node_modules/text-decoder": {
853 "version": "1.2.7",
854 "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.2.7.tgz",
855 "integrity": "sha512-vlLytXkeP4xvEq2otHeJfSQIRyWxo/oZGEbXrtEEF9Hnmrdly59sUbzZ/QgyWuLYHctCHxFF4tRQZNQ9k60ExQ==",
856 "dev": true,
857 "license": "Apache-2.0",
858 "dependencies": {
859 "b4a": "^1.6.4"
860 }
861 },
862 "node_modules/tmatch": {
863 "version": "5.0.0",
864 "resolved": "https://registry.npmjs.org/tmatch/-/tmatch-5.0.0.tgz",
865 "integrity": "sha512-Ib9OtBkpHn07tXP04SlN1SYRxFgTk6wSM2EBmjjxug4u5RXPRVLkdFJSS1PmrQidaSB8Lru9nRtViQBsbxzE5Q==",
866 "dev": true,
867 "license": "ISC",
868 "engines": {
869 "node": ">=8"
870 }
871 },
872 "node_modules/v8-to-istanbul": {
873 "version": "9.3.0",
874 "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.3.0.tgz",
875 "integrity": "sha512-kiGUalWN+rgBJ/1OHZsBtU4rXZOfj/7rKQxULKlIzwzQSvMJUUNgPwJEEh7gU6xEVxC0ahoOBvN2YI8GH6FNgA==",
876 "dev": true,
877 "license": "ISC",
878 "dependencies": {
879 "@jridgewell/trace-mapping": "^0.3.12",
880 "@types/istanbul-lib-coverage": "^2.0.1",
881 "convert-source-map": "^2.0.0"
882 },
883 "engines": {
884 "node": ">=10.12.0"
885 }
886 },
887 "node_modules/which-runtime": {
888 "version": "1.3.2",
889 "resolved": "https://registry.npmjs.org/which-runtime/-/which-runtime-1.3.2.tgz",
890 "integrity": "sha512-5kwCfWml7+b2NO7KrLMhYihjRx0teKkd3yGp1Xk5Vaf2JGdSh+rgVhEALAD9c/59dP+YwJHXoEO7e8QPy7gOkw==",
891 "dev": true,
892 "license": "Apache-2.0"
893 }
894 }
895}
package.json +4 -1
……@@ -6,5 +6,8 @@
66 "bin": {
77 "pgh": "./bin/pgh.js"
88 },
9 "main": "lib/client.js"
9 "main": "lib/client.js",
10 "devDependencies": {
11 "brittle": "^3.19.1"
12 }
1013}
test/client.test.js +47 -0
……@@ -0,0 +1,47 @@
1import test from 'brittle'
2import { PghClient } from '../lib/client.js'
3
4test('PghClient — constructs with defaults', (t) => {
5 const client = new PghClient()
6 t.is(client.server, 'http://localhost:5005')
7 t.is(client.token, null)
8})
9
10test('PghClient — custom server and token', (t) => {
11 const client = new PghClient({ server: 'http://example.com:9000', token: 'abc123' })
12 t.is(client.server, 'http://example.com:9000')
13 t.is(client.token, 'abc123')
14})
15
16test('PghClient — _headers includes Bearer when token set', (t) => {
17 const client = new PghClient({ token: 'mytoken' })
18 const h = client._headers()
19 t.is(h.Authorization, 'Bearer mytoken')
20 t.is(h.Accept, 'application/json')
21})
22
23test('PghClient — _headers omits Authorization when no token', (t) => {
24 const client = new PghClient()
25 const h = client._headers()
26 t.absent(h.Authorization)
27 t.is(h.Accept, 'application/json')
28})
29
30test('PghClient — convenience methods return correct paths', (t) => {
31 // Verify the URL construction by checking the method exists
32 const client = new PghClient()
33 t.is(typeof client.status, 'function')
34 t.is(typeof client.repos, 'function')
35 t.is(typeof client.repo, 'function')
36 t.is(typeof client.issues, 'function')
37 t.is(typeof client.createIssue, 'function')
38 t.is(typeof client.updateIssue, 'function')
39 t.is(typeof client.addComment, 'function')
40 t.is(typeof client.deploy, 'function')
41 t.is(typeof client.deployConfig, 'function')
42 t.is(typeof client.deployLog, 'function')
43 t.is(typeof client.search, 'function')
44 t.is(typeof client.adminStats, 'function')
45 t.is(typeof client.adminUsers, 'function')
46 t.is(typeof client.adminTokens, 'function')
47})