cmx-sdk 0.2.16 → 0.2.18
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/chunk-ZBI5OLBT.js +844 -0
- package/dist/cli.js +72 -796
- package/dist/index.d.ts +96 -3
- package/dist/index.js.map +1 -1
- package/dist/report-bug-PT7NNFNN.js +44 -0
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -11,789 +11,55 @@ import {
|
|
|
11
11
|
import "./chunk-NZQ6SBFS.js";
|
|
12
12
|
import "./chunk-EDXXR5BE.js";
|
|
13
13
|
import "./chunk-IIQLQIDP.js";
|
|
14
|
+
import {
|
|
15
|
+
assertSdkSuccess,
|
|
16
|
+
deleteManageCollectionsSlug,
|
|
17
|
+
deleteManageCollectionsSlugDataTypesDtSlug,
|
|
18
|
+
deleteManageContentsId,
|
|
19
|
+
deleteManageDataTypeSlugId,
|
|
20
|
+
deleteManageDataTypesSlug,
|
|
21
|
+
deleteManageFormDefinitionsSlug,
|
|
22
|
+
ensureApiCredentials,
|
|
23
|
+
formatApiErrorMessage,
|
|
24
|
+
getManageCollectionPresets,
|
|
25
|
+
getManageCollections,
|
|
26
|
+
getManageCollectionsSlug,
|
|
27
|
+
getManageCollectionsSlugDataTypes,
|
|
28
|
+
getManageComponents,
|
|
29
|
+
getManageContents,
|
|
30
|
+
getManageContentsId,
|
|
31
|
+
getManageContentsIdReferences,
|
|
32
|
+
getManageContentsIdValidate,
|
|
33
|
+
getManageDataTypeSlug,
|
|
34
|
+
getManageDataTypeSlugId,
|
|
35
|
+
getManageDataTypeSlugIdDeletionImpact,
|
|
36
|
+
getManageDataTypes,
|
|
37
|
+
getManageFormDefinitions,
|
|
38
|
+
installSdkFetchInterceptor,
|
|
39
|
+
patchManageDataTypeSlugId,
|
|
40
|
+
postManageCollections,
|
|
41
|
+
postManageCollectionsSlugDataTypes,
|
|
42
|
+
postManageCollectionsSlugDataTypesLink,
|
|
43
|
+
postManageComponentsSync,
|
|
44
|
+
postManageContents,
|
|
45
|
+
postManageContentsIdPublish,
|
|
46
|
+
postManageContentsIdRequestReview,
|
|
47
|
+
postManageDataTypeSlug,
|
|
48
|
+
postManageDataTypes,
|
|
49
|
+
postManageFormDefinitions,
|
|
50
|
+
putManageCollectionsSlug,
|
|
51
|
+
putManageContentsId,
|
|
52
|
+
putManageContentsIdReferences,
|
|
53
|
+
putManageDataTypesSlug,
|
|
54
|
+
putManageDocsType,
|
|
55
|
+
putManageFormDefinitionsSlug,
|
|
56
|
+
readJsonInput
|
|
57
|
+
} from "./chunk-ZBI5OLBT.js";
|
|
14
58
|
|
|
15
59
|
// src/cli.ts
|
|
16
60
|
import { Command } from "commander";
|
|
17
61
|
import { config } from "dotenv";
|
|
18
62
|
|
|
19
|
-
// src/commands/utils.ts
|
|
20
|
-
import { readFileSync } from "fs";
|
|
21
|
-
function stringifyErrorValue(value) {
|
|
22
|
-
if (typeof value === "string") return value;
|
|
23
|
-
if (value === null || value === void 0) return "";
|
|
24
|
-
if (typeof value === "object") {
|
|
25
|
-
const objectValue = value;
|
|
26
|
-
if (typeof objectValue.message === "string" && objectValue.message.length > 0) {
|
|
27
|
-
return objectValue.message;
|
|
28
|
-
}
|
|
29
|
-
try {
|
|
30
|
-
return JSON.stringify(value);
|
|
31
|
-
} catch {
|
|
32
|
-
return String(value);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return String(value);
|
|
36
|
-
}
|
|
37
|
-
function formatApiErrorPayload(payload) {
|
|
38
|
-
if (typeof payload === "string") {
|
|
39
|
-
return formatApiErrorMessage(payload);
|
|
40
|
-
}
|
|
41
|
-
const parsed = payload ?? {};
|
|
42
|
-
const main = stringifyErrorValue(parsed.error ?? parsed.message);
|
|
43
|
-
const details = stringifyErrorValue(parsed.details);
|
|
44
|
-
const code = typeof parsed.code === "string" ? parsed.code : void 0;
|
|
45
|
-
const message = [main, details].filter((part, index, parts) => part.length > 0 && parts.indexOf(part) === index).join(" | ");
|
|
46
|
-
if (code && message) return `${code}: ${message}`;
|
|
47
|
-
if (code) return code;
|
|
48
|
-
if (message) return message;
|
|
49
|
-
return "\u4E0D\u660E\u306A\u30A8\u30E9\u30FC";
|
|
50
|
-
}
|
|
51
|
-
function formatApiErrorMessage(errorBody) {
|
|
52
|
-
if (!errorBody) return "\u4E0D\u660E\u306A\u30A8\u30E9\u30FC";
|
|
53
|
-
try {
|
|
54
|
-
return formatApiErrorPayload(JSON.parse(errorBody));
|
|
55
|
-
} catch {
|
|
56
|
-
}
|
|
57
|
-
return errorBody;
|
|
58
|
-
}
|
|
59
|
-
var sdkFetchInterceptorInstalled = false;
|
|
60
|
-
function installSdkFetchInterceptor() {
|
|
61
|
-
if (sdkFetchInterceptorInstalled) return;
|
|
62
|
-
if (typeof globalThis.fetch !== "function") return;
|
|
63
|
-
const originalFetch = globalThis.fetch.bind(globalThis);
|
|
64
|
-
globalThis.fetch = async (input, init) => {
|
|
65
|
-
if (typeof input === "string" || input instanceof URL) {
|
|
66
|
-
const rawUrl = input.toString();
|
|
67
|
-
if (rawUrl.startsWith("/api/v1/sdk")) {
|
|
68
|
-
const apiUrl = process.env.CMX_API_URL;
|
|
69
|
-
const apiKey = process.env.CMX_API_KEY;
|
|
70
|
-
if (!apiUrl || !apiKey) {
|
|
71
|
-
throw new Error("\u74B0\u5883\u5909\u6570 CMX_API_URL \u3068 CMX_API_KEY \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
72
|
-
}
|
|
73
|
-
const baseUrl = apiUrl.replace(/\/$/, "");
|
|
74
|
-
const absoluteUrl = `${baseUrl}${rawUrl}`;
|
|
75
|
-
const headers = new Headers(init?.headers);
|
|
76
|
-
headers.set("Authorization", `Bearer ${apiKey}`);
|
|
77
|
-
return originalFetch(absoluteUrl, {
|
|
78
|
-
...init,
|
|
79
|
-
headers
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return originalFetch(input, init);
|
|
84
|
-
};
|
|
85
|
-
sdkFetchInterceptorInstalled = true;
|
|
86
|
-
}
|
|
87
|
-
function assertSdkSuccess(response) {
|
|
88
|
-
if (response.status >= 200 && response.status < 300) {
|
|
89
|
-
return response.data;
|
|
90
|
-
}
|
|
91
|
-
throw new Error(`API \u30A8\u30E9\u30FC (${response.status}): ${formatApiErrorPayload(response.data)}`);
|
|
92
|
-
}
|
|
93
|
-
function readJsonInput(options) {
|
|
94
|
-
if (options.json) {
|
|
95
|
-
try {
|
|
96
|
-
return JSON.parse(options.json);
|
|
97
|
-
} catch {
|
|
98
|
-
console.error("\u30A8\u30E9\u30FC: --json \u306E JSON \u6587\u5B57\u5217\u304C\u4E0D\u6B63\u3067\u3059");
|
|
99
|
-
process.exit(1);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
if (options.file) {
|
|
103
|
-
try {
|
|
104
|
-
const content = readFileSync(options.file, "utf-8");
|
|
105
|
-
return JSON.parse(content);
|
|
106
|
-
} catch (err) {
|
|
107
|
-
console.error(`\u30A8\u30E9\u30FC: JSON \u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${options.file}`);
|
|
108
|
-
console.error(err instanceof Error ? err.message : err);
|
|
109
|
-
process.exit(1);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
console.error("\u30A8\u30E9\u30FC: --json \u307E\u305F\u306F --file \u3092\u6307\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
113
|
-
process.exit(1);
|
|
114
|
-
}
|
|
115
|
-
function ensureApiCredentials() {
|
|
116
|
-
if (!process.env.CMX_API_URL || !process.env.CMX_API_KEY) {
|
|
117
|
-
console.error("\u30A8\u30E9\u30FC: \u74B0\u5883\u5909\u6570 CMX_API_URL \u3068 CMX_API_KEY \u3092\u8A2D\u5B9A\u3057\u3066\u304F\u3060\u3055\u3044");
|
|
118
|
-
process.exit(1);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// src/core/date-reviver.ts
|
|
123
|
-
var isoDateFormat = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}/;
|
|
124
|
-
function dateReviver(_key, value) {
|
|
125
|
-
if (typeof value === "string" && isoDateFormat.test(value)) {
|
|
126
|
-
return new Date(value);
|
|
127
|
-
}
|
|
128
|
-
return value;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
// src/generated/sdk/endpoints/sdk.ts
|
|
132
|
-
var getGetManageCollectionsUrl = () => {
|
|
133
|
-
return `/api/v1/sdk/manage/collections`;
|
|
134
|
-
};
|
|
135
|
-
var getManageCollections = async (options) => {
|
|
136
|
-
const res = await fetch(
|
|
137
|
-
getGetManageCollectionsUrl(),
|
|
138
|
-
{
|
|
139
|
-
...options,
|
|
140
|
-
method: "GET"
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
144
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
145
|
-
return { data, status: res.status, headers: res.headers };
|
|
146
|
-
};
|
|
147
|
-
var getPostManageCollectionsUrl = () => {
|
|
148
|
-
return `/api/v1/sdk/manage/collections`;
|
|
149
|
-
};
|
|
150
|
-
var postManageCollections = async (createCollectionRequest, options) => {
|
|
151
|
-
const res = await fetch(
|
|
152
|
-
getPostManageCollectionsUrl(),
|
|
153
|
-
{
|
|
154
|
-
...options,
|
|
155
|
-
method: "POST",
|
|
156
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
157
|
-
body: JSON.stringify(
|
|
158
|
-
createCollectionRequest
|
|
159
|
-
)
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
163
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
164
|
-
return { data, status: res.status, headers: res.headers };
|
|
165
|
-
};
|
|
166
|
-
var getGetManageCollectionsSlugUrl = (slug) => {
|
|
167
|
-
return `/api/v1/sdk/manage/collections/${slug}`;
|
|
168
|
-
};
|
|
169
|
-
var getManageCollectionsSlug = async (slug, options) => {
|
|
170
|
-
const res = await fetch(
|
|
171
|
-
getGetManageCollectionsSlugUrl(slug),
|
|
172
|
-
{
|
|
173
|
-
...options,
|
|
174
|
-
method: "GET"
|
|
175
|
-
}
|
|
176
|
-
);
|
|
177
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
178
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
179
|
-
return { data, status: res.status, headers: res.headers };
|
|
180
|
-
};
|
|
181
|
-
var getPutManageCollectionsSlugUrl = (slug) => {
|
|
182
|
-
return `/api/v1/sdk/manage/collections/${slug}`;
|
|
183
|
-
};
|
|
184
|
-
var putManageCollectionsSlug = async (slug, updateCollectionRequest, options) => {
|
|
185
|
-
const res = await fetch(
|
|
186
|
-
getPutManageCollectionsSlugUrl(slug),
|
|
187
|
-
{
|
|
188
|
-
...options,
|
|
189
|
-
method: "PUT",
|
|
190
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
191
|
-
body: JSON.stringify(
|
|
192
|
-
updateCollectionRequest
|
|
193
|
-
)
|
|
194
|
-
}
|
|
195
|
-
);
|
|
196
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
197
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
198
|
-
return { data, status: res.status, headers: res.headers };
|
|
199
|
-
};
|
|
200
|
-
var getDeleteManageCollectionsSlugUrl = (slug) => {
|
|
201
|
-
return `/api/v1/sdk/manage/collections/${slug}`;
|
|
202
|
-
};
|
|
203
|
-
var deleteManageCollectionsSlug = async (slug, options) => {
|
|
204
|
-
const res = await fetch(
|
|
205
|
-
getDeleteManageCollectionsSlugUrl(slug),
|
|
206
|
-
{
|
|
207
|
-
...options,
|
|
208
|
-
method: "DELETE"
|
|
209
|
-
}
|
|
210
|
-
);
|
|
211
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
212
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
213
|
-
return { data, status: res.status, headers: res.headers };
|
|
214
|
-
};
|
|
215
|
-
var getGetManageDataTypesUrl = () => {
|
|
216
|
-
return `/api/v1/sdk/manage/data-types`;
|
|
217
|
-
};
|
|
218
|
-
var getManageDataTypes = async (options) => {
|
|
219
|
-
const res = await fetch(
|
|
220
|
-
getGetManageDataTypesUrl(),
|
|
221
|
-
{
|
|
222
|
-
...options,
|
|
223
|
-
method: "GET"
|
|
224
|
-
}
|
|
225
|
-
);
|
|
226
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
227
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
228
|
-
return { data, status: res.status, headers: res.headers };
|
|
229
|
-
};
|
|
230
|
-
var getPostManageDataTypesUrl = () => {
|
|
231
|
-
return `/api/v1/sdk/manage/data-types`;
|
|
232
|
-
};
|
|
233
|
-
var postManageDataTypes = async (createDataTypeRequest, options) => {
|
|
234
|
-
const res = await fetch(
|
|
235
|
-
getPostManageDataTypesUrl(),
|
|
236
|
-
{
|
|
237
|
-
...options,
|
|
238
|
-
method: "POST",
|
|
239
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
240
|
-
body: JSON.stringify(
|
|
241
|
-
createDataTypeRequest
|
|
242
|
-
)
|
|
243
|
-
}
|
|
244
|
-
);
|
|
245
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
246
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
247
|
-
return { data, status: res.status, headers: res.headers };
|
|
248
|
-
};
|
|
249
|
-
var getPutManageDataTypesSlugUrl = (slug) => {
|
|
250
|
-
return `/api/v1/sdk/manage/data-types/${slug}`;
|
|
251
|
-
};
|
|
252
|
-
var putManageDataTypesSlug = async (slug, updateDataTypeRequest, options) => {
|
|
253
|
-
const res = await fetch(
|
|
254
|
-
getPutManageDataTypesSlugUrl(slug),
|
|
255
|
-
{
|
|
256
|
-
...options,
|
|
257
|
-
method: "PUT",
|
|
258
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
259
|
-
body: JSON.stringify(
|
|
260
|
-
updateDataTypeRequest
|
|
261
|
-
)
|
|
262
|
-
}
|
|
263
|
-
);
|
|
264
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
265
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
266
|
-
return { data, status: res.status, headers: res.headers };
|
|
267
|
-
};
|
|
268
|
-
var getDeleteManageDataTypesSlugUrl = (slug) => {
|
|
269
|
-
return `/api/v1/sdk/manage/data-types/${slug}`;
|
|
270
|
-
};
|
|
271
|
-
var deleteManageDataTypesSlug = async (slug, options) => {
|
|
272
|
-
const res = await fetch(
|
|
273
|
-
getDeleteManageDataTypesSlugUrl(slug),
|
|
274
|
-
{
|
|
275
|
-
...options,
|
|
276
|
-
method: "DELETE"
|
|
277
|
-
}
|
|
278
|
-
);
|
|
279
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
280
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
281
|
-
return { data, status: res.status, headers: res.headers };
|
|
282
|
-
};
|
|
283
|
-
var getGetManageDataTypeSlugUrl = (typeSlug, params) => {
|
|
284
|
-
const normalizedParams = new URLSearchParams();
|
|
285
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
286
|
-
if (value !== void 0) {
|
|
287
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
288
|
-
}
|
|
289
|
-
});
|
|
290
|
-
const stringifiedParams = normalizedParams.toString();
|
|
291
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}`;
|
|
292
|
-
};
|
|
293
|
-
var getManageDataTypeSlug = async (typeSlug, params, options) => {
|
|
294
|
-
const res = await fetch(
|
|
295
|
-
getGetManageDataTypeSlugUrl(typeSlug, params),
|
|
296
|
-
{
|
|
297
|
-
...options,
|
|
298
|
-
method: "GET"
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
302
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
303
|
-
return { data, status: res.status, headers: res.headers };
|
|
304
|
-
};
|
|
305
|
-
var getPostManageDataTypeSlugUrl = (typeSlug) => {
|
|
306
|
-
return `/api/v1/sdk/manage/data/${typeSlug}`;
|
|
307
|
-
};
|
|
308
|
-
var postManageDataTypeSlug = async (typeSlug, sdkCreateEntryRequest, options) => {
|
|
309
|
-
const res = await fetch(
|
|
310
|
-
getPostManageDataTypeSlugUrl(typeSlug),
|
|
311
|
-
{
|
|
312
|
-
...options,
|
|
313
|
-
method: "POST",
|
|
314
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
315
|
-
body: JSON.stringify(
|
|
316
|
-
sdkCreateEntryRequest
|
|
317
|
-
)
|
|
318
|
-
}
|
|
319
|
-
);
|
|
320
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
321
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
322
|
-
return { data, status: res.status, headers: res.headers };
|
|
323
|
-
};
|
|
324
|
-
var getGetManageDataTypeSlugIdUrl = (typeSlug, id, params) => {
|
|
325
|
-
const normalizedParams = new URLSearchParams();
|
|
326
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
327
|
-
if (value !== void 0) {
|
|
328
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
const stringifiedParams = normalizedParams.toString();
|
|
332
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}/${id}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}/${id}`;
|
|
333
|
-
};
|
|
334
|
-
var getManageDataTypeSlugId = async (typeSlug, id, params, options) => {
|
|
335
|
-
const res = await fetch(
|
|
336
|
-
getGetManageDataTypeSlugIdUrl(typeSlug, id, params),
|
|
337
|
-
{
|
|
338
|
-
...options,
|
|
339
|
-
method: "GET"
|
|
340
|
-
}
|
|
341
|
-
);
|
|
342
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
343
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
344
|
-
return { data, status: res.status, headers: res.headers };
|
|
345
|
-
};
|
|
346
|
-
var getPatchManageDataTypeSlugIdUrl = (typeSlug, id) => {
|
|
347
|
-
return `/api/v1/sdk/manage/data/${typeSlug}/${id}`;
|
|
348
|
-
};
|
|
349
|
-
var patchManageDataTypeSlugId = async (typeSlug, id, sdkUpdateEntryRequest, options) => {
|
|
350
|
-
const res = await fetch(
|
|
351
|
-
getPatchManageDataTypeSlugIdUrl(typeSlug, id),
|
|
352
|
-
{
|
|
353
|
-
...options,
|
|
354
|
-
method: "PATCH",
|
|
355
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
356
|
-
body: JSON.stringify(
|
|
357
|
-
sdkUpdateEntryRequest
|
|
358
|
-
)
|
|
359
|
-
}
|
|
360
|
-
);
|
|
361
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
362
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
363
|
-
return { data, status: res.status, headers: res.headers };
|
|
364
|
-
};
|
|
365
|
-
var getDeleteManageDataTypeSlugIdUrl = (typeSlug, id, params) => {
|
|
366
|
-
const normalizedParams = new URLSearchParams();
|
|
367
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
368
|
-
if (value !== void 0) {
|
|
369
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
const stringifiedParams = normalizedParams.toString();
|
|
373
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}/${id}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}/${id}`;
|
|
374
|
-
};
|
|
375
|
-
var deleteManageDataTypeSlugId = async (typeSlug, id, params, options) => {
|
|
376
|
-
const res = await fetch(
|
|
377
|
-
getDeleteManageDataTypeSlugIdUrl(typeSlug, id, params),
|
|
378
|
-
{
|
|
379
|
-
...options,
|
|
380
|
-
method: "DELETE"
|
|
381
|
-
}
|
|
382
|
-
);
|
|
383
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
384
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
385
|
-
return { data, status: res.status, headers: res.headers };
|
|
386
|
-
};
|
|
387
|
-
var getGetManageDataTypeSlugIdDeletionImpactUrl = (typeSlug, id) => {
|
|
388
|
-
return `/api/v1/sdk/manage/data/${typeSlug}/${id}/deletion-impact`;
|
|
389
|
-
};
|
|
390
|
-
var getManageDataTypeSlugIdDeletionImpact = async (typeSlug, id, options) => {
|
|
391
|
-
const res = await fetch(
|
|
392
|
-
getGetManageDataTypeSlugIdDeletionImpactUrl(typeSlug, id),
|
|
393
|
-
{
|
|
394
|
-
...options,
|
|
395
|
-
method: "GET"
|
|
396
|
-
}
|
|
397
|
-
);
|
|
398
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
399
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
400
|
-
return { data, status: res.status, headers: res.headers };
|
|
401
|
-
};
|
|
402
|
-
var getGetManageComponentsUrl = () => {
|
|
403
|
-
return `/api/v1/sdk/manage/components`;
|
|
404
|
-
};
|
|
405
|
-
var getManageComponents = async (options) => {
|
|
406
|
-
const res = await fetch(
|
|
407
|
-
getGetManageComponentsUrl(),
|
|
408
|
-
{
|
|
409
|
-
...options,
|
|
410
|
-
method: "GET"
|
|
411
|
-
}
|
|
412
|
-
);
|
|
413
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
414
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
415
|
-
return { data, status: res.status, headers: res.headers };
|
|
416
|
-
};
|
|
417
|
-
var getPostManageComponentsSyncUrl = () => {
|
|
418
|
-
return `/api/v1/sdk/manage/components/sync`;
|
|
419
|
-
};
|
|
420
|
-
var postManageComponentsSync = async (sdkComponentSyncRequest, options) => {
|
|
421
|
-
const res = await fetch(
|
|
422
|
-
getPostManageComponentsSyncUrl(),
|
|
423
|
-
{
|
|
424
|
-
...options,
|
|
425
|
-
method: "POST",
|
|
426
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
427
|
-
body: JSON.stringify(
|
|
428
|
-
sdkComponentSyncRequest
|
|
429
|
-
)
|
|
430
|
-
}
|
|
431
|
-
);
|
|
432
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
433
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
434
|
-
return { data, status: res.status, headers: res.headers };
|
|
435
|
-
};
|
|
436
|
-
var getGetManageFormDefinitionsUrl = () => {
|
|
437
|
-
return `/api/v1/sdk/manage/form-definitions`;
|
|
438
|
-
};
|
|
439
|
-
var getManageFormDefinitions = async (options) => {
|
|
440
|
-
const res = await fetch(
|
|
441
|
-
getGetManageFormDefinitionsUrl(),
|
|
442
|
-
{
|
|
443
|
-
...options,
|
|
444
|
-
method: "GET"
|
|
445
|
-
}
|
|
446
|
-
);
|
|
447
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
448
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
449
|
-
return { data, status: res.status, headers: res.headers };
|
|
450
|
-
};
|
|
451
|
-
var getPostManageFormDefinitionsUrl = () => {
|
|
452
|
-
return `/api/v1/sdk/manage/form-definitions`;
|
|
453
|
-
};
|
|
454
|
-
var postManageFormDefinitions = async (createFormDefinitionRequest, options) => {
|
|
455
|
-
const res = await fetch(
|
|
456
|
-
getPostManageFormDefinitionsUrl(),
|
|
457
|
-
{
|
|
458
|
-
...options,
|
|
459
|
-
method: "POST",
|
|
460
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
461
|
-
body: JSON.stringify(
|
|
462
|
-
createFormDefinitionRequest
|
|
463
|
-
)
|
|
464
|
-
}
|
|
465
|
-
);
|
|
466
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
467
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
468
|
-
return { data, status: res.status, headers: res.headers };
|
|
469
|
-
};
|
|
470
|
-
var getPutManageFormDefinitionsSlugUrl = (slug) => {
|
|
471
|
-
return `/api/v1/sdk/manage/form-definitions/${slug}`;
|
|
472
|
-
};
|
|
473
|
-
var putManageFormDefinitionsSlug = async (slug, updateFormDefinitionRequest, options) => {
|
|
474
|
-
const res = await fetch(
|
|
475
|
-
getPutManageFormDefinitionsSlugUrl(slug),
|
|
476
|
-
{
|
|
477
|
-
...options,
|
|
478
|
-
method: "PUT",
|
|
479
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
480
|
-
body: JSON.stringify(
|
|
481
|
-
updateFormDefinitionRequest
|
|
482
|
-
)
|
|
483
|
-
}
|
|
484
|
-
);
|
|
485
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
486
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
487
|
-
return { data, status: res.status, headers: res.headers };
|
|
488
|
-
};
|
|
489
|
-
var getDeleteManageFormDefinitionsSlugUrl = (slug) => {
|
|
490
|
-
return `/api/v1/sdk/manage/form-definitions/${slug}`;
|
|
491
|
-
};
|
|
492
|
-
var deleteManageFormDefinitionsSlug = async (slug, options) => {
|
|
493
|
-
const res = await fetch(
|
|
494
|
-
getDeleteManageFormDefinitionsSlugUrl(slug),
|
|
495
|
-
{
|
|
496
|
-
...options,
|
|
497
|
-
method: "DELETE"
|
|
498
|
-
}
|
|
499
|
-
);
|
|
500
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
501
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
502
|
-
return { data, status: res.status, headers: res.headers };
|
|
503
|
-
};
|
|
504
|
-
var getGetManageCollectionsSlugDataTypesUrl = (slug) => {
|
|
505
|
-
return `/api/v1/sdk/manage/collections/${slug}/data-types`;
|
|
506
|
-
};
|
|
507
|
-
var getManageCollectionsSlugDataTypes = async (slug, options) => {
|
|
508
|
-
const res = await fetch(
|
|
509
|
-
getGetManageCollectionsSlugDataTypesUrl(slug),
|
|
510
|
-
{
|
|
511
|
-
...options,
|
|
512
|
-
method: "GET"
|
|
513
|
-
}
|
|
514
|
-
);
|
|
515
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
516
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
517
|
-
return { data, status: res.status, headers: res.headers };
|
|
518
|
-
};
|
|
519
|
-
var getPostManageCollectionsSlugDataTypesUrl = (slug) => {
|
|
520
|
-
return `/api/v1/sdk/manage/collections/${slug}/data-types`;
|
|
521
|
-
};
|
|
522
|
-
var postManageCollectionsSlugDataTypes = async (slug, sdkAddCollectionDataTypeRequest, options) => {
|
|
523
|
-
const res = await fetch(
|
|
524
|
-
getPostManageCollectionsSlugDataTypesUrl(slug),
|
|
525
|
-
{
|
|
526
|
-
...options,
|
|
527
|
-
method: "POST",
|
|
528
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
529
|
-
body: JSON.stringify(
|
|
530
|
-
sdkAddCollectionDataTypeRequest
|
|
531
|
-
)
|
|
532
|
-
}
|
|
533
|
-
);
|
|
534
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
535
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
536
|
-
return { data, status: res.status, headers: res.headers };
|
|
537
|
-
};
|
|
538
|
-
var getDeleteManageCollectionsSlugDataTypesDtSlugUrl = (slug, dtSlug) => {
|
|
539
|
-
return `/api/v1/sdk/manage/collections/${slug}/data-types/${dtSlug}`;
|
|
540
|
-
};
|
|
541
|
-
var deleteManageCollectionsSlugDataTypesDtSlug = async (slug, dtSlug, options) => {
|
|
542
|
-
const res = await fetch(
|
|
543
|
-
getDeleteManageCollectionsSlugDataTypesDtSlugUrl(slug, dtSlug),
|
|
544
|
-
{
|
|
545
|
-
...options,
|
|
546
|
-
method: "DELETE"
|
|
547
|
-
}
|
|
548
|
-
);
|
|
549
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
550
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
551
|
-
return { data, status: res.status, headers: res.headers };
|
|
552
|
-
};
|
|
553
|
-
var getPostManageCollectionsSlugDataTypesLinkUrl = (slug) => {
|
|
554
|
-
return `/api/v1/sdk/manage/collections/${slug}/data-types/link`;
|
|
555
|
-
};
|
|
556
|
-
var postManageCollectionsSlugDataTypesLink = async (slug, sdkLinkExistingDataTypeRequest, options) => {
|
|
557
|
-
const res = await fetch(
|
|
558
|
-
getPostManageCollectionsSlugDataTypesLinkUrl(slug),
|
|
559
|
-
{
|
|
560
|
-
...options,
|
|
561
|
-
method: "POST",
|
|
562
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
563
|
-
body: JSON.stringify(
|
|
564
|
-
sdkLinkExistingDataTypeRequest
|
|
565
|
-
)
|
|
566
|
-
}
|
|
567
|
-
);
|
|
568
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
569
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
570
|
-
return { data, status: res.status, headers: res.headers };
|
|
571
|
-
};
|
|
572
|
-
var getGetManageCollectionPresetsUrl = (params) => {
|
|
573
|
-
const normalizedParams = new URLSearchParams();
|
|
574
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
575
|
-
if (value !== void 0) {
|
|
576
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
577
|
-
}
|
|
578
|
-
});
|
|
579
|
-
const stringifiedParams = normalizedParams.toString();
|
|
580
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/collection-presets?${stringifiedParams}` : `/api/v1/sdk/manage/collection-presets`;
|
|
581
|
-
};
|
|
582
|
-
var getManageCollectionPresets = async (params, options) => {
|
|
583
|
-
const res = await fetch(
|
|
584
|
-
getGetManageCollectionPresetsUrl(params),
|
|
585
|
-
{
|
|
586
|
-
...options,
|
|
587
|
-
method: "GET"
|
|
588
|
-
}
|
|
589
|
-
);
|
|
590
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
591
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
592
|
-
return { data, status: res.status, headers: res.headers };
|
|
593
|
-
};
|
|
594
|
-
var getPostManageContentsUrl = () => {
|
|
595
|
-
return `/api/v1/sdk/manage/contents`;
|
|
596
|
-
};
|
|
597
|
-
var postManageContents = async (createContentRequest, options) => {
|
|
598
|
-
const res = await fetch(
|
|
599
|
-
getPostManageContentsUrl(),
|
|
600
|
-
{
|
|
601
|
-
...options,
|
|
602
|
-
method: "POST",
|
|
603
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
604
|
-
body: JSON.stringify(
|
|
605
|
-
createContentRequest
|
|
606
|
-
)
|
|
607
|
-
}
|
|
608
|
-
);
|
|
609
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
610
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
611
|
-
return { data, status: res.status, headers: res.headers };
|
|
612
|
-
};
|
|
613
|
-
var getGetManageContentsUrl = (params) => {
|
|
614
|
-
const normalizedParams = new URLSearchParams();
|
|
615
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
616
|
-
if (value !== void 0) {
|
|
617
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
618
|
-
}
|
|
619
|
-
});
|
|
620
|
-
const stringifiedParams = normalizedParams.toString();
|
|
621
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/contents?${stringifiedParams}` : `/api/v1/sdk/manage/contents`;
|
|
622
|
-
};
|
|
623
|
-
var getManageContents = async (params, options) => {
|
|
624
|
-
const res = await fetch(
|
|
625
|
-
getGetManageContentsUrl(params),
|
|
626
|
-
{
|
|
627
|
-
...options,
|
|
628
|
-
method: "GET"
|
|
629
|
-
}
|
|
630
|
-
);
|
|
631
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
632
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
633
|
-
return { data, status: res.status, headers: res.headers };
|
|
634
|
-
};
|
|
635
|
-
var getPostManageContentsIdRequestReviewUrl = (id) => {
|
|
636
|
-
return `/api/v1/sdk/manage/contents/${id}/request-review`;
|
|
637
|
-
};
|
|
638
|
-
var postManageContentsIdRequestReview = async (id, options) => {
|
|
639
|
-
const res = await fetch(
|
|
640
|
-
getPostManageContentsIdRequestReviewUrl(id),
|
|
641
|
-
{
|
|
642
|
-
...options,
|
|
643
|
-
method: "POST"
|
|
644
|
-
}
|
|
645
|
-
);
|
|
646
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
647
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
648
|
-
return { data, status: res.status, headers: res.headers };
|
|
649
|
-
};
|
|
650
|
-
var getPostManageContentsIdPublishUrl = (id) => {
|
|
651
|
-
return `/api/v1/sdk/manage/contents/${id}/publish`;
|
|
652
|
-
};
|
|
653
|
-
var postManageContentsIdPublish = async (id, options) => {
|
|
654
|
-
const res = await fetch(
|
|
655
|
-
getPostManageContentsIdPublishUrl(id),
|
|
656
|
-
{
|
|
657
|
-
...options,
|
|
658
|
-
method: "POST"
|
|
659
|
-
}
|
|
660
|
-
);
|
|
661
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
662
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
663
|
-
return { data, status: res.status, headers: res.headers };
|
|
664
|
-
};
|
|
665
|
-
var getGetManageContentsIdReferencesUrl = (id) => {
|
|
666
|
-
return `/api/v1/sdk/manage/contents/${id}/references`;
|
|
667
|
-
};
|
|
668
|
-
var getManageContentsIdReferences = async (id, options) => {
|
|
669
|
-
const res = await fetch(
|
|
670
|
-
getGetManageContentsIdReferencesUrl(id),
|
|
671
|
-
{
|
|
672
|
-
...options,
|
|
673
|
-
method: "GET"
|
|
674
|
-
}
|
|
675
|
-
);
|
|
676
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
677
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
678
|
-
return { data, status: res.status, headers: res.headers };
|
|
679
|
-
};
|
|
680
|
-
var getPutManageContentsIdReferencesUrl = (id) => {
|
|
681
|
-
return `/api/v1/sdk/manage/contents/${id}/references`;
|
|
682
|
-
};
|
|
683
|
-
var putManageContentsIdReferences = async (id, sdkSetContentReferencesRequest, options) => {
|
|
684
|
-
const res = await fetch(
|
|
685
|
-
getPutManageContentsIdReferencesUrl(id),
|
|
686
|
-
{
|
|
687
|
-
...options,
|
|
688
|
-
method: "PUT",
|
|
689
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
690
|
-
body: JSON.stringify(
|
|
691
|
-
sdkSetContentReferencesRequest
|
|
692
|
-
)
|
|
693
|
-
}
|
|
694
|
-
);
|
|
695
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
696
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
697
|
-
return { data, status: res.status, headers: res.headers };
|
|
698
|
-
};
|
|
699
|
-
var getGetManageContentsIdUrl = (id, params) => {
|
|
700
|
-
const normalizedParams = new URLSearchParams();
|
|
701
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
702
|
-
if (value !== void 0) {
|
|
703
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
704
|
-
}
|
|
705
|
-
});
|
|
706
|
-
const stringifiedParams = normalizedParams.toString();
|
|
707
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/contents/${id}?${stringifiedParams}` : `/api/v1/sdk/manage/contents/${id}`;
|
|
708
|
-
};
|
|
709
|
-
var getManageContentsId = async (id, params, options) => {
|
|
710
|
-
const res = await fetch(
|
|
711
|
-
getGetManageContentsIdUrl(id, params),
|
|
712
|
-
{
|
|
713
|
-
...options,
|
|
714
|
-
method: "GET"
|
|
715
|
-
}
|
|
716
|
-
);
|
|
717
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
718
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
719
|
-
return { data, status: res.status, headers: res.headers };
|
|
720
|
-
};
|
|
721
|
-
var getPutManageContentsIdUrl = (id) => {
|
|
722
|
-
return `/api/v1/sdk/manage/contents/${id}`;
|
|
723
|
-
};
|
|
724
|
-
var putManageContentsId = async (id, updateContentRequest, options) => {
|
|
725
|
-
const res = await fetch(
|
|
726
|
-
getPutManageContentsIdUrl(id),
|
|
727
|
-
{
|
|
728
|
-
...options,
|
|
729
|
-
method: "PUT",
|
|
730
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
731
|
-
body: JSON.stringify(
|
|
732
|
-
updateContentRequest
|
|
733
|
-
)
|
|
734
|
-
}
|
|
735
|
-
);
|
|
736
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
737
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
738
|
-
return { data, status: res.status, headers: res.headers };
|
|
739
|
-
};
|
|
740
|
-
var getDeleteManageContentsIdUrl = (id, params) => {
|
|
741
|
-
const normalizedParams = new URLSearchParams();
|
|
742
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
743
|
-
if (value !== void 0) {
|
|
744
|
-
normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
745
|
-
}
|
|
746
|
-
});
|
|
747
|
-
const stringifiedParams = normalizedParams.toString();
|
|
748
|
-
return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/contents/${id}?${stringifiedParams}` : `/api/v1/sdk/manage/contents/${id}`;
|
|
749
|
-
};
|
|
750
|
-
var deleteManageContentsId = async (id, params, options) => {
|
|
751
|
-
const res = await fetch(
|
|
752
|
-
getDeleteManageContentsIdUrl(id, params),
|
|
753
|
-
{
|
|
754
|
-
...options,
|
|
755
|
-
method: "DELETE"
|
|
756
|
-
}
|
|
757
|
-
);
|
|
758
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
759
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
760
|
-
return { data, status: res.status, headers: res.headers };
|
|
761
|
-
};
|
|
762
|
-
var getGetManageContentsIdValidateUrl = (id) => {
|
|
763
|
-
return `/api/v1/sdk/manage/contents/${id}/validate`;
|
|
764
|
-
};
|
|
765
|
-
var getManageContentsIdValidate = async (id, options) => {
|
|
766
|
-
const res = await fetch(
|
|
767
|
-
getGetManageContentsIdValidateUrl(id),
|
|
768
|
-
{
|
|
769
|
-
...options,
|
|
770
|
-
method: "GET"
|
|
771
|
-
}
|
|
772
|
-
);
|
|
773
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
774
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
775
|
-
return { data, status: res.status, headers: res.headers };
|
|
776
|
-
};
|
|
777
|
-
var getPutManageDocsTypeUrl = (type) => {
|
|
778
|
-
return `/api/v1/sdk/manage/docs/${type}`;
|
|
779
|
-
};
|
|
780
|
-
var putManageDocsType = async (type, sdkUpsertDocBody, options) => {
|
|
781
|
-
const res = await fetch(
|
|
782
|
-
getPutManageDocsTypeUrl(type),
|
|
783
|
-
{
|
|
784
|
-
...options,
|
|
785
|
-
method: "PUT",
|
|
786
|
-
headers: { "Content-Type": "application/json", ...options?.headers },
|
|
787
|
-
body: JSON.stringify(
|
|
788
|
-
sdkUpsertDocBody
|
|
789
|
-
)
|
|
790
|
-
}
|
|
791
|
-
);
|
|
792
|
-
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
793
|
-
const data = body ? JSON.parse(body, dateReviver) : {};
|
|
794
|
-
return { data, status: res.status, headers: res.headers };
|
|
795
|
-
};
|
|
796
|
-
|
|
797
63
|
// src/commands/list-collections.ts
|
|
798
64
|
async function listCollections() {
|
|
799
65
|
ensureApiCredentials();
|
|
@@ -1198,7 +464,7 @@ async function deleteForm(options) {
|
|
|
1198
464
|
}
|
|
1199
465
|
|
|
1200
466
|
// src/commands/sync-components.ts
|
|
1201
|
-
import { readdirSync, readFileSync
|
|
467
|
+
import { readdirSync, readFileSync, existsSync } from "fs";
|
|
1202
468
|
import { join } from "path";
|
|
1203
469
|
import { z as z2 } from "zod";
|
|
1204
470
|
|
|
@@ -1726,7 +992,7 @@ function readComponentDefinitions(componentsDir) {
|
|
|
1726
992
|
for (const file of files) {
|
|
1727
993
|
try {
|
|
1728
994
|
const filePath = join(componentsDir, file);
|
|
1729
|
-
const content =
|
|
995
|
+
const content = readFileSync(filePath, "utf-8");
|
|
1730
996
|
const parsed = JSON.parse(content);
|
|
1731
997
|
const result = ComponentDefinitionSchema.safeParse(parsed);
|
|
1732
998
|
if (!result.success) {
|
|
@@ -1779,7 +1045,7 @@ async function syncComponents() {
|
|
|
1779
1045
|
}
|
|
1780
1046
|
|
|
1781
1047
|
// src/commands/sync-docs.ts
|
|
1782
|
-
import { readFileSync as
|
|
1048
|
+
import { readFileSync as readFileSync2, existsSync as existsSync2 } from "fs";
|
|
1783
1049
|
import { join as join2 } from "path";
|
|
1784
1050
|
var DOC_FILES = [
|
|
1785
1051
|
{ type: "style_guide", file: "cmx/style-guide.md", label: "\u30B9\u30BF\u30A4\u30EB\u30AC\u30A4\u30C9" }
|
|
@@ -1795,7 +1061,7 @@ async function syncDocs() {
|
|
|
1795
1061
|
results.push({ type, label, status: "skipped" });
|
|
1796
1062
|
continue;
|
|
1797
1063
|
}
|
|
1798
|
-
const markdown =
|
|
1064
|
+
const markdown = readFileSync2(filePath, "utf-8");
|
|
1799
1065
|
console.log(` ${label} \u3092\u540C\u671F\u3057\u3066\u3044\u307E\u3059...`);
|
|
1800
1066
|
assertSdkSuccess(await putManageDocsType(type, { markdown }));
|
|
1801
1067
|
results.push({ type, label, status: "synced" });
|
|
@@ -3438,6 +2704,9 @@ async function createContent(options) {
|
|
|
3438
2704
|
mdx: input.mdx ?? "",
|
|
3439
2705
|
collectionId,
|
|
3440
2706
|
...input.description !== void 0 ? { description: input.description } : {},
|
|
2707
|
+
...options.coverImageAssetId ? { coverImageAssetId: options.coverImageAssetId } : {},
|
|
2708
|
+
...options.coverImageExternalUrl ? { coverImageExternalUrl: options.coverImageExternalUrl } : {},
|
|
2709
|
+
...options.summary ? { summary: options.summary } : {},
|
|
3441
2710
|
...options.publish ? { autoPublish: true } : {}
|
|
3442
2711
|
};
|
|
3443
2712
|
console.log(`\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u4F5C\u6210\u3057\u3066\u3044\u307E\u3059: ${collectionSlug || collectionId}...`);
|
|
@@ -3649,7 +2918,7 @@ async function deleteDataEntry(options) {
|
|
|
3649
2918
|
}
|
|
3650
2919
|
|
|
3651
2920
|
// src/commands/scaffold-component.ts
|
|
3652
|
-
import { existsSync as existsSync4, mkdirSync, readFileSync as
|
|
2921
|
+
import { existsSync as existsSync4, mkdirSync, readFileSync as readFileSync3, writeFileSync } from "fs";
|
|
3653
2922
|
import { join as join5 } from "path";
|
|
3654
2923
|
function toPascalCase(input) {
|
|
3655
2924
|
const cleaned = input.replace(/[^a-zA-Z0-9_-]/g, "-");
|
|
@@ -3670,7 +2939,7 @@ function ensureExport(indexPath, exportName) {
|
|
|
3670
2939
|
writeFileSync(indexPath, exportLine, "utf-8");
|
|
3671
2940
|
return;
|
|
3672
2941
|
}
|
|
3673
|
-
const current =
|
|
2942
|
+
const current = readFileSync3(indexPath, "utf-8");
|
|
3674
2943
|
if (current.includes(exportLine.trim())) {
|
|
3675
2944
|
return;
|
|
3676
2945
|
}
|
|
@@ -3762,7 +3031,7 @@ export function ${pascalName}({ title, children }: ${pascalName}Props) {
|
|
|
3762
3031
|
}
|
|
3763
3032
|
|
|
3764
3033
|
// src/commands/codegen-check.ts
|
|
3765
|
-
import { existsSync as existsSync5, readFileSync as
|
|
3034
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4, readdirSync as readdirSync2, statSync } from "fs";
|
|
3766
3035
|
import { extname, join as join6, relative, resolve as resolve2 } from "path";
|
|
3767
3036
|
import stripJsonComments from "strip-json-comments";
|
|
3768
3037
|
function stripTrailingCommas(input) {
|
|
@@ -3839,7 +3108,7 @@ async function runCodegenCheck(options = {}) {
|
|
|
3839
3108
|
errors.push(`tsconfig \u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${relative(projectRoot, tsconfigAbs)}`);
|
|
3840
3109
|
} else {
|
|
3841
3110
|
try {
|
|
3842
|
-
const raw =
|
|
3111
|
+
const raw = readFileSync4(tsconfigAbs, "utf-8");
|
|
3843
3112
|
const parsed = JSON.parse(stripTrailingCommas(stripJsonComments(raw)));
|
|
3844
3113
|
const aliasValues = parsed.compilerOptions?.paths?.["@cmx/*"] ?? [];
|
|
3845
3114
|
if (aliasValues.length === 0) {
|
|
@@ -3872,7 +3141,7 @@ async function runCodegenCheck(options = {}) {
|
|
|
3872
3141
|
const legacyImportHits = [];
|
|
3873
3142
|
const generatedImportHits = [];
|
|
3874
3143
|
for (const sourceFile of sourceFiles) {
|
|
3875
|
-
const code =
|
|
3144
|
+
const code = readFileSync4(sourceFile, "utf-8");
|
|
3876
3145
|
const imports = extractImports(code);
|
|
3877
3146
|
for (const importPath of imports) {
|
|
3878
3147
|
if (importPath.startsWith("@/cmx/generated")) {
|
|
@@ -3938,7 +3207,7 @@ Codegen \u30C1\u30A7\u30C3\u30AF\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${pr
|
|
|
3938
3207
|
}
|
|
3939
3208
|
|
|
3940
3209
|
// src/commands/mdx-validate.ts
|
|
3941
|
-
import { existsSync as existsSync6, readFileSync as
|
|
3210
|
+
import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync3, statSync as statSync2 } from "fs";
|
|
3942
3211
|
import { extname as extname2, join as join7, relative as relative2, resolve as resolve3 } from "path";
|
|
3943
3212
|
|
|
3944
3213
|
// src/mdx/validator.ts
|
|
@@ -4267,7 +3536,7 @@ async function mdxValidate(options) {
|
|
|
4267
3536
|
let invalidCount = 0;
|
|
4268
3537
|
let warningCount = 0;
|
|
4269
3538
|
for (const filePath of targets) {
|
|
4270
|
-
const mdx =
|
|
3539
|
+
const mdx = readFileSync5(filePath, "utf-8");
|
|
4271
3540
|
const result = await validateMdx(mdx);
|
|
4272
3541
|
const relPath = relative2(projectRoot, filePath);
|
|
4273
3542
|
if (result.valid) {
|
|
@@ -4297,7 +3566,7 @@ async function mdxValidate(options) {
|
|
|
4297
3566
|
}
|
|
4298
3567
|
|
|
4299
3568
|
// src/commands/mdx-doctor.ts
|
|
4300
|
-
import { existsSync as existsSync7, readFileSync as
|
|
3569
|
+
import { existsSync as existsSync7, readFileSync as readFileSync6, readdirSync as readdirSync4, statSync as statSync3 } from "fs";
|
|
4301
3570
|
import { basename, extname as extname3, join as join8, relative as relative3, resolve as resolve4 } from "path";
|
|
4302
3571
|
function collectFiles2(rootDir, extension) {
|
|
4303
3572
|
const files = [];
|
|
@@ -4326,7 +3595,7 @@ function parseDefinitionFiles(projectRoot, files) {
|
|
|
4326
3595
|
const errors = [];
|
|
4327
3596
|
for (const file of files) {
|
|
4328
3597
|
try {
|
|
4329
|
-
const raw =
|
|
3598
|
+
const raw = readFileSync6(file, "utf-8");
|
|
4330
3599
|
const parsed = JSON.parse(raw);
|
|
4331
3600
|
if (typeof parsed.name !== "string" || parsed.name.length === 0) {
|
|
4332
3601
|
errors.push(`${relative3(projectRoot, file)}: \u6587\u5B57\u5217\u306E 'name' \u304C\u5FC5\u8981\u3067\u3059`);
|
|
@@ -4405,7 +3674,7 @@ async function mdxDoctor(options = {}) {
|
|
|
4405
3674
|
if (!existsSync7(indexFile)) {
|
|
4406
3675
|
issues.push(`\u30A8\u30AF\u30B9\u30DD\u30FC\u30C8\u7528 index \u30D5\u30A1\u30A4\u30EB\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093: ${relative3(projectRoot, indexFile)}`);
|
|
4407
3676
|
} else {
|
|
4408
|
-
const indexContent =
|
|
3677
|
+
const indexContent = readFileSync6(indexFile, "utf-8");
|
|
4409
3678
|
const exportedNames = collectExportedComponentNames(indexContent);
|
|
4410
3679
|
for (const implName of implementationNames) {
|
|
4411
3680
|
if (!exportedNames.has(implName)) {
|
|
@@ -4462,7 +3731,7 @@ async function getContent(options) {
|
|
|
4462
3731
|
}
|
|
4463
3732
|
|
|
4464
3733
|
// src/commands/update-content.ts
|
|
4465
|
-
import { readFileSync as
|
|
3734
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
4466
3735
|
async function updateContent(options) {
|
|
4467
3736
|
ensureApiCredentials();
|
|
4468
3737
|
if (!options.id) {
|
|
@@ -4474,9 +3743,12 @@ async function updateContent(options) {
|
|
|
4474
3743
|
if (options.slug !== void 0) body.slug = options.slug;
|
|
4475
3744
|
if (options.description !== void 0) body.description = options.description;
|
|
4476
3745
|
if (options.status !== void 0) body.status = options.status;
|
|
3746
|
+
if (options.coverImageAssetId !== void 0) body.coverImageAssetId = options.coverImageAssetId;
|
|
3747
|
+
if (options.coverImageExternalUrl !== void 0) body.coverImageExternalUrl = options.coverImageExternalUrl;
|
|
3748
|
+
if (options.summary !== void 0) body.summary = options.summary;
|
|
4477
3749
|
if (options.mdxFile) {
|
|
4478
3750
|
try {
|
|
4479
|
-
body.mdx =
|
|
3751
|
+
body.mdx = readFileSync7(options.mdxFile, "utf-8");
|
|
4480
3752
|
} catch {
|
|
4481
3753
|
console.error(`\u30A8\u30E9\u30FC: MDX\u30D5\u30A1\u30A4\u30EB\u306E\u8AAD\u307F\u8FBC\u307F\u306B\u5931\u6557\u3057\u307E\u3057\u305F: ${options.mdxFile}`);
|
|
4482
3754
|
process.exit(1);
|
|
@@ -4976,18 +4248,22 @@ program.command("list-data-entries").description("\u30C7\u30FC\u30BF\u30BF\u30A4
|
|
|
4976
4248
|
program.command("get-data-entry").description("\u5358\u4E00\u306E\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u3092\u53D6\u5F97").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--id <id>", "\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC ID").action(getDataEntry);
|
|
4977
4249
|
program.command("update-data-entry").description("\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u3092\u66F4\u65B0").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--id <id>", "\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC ID").option("--json <json>", "\u66F4\u65B0\u5185\u5BB9\u306E JSON \u6587\u5B57\u5217").option("--file <file>", "\u66F4\u65B0\u5185\u5BB9 JSON \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9").option("--status <status>", "\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08draft, review, published\uFF09").action(updateDataEntry);
|
|
4978
4250
|
program.command("delete-data-entry").description("\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u3092\u524A\u9664").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--id <id>", "\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC ID").option("--force", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(deleteDataEntry);
|
|
4979
|
-
program.command("create-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u4F5C\u6210").option("--collection <slug>", "\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30E9\u30C3\u30B0").option("--json <json>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u5B9A\u7FA9\u306E JSON \u6587\u5B57\u5217\uFF08\u63A8\u5968\uFF09").option("--file <file>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u5B9A\u7FA9 JSON \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9").option("--title <title>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u30BF\u30A4\u30C8\u30EB").option("--slug <slug>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u30B9\u30E9\u30C3\u30B0").option("--description <description>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u8AAC\u660E").option("--mdx <mdx>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u306E MDX \u672C\u6587").option("--publish", "\u4F5C\u6210\u3068\u540C\u6642\u306B\u516C\u958B\u3059\u308B").action(createContent);
|
|
4251
|
+
program.command("create-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u4F5C\u6210").option("--collection <slug>", "\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30E9\u30C3\u30B0").option("--json <json>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u5B9A\u7FA9\u306E JSON \u6587\u5B57\u5217\uFF08\u63A8\u5968\uFF09").option("--file <file>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u5B9A\u7FA9 JSON \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9").option("--title <title>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u30BF\u30A4\u30C8\u30EB").option("--slug <slug>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u30B9\u30E9\u30C3\u30B0").option("--description <description>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u8AAC\u660E").option("--mdx <mdx>", "\u30B3\u30F3\u30C6\u30F3\u30C4\u306E MDX \u672C\u6587").option("--cover-image-asset-id <id>", "\u30AB\u30D0\u30FC\u753B\u50CF\u30A2\u30BB\u30C3\u30C8ID").option("--cover-image-external-url <url>", "\u30AB\u30D0\u30FC\u753B\u50CF\u5916\u90E8URL\uFF08\u30A2\u30BB\u30C3\u30C8\u30B7\u30B9\u30C6\u30E0\u5916\u306E\u753B\u50CF\uFF09").option("--summary <summary>", "AI\u5411\u3051\u8A18\u4E8B\u8981\u7D04").option("--publish", "\u4F5C\u6210\u3068\u540C\u6642\u306B\u516C\u958B\u3059\u308B").action(createContent);
|
|
4980
4252
|
program.command("request-review-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u30EC\u30D3\u30E5\u30FC\u4F9D\u983C\u306B\u3059\u308B").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(requestReviewContent);
|
|
4981
4253
|
program.command("publish-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u516C\u958B").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(publishContent);
|
|
4982
4254
|
program.command("get-content-references").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u53C2\u7167\u60C5\u5831\u3092\u53D6\u5F97").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(getContentReferences);
|
|
4983
4255
|
program.command("set-content-references").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u53C2\u7167\u60C5\u5831\u3092\u66F4\u65B0").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").option("--json <json>", "\u53C2\u7167\u60C5\u5831\u306E JSON \u6587\u5B57\u5217").option("--file <file>", "\u53C2\u7167\u60C5\u5831 JSON \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9").action(setContentReferences);
|
|
4984
4256
|
program.command("list-contents").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u4E00\u89A7\u3092\u8868\u793A").option("--status <status>", "\u30B9\u30C6\u30FC\u30BF\u30B9\u30D5\u30A3\u30EB\u30BF\uFF08plan, draft, review, published, archived\uFF09").option("--collection-id <id>", "\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3ID\u30D5\u30A3\u30EB\u30BF").option("--limit <number>", "\u53D6\u5F97\u4EF6\u6570\uFF08\u6700\u5927100\uFF09").option("--offset <number>", "\u30AA\u30D5\u30BB\u30C3\u30C8").option("--fields <fields>", "\u53D6\u5F97\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u4F8B: id,slug,title,status").action(listContents);
|
|
4985
4257
|
program.command("get-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u53D6\u5F97").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").option("--fields <fields>", "\u53D6\u5F97\u3059\u308B\u30D5\u30A3\u30FC\u30EB\u30C9\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u4F8B: id,slug,title,mdx").action(getContent);
|
|
4986
|
-
program.command("update-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u66F4\u65B0").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").option("--title <title>", "\u65B0\u3057\u3044\u30BF\u30A4\u30C8\u30EB").option("--slug <slug>", "\u65B0\u3057\u3044\u30B9\u30E9\u30C3\u30B0").option("--description <description>", "\u65B0\u3057\u3044\u8AAC\u660E").option("--mdx <mdx>", "\u65B0\u3057\u3044 MDX \u672C\u6587").option("--mdx-file <file>", "MDX \u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u307F\u8FBC\u3080").option("--status <status>", "\u65B0\u3057\u3044\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08plan, draft, review, archived\uFF09").action(updateContent);
|
|
4258
|
+
program.command("update-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u66F4\u65B0").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").option("--title <title>", "\u65B0\u3057\u3044\u30BF\u30A4\u30C8\u30EB").option("--slug <slug>", "\u65B0\u3057\u3044\u30B9\u30E9\u30C3\u30B0").option("--description <description>", "\u65B0\u3057\u3044\u8AAC\u660E").option("--mdx <mdx>", "\u65B0\u3057\u3044 MDX \u672C\u6587").option("--mdx-file <file>", "MDX \u3092\u30D5\u30A1\u30A4\u30EB\u304B\u3089\u8AAD\u307F\u8FBC\u3080").option("--status <status>", "\u65B0\u3057\u3044\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08plan, draft, review, archived\uFF09").option("--cover-image-asset-id <id>", "\u30AB\u30D0\u30FC\u753B\u50CF\u30A2\u30BB\u30C3\u30C8ID").option("--cover-image-external-url <url>", "\u30AB\u30D0\u30FC\u753B\u50CF\u5916\u90E8URL\uFF08\u30A2\u30BB\u30C3\u30C8\u30B7\u30B9\u30C6\u30E0\u5916\u306E\u753B\u50CF\uFF09").option("--summary <summary>", "AI\u5411\u3051\u8A18\u4E8B\u8981\u7D04").action(updateContent);
|
|
4987
4259
|
program.command("delete-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u524A\u9664\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8: \u30A2\u30FC\u30AB\u30A4\u30D6\uFF09").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").option("--hard", "\u7269\u7406\u524A\u9664\uFF08\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u30A2\u30FC\u30AB\u30A4\u30D6\uFF09").option("--force", "\u78BA\u8A8D\u30D7\u30ED\u30F3\u30D7\u30C8\u3092\u30B9\u30AD\u30C3\u30D7").action(deleteContent);
|
|
4988
4260
|
program.command("cancel-review-content").description("\u30EC\u30D3\u30E5\u30FC\u4F9D\u983C\u3092\u30AD\u30E3\u30F3\u30BB\u30EB\u3057\u3066\u30C9\u30E9\u30D5\u30C8\u306B\u623B\u3059").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(cancelReviewContent);
|
|
4989
4261
|
program.command("unpublish-content").description("\u516C\u958B\u6E08\u307F\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u30C9\u30E9\u30D5\u30C8\u306B\u623B\u3059").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(unpublishContent);
|
|
4990
4262
|
program.command("archive-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u3092\u30A2\u30FC\u30AB\u30A4\u30D6").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(archiveContent);
|
|
4991
4263
|
program.command("validate-content").description("\u30B3\u30F3\u30C6\u30F3\u30C4\u306E MDX \u53C2\u7167\u6574\u5408\u6027\u3092\u691C\u8A3C\uFF08\u554F\u984C\u3042\u308A\u6642\u306F exit code 1\uFF09").requiredOption("--id <id>", "\u30B3\u30F3\u30C6\u30F3\u30C4 ID").action(validateContent);
|
|
4992
4264
|
program.command("get-data-entry-deletion-impact").description("\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u524A\u9664\u6642\u306E\u5F71\u97FF\u3092\u78BA\u8A8D").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--id <id>", "\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC ID").action(getDataEntryDeletionImpact);
|
|
4265
|
+
program.command("report-bug").description("CMX \u30D7\u30E9\u30C3\u30C8\u30D5\u30A9\u30FC\u30E0\u306E\u30D0\u30B0\u3092\u5831\u544A").requiredOption("--title <title>", "\u30D0\u30B0\u306E\u6982\u8981\u30BF\u30A4\u30C8\u30EB").requiredOption("--description <description>", "\u30D0\u30B0\u306E\u8A73\u7D30\u8AAC\u660E").option("--severity <severity>", "\u91CD\u8981\u5EA6 (low, medium, high, critical)", "medium").option("--steps <steps>", "\u518D\u73FE\u624B\u9806").option("--error <message>", "\u30A8\u30E9\u30FC\u30E1\u30C3\u30BB\u30FC\u30B8").option("--command <command>", "\u5B9F\u884C\u3057\u305F CLI \u30B3\u30DE\u30F3\u30C9").action(async (options) => {
|
|
4266
|
+
const { reportBug } = await import("./report-bug-PT7NNFNN.js");
|
|
4267
|
+
await reportBug(options);
|
|
4268
|
+
});
|
|
4993
4269
|
program.parse();
|