@fluid-app/v2025-06-cli-commands 0.1.31 → 0.1.33

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.
@@ -2,13 +2,8 @@
2
2
  import { Command } from "commander";
3
3
  import type { CommandContext } from "../lib/types.js";
4
4
 
5
- export function registerMediaEnrollmentPacks(
6
- parent: Command,
7
- ctx: CommandContext,
8
- ): void {
9
- const resource = parent
10
- .command("media-enrollment-packs")
11
- .description("MediaEnrollmentPacks");
5
+ export function registerMediaEnrollmentPacks(parent: Command, ctx: CommandContext): void {
6
+ const resource = parent.command("media-enrollment-packs").description("MediaEnrollmentPacks");
12
7
 
13
8
  resource
14
9
  .command("list <media-id>")
@@ -18,14 +13,8 @@ export function registerMediaEnrollmentPacks(
18
13
  const client = await ctx.getClient();
19
14
  const params: Record<string, unknown> = {};
20
15
  if (opts.page !== undefined) params["page"] = opts.page;
21
- if (ctx.verbose)
22
- process.stderr.write(
23
- "GET " + `/api/v2025-06/media/${mediaId}/enrollment_packs` + "\n",
24
- );
25
- const result = await client.get(
26
- `/api/v2025-06/media/${mediaId}/enrollment_packs`,
27
- params,
28
- );
16
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/media/${mediaId}/enrollment_packs` + "\n");
17
+ const result = await client.get(`/api/v2025-06/media/${mediaId}/enrollment_packs`, params);
29
18
  ctx.output(result);
30
19
  });
31
20
 
@@ -43,14 +32,8 @@ export function registerMediaEnrollmentPacks(
43
32
  } else if (opts.body) {
44
33
  body = ctx.parseBody(opts.body);
45
34
  }
46
- if (ctx.verbose)
47
- process.stderr.write(
48
- "POST " + `/api/v2025-06/media/${mediaId}/enrollment_packs` + "\n",
49
- );
50
- const result = await client.post(
51
- `/api/v2025-06/media/${mediaId}/enrollment_packs`,
52
- body,
53
- );
35
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/media/${mediaId}/enrollment_packs` + "\n");
36
+ const result = await client.post(`/api/v2025-06/media/${mediaId}/enrollment_packs`, body);
54
37
  ctx.output(result);
55
38
  });
56
39
 
@@ -59,15 +42,9 @@ export function registerMediaEnrollmentPacks(
59
42
  .description("Enrollment Pack removed from media")
60
43
  .action(async (mediaId, id) => {
61
44
  const client = await ctx.getClient();
62
- if (ctx.verbose)
63
- process.stderr.write(
64
- "DELETE " +
65
- `/api/v2025-06/media/${mediaId}/enrollment_packs/${id}` +
66
- "\n",
67
- );
68
- const result = await client.delete(
69
- `/api/v2025-06/media/${mediaId}/enrollment_packs/${id}`,
70
- );
45
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/media/${mediaId}/enrollment_packs/${id}` + "\n");
46
+ const result = await client.delete(`/api/v2025-06/media/${mediaId}/enrollment_packs/${id}`);
71
47
  ctx.output(result);
72
48
  });
49
+
73
50
  }
@@ -2,13 +2,8 @@
2
2
  import { Command } from "commander";
3
3
  import type { CommandContext } from "../lib/types.js";
4
4
 
5
- export function registerMediaProducts(
6
- parent: Command,
7
- ctx: CommandContext,
8
- ): void {
9
- const resource = parent
10
- .command("media-products")
11
- .description("MediaProducts");
5
+ export function registerMediaProducts(parent: Command, ctx: CommandContext): void {
6
+ const resource = parent.command("media-products").description("MediaProducts");
12
7
 
13
8
  resource
14
9
  .command("list <media-id>")
@@ -18,14 +13,8 @@ export function registerMediaProducts(
18
13
  const client = await ctx.getClient();
19
14
  const params: Record<string, unknown> = {};
20
15
  if (opts.page !== undefined) params["page"] = opts.page;
21
- if (ctx.verbose)
22
- process.stderr.write(
23
- "GET " + `/api/v2025-06/media/${mediaId}/products` + "\n",
24
- );
25
- const result = await client.get(
26
- `/api/v2025-06/media/${mediaId}/products`,
27
- params,
28
- );
16
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/media/${mediaId}/products` + "\n");
17
+ const result = await client.get(`/api/v2025-06/media/${mediaId}/products`, params);
29
18
  ctx.output(result);
30
19
  });
31
20
 
@@ -43,14 +32,8 @@ export function registerMediaProducts(
43
32
  } else if (opts.body) {
44
33
  body = ctx.parseBody(opts.body);
45
34
  }
46
- if (ctx.verbose)
47
- process.stderr.write(
48
- "POST " + `/api/v2025-06/media/${mediaId}/products` + "\n",
49
- );
50
- const result = await client.post(
51
- `/api/v2025-06/media/${mediaId}/products`,
52
- body,
53
- );
35
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/media/${mediaId}/products` + "\n");
36
+ const result = await client.post(`/api/v2025-06/media/${mediaId}/products`, body);
54
37
  ctx.output(result);
55
38
  });
56
39
 
@@ -59,13 +42,9 @@ export function registerMediaProducts(
59
42
  .description("Product removed from media")
60
43
  .action(async (mediaId, id) => {
61
44
  const client = await ctx.getClient();
62
- if (ctx.verbose)
63
- process.stderr.write(
64
- "DELETE " + `/api/v2025-06/media/${mediaId}/products/${id}` + "\n",
65
- );
66
- const result = await client.delete(
67
- `/api/v2025-06/media/${mediaId}/products/${id}`,
68
- );
45
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/media/${mediaId}/products/${id}` + "\n");
46
+ const result = await client.delete(`/api/v2025-06/media/${mediaId}/products/${id}`);
69
47
  ctx.output(result);
70
48
  });
49
+
71
50
  }
@@ -13,8 +13,7 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
13
13
  const client = await ctx.getClient();
14
14
  const params: Record<string, unknown> = {};
15
15
  if (opts.params !== undefined) params["params"] = opts.params;
16
- if (ctx.verbose)
17
- process.stderr.write("GET " + `/api/v202506/orders/export_csv` + "\n");
16
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/export_csv` + "\n");
18
17
  const result = await client.get(`/api/v202506/orders/export_csv`, params);
19
18
  ctx.output(result);
20
19
  });
@@ -22,16 +21,12 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
22
21
  resource
23
22
  .command("list")
24
23
  .description("List orders")
25
- .option(
26
- "--params <value>",
27
- "Query parameters for filtering, pagination, and sorting",
28
- )
24
+ .option("--params <value>", "Query parameters for filtering, pagination, and sorting")
29
25
  .action(async (opts) => {
30
26
  const client = await ctx.getClient();
31
27
  const params: Record<string, unknown> = {};
32
28
  if (opts.params !== undefined) params["params"] = opts.params;
33
- if (ctx.verbose)
34
- process.stderr.write("GET " + `/api/v202506/orders` + "\n");
29
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders` + "\n");
35
30
  const result = await client.get(`/api/v202506/orders`, params);
36
31
  ctx.output(result);
37
32
  });
@@ -41,8 +36,7 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
41
36
  .description("Get an order")
42
37
  .action(async (id) => {
43
38
  const client = await ctx.getClient();
44
- if (ctx.verbose)
45
- process.stderr.write("GET " + `/api/v202506/orders/${id}` + "\n");
39
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/${id}` + "\n");
46
40
  const result = await client.get(`/api/v202506/orders/${id}`);
47
41
  ctx.output(result);
48
42
  });
@@ -55,9 +49,9 @@ export function registerOrders(parent: Command, ctx: CommandContext): void {
55
49
  const client = await ctx.getClient();
56
50
  const params: Record<string, unknown> = {};
57
51
  if (opts.params !== undefined) params["params"] = opts.params;
58
- if (ctx.verbose)
59
- process.stderr.write("GET " + `/api/v202506/orders/stats` + "\n");
52
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v202506/orders/stats` + "\n");
60
53
  const result = await client.get(`/api/v202506/orders/stats`, params);
61
54
  ctx.output(result);
62
55
  });
56
+
63
57
  }
@@ -2,21 +2,15 @@
2
2
  import { Command } from "commander";
3
3
  import type { CommandContext } from "../lib/types.js";
4
4
 
5
- export function registerPartnerTokens(
6
- parent: Command,
7
- ctx: CommandContext,
8
- ): void {
9
- const resource = parent
10
- .command("partner-tokens")
11
- .description("Partner Tokens");
5
+ export function registerPartnerTokens(parent: Command, ctx: CommandContext): void {
6
+ const resource = parent.command("partner-tokens").description("Partner Tokens");
12
7
 
13
8
  resource
14
9
  .command("list-deprecated")
15
10
  .description("returns an array of partner tokens")
16
11
  .action(async () => {
17
12
  const client = await ctx.getClient();
18
- if (ctx.verbose)
19
- process.stderr.write("GET " + `/api/v2025-06/partner_tokens` + "\n");
13
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/partner_tokens` + "\n");
20
14
  const result = await client.get(`/api/v2025-06/partner_tokens`);
21
15
  ctx.output(result);
22
16
  });
@@ -35,8 +29,7 @@ export function registerPartnerTokens(
35
29
  } else if (opts.body) {
36
30
  body = ctx.parseBody(opts.body);
37
31
  }
38
- if (ctx.verbose)
39
- process.stderr.write("POST " + `/api/v2025-06/partner_tokens` + "\n");
32
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/partner_tokens` + "\n");
40
33
  const result = await client.post(`/api/v2025-06/partner_tokens`, body);
41
34
  ctx.output(result);
42
35
  });
@@ -46,10 +39,7 @@ export function registerPartnerTokens(
46
39
  .description("returns a specific partner token")
47
40
  .action(async (id) => {
48
41
  const client = await ctx.getClient();
49
- if (ctx.verbose)
50
- process.stderr.write(
51
- "GET " + `/api/v2025-06/partner_tokens/${id}` + "\n",
52
- );
42
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/partner_tokens/${id}` + "\n");
53
43
  const result = await client.get(`/api/v2025-06/partner_tokens/${id}`);
54
44
  ctx.output(result);
55
45
  });
@@ -68,14 +58,8 @@ export function registerPartnerTokens(
68
58
  } else if (opts.body) {
69
59
  body = ctx.parseBody(opts.body);
70
60
  }
71
- if (ctx.verbose)
72
- process.stderr.write(
73
- "PUT " + `/api/v2025-06/partner_tokens/${id}` + "\n",
74
- );
75
- const result = await client.put(
76
- `/api/v2025-06/partner_tokens/${id}`,
77
- body,
78
- );
61
+ if (ctx.verbose) process.stderr.write("PUT " + `/api/v2025-06/partner_tokens/${id}` + "\n");
62
+ const result = await client.put(`/api/v2025-06/partner_tokens/${id}`, body);
79
63
  ctx.output(result);
80
64
  });
81
65
 
@@ -84,10 +68,7 @@ export function registerPartnerTokens(
84
68
  .description("deletes a partner token")
85
69
  .action(async (id) => {
86
70
  const client = await ctx.getClient();
87
- if (ctx.verbose)
88
- process.stderr.write(
89
- "DELETE " + `/api/v2025-06/partner_tokens/${id}` + "\n",
90
- );
71
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/partner_tokens/${id}` + "\n");
91
72
  const result = await client.delete(`/api/v2025-06/partner_tokens/${id}`);
92
73
  ctx.output(result);
93
74
  });
@@ -97,8 +78,7 @@ export function registerPartnerTokens(
97
78
  .description("returns an array of partner tokens")
98
79
  .action(async () => {
99
80
  const client = await ctx.getClient();
100
- if (ctx.verbose)
101
- process.stderr.write("GET " + `/api/v2025-06/tokens/partner` + "\n");
81
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/tokens/partner` + "\n");
102
82
  const result = await client.get(`/api/v2025-06/tokens/partner`);
103
83
  ctx.output(result);
104
84
  });
@@ -117,8 +97,7 @@ export function registerPartnerTokens(
117
97
  } else if (opts.body) {
118
98
  body = ctx.parseBody(opts.body);
119
99
  }
120
- if (ctx.verbose)
121
- process.stderr.write("POST " + `/api/v2025-06/tokens/partner` + "\n");
100
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/tokens/partner` + "\n");
122
101
  const result = await client.post(`/api/v2025-06/tokens/partner`, body);
123
102
  ctx.output(result);
124
103
  });
@@ -128,10 +107,7 @@ export function registerPartnerTokens(
128
107
  .description("returns a specific partner token")
129
108
  .action(async (id) => {
130
109
  const client = await ctx.getClient();
131
- if (ctx.verbose)
132
- process.stderr.write(
133
- "GET " + `/api/v2025-06/tokens/partner/${id}` + "\n",
134
- );
110
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/tokens/partner/${id}` + "\n");
135
111
  const result = await client.get(`/api/v2025-06/tokens/partner/${id}`);
136
112
  ctx.output(result);
137
113
  });
@@ -150,14 +126,8 @@ export function registerPartnerTokens(
150
126
  } else if (opts.body) {
151
127
  body = ctx.parseBody(opts.body);
152
128
  }
153
- if (ctx.verbose)
154
- process.stderr.write(
155
- "PUT " + `/api/v2025-06/tokens/partner/${id}` + "\n",
156
- );
157
- const result = await client.put(
158
- `/api/v2025-06/tokens/partner/${id}`,
159
- body,
160
- );
129
+ if (ctx.verbose) process.stderr.write("PUT " + `/api/v2025-06/tokens/partner/${id}` + "\n");
130
+ const result = await client.put(`/api/v2025-06/tokens/partner/${id}`, body);
161
131
  ctx.output(result);
162
132
  });
163
133
 
@@ -166,11 +136,9 @@ export function registerPartnerTokens(
166
136
  .description("deletes a partner token")
167
137
  .action(async (id) => {
168
138
  const client = await ctx.getClient();
169
- if (ctx.verbose)
170
- process.stderr.write(
171
- "DELETE " + `/api/v2025-06/tokens/partner/${id}` + "\n",
172
- );
139
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/tokens/partner/${id}` + "\n");
173
140
  const result = await client.delete(`/api/v2025-06/tokens/partner/${id}`);
174
141
  ctx.output(result);
175
142
  });
143
+
176
144
  }
@@ -19,14 +19,8 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
19
19
  } else if (opts.body) {
20
20
  body = ctx.parseBody(opts.body);
21
21
  }
22
- if (ctx.verbose)
23
- process.stderr.write(
24
- "POST " + `/api/v2025-06/playlists/${playlistId}/clone` + "\n",
25
- );
26
- const result = await client.post(
27
- `/api/v2025-06/playlists/${playlistId}/clone`,
28
- body,
29
- );
22
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/playlists/${playlistId}/clone` + "\n");
23
+ const result = await client.post(`/api/v2025-06/playlists/${playlistId}/clone`, body);
30
24
  ctx.output(result);
31
25
  });
32
26
 
@@ -44,14 +38,8 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
44
38
  } else if (opts.body) {
45
39
  body = ctx.parseBody(opts.body);
46
40
  }
47
- if (ctx.verbose)
48
- process.stderr.write(
49
- "POST " + `/api/v2025-06/playlists/${playlistId}/items` + "\n",
50
- );
51
- const result = await client.post(
52
- `/api/v2025-06/playlists/${playlistId}/items`,
53
- body,
54
- );
41
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/playlists/${playlistId}/items` + "\n");
42
+ const result = await client.post(`/api/v2025-06/playlists/${playlistId}/items`, body);
55
43
  ctx.output(result);
56
44
  });
57
45
 
@@ -69,14 +57,8 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
69
57
  } else if (opts.body) {
70
58
  body = ctx.parseBody(opts.body);
71
59
  }
72
- if (ctx.verbose)
73
- process.stderr.write(
74
- "DELETE " + `/api/v2025-06/playlists/${playlistId}/items` + "\n",
75
- );
76
- const result = await client.delete(
77
- `/api/v2025-06/playlists/${playlistId}/items`,
78
- { body },
79
- );
60
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/playlists/${playlistId}/items` + "\n");
61
+ const result = await client.delete(`/api/v2025-06/playlists/${playlistId}/items`, { body });
80
62
  ctx.output(result);
81
63
  });
82
64
 
@@ -94,8 +76,7 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
94
76
  } else if (opts.body) {
95
77
  body = ctx.parseBody(opts.body);
96
78
  }
97
- if (ctx.verbose)
98
- process.stderr.write("POST " + `/api/v2025-06/playlists` + "\n");
79
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/playlists` + "\n");
99
80
  const result = await client.post(`/api/v2025-06/playlists`, body);
100
81
  ctx.output(result);
101
82
  });
@@ -110,16 +91,11 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
110
91
  .action(async (opts) => {
111
92
  const client = await ctx.getClient();
112
93
  const params: Record<string, unknown> = {};
113
- if (opts.pageCursor !== undefined)
114
- params["page[cursor]"] = opts.pageCursor;
115
- if (opts.pageLimit !== undefined)
116
- params["page[limit]"] = Number(opts.pageLimit);
117
- if (opts.filterStatus !== undefined)
118
- params["filter[status]"] = opts.filterStatus;
119
- if (opts.filterTitle !== undefined)
120
- params["filter[title]"] = opts.filterTitle;
121
- if (ctx.verbose)
122
- process.stderr.write("GET " + `/api/v2025-06/playlists` + "\n");
94
+ if (opts.pageCursor !== undefined) params["page[cursor]"] = opts.pageCursor;
95
+ if (opts.pageLimit !== undefined) params["page[limit]"] = Number(opts.pageLimit);
96
+ if (opts.filterStatus !== undefined) params["filter[status]"] = opts.filterStatus;
97
+ if (opts.filterTitle !== undefined) params["filter[title]"] = opts.filterTitle;
98
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/playlists` + "\n");
123
99
  const result = await client.get(`/api/v2025-06/playlists`, params);
124
100
  ctx.output(result);
125
101
  });
@@ -129,10 +105,7 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
129
105
  .description("delete playlist")
130
106
  .action(async (id) => {
131
107
  const client = await ctx.getClient();
132
- if (ctx.verbose)
133
- process.stderr.write(
134
- "DELETE " + `/api/v2025-06/playlists/${id}` + "\n",
135
- );
108
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/playlists/${id}` + "\n");
136
109
  const result = await client.delete(`/api/v2025-06/playlists/${id}`);
137
110
  ctx.output(result);
138
111
  });
@@ -142,8 +115,7 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
142
115
  .description("show playlist")
143
116
  .action(async (id) => {
144
117
  const client = await ctx.getClient();
145
- if (ctx.verbose)
146
- process.stderr.write("GET " + `/api/v2025-06/playlists/${id}` + "\n");
118
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/playlists/${id}` + "\n");
147
119
  const result = await client.get(`/api/v2025-06/playlists/${id}`);
148
120
  ctx.output(result);
149
121
  });
@@ -162,8 +134,7 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
162
134
  } else if (opts.body) {
163
135
  body = ctx.parseBody(opts.body);
164
136
  }
165
- if (ctx.verbose)
166
- process.stderr.write("PATCH " + `/api/v2025-06/playlists/${id}` + "\n");
137
+ if (ctx.verbose) process.stderr.write("PATCH " + `/api/v2025-06/playlists/${id}` + "\n");
167
138
  const result = await client.patch(`/api/v2025-06/playlists/${id}`, body);
168
139
  ctx.output(result);
169
140
  });
@@ -171,10 +142,7 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
171
142
  resource
172
143
  .command("get-shareable-items")
173
144
  .description("search shareable items")
174
- .option(
175
- "--type <value>",
176
- "Type of resource to search for ('Page', 'Product', 'Promotion', 'EnrollmentPack', 'Medium')",
177
- )
145
+ .option("--type <value>", "Type of resource to search for ('Page', 'Product', 'Promotion', 'EnrollmentPack', 'Medium')")
178
146
  .option("--search <value>", "Search term to filter items by title")
179
147
  .option("--country-id <value>", "Country ID to filter items")
180
148
  .action(async (opts) => {
@@ -182,16 +150,10 @@ export function registerPlaylists(parent: Command, ctx: CommandContext): void {
182
150
  const params: Record<string, unknown> = {};
183
151
  if (opts.type !== undefined) params["type"] = opts.type;
184
152
  if (opts.search !== undefined) params["search"] = opts.search;
185
- if (opts.countryId !== undefined)
186
- params["country_id"] = Number(opts.countryId);
187
- if (ctx.verbose)
188
- process.stderr.write(
189
- "GET " + `/api/v2025-06/playlists/shareables` + "\n",
190
- );
191
- const result = await client.get(
192
- `/api/v2025-06/playlists/shareables`,
193
- params,
194
- );
153
+ if (opts.countryId !== undefined) params["country_id"] = Number(opts.countryId);
154
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/playlists/shareables` + "\n");
155
+ const result = await client.get(`/api/v2025-06/playlists/shareables`, params);
195
156
  ctx.output(result);
196
157
  });
158
+
197
159
  }
@@ -2,10 +2,7 @@
2
2
  import { Command } from "commander";
3
3
  import type { CommandContext } from "../lib/types.js";
4
4
 
5
- export function registerProductMedia(
6
- parent: Command,
7
- ctx: CommandContext,
8
- ): void {
5
+ export function registerProductMedia(parent: Command, ctx: CommandContext): void {
9
6
  const resource = parent.command("product-media").description("ProductMedia");
10
7
 
11
8
  resource
@@ -16,14 +13,8 @@ export function registerProductMedia(
16
13
  const client = await ctx.getClient();
17
14
  const params: Record<string, unknown> = {};
18
15
  if (opts.page !== undefined) params["page"] = opts.page;
19
- if (ctx.verbose)
20
- process.stderr.write(
21
- "GET " + `/api/v2025-06/products/${productId}/media` + "\n",
22
- );
23
- const result = await client.get(
24
- `/api/v2025-06/products/${productId}/media`,
25
- params,
26
- );
16
+ if (ctx.verbose) process.stderr.write("GET " + `/api/v2025-06/products/${productId}/media` + "\n");
17
+ const result = await client.get(`/api/v2025-06/products/${productId}/media`, params);
27
18
  ctx.output(result);
28
19
  });
29
20
 
@@ -41,14 +32,8 @@ export function registerProductMedia(
41
32
  } else if (opts.body) {
42
33
  body = ctx.parseBody(opts.body);
43
34
  }
44
- if (ctx.verbose)
45
- process.stderr.write(
46
- "POST " + `/api/v2025-06/products/${productId}/media` + "\n",
47
- );
48
- const result = await client.post(
49
- `/api/v2025-06/products/${productId}/media`,
50
- body,
51
- );
35
+ if (ctx.verbose) process.stderr.write("POST " + `/api/v2025-06/products/${productId}/media` + "\n");
36
+ const result = await client.post(`/api/v2025-06/products/${productId}/media`, body);
52
37
  ctx.output(result);
53
38
  });
54
39
 
@@ -57,13 +42,9 @@ export function registerProductMedia(
57
42
  .description("Media removed from product")
58
43
  .action(async (productId, id) => {
59
44
  const client = await ctx.getClient();
60
- if (ctx.verbose)
61
- process.stderr.write(
62
- "DELETE " + `/api/v2025-06/products/${productId}/media/${id}` + "\n",
63
- );
64
- const result = await client.delete(
65
- `/api/v2025-06/products/${productId}/media/${id}`,
66
- );
45
+ if (ctx.verbose) process.stderr.write("DELETE " + `/api/v2025-06/products/${productId}/media/${id}` + "\n");
46
+ const result = await client.delete(`/api/v2025-06/products/${productId}/media/${id}`);
67
47
  ctx.output(result);
68
48
  });
49
+
69
50
  }