44const { CloudsmithAPI } = require ( "./cloudsmithAPI" ) ;
55const { CredentialManager } = require ( "./credentialManager" ) ;
66const { SearchQueryBuilder } = require ( "./searchQueryBuilder" ) ;
7- < << << << HEAD
8-
9- const SUPPORTED_UPSTREAM_FORMATS = [
10- << << << < HEAD
11- "deb" , "docker" , "maven" , "npm" , "python" ,
12- "ruby" , "dart" , "helm" , "nuget" , "cargo" ,
13- "rpm" , "cran" , "swift" , "go" , "hex" ,
14- "composer" , "conda" , "conan" , "p2" , "terraform" ,
15- "raw" ,
16- ] ;
17- const UPSTREAM_FETCH_BATCH_SIZE = 5 ;
18- const UPSTREAM_CACHE_TTL_MS = 10 * 60 * 1000 ; // 10 minutes
19- const REPOSITORY_UPSTREAM_CACHE_KEY_PREFIX = "cloudsmith-upstreams:v2" ;
20- = === ===
21- "alpine" ,
22- "cargo" ,
23- "cocoapods" ,
24- "composer" ,
25- "conda" ,
26- "cran" ,
27- "dart" ,
28- "deb" ,
29- "docker" ,
30- "generic" ,
31- "go" ,
32- "helm" ,
33- "hex" ,
34- "huggingface" ,
35- "luarocks" ,
36- "maven" ,
37- "npm" ,
38- "nuget" ,
39- "python" ,
40- "rpm" ,
41- "ruby" ,
42- "swift" ,
43- "vagrant" ,
44- ] ;
45- === === =
467const {
478 getSupportedUpstreamFormats,
489 SUPPORTED_UPSTREAM_FORMATS ,
4910} = require ( "./upstreamFormats" ) ;
50- > >>> >>> 50 c8bac ( fix : consolidate upstream fetch and fix WebView / Terraform export consumers )
5111const UPSTREAM_CACHE_TTL_MS = 10 * 60 * 1000 ;
5212const UPSTREAM_FETCH_BATCH_SIZE = 5 ;
13+ const REPOSITORY_UPSTREAM_CACHE_KEY_PREFIX = "cloudsmith-upstreams:v2" ;
5314const BENIGN_UPSTREAM_FORMAT_STATUS_CODES = new Set ( [ 400 , 404 , 405 , 422 ] ) ;
5415
5516function isCacheObjectRecord ( value ) {
@@ -283,7 +244,6 @@ async function fetchFormatUpstreams(api, workspace, repo, format, apiKey, signal
283244 return { format, status : "failed" , error : message , upstreams : [ ] } ;
284245 }
285246}
286- >>> > >>> 52 ddc2b ( feat : export repository as Terraform )
287247
288248class UpstreamChecker {
289249 constructor ( context ) {
@@ -905,13 +865,6 @@ class UpstreamChecker {
905865 }
906866}
907867
908- << < << << HEAD
909- module . exports = {
910- UpstreamChecker ,
911- SUPPORTED_UPSTREAM_FORMATS ,
912- UPSTREAM_FETCH_BATCH_SIZE ,
913- UPSTREAM_CACHE_TTL_MS ,
914- = === ===
915868async function getAllUpstreamData ( context , workspace , repo , options = { } ) {
916869 const checker = new UpstreamChecker ( context ) ;
917870 return checker . getAllUpstreamData ( workspace , repo , options ) ;
@@ -928,5 +881,6 @@ module.exports = {
928881 isBenignUpstreamFormatError,
929882 SUPPORTED_UPSTREAM_FORMATS ,
930883 UpstreamChecker,
931- > >>> >>> 52 ddc2b ( feat : export repository as Terraform )
884+ UPSTREAM_FETCH_BATCH_SIZE ,
885+ UPSTREAM_CACHE_TTL_MS ,
932886} ;
0 commit comments