@@ -32,14 +32,15 @@ const defaultOptions: AddApiOptions = {
32
32
testingWithLatestCodebase : false
33
33
} ;
34
34
35
- export function addApiWithoutSchema ( cwd : string , opts : Partial < AddApiOptions > = { } ) {
35
+ export function addApiWithoutSchema ( cwd : string , opts : Partial < AddApiOptions & { apiKeyExpirationDays : number } > = { } ) {
36
36
const options = _ . assign ( defaultOptions , opts ) ;
37
37
return new Promise < void > ( ( resolve , reject ) => {
38
- spawn ( getCLIPath ( ) , [ 'add' , 'api' ] , { cwd, stripColors : true } )
38
+ spawn ( getCLIPath ( options . testingWithLatestCodebase ) , [ 'add' , 'api' ] , { cwd, stripColors : true } )
39
39
. wait ( 'Please select from one of the below mentioned services:' )
40
40
. sendCarriageReturn ( )
41
41
. wait ( / .* H e r e i s t h e G r a p h Q L A P I t h a t w e w i l l c r e a t e . S e l e c t a s e t t i n g t o e d i t o r c o n t i n u e .* / )
42
42
. sendKeyUp ( 3 )
43
+ . sendCarriageReturn ( )
43
44
. wait ( 'Provide API name:' )
44
45
. sendLine ( options . apiName )
45
46
. wait ( / .* H e r e i s t h e G r a p h Q L A P I t h a t w e w i l l c r e a t e . S e l e c t a s e t t i n g t o e d i t o r c o n t i n u e .* / )
@@ -48,10 +49,9 @@ export function addApiWithoutSchema(cwd: string, opts: Partial<AddApiOptions> =
48
49
. sendCarriageReturn ( )
49
50
. wait ( 'Do you want to edit the schema now?' )
50
51
. sendConfirmNo ( )
51
- . wait ( 'Successfully added resource collectionapi locally' )
52
- // .wait(
53
- // '"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud',
54
- // )
52
+ . wait (
53
+ '"amplify publish" will build all your local backend and frontend resources (if you have hosting category added) and provision it in the cloud' ,
54
+ )
55
55
. run ( ( err : Error ) => {
56
56
if ( ! err ) {
57
57
resolve ( ) ;
0 commit comments