@earthlink/dotvault 0.14.1 → 0.14.2

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 CHANGED
@@ -757,22 +757,24 @@ async function globalDropCommand(opts) {
757
757
  );
758
758
  }
759
759
  async function resolve2(opts) {
760
+ if (opts.project !== void 0) {
761
+ const http2 = opts.http ?? createHttpClient(await resolveApiUrl(opts.cwd));
762
+ const authedFetch2 = await buildAuthedFetch(http2);
763
+ return { http: http2, project: opts.project, authedFetch: authedFetch2 };
764
+ }
760
765
  const cfg = await loadProjectConfig(opts.cwd);
761
- const project = opts.project ?? cfg.name;
762
766
  const http = opts.http ?? createHttpClient(cfg.proxy.apiUrl);
763
767
  const authedFetch = await buildAuthedFetch(http);
764
- return { http, project, authedFetch };
768
+ return { http, project: cfg.name, authedFetch };
765
769
  }
766
770
  async function resolvePool(opts) {
767
- const cfg = await loadProjectConfig(opts.cwd);
768
- const http = opts.http ?? createHttpClient(cfg.proxy.apiUrl);
771
+ const http = opts.http ?? createHttpClient(await resolveApiUrl(opts.cwd));
769
772
  const authedFetch = await buildAuthedFetch(http);
770
773
  return { http, orgId: opts.orgId, authedFetch };
771
774
  }
772
775
  async function resolvePoolWithEnv(opts) {
773
- const cfg = await loadProjectConfig(opts.cwd);
774
776
  const env = opts.env ?? GLOBAL_ALL_ENV;
775
- const http = opts.http ?? createHttpClient(cfg.proxy.apiUrl);
777
+ const http = opts.http ?? createHttpClient(await resolveApiUrl(opts.cwd));
776
778
  const authedFetch = await buildAuthedFetch(http);
777
779
  return { http, orgId: opts.orgId, env, authedFetch };
778
780
  }
@@ -1630,8 +1632,7 @@ async function fileExists(path) {
1630
1632
 
1631
1633
  // src/commands/project.ts
1632
1634
  async function projectCreateCommand(opts) {
1633
- const cfg = await loadProjectConfig(opts.cwd);
1634
- const http = createHttpClient(cfg.proxy.apiUrl);
1635
+ const http = createHttpClient(await resolveApiUrl(opts.cwd));
1635
1636
  const body = {
1636
1637
  name: opts.name,
1637
1638
  ...opts.orgId !== void 0 ? { owning_org_id: opts.orgId } : {}
@@ -1665,14 +1666,12 @@ async function buildAuthedFetch4(http) {
1665
1666
 
1666
1667
  // src/commands/token.ts
1667
1668
  async function tokenListCommand(opts) {
1668
- const cfg = await loadProjectConfig(opts.cwd);
1669
- const http = createHttpClient(cfg.proxy.apiUrl);
1669
+ const http = createHttpClient(await resolveApiUrl(opts.cwd));
1670
1670
  const authedFetch = await buildAuthedFetch5(http);
1671
1671
  return authedFetch((bearer) => http.adminTokensList(bearer, { orgId: opts.orgId }));
1672
1672
  }
1673
1673
  async function tokenCreateCommand(opts) {
1674
- const cfg = await loadProjectConfig(opts.cwd);
1675
- const http = createHttpClient(cfg.proxy.apiUrl);
1674
+ const http = createHttpClient(await resolveApiUrl(opts.cwd));
1676
1675
  const authedFetch = await buildAuthedFetch5(http);
1677
1676
  const body = {
1678
1677
  name: opts.name,
@@ -1683,8 +1682,7 @@ async function tokenCreateCommand(opts) {
1683
1682
  return authedFetch((bearer) => http.adminTokensCreate(bearer, { orgId: opts.orgId }, body));
1684
1683
  }
1685
1684
  async function tokenRevokeCommand(opts) {
1686
- const cfg = await loadProjectConfig(opts.cwd);
1687
- const http = createHttpClient(cfg.proxy.apiUrl);
1685
+ const http = createHttpClient(await resolveApiUrl(opts.cwd));
1688
1686
  const authedFetch = await buildAuthedFetch5(http);
1689
1687
  await authedFetch(
1690
1688
  (bearer) => http.adminTokensRevoke(bearer, { orgId: opts.orgId, tokenId: opts.tokenId })