clishop 1.4.3 → 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 -15
- 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,12 +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 pollSpinner = ora3("Waiting for you to complete payment setup...").start();
|
|
905
916
|
const baseUrl = getApiBaseUrl();
|
|
906
917
|
const maxAttempts = 120;
|
|
907
918
|
let completed = false;
|
|
@@ -917,12 +928,12 @@ async function runSetupWizard(emailArg) {
|
|
|
917
928
|
user: data.user
|
|
918
929
|
});
|
|
919
930
|
config.set("setupCompleted", true);
|
|
920
|
-
|
|
931
|
+
console.log(chalk4.green(" \u2713 Payment linked and account activated!"));
|
|
921
932
|
completed = true;
|
|
922
933
|
break;
|
|
923
934
|
}
|
|
924
935
|
if (data.status === "expired") {
|
|
925
|
-
|
|
936
|
+
console.log(chalk4.red(" Setup link expired. Run ") + chalk4.white("clishop setup") + chalk4.red(" to try again."));
|
|
926
937
|
process.exitCode = 1;
|
|
927
938
|
return;
|
|
928
939
|
}
|
|
@@ -930,7 +941,7 @@ async function runSetupWizard(emailArg) {
|
|
|
930
941
|
}
|
|
931
942
|
}
|
|
932
943
|
if (!completed) {
|
|
933
|
-
|
|
944
|
+
console.log(chalk4.red(" Timed out waiting for setup. Run ") + chalk4.white("clishop setup") + chalk4.red(" to try again."));
|
|
934
945
|
process.exitCode = 1;
|
|
935
946
|
return;
|
|
936
947
|
}
|
|
@@ -970,11 +981,7 @@ async function runPaymentLinkFlow(config) {
|
|
|
970
981
|
const res = await api.post("/payment-methods/setup", { agent: agent.name });
|
|
971
982
|
spinner.stop();
|
|
972
983
|
const { setupUrl } = res.data;
|
|
973
|
-
|
|
974
|
-
console.log(chalk4.bold(" Open this link to link your payment method:"));
|
|
975
|
-
console.log();
|
|
976
|
-
console.log(" " + chalk4.cyan.underline(setupUrl));
|
|
977
|
-
console.log();
|
|
984
|
+
printSetupLink("Open this link to link your payment method:", setupUrl);
|
|
978
985
|
const opened = await openBrowser(setupUrl);
|
|
979
986
|
if (opened) {
|
|
980
987
|
console.log(chalk4.dim(" (Browser opened automatically)"));
|
|
@@ -4067,7 +4074,7 @@ function registerDoctorCommand(program2) {
|
|
|
4067
4074
|
|
|
4068
4075
|
// src/index.ts
|
|
4069
4076
|
var program = new Command();
|
|
4070
|
-
program.name("clishop").version("1.4.
|
|
4077
|
+
program.name("clishop").version("1.4.4").description(
|
|
4071
4078
|
chalk16.bold("CLISHOP") + ` \u2014 Order anything from your terminal.
|
|
4072
4079
|
|
|
4073
4080
|
Run 'clishop setup' to get started with a single payment link.
|