@clavis.nexus/setup 3.0.1 → 3.0.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/cli.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
 
2
- export { }
2
+ export { };
package/dist/cli.js CHANGED
@@ -1224,8 +1224,8 @@ var init_status = __esm({
1224
1224
  });
1225
1225
 
1226
1226
  // src/setup-client.ts
1227
- async function requireSession(client) {
1228
- const stored = await loadSession(client.sessionPath);
1227
+ async function requireSession(sessionPath) {
1228
+ const stored = await loadSession(sessionPath);
1229
1229
  if (!stored?.session?.accessToken) {
1230
1230
  return {
1231
1231
  ok: false,
@@ -1236,7 +1236,7 @@ async function requireSession(client) {
1236
1236
  }
1237
1237
  };
1238
1238
  }
1239
- return { ok: true, data: { session: stored.session, origins: stored.origins ?? client.origins } };
1239
+ return { ok: true, data: { session: stored.session, origins: stored.origins } };
1240
1240
  }
1241
1241
  async function runPasskeyCeremony(args) {
1242
1242
  const returnTo = setupCeremonyReturnTo(args.origins.developersOrigin);
@@ -1314,7 +1314,7 @@ function createSetupClient(options = {}) {
1314
1314
  const checked = checkOrgCreationTerms(terms);
1315
1315
  if (!checked.ok) return checked;
1316
1316
  const { incorporation } = checked;
1317
- const auth = await requireSession({ origins, sessionPath });
1317
+ const auth = await requireSession(sessionPath);
1318
1318
  if (!auth.ok) return auth;
1319
1319
  const apiOrigin = auth.data.origins.apiOrigin;
1320
1320
  const closed = await getClosedIncorporations(apiOrigin).catch(() => []);
@@ -1368,7 +1368,7 @@ function createSetupClient(options = {}) {
1368
1368
  };
1369
1369
  },
1370
1370
  async orgAnchorFinish(args) {
1371
- const auth = await requireSession({ origins, sessionPath });
1371
+ const auth = await requireSession(sessionPath);
1372
1372
  if (!auth.ok) return auth;
1373
1373
  const payload = await pollCeremonyResult({
1374
1374
  apiOrigin: auth.data.origins.apiOrigin,
@@ -1406,7 +1406,7 @@ function createSetupClient(options = {}) {
1406
1406
  const checked = checkOrgCreationTerms(args);
1407
1407
  if (!checked.ok) return checked;
1408
1408
  const { incorporation } = checked;
1409
- const auth = await requireSession({ origins, sessionPath });
1409
+ const auth = await requireSession(sessionPath);
1410
1410
  if (!auth.ok) return auth;
1411
1411
  try {
1412
1412
  const out = await postVerifyAnchor(auth.data.origins.apiOrigin, auth.data.session.accessToken, {
@@ -1431,7 +1431,7 @@ function createSetupClient(options = {}) {
1431
1431
  }
1432
1432
  },
1433
1433
  async policyBootstrap(orgId) {
1434
- const auth = await requireSession({ origins, sessionPath });
1434
+ const auth = await requireSession(sessionPath);
1435
1435
  if (!auth.ok) return auth;
1436
1436
  const detail = await getOrg(auth.data.origins.apiOrigin, auth.data.session.accessToken, orgId);
1437
1437
  try {
@@ -1463,7 +1463,7 @@ function createSetupClient(options = {}) {
1463
1463
  const checked = checkOrgCreationTerms(args, INCORPORATION_TERMS_HUMAN);
1464
1464
  if (!checked.ok) return checked;
1465
1465
  const code = checked.incorporation;
1466
- const auth = await requireSession({ origins, sessionPath });
1466
+ const auth = await requireSession(sessionPath);
1467
1467
  if (!auth.ok) return auth;
1468
1468
  const sub = auth.data.session.sub;
1469
1469
  if (!sub) return { ok: false, error: "session_missing_sub \u2014 re-login" };
@@ -1501,7 +1501,7 @@ function createSetupClient(options = {}) {
1501
1501
  async cardCheckout(orgId, opts = {}) {
1502
1502
  const offer = opts.offer === "bundle" ? "bundle" : "meter";
1503
1503
  const lang = checkoutLang(opts.lang);
1504
- const auth = await requireSession({ origins, sessionPath });
1504
+ const auth = await requireSession(sessionPath);
1505
1505
  if (!auth.ok) return auth;
1506
1506
  const sub = auth.data.session.sub;
1507
1507
  if (!sub) return { ok: false, error: "session_missing_sub \u2014 re-login" };
@@ -1584,7 +1584,7 @@ function createSetupClient(options = {}) {
1584
1584
  };
1585
1585
  },
1586
1586
  async appRegister(args) {
1587
- const auth = await requireSession({ origins, sessionPath });
1587
+ const auth = await requireSession(sessionPath);
1588
1588
  if (!auth.ok) return auth;
1589
1589
  const sub = auth.data.session.sub;
1590
1590
  if (!sub) return { ok: false, error: "session_missing_sub \u2014 re-login" };
@@ -1629,7 +1629,7 @@ function createSetupClient(options = {}) {
1629
1629
  };
1630
1630
  },
1631
1631
  async appHostPlan(orgId, appId) {
1632
- const auth = await requireSession({ origins, sessionPath });
1632
+ const auth = await requireSession(sessionPath);
1633
1633
  if (!auth.ok) return auth;
1634
1634
  const ch = await getHostChallenge(auth.data.origins.apiOrigin, auth.data.session.accessToken, orgId, appId);
1635
1635
  return {
@@ -1646,7 +1646,7 @@ function createSetupClient(options = {}) {
1646
1646
  };
1647
1647
  },
1648
1648
  async appVerifyHost(args) {
1649
- const auth = await requireSession({ origins, sessionPath });
1649
+ const auth = await requireSession(sessionPath);
1650
1650
  if (!auth.ok) return auth;
1651
1651
  const ch = await getHostChallenge(
1652
1652
  auth.data.origins.apiOrigin,
@@ -1687,7 +1687,7 @@ function createSetupClient(options = {}) {
1687
1687
  }
1688
1688
  },
1689
1689
  async declarationSet(args) {
1690
- const auth = await requireSession({ origins, sessionPath });
1690
+ const auth = await requireSession(sessionPath);
1691
1691
  if (!auth.ok) return auth;
1692
1692
  const declaration = { endUsers: args.endUsers, uses: args.uses };
1693
1693
  const cer = await runPasskeyCeremony({
@@ -1711,7 +1711,7 @@ function createSetupClient(options = {}) {
1711
1711
  const read = readAppRegionsInput(args.regions);
1712
1712
  if (!read.ok) return read;
1713
1713
  const regions = read.regions;
1714
- const auth = await requireSession({ origins, sessionPath });
1714
+ const auth = await requireSession(sessionPath);
1715
1715
  if (!auth.ok) return auth;
1716
1716
  const sub = auth.data.session.sub;
1717
1717
  if (!sub) return { ok: false, error: "session_missing_sub \u2014 re-login" };