clishop 1.4.2 → 1.4.4
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 +22 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -809,6 +809,16 @@ async function openBrowser(url) {
|
|
|
809
809
|
function divider(color = chalk4.cyan) {
|
|
810
810
|
console.log(" " + color("\u2500".repeat(48)));
|
|
811
811
|
}
|
|
812
|
+
function printSetupLink(message, setupUrl) {
|
|
813
|
+
console.log();
|
|
814
|
+
console.log(chalk4.bold(` ${message}`));
|
|
815
|
+
console.log();
|
|
816
|
+
console.log(" " + chalk4.cyan.underline(setupUrl));
|
|
817
|
+
console.log();
|
|
818
|
+
console.log(chalk4.dim(" Setup URL (plain text):"));
|
|
819
|
+
console.log(" " + setupUrl);
|
|
820
|
+
console.log();
|
|
821
|
+
}
|
|
812
822
|
function registerSetupCommand(program2) {
|
|
813
823
|
program2.command("setup").description(
|
|
814
824
|
"Set up your CLISHOP account \u2014 links your payment method via a secure browser link"
|
|
@@ -847,7 +857,7 @@ async function runSetupWizard(emailArg) {
|
|
|
847
857
|
console.log();
|
|
848
858
|
console.log(chalk4.bold.cyan(" W E L C O M E T O C L I S H O P"));
|
|
849
859
|
console.log(chalk4.dim(" Order anything from your terminal."));
|
|
850
|
-
console.log(chalk4.dim(` Build: ${"2026-04-
|
|
860
|
+
console.log(chalk4.dim(` Build: ${"2026-04-04T17:29:59.057Z"}`));
|
|
851
861
|
console.log();
|
|
852
862
|
divider(chalk4.cyan);
|
|
853
863
|
console.log();
|
|
@@ -896,19 +906,13 @@ async function runSetupWizard(emailArg) {
|
|
|
896
906
|
process.exitCode = 1;
|
|
897
907
|
return;
|
|
898
908
|
}
|
|
909
|
+
printSetupLink(
|
|
910
|
+
"Give this link to your human to configure the payment method:",
|
|
911
|
+
setupUrl
|
|
912
|
+
);
|
|
913
|
+
console.log(chalk4.dim(" Waiting for you to complete payment setup..."));
|
|
914
|
+
console.log(chalk4.dim(" If your terminal UI hides earlier output, use the plain-text URL above."));
|
|
899
915
|
console.log();
|
|
900
|
-
console.log(chalk4.bold(" Give this link to your human to configure the payment method:"));
|
|
901
|
-
console.log();
|
|
902
|
-
console.log(" " + chalk4.cyan.underline(setupUrl));
|
|
903
|
-
console.log();
|
|
904
|
-
const opened = await openBrowser(setupUrl);
|
|
905
|
-
if (opened) {
|
|
906
|
-
console.log(chalk4.dim(" (Browser opened automatically)"));
|
|
907
|
-
} else {
|
|
908
|
-
console.log(chalk4.yellow(" Could not open browser automatically. Please share the link above."));
|
|
909
|
-
}
|
|
910
|
-
console.log();
|
|
911
|
-
const pollSpinner = ora3("Waiting for you to complete payment setup...").start();
|
|
912
916
|
const baseUrl = getApiBaseUrl();
|
|
913
917
|
const maxAttempts = 120;
|
|
914
918
|
let completed = false;
|
|
@@ -924,12 +928,12 @@ async function runSetupWizard(emailArg) {
|
|
|
924
928
|
user: data.user
|
|
925
929
|
});
|
|
926
930
|
config.set("setupCompleted", true);
|
|
927
|
-
|
|
931
|
+
console.log(chalk4.green(" \u2713 Payment linked and account activated!"));
|
|
928
932
|
completed = true;
|
|
929
933
|
break;
|
|
930
934
|
}
|
|
931
935
|
if (data.status === "expired") {
|
|
932
|
-
|
|
936
|
+
console.log(chalk4.red(" Setup link expired. Run ") + chalk4.white("clishop setup") + chalk4.red(" to try again."));
|
|
933
937
|
process.exitCode = 1;
|
|
934
938
|
return;
|
|
935
939
|
}
|
|
@@ -937,7 +941,7 @@ async function runSetupWizard(emailArg) {
|
|
|
937
941
|
}
|
|
938
942
|
}
|
|
939
943
|
if (!completed) {
|
|
940
|
-
|
|
944
|
+
console.log(chalk4.red(" Timed out waiting for setup. Run ") + chalk4.white("clishop setup") + chalk4.red(" to try again."));
|
|
941
945
|
process.exitCode = 1;
|
|
942
946
|
return;
|
|
943
947
|
}
|
|
@@ -977,11 +981,7 @@ async function runPaymentLinkFlow(config) {
|
|
|
977
981
|
const res = await api.post("/payment-methods/setup", { agent: agent.name });
|
|
978
982
|
spinner.stop();
|
|
979
983
|
const { setupUrl } = res.data;
|
|
980
|
-
|
|
981
|
-
console.log(chalk4.bold(" Open this link to link your payment method:"));
|
|
982
|
-
console.log();
|
|
983
|
-
console.log(" " + chalk4.cyan.underline(setupUrl));
|
|
984
|
-
console.log();
|
|
984
|
+
printSetupLink("Open this link to link your payment method:", setupUrl);
|
|
985
985
|
const opened = await openBrowser(setupUrl);
|
|
986
986
|
if (opened) {
|
|
987
987
|
console.log(chalk4.dim(" (Browser opened automatically)"));
|
|
@@ -4074,7 +4074,7 @@ function registerDoctorCommand(program2) {
|
|
|
4074
4074
|
|
|
4075
4075
|
// src/index.ts
|
|
4076
4076
|
var program = new Command();
|
|
4077
|
-
program.name("clishop").version("1.4.
|
|
4077
|
+
program.name("clishop").version("1.4.4").description(
|
|
4078
4078
|
chalk16.bold("CLISHOP") + ` \u2014 Order anything from your terminal.
|
|
4079
4079
|
|
|
4080
4080
|
Run 'clishop setup' to get started with a single payment link.
|