@capgo/cli 4.12.4 → 4.12.6
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 +15 -0
- package/dist/index.js +3 -7
- package/package.json +1 -1
- package/src/app/debug.ts +2 -3
- package/src/utils.ts +1 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
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.12.6](https://github.com/Cap-go/CLI/compare/v4.12.5...v4.12.6) (2024-07-09)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* remove error if no checksum found it's normal ([41c211a](https://github.com/Cap-go/CLI/commit/41c211a87bc6a69f6847288bf89efb598d155b50))
|
|
11
|
+
|
|
12
|
+
### [4.12.5](https://github.com/Cap-go/CLI/compare/v4.12.4...v4.12.5) (2024-07-09)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* lint ([01e0f31](https://github.com/Cap-go/CLI/commit/01e0f31b20232578e47cc886be729e7e4e4885ed))
|
|
18
|
+
* remove preprod url ([0d8672a](https://github.com/Cap-go/CLI/commit/0d8672a1534a5e88260cbbad7eb10821d07e6cba))
|
|
19
|
+
|
|
5
20
|
### [4.12.4](https://github.com/Cap-go/CLI/compare/v4.12.3...v4.12.4) (2024-07-09)
|
|
6
21
|
|
|
7
22
|
|
package/dist/index.js
CHANGED
|
@@ -86219,7 +86219,7 @@ var {
|
|
|
86219
86219
|
// package.json
|
|
86220
86220
|
var package_default = {
|
|
86221
86221
|
name: "@capgo/cli",
|
|
86222
|
-
version: "4.12.
|
|
86222
|
+
version: "4.12.6",
|
|
86223
86223
|
description: "A CLI to upload to capgo servers",
|
|
86224
86224
|
author: "github.com/riderx",
|
|
86225
86225
|
license: "Apache 2.0",
|
|
@@ -88042,9 +88042,6 @@ async function getRemoteChecksums(supabase, appId, channel2) {
|
|
|
88042
88042
|
checksum
|
|
88043
88043
|
)`).eq("name", channel2).eq("app_id", appId).single();
|
|
88044
88044
|
if (error || data === null || !data.version || !data.version.checksum) {
|
|
88045
|
-
f2.error(`Cannot get remote checksum for channel ${channel2}`);
|
|
88046
|
-
f2.error(`Error: ${error?.message}`);
|
|
88047
|
-
program.error("");
|
|
88048
88045
|
return null;
|
|
88049
88046
|
}
|
|
88050
88047
|
return data.version.checksum;
|
|
@@ -88090,7 +88087,7 @@ async function checkChecksum(supabase, appId, channel2, currentChecksum) {
|
|
|
88090
88087
|
const s = de();
|
|
88091
88088
|
s.start(`Checking bundle checksum compatibility with channel ${channel2}`);
|
|
88092
88089
|
const remoteChecksum = await getRemoteChecksums(supabase, appId, channel2);
|
|
88093
|
-
if (remoteChecksum === currentChecksum) {
|
|
88090
|
+
if (remoteChecksum && remoteChecksum === currentChecksum) {
|
|
88094
88091
|
f2.error(`Cannot upload the same bundle content.
|
|
88095
88092
|
Current bundle checksum matches remote bundle for channel ${channel2}
|
|
88096
88093
|
Did you builded your app before uploading ?`);
|
|
@@ -88368,8 +88365,7 @@ async function cancelCommand(channel2, command, orgId, snag) {
|
|
|
88368
88365
|
}
|
|
88369
88366
|
async function getStats(apikey, query, after) {
|
|
88370
88367
|
try {
|
|
88371
|
-
const
|
|
88372
|
-
const dataD = await distribution_default.post(`${defaultApiHostPreprod}/private/stats`, {
|
|
88368
|
+
const dataD = await distribution_default.post(`${defaultApiHost}/private/stats`, {
|
|
88373
88369
|
headers: {
|
|
88374
88370
|
"Content-Type": "application/json",
|
|
88375
88371
|
"capgkey": apikey
|
package/package.json
CHANGED
package/src/app/debug.ts
CHANGED
|
@@ -6,7 +6,7 @@ import type LogSnag from 'logsnag'
|
|
|
6
6
|
import type { Database } from '../types/supabase.types'
|
|
7
7
|
import { checkAppExistsAndHasPermissionOrgErr } from '../api/app'
|
|
8
8
|
import { checkLatest } from '../api/update'
|
|
9
|
-
import { OrganizationPerm, convertAppName, createSupabaseClient, findSavedKey, formatError, getConfig, getLocalConfig, getOrganizationId, useLogSnag, verifyUser } from '../utils'
|
|
9
|
+
import { OrganizationPerm, convertAppName, createSupabaseClient, defaultApiHost, findSavedKey, formatError, getConfig, getLocalConfig, getOrganizationId, useLogSnag, verifyUser } from '../utils'
|
|
10
10
|
|
|
11
11
|
function wait(ms: number) {
|
|
12
12
|
return new Promise((resolve) => {
|
|
@@ -60,9 +60,8 @@ interface LogData {
|
|
|
60
60
|
}
|
|
61
61
|
export async function getStats(apikey: string, query: QueryStats, after: string | null): Promise<LogData | null> {
|
|
62
62
|
try {
|
|
63
|
-
const defaultApiHostPreprod = 'https://api-preprod.capgo.app'
|
|
64
63
|
const dataD = await ky
|
|
65
|
-
.post(`${
|
|
64
|
+
.post(`${defaultApiHost}/private/stats`, {
|
|
66
65
|
headers: {
|
|
67
66
|
'Content-Type': 'application/json',
|
|
68
67
|
'capgkey': apikey,
|
package/src/utils.ts
CHANGED
|
@@ -948,10 +948,6 @@ export async function getRemoteChecksums(supabase: SupabaseClient<Database>, app
|
|
|
948
948
|
|| !data.version
|
|
949
949
|
|| !data.version.checksum
|
|
950
950
|
) {
|
|
951
|
-
p.log.error(`Cannot get remote checksum for channel ${channel}`)
|
|
952
|
-
p.log.error(`Error: ${error?.message}`)
|
|
953
|
-
|
|
954
|
-
program.error('')
|
|
955
951
|
return null
|
|
956
952
|
}
|
|
957
953
|
|
|
@@ -1018,7 +1014,7 @@ export async function checkChecksum(supabase: SupabaseClient<Database>, appId: s
|
|
|
1018
1014
|
s.start(`Checking bundle checksum compatibility with channel ${channel}`)
|
|
1019
1015
|
const remoteChecksum = await getRemoteChecksums(supabase, appId, channel)
|
|
1020
1016
|
|
|
1021
|
-
if (remoteChecksum === currentChecksum) {
|
|
1017
|
+
if (remoteChecksum && remoteChecksum === currentChecksum) {
|
|
1022
1018
|
// cannot upload the same bundle
|
|
1023
1019
|
p.log.error(`Cannot upload the same bundle content.\nCurrent bundle checksum matches remote bundle for channel ${channel}\nDid you builded your app before uploading ?`)
|
|
1024
1020
|
program.error('')
|