@@ -30,12 +30,13 @@ function run(urlStr, body, cliOpts) {
30
30
const apiUrl = urlStr . replace ( / \/ $ / , '' )
31
31
url = new URL ( apiUrl ) ;
32
32
cfg = loadConfig ( url , configFile )
33
- if ( cfg ?. [ "docs" ] !== undefined ) {
34
- console . log ( `Docs: ${ cfg ?. [ "docs" ] } ` )
35
- }
36
33
path = buildPath ( url )
37
- console . log ( `Request: (${ opts . method } ) ${ url } ` )
38
- console . log ( `Response: ${ res . status } ${ res . statusText } ` )
34
+
35
+ console . log ( `API:` )
36
+ if ( cfg ?. [ "docs" ] !== undefined ) console . log ( ` Docs: ${ cfg ?. [ "docs" ] } ` )
37
+ if ( path . path . pathFormat ) console . log ( ` Format: ${ path . path . pathFormat } ` )
38
+ console . log ( ` Request: ${ opts . method } ${ url } ` )
39
+ console . log ( ` Response: ${ res . status } ${ res . statusText } ` )
39
40
40
41
comment = buildComment ( url , path , opts . method , res )
41
42
return res . json ( )
@@ -61,8 +62,8 @@ function write(json, path, content) {
61
62
} ) ;
62
63
console . log ( )
63
64
console . log ( "Saved:" )
64
- console . log ( ` ${ path . jsonFilePath } ` )
65
- console . log ( ` ${ path . goFilePath } ` )
65
+ console . log ( ` Struct: ${ path . goFilePath } ` )
66
+ console . log ( ` Payload: ${ path . jsonFilePath } ` )
66
67
}
67
68
68
69
function buildOpts ( body , cliOpts ) {
@@ -112,12 +113,12 @@ function buildComment(url, path, method, res) {
112
113
let comment = ""
113
114
const cfg = loadConfig ( url , configFile )
114
115
if ( cfg ?. [ "docs" ] !== undefined ) {
115
- comment += `\n// Docs: ${ cfg ?. [ "docs" ] } `
116
+ comment += `\n// Docs: ${ cfg ?. [ "docs" ] } `
116
117
}
117
118
if ( path . path . pathFormat ) {
118
- comment += `\n// Format: ${ path . path . pathFormat } `
119
+ comment += `\n// Format: ${ path . path . pathFormat } `
119
120
}
120
- comment += `\n// Request: ( ${ method } ) ${ url . href } `
121
+ comment += `\n// Request: ${ method } ${ url . href } `
121
122
comment += `\n// Response: ${ res . status } ${ res . statusText } `
122
123
return `${ comment } \n//\n`
123
124
}
0 commit comments