@fluid-app/v2025-06-cli-commands 0.1.8 → 0.1.9

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.
@@ -15,12 +15,12 @@ export function registerUsersMedia(parent: Command, ctx: CommandContext): void {
15
15
  resource
16
16
  .command("list-user-media")
17
17
  .description("List user's media")
18
- .option("--page <value>", "page")
19
- .option("--per-page <value>", "per_page")
20
- .option("--sorted-by <value>", "sorted_by")
21
- .option("--status <value>", "status")
22
- .option("--active <value>", "active")
23
- .option("--search-query <value>", "search_query")
18
+ .option("--page <value>", "Page number for pagination")
19
+ .option("--per-page <value>", "Number of records per page")
20
+ .option("--sorted-by <value>", "Sort order")
21
+ .option("--status <value>", "Filter by status")
22
+ .option("--active <value>", "Filter by active status")
23
+ .option("--search-query <value>", "Search query")
24
24
  .action(async (opts) => {
25
25
  const client = await ctx.getClient();
26
26
  const params: Record<string, unknown> = {};
@@ -33,9 +33,7 @@ export function registerUsersMedia(parent: Command, ctx: CommandContext): void {
33
33
  if (opts.searchQuery !== undefined)
34
34
  params["search_query"] = opts.searchQuery;
35
35
  if (ctx.verbose)
36
- process.stderr.write(
37
- `GET ${new URL(`/api/users/v2025-06/media`, "https://placeholder").pathname}\n`,
38
- );
36
+ process.stderr.write("GET " + `/api/users/v2025-06/media` + "\n");
39
37
  const result = await client.get(`/api/users/v2025-06/media`, params);
40
38
  ctx.output(result);
41
39
  });
@@ -55,9 +53,7 @@ export function registerUsersMedia(parent: Command, ctx: CommandContext): void {
55
53
  body = ctx.parseBody(opts.body);
56
54
  }
57
55
  if (ctx.verbose)
58
- process.stderr.write(
59
- `POST ${new URL(`/api/users/v2025-06/media`, "https://placeholder").pathname}\n`,
60
- );
56
+ process.stderr.write("POST " + `/api/users/v2025-06/media` + "\n");
61
57
  const result = await client.post(`/api/users/v2025-06/media`, body);
62
58
  ctx.output(result);
63
59
  });
@@ -65,12 +61,10 @@ export function registerUsersMedia(parent: Command, ctx: CommandContext): void {
65
61
  resource
66
62
  .command("get-user-media <id>")
67
63
  .description("Get a media")
68
- .action(async (id, opts) => {
64
+ .action(async (id) => {
69
65
  const client = await ctx.getClient();
70
66
  if (ctx.verbose)
71
- process.stderr.write(
72
- `GET ${new URL(`/api/users/v2025-06/media/${id}`, "https://placeholder").pathname}\n`,
73
- );
67
+ process.stderr.write("GET " + `/api/users/v2025-06/media/${id}` + "\n");
74
68
  const result = await client.get(`/api/users/v2025-06/media/${id}`);
75
69
  ctx.output(result);
76
70
  });
@@ -91,7 +85,7 @@ export function registerUsersMedia(parent: Command, ctx: CommandContext): void {
91
85
  }
92
86
  if (ctx.verbose)
93
87
  process.stderr.write(
94
- `PATCH ${new URL(`/api/users/v2025-06/media/${id}`, "https://placeholder").pathname}\n`,
88
+ "PATCH " + `/api/users/v2025-06/media/${id}` + "\n",
95
89
  );
96
90
  const result = await client.patch(
97
91
  `/api/users/v2025-06/media/${id}`,
@@ -103,11 +97,11 @@ export function registerUsersMedia(parent: Command, ctx: CommandContext): void {
103
97
  resource
104
98
  .command("delete-user-media <id>")
105
99
  .description("Delete a media")
106
- .action(async (id, opts) => {
100
+ .action(async (id) => {
107
101
  const client = await ctx.getClient();
108
102
  if (ctx.verbose)
109
103
  process.stderr.write(
110
- `DELETE ${new URL(`/api/users/v2025-06/media/${id}`, "https://placeholder").pathname}\n`,
104
+ "DELETE " + `/api/users/v2025-06/media/${id}` + "\n",
111
105
  );
112
106
  const result = await client.delete(`/api/users/v2025-06/media/${id}`);
113
107
  ctx.output(result);
@@ -20,9 +20,7 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
20
20
  body = ctx.parseBody(opts.body);
21
21
  }
22
22
  if (ctx.verbose)
23
- process.stderr.write(
24
- `POST ${new URL(`/api/users/v2025-06/notes`, "https://placeholder").pathname}\n`,
25
- );
23
+ process.stderr.write("POST " + `/api/users/v2025-06/notes` + "\n");
26
24
  const result = await client.post(`/api/users/v2025-06/notes`, body);
27
25
  ctx.output(result);
28
26
  });
@@ -30,9 +28,9 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
30
28
  resource
31
29
  .command("list-user-notes")
32
30
  .description("List notes for a contact")
33
- .option("--contact-id <value>", "contact_id")
34
- .option("--page <value>", "page")
35
- .option("--per-page <value>", "per_page")
31
+ .option("--contact-id <value>", "Contact ID")
32
+ .option("--page <value>", "Page number (default 1)")
33
+ .option("--per-page <value>", "Items per page (default 10)")
36
34
  .action(async (opts) => {
37
35
  const client = await ctx.getClient();
38
36
  const params: Record<string, unknown> = {};
@@ -41,9 +39,7 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
41
39
  if (opts.page !== undefined) params["page"] = Number(opts.page);
42
40
  if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
43
41
  if (ctx.verbose)
44
- process.stderr.write(
45
- `GET ${new URL(`/api/users/v2025-06/notes`, "https://placeholder").pathname}\n`,
46
- );
42
+ process.stderr.write("GET " + `/api/users/v2025-06/notes` + "\n");
47
43
  const result = await client.get(`/api/users/v2025-06/notes`, params);
48
44
  ctx.output(result);
49
45
  });
@@ -51,7 +47,7 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
51
47
  resource
52
48
  .command("delete-user-note <id>")
53
49
  .description("Delete a note")
54
- .option("--contact-id <value>", "contact_id")
50
+ .option("--contact-id <value>", "Contact ID")
55
51
  .action(async (id, opts) => {
56
52
  const client = await ctx.getClient();
57
53
  const params: Record<string, unknown> = {};
@@ -59,7 +55,7 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
59
55
  params["contact_id"] = Number(opts.contactId);
60
56
  if (ctx.verbose)
61
57
  process.stderr.write(
62
- `DELETE ${new URL(`/api/users/v2025-06/notes/${id}`, "https://placeholder").pathname}\n`,
58
+ "DELETE " + `/api/users/v2025-06/notes/${id}` + "\n",
63
59
  );
64
60
  const result = await client.delete(`/api/users/v2025-06/notes/${id}`, {
65
61
  params,
@@ -70,16 +66,14 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
70
66
  resource
71
67
  .command("get-user-note <id>")
72
68
  .description("Get a note")
73
- .option("--contact-id <value>", "contact_id")
69
+ .option("--contact-id <value>", "Contact ID")
74
70
  .action(async (id, opts) => {
75
71
  const client = await ctx.getClient();
76
72
  const params: Record<string, unknown> = {};
77
73
  if (opts.contactId !== undefined)
78
74
  params["contact_id"] = Number(opts.contactId);
79
75
  if (ctx.verbose)
80
- process.stderr.write(
81
- `GET ${new URL(`/api/users/v2025-06/notes/${id}`, "https://placeholder").pathname}\n`,
82
- );
76
+ process.stderr.write("GET " + `/api/users/v2025-06/notes/${id}` + "\n");
83
77
  const result = await client.get(
84
78
  `/api/users/v2025-06/notes/${id}`,
85
79
  params,
@@ -103,7 +97,7 @@ export function registerUsersNotes(parent: Command, ctx: CommandContext): void {
103
97
  }
104
98
  if (ctx.verbose)
105
99
  process.stderr.write(
106
- `PATCH ${new URL(`/api/users/v2025-06/notes/${id}`, "https://placeholder").pathname}\n`,
100
+ "PATCH " + `/api/users/v2025-06/notes/${id}` + "\n",
107
101
  );
108
102
  const result = await client.patch(
109
103
  `/api/users/v2025-06/notes/${id}`,
@@ -25,9 +25,7 @@ export function registerUsersPlaylists(
25
25
  body = ctx.parseBody(opts.body);
26
26
  }
27
27
  if (ctx.verbose)
28
- process.stderr.write(
29
- `POST ${new URL(`/api/users/v2025-06/playlists`, "https://placeholder").pathname}\n`,
30
- );
28
+ process.stderr.write("POST " + `/api/users/v2025-06/playlists` + "\n");
31
29
  const result = await client.post(`/api/users/v2025-06/playlists`, body);
32
30
  ctx.output(result);
33
31
  });
@@ -35,11 +33,11 @@ export function registerUsersPlaylists(
35
33
  resource
36
34
  .command("list-user-playlists")
37
35
  .description("List user's playlists")
38
- .option("--page-cursor <value>", "page[cursor]")
39
- .option("--page-limit <value>", "page[limit]")
40
- .option("--filter-status <value>", "filter[status]")
41
- .option("--filter-title <value>", "filter[title]")
42
- .option("--sort <value>", "sort")
36
+ .option("--page-cursor <value>", "Cursor for pagination")
37
+ .option("--page-limit <value>", "Number of records per page")
38
+ .option("--filter-status <value>", "Filter playlists by status")
39
+ .option("--filter-title <value>", "Filter playlists by title")
40
+ .option("--sort <value>", "Sort playlists")
43
41
  .action(async (opts) => {
44
42
  const client = await ctx.getClient();
45
43
  const params: Record<string, unknown> = {};
@@ -53,9 +51,7 @@ export function registerUsersPlaylists(
53
51
  params["filter[title]"] = opts.filterTitle;
54
52
  if (opts.sort !== undefined) params["sort"] = opts.sort;
55
53
  if (ctx.verbose)
56
- process.stderr.write(
57
- `GET ${new URL(`/api/users/v2025-06/playlists`, "https://placeholder").pathname}\n`,
58
- );
54
+ process.stderr.write("GET " + `/api/users/v2025-06/playlists` + "\n");
59
55
  const result = await client.get(`/api/users/v2025-06/playlists`, params);
60
56
  ctx.output(result);
61
57
  });
@@ -63,11 +59,11 @@ export function registerUsersPlaylists(
63
59
  resource
64
60
  .command("delete-user-playlist <id>")
65
61
  .description("Delete a playlist")
66
- .action(async (id, opts) => {
62
+ .action(async (id) => {
67
63
  const client = await ctx.getClient();
68
64
  if (ctx.verbose)
69
65
  process.stderr.write(
70
- `DELETE ${new URL(`/api/users/v2025-06/playlists/${id}`, "https://placeholder").pathname}\n`,
66
+ "DELETE " + `/api/users/v2025-06/playlists/${id}` + "\n",
71
67
  );
72
68
  const result = await client.delete(`/api/users/v2025-06/playlists/${id}`);
73
69
  ctx.output(result);
@@ -76,11 +72,11 @@ export function registerUsersPlaylists(
76
72
  resource
77
73
  .command("get-user-playlist <id>")
78
74
  .description("Get a playlist")
79
- .action(async (id, opts) => {
75
+ .action(async (id) => {
80
76
  const client = await ctx.getClient();
81
77
  if (ctx.verbose)
82
78
  process.stderr.write(
83
- `GET ${new URL(`/api/users/v2025-06/playlists/${id}`, "https://placeholder").pathname}\n`,
79
+ "GET " + `/api/users/v2025-06/playlists/${id}` + "\n",
84
80
  );
85
81
  const result = await client.get(`/api/users/v2025-06/playlists/${id}`);
86
82
  ctx.output(result);
@@ -102,7 +98,7 @@ export function registerUsersPlaylists(
102
98
  }
103
99
  if (ctx.verbose)
104
100
  process.stderr.write(
105
- `PATCH ${new URL(`/api/users/v2025-06/playlists/${id}`, "https://placeholder").pathname}\n`,
101
+ "PATCH " + `/api/users/v2025-06/playlists/${id}` + "\n",
106
102
  );
107
103
  const result = await client.patch(
108
104
  `/api/users/v2025-06/playlists/${id}`,
@@ -0,0 +1,82 @@
1
+ // users-products.ts — AUTO-GENERATED, DO NOT EDIT
2
+ import { Command } from "commander";
3
+ import type { CommandContext } from "../lib/types.js";
4
+
5
+ function parseBooleanOption(value: string, flag: string): boolean {
6
+ const normalized = value.trim().toLowerCase();
7
+ if (["true", "1", "yes", "on"].includes(normalized)) return true;
8
+ if (["false", "0", "no", "off"].includes(normalized)) return false;
9
+ throw new Error(`Invalid value for ${flag}: ${value}. Expected true/false.`);
10
+ }
11
+
12
+ export function registerUsersProducts(
13
+ parent: Command,
14
+ ctx: CommandContext,
15
+ ): void {
16
+ const resource = parent
17
+ .command("users-products")
18
+ .description("Users Products");
19
+
20
+ resource
21
+ .command("list-user-products")
22
+ .description("List products")
23
+ .option("--page <value>", "Page number for pagination")
24
+ .option("--per-page <value>", "Number of records per page")
25
+ .option(
26
+ "--status <value>",
27
+ "Filter by status. Supported values: 'active', 'draft', 'archived'.",
28
+ )
29
+ .option(
30
+ "--availability <value>",
31
+ "Filter by availability. Supported values: 'All', 'in_stock'. If not specified, returns all products.",
32
+ )
33
+ .option("--search-query <value>", "Search products by title or variant SKU")
34
+ .option("--category-ids <value>", "Filter by category IDs")
35
+ .option("--collection-ids <value>", "Filter by collection IDs")
36
+ .option("--country-code <value>", "Filter by country codes")
37
+ .option(
38
+ "--bundle <value>",
39
+ "Filter by bundle status. true returns only bundles, false returns only non-bundles.",
40
+ )
41
+ .option(
42
+ "--order-by <value>",
43
+ "Sort results by specified field and direction (e.g. ['price', 'asc'])",
44
+ )
45
+ .action(async (opts) => {
46
+ const client = await ctx.getClient();
47
+ const params: Record<string, unknown> = {};
48
+ if (opts.page !== undefined) params["page"] = Number(opts.page);
49
+ if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
50
+ if (opts.status !== undefined) params["status[]"] = opts.status;
51
+ if (opts.availability !== undefined)
52
+ params["availability[]"] = opts.availability;
53
+ if (opts.searchQuery !== undefined)
54
+ params["search_query"] = opts.searchQuery;
55
+ if (opts.categoryIds !== undefined)
56
+ params["category_ids[]"] = opts.categoryIds;
57
+ if (opts.collectionIds !== undefined)
58
+ params["collection_ids[]"] = opts.collectionIds;
59
+ if (opts.countryCode !== undefined)
60
+ params["country_code[]"] = opts.countryCode;
61
+ if (opts.bundle !== undefined)
62
+ params["bundle"] = parseBooleanOption(opts.bundle, "--bundle");
63
+ if (opts.orderBy !== undefined) params["order_by[]"] = opts.orderBy;
64
+ if (ctx.verbose)
65
+ process.stderr.write("GET " + `/api/users/v2025-06/products` + "\n");
66
+ const result = await client.get(`/api/users/v2025-06/products`, params);
67
+ ctx.output(result);
68
+ });
69
+
70
+ resource
71
+ .command("get-user-product <id>")
72
+ .description("Get a product")
73
+ .action(async (id) => {
74
+ const client = await ctx.getClient();
75
+ if (ctx.verbose)
76
+ process.stderr.write(
77
+ "GET " + `/api/users/v2025-06/products/${id}` + "\n",
78
+ );
79
+ const result = await client.get(`/api/users/v2025-06/products/${id}`);
80
+ ctx.output(result);
81
+ });
82
+ }
@@ -8,11 +8,11 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
8
8
  resource
9
9
  .command("complete-user-task <id>")
10
10
  .description("Toggle task completion")
11
- .action(async (id, opts) => {
11
+ .action(async (id) => {
12
12
  const client = await ctx.getClient();
13
13
  if (ctx.verbose)
14
14
  process.stderr.write(
15
- `POST ${new URL(`/api/users/v2025-06/tasks/${id}/complete`, "https://placeholder").pathname}\n`,
15
+ "POST " + `/api/users/v2025-06/tasks/${id}/complete` + "\n",
16
16
  );
17
17
  const result = await client.post(
18
18
  `/api/users/v2025-06/tasks/${id}/complete`,
@@ -35,9 +35,7 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
35
35
  body = ctx.parseBody(opts.body);
36
36
  }
37
37
  if (ctx.verbose)
38
- process.stderr.write(
39
- `POST ${new URL(`/api/users/v2025-06/tasks`, "https://placeholder").pathname}\n`,
40
- );
38
+ process.stderr.write("POST " + `/api/users/v2025-06/tasks` + "\n");
41
39
  const result = await client.post(`/api/users/v2025-06/tasks`, body);
42
40
  ctx.output(result);
43
41
  });
@@ -45,10 +43,13 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
45
43
  resource
46
44
  .command("list-user-tasks")
47
45
  .description("List tasks for the current user")
48
- .option("--page <value>", "page")
49
- .option("--per-page <value>", "per_page")
50
- .option("--contact-id <value>", "contact_id")
51
- .option("--status <value>", "status")
46
+ .option("--page <value>", "Page number")
47
+ .option("--per-page <value>", "Items per page (max 100)")
48
+ .option("--contact-id <value>", "Filter by contact ID")
49
+ .option(
50
+ "--status <value>",
51
+ "Filter by status (pending, completed, overdue)",
52
+ )
52
53
  .action(async (opts) => {
53
54
  const client = await ctx.getClient();
54
55
  const params: Record<string, unknown> = {};
@@ -58,9 +59,7 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
58
59
  params["contact_id"] = Number(opts.contactId);
59
60
  if (opts.status !== undefined) params["status"] = opts.status;
60
61
  if (ctx.verbose)
61
- process.stderr.write(
62
- `GET ${new URL(`/api/users/v2025-06/tasks`, "https://placeholder").pathname}\n`,
63
- );
62
+ process.stderr.write("GET " + `/api/users/v2025-06/tasks` + "\n");
64
63
  const result = await client.get(`/api/users/v2025-06/tasks`, params);
65
64
  ctx.output(result);
66
65
  });
@@ -68,11 +67,11 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
68
67
  resource
69
68
  .command("delete-user-task <id>")
70
69
  .description("Delete a task")
71
- .action(async (id, opts) => {
70
+ .action(async (id) => {
72
71
  const client = await ctx.getClient();
73
72
  if (ctx.verbose)
74
73
  process.stderr.write(
75
- `DELETE ${new URL(`/api/users/v2025-06/tasks/${id}`, "https://placeholder").pathname}\n`,
74
+ "DELETE " + `/api/users/v2025-06/tasks/${id}` + "\n",
76
75
  );
77
76
  const result = await client.delete(`/api/users/v2025-06/tasks/${id}`);
78
77
  ctx.output(result);
@@ -81,12 +80,10 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
81
80
  resource
82
81
  .command("get-user-task <id>")
83
82
  .description("Get a task")
84
- .action(async (id, opts) => {
83
+ .action(async (id) => {
85
84
  const client = await ctx.getClient();
86
85
  if (ctx.verbose)
87
- process.stderr.write(
88
- `GET ${new URL(`/api/users/v2025-06/tasks/${id}`, "https://placeholder").pathname}\n`,
89
- );
86
+ process.stderr.write("GET " + `/api/users/v2025-06/tasks/${id}` + "\n");
90
87
  const result = await client.get(`/api/users/v2025-06/tasks/${id}`);
91
88
  ctx.output(result);
92
89
  });
@@ -107,7 +104,7 @@ export function registerUsersTasks(parent: Command, ctx: CommandContext): void {
107
104
  }
108
105
  if (ctx.verbose)
109
106
  process.stderr.write(
110
- `PATCH ${new URL(`/api/users/v2025-06/tasks/${id}`, "https://placeholder").pathname}\n`,
107
+ "PATCH " + `/api/users/v2025-06/tasks/${id}` + "\n",
111
108
  );
112
109
  const result = await client.patch(
113
110
  `/api/users/v2025-06/tasks/${id}`,