@capgo/cli 4.13.2 → 4.13.3
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/dist/index.js +1 -1
- package/package.json +1 -1
- package/.github/FUNDING.yml +0 -1
- package/.github/workflows/autofix.yml +0 -25
- package/.github/workflows/build.yml +0 -46
- package/.github/workflows/bump_version.yml +0 -56
- package/.github/workflows/check_posix_paths.yml +0 -229
- package/.github/workflows/test.yml +0 -30
- package/.prettierignore +0 -6
- package/.vscode/launch.json +0 -23
- package/.vscode/settings.json +0 -46
- package/.vscode/tasks.json +0 -42
- package/CHANGELOG.md +0 -3392
- package/build.mjs +0 -21
- package/bun.lockb +0 -0
- package/bunfig.toml +0 -2
- package/capacitor.config.ts +0 -33
- package/crypto_explained.png +0 -0
- package/eslint.config.js +0 -10
- package/renovate.json +0 -23
- package/src/api/app.ts +0 -55
- package/src/api/channels.ts +0 -163
- package/src/api/crypto.ts +0 -116
- package/src/api/devices_override.ts +0 -41
- package/src/api/update.ts +0 -13
- package/src/api/versions.ts +0 -101
- package/src/app/add.ts +0 -157
- package/src/app/debug.ts +0 -258
- package/src/app/delete.ts +0 -110
- package/src/app/info.ts +0 -99
- package/src/app/list.ts +0 -67
- package/src/app/set.ts +0 -96
- package/src/bundle/check.ts +0 -42
- package/src/bundle/cleanup.ts +0 -123
- package/src/bundle/compatibility.ts +0 -70
- package/src/bundle/decrypt.ts +0 -54
- package/src/bundle/delete.ts +0 -52
- package/src/bundle/encrypt.ts +0 -60
- package/src/bundle/list.ts +0 -42
- package/src/bundle/unlink.ts +0 -88
- package/src/bundle/upload.ts +0 -552
- package/src/bundle/zip.ts +0 -145
- package/src/channel/add.ts +0 -80
- package/src/channel/currentBundle.ts +0 -72
- package/src/channel/delete.ts +0 -57
- package/src/channel/list.ts +0 -49
- package/src/channel/set.ts +0 -179
- package/src/config/index.ts +0 -156
- package/src/index.ts +0 -310
- package/src/init.ts +0 -495
- package/src/key.ts +0 -135
- package/src/login.ts +0 -70
- package/src/types/capacitor__cli.d.ts +0 -6
- package/src/types/supabase.types.ts +0 -2123
- package/src/user/account.ts +0 -11
- package/src/utils.ts +0 -1076
- package/test/VerifyZip.java +0 -83
- package/test/check-posix-paths.js +0 -21
- package/test/chunk_convert.ts +0 -28
- package/test/data.ts +0 -18769
- package/test/test_headers_rls.ts +0 -24
- package/test/test_semver.ts +0 -13
- package/test/test_upload/app.js +0 -3
- package/test/test_upload/assets/check-posix-paths.js +0 -21
- package/test/test_upload/index.html +0 -0
- package/test/test_zip_swift/Package.resolved +0 -24
- package/test/test_zip_swift/Package.swift +0 -29
- package/test/test_zip_swift/Sources/main.swift +0 -80
- package/tsconfig.json +0 -39
package/test/test_headers_rls.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { createClient } from '@supabase/supabase-js'
|
|
2
|
-
|
|
3
|
-
const supaUrl = 'https://aucsybvnhavogdmzwtcw.supabase.co'
|
|
4
|
-
const apikey = '***'
|
|
5
|
-
const anonKey = '***'
|
|
6
|
-
const init = async () => {
|
|
7
|
-
const supabase = createClient(supaUrl, anonKey, {
|
|
8
|
-
global: {
|
|
9
|
-
headers: {
|
|
10
|
-
capgkey: '***',
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
const { data: userId } = await supabase
|
|
15
|
-
.rpc('get_user_id', { apikey })
|
|
16
|
-
console.log('userId', userId)
|
|
17
|
-
const apps = await supabase.from('apps')
|
|
18
|
-
.select()
|
|
19
|
-
.eq('app_id', 'ee.forgr.captime')
|
|
20
|
-
console.log('apps', apps.data)
|
|
21
|
-
// try to find one app
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
init()
|
package/test/test_semver.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// import semver from 'semver'
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line max-len
|
|
4
|
-
const regex = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/
|
|
5
|
-
const bundles = ['20220929.0.0+7c146f40', 'v1.2.3']
|
|
6
|
-
// check if bundle is valid
|
|
7
|
-
for (const bundle of bundles) {
|
|
8
|
-
if (!regex.test(bundle)) {
|
|
9
|
-
console.log(`Your bundle name ${bundle}, is not valid it should follow semver convention : https://semver.org/`);
|
|
10
|
-
} else {
|
|
11
|
-
console.log('valid')
|
|
12
|
-
}
|
|
13
|
-
}
|
package/test/test_upload/app.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const AdmZip = require('adm-zip');
|
|
2
|
-
|
|
3
|
-
const zip = new AdmZip('build.zip');
|
|
4
|
-
const zipEntries = zip.getEntries(); // an array of ZipEntry records
|
|
5
|
-
|
|
6
|
-
let errorFound = false;
|
|
7
|
-
|
|
8
|
-
zipEntries.forEach((zipEntry) => {
|
|
9
|
-
const entryName = zipEntry.entryName;
|
|
10
|
-
if (entryName.includes('\\')) {
|
|
11
|
-
console.error(`Non-POSIX path detected: ${entryName}`);
|
|
12
|
-
errorFound = true;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
if (errorFound) {
|
|
17
|
-
console.error('Non-POSIX paths detected in the zip file');
|
|
18
|
-
process.exit(1);
|
|
19
|
-
} else {
|
|
20
|
-
console.log('All paths are POSIX compliant.');
|
|
21
|
-
}
|
|
File without changes
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"originHash" : "be28ad70f15d01b567aeb05f85c074fc7d437a0ade8a8ceab7a6149b8f5b3593",
|
|
3
|
-
"pins" : [
|
|
4
|
-
{
|
|
5
|
-
"identity" : "swift-argument-parser",
|
|
6
|
-
"kind" : "remoteSourceControl",
|
|
7
|
-
"location" : "https://github.com/apple/swift-argument-parser",
|
|
8
|
-
"state" : {
|
|
9
|
-
"revision" : "0fbc8848e389af3bb55c182bc19ca9d5dc2f255b",
|
|
10
|
-
"version" : "1.4.0"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"identity" : "ziparchive",
|
|
15
|
-
"kind" : "remoteSourceControl",
|
|
16
|
-
"location" : "https://github.com/ZipArchive/ZipArchive.git",
|
|
17
|
-
"state" : {
|
|
18
|
-
"revision" : "79d4dc9729096c6ad83dd3cee2b9f354d1b4ab7b",
|
|
19
|
-
"version" : "2.5.5"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"version" : 3
|
|
24
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// swift-tools-version: 5.10
|
|
2
|
-
// The swift-tools-version declares the minimum version of Swift required to build this package.
|
|
3
|
-
|
|
4
|
-
import PackageDescription
|
|
5
|
-
|
|
6
|
-
let package = Package(
|
|
7
|
-
name: "MyCLI",
|
|
8
|
-
platforms: [
|
|
9
|
-
.macOS(.v11)
|
|
10
|
-
], dependencies: [
|
|
11
|
-
.package(url: "https://github.com/apple/swift-argument-parser.git", .upToNextMajor(from: "1.4.0")),
|
|
12
|
-
.package(url: "https://github.com/ZipArchive/ZipArchive.git", .upToNextMajor(from: "2.5.5"))
|
|
13
|
-
],
|
|
14
|
-
targets: [
|
|
15
|
-
// Targets are the basic building blocks of a package, defining a module or a test suite.
|
|
16
|
-
// Targets can depend on other targets in this package and products from dependencies.
|
|
17
|
-
.executableTarget(
|
|
18
|
-
name: "MyCLI",
|
|
19
|
-
dependencies: [
|
|
20
|
-
.product(name: "ZipArchive", package: "ZipArchive"),
|
|
21
|
-
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
|
22
|
-
],
|
|
23
|
-
path: "Sources",
|
|
24
|
-
swiftSettings: [
|
|
25
|
-
.unsafeFlags(["-parse-as-library"])
|
|
26
|
-
]
|
|
27
|
-
),
|
|
28
|
-
]
|
|
29
|
-
)
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
// The Swift Programming Language
|
|
2
|
-
// https://docs.swift.org/swift-book
|
|
3
|
-
|
|
4
|
-
import ArgumentParser
|
|
5
|
-
import Foundation
|
|
6
|
-
import ZipArchive
|
|
7
|
-
import Darwin
|
|
8
|
-
|
|
9
|
-
extension URL {
|
|
10
|
-
var isDirectory: Bool {
|
|
11
|
-
(try? resourceValues(forKeys: [.isDirectoryKey]))?.isDirectory == true
|
|
12
|
-
}
|
|
13
|
-
var exist: Bool {
|
|
14
|
-
return FileManager().fileExists(atPath: self.path)
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
func verifyZipFile(zipFilePath: String) {
|
|
20
|
-
let destUnZip = URL(fileURLWithPath: NSTemporaryDirectory()).appendingPathComponent("extracted")
|
|
21
|
-
|
|
22
|
-
var unzipError: NSError?
|
|
23
|
-
let success = SSZipArchive.unzipFile(atPath: zipFilePath,
|
|
24
|
-
toDestination: destUnZip.path,
|
|
25
|
-
preserveAttributes: true,
|
|
26
|
-
overwrite: true,
|
|
27
|
-
nestedZipLevel: 1,
|
|
28
|
-
password: nil,
|
|
29
|
-
error: &unzipError,
|
|
30
|
-
delegate: nil,
|
|
31
|
-
progressHandler: { (entry, _, _, _) in
|
|
32
|
-
if entry.contains("\\") {
|
|
33
|
-
print("Windows path is not supported: \(entry)")
|
|
34
|
-
exit(1)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
let fileURL = destUnZip.appendingPathComponent(entry)
|
|
38
|
-
let canonicalPath = fileURL.path
|
|
39
|
-
let canonicalDir = destUnZip.path
|
|
40
|
-
|
|
41
|
-
if !canonicalPath.hasPrefix(canonicalDir) {
|
|
42
|
-
print("SecurityException, Failed to ensure directory is the start path: \(canonicalDir) of \(canonicalPath)")
|
|
43
|
-
exit(1)
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
completionHandler: nil)
|
|
47
|
-
|
|
48
|
-
if !success || unzipError != nil {
|
|
49
|
-
print("Failed to unzip file: \(zipFilePath)")
|
|
50
|
-
print("Error: \(unzipError?.localizedDescription ?? "")")
|
|
51
|
-
exit(1)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
print("ZIP file is valid: \(zipFilePath)")
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
@main
|
|
58
|
-
struct CapgoCliTest: ParsableCommand {
|
|
59
|
-
@Option(parsing: .upToNextOption, help: "Specify the files to test")
|
|
60
|
-
public var zipFiles: [String]
|
|
61
|
-
|
|
62
|
-
public func run() throws {
|
|
63
|
-
print("Hello capgo test", zipFiles)
|
|
64
|
-
|
|
65
|
-
for file in zipFiles {
|
|
66
|
-
guard let fileUrl = URL(string: file) else {
|
|
67
|
-
print("Cannot convert \"\(file)\" into a file")
|
|
68
|
-
Darwin.exit(1)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
if (!fileUrl.exist) {
|
|
72
|
-
print("File \"\(fileUrl)\" does not exist")
|
|
73
|
-
Darwin.exit(1)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
print("Testing file \(file)")
|
|
77
|
-
verifyZipFile(zipFilePath: file)
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"strict": true,
|
|
4
|
-
"forceConsistentCasingInFileNames": true,
|
|
5
|
-
"module": "commonjs",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"target": "es2015",
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"outDir": "dist",
|
|
13
|
-
"baseUrl": "src",
|
|
14
|
-
"lib": [
|
|
15
|
-
"es2016",
|
|
16
|
-
"dom"
|
|
17
|
-
],
|
|
18
|
-
"typeRoots": [
|
|
19
|
-
"src/types/*"
|
|
20
|
-
],
|
|
21
|
-
"paths": {
|
|
22
|
-
"*": [
|
|
23
|
-
"src/types/*"
|
|
24
|
-
],
|
|
25
|
-
"@capacitor/cli/dist/config": [
|
|
26
|
-
"src/types/capacitor-cli.d.ts"
|
|
27
|
-
]
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
"include": [
|
|
31
|
-
"src/**/*"
|
|
32
|
-
],
|
|
33
|
-
"exclude": [
|
|
34
|
-
"node_modules",
|
|
35
|
-
"dist",
|
|
36
|
-
"__tests__",
|
|
37
|
-
"**/*.spec.ts"
|
|
38
|
-
],
|
|
39
|
-
}
|