@capgo/cli 4.2.8 → 4.2.11

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/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [4.2.11](https://github.com/Cap-go/CLI/compare/v4.2.10...v4.2.11) (2024-03-25)
6
+
7
+ ### [4.2.10](https://github.com/Cap-go/CLI/compare/v4.2.9...v4.2.10) (2024-03-25)
8
+
9
+ ### [4.2.9](https://github.com/Cap-go/CLI/compare/v4.2.8...v4.2.9) (2024-03-23)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * empty list issue ([dac8617](https://github.com/Cap-go/CLI/commit/dac86177c55c71bd3ad3bbbca7833ba30d461c33))
15
+
5
16
  ### [4.2.8](https://github.com/Cap-go/CLI/compare/v4.2.7...v4.2.8) (2024-03-23)
6
17
 
7
18
  ### [4.2.7](https://github.com/Cap-go/CLI/compare/v4.2.6...v4.2.7) (2024-03-23)
package/dist/index.js CHANGED
@@ -61137,7 +61137,7 @@ var {
61137
61137
  // package.json
61138
61138
  var package_default = {
61139
61139
  name: "@capgo/cli",
61140
- version: "4.2.8",
61140
+ version: "4.2.11",
61141
61141
  description: "A CLI to upload to capgo servers",
61142
61142
  main: "dist/index.js",
61143
61143
  bin: {
@@ -62621,8 +62621,8 @@ async function verifyUser(supabase, apikey, keymod = ["all"]) {
62621
62621
  }
62622
62622
  return userId;
62623
62623
  }
62624
- async function requireUpdateMetadata(supabase, channel2) {
62625
- const { data, error } = await supabase.from("channels").select("disableAutoUpdate").eq("name", channel2).limit(1);
62624
+ async function requireUpdateMetadata(supabase, channel2, appId) {
62625
+ const { data, error } = await supabase.from("channels").select("disableAutoUpdate").eq("name", channel2).eq("app_id", appId).limit(1);
62626
62626
  if (error) {
62627
62627
  f2.error(`Cannot check if disableAutoUpdate is required ${formatError(error)}`);
62628
62628
  program.error("");
@@ -63493,7 +63493,7 @@ async function uploadBundle(appid, options, shouldExit = true) {
63493
63493
  const userId = await verifyUser(supabase, options.apikey, ["write", "all", "upload"]);
63494
63494
  const permissions = await checkAppExistsAndHasPermissionOrgErr(supabase, options.apikey, appid, 2 /* upload */);
63495
63495
  await checkPlanValid(supabase, userId, options.apikey, appid, true);
63496
- const updateMetadataRequired = await requireUpdateMetadata(supabase, channel2);
63496
+ const updateMetadataRequired = await requireUpdateMetadata(supabase, channel2, appid);
63497
63497
  const { data: channelData, error: channelError } = await supabase.from("channels").select("version ( minUpdateVersion, native_packages )").eq("name", channel2).eq("app_id", appid).single();
63498
63498
  let localDependencies = void 0;
63499
63499
  let finalCompatibility;
@@ -64346,6 +64346,10 @@ async function deleteSpecificVersion(supabase, appid, _userId, bundle2) {
64346
64346
  await deleteAppVersion(supabase, appid, bundle2);
64347
64347
  }
64348
64348
  function displayBundles(data) {
64349
+ if (!data.length) {
64350
+ f2.error("No bundle found");
64351
+ process.exit(1);
64352
+ }
64349
64353
  const t = new import_console_table_printer2.Table({
64350
64354
  title: "Bundles",
64351
64355
  charLength: { "\u274C": 2, "\u2705": 2 }
@@ -64756,6 +64760,10 @@ async function currentBundle(channel2, appId, options) {
64756
64760
  var import_node_process25 = __toESM(require("node:process"));
64757
64761
  var import_console_table_printer3 = __toESM(require_dist18());
64758
64762
  function displayApp(data) {
64763
+ if (!data.length) {
64764
+ f2.error("No apps found");
64765
+ import_node_process25.default.exit(1);
64766
+ }
64759
64767
  const t = new import_console_table_printer3.Table({
64760
64768
  title: "Apps",
64761
64769
  charLength: { "\u274C": 2, "\u2705": 2 }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capgo/cli",
3
- "version": "4.2.8",
3
+ "version": "4.2.11",
4
4
  "description": "A CLI to upload to capgo servers",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -33,6 +33,11 @@ export async function deleteSpecificVersion(supabase: SupabaseClient<Database>,
33
33
  }
34
34
 
35
35
  export function displayBundles(data: (Database['public']['Tables']['app_versions']['Row'] & { keep?: string })[]) {
36
+ if (!data.length) {
37
+ p.log.error('No bundle found')
38
+ // eslint-disable-next-line node/prefer-global/process
39
+ process.exit(1)
40
+ }
36
41
  const t = new Table({
37
42
  title: 'Bundles',
38
43
  charLength: { '❌': 2, '✅': 2 },
package/src/app/list.ts CHANGED
@@ -9,6 +9,10 @@ import { createSupabaseClient, findSavedKey, getHumanDate, verifyUser } from '..
9
9
  import { checkLatest } from '../api/update'
10
10
 
11
11
  function displayApp(data: Database['public']['Tables']['apps']['Row'][]) {
12
+ if (!data.length) {
13
+ p.log.error('No apps found')
14
+ process.exit(1)
15
+ }
12
16
  const t = new Table({
13
17
  title: 'Apps',
14
18
  charLength: { '❌': 2, '✅': 2 },
@@ -121,7 +121,7 @@ export async function uploadBundle(appid: string, options: Options, shouldExit =
121
121
  const permissions = await checkAppExistsAndHasPermissionOrgErr(supabase, options.apikey, appid, OrganizationPerm.upload)
122
122
  await checkPlanValid(supabase, userId, options.apikey, appid, true)
123
123
 
124
- const updateMetadataRequired = await requireUpdateMetadata(supabase, channel)
124
+ const updateMetadataRequired = await requireUpdateMetadata(supabase, channel, appid)
125
125
 
126
126
  // Check compatibility here
127
127
  const { data: channelData, error: channelError } = await supabase
package/src/utils.ts CHANGED
@@ -498,11 +498,12 @@ export async function verifyUser(supabase: SupabaseClient<Database>, apikey: str
498
498
  return userId
499
499
  }
500
500
 
501
- export async function requireUpdateMetadata(supabase: SupabaseClient<Database>, channel: string): Promise<boolean> {
501
+ export async function requireUpdateMetadata(supabase: SupabaseClient<Database>, channel: string, appId: string): Promise<boolean> {
502
502
  const { data, error } = await supabase
503
503
  .from('channels')
504
504
  .select('disableAutoUpdate')
505
505
  .eq('name', channel)
506
+ .eq('app_id', appId)
506
507
  .limit(1)
507
508
 
508
509
  if (error) {