@capgo/cli 7.118.0 → 7.119.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/dist/index.js +415 -414
- package/dist/package.json +1 -1
- package/dist/src/bundle/builder-cta.d.ts +39 -0
- package/dist/src/bundle/upload-command.d.ts +8 -0
- package/dist/src/bundle/upload.d.ts +1 -0
- package/dist/src/schemas/bundle.d.ts +4 -0
- package/dist/src/sdk.js +210 -209
- package/package.json +1 -1
package/dist/package.json
CHANGED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export type BuilderCtaSurface = 'skip' | 'ci-ad' | 'prompt-onboarding' | 'prompt-build';
|
|
2
|
+
export type BuilderCtaAction = 'continue' | 'launch-onboarding' | 'launch-build';
|
|
3
|
+
export interface BuilderCtaContext {
|
|
4
|
+
incompatible: boolean;
|
|
5
|
+
interactive: boolean;
|
|
6
|
+
hasCredentials: boolean;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Pure decision: which Builder CTA surface (if any) to show for this upload.
|
|
10
|
+
* - `skip`: do nothing (compatible bundle).
|
|
11
|
+
* - `ci-ad`: non-interactive — print a one-off ad, never prompt.
|
|
12
|
+
* - `prompt-onboarding` / `prompt-build`: interactive prompt, branched on
|
|
13
|
+
* whether the app already has build credentials.
|
|
14
|
+
*/
|
|
15
|
+
export declare function decideBuilderCtaSurface(ctx: BuilderCtaContext): BuilderCtaSurface;
|
|
16
|
+
export declare function printBuilderCiAd(hasCredentials: boolean): void;
|
|
17
|
+
/** Confirm-prompt seam (`@clack/prompts` `confirm` satisfies it); injectable for tests. */
|
|
18
|
+
export type BuilderConfirm = (opts: {
|
|
19
|
+
message: string;
|
|
20
|
+
initialValue?: boolean;
|
|
21
|
+
}) => Promise<boolean | symbol>;
|
|
22
|
+
export interface MaybePromptBuilderCtaParams {
|
|
23
|
+
incompatible: boolean;
|
|
24
|
+
interactive: boolean;
|
|
25
|
+
/** Whether the app already has saved build credentials (resolved by the caller). */
|
|
26
|
+
hasCredentials: boolean;
|
|
27
|
+
appId: string;
|
|
28
|
+
orgId: string;
|
|
29
|
+
apikey: string;
|
|
30
|
+
incompatibleCount: number;
|
|
31
|
+
/** Injectable for tests; defaults to the `@clack/prompts` confirm prompt. */
|
|
32
|
+
confirm?: BuilderConfirm;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Surface the Capgo Builder CTA for an incompatible upload and return the action
|
|
36
|
+
* the caller should take. Never throws; telemetry and prompt failures degrade to
|
|
37
|
+
* `continue` so the upload is never blocked by the CTA.
|
|
38
|
+
*/
|
|
39
|
+
export declare function maybePromptBuilderCta(params: MaybePromptBuilderCtaParams): Promise<BuilderCtaAction>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OptionsUpload } from './upload_interface';
|
|
2
|
+
/**
|
|
3
|
+
* `bundle upload` command handler. Uploads the bundle, then — when the bundle is
|
|
4
|
+
* incompatible and the user opted into Capgo Builder — launches the Ink-based
|
|
5
|
+
* build flow. Kept out of `upload.ts` so the programmatic SDK bundle (which
|
|
6
|
+
* imports `uploadBundleInternal`) never statically pulls in `ink`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function handleBundleUploadCommand(appId: string, options: OptionsUpload): Promise<void>;
|
|
@@ -84,6 +84,10 @@ export declare const uploadBundleResultSchema: z.ZodObject<{
|
|
|
84
84
|
storageProvider: z.ZodOptional<z.ZodString>;
|
|
85
85
|
skipped: z.ZodOptional<z.ZodBoolean>;
|
|
86
86
|
reason: z.ZodOptional<z.ZodString>;
|
|
87
|
+
builderAction: z.ZodOptional<z.ZodEnum<{
|
|
88
|
+
"launch-onboarding": "launch-onboarding";
|
|
89
|
+
"launch-build": "launch-build";
|
|
90
|
+
}>>;
|
|
87
91
|
}, z.core.$strip>;
|
|
88
92
|
export type UploadBundleResult = z.infer<typeof uploadBundleResultSchema>;
|
|
89
93
|
export declare const bundleZipOptionsSchema: z.ZodObject<{
|