@capgo/cli 4.4.4 โ 4.5.0
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/.vscode/settings.json +43 -2
- package/CHANGELOG.md +14 -0
- package/bun.lockb +0 -0
- package/dist/index.js +30781 -30057
- package/eslint.config.js +8 -1
- package/package.json +29 -37
- package/src/api/update.ts +2 -1
- package/src/bundle/upload.ts +4 -8
- package/src/channel/add.ts +3 -2
- package/src/channel/set.ts +1 -0
- package/src/types/supabase.types.ts +697 -324
- package/src/utils.ts +0 -18
- package/.eslintignore +0 -4
package/eslint.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capgo/cli",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.5.0",
|
|
4
4
|
"description": "A CLI to upload to capgo servers",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
},
|
|
5
|
+
"author": "github.com/riderx",
|
|
6
|
+
"license": "Apache 2.0",
|
|
7
|
+
"homepage": "https://github.com/Cap-go/CLIl#readme",
|
|
9
8
|
"repository": {
|
|
10
9
|
"type": "git",
|
|
11
10
|
"url": "git+https://github.com/Cap-go/CLI.git"
|
|
@@ -13,11 +12,6 @@
|
|
|
13
12
|
"bugs": {
|
|
14
13
|
"url": "https://github.com/Cap-go/CLI/issues"
|
|
15
14
|
},
|
|
16
|
-
"homepage": "https://github.com/Cap-go/CLIl#readme",
|
|
17
|
-
"engines": {
|
|
18
|
-
"npm": ">=8.0.0",
|
|
19
|
-
"node": ">=18.0.0"
|
|
20
|
-
},
|
|
21
15
|
"keywords": [
|
|
22
16
|
"appflow alternative",
|
|
23
17
|
"ionic",
|
|
@@ -29,6 +23,14 @@
|
|
|
29
23
|
"upload",
|
|
30
24
|
"capgo-cli"
|
|
31
25
|
],
|
|
26
|
+
"main": "dist/index.js",
|
|
27
|
+
"bin": {
|
|
28
|
+
"capgo": "dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"npm": ">=8.0.0",
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
32
34
|
"scripts": {
|
|
33
35
|
"build": "node build.mjs",
|
|
34
36
|
"dev": "NODE_ENV=development node build.mjs",
|
|
@@ -40,58 +42,48 @@
|
|
|
40
42
|
"test_rls": "ts-node ./test/test_headers_rls.ts",
|
|
41
43
|
"lint": "eslint \"src/**/*.ts\" --fix"
|
|
42
44
|
},
|
|
43
|
-
"author": "github.com/riderx",
|
|
44
|
-
"license": "Apache 2.0",
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@aws-sdk/client-s3": "^3.
|
|
47
|
-
"@capacitor/cli": "
|
|
46
|
+
"@aws-sdk/client-s3": "^3.563.0",
|
|
47
|
+
"@capacitor/cli": "6.0.0",
|
|
48
48
|
"@capgo/find-package-manager": "0.0.11",
|
|
49
49
|
"@clack/prompts": "^0.7.0",
|
|
50
|
-
"@supabase/supabase-js": "^2.
|
|
50
|
+
"@supabase/supabase-js": "^2.42.7",
|
|
51
51
|
"@tomasklaen/checksum": "^1.1.0",
|
|
52
52
|
"@trufflesuite/spinnies": "^0.1.1",
|
|
53
|
-
"adm-zip": "^0.5.
|
|
53
|
+
"adm-zip": "^0.5.12",
|
|
54
54
|
"ci-info": "^4.0.0",
|
|
55
55
|
"commander": "12.0.0",
|
|
56
56
|
"console-table-printer": "^2.12.0",
|
|
57
57
|
"get-latest-version": "^5.1.0",
|
|
58
|
-
"ky": "^1.2.
|
|
58
|
+
"ky": "^1.2.4",
|
|
59
59
|
"logsnag": "1.0.0",
|
|
60
|
-
"mime": "^4.0.
|
|
60
|
+
"mime": "^4.0.3",
|
|
61
61
|
"node-dir": "^0.1.17",
|
|
62
|
-
"open": "^10.0
|
|
62
|
+
"open": "^10.1.0",
|
|
63
63
|
"prettyjson": "^1.2.5",
|
|
64
64
|
"prompt-sync": "^4.2.0",
|
|
65
|
-
"qrcode": "^1.5.3",
|
|
66
65
|
"semver": "^7.6.0"
|
|
67
66
|
},
|
|
68
67
|
"devDependencies": {
|
|
69
|
-
"@antfu/eslint-config": "^2.
|
|
68
|
+
"@antfu/eslint-config": "^2.16.1",
|
|
70
69
|
"@types/adm-zip": "0.5.5",
|
|
71
70
|
"@types/mime": "^3.0.4",
|
|
72
|
-
"@types/node": "^20.
|
|
71
|
+
"@types/node": "^20.12.7",
|
|
73
72
|
"@types/node-dir": "^0.0.37",
|
|
74
73
|
"@types/npmcli__ci-detect": "^2.0.3",
|
|
75
74
|
"@types/prettyjson": "^0.0.33",
|
|
76
75
|
"@types/prompt-sync": "^4.2.3",
|
|
77
|
-
"@types/
|
|
78
|
-
"@
|
|
79
|
-
"@typescript-eslint/
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"eslint-config-prettier": "^9.1.0",
|
|
85
|
-
"eslint-import-resolver-typescript": "3.6.1",
|
|
86
|
-
"eslint-plugin-import": "2.29.1",
|
|
87
|
-
"eslint-plugin-prettier": "^5.1.3",
|
|
88
|
-
"git-format-staged": "3.0.0",
|
|
89
|
-
"husky": "^9.0.10",
|
|
76
|
+
"@types/semver": "^7.5.8",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "7.7.1",
|
|
78
|
+
"@typescript-eslint/parser": "7.7.1",
|
|
79
|
+
"esbuild": "^0.20.2",
|
|
80
|
+
"eslint": "9.1.1",
|
|
81
|
+
"git-format-staged": "3.1.1",
|
|
82
|
+
"husky": "^9.0.11",
|
|
90
83
|
"pkg": "5.8.1",
|
|
91
|
-
"prettier": "3.2.5",
|
|
92
84
|
"ts-loader": "^9.5.1",
|
|
93
85
|
"ts-node": "^10.9.2",
|
|
94
86
|
"tsconfig-paths": "4.2.0",
|
|
95
|
-
"typescript": "5.
|
|
87
|
+
"typescript": "5.4.5"
|
|
96
88
|
}
|
|
97
89
|
}
|
package/src/api/update.ts
CHANGED
|
@@ -4,9 +4,10 @@ import pack from '../../package.json'
|
|
|
4
4
|
|
|
5
5
|
export async function checkLatest() {
|
|
6
6
|
const latest = await getLatest('@capgo/cli')
|
|
7
|
+
const major = latest?.split('.')[0]
|
|
7
8
|
if (latest !== pack.version) {
|
|
8
9
|
p.log.warning(`๐จ You are using @capgo/cli@${pack.version} it's not the latest version.
|
|
9
|
-
Please use @capgo/cli@${latest}" or @capgo/cli
|
|
10
|
+
Please use @capgo/cli@${latest}" or @capgo/cli@${major} to keep up to date with the latest features and bug fixes.`,
|
|
10
11
|
)
|
|
11
12
|
}
|
|
12
13
|
}
|
package/src/bundle/upload.ts
CHANGED
|
@@ -19,7 +19,6 @@ import type {
|
|
|
19
19
|
OptionsBase,
|
|
20
20
|
} from '../utils'
|
|
21
21
|
import {
|
|
22
|
-
EMPTY_UUID,
|
|
23
22
|
OrganizationPerm,
|
|
24
23
|
baseKeyPub,
|
|
25
24
|
checkCompatibility,
|
|
@@ -29,7 +28,6 @@ import {
|
|
|
29
28
|
deletedFailedVersion,
|
|
30
29
|
findSavedKey,
|
|
31
30
|
formatError,
|
|
32
|
-
getAppOwner,
|
|
33
31
|
getConfig,
|
|
34
32
|
getLocalConfig,
|
|
35
33
|
getLocalDepenencies,
|
|
@@ -358,8 +356,6 @@ It will be also visible in your dashboard\n`)
|
|
|
358
356
|
|
|
359
357
|
const nativePackages = (hashedLocalDependencies.size > 0 || !options.ignoreMetadataCheck) ? Array.from(hashedLocalDependencies, ([name, value]) => ({ name, version: value.version })) : undefined
|
|
360
358
|
|
|
361
|
-
const appOwner = await getAppOwner(supabase, appid)
|
|
362
|
-
|
|
363
359
|
const versionData = {
|
|
364
360
|
// bucket_id: external ? undefined : fileName,
|
|
365
361
|
name: bundle,
|
|
@@ -369,7 +365,7 @@ It will be also visible in your dashboard\n`)
|
|
|
369
365
|
storage_provider: external ? 'external' : 'r2-direct',
|
|
370
366
|
minUpdateVersion,
|
|
371
367
|
native_packages: nativePackages,
|
|
372
|
-
owner_org:
|
|
368
|
+
owner_org: orgId,
|
|
373
369
|
user_id: userId,
|
|
374
370
|
checksum,
|
|
375
371
|
}
|
|
@@ -415,7 +411,7 @@ It will be also visible in your dashboard\n`)
|
|
|
415
411
|
}
|
|
416
412
|
spinner.stop('Bundle Uploaded ๐ช')
|
|
417
413
|
}
|
|
418
|
-
else if (useS3 && zipped) {
|
|
414
|
+
else if (useS3 && zipped && s3Client) {
|
|
419
415
|
const spinner = p.spinner()
|
|
420
416
|
spinner.start(`Uploading Bundle`)
|
|
421
417
|
|
|
@@ -450,9 +446,9 @@ It will be also visible in your dashboard\n`)
|
|
|
450
446
|
const { error: dbError3, data } = await updateOrCreateChannel(supabase, {
|
|
451
447
|
name: channel,
|
|
452
448
|
app_id: appid,
|
|
453
|
-
created_by:
|
|
449
|
+
created_by: userId,
|
|
454
450
|
version: versionId,
|
|
455
|
-
owner_org:
|
|
451
|
+
owner_org: orgId,
|
|
456
452
|
})
|
|
457
453
|
if (dbError3) {
|
|
458
454
|
p.log.error(`Cannot set channel, the upload key is not allowed to do that, use the "all" for this. ${formatError(dbError3)}`)
|
package/src/channel/add.ts
CHANGED
|
@@ -4,7 +4,7 @@ import * as p from '@clack/prompts'
|
|
|
4
4
|
import { checkAppExistsAndHasPermissionOrgErr } from '../api/app'
|
|
5
5
|
import { createChannel, findUnknownVersion } from '../api/channels'
|
|
6
6
|
import type { OptionsBase } from '../utils'
|
|
7
|
-
import {
|
|
7
|
+
import { OrganizationPerm, createSupabaseClient, findSavedKey, getConfig, getOrganizationId, useLogSnag, verifyUser } from '../utils'
|
|
8
8
|
|
|
9
9
|
interface Options extends OptionsBase {
|
|
10
10
|
default?: boolean
|
|
@@ -34,6 +34,7 @@ export async function addChannel(channelId: string, appId: string, options: Opti
|
|
|
34
34
|
p.log.info(`Creating channel ${appId}#${channelId} to Capgo`)
|
|
35
35
|
try {
|
|
36
36
|
const data = await findUnknownVersion(supabase, appId)
|
|
37
|
+
const orgId = await getOrganizationId(supabase, appId)
|
|
37
38
|
if (!data) {
|
|
38
39
|
p.log.error(`Cannot find default version for channel creation, please contact Capgo support ๐คจ`)
|
|
39
40
|
program.error('')
|
|
@@ -42,7 +43,7 @@ export async function addChannel(channelId: string, appId: string, options: Opti
|
|
|
42
43
|
name: channelId,
|
|
43
44
|
app_id: appId,
|
|
44
45
|
version: data.id,
|
|
45
|
-
owner_org:
|
|
46
|
+
owner_org: orgId,
|
|
46
47
|
})
|
|
47
48
|
p.log.success(`Channel created โ
`)
|
|
48
49
|
await snag.track({
|
package/src/channel/set.ts
CHANGED
|
@@ -83,6 +83,7 @@ export async function setChannel(channel: string, appId: string, options: Option
|
|
|
83
83
|
created_by: userId,
|
|
84
84
|
app_id: appId,
|
|
85
85
|
name: channel,
|
|
86
|
+
owner_org: orgId,
|
|
86
87
|
version: undefined as any,
|
|
87
88
|
}
|
|
88
89
|
const bundleVersion = latest ? config?.app?.package?.version : bundle
|