@mp-lb/forum-cli 0.1.9 → 0.1.10

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
@@ -18693,7 +18693,8 @@ var listSearchReconciliationStoresInputSchema = external_exports.object({
18693
18693
  touchedAfter: external_exports.string().datetime()
18694
18694
  });
18695
18695
  var listOwnStoresInputSchema = external_exports.object({
18696
- workspaceId: external_exports.string().trim().min(1).optional()
18696
+ workspaceId: external_exports.string().trim().min(1).optional(),
18697
+ workspaceSlug: external_exports.string().trim().min(1).optional()
18697
18698
  });
18698
18699
  var readStoreMetadataInputSchema = external_exports.object({
18699
18700
  workspaceId: storeWorkspaceIdSchema,
@@ -31403,7 +31404,7 @@ var createStoreClient = ({
31403
31404
  );
31404
31405
  return {
31405
31406
  createRawFileUrl: (fileId) => `${apiBaseUrl.replace(/\/+$/, "")}/raw-file/${encodeURIComponent(fileId)}`,
31406
- listStores: () => call("stores.list", () => trpc.stores.list.query({})),
31407
+ listStores: (input = {}) => call("stores.list", () => trpc.stores.list.query(input)),
31407
31408
  createStore: (input) => call("stores.create", () => trpc.stores.create.mutate(input)),
31408
31409
  deleteStore: (input) => call("stores.delete", () => trpc.stores.delete.mutate(input)),
31409
31410
  readStoreByRef: (input) => call("stores.readByRef", () => trpc.stores.readByRef.query(input)),
@@ -32368,10 +32369,10 @@ var usage = `Forum CLI
32368
32369
 
32369
32370
  Usage:
32370
32371
  Remote workspace commands:
32371
- fm store create <storeId|workspace/storeId> [--token <jwt>]
32372
- fm store list [--token <jwt>]
32373
- fm store ls [--token <jwt>]
32374
- fm store info <storeId> [--token <jwt>] [--json]
32372
+ fm store create <storeId|workspace/storeId> [--workspace <slug>] [--token <jwt>]
32373
+ fm store list [--workspace <slug>] [--token <jwt>]
32374
+ fm store ls [--workspace <slug>] [--token <jwt>]
32375
+ fm store info <storeId> [--workspace <slug>] [--token <jwt>] [--json]
32375
32376
  fm store duplicate <sourceStoreId> <newStoreId> [--token <jwt>]
32376
32377
  fm store delete <storeId> [--yes|-y] [--token <jwt>]
32377
32378
  fm file ls [directoryPath] [--store <storeId>] [--token <jwt>]
@@ -32458,6 +32459,7 @@ Usage:
32458
32459
  Store creation:
32459
32460
  fm store create <storeId> creates in defaults.store's workspace from .forum/sync.yaml when present, otherwise in the authenticated workspace.
32460
32461
  fm store create <workspace/storeId> creates in that explicitly selected workspace.
32462
+ For store create, list, and info, --workspace <slug> selects a workspace without changing the saved login.
32461
32463
 
32462
32464
  Auth:
32463
32465
  Provide a Clerk session token via --token or DOCTRINE_TOKEN.
@@ -32518,6 +32520,7 @@ var parseArgs = (argv) => {
32518
32520
  const isSyncCommand = parseArgvCommandName(argv) === "sync";
32519
32521
  const isCatCommand = parseArgvCommandName(argv) === "cat";
32520
32522
  let token = null;
32523
+ let workspace = null;
32521
32524
  const storeFilters = [];
32522
32525
  let searchLimit = null;
32523
32526
  let searchType = null;
@@ -32564,6 +32567,14 @@ var parseArgs = (argv) => {
32564
32567
  index += 1;
32565
32568
  continue;
32566
32569
  }
32570
+ if (current === "--workspace") {
32571
+ if (!next || next.startsWith("-")) {
32572
+ throw new Error("--workspace requires a workspace slug.");
32573
+ }
32574
+ workspace = next;
32575
+ index += 1;
32576
+ continue;
32577
+ }
32567
32578
  if (current === "--store" || current === "-s" && !isCatCommand) {
32568
32579
  storeFilters.push(
32569
32580
  ...(next ?? "").split(",").map((storeId) => storeId.trim()).filter(Boolean)
@@ -32766,6 +32777,7 @@ var parseArgs = (argv) => {
32766
32777
  args: positional,
32767
32778
  conflictPolicy,
32768
32779
  token,
32780
+ workspace,
32769
32781
  storeFilters,
32770
32782
  searchLimit,
32771
32783
  searchType,
@@ -37313,6 +37325,11 @@ var main = async (argv = process.argv.slice(2)) => {
37313
37325
  renderOutput(usage);
37314
37326
  return;
37315
37327
  }
37328
+ if (parsed.workspace && (command !== "store" || !["create", "list", "ls", "info", "metadata"].includes(rest[0] ?? ""))) {
37329
+ throw new Error(
37330
+ "--workspace is supported by store create, list, and info. Use a qualified workspace/store ref for file commands."
37331
+ );
37332
+ }
37316
37333
  assertDryRunSupported(parsed, command, rest);
37317
37334
  if (command === "schema") {
37318
37335
  if (rest.length > 1) {
@@ -37490,7 +37507,7 @@ var main = async (argv = process.argv.slice(2)) => {
37490
37507
  const storePath = await withActivity(
37491
37508
  "Creating store",
37492
37509
  () => createStore(
37493
- storePathInput,
37510
+ parsed.workspace && !storePathInput.includes("/") ? `${parsed.workspace}/${storePathInput}` : storePathInput,
37494
37511
  (input) => client.createStore(input),
37495
37512
  (input) => client.writeTextFileByRef(input)
37496
37513
  )
@@ -37501,7 +37518,11 @@ var main = async (argv = process.argv.slice(2)) => {
37501
37518
  if (subcommand === "list" || subcommand === "ls") {
37502
37519
  await withActivity(
37503
37520
  "Loading stores",
37504
- () => listStores(() => client.listStores())
37521
+ () => listStores(
37522
+ () => client.listStores(
37523
+ parsed.workspace ? { workspaceSlug: parsed.workspace } : {}
37524
+ )
37525
+ )
37505
37526
  );
37506
37527
  return;
37507
37528
  }
@@ -37512,7 +37533,13 @@ var main = async (argv = process.argv.slice(2)) => {
37512
37533
  }
37513
37534
  await withActivity(
37514
37535
  "Loading store",
37515
- () => storeInfo(storeInput, () => client.listStores(), parsed.json)
37536
+ () => storeInfo(
37537
+ storeInput,
37538
+ () => client.listStores(
37539
+ parsed.workspace ? { workspaceSlug: parsed.workspace } : {}
37540
+ ),
37541
+ parsed.json
37542
+ )
37516
37543
  );
37517
37544
  return;
37518
37545
  }