@capgo/cli 4.3.6 → 5.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/utils.ts CHANGED
@@ -382,7 +382,6 @@ interface Config {
382
382
  resetWhenUpdate?: boolean
383
383
  updateUrl?: string
384
384
  statsUrl?: string
385
- privateKey?: string
386
385
  version?: string
387
386
  directUpdate?: boolean
388
387
  periodCheckDelay?: number
@@ -393,6 +392,9 @@ interface Config {
393
392
  localSupaAnon?: string
394
393
  allowModifyUrl?: boolean
395
394
  defaultChannel?: string
395
+ channelUrl?: string
396
+ publicKey?: string
397
+ privateKey?: string
396
398
  }
397
399
  }
398
400
  server: {
@@ -403,6 +405,25 @@ interface Config {
403
405
  }
404
406
  }
405
407
 
408
+ export async function checKOldEncryption() {
409
+ const config = await getConfig()
410
+ const { extConfig } = config.app
411
+ // console.log('localConfig - ', localConfig)
412
+ // console.log('config - ', config)
413
+
414
+ const hasPrivateKeyInConfig = !!extConfig?.plugins?.CapacitorUpdater?.privateKey
415
+ const hasPublicKeyInConfig = !!extConfig?.plugins?.CapacitorUpdater?.publicKey
416
+
417
+ if (hasPrivateKeyInConfig)
418
+ p.log.warning(`You still have privateKey in the capacitor config, this is deprecated, please remove it`)
419
+ p.log.warning(`Encryption with private will be ignored`)
420
+
421
+ if (!hasPublicKeyInConfig) {
422
+ p.log.warning(`publicKey not found in capacitor config, please run npx @capgo/cli key save`)
423
+ program.error('')
424
+ }
425
+ }
426
+
406
427
  export async function updateOrCreateVersion(supabase: SupabaseClient<Database>, update: Database['public']['Tables']['app_versions']['Insert']) {
407
428
  return supabase.from('app_versions')
408
429
  .upsert(update, { onConflict: 'name,app_id' })