@capgo/cli 7.84.6 → 7.84.8
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/README.md +31 -0
- package/dist/index.js +286 -281
- package/dist/package.json +1 -1
- package/dist/src/api/app.d.ts +2 -0
- package/dist/src/app/add.d.ts +1 -0
- package/dist/src/bundle/upload.d.ts +11 -1
- package/dist/src/github.d.ts +34 -0
- package/dist/src/schemas/sdk.d.ts +10 -0
- package/dist/src/sdk.d.ts +37 -2
- package/dist/src/sdk.js +219 -218
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/src/api/app.d.ts
CHANGED
|
@@ -13,3 +13,5 @@ export declare function check2FAComplianceForApp(supabase: SupabaseClient<Databa
|
|
|
13
13
|
export declare function checkAppExistsAndHasPermissionOrgErr(supabase: SupabaseClient<Database>, apikey: string, appid: string, requiredPermission: OrganizationPerm, silent?: boolean, skip2FACheck?: boolean): Promise<OrganizationPerm>;
|
|
14
14
|
export type { AppOptions as Options } from '../schemas/app';
|
|
15
15
|
export declare const newIconPath = "assets/icon.png";
|
|
16
|
+
export declare const defaultAppIconPath = "public/capgo.png";
|
|
17
|
+
export declare function getAppIconStoragePath(organizationUid: string, appId: string): string;
|
package/dist/src/app/add.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export declare function addAppInternal(initialAppId: string, options: AppOptions
|
|
|
6
6
|
organizationUid: string;
|
|
7
7
|
userId: string;
|
|
8
8
|
name: string;
|
|
9
|
+
iconUrl: string;
|
|
9
10
|
signedURL: string;
|
|
10
11
|
}>;
|
|
11
12
|
export declare function addApp(appId: string, options: AppOptions): Promise<void>;
|
|
@@ -5,4 +5,14 @@ type SupabaseType = Awaited<ReturnType<typeof createSupabaseClient>>;
|
|
|
5
5
|
export type { UploadBundleResult };
|
|
6
6
|
export declare function getDefaultUploadChannel(appId: string, supabase: SupabaseType, hostWeb: string): Promise<string | null>;
|
|
7
7
|
export declare function uploadBundleInternal(preAppid: string, options: OptionsUpload, silent?: boolean): Promise<UploadBundleResult>;
|
|
8
|
-
export declare function uploadBundle(appid: string, options: OptionsUpload): Promise<
|
|
8
|
+
export declare function uploadBundle(appid: string, options: OptionsUpload): Promise<{
|
|
9
|
+
success: boolean;
|
|
10
|
+
bundle: string;
|
|
11
|
+
encryptionMethod: "none" | "v1" | "v2";
|
|
12
|
+
checksum?: string | null | undefined;
|
|
13
|
+
sessionKey?: string | undefined;
|
|
14
|
+
ivSessionKey?: string | null | undefined;
|
|
15
|
+
storageProvider?: string | undefined;
|
|
16
|
+
skipped?: boolean | undefined;
|
|
17
|
+
reason?: string | undefined;
|
|
18
|
+
}>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const defaultStarRepo = "capacitor-updater";
|
|
2
|
+
export type StarAllRepositoryStatus = 'starred' | 'already_starred' | 'skipped' | 'failed';
|
|
3
|
+
export interface StarAllRepositoryResult {
|
|
4
|
+
repository: string;
|
|
5
|
+
alreadyStarred: boolean;
|
|
6
|
+
skipped: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
status: StarAllRepositoryStatus;
|
|
9
|
+
}
|
|
10
|
+
export interface StarAllRepositoriesOptions {
|
|
11
|
+
repositories?: string[];
|
|
12
|
+
minDelayMs?: number;
|
|
13
|
+
maxDelayMs?: number;
|
|
14
|
+
onProgress?: (result: StarAllRepositoryResult) => void;
|
|
15
|
+
onDiscovery?: (message: string) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function markRepoStarredInSession(repository: string): void;
|
|
18
|
+
export declare function isRepoStarredInSession(repositoryInput?: string): boolean;
|
|
19
|
+
export interface RepoStarStatus {
|
|
20
|
+
repository: string;
|
|
21
|
+
ghInstalled: boolean;
|
|
22
|
+
ghLoggedIn: boolean;
|
|
23
|
+
repositoryExists: boolean;
|
|
24
|
+
starred: boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function normalizeGithubRepo(repository?: string): string;
|
|
27
|
+
export declare function isGhInstalled(): boolean;
|
|
28
|
+
export declare function isGhLoggedIn(): boolean;
|
|
29
|
+
export declare function getRepoStarStatus(repositoryInput?: string): RepoStarStatus;
|
|
30
|
+
export declare function starAllRepositories(options?: StarAllRepositoriesOptions): Promise<StarAllRepositoryResult[]>;
|
|
31
|
+
export declare function starRepository(repositoryInput?: string): {
|
|
32
|
+
repository: string;
|
|
33
|
+
alreadyStarred: boolean;
|
|
34
|
+
};
|
|
@@ -41,6 +41,16 @@ export declare const appInfoSchema: z.ZodObject<{
|
|
|
41
41
|
createdAt: z.ZodDate;
|
|
42
42
|
}, z.core.$strip>;
|
|
43
43
|
export type AppInfo = z.infer<typeof appInfoSchema>;
|
|
44
|
+
export declare const starRepoOptionsSchema: z.ZodObject<{
|
|
45
|
+
repository: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, z.core.$strip>;
|
|
47
|
+
export type StarRepoOptions = z.infer<typeof starRepoOptionsSchema>;
|
|
48
|
+
export declare const starAllRepositoriesOptionsSchema: z.ZodObject<{
|
|
49
|
+
repositories: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
50
|
+
minDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
maxDelayMs: z.ZodOptional<z.ZodNumber>;
|
|
52
|
+
}, z.core.$strip>;
|
|
53
|
+
export type StarAllRepositoriesOptions = z.infer<typeof starAllRepositoriesOptionsSchema>;
|
|
44
54
|
export declare const uploadOptionsSchema: z.ZodObject<{
|
|
45
55
|
appId: z.ZodString;
|
|
46
56
|
path: z.ZodString;
|
package/dist/src/sdk.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import type { DecryptResult } from './bundle/decrypt';
|
|
|
3
3
|
import type { EncryptResult } from './bundle/encrypt';
|
|
4
4
|
import type { ZipResult } from './bundle/zip';
|
|
5
5
|
import type { ProbeInternalResult } from './probe';
|
|
6
|
-
import type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions } from './schemas/sdk';
|
|
6
|
+
import type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, StarAllRepositoriesOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, StarRepoOptions, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions } from './schemas/sdk';
|
|
7
7
|
import { getInfoInternal } from './app/info';
|
|
8
8
|
import { checkCompatibilityInternal } from './bundle/compatibility';
|
|
9
|
+
import type { StarAllRepositoryResult } from './github';
|
|
9
10
|
export type DoctorInfo = Awaited<ReturnType<typeof getInfoInternal>>;
|
|
10
11
|
type CompatibilityReport = Awaited<ReturnType<typeof checkCompatibilityInternal>>['finalCompatibility'];
|
|
11
12
|
export type BundleCompatibilityEntry = CompatibilityReport[number];
|
|
@@ -108,6 +109,35 @@ export declare class CapgoSDK {
|
|
|
108
109
|
* Retrieve the account ID associated with the configured API key
|
|
109
110
|
*/
|
|
110
111
|
getAccountId(options?: AccountIdOptions): Promise<SDKResult<string>>;
|
|
112
|
+
/**
|
|
113
|
+
* Star the Capgo repository on GitHub
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const result = await sdk.starRepo({ repository: 'Cap-go/capacitor-updater' })
|
|
118
|
+
* if (result.success) {
|
|
119
|
+
* console.log(`${result.data?.repository} starred`)
|
|
120
|
+
* }
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
starRepo(options?: StarRepoOptions): Promise<SDKResult<{
|
|
124
|
+
repository: string;
|
|
125
|
+
alreadyStarred: boolean;
|
|
126
|
+
}>>;
|
|
127
|
+
/**
|
|
128
|
+
* Star the Capgo-related repositories on GitHub
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const result = await sdk.starAllRepositories()
|
|
133
|
+
* if (result.success) {
|
|
134
|
+
* for (const entry of result.data ?? []) {
|
|
135
|
+
* console.log(entry.repository, entry.status)
|
|
136
|
+
* }
|
|
137
|
+
* }
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
starAllRepositories(options?: StarAllRepositoriesOptions): Promise<SDKResult<StarAllRepositoryResult[]>>;
|
|
111
141
|
checkBundleCompatibility(options: BundleCompatibilityOptions): Promise<SDKResult<BundleCompatibilityEntry[]>>;
|
|
112
142
|
encryptBundle(options: EncryptBundleOptions): Promise<SDKResult<EncryptResult>>;
|
|
113
143
|
decryptBundle(options: DecryptBundleOptions): Promise<SDKResult<DecryptResult>>;
|
|
@@ -341,6 +371,11 @@ export declare function checkBundleCompatibility(options: BundleCompatibilityOpt
|
|
|
341
371
|
export declare function encryptBundle(options: EncryptBundleOptions): Promise<SDKResult<EncryptResult>>;
|
|
342
372
|
export declare function decryptBundle(options: DecryptBundleOptions): Promise<SDKResult<DecryptResult>>;
|
|
343
373
|
export declare function zipBundle(options: ZipBundleOptions): Promise<SDKResult<ZipResult>>;
|
|
374
|
+
export declare function starRepo(options?: StarRepoOptions): Promise<SDKResult<{
|
|
375
|
+
repository: string;
|
|
376
|
+
alreadyStarred: boolean;
|
|
377
|
+
}>>;
|
|
378
|
+
export declare function starAllRepositories(options?: StarAllRepositoriesOptions): Promise<SDKResult<StarAllRepositoryResult[]>>;
|
|
344
379
|
export declare function generateEncryptionKeys(options?: GenerateKeyOptions): Promise<SDKResult>;
|
|
345
380
|
export declare function saveEncryptionKey(options?: SaveKeyOptions): Promise<SDKResult>;
|
|
346
381
|
export declare function deleteLegacyEncryptionKey(options?: DeleteOldKeyOptions): Promise<SDKResult<{
|
|
@@ -487,7 +522,7 @@ export declare function getCapacitorConfig(): Promise<{
|
|
|
487
522
|
export type { BuildCredentials } from './build/request';
|
|
488
523
|
export type { CapacitorConfig } from './config';
|
|
489
524
|
export type { ProbeInternalResult } from './probe';
|
|
490
|
-
export type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, StatsOrder, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions, } from './schemas/sdk';
|
|
525
|
+
export type { AccountIdOptions, AddAppOptions, AddChannelOptions, AddOrganizationOptions, AppInfo, BundleCompatibilityOptions, BundleInfo, CleanupOptions, CurrentBundleOptions, DecryptBundleOptions, DeleteOldKeyOptions, DeleteOrganizationOptions, DeviceStats, DoctorOptions, EncryptBundleOptions, GenerateKeyOptions, GetStatsOptions, ListOrganizationsOptions, LoginOptions, OrganizationInfo, ProbeOptions, RequestBuildOptions, SaveKeyOptions, SDKResult, SetSettingOptions, StarAllRepositoriesOptions, StarRepoOptions, StatsOrder, UpdateAppOptions, UpdateChannelOptions, UpdateOrganizationOptions, UploadOptions, UploadResult, ZipBundleOptions, } from './schemas/sdk';
|
|
491
526
|
export type { Database } from './types/supabase.types';
|
|
492
527
|
export { createSupabaseClient } from './utils';
|
|
493
528
|
export { formatApiErrorForCli, getSecurityPolicyMessage, isSecurityPolicyError, parseSecurityPolicyError, SECURITY_POLICY_ERRORS, SECURITY_POLICY_MESSAGES, } from './utils/security_policy_errors';
|