File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,6 +8,8 @@ import * as o2 from '../projects/options';
88export type DeployOptions = Required <
99 Pick <
1010 Opts & POpts ,
11+ | 'endpoint'
12+ | 'apiKey'
1113 | 'beta'
1214 | 'command'
1315 | 'configPath'
Original file line number Diff line number Diff line change @@ -118,16 +118,15 @@ const redirectTov2 = async (
118118
119119 // default endpoint to one from openfn.yaml
120120 const v2config = yamlToJson ( await fs . readFile ( v2ConfigPath , 'utf-8' ) ) ;
121- if ( ! config . endpoint && v2config ?. project ?. endpoint ) {
122- config . endpoint = v2config . project . endpoint ;
123- }
121+ const endpoint =
122+ options . endpoint ?? v2config ?. project ?. endpoint ?? config . endpoint ;
124123
125124 return beta . handler (
126125 {
127126 ...options ,
128127 force : true ,
129- endpoint : config . endpoint ,
130- apiKey : config . apiKey ?? undefined ,
128+ endpoint,
129+ apiKey : options . apiKey ?? config . apiKey ?? undefined ,
131130 } ,
132131 logger
133132 ) ;
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ const syncProjects = async (
148148 // TODO should we prefer endpoint over alias?
149149 // maybe if it's explicitly passed?
150150 const endpoint = trackedProject . openfn ?. endpoint ?? config . endpoint ;
151-
151+ console . log ( { config } ) ;
152152 const { data } = await fetchProject (
153153 endpoint ,
154154 config . apiKey ,
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ export async function fetchProject(
121121) : Promise < { data : Provisioner . Project | null } > {
122122 const url = getLightningUrl ( endpoint , projectId , snapshots ) ;
123123 logger ?. info ( `Checking ${ url } for existing project` ) ;
124-
124+ console . log ( { apiKey } ) ;
125125 try {
126126 const response = await fetch ( url , {
127127 headers : {
You can’t perform that action at this time.
0 commit comments