@@ -124,6 +124,11 @@ function matchNpmRegistry(urlString) {
124124 return json ( { error : 'Not found' } , 404 )
125125 }
126126
127+ // Attestations endpoint - return empty attestations
128+ if ( pathname . startsWith ( '/-/npm/v1/attestations/' ) ) {
129+ return json ( { attestations : [ ] } )
130+ }
131+
127132 // Packument
128133 if ( ! pathname . startsWith ( '/-/' ) ) {
129134 let packageName = pathname . slice ( 1 )
@@ -440,6 +445,52 @@ function matchGravatarApi(_urlString) {
440445 return { status : 404 , contentType : 'text/plain' , body : 'Not found' }
441446}
442447
448+ /**
449+ * @param {string } urlString
450+ * @returns {MockResponse | null }
451+ */
452+ function matchUnghApi ( urlString ) {
453+ const url = new URL ( urlString )
454+
455+ const repoMatch = url . pathname . match ( / ^ \/ r e p o s \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) $ / )
456+ if ( repoMatch && repoMatch [ 1 ] && repoMatch [ 2 ] ) {
457+ return json ( {
458+ repo : {
459+ description : `${ repoMatch [ 1 ] } /${ repoMatch [ 2 ] } - mock repo description` ,
460+ stars : 1000 ,
461+ forks : 100 ,
462+ watchers : 50 ,
463+ defaultBranch : 'main' ,
464+ } ,
465+ } )
466+ }
467+
468+ return json ( null )
469+ }
470+
471+ /**
472+ * @param {string } urlString
473+ * @returns {MockResponse | null }
474+ */
475+ function matchConstellationApi ( urlString ) {
476+ const url = new URL ( urlString )
477+
478+ if ( url . pathname === '/links/distinct-dids' ) {
479+ return json ( { total : 0 , linking_dids : [ ] , cursor : undefined } )
480+ }
481+
482+ if ( url . pathname === '/links/all' ) {
483+ return json ( { links : { } } )
484+ }
485+
486+ if ( url . pathname === '/xrpc/blue.microcosm.links.getBacklinks' ) {
487+ return json ( { total : 0 , records : [ ] , cursor : undefined } )
488+ }
489+
490+ // Unknown constellation endpoint - return empty
491+ return json ( null )
492+ }
493+
443494/**
444495 * @param {string } urlString
445496 * @returns {MockResponse | null }
@@ -454,6 +505,18 @@ function matchGitHubApi(urlString) {
454505 return json ( fixture || [ ] )
455506 }
456507
508+ // Commits endpoint
509+ const commitsMatch = pathname . match ( / ^ \/ r e p o s \/ ( [ ^ / ] + ) \/ ( [ ^ / ] + ) \/ c o m m i t s $ / )
510+ if ( commitsMatch ) {
511+ return json ( [ { sha : 'mock-commit' } ] )
512+ }
513+
514+ // Search endpoint (issues, commits, etc.)
515+ const searchMatch = pathname . match ( / ^ \/ s e a r c h \/ ( .+ ) $ / )
516+ if ( searchMatch ) {
517+ return json ( { total_count : 0 , incomplete_results : false , items : [ ] } )
518+ }
519+
457520 return null
458521}
459522
@@ -480,6 +543,12 @@ const routes = [
480543 } ,
481544 { name : 'Gravatar API' , pattern : 'https://www.gravatar.com/**' , match : matchGravatarApi } ,
482545 { name : 'GitHub API' , pattern : 'https://api.github.com/**' , match : matchGitHubApi } ,
546+ { name : 'UNGH API' , pattern : 'https://ungh.cc/**' , match : matchUnghApi } ,
547+ {
548+ name : 'Constellation API' ,
549+ pattern : 'https://constellation.microcosm.blue/**' ,
550+ match : matchConstellationApi ,
551+ } ,
483552]
484553
485554/**
0 commit comments