@fluid-app/v2025-06-cli-commands 0.1.0
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/.turbo/turbo-build.log +18 -0
- package/dist/index.d.mts +7 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1969 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
- package/scripts/generate-cli-commands.ts +17 -0
- package/src/generated/company-contacts.ts +108 -0
- package/src/generated/compliance.ts +819 -0
- package/src/generated/customers.ts +139 -0
- package/src/generated/default.ts +35 -0
- package/src/generated/email-settings.ts +50 -0
- package/src/generated/enrollment-pack-media.ts +71 -0
- package/src/generated/fair-share-settings.ts +50 -0
- package/src/generated/index.ts +52 -0
- package/src/generated/lighthouse.ts +819 -0
- package/src/generated/media-enrollment-packs.ts +71 -0
- package/src/generated/media-products.ts +71 -0
- package/src/generated/partner-tokens.ts +184 -0
- package/src/generated/playlists.ts +202 -0
- package/src/generated/product-media.ts +69 -0
- package/src/generated/reps.ts +307 -0
- package/src/generated/share-statistics.ts +126 -0
- package/src/generated/users-contacts.ts +300 -0
- package/src/generated/users-media.ts +115 -0
- package/src/generated/users-notes.ts +114 -0
- package/src/generated/users-playlists.ts +113 -0
- package/src/generated/users-tasks.ts +118 -0
- package/src/generated/widgets.ts +423 -0
- package/src/index.ts +20 -0
- package/src/lib/types.ts +2 -0
- package/tsconfig.json +10 -0
- package/tsdown.config.ts +12 -0
|
@@ -0,0 +1,819 @@
|
|
|
1
|
+
// compliance.ts — AUTO-GENERATED, DO NOT EDIT
|
|
2
|
+
import { Command } from "commander";
|
|
3
|
+
import type { CommandContext } from "../lib/types.js";
|
|
4
|
+
|
|
5
|
+
export function registerCompliance(parent: Command, ctx: CommandContext): void {
|
|
6
|
+
const resource = parent.command("compliance").description("Compliance");
|
|
7
|
+
|
|
8
|
+
resource
|
|
9
|
+
.command("get-latest-product-compliance <product-id>")
|
|
10
|
+
.description("Get latest compliance scan for a product")
|
|
11
|
+
.action(async (productId, opts) => {
|
|
12
|
+
const client = await ctx.getClient();
|
|
13
|
+
if (ctx.verbose)
|
|
14
|
+
process.stderr.write(
|
|
15
|
+
`GET ${new URL(`/api/v202506/products/${productId}/compliance`, "https://placeholder").pathname}\n`,
|
|
16
|
+
);
|
|
17
|
+
const result = await client.get(
|
|
18
|
+
`/api/v202506/products/${productId}/compliance`,
|
|
19
|
+
);
|
|
20
|
+
ctx.output(result);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
resource
|
|
24
|
+
.command("list-product-compliances <product-id>")
|
|
25
|
+
.description("List all compliance scans for a product")
|
|
26
|
+
.option("--page <value>", "page")
|
|
27
|
+
.option("--per-page <value>", "per_page")
|
|
28
|
+
.action(async (productId, opts) => {
|
|
29
|
+
const client = await ctx.getClient();
|
|
30
|
+
const params: Record<string, unknown> = {};
|
|
31
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
32
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
33
|
+
if (ctx.verbose)
|
|
34
|
+
process.stderr.write(
|
|
35
|
+
`GET ${new URL(`/api/v202506/products/${productId}/compliances`, "https://placeholder").pathname}\n`,
|
|
36
|
+
);
|
|
37
|
+
const result = await client.get(
|
|
38
|
+
`/api/v202506/products/${productId}/compliances`,
|
|
39
|
+
params,
|
|
40
|
+
);
|
|
41
|
+
ctx.output(result);
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
resource
|
|
45
|
+
.command("create-product-compliance <product-id>")
|
|
46
|
+
.description("Create a new compliance scan for a product")
|
|
47
|
+
.option("--body <json>", "Request body as JSON string")
|
|
48
|
+
.option("--body-file <path>", "Read request body from file")
|
|
49
|
+
.action(async (productId, opts) => {
|
|
50
|
+
const client = await ctx.getClient();
|
|
51
|
+
let body: unknown;
|
|
52
|
+
if (opts.bodyFile) {
|
|
53
|
+
const { readFileSync } = await import("fs");
|
|
54
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
55
|
+
} else if (opts.body) {
|
|
56
|
+
body = ctx.parseBody(opts.body);
|
|
57
|
+
}
|
|
58
|
+
if (ctx.verbose)
|
|
59
|
+
process.stderr.write(
|
|
60
|
+
`POST ${new URL(`/api/v202506/products/${productId}/compliances`, "https://placeholder").pathname}\n`,
|
|
61
|
+
);
|
|
62
|
+
const result = await client.post(
|
|
63
|
+
`/api/v202506/products/${productId}/compliances`,
|
|
64
|
+
body,
|
|
65
|
+
);
|
|
66
|
+
ctx.output(result);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
resource
|
|
70
|
+
.command("get-product-compliance <product-id> <id>")
|
|
71
|
+
.description("Get a specific compliance scan for a product")
|
|
72
|
+
.action(async (productId, id, opts) => {
|
|
73
|
+
const client = await ctx.getClient();
|
|
74
|
+
if (ctx.verbose)
|
|
75
|
+
process.stderr.write(
|
|
76
|
+
`GET ${new URL(`/api/v202506/products/${productId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
77
|
+
);
|
|
78
|
+
const result = await client.get(
|
|
79
|
+
`/api/v202506/products/${productId}/compliances/${id}`,
|
|
80
|
+
);
|
|
81
|
+
ctx.output(result);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
resource
|
|
85
|
+
.command("update-product-compliance <product-id> <id>")
|
|
86
|
+
.description("Update a compliance scan for a product")
|
|
87
|
+
.option("--body <json>", "Request body as JSON string")
|
|
88
|
+
.option("--body-file <path>", "Read request body from file")
|
|
89
|
+
.action(async (productId, id, opts) => {
|
|
90
|
+
const client = await ctx.getClient();
|
|
91
|
+
let body: unknown;
|
|
92
|
+
if (opts.bodyFile) {
|
|
93
|
+
const { readFileSync } = await import("fs");
|
|
94
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
95
|
+
} else if (opts.body) {
|
|
96
|
+
body = ctx.parseBody(opts.body);
|
|
97
|
+
}
|
|
98
|
+
if (ctx.verbose)
|
|
99
|
+
process.stderr.write(
|
|
100
|
+
`PATCH ${new URL(`/api/v202506/products/${productId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
101
|
+
);
|
|
102
|
+
const result = await client.patch(
|
|
103
|
+
`/api/v202506/products/${productId}/compliances/${id}`,
|
|
104
|
+
body,
|
|
105
|
+
);
|
|
106
|
+
ctx.output(result);
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
resource
|
|
110
|
+
.command("delete-product-compliance <product-id> <id>")
|
|
111
|
+
.description("Delete a compliance scan for a product")
|
|
112
|
+
.action(async (productId, id, opts) => {
|
|
113
|
+
const client = await ctx.getClient();
|
|
114
|
+
if (ctx.verbose)
|
|
115
|
+
process.stderr.write(
|
|
116
|
+
`DELETE ${new URL(`/api/v202506/products/${productId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
117
|
+
);
|
|
118
|
+
const result = await client.delete(
|
|
119
|
+
`/api/v202506/products/${productId}/compliances/${id}`,
|
|
120
|
+
);
|
|
121
|
+
ctx.output(result);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
resource
|
|
125
|
+
.command("get-latest-media-compliance <medium-id>")
|
|
126
|
+
.description("Get latest compliance scan for media")
|
|
127
|
+
.action(async (mediumId, opts) => {
|
|
128
|
+
const client = await ctx.getClient();
|
|
129
|
+
if (ctx.verbose)
|
|
130
|
+
process.stderr.write(
|
|
131
|
+
`GET ${new URL(`/api/v202506/media/${mediumId}/compliance`, "https://placeholder").pathname}\n`,
|
|
132
|
+
);
|
|
133
|
+
const result = await client.get(
|
|
134
|
+
`/api/v202506/media/${mediumId}/compliance`,
|
|
135
|
+
);
|
|
136
|
+
ctx.output(result);
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
resource
|
|
140
|
+
.command("list-media-compliances <medium-id>")
|
|
141
|
+
.description("List all compliance scans for media")
|
|
142
|
+
.option("--page <value>", "page")
|
|
143
|
+
.option("--per-page <value>", "per_page")
|
|
144
|
+
.action(async (mediumId, opts) => {
|
|
145
|
+
const client = await ctx.getClient();
|
|
146
|
+
const params: Record<string, unknown> = {};
|
|
147
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
148
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
149
|
+
if (ctx.verbose)
|
|
150
|
+
process.stderr.write(
|
|
151
|
+
`GET ${new URL(`/api/v202506/media/${mediumId}/compliances`, "https://placeholder").pathname}\n`,
|
|
152
|
+
);
|
|
153
|
+
const result = await client.get(
|
|
154
|
+
`/api/v202506/media/${mediumId}/compliances`,
|
|
155
|
+
params,
|
|
156
|
+
);
|
|
157
|
+
ctx.output(result);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
resource
|
|
161
|
+
.command("create-media-compliance <medium-id>")
|
|
162
|
+
.description("Create a new compliance scan for media")
|
|
163
|
+
.option("--body <json>", "Request body as JSON string")
|
|
164
|
+
.option("--body-file <path>", "Read request body from file")
|
|
165
|
+
.action(async (mediumId, opts) => {
|
|
166
|
+
const client = await ctx.getClient();
|
|
167
|
+
let body: unknown;
|
|
168
|
+
if (opts.bodyFile) {
|
|
169
|
+
const { readFileSync } = await import("fs");
|
|
170
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
171
|
+
} else if (opts.body) {
|
|
172
|
+
body = ctx.parseBody(opts.body);
|
|
173
|
+
}
|
|
174
|
+
if (ctx.verbose)
|
|
175
|
+
process.stderr.write(
|
|
176
|
+
`POST ${new URL(`/api/v202506/media/${mediumId}/compliances`, "https://placeholder").pathname}\n`,
|
|
177
|
+
);
|
|
178
|
+
const result = await client.post(
|
|
179
|
+
`/api/v202506/media/${mediumId}/compliances`,
|
|
180
|
+
body,
|
|
181
|
+
);
|
|
182
|
+
ctx.output(result);
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
resource
|
|
186
|
+
.command("get-media-compliance <medium-id> <id>")
|
|
187
|
+
.description("Get a specific compliance scan for media")
|
|
188
|
+
.action(async (mediumId, id, opts) => {
|
|
189
|
+
const client = await ctx.getClient();
|
|
190
|
+
if (ctx.verbose)
|
|
191
|
+
process.stderr.write(
|
|
192
|
+
`GET ${new URL(`/api/v202506/media/${mediumId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
193
|
+
);
|
|
194
|
+
const result = await client.get(
|
|
195
|
+
`/api/v202506/media/${mediumId}/compliances/${id}`,
|
|
196
|
+
);
|
|
197
|
+
ctx.output(result);
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
resource
|
|
201
|
+
.command("update-media-compliance <medium-id> <id>")
|
|
202
|
+
.description("Update a compliance scan for media")
|
|
203
|
+
.option("--body <json>", "Request body as JSON string")
|
|
204
|
+
.option("--body-file <path>", "Read request body from file")
|
|
205
|
+
.action(async (mediumId, id, opts) => {
|
|
206
|
+
const client = await ctx.getClient();
|
|
207
|
+
let body: unknown;
|
|
208
|
+
if (opts.bodyFile) {
|
|
209
|
+
const { readFileSync } = await import("fs");
|
|
210
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
211
|
+
} else if (opts.body) {
|
|
212
|
+
body = ctx.parseBody(opts.body);
|
|
213
|
+
}
|
|
214
|
+
if (ctx.verbose)
|
|
215
|
+
process.stderr.write(
|
|
216
|
+
`PATCH ${new URL(`/api/v202506/media/${mediumId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
217
|
+
);
|
|
218
|
+
const result = await client.patch(
|
|
219
|
+
`/api/v202506/media/${mediumId}/compliances/${id}`,
|
|
220
|
+
body,
|
|
221
|
+
);
|
|
222
|
+
ctx.output(result);
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
resource
|
|
226
|
+
.command("delete-media-compliance <medium-id> <id>")
|
|
227
|
+
.description("Delete a compliance scan for media")
|
|
228
|
+
.action(async (mediumId, id, opts) => {
|
|
229
|
+
const client = await ctx.getClient();
|
|
230
|
+
if (ctx.verbose)
|
|
231
|
+
process.stderr.write(
|
|
232
|
+
`DELETE ${new URL(`/api/v202506/media/${mediumId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
233
|
+
);
|
|
234
|
+
const result = await client.delete(
|
|
235
|
+
`/api/v202506/media/${mediumId}/compliances/${id}`,
|
|
236
|
+
);
|
|
237
|
+
ctx.output(result);
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
resource
|
|
241
|
+
.command("get-latest-playlist-compliance <playlist-id>")
|
|
242
|
+
.description("Get latest compliance scan for a playlist")
|
|
243
|
+
.action(async (playlistId, opts) => {
|
|
244
|
+
const client = await ctx.getClient();
|
|
245
|
+
if (ctx.verbose)
|
|
246
|
+
process.stderr.write(
|
|
247
|
+
`GET ${new URL(`/api/v202506/playlists/${playlistId}/compliance`, "https://placeholder").pathname}\n`,
|
|
248
|
+
);
|
|
249
|
+
const result = await client.get(
|
|
250
|
+
`/api/v202506/playlists/${playlistId}/compliance`,
|
|
251
|
+
);
|
|
252
|
+
ctx.output(result);
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
resource
|
|
256
|
+
.command("list-playlist-compliances <playlist-id>")
|
|
257
|
+
.description("List all compliance scans for a playlist")
|
|
258
|
+
.option("--page <value>", "page")
|
|
259
|
+
.option("--per-page <value>", "per_page")
|
|
260
|
+
.action(async (playlistId, opts) => {
|
|
261
|
+
const client = await ctx.getClient();
|
|
262
|
+
const params: Record<string, unknown> = {};
|
|
263
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
264
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
265
|
+
if (ctx.verbose)
|
|
266
|
+
process.stderr.write(
|
|
267
|
+
`GET ${new URL(`/api/v202506/playlists/${playlistId}/compliances`, "https://placeholder").pathname}\n`,
|
|
268
|
+
);
|
|
269
|
+
const result = await client.get(
|
|
270
|
+
`/api/v202506/playlists/${playlistId}/compliances`,
|
|
271
|
+
params,
|
|
272
|
+
);
|
|
273
|
+
ctx.output(result);
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
resource
|
|
277
|
+
.command("create-playlist-compliance <playlist-id>")
|
|
278
|
+
.description("Create a new compliance scan for a playlist")
|
|
279
|
+
.option("--body <json>", "Request body as JSON string")
|
|
280
|
+
.option("--body-file <path>", "Read request body from file")
|
|
281
|
+
.action(async (playlistId, opts) => {
|
|
282
|
+
const client = await ctx.getClient();
|
|
283
|
+
let body: unknown;
|
|
284
|
+
if (opts.bodyFile) {
|
|
285
|
+
const { readFileSync } = await import("fs");
|
|
286
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
287
|
+
} else if (opts.body) {
|
|
288
|
+
body = ctx.parseBody(opts.body);
|
|
289
|
+
}
|
|
290
|
+
if (ctx.verbose)
|
|
291
|
+
process.stderr.write(
|
|
292
|
+
`POST ${new URL(`/api/v202506/playlists/${playlistId}/compliances`, "https://placeholder").pathname}\n`,
|
|
293
|
+
);
|
|
294
|
+
const result = await client.post(
|
|
295
|
+
`/api/v202506/playlists/${playlistId}/compliances`,
|
|
296
|
+
body,
|
|
297
|
+
);
|
|
298
|
+
ctx.output(result);
|
|
299
|
+
});
|
|
300
|
+
|
|
301
|
+
resource
|
|
302
|
+
.command("get-playlist-compliance <playlist-id> <id>")
|
|
303
|
+
.description("Get a specific compliance scan for a playlist")
|
|
304
|
+
.action(async (playlistId, id, opts) => {
|
|
305
|
+
const client = await ctx.getClient();
|
|
306
|
+
if (ctx.verbose)
|
|
307
|
+
process.stderr.write(
|
|
308
|
+
`GET ${new URL(`/api/v202506/playlists/${playlistId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
309
|
+
);
|
|
310
|
+
const result = await client.get(
|
|
311
|
+
`/api/v202506/playlists/${playlistId}/compliances/${id}`,
|
|
312
|
+
);
|
|
313
|
+
ctx.output(result);
|
|
314
|
+
});
|
|
315
|
+
|
|
316
|
+
resource
|
|
317
|
+
.command("update-playlist-compliance <playlist-id> <id>")
|
|
318
|
+
.description("Update a compliance scan for a playlist")
|
|
319
|
+
.option("--body <json>", "Request body as JSON string")
|
|
320
|
+
.option("--body-file <path>", "Read request body from file")
|
|
321
|
+
.action(async (playlistId, id, opts) => {
|
|
322
|
+
const client = await ctx.getClient();
|
|
323
|
+
let body: unknown;
|
|
324
|
+
if (opts.bodyFile) {
|
|
325
|
+
const { readFileSync } = await import("fs");
|
|
326
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
327
|
+
} else if (opts.body) {
|
|
328
|
+
body = ctx.parseBody(opts.body);
|
|
329
|
+
}
|
|
330
|
+
if (ctx.verbose)
|
|
331
|
+
process.stderr.write(
|
|
332
|
+
`PATCH ${new URL(`/api/v202506/playlists/${playlistId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
333
|
+
);
|
|
334
|
+
const result = await client.patch(
|
|
335
|
+
`/api/v202506/playlists/${playlistId}/compliances/${id}`,
|
|
336
|
+
body,
|
|
337
|
+
);
|
|
338
|
+
ctx.output(result);
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
resource
|
|
342
|
+
.command("delete-playlist-compliance <playlist-id> <id>")
|
|
343
|
+
.description("Delete a compliance scan for a playlist")
|
|
344
|
+
.action(async (playlistId, id, opts) => {
|
|
345
|
+
const client = await ctx.getClient();
|
|
346
|
+
if (ctx.verbose)
|
|
347
|
+
process.stderr.write(
|
|
348
|
+
`DELETE ${new URL(`/api/v202506/playlists/${playlistId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
349
|
+
);
|
|
350
|
+
const result = await client.delete(
|
|
351
|
+
`/api/v202506/playlists/${playlistId}/compliances/${id}`,
|
|
352
|
+
);
|
|
353
|
+
ctx.output(result);
|
|
354
|
+
});
|
|
355
|
+
|
|
356
|
+
resource
|
|
357
|
+
.command("get-latest-category-compliance <category-id>")
|
|
358
|
+
.description("Get latest compliance scan for a category")
|
|
359
|
+
.action(async (categoryId, opts) => {
|
|
360
|
+
const client = await ctx.getClient();
|
|
361
|
+
if (ctx.verbose)
|
|
362
|
+
process.stderr.write(
|
|
363
|
+
`GET ${new URL(`/api/v202506/categories/${categoryId}/compliance`, "https://placeholder").pathname}\n`,
|
|
364
|
+
);
|
|
365
|
+
const result = await client.get(
|
|
366
|
+
`/api/v202506/categories/${categoryId}/compliance`,
|
|
367
|
+
);
|
|
368
|
+
ctx.output(result);
|
|
369
|
+
});
|
|
370
|
+
|
|
371
|
+
resource
|
|
372
|
+
.command("list-category-compliances <category-id>")
|
|
373
|
+
.description("List all compliance scans for a category")
|
|
374
|
+
.option("--page <value>", "page")
|
|
375
|
+
.option("--per-page <value>", "per_page")
|
|
376
|
+
.action(async (categoryId, opts) => {
|
|
377
|
+
const client = await ctx.getClient();
|
|
378
|
+
const params: Record<string, unknown> = {};
|
|
379
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
380
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
381
|
+
if (ctx.verbose)
|
|
382
|
+
process.stderr.write(
|
|
383
|
+
`GET ${new URL(`/api/v202506/categories/${categoryId}/compliances`, "https://placeholder").pathname}\n`,
|
|
384
|
+
);
|
|
385
|
+
const result = await client.get(
|
|
386
|
+
`/api/v202506/categories/${categoryId}/compliances`,
|
|
387
|
+
params,
|
|
388
|
+
);
|
|
389
|
+
ctx.output(result);
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
resource
|
|
393
|
+
.command("create-category-compliance <category-id>")
|
|
394
|
+
.description("Create a new compliance scan for a category")
|
|
395
|
+
.option("--body <json>", "Request body as JSON string")
|
|
396
|
+
.option("--body-file <path>", "Read request body from file")
|
|
397
|
+
.action(async (categoryId, opts) => {
|
|
398
|
+
const client = await ctx.getClient();
|
|
399
|
+
let body: unknown;
|
|
400
|
+
if (opts.bodyFile) {
|
|
401
|
+
const { readFileSync } = await import("fs");
|
|
402
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
403
|
+
} else if (opts.body) {
|
|
404
|
+
body = ctx.parseBody(opts.body);
|
|
405
|
+
}
|
|
406
|
+
if (ctx.verbose)
|
|
407
|
+
process.stderr.write(
|
|
408
|
+
`POST ${new URL(`/api/v202506/categories/${categoryId}/compliances`, "https://placeholder").pathname}\n`,
|
|
409
|
+
);
|
|
410
|
+
const result = await client.post(
|
|
411
|
+
`/api/v202506/categories/${categoryId}/compliances`,
|
|
412
|
+
body,
|
|
413
|
+
);
|
|
414
|
+
ctx.output(result);
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
resource
|
|
418
|
+
.command("get-category-compliance <category-id> <id>")
|
|
419
|
+
.description("Get a specific compliance scan for a category")
|
|
420
|
+
.action(async (categoryId, id, opts) => {
|
|
421
|
+
const client = await ctx.getClient();
|
|
422
|
+
if (ctx.verbose)
|
|
423
|
+
process.stderr.write(
|
|
424
|
+
`GET ${new URL(`/api/v202506/categories/${categoryId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
425
|
+
);
|
|
426
|
+
const result = await client.get(
|
|
427
|
+
`/api/v202506/categories/${categoryId}/compliances/${id}`,
|
|
428
|
+
);
|
|
429
|
+
ctx.output(result);
|
|
430
|
+
});
|
|
431
|
+
|
|
432
|
+
resource
|
|
433
|
+
.command("update-category-compliance <category-id> <id>")
|
|
434
|
+
.description("Update a compliance scan for a category")
|
|
435
|
+
.option("--body <json>", "Request body as JSON string")
|
|
436
|
+
.option("--body-file <path>", "Read request body from file")
|
|
437
|
+
.action(async (categoryId, id, opts) => {
|
|
438
|
+
const client = await ctx.getClient();
|
|
439
|
+
let body: unknown;
|
|
440
|
+
if (opts.bodyFile) {
|
|
441
|
+
const { readFileSync } = await import("fs");
|
|
442
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
443
|
+
} else if (opts.body) {
|
|
444
|
+
body = ctx.parseBody(opts.body);
|
|
445
|
+
}
|
|
446
|
+
if (ctx.verbose)
|
|
447
|
+
process.stderr.write(
|
|
448
|
+
`PATCH ${new URL(`/api/v202506/categories/${categoryId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
449
|
+
);
|
|
450
|
+
const result = await client.patch(
|
|
451
|
+
`/api/v202506/categories/${categoryId}/compliances/${id}`,
|
|
452
|
+
body,
|
|
453
|
+
);
|
|
454
|
+
ctx.output(result);
|
|
455
|
+
});
|
|
456
|
+
|
|
457
|
+
resource
|
|
458
|
+
.command("delete-category-compliance <category-id> <id>")
|
|
459
|
+
.description("Delete a compliance scan for a category")
|
|
460
|
+
.action(async (categoryId, id, opts) => {
|
|
461
|
+
const client = await ctx.getClient();
|
|
462
|
+
if (ctx.verbose)
|
|
463
|
+
process.stderr.write(
|
|
464
|
+
`DELETE ${new URL(`/api/v202506/categories/${categoryId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
465
|
+
);
|
|
466
|
+
const result = await client.delete(
|
|
467
|
+
`/api/v202506/categories/${categoryId}/compliances/${id}`,
|
|
468
|
+
);
|
|
469
|
+
ctx.output(result);
|
|
470
|
+
});
|
|
471
|
+
|
|
472
|
+
resource
|
|
473
|
+
.command("get-latest-collection-compliance <collection-id>")
|
|
474
|
+
.description("Get latest compliance scan for a collection")
|
|
475
|
+
.action(async (collectionId, opts) => {
|
|
476
|
+
const client = await ctx.getClient();
|
|
477
|
+
if (ctx.verbose)
|
|
478
|
+
process.stderr.write(
|
|
479
|
+
`GET ${new URL(`/api/v202506/collections/${collectionId}/compliance`, "https://placeholder").pathname}\n`,
|
|
480
|
+
);
|
|
481
|
+
const result = await client.get(
|
|
482
|
+
`/api/v202506/collections/${collectionId}/compliance`,
|
|
483
|
+
);
|
|
484
|
+
ctx.output(result);
|
|
485
|
+
});
|
|
486
|
+
|
|
487
|
+
resource
|
|
488
|
+
.command("list-collection-compliances <collection-id>")
|
|
489
|
+
.description("List all compliance scans for a collection")
|
|
490
|
+
.option("--page <value>", "page")
|
|
491
|
+
.option("--per-page <value>", "per_page")
|
|
492
|
+
.action(async (collectionId, opts) => {
|
|
493
|
+
const client = await ctx.getClient();
|
|
494
|
+
const params: Record<string, unknown> = {};
|
|
495
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
496
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
497
|
+
if (ctx.verbose)
|
|
498
|
+
process.stderr.write(
|
|
499
|
+
`GET ${new URL(`/api/v202506/collections/${collectionId}/compliances`, "https://placeholder").pathname}\n`,
|
|
500
|
+
);
|
|
501
|
+
const result = await client.get(
|
|
502
|
+
`/api/v202506/collections/${collectionId}/compliances`,
|
|
503
|
+
params,
|
|
504
|
+
);
|
|
505
|
+
ctx.output(result);
|
|
506
|
+
});
|
|
507
|
+
|
|
508
|
+
resource
|
|
509
|
+
.command("create-collection-compliance <collection-id>")
|
|
510
|
+
.description("Create a new compliance scan for a collection")
|
|
511
|
+
.option("--body <json>", "Request body as JSON string")
|
|
512
|
+
.option("--body-file <path>", "Read request body from file")
|
|
513
|
+
.action(async (collectionId, opts) => {
|
|
514
|
+
const client = await ctx.getClient();
|
|
515
|
+
let body: unknown;
|
|
516
|
+
if (opts.bodyFile) {
|
|
517
|
+
const { readFileSync } = await import("fs");
|
|
518
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
519
|
+
} else if (opts.body) {
|
|
520
|
+
body = ctx.parseBody(opts.body);
|
|
521
|
+
}
|
|
522
|
+
if (ctx.verbose)
|
|
523
|
+
process.stderr.write(
|
|
524
|
+
`POST ${new URL(`/api/v202506/collections/${collectionId}/compliances`, "https://placeholder").pathname}\n`,
|
|
525
|
+
);
|
|
526
|
+
const result = await client.post(
|
|
527
|
+
`/api/v202506/collections/${collectionId}/compliances`,
|
|
528
|
+
body,
|
|
529
|
+
);
|
|
530
|
+
ctx.output(result);
|
|
531
|
+
});
|
|
532
|
+
|
|
533
|
+
resource
|
|
534
|
+
.command("get-collection-compliance <collection-id> <id>")
|
|
535
|
+
.description("Get a specific compliance scan for a collection")
|
|
536
|
+
.action(async (collectionId, id, opts) => {
|
|
537
|
+
const client = await ctx.getClient();
|
|
538
|
+
if (ctx.verbose)
|
|
539
|
+
process.stderr.write(
|
|
540
|
+
`GET ${new URL(`/api/v202506/collections/${collectionId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
541
|
+
);
|
|
542
|
+
const result = await client.get(
|
|
543
|
+
`/api/v202506/collections/${collectionId}/compliances/${id}`,
|
|
544
|
+
);
|
|
545
|
+
ctx.output(result);
|
|
546
|
+
});
|
|
547
|
+
|
|
548
|
+
resource
|
|
549
|
+
.command("update-collection-compliance <collection-id> <id>")
|
|
550
|
+
.description("Update a compliance scan for a collection")
|
|
551
|
+
.option("--body <json>", "Request body as JSON string")
|
|
552
|
+
.option("--body-file <path>", "Read request body from file")
|
|
553
|
+
.action(async (collectionId, id, opts) => {
|
|
554
|
+
const client = await ctx.getClient();
|
|
555
|
+
let body: unknown;
|
|
556
|
+
if (opts.bodyFile) {
|
|
557
|
+
const { readFileSync } = await import("fs");
|
|
558
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
559
|
+
} else if (opts.body) {
|
|
560
|
+
body = ctx.parseBody(opts.body);
|
|
561
|
+
}
|
|
562
|
+
if (ctx.verbose)
|
|
563
|
+
process.stderr.write(
|
|
564
|
+
`PATCH ${new URL(`/api/v202506/collections/${collectionId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
565
|
+
);
|
|
566
|
+
const result = await client.patch(
|
|
567
|
+
`/api/v202506/collections/${collectionId}/compliances/${id}`,
|
|
568
|
+
body,
|
|
569
|
+
);
|
|
570
|
+
ctx.output(result);
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
resource
|
|
574
|
+
.command("delete-collection-compliance <collection-id> <id>")
|
|
575
|
+
.description("Delete a compliance scan for a collection")
|
|
576
|
+
.action(async (collectionId, id, opts) => {
|
|
577
|
+
const client = await ctx.getClient();
|
|
578
|
+
if (ctx.verbose)
|
|
579
|
+
process.stderr.write(
|
|
580
|
+
`DELETE ${new URL(`/api/v202506/collections/${collectionId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
581
|
+
);
|
|
582
|
+
const result = await client.delete(
|
|
583
|
+
`/api/v202506/collections/${collectionId}/compliances/${id}`,
|
|
584
|
+
);
|
|
585
|
+
ctx.output(result);
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
resource
|
|
589
|
+
.command("get-latest-post-compliance <post-id>")
|
|
590
|
+
.description("Get latest compliance scan for a post")
|
|
591
|
+
.action(async (postId, opts) => {
|
|
592
|
+
const client = await ctx.getClient();
|
|
593
|
+
if (ctx.verbose)
|
|
594
|
+
process.stderr.write(
|
|
595
|
+
`GET ${new URL(`/api/v202506/posts/${postId}/compliance`, "https://placeholder").pathname}\n`,
|
|
596
|
+
);
|
|
597
|
+
const result = await client.get(
|
|
598
|
+
`/api/v202506/posts/${postId}/compliance`,
|
|
599
|
+
);
|
|
600
|
+
ctx.output(result);
|
|
601
|
+
});
|
|
602
|
+
|
|
603
|
+
resource
|
|
604
|
+
.command("list-post-compliances <post-id>")
|
|
605
|
+
.description("List all compliance scans for a post")
|
|
606
|
+
.option("--page <value>", "page")
|
|
607
|
+
.option("--per-page <value>", "per_page")
|
|
608
|
+
.action(async (postId, opts) => {
|
|
609
|
+
const client = await ctx.getClient();
|
|
610
|
+
const params: Record<string, unknown> = {};
|
|
611
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
612
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
613
|
+
if (ctx.verbose)
|
|
614
|
+
process.stderr.write(
|
|
615
|
+
`GET ${new URL(`/api/v202506/posts/${postId}/compliances`, "https://placeholder").pathname}\n`,
|
|
616
|
+
);
|
|
617
|
+
const result = await client.get(
|
|
618
|
+
`/api/v202506/posts/${postId}/compliances`,
|
|
619
|
+
params,
|
|
620
|
+
);
|
|
621
|
+
ctx.output(result);
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
resource
|
|
625
|
+
.command("create-post-compliance <post-id>")
|
|
626
|
+
.description("Create a new compliance scan for a post")
|
|
627
|
+
.option("--body <json>", "Request body as JSON string")
|
|
628
|
+
.option("--body-file <path>", "Read request body from file")
|
|
629
|
+
.action(async (postId, opts) => {
|
|
630
|
+
const client = await ctx.getClient();
|
|
631
|
+
let body: unknown;
|
|
632
|
+
if (opts.bodyFile) {
|
|
633
|
+
const { readFileSync } = await import("fs");
|
|
634
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
635
|
+
} else if (opts.body) {
|
|
636
|
+
body = ctx.parseBody(opts.body);
|
|
637
|
+
}
|
|
638
|
+
if (ctx.verbose)
|
|
639
|
+
process.stderr.write(
|
|
640
|
+
`POST ${new URL(`/api/v202506/posts/${postId}/compliances`, "https://placeholder").pathname}\n`,
|
|
641
|
+
);
|
|
642
|
+
const result = await client.post(
|
|
643
|
+
`/api/v202506/posts/${postId}/compliances`,
|
|
644
|
+
body,
|
|
645
|
+
);
|
|
646
|
+
ctx.output(result);
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
resource
|
|
650
|
+
.command("get-post-compliance <post-id> <id>")
|
|
651
|
+
.description("Get a specific compliance scan for a post")
|
|
652
|
+
.action(async (postId, id, opts) => {
|
|
653
|
+
const client = await ctx.getClient();
|
|
654
|
+
if (ctx.verbose)
|
|
655
|
+
process.stderr.write(
|
|
656
|
+
`GET ${new URL(`/api/v202506/posts/${postId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
657
|
+
);
|
|
658
|
+
const result = await client.get(
|
|
659
|
+
`/api/v202506/posts/${postId}/compliances/${id}`,
|
|
660
|
+
);
|
|
661
|
+
ctx.output(result);
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
resource
|
|
665
|
+
.command("update-post-compliance <post-id> <id>")
|
|
666
|
+
.description("Update a compliance scan for a post")
|
|
667
|
+
.option("--body <json>", "Request body as JSON string")
|
|
668
|
+
.option("--body-file <path>", "Read request body from file")
|
|
669
|
+
.action(async (postId, id, opts) => {
|
|
670
|
+
const client = await ctx.getClient();
|
|
671
|
+
let body: unknown;
|
|
672
|
+
if (opts.bodyFile) {
|
|
673
|
+
const { readFileSync } = await import("fs");
|
|
674
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
675
|
+
} else if (opts.body) {
|
|
676
|
+
body = ctx.parseBody(opts.body);
|
|
677
|
+
}
|
|
678
|
+
if (ctx.verbose)
|
|
679
|
+
process.stderr.write(
|
|
680
|
+
`PATCH ${new URL(`/api/v202506/posts/${postId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
681
|
+
);
|
|
682
|
+
const result = await client.patch(
|
|
683
|
+
`/api/v202506/posts/${postId}/compliances/${id}`,
|
|
684
|
+
body,
|
|
685
|
+
);
|
|
686
|
+
ctx.output(result);
|
|
687
|
+
});
|
|
688
|
+
|
|
689
|
+
resource
|
|
690
|
+
.command("delete-post-compliance <post-id> <id>")
|
|
691
|
+
.description("Delete a compliance scan for a post")
|
|
692
|
+
.action(async (postId, id, opts) => {
|
|
693
|
+
const client = await ctx.getClient();
|
|
694
|
+
if (ctx.verbose)
|
|
695
|
+
process.stderr.write(
|
|
696
|
+
`DELETE ${new URL(`/api/v202506/posts/${postId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
697
|
+
);
|
|
698
|
+
const result = await client.delete(
|
|
699
|
+
`/api/v202506/posts/${postId}/compliances/${id}`,
|
|
700
|
+
);
|
|
701
|
+
ctx.output(result);
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
resource
|
|
705
|
+
.command("get-latest-enrollment-pack-compliance <enrollment-pack-id>")
|
|
706
|
+
.description("Get latest compliance scan for an enrollment pack")
|
|
707
|
+
.action(async (enrollmentPackId, opts) => {
|
|
708
|
+
const client = await ctx.getClient();
|
|
709
|
+
if (ctx.verbose)
|
|
710
|
+
process.stderr.write(
|
|
711
|
+
`GET ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/compliance`, "https://placeholder").pathname}\n`,
|
|
712
|
+
);
|
|
713
|
+
const result = await client.get(
|
|
714
|
+
`/api/v202506/enrollment_packs/${enrollmentPackId}/compliance`,
|
|
715
|
+
);
|
|
716
|
+
ctx.output(result);
|
|
717
|
+
});
|
|
718
|
+
|
|
719
|
+
resource
|
|
720
|
+
.command("list-enrollment-pack-compliances <enrollment-pack-id>")
|
|
721
|
+
.description("List all compliance scans for an enrollment pack")
|
|
722
|
+
.option("--page <value>", "page")
|
|
723
|
+
.option("--per-page <value>", "per_page")
|
|
724
|
+
.action(async (enrollmentPackId, opts) => {
|
|
725
|
+
const client = await ctx.getClient();
|
|
726
|
+
const params: Record<string, unknown> = {};
|
|
727
|
+
if (opts.page !== undefined) params["page"] = Number(opts.page);
|
|
728
|
+
if (opts.perPage !== undefined) params["per_page"] = Number(opts.perPage);
|
|
729
|
+
if (ctx.verbose)
|
|
730
|
+
process.stderr.write(
|
|
731
|
+
`GET ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances`, "https://placeholder").pathname}\n`,
|
|
732
|
+
);
|
|
733
|
+
const result = await client.get(
|
|
734
|
+
`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances`,
|
|
735
|
+
params,
|
|
736
|
+
);
|
|
737
|
+
ctx.output(result);
|
|
738
|
+
});
|
|
739
|
+
|
|
740
|
+
resource
|
|
741
|
+
.command("create-enrollment-pack-compliance <enrollment-pack-id>")
|
|
742
|
+
.description("Create a new compliance scan for an enrollment pack")
|
|
743
|
+
.option("--body <json>", "Request body as JSON string")
|
|
744
|
+
.option("--body-file <path>", "Read request body from file")
|
|
745
|
+
.action(async (enrollmentPackId, opts) => {
|
|
746
|
+
const client = await ctx.getClient();
|
|
747
|
+
let body: unknown;
|
|
748
|
+
if (opts.bodyFile) {
|
|
749
|
+
const { readFileSync } = await import("fs");
|
|
750
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
751
|
+
} else if (opts.body) {
|
|
752
|
+
body = ctx.parseBody(opts.body);
|
|
753
|
+
}
|
|
754
|
+
if (ctx.verbose)
|
|
755
|
+
process.stderr.write(
|
|
756
|
+
`POST ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances`, "https://placeholder").pathname}\n`,
|
|
757
|
+
);
|
|
758
|
+
const result = await client.post(
|
|
759
|
+
`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances`,
|
|
760
|
+
body,
|
|
761
|
+
);
|
|
762
|
+
ctx.output(result);
|
|
763
|
+
});
|
|
764
|
+
|
|
765
|
+
resource
|
|
766
|
+
.command("get-enrollment-pack-compliance <enrollment-pack-id> <id>")
|
|
767
|
+
.description("Get a specific compliance scan for an enrollment pack")
|
|
768
|
+
.action(async (enrollmentPackId, id, opts) => {
|
|
769
|
+
const client = await ctx.getClient();
|
|
770
|
+
if (ctx.verbose)
|
|
771
|
+
process.stderr.write(
|
|
772
|
+
`GET ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
773
|
+
);
|
|
774
|
+
const result = await client.get(
|
|
775
|
+
`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances/${id}`,
|
|
776
|
+
);
|
|
777
|
+
ctx.output(result);
|
|
778
|
+
});
|
|
779
|
+
|
|
780
|
+
resource
|
|
781
|
+
.command("update-enrollment-pack-compliance <enrollment-pack-id> <id>")
|
|
782
|
+
.description("Update a compliance scan for an enrollment pack")
|
|
783
|
+
.option("--body <json>", "Request body as JSON string")
|
|
784
|
+
.option("--body-file <path>", "Read request body from file")
|
|
785
|
+
.action(async (enrollmentPackId, id, opts) => {
|
|
786
|
+
const client = await ctx.getClient();
|
|
787
|
+
let body: unknown;
|
|
788
|
+
if (opts.bodyFile) {
|
|
789
|
+
const { readFileSync } = await import("fs");
|
|
790
|
+
body = ctx.parseBody(readFileSync(opts.bodyFile, "utf-8"));
|
|
791
|
+
} else if (opts.body) {
|
|
792
|
+
body = ctx.parseBody(opts.body);
|
|
793
|
+
}
|
|
794
|
+
if (ctx.verbose)
|
|
795
|
+
process.stderr.write(
|
|
796
|
+
`PATCH ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
797
|
+
);
|
|
798
|
+
const result = await client.patch(
|
|
799
|
+
`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances/${id}`,
|
|
800
|
+
body,
|
|
801
|
+
);
|
|
802
|
+
ctx.output(result);
|
|
803
|
+
});
|
|
804
|
+
|
|
805
|
+
resource
|
|
806
|
+
.command("delete-enrollment-pack-compliance <enrollment-pack-id> <id>")
|
|
807
|
+
.description("Delete a compliance scan for an enrollment pack")
|
|
808
|
+
.action(async (enrollmentPackId, id, opts) => {
|
|
809
|
+
const client = await ctx.getClient();
|
|
810
|
+
if (ctx.verbose)
|
|
811
|
+
process.stderr.write(
|
|
812
|
+
`DELETE ${new URL(`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances/${id}`, "https://placeholder").pathname}\n`,
|
|
813
|
+
);
|
|
814
|
+
const result = await client.delete(
|
|
815
|
+
`/api/v202506/enrollment_packs/${enrollmentPackId}/compliances/${id}`,
|
|
816
|
+
);
|
|
817
|
+
ctx.output(result);
|
|
818
|
+
});
|
|
819
|
+
}
|