@fluid-app/fluid-cli 0.1.751 → 0.1.753

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.
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { $ as walkCommands, A as pollAgentAccess, D as fetchUserCompanies, E as confirmMfa, F as validateToken, M as sendMfa, N as signup, O as getFluidApiBase, P as switchCompany, Q as visibleSubcommands, S as resolveCredentialSource, X as rootCommand, Y as filterCatalog, Z as visibleOptions, _ as getAuthToken, c as inputsModeActive, g as getActiveProfile, j as redeemIdentityLink, k as isInsecureRemoteBase, l as registerInputsHook, s as exitOnInputsError, u as createInputsReader, w as FLUID_API_ERROR, x as readFdToken } from "../hook-B_YV8s2r.mjs";
3
- import { A as isClientProfile, C as readStoredConfig, D as getConfigDir, E as isStrictConfig, S as readConfig, T as writeConfig, _ as primeClientProfile, c as sessionFacts, j as isIdentityProfile, l as signInWithBrowser, n as describeIdentityError, o as primeIdentityProfile, p as clientAccessToken, r as identityToken, t as endUnusedSessions, u as signOutIdentity, w as updateConfig, y as resolveIdentityUrl } from "../profiles-BRMp_Rr8.mjs";
2
+ import { $ as walkCommands, A as pollAgentAccess, D as fetchUserCompanies, E as confirmMfa, F as validateToken, M as sendMfa, N as signup, O as getFluidApiBase, P as switchCompany, Q as visibleSubcommands, S as resolveCredentialSource, X as rootCommand, Y as filterCatalog, Z as visibleOptions, _ as getAuthToken, c as inputsModeActive, g as getActiveProfile, j as redeemIdentityLink, k as isInsecureRemoteBase, l as registerInputsHook, s as exitOnInputsError, u as createInputsReader, w as FLUID_API_ERROR, x as readFdToken } from "../hook-2J2ThJ6q.mjs";
3
+ import { A as isClientProfile, C as readStoredConfig, D as getConfigDir, E as isStrictConfig, S as readConfig, T as writeConfig, _ as primeClientProfile, c as sessionFacts, j as isIdentityProfile, l as signInWithBrowser, n as describeIdentityError, o as primeIdentityProfile, p as clientAccessToken, r as identityToken, t as endUnusedSessions, u as signOutIdentity, w as updateConfig, y as resolveIdentityUrl } from "../profiles-X-HRUprR.mjs";
4
4
  import { createRequire } from "node:module";
5
5
  import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
6
6
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -462,7 +462,8 @@ async function loginWithIdentity(context) {
462
462
  try {
463
463
  signIn = await signInWithBrowser({
464
464
  identityUrl,
465
- log: context.log
465
+ log: context.log,
466
+ loginHint: context.loginHint
466
467
  });
467
468
  } catch (error) {
468
469
  return failed("IDENTITY_SIGN_IN_FAILED", describeIdentityError(error));
@@ -729,8 +730,15 @@ async function loginWithEmail(opts, ui, deps) {
729
730
  }
730
731
  }
731
732
  const sendSpinner = ui.spinner("Sending verification code...");
732
- const sendResult = await deps.api.sendMfa(email, ...shopArgs(opts.shop));
733
+ const sendResult = await deps.api.sendMfa(email, opts.shop ? { fluidShop: opts.shop } : { identityHint: true });
733
734
  if (!sendResult.success) return ui.fail(sendResult.error, sendSpinner);
735
+ if (sendResult.value.signInPath === "identity") {
736
+ sendSpinner.succeed("Opening your browser to sign in");
737
+ return identityResult(await loginWithIdentity({
738
+ ...identityContext(opts, true, ui, deps),
739
+ loginHint: normaliseEmail(email)
740
+ }), ui, deps);
741
+ }
734
742
  sendSpinner.succeed(`Verification code sent — check your email (${expiryNote(sendResult.value.expiresAt)})`);
735
743
  if (!ui.json) deps.log(chalk.dim(LINK_HINT));
736
744
  const MAX_CODE_ATTEMPTS = 3;
@@ -1055,7 +1063,7 @@ const defaultSignupDeps = {
1055
1063
  isInteractive: () => Boolean(process.stdin.isTTY),
1056
1064
  agent: {
1057
1065
  poll: pollAgentAccess,
1058
- saveProfile: async (name, input, options) => (await import("../client-BTak96wP.mjs")).saveClientProfile(name, input, options),
1066
+ saveProfile: async (name, input, options) => (await import("../client-B7rLAOwk.mjs")).saveClientProfile(name, input, options),
1059
1067
  strictConfig: isStrictConfig,
1060
1068
  stashRecovery: writeRecoveryFile,
1061
1069
  stderrIsTty: () => Boolean(process.stderr.isTTY),