@fluid-app/fluid-cli 0.1.801 → 0.1.803

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.
@@ -0,0 +1,2 @@
1
+ import { b as saveClientProfile } from "./profiles-B6V5IBeX.mjs";
2
+ export { saveClientProfile };
@@ -1,4 +1,4 @@
1
- import { C as readConfig, M as isIdentityProfile, a as peekIdentityToken, g as peekClientToken, j as isClientProfile, p as clientAccessToken, s as profileAccessToken } from "./profiles-CbMJHi-u.mjs";
1
+ import { E as readConfig, I as isClientProfile, L as isIdentityProfile, c as profileAccessToken, h as clientAccessToken, o as peekIdentityToken, v as peekClientToken } from "./profiles-B6V5IBeX.mjs";
2
2
  import { closeSync, constants, existsSync, fstatSync, openSync, readFileSync, readSync, readdirSync, realpathSync, writeSync } from "node:fs";
3
3
  import { dirname, isAbsolute, join, sep } from "node:path";
4
4
  import { createHash } from "node:crypto";
@@ -105,7 +105,7 @@ function filterCatalog(entries, root, prefix) {
105
105
  }
106
106
  //#endregion
107
107
  //#region package.json
108
- var version = "0.1.801";
108
+ var version = "0.1.803";
109
109
  //#endregion
110
110
  //#region src/auth/client-headers.ts
111
111
  const CLIENT_HEADERS = {
@@ -1041,6 +1041,17 @@ function adoptIdentityProfile(identity, from) {
1041
1041
  };
1042
1042
  }
1043
1043
  /**
1044
+ * A candidate identity-mode profile for the company of `rejected`, or null
1045
+ * when none exists. This is a prefilter, not proof: company names are not
1046
+ * unique, so it compares only the name and the base URLs, which must both be
1047
+ * set and agree, and a `fluidShop` when both profiles carry one. An identity
1048
+ * profile written by `fluid login` carries none. The caller must confirm the
1049
+ * identity session's company before relying on the candidate.
1050
+ */
1051
+ function findIdentityFallbackProfile(rejected) {
1052
+ return Object.values(readConfig().profiles).filter(isIdentityProfile).find((profile) => sameTenant(profile, rejected)) ?? null;
1053
+ }
1054
+ /**
1044
1055
  * Identity-mode profiles that could be the company of `rejected`, in two
1045
1056
  * groups: those whose company name also matches, then those on the same base
1046
1057
  * URL (and `fluidShop`, when both carry one) whose name differs, since a
@@ -1575,6 +1586,6 @@ function exitOnInputsError(error, io = processIo) {
1575
1586
  io.exit(64);
1576
1587
  }
1577
1588
  //#endregion
1578
- export { filterCatalog as $, fetchCompanyShops as A, failure as B, listProfileNames as C, FLUID_API_ERROR as D, findProjectConfig as E, redeemIdentityLink as F, isSuccess as G, isError as H, sendMfa as I, success as J, mapError as K, signup as L, getFluidApiBase as M, isInsecureRemoteBase as N, SIGNUP_ERROR as O, pollAgentAccess as P, unwrapOr as Q, switchCompany as R, getRoleAuthTokenAsync as S, resolveCredentialSource as T, isFailure as U, getErrorMessage as V, isNodeError as W, tryCatchAsync as X, tryCatch as Y, unwrap as Z, describeCredentialSource as _, INPUTS_UNDECLARED_CODE as a, getAuthToken as b, inputsModeActive as c, setActiveSnapshot as d, rootCommand as et, inInternalRead as f, adoptIdentityProfile as g, declareInputs as h, INPUTS_MODE_ENV as i, describeCommand as it, fetchUserCompanies as j, confirmMfa as k, registerInputsHook as l, withInternalReadsAsync as m, INPUTS_MISMATCH_CODE as n, visibleSubcommands as nt, INPUTS_UNDECLARED_EXIT as o, withInternalReads as p, mapResult as q, INPUTS_MISMATCH_EXIT as r, walkCommands as rt, exitOnInputsError as s, INPUTS_EXPECT_ENV as t, visibleOptions as tt, createInputsReader as u, findIdentityFallbackCandidates as v, readFdToken as w, getAuthTokenAsync as x, getActiveProfile as y, validateToken as z };
1589
+ export { unwrapOr as $, confirmMfa as A, validateToken as B, getRoleAuthTokenAsync as C, findProjectConfig as D, resolveCredentialSource as E, pollAgentAccess as F, isNodeError as G, getErrorMessage as H, redeemIdentityLink as I, mapResult as J, isSuccess as K, sendMfa as L, fetchUserCompanies as M, getFluidApiBase as N, FLUID_API_ERROR as O, isInsecureRemoteBase as P, unwrap as Q, signup as R, getAuthTokenAsync as S, readFdToken as T, isError as U, failure as V, isFailure as W, tryCatch as X, success as Y, tryCatchAsync as Z, describeCredentialSource as _, INPUTS_UNDECLARED_CODE as a, describeCommand as at, getActiveProfile as b, inputsModeActive as c, setActiveSnapshot as d, filterCatalog as et, inInternalRead as f, adoptIdentityProfile as g, declareInputs as h, INPUTS_MODE_ENV as i, walkCommands as it, fetchCompanyShops as j, SIGNUP_ERROR as k, registerInputsHook as l, withInternalReadsAsync as m, INPUTS_MISMATCH_CODE as n, visibleOptions as nt, INPUTS_UNDECLARED_EXIT as o, withInternalReads as p, mapError as q, INPUTS_MISMATCH_EXIT as r, visibleSubcommands as rt, exitOnInputsError as s, INPUTS_EXPECT_ENV as t, rootCommand as tt, createInputsReader as u, findIdentityFallbackCandidates as v, listProfileNames as w, getAuthToken as x, findIdentityFallbackProfile as y, switchCompany as z };
1579
1590
 
1580
- //# sourceMappingURL=hook-gdAJafKe.mjs.map
1591
+ //# sourceMappingURL=hook-DCHZlXFZ.mjs.map