@@ -201,13 +201,44 @@ export function printConfigInfo(
201201 }
202202}
203203
204+ export function printJsonDeployedResources (
205+ config : DeployLocalProjectConfig ,
206+ result : DeployResult
207+ ) {
208+ function formatResource ( resource : FunctionResource | AssetResource ) {
209+ return {
210+ access : resource . access ,
211+ path : resource . path ,
212+ url : `https://${ result . domain } ${ resource . path } ` ,
213+ } ;
214+ }
215+
216+ const data = {
217+ domain : result . domain ,
218+ serviceName : result . serviceName ,
219+ serviceSid : result . serviceSid ,
220+ environmentSuffix : config . functionsEnv ,
221+ environmentSid : result . environmentSid ,
222+ buildSid : result . buildSid ,
223+ runtime : result . runtime ,
224+ viewLiveLogs : getTwilioConsoleDeploymentUrl (
225+ result . serviceSid ,
226+ result . environmentSid
227+ ) ,
228+ functions : result . functionResources . sort ( sortByAccess ) . map ( formatResource ) ,
229+ assets : result . assetResources . sort ( sortByAccess ) . map ( formatResource ) ,
230+ } ;
231+
232+ writeJSONOutput ( data ) ;
233+ }
234+
204235export function printDeployedResources (
205236 config : DeployLocalProjectConfig ,
206237 result : DeployResult ,
207238 outputFormat : OutputFormat
208239) {
209240 if ( outputFormat === 'json' ) {
210- writeJSONOutput ( result ) ;
241+ printJsonDeployedResources ( config , result ) ;
211242 return ;
212243 }
213244 if ( shouldPrettyPrint ) {
0 commit comments