/* Ċ Ġ* ĠTencent Ġis Ġplease d Ġto Ġsupport Ġthe Ġopen Ġsource Ġcommunity Ġby Ġmaking ĠB K - CI Ġ èĵĿ é² ¸ æĮģ ç»Ń éĽĨ æĪĲ å¹³åı° Ġavailable . ĠĠĊ Ġ* Ċ Ġ* ĠCopyright Ġ( C ) Ġ 2 0 1 9 ĠTH L ĠA 2 9 ĠLimited , Ġa ĠTencent Ġcompany . Ġ ĠAll Ġrights Ġreserved . Ċ Ġ* Ċ Ġ* ĠB K - CI Ġ èĵĿ é² ¸ æĮģ ç»Ń éĽĨ æĪĲ å¹³åı° Ġis Ġlicensed Ġunder Ġthe ĠMIT Ġlicense . Ċ Ġ* Ċ Ġ* ĠA Ġcopy Ġof Ġthe ĠMIT ĠLicense Ġis Ġincluded Ġin Ġthis Ġfile . Ċ Ġ* Ċ Ġ* Ċ Ġ* ĠTerms Ġof Ġthe ĠMIT ĠLicense : Ċ Ġ* Ġ------------------------------------------------ --- Ċ Ġ* ĠPermission Ġis Ġhereby Ġgranted , Ġfree Ġof Ġcharge , Ġto Ġany Ġperson Ġobtaining Ġa Ġcopy Ġof Ġthis Ġsoftware Ġand Ġassociated Ġdocumentation Ġfiles Ġ( the Ġ" Software "), Ġto Ġdeal Ġin Ġthe ĠSoftware Ġwithout Ġrestriction , Ġincluding Ġwithout Ġlimitation Ġthe Ġrights Ġto Ġuse , Ġcopy , Ġmodify , Ġmerge , Ġpublish , Ġdistribute , Ġsublicense , Ġand / or Ġsell Ġcopies Ġof Ġthe ĠSoftware , Ġand Ġto Ġpermit Ġpersons Ġto Ġwhom Ġthe ĠSoftware Ġis Ġfurnished Ġto Ġdo Ġso , Ġsubject Ġto Ġthe Ġfollowing Ġconditions : Ċ Ġ* Ċ Ġ* ĠThe Ġabove Ġcopyright Ġnotice Ġand Ġthis Ġpermission Ġnotice Ġshall Ġbe Ġincluded Ġin Ġall Ġcopies Ġor Ġsubstantial Ġportions Ġof Ġthe ĠSoftware . Ċ Ġ* Ċ Ġ* ĠTHE ĠSOFTWARE ĠIS ĠPROVIDED Ġ" AS ĠIS ", ĠWITHOUT ĠWARRANTY ĠOF ĠANY ĠKIND , ĠEXPRESS ĠOR ĠIMPLIED , ĠINCLUDING ĠBUT ĠNOT ĠLIMITED ĠTO ĠTHE ĠWARRANTIES ĠOF ĠMERCHANTABILITY , ĠFITNESS ĠFOR ĠA ĠPARTICULAR ĠPURPOSE ĠAND ĠNONINFRINGEMENT . ĠIN ĠNO ĠEVENT ĠSHALL ĠTHE ĠAUTHORS ĠOR ĠCOPYRIGHT ĠHOLDERS ĠBE ĠLIABLE ĠFOR ĠANY ĠCLAIM , ĠDAMAGES ĠOR ĠOTHER ĠLIABILITY , ĠWHETHER ĠIN ĠAN ĠACTION ĠOF ĠCONTRACT , ĠTORT ĠOR ĠOTHERWISE , ĠARISING ĠFROM , ĠOUT ĠOF ĠOR ĠIN ĠCONNECTION ĠWITH ĠTHE ĠSOFTWARE ĠOR ĠTHE ĠUSE ĠOR ĠOTHER ĠDEALINGS ĠIN ĠTHE ĠSOFTWARE . Ċ Ġ* Ċ Ġ* Ċ Ġ*/ Ċ Ċ package Ġcom . tencent . bk repo . composer . service Ċ Ċ import Ġcom . tencent . bk repo . auth . pojo . enums . Permission Action Ċ import Ġcom . tencent . bk repo . auth . pojo . enums . ResourceType Ċ import Ġcom . tencent . bk repo . common . artifact . api . Artifact File Ċ import Ġcom . tencent . bk repo . common . artifact . repository . context . Artifact Download Context Ċ import Ġcom . tencent . bk repo . common . artifact . repository . context . Artifact Search Context Ċ import Ġcom . tencent . bk repo . common . artifact . repository . context . Artifact Upload Context Ċ import Ġcom . tencent . bk repo . common . artifact . repository . context . Repository Holder Ċ import Ġcom . tencent . bk repo . common . security . permission . Permission Ċ import Ġcom . tencent . bk repo . composer . artifact . Composer Artifact Info Ċ import Ġcom . tencent . bk repo . composer . artifact . repository . Composer Repository Ċ import Ġorg . springframework . stereotype . Service Ċ Ċ @ Service Ċ class ĠComposer Service Ġ{ ĊĊĠĠĠ Ġ@ Permission ( type Ġ= ĠResource Type . REPO , Ġaction Ġ= ĠPermission Action . READ ) ĊĠĠĠ Ġfun Ġinstall Require ( composer Artifact Info : ĠComposer Artifact Info ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠArtifact Download Context () ĊĠĠĠĠĠĠĠ Ġval Ġrepository Ġ= ĠRepository Holder . getRepository ( context . repository Info . category ) ĊĠĠĠĠĠĠĠ Ġrepository . download ( context ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Permission ( type Ġ= ĠResource Type . REPO , Ġaction Ġ= ĠPermission Action . READ ) ĊĠĠĠ Ġfun Ġget Json ( composer Artifact Info : ĠComposer Artifact Info ): ĠString ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠArtifact Search Context () ĊĠĠĠĠĠĠĠ Ġval Ġrepository Ġ= ĠRepository Holder . getRepository ( context . repository Info . category ) ĊĠĠĠĠĠĠĠ Ġreturn Ġ( repository Ġas ĠComposer Repository ). get Json ( context ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Permission ( type Ġ= ĠResource Type . REPO , Ġaction Ġ= ĠPermission Action . READ ) ĊĠĠĠ Ġfun Ġpackages ( composer Artifact Info : ĠComposer Artifact Info ): ĠString ? Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠArtifact Search Context () ĊĠĠĠĠĠĠĠ Ġval Ġrepository Ġ= ĠRepository Holder . getRepository ( context . repository Info . category ) ĊĠĠĠĠĠĠĠ Ġreturn Ġ( repository Ġas ĠComposer Repository ). packages ( context ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ@ Permission ( type Ġ= ĠResource Type . REPO , Ġaction Ġ= ĠPermission Action . WRITE ) ĊĠĠĠ Ġfun Ġdeploy ( composer Artifact Info : ĠComposer Artifact Info , Ġfile : ĠArtifact File ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġcontext Ġ= ĠArtifact Upload Context ( file ) ĊĠĠĠĠĠĠĠ Ġval Ġrepository Ġ= ĠRepository Holder . getRepository ( context . repository Info . category ) ĊĠĠĠĠĠĠĠ Ġrepository . upload ( context ) ĊĠĠĠ Ġ} Ċ } Ċ