@@ -201,13 +201,44 @@ export function printConfigInfo(
201
201
}
202
202
}
203
203
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
+
204
235
export function printDeployedResources (
205
236
config : DeployLocalProjectConfig ,
206
237
result : DeployResult ,
207
238
outputFormat : OutputFormat
208
239
) {
209
240
if ( outputFormat === 'json' ) {
210
- writeJSONOutput ( result ) ;
241
+ printJsonDeployedResources ( config , result ) ;
211
242
return ;
212
243
}
213
244
if ( shouldPrettyPrint ) {
0 commit comments