cmx-sdk 0.2.4 → 0.2.6
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/{add-studio-TLDFTZTX.js → add-studio-J7M7KOWM.js} +36 -30
- package/dist/chunk-IIQLQIDP.js +55 -0
- package/dist/chunk-XPP5MZKG.js +0 -0
- package/dist/cli.js +5 -5
- package/dist/index.js +2 -6
- package/dist/index.js.map +1 -1
- package/dist/{init-XUTF5IBZ.js → init-NDNG5Q5T.js} +80 -31
- package/dist/{interactive-menu-BDZOOGQH.js → interactive-menu-RPPCBCOU.js} +2 -2
- package/dist/studio-3YGVKWS4.js +0 -0
- package/package.json +8 -9
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
cleanupTempFile,
|
|
4
|
+
downloadTarball
|
|
5
|
+
} from "./chunk-IIQLQIDP.js";
|
|
2
6
|
|
|
3
7
|
// src/commands/add-studio.ts
|
|
4
8
|
import { existsSync, readFileSync, mkdirSync } from "fs";
|
|
5
9
|
import { join, resolve } from "path";
|
|
6
10
|
import { execSync } from "child_process";
|
|
7
|
-
import {
|
|
8
|
-
import { pipeline } from "stream/promises";
|
|
9
|
-
import https from "https";
|
|
11
|
+
import { config } from "dotenv";
|
|
10
12
|
import { extract } from "tar";
|
|
11
13
|
var REPO_OWNER = "kzkm-lab";
|
|
12
14
|
var REPO_NAME = "cmx-starter-kit";
|
|
@@ -32,27 +34,8 @@ function findProjectRoot() {
|
|
|
32
34
|
async function downloadStudio(targetDir) {
|
|
33
35
|
const tarballUrl = `https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/tarball/${REPO_BRANCH}`;
|
|
34
36
|
const tmpFile = join(targetDir, ".tmp-studio-tarball.tar.gz");
|
|
35
|
-
await
|
|
36
|
-
|
|
37
|
-
https.get(url, {
|
|
38
|
-
headers: { "User-Agent": "cmx-sdk", Accept: "application/vnd.github+json" }
|
|
39
|
-
}, (res) => {
|
|
40
|
-
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
41
|
-
const redirectUrl = res.headers.location;
|
|
42
|
-
if (redirectUrl) {
|
|
43
|
-
download(redirectUrl);
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (res.statusCode !== 200) {
|
|
48
|
-
reject(new Error(`\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F (HTTP ${res.statusCode})`));
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
const fileStream = createWriteStream(tmpFile);
|
|
52
|
-
pipeline(res, fileStream).then(resolve2).catch(reject);
|
|
53
|
-
}).on("error", reject);
|
|
54
|
-
};
|
|
55
|
-
download(tarballUrl);
|
|
37
|
+
await downloadTarball(tarballUrl, tmpFile, {
|
|
38
|
+
headers: { Accept: "application/vnd.github+json" }
|
|
56
39
|
});
|
|
57
40
|
const studioDir = join(targetDir, ".cmx", "studio");
|
|
58
41
|
mkdirSync(studioDir, { recursive: true });
|
|
@@ -66,11 +49,26 @@ async function downloadStudio(targetDir) {
|
|
|
66
49
|
return parts.length >= 3 && parts[1] === ".cmx" && parts[2] === "studio";
|
|
67
50
|
}
|
|
68
51
|
});
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
52
|
+
cleanupTempFile(tmpFile);
|
|
53
|
+
}
|
|
54
|
+
async function downloadStudioViaApi(targetDir, apiUrl, apiKey) {
|
|
55
|
+
const downloadUrl = `${apiUrl}/api/v1/sdk/download/studio`;
|
|
56
|
+
const tmpFile = join(targetDir, ".tmp-studio-tarball.tar.gz");
|
|
57
|
+
await downloadTarball(downloadUrl, tmpFile, {
|
|
58
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
59
|
+
});
|
|
60
|
+
const studioDir = join(targetDir, ".cmx", "studio");
|
|
61
|
+
mkdirSync(studioDir, { recursive: true });
|
|
62
|
+
await extract({
|
|
63
|
+
file: tmpFile,
|
|
64
|
+
cwd: studioDir,
|
|
65
|
+
strip: 2,
|
|
66
|
+
filter: (path) => {
|
|
67
|
+
const parts = path.split("/");
|
|
68
|
+
return parts.length >= 3 && parts[1] === ".cmx" && parts[2] === "studio";
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
cleanupTempFile(tmpFile);
|
|
74
72
|
}
|
|
75
73
|
async function addStudio() {
|
|
76
74
|
console.log("\n CMX Studio \u3092\u8FFD\u52A0\u4E2D...\n");
|
|
@@ -86,9 +84,17 @@ async function addStudio() {
|
|
|
86
84
|
console.error(" \u518D\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u3059\u308B\u5834\u5408\u306F\u5148\u306B\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\n");
|
|
87
85
|
process.exit(1);
|
|
88
86
|
}
|
|
87
|
+
config({ path: join(projectRoot, ".env") });
|
|
88
|
+
const apiUrl = process.env.CMX_API_URL;
|
|
89
|
+
const apiKey = process.env.CMX_API_KEY;
|
|
90
|
+
const useApiDownload = !!(apiUrl && apiKey);
|
|
89
91
|
console.log(" \u23F3 Studio \u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u4E2D...");
|
|
90
92
|
try {
|
|
91
|
-
|
|
93
|
+
if (useApiDownload) {
|
|
94
|
+
await downloadStudioViaApi(projectRoot, apiUrl, apiKey);
|
|
95
|
+
} else {
|
|
96
|
+
await downloadStudio(projectRoot);
|
|
97
|
+
}
|
|
92
98
|
console.log(" \u2713 Studio \u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u307E\u3057\u305F");
|
|
93
99
|
} catch (error) {
|
|
94
100
|
console.error("\n \u274C Studio \u306E\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
// src/utils/download.ts
|
|
4
|
+
import { createWriteStream } from "fs";
|
|
5
|
+
import { pipeline } from "stream/promises";
|
|
6
|
+
import https from "https";
|
|
7
|
+
import http from "http";
|
|
8
|
+
import { rmSync } from "fs";
|
|
9
|
+
async function downloadTarball(url, destFile, options) {
|
|
10
|
+
const defaultHeaders = {
|
|
11
|
+
"User-Agent": "cmx-sdk"
|
|
12
|
+
};
|
|
13
|
+
const headers = { ...defaultHeaders, ...options?.headers };
|
|
14
|
+
await new Promise((resolve, reject) => {
|
|
15
|
+
const download = (targetUrl) => {
|
|
16
|
+
const isHttps = targetUrl.startsWith("https://");
|
|
17
|
+
const httpModule = isHttps ? https : http;
|
|
18
|
+
httpModule.get(targetUrl, { headers }, (res) => {
|
|
19
|
+
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
20
|
+
const redirectUrl = res.headers.location;
|
|
21
|
+
if (redirectUrl) {
|
|
22
|
+
download(redirectUrl);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
if (res.statusCode === 401) {
|
|
27
|
+
reject(new Error("\u8A8D\u8A3C\u306B\u5931\u6557\u3057\u307E\u3057\u305F\u3002API \u30AD\u30FC\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (res.statusCode === 403) {
|
|
31
|
+
reject(new Error("\u30A2\u30AF\u30BB\u30B9\u304C\u62D2\u5426\u3055\u308C\u307E\u3057\u305F\u3002API \u30AD\u30FC\u306E\u6A29\u9650\u3092\u78BA\u8A8D\u3057\u3066\u304F\u3060\u3055\u3044\u3002"));
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (res.statusCode !== 200) {
|
|
35
|
+
reject(new Error(`\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F (HTTP ${res.statusCode})`));
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const fileStream = createWriteStream(destFile);
|
|
39
|
+
pipeline(res, fileStream).then(resolve).catch(reject);
|
|
40
|
+
}).on("error", reject);
|
|
41
|
+
};
|
|
42
|
+
download(url);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function cleanupTempFile(filePath) {
|
|
46
|
+
try {
|
|
47
|
+
rmSync(filePath);
|
|
48
|
+
} catch {
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
downloadTarball,
|
|
54
|
+
cleanupTempFile
|
|
55
|
+
};
|
package/dist/chunk-XPP5MZKG.js
CHANGED
|
File without changes
|
package/dist/cli.js
CHANGED
|
@@ -3280,7 +3280,7 @@ Doctor found ${issues.length} issue(s)`);
|
|
|
3280
3280
|
// src/cli.ts
|
|
3281
3281
|
config();
|
|
3282
3282
|
var program = new Command();
|
|
3283
|
-
program.name("cmx-sdk").description("CMX SDK - CLI tool for managing CMX schemas and content").version("0.2.
|
|
3283
|
+
program.name("cmx-sdk").description("CMX SDK - CLI tool for managing CMX schemas and content").version("0.2.6").allowExcessArguments(false);
|
|
3284
3284
|
function requireApiCredentials() {
|
|
3285
3285
|
const apiUrl = process.env.CMX_API_URL;
|
|
3286
3286
|
const apiKey = process.env.CMX_API_KEY;
|
|
@@ -3291,15 +3291,15 @@ function requireApiCredentials() {
|
|
|
3291
3291
|
return { apiUrl, apiKey };
|
|
3292
3292
|
}
|
|
3293
3293
|
program.action(async () => {
|
|
3294
|
-
const { interactiveMenu } = await import("./interactive-menu-
|
|
3294
|
+
const { interactiveMenu } = await import("./interactive-menu-RPPCBCOU.js");
|
|
3295
3295
|
await interactiveMenu();
|
|
3296
3296
|
});
|
|
3297
|
-
program.command("init [project-name]").description("\u65B0\u898F CMX \u30B5\u30A4\u30C8\u3092\u4F5C\u6210").option("--no-studio", "CMX Studio \u3092\u30B9\u30AD\u30C3\u30D7").option("--pm <manager>", "\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC (npm, pnpm, yarn)").action(async (projectName, options) => {
|
|
3298
|
-
const { init } = await import("./init-
|
|
3297
|
+
program.command("init [project-name]").description("\u65B0\u898F CMX \u30B5\u30A4\u30C8\u3092\u4F5C\u6210").option("--no-studio", "CMX Studio \u3092\u30B9\u30AD\u30C3\u30D7").option("--pm <manager>", "\u30D1\u30C3\u30B1\u30FC\u30B8\u30DE\u30CD\u30FC\u30B8\u30E3\u30FC (npm, pnpm, yarn)").option("--key <key>", "CMX API \u30AD\u30FC\uFF08\u8A8D\u8A3C\u4ED8\u304D\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\uFF09").option("--api-url <url>", "CMX API \u30B5\u30FC\u30D0\u30FC\u306E URL").action(async (projectName, options) => {
|
|
3298
|
+
const { init } = await import("./init-NDNG5Q5T.js");
|
|
3299
3299
|
await init(projectName, options);
|
|
3300
3300
|
});
|
|
3301
3301
|
program.command("add-studio").description("\u65E2\u5B58\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u306B CMX Studio \u3092\u8FFD\u52A0").action(async () => {
|
|
3302
|
-
const { addStudio } = await import("./add-studio-
|
|
3302
|
+
const { addStudio } = await import("./add-studio-J7M7KOWM.js");
|
|
3303
3303
|
await addStudio();
|
|
3304
3304
|
});
|
|
3305
3305
|
program.command("studio").description("\u30B5\u30A4\u30C8 (4000) \u3068 Studio (4001) \u3092\u540C\u6642\u8D77\u52D5").action(studio);
|
package/dist/index.js
CHANGED
|
@@ -21,13 +21,9 @@ var CmxApiError = class extends Error {
|
|
|
21
21
|
};
|
|
22
22
|
|
|
23
23
|
// src/core/sdk-fetcher.ts
|
|
24
|
+
var DEFAULT_API_URL = "https://app.cmx-ai.org";
|
|
24
25
|
function getSdkApiBaseUrl() {
|
|
25
|
-
const apiUrl = process.env.CMX_API_URL;
|
|
26
|
-
if (!apiUrl) {
|
|
27
|
-
throw new Error(
|
|
28
|
-
"CMX_API_URL environment variable is not set.\nPlease set it in your .env.local file:\n CMX_API_URL=https://your-cmx-api.example.com\nYou can find your API URL in the CMX admin dashboard."
|
|
29
|
-
);
|
|
30
|
-
}
|
|
26
|
+
const apiUrl = process.env.CMX_API_URL || DEFAULT_API_URL;
|
|
31
27
|
return `${apiUrl}/api/v1/sdk`;
|
|
32
28
|
}
|
|
33
29
|
function getSdkApiToken() {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/core/types.ts","../src/core/sdk-fetcher.ts","../src/core/cache-tags.ts","../src/core/date-reviver.ts","../src/generated/sdk/endpoints/sdk.ts","../src/api.ts","../src/mdx/components/basic/Callout.tsx","../src/mdx/components/basic/Embed.tsx","../src/mdx/components/basic/Button.tsx","../src/mdx/components/basic/index.ts","../src/mdx/components/custom/BlogCard.tsx","../src/mdx/components/custom/Image.tsx","../src/mdx/components/custom/index.ts","../src/mdx/components/markdown/index.tsx","../src/mdx/components/index.ts","../src/mdx/component-catalog.ts","../src/mdx/validator.ts","../src/render.tsx"],"sourcesContent":["/**\n * API共通型定義\n */\n\n/**\n * APIレスポンスの共通型(Admin API用)\n */\nexport interface ApiResponse<T> {\n data: T | null\n error: string | null\n status: number\n}\n\n/**\n * Admin fetcherオプション\n */\nexport interface AdminFetcherOptions {\n /** 401エラー時のサインアウトを無効化 */\n disableAutoSignOut?: boolean\n /** サインアウト後のリダイレクト先URL */\n signOutCallbackUrl?: string\n /** ワークスペースSlug(未指定ならURLから推測) */\n workspaceSlug?: string\n}\n\n/**\n * Public fetcherオプション\n */\nexport interface PublicFetcherOptions {\n /** 認証トークン */\n token: string\n /** Next.js cache tags */\n tags?: string[]\n /** キャッシュ設定 */\n revalidate?: number | false\n}\n\n/**\n * 認証エラーコード\n */\nexport const AUTH_ERROR_CODES = [\"AUTH_REQUIRED\", \"USER_DELETED\"] as const\nexport type AuthErrorCode = (typeof AUTH_ERROR_CODES)[number]\n\n/**\n * SDK APIエラー\n * HTTPステータスコードとAPIエラーコードを保持し、\n * 404/401/403/500等の区別を可能にする\n */\nexport class CmxApiError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code?: string,\n ) {\n super(message)\n this.name = \"CmxApiError\"\n }\n\n get isNotFound(): boolean {\n return this.status === 404\n }\n\n get isUnauthorized(): boolean {\n return this.status === 401\n }\n\n get isForbidden(): boolean {\n return this.status === 403\n }\n\n get isServerError(): boolean {\n return this.status >= 500\n }\n}\n","/**\n * SDK API用カスタムfetcher\n * サーバーサイドからSDK APIを呼び出すためのfetcher\n * - Authorization: Bearer ヘッダー付与\n * - Next.js cache tags対応\n */\n\nimport type { PublicFetcherOptions } from \"./types\"\nimport { CmxApiError } from \"./types\"\n\n// Next.js拡張のRequestInit型\ninterface NextFetchRequestInit extends RequestInit {\n next?: {\n tags?: string[]\n revalidate?: number | false\n }\n}\n\n/**\n * SDK APIのベースURL取得\n */\nexport function getSdkApiBaseUrl(): string {\n const apiUrl = process.env.CMX_API_URL\n if (!apiUrl) {\n throw new Error(\n \"CMX_API_URL environment variable is not set.\\n\" +\n \"Please set it in your .env.local file:\\n\" +\n \" CMX_API_URL=https://your-cmx-api.example.com\\n\" +\n \"You can find your API URL in the CMX admin dashboard.\"\n )\n }\n return `${apiUrl}/api/v1/sdk`\n}\n\n/**\n * 環境変数からSDK APIトークン取得\n */\nexport function getSdkApiToken(): string {\n const token = process.env.CMX_API_KEY\n if (!token) {\n throw new Error(\"CMX_API_KEY environment variable is not set\")\n }\n return token\n}\n\n/**\n * SDK API用のカスタムfetcher\n * サーバーサイドでのみ使用(SSR/RSC)\n */\nexport async function sdkFetcher<T>(\n path: string,\n options: PublicFetcherOptions\n): Promise<T> {\n const { token, tags, revalidate } = options\n const baseUrl = getSdkApiBaseUrl()\n const url = `${baseUrl}${path}`\n\n const fetchOptions: NextFetchRequestInit = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n next: {\n tags: tags || [],\n ...(revalidate !== undefined && { revalidate }),\n },\n }\n\n const response = await fetch(url, fetchOptions as RequestInit)\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n\n/**\n * Orval用のカスタムインスタンス\n * OrvalはURLとRequestInitを直接渡す形式で呼び出す\n */\nexport async function sdkCustomInstance<T>(\n url: string,\n options?: RequestInit\n): Promise<T> {\n const token = getSdkApiToken()\n const baseUrl = getSdkApiBaseUrl()\n const fullUrl = url.startsWith(\"http\") ? url : `${baseUrl}${url}`\n\n const response = await fetch(fullUrl, {\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n ...options?.headers,\n },\n })\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n\n/**\n * キャッシュタグ付きのSDK APIリクエスト用ラッパー\n * Next.js ISR/on-demand revalidation対応\n */\nexport async function sdkFetchWithTags<T>(\n path: string,\n tags?: string[],\n revalidate?: number | false\n): Promise<T> {\n const token = getSdkApiToken()\n const baseUrl = getSdkApiBaseUrl()\n const url = `${baseUrl}${path}`\n\n const fetchOptions: NextFetchRequestInit = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n next: {\n tags: tags || [],\n ...(revalidate !== undefined && { revalidate }),\n },\n }\n\n const response = await fetch(url, fetchOptions as RequestInit)\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n\n/**\n * SDK API用のPOSTリクエストfetcher\n * サーバーサイド(Server Action等)から使用\n */\nexport async function sdkPostFetcher<T>(\n path: string,\n body: unknown\n): Promise<T> {\n const token = getSdkApiToken()\n const baseUrl = getSdkApiBaseUrl()\n const url = `${baseUrl}${path}`\n\n const response = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n body: JSON.stringify(body),\n cache: \"no-store\",\n })\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n","/**\n * キャッシュタグ定義\n * Next.js ISR/on-demand revalidation用\n */\n\nexport const CACHE_TAGS = {\n /** 全コレクション共通 */\n collections: \"collections\",\n /** 特定コレクション */\n collection: (slug: string) => `collection:${slug}`,\n /** 特定コンテンツ */\n content: (collectionSlug: string, contentSlug: string) =>\n `content:${collectionSlug}:${contentSlug}`,\n /** 全データタイプ共通 */\n data: \"data\",\n /** 特定データタイプ */\n dataType: (slug: string) => `data:${slug}`,\n} as const\n","/**\n * JSON reviver for automatic date parsing\n * Converts ISO date strings to JavaScript Date objects\n */\nconst isoDateFormat = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/\n\nexport function dateReviver(_key: string, value: unknown): unknown {\n if (typeof value === \"string\" && isoDateFormat.test(value)) {\n return new Date(value)\n }\n return value\n}\n","/**\n * Generated by orval v7.17.2 🍺\n * Do not edit manually.\n * CMX SDK API\n * CMX SDK API(コンテンツ配信+管理)\n * OpenAPI spec version: 1.0.0\n */\nimport type {\n CollectionContentDetailResponse,\n CollectionContentsResponse,\n CollectionListResponse,\n CollectionResponse,\n CreateCollectionRequest,\n CreateContentRequest,\n CreateDataTypeRequest,\n CreateFormDefinitionRequest,\n DataEntryDetailResponse,\n DataListResponse,\n DataTypeResponse,\n DeleteManageDataTypeSlugIdParams,\n ErrorResponse,\n FormDefinitionResponse,\n GetCollectionsSlugContentsParams,\n GetDataTypeSlugParams,\n GetManageCollectionPresets200,\n GetManageCollectionPresetsParams,\n GetManageDataTypeSlugParams,\n GetPreviewToken200,\n PublicSubmissionRequest,\n PublicSubmissionResponse,\n ReferenceField,\n SchemaResponse,\n SdkAddCollectionDataTypeRequest,\n SdkCollectionDataTypeResponse,\n SdkComponentSuccessResponse,\n SdkComponentSyncRequest,\n SdkContentReferencesResponse,\n SdkCreateContentResponse,\n SdkCreateEntryRequest,\n SdkCustomComponentsListResponse,\n SdkDataEntriesListResponse,\n SdkDataEntryDeletionImpactResponse,\n SdkDataEntryDetailResponse,\n SdkDataEntryResponse,\n SdkDeleteCollectionDataTypeResponse,\n SdkDeleteCollectionResponse,\n SdkDeleteDataEntryResponse,\n SdkDeleteDataTypeResponse,\n SdkDeleteFormDefinitionResponse,\n SdkLinkExistingDataTypeRequest,\n SdkPublishContentResponse,\n SdkRequestReviewResponse,\n SdkSetContentReferencesRequest,\n SdkSetContentReferencesResponse,\n SdkUpdateEntryRequest,\n UpdateCollectionRequest,\n UpdateDataTypeRequest,\n UpdateFormDefinitionRequest\n} from '../models';\n\nimport { dateReviver } from '../../../core/date-reviver';\n\n/**\n * @summary コレクションの公開済みコンテンツ一覧を取得\n */\nexport type getCollectionsSlugContentsResponse200 = {\n data: CollectionContentsResponse\n status: 200\n}\n\nexport type getCollectionsSlugContentsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getCollectionsSlugContentsResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getCollectionsSlugContentsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getCollectionsSlugContentsResponseSuccess = (getCollectionsSlugContentsResponse200) & {\n headers: Headers;\n};\nexport type getCollectionsSlugContentsResponseError = (getCollectionsSlugContentsResponse401 | getCollectionsSlugContentsResponse404 | getCollectionsSlugContentsResponse500) & {\n headers: Headers;\n};\n\nexport type getCollectionsSlugContentsResponse = (getCollectionsSlugContentsResponseSuccess | getCollectionsSlugContentsResponseError)\n\nexport const getGetCollectionsSlugContentsUrl = (slug: string,\n params?: GetCollectionsSlugContentsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/collections/${slug}/contents?${stringifiedParams}` : `/api/v1/sdk/collections/${slug}/contents`\n}\n\nexport const getCollectionsSlugContents = async (slug: string,\n params?: GetCollectionsSlugContentsParams, options?: RequestInit): Promise<getCollectionsSlugContentsResponse> => {\n \n const res = await fetch(getGetCollectionsSlugContentsUrl(slug,params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getCollectionsSlugContentsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getCollectionsSlugContentsResponse\n}\n\n\n\n/**\n * @summary コレクションの公開済みコンテンツ詳細を取得(参照解決済み)\n */\nexport type getCollectionsSlugContentsContentSlugResponse200 = {\n data: CollectionContentDetailResponse\n status: 200\n}\n\nexport type getCollectionsSlugContentsContentSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getCollectionsSlugContentsContentSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getCollectionsSlugContentsContentSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getCollectionsSlugContentsContentSlugResponseSuccess = (getCollectionsSlugContentsContentSlugResponse200) & {\n headers: Headers;\n};\nexport type getCollectionsSlugContentsContentSlugResponseError = (getCollectionsSlugContentsContentSlugResponse401 | getCollectionsSlugContentsContentSlugResponse404 | getCollectionsSlugContentsContentSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getCollectionsSlugContentsContentSlugResponse = (getCollectionsSlugContentsContentSlugResponseSuccess | getCollectionsSlugContentsContentSlugResponseError)\n\nexport const getGetCollectionsSlugContentsContentSlugUrl = (slug: string,\n contentSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/collections/${slug}/contents/${contentSlug}`\n}\n\nexport const getCollectionsSlugContentsContentSlug = async (slug: string,\n contentSlug: string, options?: RequestInit): Promise<getCollectionsSlugContentsContentSlugResponse> => {\n \n const res = await fetch(getGetCollectionsSlugContentsContentSlugUrl(slug,contentSlug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getCollectionsSlugContentsContentSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getCollectionsSlugContentsContentSlugResponse\n}\n\n\n\n/**\n * @summary データタイプのエントリ一覧を取得\n */\nexport type getDataTypeSlugResponse200 = {\n data: DataListResponse\n status: 200\n}\n\nexport type getDataTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getDataTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getDataTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getDataTypeSlugResponseSuccess = (getDataTypeSlugResponse200) & {\n headers: Headers;\n};\nexport type getDataTypeSlugResponseError = (getDataTypeSlugResponse401 | getDataTypeSlugResponse404 | getDataTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getDataTypeSlugResponse = (getDataTypeSlugResponseSuccess | getDataTypeSlugResponseError)\n\nexport const getGetDataTypeSlugUrl = (typeSlug: string,\n params?: GetDataTypeSlugParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/data/${typeSlug}?${stringifiedParams}` : `/api/v1/sdk/data/${typeSlug}`\n}\n\nexport const getDataTypeSlug = async (typeSlug: string,\n params?: GetDataTypeSlugParams, options?: RequestInit): Promise<getDataTypeSlugResponse> => {\n \n const res = await fetch(getGetDataTypeSlugUrl(typeSlug,params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getDataTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getDataTypeSlugResponse\n}\n\n\n\n/**\n * @summary データエントリの詳細を取得\n */\nexport type getDataTypeSlugIdResponse200 = {\n data: DataEntryDetailResponse\n status: 200\n}\n\nexport type getDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getDataTypeSlugIdResponseSuccess = (getDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type getDataTypeSlugIdResponseError = (getDataTypeSlugIdResponse401 | getDataTypeSlugIdResponse404 | getDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type getDataTypeSlugIdResponse = (getDataTypeSlugIdResponseSuccess | getDataTypeSlugIdResponseError)\n\nexport const getGetDataTypeSlugIdUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/data/${typeSlug}/${id}`\n}\n\nexport const getDataTypeSlugId = async (typeSlug: string,\n id: string, options?: RequestInit): Promise<getDataTypeSlugIdResponse> => {\n \n const res = await fetch(getGetDataTypeSlugIdUrl(typeSlug,id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary プレビュートークンで記事を取得(認証不要)\n */\nexport type getPreviewTokenResponse200 = {\n data: GetPreviewToken200\n status: 200\n}\n\nexport type getPreviewTokenResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getPreviewTokenResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getPreviewTokenResponseSuccess = (getPreviewTokenResponse200) & {\n headers: Headers;\n};\nexport type getPreviewTokenResponseError = (getPreviewTokenResponse404 | getPreviewTokenResponse500) & {\n headers: Headers;\n};\n\nexport type getPreviewTokenResponse = (getPreviewTokenResponseSuccess | getPreviewTokenResponseError)\n\nexport const getGetPreviewTokenUrl = (token: string,) => {\n\n\n \n\n return `/api/v1/sdk/preview/${token}`\n}\n\nexport const getPreviewToken = async (token: string, options?: RequestInit): Promise<getPreviewTokenResponse> => {\n \n const res = await fetch(getGetPreviewTokenUrl(token),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getPreviewTokenResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getPreviewTokenResponse\n}\n\n\n\n/**\n * @summary ワークスペースのスキーマ情報を取得(データタイプ・コレクション)\n */\nexport type getSchemaResponse200 = {\n data: SchemaResponse\n status: 200\n}\n\nexport type getSchemaResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getSchemaResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getSchemaResponseSuccess = (getSchemaResponse200) & {\n headers: Headers;\n};\nexport type getSchemaResponseError = (getSchemaResponse401 | getSchemaResponse500) & {\n headers: Headers;\n};\n\nexport type getSchemaResponse = (getSchemaResponseSuccess | getSchemaResponseError)\n\nexport const getGetSchemaUrl = () => {\n\n\n \n\n return `/api/v1/sdk/schema`\n}\n\nexport const getSchema = async ( options?: RequestInit): Promise<getSchemaResponse> => {\n \n const res = await fetch(getGetSchemaUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getSchemaResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getSchemaResponse\n}\n\n\n\n/**\n * enabledが有効なフォーム定義にデータを送信します。送信データはpendingステータスで保存されます。\n * @summary 公開フォームからデータを送信\n */\nexport type postSubmissionsTypeSlugResponse200 = {\n data: PublicSubmissionResponse\n status: 200\n}\n\nexport type postSubmissionsTypeSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postSubmissionsTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postSubmissionsTypeSlugResponse403 = {\n data: ErrorResponse\n status: 403\n}\n\nexport type postSubmissionsTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postSubmissionsTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postSubmissionsTypeSlugResponseSuccess = (postSubmissionsTypeSlugResponse200) & {\n headers: Headers;\n};\nexport type postSubmissionsTypeSlugResponseError = (postSubmissionsTypeSlugResponse400 | postSubmissionsTypeSlugResponse401 | postSubmissionsTypeSlugResponse403 | postSubmissionsTypeSlugResponse404 | postSubmissionsTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type postSubmissionsTypeSlugResponse = (postSubmissionsTypeSlugResponseSuccess | postSubmissionsTypeSlugResponseError)\n\nexport const getPostSubmissionsTypeSlugUrl = (typeSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/submissions/${typeSlug}`\n}\n\nexport const postSubmissionsTypeSlug = async (typeSlug: string,\n publicSubmissionRequest: PublicSubmissionRequest, options?: RequestInit): Promise<postSubmissionsTypeSlugResponse> => {\n \n const res = await fetch(getPostSubmissionsTypeSlugUrl(typeSlug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n publicSubmissionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postSubmissionsTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postSubmissionsTypeSlugResponse\n}\n\n\n\n/**\n * @summary コレクション一覧を取得\n */\nexport type getManageCollectionsResponse200 = {\n data: CollectionListResponse\n status: 200\n}\n\nexport type getManageCollectionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageCollectionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageCollectionsResponseSuccess = (getManageCollectionsResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionsResponseError = (getManageCollectionsResponse401 | getManageCollectionsResponse500) & {\n headers: Headers;\n};\n\nexport type getManageCollectionsResponse = (getManageCollectionsResponseSuccess | getManageCollectionsResponseError)\n\nexport const getGetManageCollectionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/collections`\n}\n\nexport const getManageCollections = async ( options?: RequestInit): Promise<getManageCollectionsResponse> => {\n \n const res = await fetch(getGetManageCollectionsUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionsResponse\n}\n\n\n\n/**\n * @summary コレクションを作成\n */\nexport type postManageCollectionsResponse201 = {\n data: CollectionResponse\n status: 201\n}\n\nexport type postManageCollectionsResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageCollectionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageCollectionsResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageCollectionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageCollectionsResponseSuccess = (postManageCollectionsResponse201) & {\n headers: Headers;\n};\nexport type postManageCollectionsResponseError = (postManageCollectionsResponse400 | postManageCollectionsResponse401 | postManageCollectionsResponse409 | postManageCollectionsResponse500) & {\n headers: Headers;\n};\n\nexport type postManageCollectionsResponse = (postManageCollectionsResponseSuccess | postManageCollectionsResponseError)\n\nexport const getPostManageCollectionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/collections`\n}\n\nexport const postManageCollections = async (createCollectionRequest: CreateCollectionRequest, options?: RequestInit): Promise<postManageCollectionsResponse> => {\n \n const res = await fetch(getPostManageCollectionsUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createCollectionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageCollectionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageCollectionsResponse\n}\n\n\n\n/**\n * @summary コレクションを取得\n */\nexport type getManageCollectionsSlugResponse200 = {\n data: CollectionResponse\n status: 200\n}\n\nexport type getManageCollectionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageCollectionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageCollectionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageCollectionsSlugResponseSuccess = (getManageCollectionsSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionsSlugResponseError = (getManageCollectionsSlugResponse401 | getManageCollectionsSlugResponse404 | getManageCollectionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageCollectionsSlugResponse = (getManageCollectionsSlugResponseSuccess | getManageCollectionsSlugResponseError)\n\nexport const getGetManageCollectionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}`\n}\n\nexport const getManageCollectionsSlug = async (slug: string, options?: RequestInit): Promise<getManageCollectionsSlugResponse> => {\n \n const res = await fetch(getGetManageCollectionsSlugUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionsSlugResponse\n}\n\n\n\n/**\n * @summary コレクションを更新\n */\nexport type putManageCollectionsSlugResponse200 = {\n data: CollectionResponse\n status: 200\n}\n\nexport type putManageCollectionsSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageCollectionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageCollectionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageCollectionsSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type putManageCollectionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageCollectionsSlugResponseSuccess = (putManageCollectionsSlugResponse200) & {\n headers: Headers;\n};\nexport type putManageCollectionsSlugResponseError = (putManageCollectionsSlugResponse400 | putManageCollectionsSlugResponse401 | putManageCollectionsSlugResponse404 | putManageCollectionsSlugResponse409 | putManageCollectionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type putManageCollectionsSlugResponse = (putManageCollectionsSlugResponseSuccess | putManageCollectionsSlugResponseError)\n\nexport const getPutManageCollectionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}`\n}\n\nexport const putManageCollectionsSlug = async (slug: string,\n updateCollectionRequest: UpdateCollectionRequest, options?: RequestInit): Promise<putManageCollectionsSlugResponse> => {\n \n const res = await fetch(getPutManageCollectionsSlugUrl(slug),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n updateCollectionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageCollectionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageCollectionsSlugResponse\n}\n\n\n\n/**\n * @summary コレクションを削除\n */\nexport type deleteManageCollectionsSlugResponse200 = {\n data: SdkDeleteCollectionResponse\n status: 200\n}\n\nexport type deleteManageCollectionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageCollectionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageCollectionsSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type deleteManageCollectionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageCollectionsSlugResponseSuccess = (deleteManageCollectionsSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageCollectionsSlugResponseError = (deleteManageCollectionsSlugResponse401 | deleteManageCollectionsSlugResponse404 | deleteManageCollectionsSlugResponse409 | deleteManageCollectionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageCollectionsSlugResponse = (deleteManageCollectionsSlugResponseSuccess | deleteManageCollectionsSlugResponseError)\n\nexport const getDeleteManageCollectionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}`\n}\n\nexport const deleteManageCollectionsSlug = async (slug: string, options?: RequestInit): Promise<deleteManageCollectionsSlugResponse> => {\n \n const res = await fetch(getDeleteManageCollectionsSlugUrl(slug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageCollectionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageCollectionsSlugResponse\n}\n\n\n\n/**\n * @summary データタイプ一覧を取得\n */\nexport type getManageDataTypesResponse200 = {\n data: DataTypeResponse[]\n status: 200\n}\n\nexport type getManageDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypesResponseSuccess = (getManageDataTypesResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypesResponseError = (getManageDataTypesResponse401 | getManageDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypesResponse = (getManageDataTypesResponseSuccess | getManageDataTypesResponseError)\n\nexport const getGetManageDataTypesUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types`\n}\n\nexport const getManageDataTypes = async ( options?: RequestInit): Promise<getManageDataTypesResponse> => {\n \n const res = await fetch(getGetManageDataTypesUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypesResponse\n}\n\n\n\n/**\n * @summary データタイプを作成\n */\nexport type postManageDataTypesResponse201 = {\n data: DataTypeResponse\n status: 201\n}\n\nexport type postManageDataTypesResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageDataTypesResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageDataTypesResponseSuccess = (postManageDataTypesResponse201) & {\n headers: Headers;\n};\nexport type postManageDataTypesResponseError = (postManageDataTypesResponse400 | postManageDataTypesResponse401 | postManageDataTypesResponse409 | postManageDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type postManageDataTypesResponse = (postManageDataTypesResponseSuccess | postManageDataTypesResponseError)\n\nexport const getPostManageDataTypesUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types`\n}\n\nexport const postManageDataTypes = async (createDataTypeRequest: CreateDataTypeRequest, options?: RequestInit): Promise<postManageDataTypesResponse> => {\n \n const res = await fetch(getPostManageDataTypesUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageDataTypesResponse\n}\n\n\n\n/**\n * @summary データタイプを取得\n */\nexport type getManageDataTypesSlugResponse200 = {\n data: DataTypeResponse\n status: 200\n}\n\nexport type getManageDataTypesSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypesSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypesSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypesSlugResponseSuccess = (getManageDataTypesSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypesSlugResponseError = (getManageDataTypesSlugResponse401 | getManageDataTypesSlugResponse404 | getManageDataTypesSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypesSlugResponse = (getManageDataTypesSlugResponseSuccess | getManageDataTypesSlugResponseError)\n\nexport const getGetManageDataTypesSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types/${slug}`\n}\n\nexport const getManageDataTypesSlug = async (slug: string, options?: RequestInit): Promise<getManageDataTypesSlugResponse> => {\n \n const res = await fetch(getGetManageDataTypesSlugUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypesSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypesSlugResponse\n}\n\n\n\n/**\n * @summary データタイプを更新\n */\nexport type putManageDataTypesSlugResponse200 = {\n data: DataTypeResponse\n status: 200\n}\n\nexport type putManageDataTypesSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageDataTypesSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageDataTypesSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageDataTypesSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type putManageDataTypesSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageDataTypesSlugResponseSuccess = (putManageDataTypesSlugResponse200) & {\n headers: Headers;\n};\nexport type putManageDataTypesSlugResponseError = (putManageDataTypesSlugResponse400 | putManageDataTypesSlugResponse401 | putManageDataTypesSlugResponse404 | putManageDataTypesSlugResponse409 | putManageDataTypesSlugResponse500) & {\n headers: Headers;\n};\n\nexport type putManageDataTypesSlugResponse = (putManageDataTypesSlugResponseSuccess | putManageDataTypesSlugResponseError)\n\nexport const getPutManageDataTypesSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types/${slug}`\n}\n\nexport const putManageDataTypesSlug = async (slug: string,\n updateDataTypeRequest: UpdateDataTypeRequest, options?: RequestInit): Promise<putManageDataTypesSlugResponse> => {\n \n const res = await fetch(getPutManageDataTypesSlugUrl(slug),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n updateDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageDataTypesSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageDataTypesSlugResponse\n}\n\n\n\n/**\n * @summary データタイプを削除\n */\nexport type deleteManageDataTypesSlugResponse200 = {\n data: SdkDeleteDataTypeResponse\n status: 200\n}\n\nexport type deleteManageDataTypesSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageDataTypesSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageDataTypesSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type deleteManageDataTypesSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageDataTypesSlugResponseSuccess = (deleteManageDataTypesSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageDataTypesSlugResponseError = (deleteManageDataTypesSlugResponse401 | deleteManageDataTypesSlugResponse404 | deleteManageDataTypesSlugResponse409 | deleteManageDataTypesSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageDataTypesSlugResponse = (deleteManageDataTypesSlugResponseSuccess | deleteManageDataTypesSlugResponseError)\n\nexport const getDeleteManageDataTypesSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types/${slug}`\n}\n\nexport const deleteManageDataTypesSlug = async (slug: string, options?: RequestInit): Promise<deleteManageDataTypesSlugResponse> => {\n \n const res = await fetch(getDeleteManageDataTypesSlugUrl(slug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageDataTypesSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageDataTypesSlugResponse\n}\n\n\n\n/**\n * @summary データエントリ一覧を取得\n */\nexport type getManageDataTypeSlugResponse200 = {\n data: SdkDataEntriesListResponse\n status: 200\n}\n\nexport type getManageDataTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypeSlugResponseSuccess = (getManageDataTypeSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypeSlugResponseError = (getManageDataTypeSlugResponse401 | getManageDataTypeSlugResponse404 | getManageDataTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypeSlugResponse = (getManageDataTypeSlugResponseSuccess | getManageDataTypeSlugResponseError)\n\nexport const getGetManageDataTypeSlugUrl = (typeSlug: string,\n params?: GetManageDataTypeSlugParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}`\n}\n\nexport const getManageDataTypeSlug = async (typeSlug: string,\n params?: GetManageDataTypeSlugParams, options?: RequestInit): Promise<getManageDataTypeSlugResponse> => {\n \n const res = await fetch(getGetManageDataTypeSlugUrl(typeSlug,params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypeSlugResponse\n}\n\n\n\n/**\n * @summary データエントリを作成\n */\nexport type postManageDataTypeSlugResponse201 = {\n data: SdkDataEntryResponse\n status: 201\n}\n\nexport type postManageDataTypeSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageDataTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageDataTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageDataTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageDataTypeSlugResponseSuccess = (postManageDataTypeSlugResponse201) & {\n headers: Headers;\n};\nexport type postManageDataTypeSlugResponseError = (postManageDataTypeSlugResponse400 | postManageDataTypeSlugResponse401 | postManageDataTypeSlugResponse404 | postManageDataTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type postManageDataTypeSlugResponse = (postManageDataTypeSlugResponseSuccess | postManageDataTypeSlugResponseError)\n\nexport const getPostManageDataTypeSlugUrl = (typeSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}`\n}\n\nexport const postManageDataTypeSlug = async (typeSlug: string,\n sdkCreateEntryRequest: SdkCreateEntryRequest, options?: RequestInit): Promise<postManageDataTypeSlugResponse> => {\n \n const res = await fetch(getPostManageDataTypeSlugUrl(typeSlug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkCreateEntryRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageDataTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageDataTypeSlugResponse\n}\n\n\n\n/**\n * @summary データエントリを取得\n */\nexport type getManageDataTypeSlugIdResponse200 = {\n data: SdkDataEntryDetailResponse\n status: 200\n}\n\nexport type getManageDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypeSlugIdResponseSuccess = (getManageDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypeSlugIdResponseError = (getManageDataTypeSlugIdResponse401 | getManageDataTypeSlugIdResponse404 | getManageDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypeSlugIdResponse = (getManageDataTypeSlugIdResponseSuccess | getManageDataTypeSlugIdResponseError)\n\nexport const getGetManageDataTypeSlugIdUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}/${id}`\n}\n\nexport const getManageDataTypeSlugId = async (typeSlug: string,\n id: string, options?: RequestInit): Promise<getManageDataTypeSlugIdResponse> => {\n \n const res = await fetch(getGetManageDataTypeSlugIdUrl(typeSlug,id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary データエントリを更新\n */\nexport type patchManageDataTypeSlugIdResponse200 = {\n data: SdkDataEntryResponse\n status: 200\n}\n\nexport type patchManageDataTypeSlugIdResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type patchManageDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type patchManageDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type patchManageDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type patchManageDataTypeSlugIdResponseSuccess = (patchManageDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type patchManageDataTypeSlugIdResponseError = (patchManageDataTypeSlugIdResponse400 | patchManageDataTypeSlugIdResponse401 | patchManageDataTypeSlugIdResponse404 | patchManageDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type patchManageDataTypeSlugIdResponse = (patchManageDataTypeSlugIdResponseSuccess | patchManageDataTypeSlugIdResponseError)\n\nexport const getPatchManageDataTypeSlugIdUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}/${id}`\n}\n\nexport const patchManageDataTypeSlugId = async (typeSlug: string,\n id: string,\n sdkUpdateEntryRequest: SdkUpdateEntryRequest, options?: RequestInit): Promise<patchManageDataTypeSlugIdResponse> => {\n \n const res = await fetch(getPatchManageDataTypeSlugIdUrl(typeSlug,id),\n { \n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkUpdateEntryRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: patchManageDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as patchManageDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary データエントリを削除\n */\nexport type deleteManageDataTypeSlugIdResponse200 = {\n data: SdkDeleteDataEntryResponse\n status: 200\n}\n\nexport type deleteManageDataTypeSlugIdResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type deleteManageDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageDataTypeSlugIdResponseSuccess = (deleteManageDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type deleteManageDataTypeSlugIdResponseError = (deleteManageDataTypeSlugIdResponse400 | deleteManageDataTypeSlugIdResponse401 | deleteManageDataTypeSlugIdResponse404 | deleteManageDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageDataTypeSlugIdResponse = (deleteManageDataTypeSlugIdResponseSuccess | deleteManageDataTypeSlugIdResponseError)\n\nexport const getDeleteManageDataTypeSlugIdUrl = (typeSlug: string,\n id: string,\n params?: DeleteManageDataTypeSlugIdParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}/${id}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}/${id}`\n}\n\nexport const deleteManageDataTypeSlugId = async (typeSlug: string,\n id: string,\n params?: DeleteManageDataTypeSlugIdParams, options?: RequestInit): Promise<deleteManageDataTypeSlugIdResponse> => {\n \n const res = await fetch(getDeleteManageDataTypeSlugIdUrl(typeSlug,id,params),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary データエントリ削除時の影響を取得\n */\nexport type getManageDataTypeSlugIdDeletionImpactResponse200 = {\n data: SdkDataEntryDeletionImpactResponse\n status: 200\n}\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypeSlugIdDeletionImpactResponseSuccess = (getManageDataTypeSlugIdDeletionImpactResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypeSlugIdDeletionImpactResponseError = (getManageDataTypeSlugIdDeletionImpactResponse401 | getManageDataTypeSlugIdDeletionImpactResponse404 | getManageDataTypeSlugIdDeletionImpactResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse = (getManageDataTypeSlugIdDeletionImpactResponseSuccess | getManageDataTypeSlugIdDeletionImpactResponseError)\n\nexport const getGetManageDataTypeSlugIdDeletionImpactUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}/${id}/deletion-impact`\n}\n\nexport const getManageDataTypeSlugIdDeletionImpact = async (typeSlug: string,\n id: string, options?: RequestInit): Promise<getManageDataTypeSlugIdDeletionImpactResponse> => {\n \n const res = await fetch(getGetManageDataTypeSlugIdDeletionImpactUrl(typeSlug,id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypeSlugIdDeletionImpactResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypeSlugIdDeletionImpactResponse\n}\n\n\n\n/**\n * @summary カスタムコンポーネント一覧を取得\n */\nexport type getManageComponentsResponse200 = {\n data: SdkCustomComponentsListResponse\n status: 200\n}\n\nexport type getManageComponentsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageComponentsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageComponentsResponseSuccess = (getManageComponentsResponse200) & {\n headers: Headers;\n};\nexport type getManageComponentsResponseError = (getManageComponentsResponse401 | getManageComponentsResponse500) & {\n headers: Headers;\n};\n\nexport type getManageComponentsResponse = (getManageComponentsResponseSuccess | getManageComponentsResponseError)\n\nexport const getGetManageComponentsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/components`\n}\n\nexport const getManageComponents = async ( options?: RequestInit): Promise<getManageComponentsResponse> => {\n \n const res = await fetch(getGetManageComponentsUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageComponentsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageComponentsResponse\n}\n\n\n\n/**\n * カスタムコンポーネント定義を同期します。既存のコンポーネントは更新され、新しいコンポーネントは作成されます。\n * @summary カスタムコンポーネントを同期\n */\nexport type postManageComponentsSyncResponse200 = {\n data: SdkComponentSuccessResponse\n status: 200\n}\n\nexport type postManageComponentsSyncResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageComponentsSyncResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageComponentsSyncResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageComponentsSyncResponseSuccess = (postManageComponentsSyncResponse200) & {\n headers: Headers;\n};\nexport type postManageComponentsSyncResponseError = (postManageComponentsSyncResponse400 | postManageComponentsSyncResponse401 | postManageComponentsSyncResponse500) & {\n headers: Headers;\n};\n\nexport type postManageComponentsSyncResponse = (postManageComponentsSyncResponseSuccess | postManageComponentsSyncResponseError)\n\nexport const getPostManageComponentsSyncUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/components/sync`\n}\n\nexport const postManageComponentsSync = async (sdkComponentSyncRequest: SdkComponentSyncRequest, options?: RequestInit): Promise<postManageComponentsSyncResponse> => {\n \n const res = await fetch(getPostManageComponentsSyncUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkComponentSyncRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageComponentsSyncResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageComponentsSyncResponse\n}\n\n\n\n/**\n * @summary フォーム定義一覧を取得\n */\nexport type getManageFormDefinitionsResponse200 = {\n data: FormDefinitionResponse[]\n status: 200\n}\n\nexport type getManageFormDefinitionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageFormDefinitionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageFormDefinitionsResponseSuccess = (getManageFormDefinitionsResponse200) & {\n headers: Headers;\n};\nexport type getManageFormDefinitionsResponseError = (getManageFormDefinitionsResponse401 | getManageFormDefinitionsResponse500) & {\n headers: Headers;\n};\n\nexport type getManageFormDefinitionsResponse = (getManageFormDefinitionsResponseSuccess | getManageFormDefinitionsResponseError)\n\nexport const getGetManageFormDefinitionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions`\n}\n\nexport const getManageFormDefinitions = async ( options?: RequestInit): Promise<getManageFormDefinitionsResponse> => {\n \n const res = await fetch(getGetManageFormDefinitionsUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageFormDefinitionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageFormDefinitionsResponse\n}\n\n\n\n/**\n * @summary フォーム定義を作成\n */\nexport type postManageFormDefinitionsResponse201 = {\n data: FormDefinitionResponse\n status: 201\n}\n\nexport type postManageFormDefinitionsResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageFormDefinitionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageFormDefinitionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageFormDefinitionsResponseSuccess = (postManageFormDefinitionsResponse201) & {\n headers: Headers;\n};\nexport type postManageFormDefinitionsResponseError = (postManageFormDefinitionsResponse400 | postManageFormDefinitionsResponse401 | postManageFormDefinitionsResponse500) & {\n headers: Headers;\n};\n\nexport type postManageFormDefinitionsResponse = (postManageFormDefinitionsResponseSuccess | postManageFormDefinitionsResponseError)\n\nexport const getPostManageFormDefinitionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions`\n}\n\nexport const postManageFormDefinitions = async (createFormDefinitionRequest: CreateFormDefinitionRequest, options?: RequestInit): Promise<postManageFormDefinitionsResponse> => {\n \n const res = await fetch(getPostManageFormDefinitionsUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createFormDefinitionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageFormDefinitionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageFormDefinitionsResponse\n}\n\n\n\n/**\n * @summary フォーム定義を取得\n */\nexport type getManageFormDefinitionsSlugResponse200 = {\n data: FormDefinitionResponse\n status: 200\n}\n\nexport type getManageFormDefinitionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageFormDefinitionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageFormDefinitionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageFormDefinitionsSlugResponseSuccess = (getManageFormDefinitionsSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageFormDefinitionsSlugResponseError = (getManageFormDefinitionsSlugResponse401 | getManageFormDefinitionsSlugResponse404 | getManageFormDefinitionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageFormDefinitionsSlugResponse = (getManageFormDefinitionsSlugResponseSuccess | getManageFormDefinitionsSlugResponseError)\n\nexport const getGetManageFormDefinitionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions/${slug}`\n}\n\nexport const getManageFormDefinitionsSlug = async (slug: string, options?: RequestInit): Promise<getManageFormDefinitionsSlugResponse> => {\n \n const res = await fetch(getGetManageFormDefinitionsSlugUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageFormDefinitionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageFormDefinitionsSlugResponse\n}\n\n\n\n/**\n * @summary フォーム定義を更新\n */\nexport type putManageFormDefinitionsSlugResponse200 = {\n data: FormDefinitionResponse\n status: 200\n}\n\nexport type putManageFormDefinitionsSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageFormDefinitionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageFormDefinitionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageFormDefinitionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageFormDefinitionsSlugResponseSuccess = (putManageFormDefinitionsSlugResponse200) & {\n headers: Headers;\n};\nexport type putManageFormDefinitionsSlugResponseError = (putManageFormDefinitionsSlugResponse400 | putManageFormDefinitionsSlugResponse401 | putManageFormDefinitionsSlugResponse404 | putManageFormDefinitionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type putManageFormDefinitionsSlugResponse = (putManageFormDefinitionsSlugResponseSuccess | putManageFormDefinitionsSlugResponseError)\n\nexport const getPutManageFormDefinitionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions/${slug}`\n}\n\nexport const putManageFormDefinitionsSlug = async (slug: string,\n updateFormDefinitionRequest: UpdateFormDefinitionRequest, options?: RequestInit): Promise<putManageFormDefinitionsSlugResponse> => {\n \n const res = await fetch(getPutManageFormDefinitionsSlugUrl(slug),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n updateFormDefinitionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageFormDefinitionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageFormDefinitionsSlugResponse\n}\n\n\n\n/**\n * @summary フォーム定義を削除\n */\nexport type deleteManageFormDefinitionsSlugResponse200 = {\n data: SdkDeleteFormDefinitionResponse\n status: 200\n}\n\nexport type deleteManageFormDefinitionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageFormDefinitionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageFormDefinitionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageFormDefinitionsSlugResponseSuccess = (deleteManageFormDefinitionsSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageFormDefinitionsSlugResponseError = (deleteManageFormDefinitionsSlugResponse401 | deleteManageFormDefinitionsSlugResponse404 | deleteManageFormDefinitionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageFormDefinitionsSlugResponse = (deleteManageFormDefinitionsSlugResponseSuccess | deleteManageFormDefinitionsSlugResponseError)\n\nexport const getDeleteManageFormDefinitionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions/${slug}`\n}\n\nexport const deleteManageFormDefinitionsSlug = async (slug: string, options?: RequestInit): Promise<deleteManageFormDefinitionsSlugResponse> => {\n \n const res = await fetch(getDeleteManageFormDefinitionsSlugUrl(slug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageFormDefinitionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageFormDefinitionsSlugResponse\n}\n\n\n\n/**\n * @summary コレクションのデータタイプ一覧を取得\n */\nexport type getManageCollectionsSlugDataTypesResponse200 = {\n data: SdkCollectionDataTypeResponse[]\n status: 200\n}\n\nexport type getManageCollectionsSlugDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageCollectionsSlugDataTypesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageCollectionsSlugDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageCollectionsSlugDataTypesResponseSuccess = (getManageCollectionsSlugDataTypesResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionsSlugDataTypesResponseError = (getManageCollectionsSlugDataTypesResponse401 | getManageCollectionsSlugDataTypesResponse404 | getManageCollectionsSlugDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type getManageCollectionsSlugDataTypesResponse = (getManageCollectionsSlugDataTypesResponseSuccess | getManageCollectionsSlugDataTypesResponseError)\n\nexport const getGetManageCollectionsSlugDataTypesUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types`\n}\n\nexport const getManageCollectionsSlugDataTypes = async (slug: string, options?: RequestInit): Promise<getManageCollectionsSlugDataTypesResponse> => {\n \n const res = await fetch(getGetManageCollectionsSlugDataTypesUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionsSlugDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionsSlugDataTypesResponse\n}\n\n\n\n/**\n * @summary コレクションにデータタイプを追加\n */\nexport type postManageCollectionsSlugDataTypesResponse201 = {\n data: DataTypeResponse\n status: 201\n}\n\nexport type postManageCollectionsSlugDataTypesResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageCollectionsSlugDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageCollectionsSlugDataTypesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageCollectionsSlugDataTypesResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageCollectionsSlugDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageCollectionsSlugDataTypesResponseSuccess = (postManageCollectionsSlugDataTypesResponse201) & {\n headers: Headers;\n};\nexport type postManageCollectionsSlugDataTypesResponseError = (postManageCollectionsSlugDataTypesResponse400 | postManageCollectionsSlugDataTypesResponse401 | postManageCollectionsSlugDataTypesResponse404 | postManageCollectionsSlugDataTypesResponse409 | postManageCollectionsSlugDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type postManageCollectionsSlugDataTypesResponse = (postManageCollectionsSlugDataTypesResponseSuccess | postManageCollectionsSlugDataTypesResponseError)\n\nexport const getPostManageCollectionsSlugDataTypesUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types`\n}\n\nexport const postManageCollectionsSlugDataTypes = async (slug: string,\n sdkAddCollectionDataTypeRequest: SdkAddCollectionDataTypeRequest, options?: RequestInit): Promise<postManageCollectionsSlugDataTypesResponse> => {\n \n const res = await fetch(getPostManageCollectionsSlugDataTypesUrl(slug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkAddCollectionDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageCollectionsSlugDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageCollectionsSlugDataTypesResponse\n}\n\n\n\n/**\n * @summary コレクションからデータタイプを削除\n */\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse200 = {\n data: SdkDeleteCollectionDataTypeResponse\n status: 200\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageCollectionsSlugDataTypesDtSlugResponseSuccess = (deleteManageCollectionsSlugDataTypesDtSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponseError = (deleteManageCollectionsSlugDataTypesDtSlugResponse401 | deleteManageCollectionsSlugDataTypesDtSlugResponse404 | deleteManageCollectionsSlugDataTypesDtSlugResponse409 | deleteManageCollectionsSlugDataTypesDtSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse = (deleteManageCollectionsSlugDataTypesDtSlugResponseSuccess | deleteManageCollectionsSlugDataTypesDtSlugResponseError)\n\nexport const getDeleteManageCollectionsSlugDataTypesDtSlugUrl = (slug: string,\n dtSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types/${dtSlug}`\n}\n\nexport const deleteManageCollectionsSlugDataTypesDtSlug = async (slug: string,\n dtSlug: string, options?: RequestInit): Promise<deleteManageCollectionsSlugDataTypesDtSlugResponse> => {\n \n const res = await fetch(getDeleteManageCollectionsSlugDataTypesDtSlugUrl(slug,dtSlug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageCollectionsSlugDataTypesDtSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageCollectionsSlugDataTypesDtSlugResponse\n}\n\n\n\n/**\n * @summary 既存のデータタイプをコレクションにリンク\n */\nexport type postManageCollectionsSlugDataTypesLinkResponse201 = {\n data: ReferenceField\n status: 201\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageCollectionsSlugDataTypesLinkResponseSuccess = (postManageCollectionsSlugDataTypesLinkResponse201) & {\n headers: Headers;\n};\nexport type postManageCollectionsSlugDataTypesLinkResponseError = (postManageCollectionsSlugDataTypesLinkResponse400 | postManageCollectionsSlugDataTypesLinkResponse401 | postManageCollectionsSlugDataTypesLinkResponse404 | postManageCollectionsSlugDataTypesLinkResponse409 | postManageCollectionsSlugDataTypesLinkResponse500) & {\n headers: Headers;\n};\n\nexport type postManageCollectionsSlugDataTypesLinkResponse = (postManageCollectionsSlugDataTypesLinkResponseSuccess | postManageCollectionsSlugDataTypesLinkResponseError)\n\nexport const getPostManageCollectionsSlugDataTypesLinkUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types/link`\n}\n\nexport const postManageCollectionsSlugDataTypesLink = async (slug: string,\n sdkLinkExistingDataTypeRequest: SdkLinkExistingDataTypeRequest, options?: RequestInit): Promise<postManageCollectionsSlugDataTypesLinkResponse> => {\n \n const res = await fetch(getPostManageCollectionsSlugDataTypesLinkUrl(slug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkLinkExistingDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageCollectionsSlugDataTypesLinkResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageCollectionsSlugDataTypesLinkResponse\n}\n\n\n\n/**\n * @summary コレクションプリセット一覧を取得\n */\nexport type getManageCollectionPresetsResponse200 = {\n data: GetManageCollectionPresets200\n status: 200\n}\n\nexport type getManageCollectionPresetsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n \nexport type getManageCollectionPresetsResponseSuccess = (getManageCollectionPresetsResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionPresetsResponseError = (getManageCollectionPresetsResponse401) & {\n headers: Headers;\n};\n\nexport type getManageCollectionPresetsResponse = (getManageCollectionPresetsResponseSuccess | getManageCollectionPresetsResponseError)\n\nexport const getGetManageCollectionPresetsUrl = (params?: GetManageCollectionPresetsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/collection-presets?${stringifiedParams}` : `/api/v1/sdk/manage/collection-presets`\n}\n\nexport const getManageCollectionPresets = async (params?: GetManageCollectionPresetsParams, options?: RequestInit): Promise<getManageCollectionPresetsResponse> => {\n \n const res = await fetch(getGetManageCollectionPresetsUrl(params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionPresetsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionPresetsResponse\n}\n\n\n\n/**\n * @summary コンテンツを作成\n */\nexport type postManageContentsResponse201 = {\n data: SdkCreateContentResponse\n status: 201\n}\n\nexport type postManageContentsResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageContentsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageContentsResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageContentsResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageContentsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageContentsResponseSuccess = (postManageContentsResponse201) & {\n headers: Headers;\n};\nexport type postManageContentsResponseError = (postManageContentsResponse400 | postManageContentsResponse401 | postManageContentsResponse404 | postManageContentsResponse409 | postManageContentsResponse500) & {\n headers: Headers;\n};\n\nexport type postManageContentsResponse = (postManageContentsResponseSuccess | postManageContentsResponseError)\n\nexport const getPostManageContentsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/contents`\n}\n\nexport const postManageContents = async (createContentRequest: CreateContentRequest, options?: RequestInit): Promise<postManageContentsResponse> => {\n \n const res = await fetch(getPostManageContentsUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createContentRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageContentsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageContentsResponse\n}\n\n\n\n/**\n * @summary レビューをリクエスト\n */\nexport type postManageContentsIdRequestReviewResponse200 = {\n data: SdkRequestReviewResponse\n status: 200\n}\n\nexport type postManageContentsIdRequestReviewResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageContentsIdRequestReviewResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageContentsIdRequestReviewResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageContentsIdRequestReviewResponseSuccess = (postManageContentsIdRequestReviewResponse200) & {\n headers: Headers;\n};\nexport type postManageContentsIdRequestReviewResponseError = (postManageContentsIdRequestReviewResponse401 | postManageContentsIdRequestReviewResponse404 | postManageContentsIdRequestReviewResponse500) & {\n headers: Headers;\n};\n\nexport type postManageContentsIdRequestReviewResponse = (postManageContentsIdRequestReviewResponseSuccess | postManageContentsIdRequestReviewResponseError)\n\nexport const getPostManageContentsIdRequestReviewUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/request-review`\n}\n\nexport const postManageContentsIdRequestReview = async (id: string, options?: RequestInit): Promise<postManageContentsIdRequestReviewResponse> => {\n \n const res = await fetch(getPostManageContentsIdRequestReviewUrl(id),\n { \n ...options,\n method: 'POST'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageContentsIdRequestReviewResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageContentsIdRequestReviewResponse\n}\n\n\n\n/**\n * @summary コンテンツを公開\n */\nexport type postManageContentsIdPublishResponse200 = {\n data: SdkPublishContentResponse\n status: 200\n}\n\nexport type postManageContentsIdPublishResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageContentsIdPublishResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageContentsIdPublishResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageContentsIdPublishResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageContentsIdPublishResponseSuccess = (postManageContentsIdPublishResponse200) & {\n headers: Headers;\n};\nexport type postManageContentsIdPublishResponseError = (postManageContentsIdPublishResponse400 | postManageContentsIdPublishResponse401 | postManageContentsIdPublishResponse404 | postManageContentsIdPublishResponse500) & {\n headers: Headers;\n};\n\nexport type postManageContentsIdPublishResponse = (postManageContentsIdPublishResponseSuccess | postManageContentsIdPublishResponseError)\n\nexport const getPostManageContentsIdPublishUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/publish`\n}\n\nexport const postManageContentsIdPublish = async (id: string, options?: RequestInit): Promise<postManageContentsIdPublishResponse> => {\n \n const res = await fetch(getPostManageContentsIdPublishUrl(id),\n { \n ...options,\n method: 'POST'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageContentsIdPublishResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageContentsIdPublishResponse\n}\n\n\n\n/**\n * @summary コンテンツの参照を取得\n */\nexport type getManageContentsIdReferencesResponse200 = {\n data: SdkContentReferencesResponse\n status: 200\n}\n\nexport type getManageContentsIdReferencesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageContentsIdReferencesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageContentsIdReferencesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageContentsIdReferencesResponseSuccess = (getManageContentsIdReferencesResponse200) & {\n headers: Headers;\n};\nexport type getManageContentsIdReferencesResponseError = (getManageContentsIdReferencesResponse401 | getManageContentsIdReferencesResponse404 | getManageContentsIdReferencesResponse500) & {\n headers: Headers;\n};\n\nexport type getManageContentsIdReferencesResponse = (getManageContentsIdReferencesResponseSuccess | getManageContentsIdReferencesResponseError)\n\nexport const getGetManageContentsIdReferencesUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/references`\n}\n\nexport const getManageContentsIdReferences = async (id: string, options?: RequestInit): Promise<getManageContentsIdReferencesResponse> => {\n \n const res = await fetch(getGetManageContentsIdReferencesUrl(id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageContentsIdReferencesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageContentsIdReferencesResponse\n}\n\n\n\n/**\n * @summary コンテンツの参照を設定\n */\nexport type putManageContentsIdReferencesResponse200 = {\n data: SdkSetContentReferencesResponse\n status: 200\n}\n\nexport type putManageContentsIdReferencesResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageContentsIdReferencesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageContentsIdReferencesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageContentsIdReferencesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageContentsIdReferencesResponseSuccess = (putManageContentsIdReferencesResponse200) & {\n headers: Headers;\n};\nexport type putManageContentsIdReferencesResponseError = (putManageContentsIdReferencesResponse400 | putManageContentsIdReferencesResponse401 | putManageContentsIdReferencesResponse404 | putManageContentsIdReferencesResponse500) & {\n headers: Headers;\n};\n\nexport type putManageContentsIdReferencesResponse = (putManageContentsIdReferencesResponseSuccess | putManageContentsIdReferencesResponseError)\n\nexport const getPutManageContentsIdReferencesUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/references`\n}\n\nexport const putManageContentsIdReferences = async (id: string,\n sdkSetContentReferencesRequest: SdkSetContentReferencesRequest, options?: RequestInit): Promise<putManageContentsIdReferencesResponse> => {\n \n const res = await fetch(getPutManageContentsIdReferencesUrl(id),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkSetContentReferencesRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageContentsIdReferencesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageContentsIdReferencesResponse\n}\n\n\n\n","/**\n * CMX SDK — Convenience API functions\n *\n * Human-friendly wrappers around the generated Orval endpoints.\n * These manage cache tags automatically and return typed responses.\n */\n\nimport { sdkFetchWithTags, sdkPostFetcher, getSdkApiBaseUrl } from \"./core/sdk.js\"\nimport { CACHE_TAGS } from \"./core/sdk.js\"\nimport type {\n CollectionContentsResponse,\n CollectionContentDetailResponse,\n DataListResponse,\n DataEntryItem,\n GetPreviewToken200,\n SchemaResponse,\n} from \"./generated/sdk/models/index.js\"\n\n// Re-export the preview response type with a friendlier name\nexport type PreviewResponse = GetPreviewToken200\n\n/**\n * Common fetch options for ISR/caching\n */\nexport interface FetchOptions {\n /** Next.js ISR revalidation interval in seconds. Set to `false` to disable caching. */\n revalidate?: number | false\n}\n\n/**\n * Options for fetching collection contents\n */\nexport interface CollectionContentsOptions extends FetchOptions {\n sortBy?: \"publishedAt\" | \"sortOrder\"\n sortOrder?: \"asc\" | \"desc\"\n limit?: number\n offset?: number\n status?: string // \"published\" (default), \"all\", or comma-separated statuses (e.g., \"draft,review\")\n}\n\n/**\n * Get contents from a collection\n */\nexport async function getCollectionContents(\n slug: string,\n options?: CollectionContentsOptions\n): Promise<CollectionContentsResponse> {\n const params = new URLSearchParams()\n if (options?.sortBy) params.set(\"sortBy\", options.sortBy)\n if (options?.sortOrder) params.set(\"sortOrder\", options.sortOrder)\n if (options?.limit) params.set(\"limit\", String(options.limit))\n if (options?.offset) params.set(\"offset\", String(options.offset))\n if (options?.status) params.set(\"status\", options.status)\n\n const query = params.toString()\n return sdkFetchWithTags<CollectionContentsResponse>(\n `/collections/${encodeURIComponent(slug)}/contents${query ? `?${query}` : \"\"}`,\n [CACHE_TAGS.collections, CACHE_TAGS.collection(slug)],\n options?.revalidate\n )\n}\n\n/**\n * Get a specific content detail with resolved references\n */\nexport async function getCollectionContentDetail(\n collectionSlug: string,\n contentSlug: string,\n options?: FetchOptions\n): Promise<CollectionContentDetailResponse> {\n return sdkFetchWithTags<CollectionContentDetailResponse>(\n `/collections/${encodeURIComponent(collectionSlug)}/contents/${encodeURIComponent(contentSlug)}`,\n [\n CACHE_TAGS.collections,\n CACHE_TAGS.collection(collectionSlug),\n CACHE_TAGS.content(collectionSlug, contentSlug),\n ],\n options?.revalidate\n )\n}\n\n/**\n * Options for fetching data entries\n */\nexport interface DataEntriesOptions extends FetchOptions {\n sortBy?: string\n sortOrder?: string\n limit?: number\n offset?: number\n status?: string // \"published\" (default) or \"all\"\n}\n\n/**\n * Get data entries for a data type\n */\nexport async function getDataEntries(\n typeSlug: string,\n options?: DataEntriesOptions\n): Promise<DataListResponse> {\n const params = new URLSearchParams()\n if (options?.sortBy) params.set(\"sortBy\", options.sortBy)\n if (options?.sortOrder) params.set(\"sortOrder\", options.sortOrder)\n if (options?.limit) params.set(\"limit\", String(options.limit))\n if (options?.offset) params.set(\"offset\", String(options.offset))\n if (options?.status) params.set(\"status\", options.status)\n\n const query = params.toString()\n return sdkFetchWithTags<DataListResponse>(\n `/data/${encodeURIComponent(typeSlug)}${query ? `?${query}` : \"\"}`,\n [CACHE_TAGS.data, CACHE_TAGS.dataType(typeSlug)],\n options?.revalidate\n )\n}\n\n/**\n * Get a single data entry\n */\nexport async function getDataEntry(\n typeSlug: string,\n id: string,\n options?: FetchOptions\n): Promise<DataEntryItem> {\n return sdkFetchWithTags<DataEntryItem>(\n `/data/${encodeURIComponent(typeSlug)}/${encodeURIComponent(id)}`,\n [CACHE_TAGS.data, CACHE_TAGS.dataType(typeSlug)],\n options?.revalidate\n )\n}\n\n// ============================================\n// OrThrow variants — throw on failure instead of returning null/undefined\n// ============================================\n\n/**\n * Get contents from a collection, or throw an error\n */\nexport async function getCollectionContentsOrThrow(\n slug: string,\n options?: CollectionContentsOptions\n): Promise<CollectionContentsResponse> {\n const result = await getCollectionContents(slug, options)\n if (!result) throw new Error(`Failed to fetch collection contents: ${slug}`)\n return result\n}\n\n/**\n * Get a specific content detail, or throw an error\n */\nexport async function getCollectionContentDetailOrThrow(\n collectionSlug: string,\n contentSlug: string,\n options?: FetchOptions\n): Promise<CollectionContentDetailResponse> {\n const result = await getCollectionContentDetail(collectionSlug, contentSlug, options)\n if (!result) throw new Error(`Failed to fetch content detail: ${collectionSlug}/${contentSlug}`)\n return result\n}\n\n/**\n * Get data entries for a data type, or throw an error\n */\nexport async function getDataEntriesOrThrow(\n typeSlug: string,\n options?: DataEntriesOptions\n): Promise<DataListResponse> {\n const result = await getDataEntries(typeSlug, options)\n if (!result) throw new Error(`Failed to fetch data entries: ${typeSlug}`)\n return result\n}\n\n/**\n * Get a single data entry, or throw an error\n */\nexport async function getDataEntryOrThrow(\n typeSlug: string,\n id: string,\n options?: FetchOptions\n): Promise<DataEntryItem> {\n const result = await getDataEntry(typeSlug, id, options)\n if (!result) throw new Error(`Failed to fetch data entry: ${typeSlug}/${id}`)\n return result\n}\n\n/**\n * Get preview content by token (no authentication required)\n * Returns null if the token is invalid or expired.\n */\nexport async function getPreviewByToken(token: string): Promise<PreviewResponse | null> {\n try {\n const baseUrl = getSdkApiBaseUrl()\n const response = await fetch(`${baseUrl}/preview/${encodeURIComponent(token)}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n cache: \"no-store\",\n })\n\n if (!response.ok) {\n return null\n }\n\n return response.json()\n } catch (error) {\n console.error(\"Error fetching preview:\", error)\n return null\n }\n}\n\n/**\n * Get the workspace schema (collections, data types, forms)\n */\nexport async function getSchema(\n options?: FetchOptions\n): Promise<SchemaResponse> {\n return sdkFetchWithTags<SchemaResponse>(\n \"/schema\",\n [CACHE_TAGS.collections, CACHE_TAGS.data],\n options?.revalidate\n )\n}\n\n/**\n * Get all collections in the workspace\n */\nexport async function getCollections(\n options?: FetchOptions\n): Promise<SchemaResponse[\"collections\"]> {\n const schema = await getSchema(options)\n return schema.collections\n}\n\n/**\n * Submit data to a public form\n * Only works for data types with publicSubmission enabled.\n * Submissions are saved as \"pending\" for admin review.\n */\nexport async function submitFormData(\n typeSlug: string,\n data: Record<string, unknown>\n): Promise<{ success: true; id: string }> {\n return sdkPostFetcher<{ success: true; id: string }>(\n `/submissions/${encodeURIComponent(typeSlug)}`,\n { data }\n )\n}\n","import { ReactNode } from \"react\"\nimport { AlertCircle, AlertTriangle, CheckCircle, Info, Lightbulb } from \"lucide-react\"\n\ninterface CalloutProps {\n type?: \"info\" | \"warning\" | \"error\" | \"success\" | \"tip\"\n title?: string\n children: ReactNode\n}\n\nconst icons = {\n info: Info,\n warning: AlertTriangle,\n error: AlertCircle,\n success: CheckCircle,\n tip: Lightbulb,\n}\n\nconst styles = {\n info: \"cmx-mdx__callout--info bg-blue-50 border-blue-200 text-blue-800\",\n warning: \"cmx-mdx__callout--warning bg-yellow-50 border-yellow-200 text-yellow-800\",\n error: \"cmx-mdx__callout--error bg-red-50 border-red-200 text-red-800\",\n success: \"cmx-mdx__callout--success bg-green-50 border-green-200 text-green-800\",\n tip: \"cmx-mdx__callout--tip bg-purple-50 border-purple-200 text-purple-800\",\n}\n\nconst iconColors = {\n info: \"text-blue-500\",\n warning: \"text-yellow-500\",\n error: \"text-red-500\",\n success: \"text-green-500\",\n tip: \"text-purple-500\",\n}\n\nexport function Callout({ type = \"info\", title, children }: CalloutProps) {\n const Icon = icons[type]\n\n return (\n <div className={`cmx-mdx__callout my-4 p-4 border rounded-lg ${styles[type]}`}>\n <div className=\"cmx-mdx__callout-content flex gap-3\">\n <Icon className={`cmx-mdx__callout-icon w-5 h-5 flex-shrink-0 mt-0.5 ${iconColors[type]}`} />\n <div className=\"cmx-mdx__callout-body flex-1\">\n {title && <p className=\"cmx-mdx__callout-title font-semibold mb-1\">{title}</p>}\n <div className=\"cmx-mdx__callout-text text-sm\">{children}</div>\n </div>\n </div>\n </div>\n )\n}\n","interface EmbedProps {\n url: string\n type?: \"youtube\" | \"twitter\" | \"generic\"\n}\n\nfunction extractYouTubeId(url: string): string | null {\n const patterns = [\n /(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/|youtube\\.com\\/embed\\/)([^&\\n?#]+)/,\n ]\n for (const pattern of patterns) {\n const match = url.match(pattern)\n if (match) return match[1]\n }\n return null\n}\n\nexport function Embed({ url, type = \"generic\" }: EmbedProps) {\n if (type === \"youtube\") {\n const videoId = extractYouTubeId(url)\n if (videoId) {\n return (\n <div className=\"cmx-mdx__embed cmx-mdx__embed--youtube my-4 aspect-video\">\n <iframe\n src={`https://www.youtube.com/embed/${videoId}`}\n className=\"cmx-mdx__embed-iframe w-full h-full rounded-lg\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n </div>\n )\n }\n }\n\n if (type === \"twitter\") {\n // Twitterの埋め込みはクライアントサイドで処理が必要\n return (\n <div className=\"cmx-mdx__embed cmx-mdx__embed--twitter my-4 border border-gray-200 rounded-lg p-4 bg-gray-50\">\n <p className=\"cmx-mdx__embed-label text-sm text-gray-500\">Twitter埋め込み</p>\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"cmx-mdx__embed-link text-blue-500 hover:underline text-sm\"\n >\n {url}\n </a>\n </div>\n )\n }\n\n // Generic embed\n return (\n <div className=\"cmx-mdx__embed cmx-mdx__embed--generic my-4 aspect-video\">\n <iframe\n src={url}\n className=\"cmx-mdx__embed-iframe w-full h-full rounded-lg border border-gray-200\"\n allowFullScreen\n />\n </div>\n )\n}\n","import Link from \"next/link\"\nimport { ReactNode } from \"react\"\n\ninterface ButtonProps {\n href: string\n children: ReactNode\n variant?: \"primary\" | \"secondary\" | \"outline\"\n}\n\nconst variants = {\n primary: \"cmx-mdx__button--primary bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"cmx-mdx__button--secondary bg-gray-600 text-white hover:bg-gray-700\",\n outline: \"cmx-mdx__button--outline border border-gray-300 text-gray-700 hover:bg-gray-50\",\n}\n\nexport function Button({ href, children, variant = \"primary\" }: ButtonProps) {\n const isExternal = href.startsWith(\"http\")\n\n const className = `cmx-mdx__button inline-block px-4 py-2 rounded-lg font-medium transition-colors ${variants[variant]}`\n\n if (isExternal) {\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n >\n {children}\n </a>\n )\n }\n\n return (\n <Link href={href} className={className}>\n {children}\n </Link>\n )\n}\n","// CMX Basic MDX Components\n// テンプレートとして提供する標準コンポーネント\n// クラス名: cmx-mdx__[component], cmx-mdx__[component]-[element], cmx-mdx__[component]--[modifier]\n\nexport { Callout } from \"./Callout\"\nexport { Embed } from \"./Embed\"\nexport { Button } from \"./Button\"\n\nimport { Callout } from \"./Callout\"\nimport { Embed } from \"./Embed\"\nimport { Button } from \"./Button\"\n\nexport const basicComponents = {\n Callout,\n Embed,\n Button,\n}\n","import Link from \"next/link\"\n\ninterface BlogCardProps {\n contentId: string\n // 以下はサーバーサイドでcontentIdから解決される\n title?: string\n slug?: string\n excerpt?: string\n}\n\nexport function BlogCard({ contentId, title, slug, excerpt }: BlogCardProps) {\n // contentIdのみの場合(未解決)\n if (!title || !slug) {\n return (\n <div className=\"border border-dashed border-gray-300 rounded-lg p-4 bg-gray-50\">\n <p className=\"text-sm text-gray-500\">記事カード: {contentId}</p>\n </div>\n )\n }\n\n return (\n <Link\n href={`/${slug}`}\n className=\"block border border-gray-200 rounded-lg p-4 hover:border-blue-400 hover:shadow-md transition-all\"\n >\n <h3 className=\"text-lg font-semibold text-gray-900 mb-2\">{title}</h3>\n {excerpt && <p className=\"text-sm text-gray-600 line-clamp-2\">{excerpt}</p>}\n </Link>\n )\n}\n","import NextImage from \"next/image\"\n\ninterface ImageProps {\n assetId: string\n alt?: string\n size?: \"thumbnail\" | \"medium\" | \"large\" | \"original\"\n caption?: string\n // 以下はサーバーサイドでassetIdから解決される\n url?: string\n width?: number\n height?: number\n}\n\nexport function Image({\n assetId,\n alt = \"\",\n size = \"large\",\n caption,\n url,\n width,\n height,\n}: ImageProps) {\n // 未解決の場合\n if (!url) {\n return (\n <figure className=\"my-4\">\n <div className=\"border border-dashed border-gray-300 rounded-lg p-8 bg-gray-50 text-center\">\n <p className=\"text-sm text-gray-500\">画像: {assetId}</p>\n <p className=\"text-xs text-gray-400\">サイズ: {size}</p>\n </div>\n {caption && (\n <figcaption className=\"mt-2 text-sm text-gray-500 text-center\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n }\n\n return (\n <figure className=\"my-4\">\n <NextImage\n src={url}\n alt={alt}\n width={width || 800}\n height={height || 600}\n className=\"rounded-lg\"\n />\n {caption && (\n <figcaption className=\"mt-2 text-sm text-gray-500 text-center\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n}\n","// CMX Custom MDX Components\n// プロジェクト固有のカスタムコンポーネント(reference解決が必要)\n// これらは企業ごとにカスタマイズされることを想定\n\nexport { BlogCard } from \"./BlogCard\"\nexport { Image } from \"./Image\"\n\nimport { BlogCard } from \"./BlogCard\"\nimport { Image } from \"./Image\"\n\nexport const customComponents = {\n BlogCard,\n Image,\n}\n","// ============================================\n// Standard Markdown Element Components\n// These map to HTML elements generated from Markdown syntax\n// ============================================\n\ntype PropsWithChildren = { children?: React.ReactNode; [key: string]: unknown }\n\n// Headings: # ## ### #### ##### ######\nconst mdxH1 = ({ children, ...props }: PropsWithChildren) => (\n <h1 className=\"text-4xl font-bold mt-8 mb-4\" {...props}>{children}</h1>\n)\nconst mdxH2 = ({ children, ...props }: PropsWithChildren) => (\n <h2 className=\"text-3xl font-bold mt-6 mb-3\" {...props}>{children}</h2>\n)\nconst mdxH3 = ({ children, ...props }: PropsWithChildren) => (\n <h3 className=\"text-2xl font-semibold mt-4 mb-2\" {...props}>{children}</h3>\n)\nconst mdxH4 = ({ children, ...props }: PropsWithChildren) => (\n <h4 className=\"text-xl font-semibold mt-3 mb-2\" {...props}>{children}</h4>\n)\nconst mdxH5 = ({ children, ...props }: PropsWithChildren) => (\n <h5 className=\"text-lg font-medium mt-2 mb-1\" {...props}>{children}</h5>\n)\nconst mdxH6 = ({ children, ...props }: PropsWithChildren) => (\n <h6 className=\"text-base font-medium mt-2 mb-1\" {...props}>{children}</h6>\n)\n\n// Paragraph\nconst mdxP = ({ children, ...props }: PropsWithChildren) => (\n <p className=\"my-4 leading-7\" {...props}>{children}</p>\n)\n\n// Lists: - item / 1. item\nconst mdxUl = ({ children, ...props }: PropsWithChildren) => (\n <ul className=\"my-4 pl-6 list-disc\" {...props}>{children}</ul>\n)\nconst mdxOl = ({ children, ...props }: PropsWithChildren) => (\n <ol className=\"my-4 pl-6 list-decimal\" {...props}>{children}</ol>\n)\nconst mdxLi = ({ children, ...props }: PropsWithChildren) => (\n <li className=\"my-1\" {...props}>{children}</li>\n)\n\n// Blockquote: > quote\nconst mdxBlockquote = ({ children, ...props }: PropsWithChildren) => (\n <blockquote className=\"border-l-4 border-primary pl-4 italic my-4\" {...props}>\n {children}\n </blockquote>\n)\n\n// Code: ```code``` and `inline`\nconst mdxPre = ({ children, ...props }: PropsWithChildren) => (\n <pre className=\"overflow-x-auto rounded-lg bg-slate-900 p-4 text-sm my-4\" {...props}>\n {children}\n </pre>\n)\nconst mdxCode = ({ children, ...props }: PropsWithChildren) => (\n <code className=\"bg-muted px-1.5 py-0.5 rounded text-sm font-mono\" {...props}>\n {children}\n </code>\n)\n\n// Horizontal rule: ---\nconst mdxHr = () => (\n <hr className=\"my-8 border-t border-border\" />\n)\n\n// Links: [text](url)\nconst mdxA = ({ children, href, ...props }: PropsWithChildren & { href?: string }) => (\n <a\n href={href}\n className=\"text-primary underline underline-offset-4 hover:text-primary/80\"\n target={href?.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={href?.startsWith(\"http\") ? \"noopener noreferrer\" : undefined}\n {...props}\n >\n {children}\n </a>\n)\n\n// Images: \nconst mdxImg = ({ src, alt, ...props }: { src?: string; alt?: string; [key: string]: unknown }) => (\n // eslint-disable-next-line @next/next/no-img-element\n <img\n src={src}\n alt={alt || \"\"}\n className=\"max-w-full h-auto rounded-lg my-4\"\n {...props}\n />\n)\n\n// Text formatting: **bold** *italic*\nconst mdxStrong = ({ children, ...props }: PropsWithChildren) => (\n <strong className=\"font-bold\" {...props}>{children}</strong>\n)\nconst mdxEm = ({ children, ...props }: PropsWithChildren) => (\n <em className=\"italic\" {...props}>{children}</em>\n)\n\n// Tables (GFM)\nconst mdxTable = ({ children, ...props }: PropsWithChildren) => (\n <div className=\"my-4 overflow-x-auto\">\n <table className=\"min-w-full border-collapse border border-border\" {...props}>\n {children}\n </table>\n </div>\n)\nconst mdxThead = ({ children, ...props }: PropsWithChildren) => (\n <thead className=\"bg-muted\" {...props}>{children}</thead>\n)\nconst mdxTbody = ({ children, ...props }: PropsWithChildren) => (\n <tbody {...props}>{children}</tbody>\n)\nconst mdxTr = ({ children, ...props }: PropsWithChildren) => (\n <tr className=\"border-b border-border\" {...props}>{children}</tr>\n)\nconst mdxTh = ({ children, ...props }: PropsWithChildren) => (\n <th className=\"px-4 py-2 text-left font-semibold border border-border\" {...props}>{children}</th>\n)\nconst mdxTd = ({ children, ...props }: PropsWithChildren) => (\n <td className=\"px-4 py-2 border border-border\" {...props}>{children}</td>\n)\n\n/**\n * Standard markdown element mappings for MDX\n * Use with MDX's components prop: <MDXContent components={markdownComponents} />\n */\nexport const markdownComponents = {\n h1: mdxH1,\n h2: mdxH2,\n h3: mdxH3,\n h4: mdxH4,\n h5: mdxH5,\n h6: mdxH6,\n p: mdxP,\n ul: mdxUl,\n ol: mdxOl,\n li: mdxLi,\n blockquote: mdxBlockquote,\n pre: mdxPre,\n code: mdxCode,\n hr: mdxHr,\n a: mdxA,\n img: mdxImg,\n strong: mdxStrong,\n em: mdxEm,\n table: mdxTable,\n thead: mdxThead,\n tbody: mdxTbody,\n tr: mdxTr,\n th: mdxTh,\n td: mdxTd,\n}\n","// MDX Components\n// basic: CMXテンプレート(cmx-mdx__プレフィックス付き)\n// custom: プロジェクト固有(reference解決が必要)\n// markdown: 標準Markdown要素(h1, p, ul, etc.)\n\n// Basic Components (CMX templates)\nexport { Callout, Embed, Button, basicComponents } from \"./basic\"\n\n// Custom Components (project-specific)\nexport { BlogCard, Image, customComponents } from \"./custom\"\n\n// Standard Markdown Element Components\nexport { markdownComponents } from \"./markdown\"\n\n// Combined MDX Component Map\nimport { basicComponents } from \"./basic\"\nimport { customComponents } from \"./custom\"\nimport { markdownComponents } from \"./markdown\"\n\nexport const mdxComponents = {\n ...markdownComponents,\n ...basicComponents,\n ...customComponents,\n}\n","import { z } from \"zod\"\n\n// ============================================\n// Component Props Schema Definitions\n// ============================================\n\nexport const componentSchemas = {\n BlogCard: z.object({\n contentId: z.string().uuid().describe(\"参照先コンテンツのUUID\"),\n }),\n\n Image: z.object({\n assetId: z.string().uuid().describe(\"アセットのUUID\"),\n alt: z.string().optional().describe(\"代替テキスト\"),\n size: z\n .enum([\"thumbnail\", \"medium\", \"large\", \"original\"])\n .default(\"large\")\n .describe(\"表示サイズ\"),\n caption: z.string().optional().describe(\"キャプション\"),\n }),\n\n Callout: z.object({\n type: z\n .enum([\"info\", \"warning\", \"error\", \"success\", \"tip\"])\n .default(\"info\")\n .describe(\"タイプ\"),\n title: z.string().optional().describe(\"タイトル\"),\n children: z.string().describe(\"本文(Markdown可)\"),\n }),\n\n Embed: z.object({\n url: z.string().url().describe(\"埋め込みURL\"),\n type: z.enum([\"youtube\", \"twitter\", \"generic\"]).default(\"generic\").describe(\"タイプ\"),\n }),\n\n Button: z.object({\n href: z.string().describe(\"リンク先URL\"),\n children: z.string().describe(\"ボタンテキスト\"),\n variant: z.enum([\"primary\", \"secondary\", \"outline\"]).default(\"primary\").describe(\"スタイル\"),\n }),\n} as const\n\n// ============================================\n// Component Catalog Type\n// ============================================\n\nexport type ComponentName = keyof typeof componentSchemas\nexport type ComponentSource = \"standard\" | \"custom\"\nexport type ComponentKind = \"presentational\" | \"data-bound\"\n\nexport interface ComponentBinding {\n prop: string\n target: \"content\" | \"asset\" | \"dataEntry\"\n strategy: \"by-id\"\n}\n\nexport interface ComponentDefinition<T extends ComponentName = ComponentName> {\n name: T\n displayName: string\n description: string\n category: \"content\" | \"media\" | \"reference\" | \"layout\"\n schema: (typeof componentSchemas)[T]\n examples: string[]\n hasReferences: boolean\n source: \"standard\"\n kind: ComponentKind\n locked: true\n editable: false\n bindings?: ComponentBinding[]\n}\n\nexport interface CatalogForAIComponent {\n name: string\n description: string\n props: Record<string, { type: string; description?: string; required: boolean }>\n examples: string[]\n source: ComponentSource\n kind: ComponentKind\n locked: boolean\n editable: boolean\n bindings?: ComponentBinding[]\n}\n\n// ============================================\n// Component Catalog (Standard / Immutable)\n// ============================================\n\nexport const componentCatalog: Record<ComponentName, ComponentDefinition> = {\n BlogCard: {\n name: \"BlogCard\",\n displayName: \"記事カード\",\n description: \"他の記事へのリンクカードを表示します\",\n category: \"reference\",\n schema: componentSchemas.BlogCard,\n examples: ['<BlogCard contentId=\"123e4567-e89b-12d3-a456-426614174000\" />'],\n hasReferences: true,\n source: \"standard\",\n kind: \"data-bound\",\n locked: true,\n editable: false,\n bindings: [{ prop: \"contentId\", target: \"content\", strategy: \"by-id\" }],\n },\n\n Image: {\n name: \"Image\",\n displayName: \"画像\",\n description: \"アップロード済み画像を表示します\",\n category: \"media\",\n schema: componentSchemas.Image,\n examples: [\n '<Image assetId=\"123e4567-e89b-12d3-a456-426614174000\" alt=\"説明\" />',\n '<Image assetId=\"123e4567-e89b-12d3-a456-426614174000\" size=\"medium\" caption=\"キャプション\" />',\n ],\n hasReferences: true,\n source: \"standard\",\n kind: \"data-bound\",\n locked: true,\n editable: false,\n bindings: [{ prop: \"assetId\", target: \"asset\", strategy: \"by-id\" }],\n },\n\n Callout: {\n name: \"Callout\",\n displayName: \"コールアウト\",\n description: \"注意書きや補足情報を目立たせるボックス\",\n category: \"content\",\n schema: componentSchemas.Callout,\n examples: [\n '<Callout type=\"info\">これは情報です</Callout>',\n '<Callout type=\"warning\" title=\"注意\">重要な注意事項です</Callout>',\n ],\n hasReferences: false,\n source: \"standard\",\n kind: \"presentational\",\n locked: true,\n editable: false,\n },\n\n Embed: {\n name: \"Embed\",\n displayName: \"埋め込み\",\n description: \"YouTube動画やツイートを埋め込みます\",\n category: \"media\",\n schema: componentSchemas.Embed,\n examples: [\n '<Embed url=\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\" type=\"youtube\" />',\n '<Embed url=\"https://twitter.com/example/status/123456789\" type=\"twitter\" />',\n ],\n hasReferences: false,\n source: \"standard\",\n kind: \"presentational\",\n locked: true,\n editable: false,\n },\n\n Button: {\n name: \"Button\",\n displayName: \"ボタン\",\n description: \"アクションを促すボタンリンク\",\n category: \"content\",\n schema: componentSchemas.Button,\n examples: [\n '<Button href=\"/contact\">お問い合わせ</Button>',\n '<Button href=\"https://example.com\" variant=\"secondary\">詳細を見る</Button>',\n ],\n hasReferences: false,\n source: \"standard\",\n kind: \"presentational\",\n locked: true,\n editable: false,\n },\n}\n\n// ============================================\n// Utility Functions\n// ============================================\n\nexport function isValidComponent(name: string): name is ComponentName {\n return name in componentCatalog\n}\n\nexport function validateComponentProps(\n name: ComponentName,\n props: unknown\n): { success: true; data: unknown } | { success: false; error: z.ZodError } {\n const schema = componentSchemas[name]\n const result = schema.safeParse(props)\n if (result.success) {\n return { success: true, data: result.data }\n }\n return { success: false, error: result.error }\n}\n\nexport function getComponentsWithReferences(): ComponentName[] {\n return (Object.keys(componentCatalog) as ComponentName[]).filter(\n (name) => componentCatalog[name].hasReferences\n )\n}\n\nexport function getComponentsByCategory(): Record<string, ComponentDefinition[]> {\n const grouped: Record<string, ComponentDefinition[]> = {}\n for (const def of Object.values(componentCatalog)) {\n if (!grouped[def.category]) {\n grouped[def.category] = []\n }\n grouped[def.category].push(def)\n }\n return grouped\n}\n\nexport function getStandardComponentNames(): ComponentName[] {\n return Object.keys(componentCatalog) as ComponentName[]\n}\n\nexport function isStandardComponentName(name: string): boolean {\n return isValidComponent(name)\n}\n\nexport function getCatalogForAI(): CatalogForAIComponent[] {\n return Object.values(componentCatalog).map((def) => {\n const shape = def.schema.shape as Record<string, z.ZodTypeAny>\n const props: Record<string, { type: string; description?: string; required: boolean }> = {}\n\n for (const [key, zodType] of Object.entries(shape)) {\n const isOptional = zodType.isOptional()\n props[key] = {\n type: getZodTypeName(zodType),\n description: zodType.description,\n required: !isOptional,\n }\n }\n\n return {\n name: def.name,\n description: def.description,\n props,\n examples: def.examples,\n source: def.source,\n kind: def.kind,\n locked: def.locked,\n editable: def.editable,\n bindings: def.bindings,\n }\n })\n}\n\nfunction getZodTypeName(zodType: z.ZodTypeAny): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const typeDef = (zodType as any)._zod?.def ?? (zodType as any)._def\n if (!typeDef) return \"unknown\"\n\n const typeName = typeDef.type ?? typeDef.typeName\n\n switch (typeName) {\n case \"string\":\n case \"ZodString\":\n return \"string\"\n case \"number\":\n case \"ZodNumber\":\n return \"number\"\n case \"boolean\":\n case \"ZodBoolean\":\n return \"boolean\"\n case \"enum\":\n case \"ZodEnum\":\n return `enum(${typeDef.values?.join(\"|\") ?? \"\"})`\n case \"array\":\n case \"ZodArray\":\n return \"array\"\n case \"optional\":\n case \"ZodOptional\":\n return typeDef.innerType ? getZodTypeName(typeDef.innerType) : \"unknown\"\n case \"default\":\n case \"ZodDefault\":\n return typeDef.innerType ? getZodTypeName(typeDef.innerType) : \"unknown\"\n default:\n return \"unknown\"\n }\n}\n","import { compile } from \"@mdx-js/mdx\"\nimport { isValidComponent, validateComponentProps, ComponentName } from \"./component-catalog\"\n\n// ============================================\n// Validation Error Types\n// ============================================\n\nexport interface ValidationError {\n type: \"syntax\" | \"forbidden\" | \"component\" | \"props\"\n message: string\n line?: number\n column?: number\n component?: string\n}\n\nexport interface ValidationResult {\n valid: boolean\n errors: ValidationError[]\n warnings: string[]\n references: {\n contentIds: string[]\n assetIds: string[]\n }\n}\n\n// ============================================\n// Forbidden Patterns\n// ============================================\n\nconst FORBIDDEN_PATTERNS = [\n // import/export statements\n { pattern: /^\\s*import\\s+/m, message: \"import文は使用できません\" },\n { pattern: /^\\s*export\\s+/m, message: \"export文は使用できません\" },\n // JS expressions in curly braces (except component props)\n { pattern: /\\{[^}]*(?:=>|function|new\\s+|typeof|instanceof)[^}]*\\}/m, message: \"JavaScript式は使用できません\" },\n // eval, Function constructor\n { pattern: /\\beval\\s*\\(/m, message: \"evalは使用できません\" },\n { pattern: /\\bnew\\s+Function\\s*\\(/m, message: \"Function constructorは使用できません\" },\n // script tags\n { pattern: /<script[\\s>]/i, message: \"scriptタグは使用できません\" },\n // on* event handlers\n { pattern: /\\bon\\w+\\s*=/i, message: \"イベントハンドラ属性は使用できません\" },\n // javascript: URLs\n { pattern: /javascript\\s*:/i, message: \"javascript: URLは使用できません\" },\n // data: URLs (for images - can be XSS vector)\n { pattern: /src\\s*=\\s*[\"']?\\s*data:/i, message: \"data: URLは使用できません\" },\n]\n\n// ============================================\n// Component Extraction\n// ============================================\n\ninterface ExtractedComponent {\n name: string\n props: Record<string, unknown>\n line: number\n}\n\nfunction extractComponents(mdx: string): ExtractedComponent[] {\n const components: ExtractedComponent[] = []\n const lines = mdx.split(\"\\n\")\n\n // Simple regex to find JSX-like components\n // <ComponentName prop=\"value\" prop2={expression} />\n const componentPattern = /<([A-Z][a-zA-Z0-9]*)\\s*([^>]*?)\\s*\\/?>/g\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n let match\n\n while ((match = componentPattern.exec(line)) !== null) {\n const name = match[1]\n const propsString = match[2]\n const props = parseProps(propsString)\n\n components.push({\n name,\n props,\n line: i + 1,\n })\n }\n }\n\n return components\n}\n\nfunction parseProps(propsString: string): Record<string, unknown> {\n const props: Record<string, unknown> = {}\n\n // Match prop=\"value\" or prop={value} patterns\n const propPattern = /(\\w+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|\\{([^}]*)\\})/g\n let match\n\n while ((match = propPattern.exec(propsString)) !== null) {\n const key = match[1]\n const stringValue = match[2] ?? match[3]\n const expressionValue = match[4]\n\n if (stringValue !== undefined) {\n props[key] = stringValue\n } else if (expressionValue !== undefined) {\n // Try to parse simple values\n const trimmed = expressionValue.trim()\n if (trimmed === \"true\") {\n props[key] = true\n } else if (trimmed === \"false\") {\n props[key] = false\n } else if (/^\\d+$/.test(trimmed)) {\n props[key] = parseInt(trimmed, 10)\n } else if (/^\\d+\\.\\d+$/.test(trimmed)) {\n props[key] = parseFloat(trimmed)\n } else if (trimmed.startsWith(\"[\") && trimmed.endsWith(\"]\")) {\n // Try to parse array\n try {\n props[key] = JSON.parse(trimmed.replace(/'/g, '\"'))\n } catch {\n props[key] = trimmed\n }\n } else {\n props[key] = trimmed\n }\n }\n }\n\n // Handle boolean props without value (e.g., <CodeBlock showLineNumbers />)\n const booleanPattern = /(?:^|\\s)(\\w+)(?=\\s|\\/|>|$)/g\n while ((match = booleanPattern.exec(propsString)) !== null) {\n const key = match[1]\n if (!(key in props)) {\n props[key] = true\n }\n }\n\n return props\n}\n\n// ============================================\n// Extract References\n// ============================================\n\nfunction extractReferences(components: ExtractedComponent[]): {\n contentIds: string[]\n assetIds: string[]\n} {\n const contentIds: string[] = []\n const assetIds: string[] = []\n\n for (const component of components) {\n if (component.name === \"BlogCard\" && typeof component.props.contentId === \"string\") {\n contentIds.push(component.props.contentId)\n }\n if (component.name === \"Image\" && typeof component.props.assetId === \"string\") {\n assetIds.push(component.props.assetId)\n }\n }\n\n return {\n contentIds: [...new Set(contentIds)],\n assetIds: [...new Set(assetIds)],\n }\n}\n\n// ============================================\n// Main Validation Function\n// ============================================\n\nexport async function validateMdx(mdx: string): Promise<ValidationResult> {\n const errors: ValidationError[] = []\n const warnings: string[] = []\n\n // 1. Check forbidden patterns\n for (const { pattern, message } of FORBIDDEN_PATTERNS) {\n if (pattern.test(mdx)) {\n const lines = mdx.split(\"\\n\")\n for (let i = 0; i < lines.length; i++) {\n if (pattern.test(lines[i])) {\n errors.push({\n type: \"forbidden\",\n message,\n line: i + 1,\n })\n break\n }\n }\n }\n }\n\n // 2. Try to compile MDX (syntax check)\n try {\n await compile(mdx, {\n development: false,\n // Minimal compilation to check syntax\n })\n } catch (error) {\n const err = error as Error & { line?: number; column?: number }\n errors.push({\n type: \"syntax\",\n message: err.message,\n line: err.line,\n column: err.column,\n })\n }\n\n // 3. Extract and validate components\n const components = extractComponents(mdx)\n\n for (const component of components) {\n // Check if component is in catalog\n if (!isValidComponent(component.name)) {\n errors.push({\n type: \"component\",\n message: `未知のコンポーネント: ${component.name}`,\n line: component.line,\n component: component.name,\n })\n continue\n }\n\n // Validate props\n const result = validateComponentProps(component.name as ComponentName, component.props)\n if (!result.success) {\n for (const issue of result.error.issues) {\n errors.push({\n type: \"props\",\n message: `${component.name}: ${issue.path.join(\".\")} - ${issue.message}`,\n line: component.line,\n component: component.name,\n })\n }\n }\n }\n\n // 4. Extract references\n const references = extractReferences(components)\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n references,\n }\n}\n\n// ============================================\n// Quick Validation (for save)\n// ============================================\n\nexport function quickValidateMdx(mdx: string): {\n valid: boolean\n errors: ValidationError[]\n} {\n const errors: ValidationError[] = []\n\n // Only check forbidden patterns (fast)\n for (const { pattern, message } of FORBIDDEN_PATTERNS) {\n if (pattern.test(mdx)) {\n errors.push({\n type: \"forbidden\",\n message,\n })\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n}\n","/**\n * CMX SDK — MDX Rendering\n *\n * Server-side MDX compilation and rendering with reference resolution.\n * Provides `renderMdx` as an async function for Server Components.\n */\n\nimport { compile, run } from \"@mdx-js/mdx\"\nimport * as runtime from \"react/jsx-runtime\"\n\nimport {\n BlogCard,\n Image,\n Callout,\n Embed,\n Button,\n markdownComponents,\n} from \"./mdx/components/index.js\"\n\nimport type {\n References,\n ContentReference,\n AssetReference,\n} from \"./generated/sdk/models/index.js\"\n\n// ============================================\n// Types\n// ============================================\n\nexport interface ResolvedReferences {\n contents: Map<string, ContentReference>\n assets: Map<string, AssetReference>\n}\n\nexport interface RenderOptions {\n /** Additional MDX components to make available (e.g. custom components) */\n additionalComponents?: Record<string, React.ComponentType<any>>\n}\n\nexport interface RenderResult {\n content: React.ReactElement\n references: ResolvedReferences\n}\n\n// ============================================\n// Reference Conversion\n// ============================================\n\nfunction convertReferencesToMaps(refs?: References): ResolvedReferences {\n const contentsMap = new Map<string, ContentReference>()\n const assetsMap = new Map<string, AssetReference>()\n\n if (refs?.contents) {\n Object.entries(refs.contents).forEach(([id, content]) => {\n contentsMap.set(id, content)\n })\n }\n\n if (refs?.assets) {\n Object.entries(refs.assets).forEach(([id, asset]) => {\n assetsMap.set(id, asset)\n })\n }\n\n return { contents: contentsMap, assets: assetsMap }\n}\n\n// ============================================\n// Component Factory\n// ============================================\n\nfunction createResolvedComponents(\n references: ResolvedReferences,\n additionalComponents?: Record<string, React.ComponentType<any>>\n) {\n return {\n // Standard markdown elements\n ...markdownComponents,\n\n // Custom components with reference resolution\n BlogCard: (props: { contentId: string }) => {\n const ref = references.contents.get(props.contentId)\n return (\n <BlogCard\n contentId={props.contentId}\n title={ref?.title}\n slug={ref?.slug}\n excerpt={ref?.description || undefined}\n />\n )\n },\n\n Image: (props: { assetId: string; alt?: string; size?: \"thumbnail\" | \"medium\" | \"large\" | \"original\"; caption?: string }) => {\n const asset = references.assets.get(props.assetId)\n const size = props.size || \"large\"\n let url = asset?.url\n\n // Get the appropriate variant URL\n if (asset?.variants && size !== \"original\") {\n url = asset.variants[size] || asset.url\n }\n\n return (\n <Image\n assetId={props.assetId}\n alt={props.alt || asset?.alt || \"\"}\n size={size}\n caption={props.caption}\n url={url}\n width={asset?.width || undefined}\n height={asset?.height || undefined}\n />\n )\n },\n\n // Components without resolution\n Callout,\n Embed,\n Button,\n\n // User-provided custom components\n ...additionalComponents,\n }\n}\n\n// ============================================\n// MDX Validation\n// ============================================\n\n/**\n * Patterns that indicate potentially dangerous MDX content.\n * These are blocked to prevent arbitrary code execution via MDX injection.\n */\nconst DANGEROUS_PATTERNS = [\n /\\bimport\\s+/, // import statements\n /\\bexport\\s+/, // export statements (except default handled by mdx compiler)\n /\\{.*\\bconstructor\\b/, // constructor access in expressions\n /\\{.*\\b__proto__\\b/, // prototype pollution\n /\\{.*\\bprocess\\b/, // process access\n /\\{.*\\brequire\\s*\\(/, // require() calls\n /\\{.*\\beval\\s*\\(/, // eval() calls\n /\\{.*\\bFunction\\s*\\(/, // Function constructor\n] as const\n\n/**\n * Validate MDX content before compilation.\n * Throws an error if dangerous patterns are detected.\n */\nfunction validateMdx(mdx: string): void {\n for (const pattern of DANGEROUS_PATTERNS) {\n if (pattern.test(mdx)) {\n throw new Error(\n `MDX validation failed: potentially unsafe content detected (${pattern.source}). ` +\n \"MDX content must not contain import/export statements or dynamic code execution.\"\n )\n }\n }\n}\n\n// ============================================\n// MDX Renderer\n// ============================================\n\n/**\n * Render MDX content with pre-resolved references from CMX API.\n *\n * @param mdx - Raw MDX string\n * @param references - References object from the API response (contents & assets)\n * @param options - Additional options (e.g. custom components)\n * @returns Rendered content and resolved references\n *\n * @example\n * ```tsx\n * const { content } = await renderMdx(post.mdx, post.references)\n * return <article>{content}</article>\n * ```\n *\n * @example With custom components\n * ```tsx\n * import { FeatureCard } from '@/components/custom'\n * const { content } = await renderMdx(post.mdx, post.references, {\n * additionalComponents: { FeatureCard }\n * })\n * ```\n */\nexport async function renderMdx(\n mdx: string,\n references?: References,\n options?: RenderOptions\n): Promise<RenderResult> {\n validateMdx(mdx)\n\n const resolvedReferences = convertReferencesToMaps(references)\n const components = createResolvedComponents(resolvedReferences, options?.additionalComponents)\n\n const code = await compile(mdx, {\n outputFormat: \"function-body\",\n development: false,\n })\n\n const { default: MDXContent } = await run(String(code), {\n ...runtime,\n baseUrl: import.meta.url,\n })\n\n const content = <MDXContent components={components} />\n\n return {\n content,\n references: resolvedReferences,\n }\n}\n\n/**\n * Render MDX content without reference resolution (for preview in editor).\n *\n * @param mdx - Raw MDX string\n * @param additionalComponents - Optional custom components\n * @returns Rendered React element\n */\nexport async function renderMdxPreview(\n mdx: string,\n additionalComponents?: Record<string, React.ComponentType<any>>\n): Promise<React.ReactElement> {\n const components = {\n ...markdownComponents,\n BlogCard,\n Image,\n Callout,\n Embed,\n Button,\n ...additionalComponents,\n }\n\n try {\n validateMdx(mdx)\n\n const code = await compile(mdx, {\n outputFormat: \"function-body\",\n development: false,\n })\n\n const { default: MDXContent } = await run(String(code), {\n ...runtime,\n baseUrl: import.meta.url,\n })\n\n return <MDXContent components={components} />\n } catch (error) {\n console.error(\"MDX render error:\", error)\n return (\n <div className=\"p-4 bg-red-50 border border-red-200 rounded-lg\">\n <p className=\"text-red-600 font-medium\">MDX Render Error</p>\n <pre className=\"mt-2 text-sm text-red-500 whitespace-pre-wrap\">\n {error instanceof Error ? error.message : \"Unknown error\"}\n </pre>\n </div>\n )\n }\n}\n"],"mappings":";AAgDO,IAAM,cAAN,cAA0B,MAAM;AAAA,EACrC,YACE,SACgB,QACA,MAChB;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,IAAI,aAAsB;AACxB,WAAO,KAA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,EACd;AACF;AASA,eAAsB,iBACpB,KACA,sBAC6B;AAC7B,QAAM,aAAa;AAAA,IACjB,GAAG;AAAA,IACH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL;AAEA,MAAI;AACF,IAAAE,aAAY,GAAG;AAEf,UAAM,OAAO,MAAMC,SAAQ,KAAK;AAAA,MAC9B,cAAc;AAAA,MACd,aAAa;AAAA,IACf,CAAC;AAED,UAAM,EAAE,SAAS,WAAW,IAAI,MAAM,IAAI,OAAO,IAAI,GAAG;AAAA,MACtD,GAAG;AAAA,MACH,SAAS,YAAY;AAAA,IACvB,CAAC;AAED,WAAO,gBAAAH,KAAC,cAAW,YAAwB;AAAA,EAC7C,SAAS,OAAO;AACd,YAAQ,MAAM,qBAAqB,KAAK;AACxC,WACE,gBAAAC,MAAC,SAAI,WAAU,kDACb;AAAA,sBAAAD,KAAC,OAAE,WAAU,4BAA2B,8BAAgB;AAAA,MACxD,gBAAAA,KAAC,SAAI,WAAU,iDACZ,2BAAiB,QAAQ,MAAM,UAAU,iBAC5C;AAAA,OACF;AAAA,EAEJ;AACF;","names":["jsx","jsxs","jsx","Link","jsx","jsxs","jsx","jsxs","jsx","compile","jsx","jsxs","validateMdx","compile"]}
|
|
1
|
+
{"version":3,"sources":["../src/core/types.ts","../src/core/sdk-fetcher.ts","../src/core/cache-tags.ts","../src/core/date-reviver.ts","../src/generated/sdk/endpoints/sdk.ts","../src/api.ts","../src/mdx/components/basic/Callout.tsx","../src/mdx/components/basic/Embed.tsx","../src/mdx/components/basic/Button.tsx","../src/mdx/components/basic/index.ts","../src/mdx/components/custom/BlogCard.tsx","../src/mdx/components/custom/Image.tsx","../src/mdx/components/custom/index.ts","../src/mdx/components/markdown/index.tsx","../src/mdx/components/index.ts","../src/mdx/component-catalog.ts","../src/mdx/validator.ts","../src/render.tsx"],"sourcesContent":["/**\n * API共通型定義\n */\n\n/**\n * APIレスポンスの共通型(Admin API用)\n */\nexport interface ApiResponse<T> {\n data: T | null\n error: string | null\n status: number\n}\n\n/**\n * Admin fetcherオプション\n */\nexport interface AdminFetcherOptions {\n /** 401エラー時の自動リダイレクトを無効化 */\n disableAutoSignOut?: boolean\n /** 401エラー時のリダイレクト先URL */\n signOutCallbackUrl?: string\n /** ワークスペースSlug(未指定ならURLから推測) */\n workspaceSlug?: string\n}\n\n/**\n * Public fetcherオプション\n */\nexport interface PublicFetcherOptions {\n /** 認証トークン */\n token: string\n /** Next.js cache tags */\n tags?: string[]\n /** キャッシュ設定 */\n revalidate?: number | false\n}\n\n/**\n * 認証エラーコード\n */\nexport const AUTH_ERROR_CODES = [\"AUTH_REQUIRED\", \"USER_DELETED\"] as const\nexport type AuthErrorCode = (typeof AUTH_ERROR_CODES)[number]\n\n/**\n * SDK APIエラー\n * HTTPステータスコードとAPIエラーコードを保持し、\n * 404/401/403/500等の区別を可能にする\n */\nexport class CmxApiError extends Error {\n constructor(\n message: string,\n public readonly status: number,\n public readonly code?: string,\n ) {\n super(message)\n this.name = \"CmxApiError\"\n }\n\n get isNotFound(): boolean {\n return this.status === 404\n }\n\n get isUnauthorized(): boolean {\n return this.status === 401\n }\n\n get isForbidden(): boolean {\n return this.status === 403\n }\n\n get isServerError(): boolean {\n return this.status >= 500\n }\n}\n","/**\n * SDK API用カスタムfetcher\n * サーバーサイドからSDK APIを呼び出すためのfetcher\n * - Authorization: Bearer ヘッダー付与\n * - Next.js cache tags対応\n */\n\nimport type { PublicFetcherOptions } from \"./types\"\nimport { CmxApiError } from \"./types\"\n\n// Next.js拡張のRequestInit型\ninterface NextFetchRequestInit extends RequestInit {\n next?: {\n tags?: string[]\n revalidate?: number | false\n }\n}\n\nconst DEFAULT_API_URL = \"https://app.cmx-ai.org\"\n\n/**\n * SDK APIのベースURL取得\n */\nexport function getSdkApiBaseUrl(): string {\n const apiUrl = process.env.CMX_API_URL || DEFAULT_API_URL\n return `${apiUrl}/api/v1/sdk`\n}\n\n/**\n * 環境変数からSDK APIトークン取得\n */\nexport function getSdkApiToken(): string {\n const token = process.env.CMX_API_KEY\n if (!token) {\n throw new Error(\"CMX_API_KEY environment variable is not set\")\n }\n return token\n}\n\n/**\n * SDK API用のカスタムfetcher\n * サーバーサイドでのみ使用(SSR/RSC)\n */\nexport async function sdkFetcher<T>(\n path: string,\n options: PublicFetcherOptions\n): Promise<T> {\n const { token, tags, revalidate } = options\n const baseUrl = getSdkApiBaseUrl()\n const url = `${baseUrl}${path}`\n\n const fetchOptions: NextFetchRequestInit = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n next: {\n tags: tags || [],\n ...(revalidate !== undefined && { revalidate }),\n },\n }\n\n const response = await fetch(url, fetchOptions as RequestInit)\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n\n/**\n * Orval用のカスタムインスタンス\n * OrvalはURLとRequestInitを直接渡す形式で呼び出す\n */\nexport async function sdkCustomInstance<T>(\n url: string,\n options?: RequestInit\n): Promise<T> {\n const token = getSdkApiToken()\n const baseUrl = getSdkApiBaseUrl()\n const fullUrl = url.startsWith(\"http\") ? url : `${baseUrl}${url}`\n\n const response = await fetch(fullUrl, {\n ...options,\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n ...options?.headers,\n },\n })\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n\n/**\n * キャッシュタグ付きのSDK APIリクエスト用ラッパー\n * Next.js ISR/on-demand revalidation対応\n */\nexport async function sdkFetchWithTags<T>(\n path: string,\n tags?: string[],\n revalidate?: number | false\n): Promise<T> {\n const token = getSdkApiToken()\n const baseUrl = getSdkApiBaseUrl()\n const url = `${baseUrl}${path}`\n\n const fetchOptions: NextFetchRequestInit = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n next: {\n tags: tags || [],\n ...(revalidate !== undefined && { revalidate }),\n },\n }\n\n const response = await fetch(url, fetchOptions as RequestInit)\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n\n/**\n * SDK API用のPOSTリクエストfetcher\n * サーバーサイド(Server Action等)から使用\n */\nexport async function sdkPostFetcher<T>(\n path: string,\n body: unknown\n): Promise<T> {\n const token = getSdkApiToken()\n const baseUrl = getSdkApiBaseUrl()\n const url = `${baseUrl}${path}`\n\n const response = await fetch(url, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n body: JSON.stringify(body),\n cache: \"no-store\",\n })\n\n if (!response.ok) {\n const error = await response.json().catch(() => ({ error: \"Unknown error\" }))\n throw new CmxApiError(error.error || `API error: ${response.status}`, response.status, error.code)\n }\n\n return response.json()\n}\n","/**\n * キャッシュタグ定義\n * Next.js ISR/on-demand revalidation用\n */\n\nexport const CACHE_TAGS = {\n /** 全コレクション共通 */\n collections: \"collections\",\n /** 特定コレクション */\n collection: (slug: string) => `collection:${slug}`,\n /** 特定コンテンツ */\n content: (collectionSlug: string, contentSlug: string) =>\n `content:${collectionSlug}:${contentSlug}`,\n /** 全データタイプ共通 */\n data: \"data\",\n /** 特定データタイプ */\n dataType: (slug: string) => `data:${slug}`,\n} as const\n","/**\n * JSON reviver for automatic date parsing\n * Converts ISO date strings to JavaScript Date objects\n */\nconst isoDateFormat = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}/\n\nexport function dateReviver(_key: string, value: unknown): unknown {\n if (typeof value === \"string\" && isoDateFormat.test(value)) {\n return new Date(value)\n }\n return value\n}\n","/**\n * Generated by orval v7.17.2 🍺\n * Do not edit manually.\n * CMX SDK API\n * CMX SDK API(コンテンツ配信+管理)\n * OpenAPI spec version: 1.0.0\n */\nimport type {\n CollectionContentDetailResponse,\n CollectionContentsResponse,\n CollectionListResponse,\n CollectionResponse,\n CreateCollectionRequest,\n CreateContentRequest,\n CreateDataTypeRequest,\n CreateFormDefinitionRequest,\n DataEntryDetailResponse,\n DataListResponse,\n DataTypeResponse,\n DeleteManageDataTypeSlugIdParams,\n ErrorResponse,\n FormDefinitionResponse,\n GetCollectionsSlugContentsParams,\n GetDataTypeSlugParams,\n GetManageCollectionPresets200,\n GetManageCollectionPresetsParams,\n GetManageDataTypeSlugParams,\n GetPreviewToken200,\n PublicSubmissionRequest,\n PublicSubmissionResponse,\n ReferenceField,\n SchemaResponse,\n SdkAddCollectionDataTypeRequest,\n SdkCollectionDataTypeResponse,\n SdkComponentSuccessResponse,\n SdkComponentSyncRequest,\n SdkContentReferencesResponse,\n SdkCreateContentResponse,\n SdkCreateEntryRequest,\n SdkCustomComponentsListResponse,\n SdkDataEntriesListResponse,\n SdkDataEntryDeletionImpactResponse,\n SdkDataEntryDetailResponse,\n SdkDataEntryResponse,\n SdkDeleteCollectionDataTypeResponse,\n SdkDeleteCollectionResponse,\n SdkDeleteDataEntryResponse,\n SdkDeleteDataTypeResponse,\n SdkDeleteFormDefinitionResponse,\n SdkLinkExistingDataTypeRequest,\n SdkPublishContentResponse,\n SdkRequestReviewResponse,\n SdkSetContentReferencesRequest,\n SdkSetContentReferencesResponse,\n SdkUpdateEntryRequest,\n UpdateCollectionRequest,\n UpdateDataTypeRequest,\n UpdateFormDefinitionRequest\n} from '../models';\n\nimport { dateReviver } from '../../../core/date-reviver';\n\n/**\n * @summary コレクションの公開済みコンテンツ一覧を取得\n */\nexport type getCollectionsSlugContentsResponse200 = {\n data: CollectionContentsResponse\n status: 200\n}\n\nexport type getCollectionsSlugContentsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getCollectionsSlugContentsResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getCollectionsSlugContentsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getCollectionsSlugContentsResponseSuccess = (getCollectionsSlugContentsResponse200) & {\n headers: Headers;\n};\nexport type getCollectionsSlugContentsResponseError = (getCollectionsSlugContentsResponse401 | getCollectionsSlugContentsResponse404 | getCollectionsSlugContentsResponse500) & {\n headers: Headers;\n};\n\nexport type getCollectionsSlugContentsResponse = (getCollectionsSlugContentsResponseSuccess | getCollectionsSlugContentsResponseError)\n\nexport const getGetCollectionsSlugContentsUrl = (slug: string,\n params?: GetCollectionsSlugContentsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/collections/${slug}/contents?${stringifiedParams}` : `/api/v1/sdk/collections/${slug}/contents`\n}\n\nexport const getCollectionsSlugContents = async (slug: string,\n params?: GetCollectionsSlugContentsParams, options?: RequestInit): Promise<getCollectionsSlugContentsResponse> => {\n \n const res = await fetch(getGetCollectionsSlugContentsUrl(slug,params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getCollectionsSlugContentsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getCollectionsSlugContentsResponse\n}\n\n\n\n/**\n * @summary コレクションの公開済みコンテンツ詳細を取得(参照解決済み)\n */\nexport type getCollectionsSlugContentsContentSlugResponse200 = {\n data: CollectionContentDetailResponse\n status: 200\n}\n\nexport type getCollectionsSlugContentsContentSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getCollectionsSlugContentsContentSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getCollectionsSlugContentsContentSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getCollectionsSlugContentsContentSlugResponseSuccess = (getCollectionsSlugContentsContentSlugResponse200) & {\n headers: Headers;\n};\nexport type getCollectionsSlugContentsContentSlugResponseError = (getCollectionsSlugContentsContentSlugResponse401 | getCollectionsSlugContentsContentSlugResponse404 | getCollectionsSlugContentsContentSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getCollectionsSlugContentsContentSlugResponse = (getCollectionsSlugContentsContentSlugResponseSuccess | getCollectionsSlugContentsContentSlugResponseError)\n\nexport const getGetCollectionsSlugContentsContentSlugUrl = (slug: string,\n contentSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/collections/${slug}/contents/${contentSlug}`\n}\n\nexport const getCollectionsSlugContentsContentSlug = async (slug: string,\n contentSlug: string, options?: RequestInit): Promise<getCollectionsSlugContentsContentSlugResponse> => {\n \n const res = await fetch(getGetCollectionsSlugContentsContentSlugUrl(slug,contentSlug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getCollectionsSlugContentsContentSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getCollectionsSlugContentsContentSlugResponse\n}\n\n\n\n/**\n * @summary データタイプのエントリ一覧を取得\n */\nexport type getDataTypeSlugResponse200 = {\n data: DataListResponse\n status: 200\n}\n\nexport type getDataTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getDataTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getDataTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getDataTypeSlugResponseSuccess = (getDataTypeSlugResponse200) & {\n headers: Headers;\n};\nexport type getDataTypeSlugResponseError = (getDataTypeSlugResponse401 | getDataTypeSlugResponse404 | getDataTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getDataTypeSlugResponse = (getDataTypeSlugResponseSuccess | getDataTypeSlugResponseError)\n\nexport const getGetDataTypeSlugUrl = (typeSlug: string,\n params?: GetDataTypeSlugParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/data/${typeSlug}?${stringifiedParams}` : `/api/v1/sdk/data/${typeSlug}`\n}\n\nexport const getDataTypeSlug = async (typeSlug: string,\n params?: GetDataTypeSlugParams, options?: RequestInit): Promise<getDataTypeSlugResponse> => {\n \n const res = await fetch(getGetDataTypeSlugUrl(typeSlug,params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getDataTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getDataTypeSlugResponse\n}\n\n\n\n/**\n * @summary データエントリの詳細を取得\n */\nexport type getDataTypeSlugIdResponse200 = {\n data: DataEntryDetailResponse\n status: 200\n}\n\nexport type getDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getDataTypeSlugIdResponseSuccess = (getDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type getDataTypeSlugIdResponseError = (getDataTypeSlugIdResponse401 | getDataTypeSlugIdResponse404 | getDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type getDataTypeSlugIdResponse = (getDataTypeSlugIdResponseSuccess | getDataTypeSlugIdResponseError)\n\nexport const getGetDataTypeSlugIdUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/data/${typeSlug}/${id}`\n}\n\nexport const getDataTypeSlugId = async (typeSlug: string,\n id: string, options?: RequestInit): Promise<getDataTypeSlugIdResponse> => {\n \n const res = await fetch(getGetDataTypeSlugIdUrl(typeSlug,id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary プレビュートークンで記事を取得(認証不要)\n */\nexport type getPreviewTokenResponse200 = {\n data: GetPreviewToken200\n status: 200\n}\n\nexport type getPreviewTokenResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getPreviewTokenResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getPreviewTokenResponseSuccess = (getPreviewTokenResponse200) & {\n headers: Headers;\n};\nexport type getPreviewTokenResponseError = (getPreviewTokenResponse404 | getPreviewTokenResponse500) & {\n headers: Headers;\n};\n\nexport type getPreviewTokenResponse = (getPreviewTokenResponseSuccess | getPreviewTokenResponseError)\n\nexport const getGetPreviewTokenUrl = (token: string,) => {\n\n\n \n\n return `/api/v1/sdk/preview/${token}`\n}\n\nexport const getPreviewToken = async (token: string, options?: RequestInit): Promise<getPreviewTokenResponse> => {\n \n const res = await fetch(getGetPreviewTokenUrl(token),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getPreviewTokenResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getPreviewTokenResponse\n}\n\n\n\n/**\n * @summary ワークスペースのスキーマ情報を取得(データタイプ・コレクション)\n */\nexport type getSchemaResponse200 = {\n data: SchemaResponse\n status: 200\n}\n\nexport type getSchemaResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getSchemaResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getSchemaResponseSuccess = (getSchemaResponse200) & {\n headers: Headers;\n};\nexport type getSchemaResponseError = (getSchemaResponse401 | getSchemaResponse500) & {\n headers: Headers;\n};\n\nexport type getSchemaResponse = (getSchemaResponseSuccess | getSchemaResponseError)\n\nexport const getGetSchemaUrl = () => {\n\n\n \n\n return `/api/v1/sdk/schema`\n}\n\nexport const getSchema = async ( options?: RequestInit): Promise<getSchemaResponse> => {\n \n const res = await fetch(getGetSchemaUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getSchemaResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getSchemaResponse\n}\n\n\n\n/**\n * enabledが有効なフォーム定義にデータを送信します。送信データはpendingステータスで保存されます。\n * @summary 公開フォームからデータを送信\n */\nexport type postSubmissionsTypeSlugResponse200 = {\n data: PublicSubmissionResponse\n status: 200\n}\n\nexport type postSubmissionsTypeSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postSubmissionsTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postSubmissionsTypeSlugResponse403 = {\n data: ErrorResponse\n status: 403\n}\n\nexport type postSubmissionsTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postSubmissionsTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postSubmissionsTypeSlugResponseSuccess = (postSubmissionsTypeSlugResponse200) & {\n headers: Headers;\n};\nexport type postSubmissionsTypeSlugResponseError = (postSubmissionsTypeSlugResponse400 | postSubmissionsTypeSlugResponse401 | postSubmissionsTypeSlugResponse403 | postSubmissionsTypeSlugResponse404 | postSubmissionsTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type postSubmissionsTypeSlugResponse = (postSubmissionsTypeSlugResponseSuccess | postSubmissionsTypeSlugResponseError)\n\nexport const getPostSubmissionsTypeSlugUrl = (typeSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/submissions/${typeSlug}`\n}\n\nexport const postSubmissionsTypeSlug = async (typeSlug: string,\n publicSubmissionRequest: PublicSubmissionRequest, options?: RequestInit): Promise<postSubmissionsTypeSlugResponse> => {\n \n const res = await fetch(getPostSubmissionsTypeSlugUrl(typeSlug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n publicSubmissionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postSubmissionsTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postSubmissionsTypeSlugResponse\n}\n\n\n\n/**\n * @summary コレクション一覧を取得\n */\nexport type getManageCollectionsResponse200 = {\n data: CollectionListResponse\n status: 200\n}\n\nexport type getManageCollectionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageCollectionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageCollectionsResponseSuccess = (getManageCollectionsResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionsResponseError = (getManageCollectionsResponse401 | getManageCollectionsResponse500) & {\n headers: Headers;\n};\n\nexport type getManageCollectionsResponse = (getManageCollectionsResponseSuccess | getManageCollectionsResponseError)\n\nexport const getGetManageCollectionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/collections`\n}\n\nexport const getManageCollections = async ( options?: RequestInit): Promise<getManageCollectionsResponse> => {\n \n const res = await fetch(getGetManageCollectionsUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionsResponse\n}\n\n\n\n/**\n * @summary コレクションを作成\n */\nexport type postManageCollectionsResponse201 = {\n data: CollectionResponse\n status: 201\n}\n\nexport type postManageCollectionsResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageCollectionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageCollectionsResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageCollectionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageCollectionsResponseSuccess = (postManageCollectionsResponse201) & {\n headers: Headers;\n};\nexport type postManageCollectionsResponseError = (postManageCollectionsResponse400 | postManageCollectionsResponse401 | postManageCollectionsResponse409 | postManageCollectionsResponse500) & {\n headers: Headers;\n};\n\nexport type postManageCollectionsResponse = (postManageCollectionsResponseSuccess | postManageCollectionsResponseError)\n\nexport const getPostManageCollectionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/collections`\n}\n\nexport const postManageCollections = async (createCollectionRequest: CreateCollectionRequest, options?: RequestInit): Promise<postManageCollectionsResponse> => {\n \n const res = await fetch(getPostManageCollectionsUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createCollectionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageCollectionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageCollectionsResponse\n}\n\n\n\n/**\n * @summary コレクションを取得\n */\nexport type getManageCollectionsSlugResponse200 = {\n data: CollectionResponse\n status: 200\n}\n\nexport type getManageCollectionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageCollectionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageCollectionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageCollectionsSlugResponseSuccess = (getManageCollectionsSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionsSlugResponseError = (getManageCollectionsSlugResponse401 | getManageCollectionsSlugResponse404 | getManageCollectionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageCollectionsSlugResponse = (getManageCollectionsSlugResponseSuccess | getManageCollectionsSlugResponseError)\n\nexport const getGetManageCollectionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}`\n}\n\nexport const getManageCollectionsSlug = async (slug: string, options?: RequestInit): Promise<getManageCollectionsSlugResponse> => {\n \n const res = await fetch(getGetManageCollectionsSlugUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionsSlugResponse\n}\n\n\n\n/**\n * @summary コレクションを更新\n */\nexport type putManageCollectionsSlugResponse200 = {\n data: CollectionResponse\n status: 200\n}\n\nexport type putManageCollectionsSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageCollectionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageCollectionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageCollectionsSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type putManageCollectionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageCollectionsSlugResponseSuccess = (putManageCollectionsSlugResponse200) & {\n headers: Headers;\n};\nexport type putManageCollectionsSlugResponseError = (putManageCollectionsSlugResponse400 | putManageCollectionsSlugResponse401 | putManageCollectionsSlugResponse404 | putManageCollectionsSlugResponse409 | putManageCollectionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type putManageCollectionsSlugResponse = (putManageCollectionsSlugResponseSuccess | putManageCollectionsSlugResponseError)\n\nexport const getPutManageCollectionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}`\n}\n\nexport const putManageCollectionsSlug = async (slug: string,\n updateCollectionRequest: UpdateCollectionRequest, options?: RequestInit): Promise<putManageCollectionsSlugResponse> => {\n \n const res = await fetch(getPutManageCollectionsSlugUrl(slug),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n updateCollectionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageCollectionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageCollectionsSlugResponse\n}\n\n\n\n/**\n * @summary コレクションを削除\n */\nexport type deleteManageCollectionsSlugResponse200 = {\n data: SdkDeleteCollectionResponse\n status: 200\n}\n\nexport type deleteManageCollectionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageCollectionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageCollectionsSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type deleteManageCollectionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageCollectionsSlugResponseSuccess = (deleteManageCollectionsSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageCollectionsSlugResponseError = (deleteManageCollectionsSlugResponse401 | deleteManageCollectionsSlugResponse404 | deleteManageCollectionsSlugResponse409 | deleteManageCollectionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageCollectionsSlugResponse = (deleteManageCollectionsSlugResponseSuccess | deleteManageCollectionsSlugResponseError)\n\nexport const getDeleteManageCollectionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}`\n}\n\nexport const deleteManageCollectionsSlug = async (slug: string, options?: RequestInit): Promise<deleteManageCollectionsSlugResponse> => {\n \n const res = await fetch(getDeleteManageCollectionsSlugUrl(slug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageCollectionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageCollectionsSlugResponse\n}\n\n\n\n/**\n * @summary データタイプ一覧を取得\n */\nexport type getManageDataTypesResponse200 = {\n data: DataTypeResponse[]\n status: 200\n}\n\nexport type getManageDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypesResponseSuccess = (getManageDataTypesResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypesResponseError = (getManageDataTypesResponse401 | getManageDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypesResponse = (getManageDataTypesResponseSuccess | getManageDataTypesResponseError)\n\nexport const getGetManageDataTypesUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types`\n}\n\nexport const getManageDataTypes = async ( options?: RequestInit): Promise<getManageDataTypesResponse> => {\n \n const res = await fetch(getGetManageDataTypesUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypesResponse\n}\n\n\n\n/**\n * @summary データタイプを作成\n */\nexport type postManageDataTypesResponse201 = {\n data: DataTypeResponse\n status: 201\n}\n\nexport type postManageDataTypesResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageDataTypesResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageDataTypesResponseSuccess = (postManageDataTypesResponse201) & {\n headers: Headers;\n};\nexport type postManageDataTypesResponseError = (postManageDataTypesResponse400 | postManageDataTypesResponse401 | postManageDataTypesResponse409 | postManageDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type postManageDataTypesResponse = (postManageDataTypesResponseSuccess | postManageDataTypesResponseError)\n\nexport const getPostManageDataTypesUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types`\n}\n\nexport const postManageDataTypes = async (createDataTypeRequest: CreateDataTypeRequest, options?: RequestInit): Promise<postManageDataTypesResponse> => {\n \n const res = await fetch(getPostManageDataTypesUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageDataTypesResponse\n}\n\n\n\n/**\n * @summary データタイプを取得\n */\nexport type getManageDataTypesSlugResponse200 = {\n data: DataTypeResponse\n status: 200\n}\n\nexport type getManageDataTypesSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypesSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypesSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypesSlugResponseSuccess = (getManageDataTypesSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypesSlugResponseError = (getManageDataTypesSlugResponse401 | getManageDataTypesSlugResponse404 | getManageDataTypesSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypesSlugResponse = (getManageDataTypesSlugResponseSuccess | getManageDataTypesSlugResponseError)\n\nexport const getGetManageDataTypesSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types/${slug}`\n}\n\nexport const getManageDataTypesSlug = async (slug: string, options?: RequestInit): Promise<getManageDataTypesSlugResponse> => {\n \n const res = await fetch(getGetManageDataTypesSlugUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypesSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypesSlugResponse\n}\n\n\n\n/**\n * @summary データタイプを更新\n */\nexport type putManageDataTypesSlugResponse200 = {\n data: DataTypeResponse\n status: 200\n}\n\nexport type putManageDataTypesSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageDataTypesSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageDataTypesSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageDataTypesSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type putManageDataTypesSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageDataTypesSlugResponseSuccess = (putManageDataTypesSlugResponse200) & {\n headers: Headers;\n};\nexport type putManageDataTypesSlugResponseError = (putManageDataTypesSlugResponse400 | putManageDataTypesSlugResponse401 | putManageDataTypesSlugResponse404 | putManageDataTypesSlugResponse409 | putManageDataTypesSlugResponse500) & {\n headers: Headers;\n};\n\nexport type putManageDataTypesSlugResponse = (putManageDataTypesSlugResponseSuccess | putManageDataTypesSlugResponseError)\n\nexport const getPutManageDataTypesSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types/${slug}`\n}\n\nexport const putManageDataTypesSlug = async (slug: string,\n updateDataTypeRequest: UpdateDataTypeRequest, options?: RequestInit): Promise<putManageDataTypesSlugResponse> => {\n \n const res = await fetch(getPutManageDataTypesSlugUrl(slug),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n updateDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageDataTypesSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageDataTypesSlugResponse\n}\n\n\n\n/**\n * @summary データタイプを削除\n */\nexport type deleteManageDataTypesSlugResponse200 = {\n data: SdkDeleteDataTypeResponse\n status: 200\n}\n\nexport type deleteManageDataTypesSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageDataTypesSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageDataTypesSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type deleteManageDataTypesSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageDataTypesSlugResponseSuccess = (deleteManageDataTypesSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageDataTypesSlugResponseError = (deleteManageDataTypesSlugResponse401 | deleteManageDataTypesSlugResponse404 | deleteManageDataTypesSlugResponse409 | deleteManageDataTypesSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageDataTypesSlugResponse = (deleteManageDataTypesSlugResponseSuccess | deleteManageDataTypesSlugResponseError)\n\nexport const getDeleteManageDataTypesSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data-types/${slug}`\n}\n\nexport const deleteManageDataTypesSlug = async (slug: string, options?: RequestInit): Promise<deleteManageDataTypesSlugResponse> => {\n \n const res = await fetch(getDeleteManageDataTypesSlugUrl(slug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageDataTypesSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageDataTypesSlugResponse\n}\n\n\n\n/**\n * @summary データエントリ一覧を取得\n */\nexport type getManageDataTypeSlugResponse200 = {\n data: SdkDataEntriesListResponse\n status: 200\n}\n\nexport type getManageDataTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypeSlugResponseSuccess = (getManageDataTypeSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypeSlugResponseError = (getManageDataTypeSlugResponse401 | getManageDataTypeSlugResponse404 | getManageDataTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypeSlugResponse = (getManageDataTypeSlugResponseSuccess | getManageDataTypeSlugResponseError)\n\nexport const getGetManageDataTypeSlugUrl = (typeSlug: string,\n params?: GetManageDataTypeSlugParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}`\n}\n\nexport const getManageDataTypeSlug = async (typeSlug: string,\n params?: GetManageDataTypeSlugParams, options?: RequestInit): Promise<getManageDataTypeSlugResponse> => {\n \n const res = await fetch(getGetManageDataTypeSlugUrl(typeSlug,params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypeSlugResponse\n}\n\n\n\n/**\n * @summary データエントリを作成\n */\nexport type postManageDataTypeSlugResponse201 = {\n data: SdkDataEntryResponse\n status: 201\n}\n\nexport type postManageDataTypeSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageDataTypeSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageDataTypeSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageDataTypeSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageDataTypeSlugResponseSuccess = (postManageDataTypeSlugResponse201) & {\n headers: Headers;\n};\nexport type postManageDataTypeSlugResponseError = (postManageDataTypeSlugResponse400 | postManageDataTypeSlugResponse401 | postManageDataTypeSlugResponse404 | postManageDataTypeSlugResponse500) & {\n headers: Headers;\n};\n\nexport type postManageDataTypeSlugResponse = (postManageDataTypeSlugResponseSuccess | postManageDataTypeSlugResponseError)\n\nexport const getPostManageDataTypeSlugUrl = (typeSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}`\n}\n\nexport const postManageDataTypeSlug = async (typeSlug: string,\n sdkCreateEntryRequest: SdkCreateEntryRequest, options?: RequestInit): Promise<postManageDataTypeSlugResponse> => {\n \n const res = await fetch(getPostManageDataTypeSlugUrl(typeSlug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkCreateEntryRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageDataTypeSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageDataTypeSlugResponse\n}\n\n\n\n/**\n * @summary データエントリを取得\n */\nexport type getManageDataTypeSlugIdResponse200 = {\n data: SdkDataEntryDetailResponse\n status: 200\n}\n\nexport type getManageDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypeSlugIdResponseSuccess = (getManageDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypeSlugIdResponseError = (getManageDataTypeSlugIdResponse401 | getManageDataTypeSlugIdResponse404 | getManageDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypeSlugIdResponse = (getManageDataTypeSlugIdResponseSuccess | getManageDataTypeSlugIdResponseError)\n\nexport const getGetManageDataTypeSlugIdUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}/${id}`\n}\n\nexport const getManageDataTypeSlugId = async (typeSlug: string,\n id: string, options?: RequestInit): Promise<getManageDataTypeSlugIdResponse> => {\n \n const res = await fetch(getGetManageDataTypeSlugIdUrl(typeSlug,id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary データエントリを更新\n */\nexport type patchManageDataTypeSlugIdResponse200 = {\n data: SdkDataEntryResponse\n status: 200\n}\n\nexport type patchManageDataTypeSlugIdResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type patchManageDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type patchManageDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type patchManageDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type patchManageDataTypeSlugIdResponseSuccess = (patchManageDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type patchManageDataTypeSlugIdResponseError = (patchManageDataTypeSlugIdResponse400 | patchManageDataTypeSlugIdResponse401 | patchManageDataTypeSlugIdResponse404 | patchManageDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type patchManageDataTypeSlugIdResponse = (patchManageDataTypeSlugIdResponseSuccess | patchManageDataTypeSlugIdResponseError)\n\nexport const getPatchManageDataTypeSlugIdUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}/${id}`\n}\n\nexport const patchManageDataTypeSlugId = async (typeSlug: string,\n id: string,\n sdkUpdateEntryRequest: SdkUpdateEntryRequest, options?: RequestInit): Promise<patchManageDataTypeSlugIdResponse> => {\n \n const res = await fetch(getPatchManageDataTypeSlugIdUrl(typeSlug,id),\n { \n ...options,\n method: 'PATCH',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkUpdateEntryRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: patchManageDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as patchManageDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary データエントリを削除\n */\nexport type deleteManageDataTypeSlugIdResponse200 = {\n data: SdkDeleteDataEntryResponse\n status: 200\n}\n\nexport type deleteManageDataTypeSlugIdResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type deleteManageDataTypeSlugIdResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageDataTypeSlugIdResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageDataTypeSlugIdResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageDataTypeSlugIdResponseSuccess = (deleteManageDataTypeSlugIdResponse200) & {\n headers: Headers;\n};\nexport type deleteManageDataTypeSlugIdResponseError = (deleteManageDataTypeSlugIdResponse400 | deleteManageDataTypeSlugIdResponse401 | deleteManageDataTypeSlugIdResponse404 | deleteManageDataTypeSlugIdResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageDataTypeSlugIdResponse = (deleteManageDataTypeSlugIdResponseSuccess | deleteManageDataTypeSlugIdResponseError)\n\nexport const getDeleteManageDataTypeSlugIdUrl = (typeSlug: string,\n id: string,\n params?: DeleteManageDataTypeSlugIdParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/data/${typeSlug}/${id}?${stringifiedParams}` : `/api/v1/sdk/manage/data/${typeSlug}/${id}`\n}\n\nexport const deleteManageDataTypeSlugId = async (typeSlug: string,\n id: string,\n params?: DeleteManageDataTypeSlugIdParams, options?: RequestInit): Promise<deleteManageDataTypeSlugIdResponse> => {\n \n const res = await fetch(getDeleteManageDataTypeSlugIdUrl(typeSlug,id,params),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageDataTypeSlugIdResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageDataTypeSlugIdResponse\n}\n\n\n\n/**\n * @summary データエントリ削除時の影響を取得\n */\nexport type getManageDataTypeSlugIdDeletionImpactResponse200 = {\n data: SdkDataEntryDeletionImpactResponse\n status: 200\n}\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageDataTypeSlugIdDeletionImpactResponseSuccess = (getManageDataTypeSlugIdDeletionImpactResponse200) & {\n headers: Headers;\n};\nexport type getManageDataTypeSlugIdDeletionImpactResponseError = (getManageDataTypeSlugIdDeletionImpactResponse401 | getManageDataTypeSlugIdDeletionImpactResponse404 | getManageDataTypeSlugIdDeletionImpactResponse500) & {\n headers: Headers;\n};\n\nexport type getManageDataTypeSlugIdDeletionImpactResponse = (getManageDataTypeSlugIdDeletionImpactResponseSuccess | getManageDataTypeSlugIdDeletionImpactResponseError)\n\nexport const getGetManageDataTypeSlugIdDeletionImpactUrl = (typeSlug: string,\n id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/data/${typeSlug}/${id}/deletion-impact`\n}\n\nexport const getManageDataTypeSlugIdDeletionImpact = async (typeSlug: string,\n id: string, options?: RequestInit): Promise<getManageDataTypeSlugIdDeletionImpactResponse> => {\n \n const res = await fetch(getGetManageDataTypeSlugIdDeletionImpactUrl(typeSlug,id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageDataTypeSlugIdDeletionImpactResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageDataTypeSlugIdDeletionImpactResponse\n}\n\n\n\n/**\n * @summary カスタムコンポーネント一覧を取得\n */\nexport type getManageComponentsResponse200 = {\n data: SdkCustomComponentsListResponse\n status: 200\n}\n\nexport type getManageComponentsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageComponentsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageComponentsResponseSuccess = (getManageComponentsResponse200) & {\n headers: Headers;\n};\nexport type getManageComponentsResponseError = (getManageComponentsResponse401 | getManageComponentsResponse500) & {\n headers: Headers;\n};\n\nexport type getManageComponentsResponse = (getManageComponentsResponseSuccess | getManageComponentsResponseError)\n\nexport const getGetManageComponentsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/components`\n}\n\nexport const getManageComponents = async ( options?: RequestInit): Promise<getManageComponentsResponse> => {\n \n const res = await fetch(getGetManageComponentsUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageComponentsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageComponentsResponse\n}\n\n\n\n/**\n * カスタムコンポーネント定義を同期します。既存のコンポーネントは更新され、新しいコンポーネントは作成されます。\n * @summary カスタムコンポーネントを同期\n */\nexport type postManageComponentsSyncResponse200 = {\n data: SdkComponentSuccessResponse\n status: 200\n}\n\nexport type postManageComponentsSyncResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageComponentsSyncResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageComponentsSyncResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageComponentsSyncResponseSuccess = (postManageComponentsSyncResponse200) & {\n headers: Headers;\n};\nexport type postManageComponentsSyncResponseError = (postManageComponentsSyncResponse400 | postManageComponentsSyncResponse401 | postManageComponentsSyncResponse500) & {\n headers: Headers;\n};\n\nexport type postManageComponentsSyncResponse = (postManageComponentsSyncResponseSuccess | postManageComponentsSyncResponseError)\n\nexport const getPostManageComponentsSyncUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/components/sync`\n}\n\nexport const postManageComponentsSync = async (sdkComponentSyncRequest: SdkComponentSyncRequest, options?: RequestInit): Promise<postManageComponentsSyncResponse> => {\n \n const res = await fetch(getPostManageComponentsSyncUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkComponentSyncRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageComponentsSyncResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageComponentsSyncResponse\n}\n\n\n\n/**\n * @summary フォーム定義一覧を取得\n */\nexport type getManageFormDefinitionsResponse200 = {\n data: FormDefinitionResponse[]\n status: 200\n}\n\nexport type getManageFormDefinitionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageFormDefinitionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageFormDefinitionsResponseSuccess = (getManageFormDefinitionsResponse200) & {\n headers: Headers;\n};\nexport type getManageFormDefinitionsResponseError = (getManageFormDefinitionsResponse401 | getManageFormDefinitionsResponse500) & {\n headers: Headers;\n};\n\nexport type getManageFormDefinitionsResponse = (getManageFormDefinitionsResponseSuccess | getManageFormDefinitionsResponseError)\n\nexport const getGetManageFormDefinitionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions`\n}\n\nexport const getManageFormDefinitions = async ( options?: RequestInit): Promise<getManageFormDefinitionsResponse> => {\n \n const res = await fetch(getGetManageFormDefinitionsUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageFormDefinitionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageFormDefinitionsResponse\n}\n\n\n\n/**\n * @summary フォーム定義を作成\n */\nexport type postManageFormDefinitionsResponse201 = {\n data: FormDefinitionResponse\n status: 201\n}\n\nexport type postManageFormDefinitionsResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageFormDefinitionsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageFormDefinitionsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageFormDefinitionsResponseSuccess = (postManageFormDefinitionsResponse201) & {\n headers: Headers;\n};\nexport type postManageFormDefinitionsResponseError = (postManageFormDefinitionsResponse400 | postManageFormDefinitionsResponse401 | postManageFormDefinitionsResponse500) & {\n headers: Headers;\n};\n\nexport type postManageFormDefinitionsResponse = (postManageFormDefinitionsResponseSuccess | postManageFormDefinitionsResponseError)\n\nexport const getPostManageFormDefinitionsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions`\n}\n\nexport const postManageFormDefinitions = async (createFormDefinitionRequest: CreateFormDefinitionRequest, options?: RequestInit): Promise<postManageFormDefinitionsResponse> => {\n \n const res = await fetch(getPostManageFormDefinitionsUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createFormDefinitionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageFormDefinitionsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageFormDefinitionsResponse\n}\n\n\n\n/**\n * @summary フォーム定義を取得\n */\nexport type getManageFormDefinitionsSlugResponse200 = {\n data: FormDefinitionResponse\n status: 200\n}\n\nexport type getManageFormDefinitionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageFormDefinitionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageFormDefinitionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageFormDefinitionsSlugResponseSuccess = (getManageFormDefinitionsSlugResponse200) & {\n headers: Headers;\n};\nexport type getManageFormDefinitionsSlugResponseError = (getManageFormDefinitionsSlugResponse401 | getManageFormDefinitionsSlugResponse404 | getManageFormDefinitionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type getManageFormDefinitionsSlugResponse = (getManageFormDefinitionsSlugResponseSuccess | getManageFormDefinitionsSlugResponseError)\n\nexport const getGetManageFormDefinitionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions/${slug}`\n}\n\nexport const getManageFormDefinitionsSlug = async (slug: string, options?: RequestInit): Promise<getManageFormDefinitionsSlugResponse> => {\n \n const res = await fetch(getGetManageFormDefinitionsSlugUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageFormDefinitionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageFormDefinitionsSlugResponse\n}\n\n\n\n/**\n * @summary フォーム定義を更新\n */\nexport type putManageFormDefinitionsSlugResponse200 = {\n data: FormDefinitionResponse\n status: 200\n}\n\nexport type putManageFormDefinitionsSlugResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageFormDefinitionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageFormDefinitionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageFormDefinitionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageFormDefinitionsSlugResponseSuccess = (putManageFormDefinitionsSlugResponse200) & {\n headers: Headers;\n};\nexport type putManageFormDefinitionsSlugResponseError = (putManageFormDefinitionsSlugResponse400 | putManageFormDefinitionsSlugResponse401 | putManageFormDefinitionsSlugResponse404 | putManageFormDefinitionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type putManageFormDefinitionsSlugResponse = (putManageFormDefinitionsSlugResponseSuccess | putManageFormDefinitionsSlugResponseError)\n\nexport const getPutManageFormDefinitionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions/${slug}`\n}\n\nexport const putManageFormDefinitionsSlug = async (slug: string,\n updateFormDefinitionRequest: UpdateFormDefinitionRequest, options?: RequestInit): Promise<putManageFormDefinitionsSlugResponse> => {\n \n const res = await fetch(getPutManageFormDefinitionsSlugUrl(slug),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n updateFormDefinitionRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageFormDefinitionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageFormDefinitionsSlugResponse\n}\n\n\n\n/**\n * @summary フォーム定義を削除\n */\nexport type deleteManageFormDefinitionsSlugResponse200 = {\n data: SdkDeleteFormDefinitionResponse\n status: 200\n}\n\nexport type deleteManageFormDefinitionsSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageFormDefinitionsSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageFormDefinitionsSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageFormDefinitionsSlugResponseSuccess = (deleteManageFormDefinitionsSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageFormDefinitionsSlugResponseError = (deleteManageFormDefinitionsSlugResponse401 | deleteManageFormDefinitionsSlugResponse404 | deleteManageFormDefinitionsSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageFormDefinitionsSlugResponse = (deleteManageFormDefinitionsSlugResponseSuccess | deleteManageFormDefinitionsSlugResponseError)\n\nexport const getDeleteManageFormDefinitionsSlugUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/form-definitions/${slug}`\n}\n\nexport const deleteManageFormDefinitionsSlug = async (slug: string, options?: RequestInit): Promise<deleteManageFormDefinitionsSlugResponse> => {\n \n const res = await fetch(getDeleteManageFormDefinitionsSlugUrl(slug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageFormDefinitionsSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageFormDefinitionsSlugResponse\n}\n\n\n\n/**\n * @summary コレクションのデータタイプ一覧を取得\n */\nexport type getManageCollectionsSlugDataTypesResponse200 = {\n data: SdkCollectionDataTypeResponse[]\n status: 200\n}\n\nexport type getManageCollectionsSlugDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageCollectionsSlugDataTypesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageCollectionsSlugDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageCollectionsSlugDataTypesResponseSuccess = (getManageCollectionsSlugDataTypesResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionsSlugDataTypesResponseError = (getManageCollectionsSlugDataTypesResponse401 | getManageCollectionsSlugDataTypesResponse404 | getManageCollectionsSlugDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type getManageCollectionsSlugDataTypesResponse = (getManageCollectionsSlugDataTypesResponseSuccess | getManageCollectionsSlugDataTypesResponseError)\n\nexport const getGetManageCollectionsSlugDataTypesUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types`\n}\n\nexport const getManageCollectionsSlugDataTypes = async (slug: string, options?: RequestInit): Promise<getManageCollectionsSlugDataTypesResponse> => {\n \n const res = await fetch(getGetManageCollectionsSlugDataTypesUrl(slug),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionsSlugDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionsSlugDataTypesResponse\n}\n\n\n\n/**\n * @summary コレクションにデータタイプを追加\n */\nexport type postManageCollectionsSlugDataTypesResponse201 = {\n data: DataTypeResponse\n status: 201\n}\n\nexport type postManageCollectionsSlugDataTypesResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageCollectionsSlugDataTypesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageCollectionsSlugDataTypesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageCollectionsSlugDataTypesResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageCollectionsSlugDataTypesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageCollectionsSlugDataTypesResponseSuccess = (postManageCollectionsSlugDataTypesResponse201) & {\n headers: Headers;\n};\nexport type postManageCollectionsSlugDataTypesResponseError = (postManageCollectionsSlugDataTypesResponse400 | postManageCollectionsSlugDataTypesResponse401 | postManageCollectionsSlugDataTypesResponse404 | postManageCollectionsSlugDataTypesResponse409 | postManageCollectionsSlugDataTypesResponse500) & {\n headers: Headers;\n};\n\nexport type postManageCollectionsSlugDataTypesResponse = (postManageCollectionsSlugDataTypesResponseSuccess | postManageCollectionsSlugDataTypesResponseError)\n\nexport const getPostManageCollectionsSlugDataTypesUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types`\n}\n\nexport const postManageCollectionsSlugDataTypes = async (slug: string,\n sdkAddCollectionDataTypeRequest: SdkAddCollectionDataTypeRequest, options?: RequestInit): Promise<postManageCollectionsSlugDataTypesResponse> => {\n \n const res = await fetch(getPostManageCollectionsSlugDataTypesUrl(slug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkAddCollectionDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageCollectionsSlugDataTypesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageCollectionsSlugDataTypesResponse\n}\n\n\n\n/**\n * @summary コレクションからデータタイプを削除\n */\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse200 = {\n data: SdkDeleteCollectionDataTypeResponse\n status: 200\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type deleteManageCollectionsSlugDataTypesDtSlugResponseSuccess = (deleteManageCollectionsSlugDataTypesDtSlugResponse200) & {\n headers: Headers;\n};\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponseError = (deleteManageCollectionsSlugDataTypesDtSlugResponse401 | deleteManageCollectionsSlugDataTypesDtSlugResponse404 | deleteManageCollectionsSlugDataTypesDtSlugResponse409 | deleteManageCollectionsSlugDataTypesDtSlugResponse500) & {\n headers: Headers;\n};\n\nexport type deleteManageCollectionsSlugDataTypesDtSlugResponse = (deleteManageCollectionsSlugDataTypesDtSlugResponseSuccess | deleteManageCollectionsSlugDataTypesDtSlugResponseError)\n\nexport const getDeleteManageCollectionsSlugDataTypesDtSlugUrl = (slug: string,\n dtSlug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types/${dtSlug}`\n}\n\nexport const deleteManageCollectionsSlugDataTypesDtSlug = async (slug: string,\n dtSlug: string, options?: RequestInit): Promise<deleteManageCollectionsSlugDataTypesDtSlugResponse> => {\n \n const res = await fetch(getDeleteManageCollectionsSlugDataTypesDtSlugUrl(slug,dtSlug),\n { \n ...options,\n method: 'DELETE'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: deleteManageCollectionsSlugDataTypesDtSlugResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as deleteManageCollectionsSlugDataTypesDtSlugResponse\n}\n\n\n\n/**\n * @summary 既存のデータタイプをコレクションにリンク\n */\nexport type postManageCollectionsSlugDataTypesLinkResponse201 = {\n data: ReferenceField\n status: 201\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageCollectionsSlugDataTypesLinkResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageCollectionsSlugDataTypesLinkResponseSuccess = (postManageCollectionsSlugDataTypesLinkResponse201) & {\n headers: Headers;\n};\nexport type postManageCollectionsSlugDataTypesLinkResponseError = (postManageCollectionsSlugDataTypesLinkResponse400 | postManageCollectionsSlugDataTypesLinkResponse401 | postManageCollectionsSlugDataTypesLinkResponse404 | postManageCollectionsSlugDataTypesLinkResponse409 | postManageCollectionsSlugDataTypesLinkResponse500) & {\n headers: Headers;\n};\n\nexport type postManageCollectionsSlugDataTypesLinkResponse = (postManageCollectionsSlugDataTypesLinkResponseSuccess | postManageCollectionsSlugDataTypesLinkResponseError)\n\nexport const getPostManageCollectionsSlugDataTypesLinkUrl = (slug: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/collections/${slug}/data-types/link`\n}\n\nexport const postManageCollectionsSlugDataTypesLink = async (slug: string,\n sdkLinkExistingDataTypeRequest: SdkLinkExistingDataTypeRequest, options?: RequestInit): Promise<postManageCollectionsSlugDataTypesLinkResponse> => {\n \n const res = await fetch(getPostManageCollectionsSlugDataTypesLinkUrl(slug),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkLinkExistingDataTypeRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageCollectionsSlugDataTypesLinkResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageCollectionsSlugDataTypesLinkResponse\n}\n\n\n\n/**\n * @summary コレクションプリセット一覧を取得\n */\nexport type getManageCollectionPresetsResponse200 = {\n data: GetManageCollectionPresets200\n status: 200\n}\n\nexport type getManageCollectionPresetsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n \nexport type getManageCollectionPresetsResponseSuccess = (getManageCollectionPresetsResponse200) & {\n headers: Headers;\n};\nexport type getManageCollectionPresetsResponseError = (getManageCollectionPresetsResponse401) & {\n headers: Headers;\n};\n\nexport type getManageCollectionPresetsResponse = (getManageCollectionPresetsResponseSuccess | getManageCollectionPresetsResponseError)\n\nexport const getGetManageCollectionPresetsUrl = (params?: GetManageCollectionPresetsParams,) => {\n const normalizedParams = new URLSearchParams();\n\n Object.entries(params || {}).forEach(([key, value]) => {\n \n if (value !== undefined) {\n normalizedParams.append(key, value === null ? 'null' : value.toString())\n }\n });\n\n const stringifiedParams = normalizedParams.toString();\n\n return stringifiedParams.length > 0 ? `/api/v1/sdk/manage/collection-presets?${stringifiedParams}` : `/api/v1/sdk/manage/collection-presets`\n}\n\nexport const getManageCollectionPresets = async (params?: GetManageCollectionPresetsParams, options?: RequestInit): Promise<getManageCollectionPresetsResponse> => {\n \n const res = await fetch(getGetManageCollectionPresetsUrl(params),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageCollectionPresetsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageCollectionPresetsResponse\n}\n\n\n\n/**\n * @summary コンテンツを作成\n */\nexport type postManageContentsResponse201 = {\n data: SdkCreateContentResponse\n status: 201\n}\n\nexport type postManageContentsResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageContentsResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageContentsResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageContentsResponse409 = {\n data: ErrorResponse\n status: 409\n}\n\nexport type postManageContentsResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageContentsResponseSuccess = (postManageContentsResponse201) & {\n headers: Headers;\n};\nexport type postManageContentsResponseError = (postManageContentsResponse400 | postManageContentsResponse401 | postManageContentsResponse404 | postManageContentsResponse409 | postManageContentsResponse500) & {\n headers: Headers;\n};\n\nexport type postManageContentsResponse = (postManageContentsResponseSuccess | postManageContentsResponseError)\n\nexport const getPostManageContentsUrl = () => {\n\n\n \n\n return `/api/v1/sdk/manage/contents`\n}\n\nexport const postManageContents = async (createContentRequest: CreateContentRequest, options?: RequestInit): Promise<postManageContentsResponse> => {\n \n const res = await fetch(getPostManageContentsUrl(),\n { \n ...options,\n method: 'POST',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n createContentRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageContentsResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageContentsResponse\n}\n\n\n\n/**\n * @summary レビューをリクエスト\n */\nexport type postManageContentsIdRequestReviewResponse200 = {\n data: SdkRequestReviewResponse\n status: 200\n}\n\nexport type postManageContentsIdRequestReviewResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageContentsIdRequestReviewResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageContentsIdRequestReviewResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageContentsIdRequestReviewResponseSuccess = (postManageContentsIdRequestReviewResponse200) & {\n headers: Headers;\n};\nexport type postManageContentsIdRequestReviewResponseError = (postManageContentsIdRequestReviewResponse401 | postManageContentsIdRequestReviewResponse404 | postManageContentsIdRequestReviewResponse500) & {\n headers: Headers;\n};\n\nexport type postManageContentsIdRequestReviewResponse = (postManageContentsIdRequestReviewResponseSuccess | postManageContentsIdRequestReviewResponseError)\n\nexport const getPostManageContentsIdRequestReviewUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/request-review`\n}\n\nexport const postManageContentsIdRequestReview = async (id: string, options?: RequestInit): Promise<postManageContentsIdRequestReviewResponse> => {\n \n const res = await fetch(getPostManageContentsIdRequestReviewUrl(id),\n { \n ...options,\n method: 'POST'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageContentsIdRequestReviewResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageContentsIdRequestReviewResponse\n}\n\n\n\n/**\n * @summary コンテンツを公開\n */\nexport type postManageContentsIdPublishResponse200 = {\n data: SdkPublishContentResponse\n status: 200\n}\n\nexport type postManageContentsIdPublishResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type postManageContentsIdPublishResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type postManageContentsIdPublishResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type postManageContentsIdPublishResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type postManageContentsIdPublishResponseSuccess = (postManageContentsIdPublishResponse200) & {\n headers: Headers;\n};\nexport type postManageContentsIdPublishResponseError = (postManageContentsIdPublishResponse400 | postManageContentsIdPublishResponse401 | postManageContentsIdPublishResponse404 | postManageContentsIdPublishResponse500) & {\n headers: Headers;\n};\n\nexport type postManageContentsIdPublishResponse = (postManageContentsIdPublishResponseSuccess | postManageContentsIdPublishResponseError)\n\nexport const getPostManageContentsIdPublishUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/publish`\n}\n\nexport const postManageContentsIdPublish = async (id: string, options?: RequestInit): Promise<postManageContentsIdPublishResponse> => {\n \n const res = await fetch(getPostManageContentsIdPublishUrl(id),\n { \n ...options,\n method: 'POST'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: postManageContentsIdPublishResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as postManageContentsIdPublishResponse\n}\n\n\n\n/**\n * @summary コンテンツの参照を取得\n */\nexport type getManageContentsIdReferencesResponse200 = {\n data: SdkContentReferencesResponse\n status: 200\n}\n\nexport type getManageContentsIdReferencesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getManageContentsIdReferencesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type getManageContentsIdReferencesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getManageContentsIdReferencesResponseSuccess = (getManageContentsIdReferencesResponse200) & {\n headers: Headers;\n};\nexport type getManageContentsIdReferencesResponseError = (getManageContentsIdReferencesResponse401 | getManageContentsIdReferencesResponse404 | getManageContentsIdReferencesResponse500) & {\n headers: Headers;\n};\n\nexport type getManageContentsIdReferencesResponse = (getManageContentsIdReferencesResponseSuccess | getManageContentsIdReferencesResponseError)\n\nexport const getGetManageContentsIdReferencesUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/references`\n}\n\nexport const getManageContentsIdReferences = async (id: string, options?: RequestInit): Promise<getManageContentsIdReferencesResponse> => {\n \n const res = await fetch(getGetManageContentsIdReferencesUrl(id),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getManageContentsIdReferencesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getManageContentsIdReferencesResponse\n}\n\n\n\n/**\n * @summary コンテンツの参照を設定\n */\nexport type putManageContentsIdReferencesResponse200 = {\n data: SdkSetContentReferencesResponse\n status: 200\n}\n\nexport type putManageContentsIdReferencesResponse400 = {\n data: ErrorResponse\n status: 400\n}\n\nexport type putManageContentsIdReferencesResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type putManageContentsIdReferencesResponse404 = {\n data: ErrorResponse\n status: 404\n}\n\nexport type putManageContentsIdReferencesResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type putManageContentsIdReferencesResponseSuccess = (putManageContentsIdReferencesResponse200) & {\n headers: Headers;\n};\nexport type putManageContentsIdReferencesResponseError = (putManageContentsIdReferencesResponse400 | putManageContentsIdReferencesResponse401 | putManageContentsIdReferencesResponse404 | putManageContentsIdReferencesResponse500) & {\n headers: Headers;\n};\n\nexport type putManageContentsIdReferencesResponse = (putManageContentsIdReferencesResponseSuccess | putManageContentsIdReferencesResponseError)\n\nexport const getPutManageContentsIdReferencesUrl = (id: string,) => {\n\n\n \n\n return `/api/v1/sdk/manage/contents/${id}/references`\n}\n\nexport const putManageContentsIdReferences = async (id: string,\n sdkSetContentReferencesRequest: SdkSetContentReferencesRequest, options?: RequestInit): Promise<putManageContentsIdReferencesResponse> => {\n \n const res = await fetch(getPutManageContentsIdReferencesUrl(id),\n { \n ...options,\n method: 'PUT',\n headers: { 'Content-Type': 'application/json', ...options?.headers },\n body: JSON.stringify(\n sdkSetContentReferencesRequest,)\n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: putManageContentsIdReferencesResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as putManageContentsIdReferencesResponse\n}\n\n\n\n/**\n * @summary スターターキットをダウンロード\n */\nexport type getDownloadStarterKitResponse200 = {\n data: Blob\n status: 200\n}\n\nexport type getDownloadStarterKitResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getDownloadStarterKitResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getDownloadStarterKitResponseSuccess = (getDownloadStarterKitResponse200) & {\n headers: Headers;\n};\nexport type getDownloadStarterKitResponseError = (getDownloadStarterKitResponse401 | getDownloadStarterKitResponse500) & {\n headers: Headers;\n};\n\nexport type getDownloadStarterKitResponse = (getDownloadStarterKitResponseSuccess | getDownloadStarterKitResponseError)\n\nexport const getGetDownloadStarterKitUrl = () => {\n\n\n \n\n return `/api/v1/sdk/download/starter-kit`\n}\n\nexport const getDownloadStarterKit = async ( options?: RequestInit): Promise<getDownloadStarterKitResponse> => {\n \n const res = await fetch(getGetDownloadStarterKitUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getDownloadStarterKitResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getDownloadStarterKitResponse\n}\n\n\n\n/**\n * @summary CMX Studio をダウンロード\n */\nexport type getDownloadStudioResponse200 = {\n data: Blob\n status: 200\n}\n\nexport type getDownloadStudioResponse401 = {\n data: ErrorResponse\n status: 401\n}\n\nexport type getDownloadStudioResponse500 = {\n data: ErrorResponse\n status: 500\n}\n \nexport type getDownloadStudioResponseSuccess = (getDownloadStudioResponse200) & {\n headers: Headers;\n};\nexport type getDownloadStudioResponseError = (getDownloadStudioResponse401 | getDownloadStudioResponse500) & {\n headers: Headers;\n};\n\nexport type getDownloadStudioResponse = (getDownloadStudioResponseSuccess | getDownloadStudioResponseError)\n\nexport const getGetDownloadStudioUrl = () => {\n\n\n \n\n return `/api/v1/sdk/download/studio`\n}\n\nexport const getDownloadStudio = async ( options?: RequestInit): Promise<getDownloadStudioResponse> => {\n \n const res = await fetch(getGetDownloadStudioUrl(),\n { \n ...options,\n method: 'GET'\n \n \n }\n)\n\n const body = [204, 205, 304].includes(res.status) ? null : await res.text();\n \n const data: getDownloadStudioResponse['data'] = body ? JSON.parse(body, dateReviver) : {}\n return { data, status: res.status, headers: res.headers } as getDownloadStudioResponse\n}\n\n\n\n","/**\n * CMX SDK — Convenience API functions\n *\n * Human-friendly wrappers around the generated Orval endpoints.\n * These manage cache tags automatically and return typed responses.\n */\n\nimport { sdkFetchWithTags, sdkPostFetcher, getSdkApiBaseUrl } from \"./core/sdk.js\"\nimport { CACHE_TAGS } from \"./core/sdk.js\"\nimport type {\n CollectionContentsResponse,\n CollectionContentDetailResponse,\n DataListResponse,\n DataEntryItem,\n GetPreviewToken200,\n SchemaResponse,\n} from \"./generated/sdk/models/index.js\"\n\n// Re-export the preview response type with a friendlier name\nexport type PreviewResponse = GetPreviewToken200\n\n/**\n * Common fetch options for ISR/caching\n */\nexport interface FetchOptions {\n /** Next.js ISR revalidation interval in seconds. Set to `false` to disable caching. */\n revalidate?: number | false\n}\n\n/**\n * Options for fetching collection contents\n */\nexport interface CollectionContentsOptions extends FetchOptions {\n sortBy?: \"publishedAt\" | \"sortOrder\"\n sortOrder?: \"asc\" | \"desc\"\n limit?: number\n offset?: number\n status?: string // \"published\" (default), \"all\", or comma-separated statuses (e.g., \"draft,review\")\n}\n\n/**\n * Get contents from a collection\n */\nexport async function getCollectionContents(\n slug: string,\n options?: CollectionContentsOptions\n): Promise<CollectionContentsResponse> {\n const params = new URLSearchParams()\n if (options?.sortBy) params.set(\"sortBy\", options.sortBy)\n if (options?.sortOrder) params.set(\"sortOrder\", options.sortOrder)\n if (options?.limit) params.set(\"limit\", String(options.limit))\n if (options?.offset) params.set(\"offset\", String(options.offset))\n if (options?.status) params.set(\"status\", options.status)\n\n const query = params.toString()\n return sdkFetchWithTags<CollectionContentsResponse>(\n `/collections/${encodeURIComponent(slug)}/contents${query ? `?${query}` : \"\"}`,\n [CACHE_TAGS.collections, CACHE_TAGS.collection(slug)],\n options?.revalidate\n )\n}\n\n/**\n * Get a specific content detail with resolved references\n */\nexport async function getCollectionContentDetail(\n collectionSlug: string,\n contentSlug: string,\n options?: FetchOptions\n): Promise<CollectionContentDetailResponse> {\n return sdkFetchWithTags<CollectionContentDetailResponse>(\n `/collections/${encodeURIComponent(collectionSlug)}/contents/${encodeURIComponent(contentSlug)}`,\n [\n CACHE_TAGS.collections,\n CACHE_TAGS.collection(collectionSlug),\n CACHE_TAGS.content(collectionSlug, contentSlug),\n ],\n options?.revalidate\n )\n}\n\n/**\n * Options for fetching data entries\n */\nexport interface DataEntriesOptions extends FetchOptions {\n sortBy?: string\n sortOrder?: string\n limit?: number\n offset?: number\n status?: string // \"published\" (default) or \"all\"\n}\n\n/**\n * Get data entries for a data type\n */\nexport async function getDataEntries(\n typeSlug: string,\n options?: DataEntriesOptions\n): Promise<DataListResponse> {\n const params = new URLSearchParams()\n if (options?.sortBy) params.set(\"sortBy\", options.sortBy)\n if (options?.sortOrder) params.set(\"sortOrder\", options.sortOrder)\n if (options?.limit) params.set(\"limit\", String(options.limit))\n if (options?.offset) params.set(\"offset\", String(options.offset))\n if (options?.status) params.set(\"status\", options.status)\n\n const query = params.toString()\n return sdkFetchWithTags<DataListResponse>(\n `/data/${encodeURIComponent(typeSlug)}${query ? `?${query}` : \"\"}`,\n [CACHE_TAGS.data, CACHE_TAGS.dataType(typeSlug)],\n options?.revalidate\n )\n}\n\n/**\n * Get a single data entry\n */\nexport async function getDataEntry(\n typeSlug: string,\n id: string,\n options?: FetchOptions\n): Promise<DataEntryItem> {\n return sdkFetchWithTags<DataEntryItem>(\n `/data/${encodeURIComponent(typeSlug)}/${encodeURIComponent(id)}`,\n [CACHE_TAGS.data, CACHE_TAGS.dataType(typeSlug)],\n options?.revalidate\n )\n}\n\n// ============================================\n// OrThrow variants — throw on failure instead of returning null/undefined\n// ============================================\n\n/**\n * Get contents from a collection, or throw an error\n */\nexport async function getCollectionContentsOrThrow(\n slug: string,\n options?: CollectionContentsOptions\n): Promise<CollectionContentsResponse> {\n const result = await getCollectionContents(slug, options)\n if (!result) throw new Error(`Failed to fetch collection contents: ${slug}`)\n return result\n}\n\n/**\n * Get a specific content detail, or throw an error\n */\nexport async function getCollectionContentDetailOrThrow(\n collectionSlug: string,\n contentSlug: string,\n options?: FetchOptions\n): Promise<CollectionContentDetailResponse> {\n const result = await getCollectionContentDetail(collectionSlug, contentSlug, options)\n if (!result) throw new Error(`Failed to fetch content detail: ${collectionSlug}/${contentSlug}`)\n return result\n}\n\n/**\n * Get data entries for a data type, or throw an error\n */\nexport async function getDataEntriesOrThrow(\n typeSlug: string,\n options?: DataEntriesOptions\n): Promise<DataListResponse> {\n const result = await getDataEntries(typeSlug, options)\n if (!result) throw new Error(`Failed to fetch data entries: ${typeSlug}`)\n return result\n}\n\n/**\n * Get a single data entry, or throw an error\n */\nexport async function getDataEntryOrThrow(\n typeSlug: string,\n id: string,\n options?: FetchOptions\n): Promise<DataEntryItem> {\n const result = await getDataEntry(typeSlug, id, options)\n if (!result) throw new Error(`Failed to fetch data entry: ${typeSlug}/${id}`)\n return result\n}\n\n/**\n * Get preview content by token (no authentication required)\n * Returns null if the token is invalid or expired.\n */\nexport async function getPreviewByToken(token: string): Promise<PreviewResponse | null> {\n try {\n const baseUrl = getSdkApiBaseUrl()\n const response = await fetch(`${baseUrl}/preview/${encodeURIComponent(token)}`, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n cache: \"no-store\",\n })\n\n if (!response.ok) {\n return null\n }\n\n return response.json()\n } catch (error) {\n console.error(\"Error fetching preview:\", error)\n return null\n }\n}\n\n/**\n * Get the workspace schema (collections, data types, forms)\n */\nexport async function getSchema(\n options?: FetchOptions\n): Promise<SchemaResponse> {\n return sdkFetchWithTags<SchemaResponse>(\n \"/schema\",\n [CACHE_TAGS.collections, CACHE_TAGS.data],\n options?.revalidate\n )\n}\n\n/**\n * Get all collections in the workspace\n */\nexport async function getCollections(\n options?: FetchOptions\n): Promise<SchemaResponse[\"collections\"]> {\n const schema = await getSchema(options)\n return schema.collections\n}\n\n/**\n * Submit data to a public form\n * Only works for data types with publicSubmission enabled.\n * Submissions are saved as \"pending\" for admin review.\n */\nexport async function submitFormData(\n typeSlug: string,\n data: Record<string, unknown>\n): Promise<{ success: true; id: string }> {\n return sdkPostFetcher<{ success: true; id: string }>(\n `/submissions/${encodeURIComponent(typeSlug)}`,\n { data }\n )\n}\n","import { ReactNode } from \"react\"\nimport { AlertCircle, AlertTriangle, CheckCircle, Info, Lightbulb } from \"lucide-react\"\n\ninterface CalloutProps {\n type?: \"info\" | \"warning\" | \"error\" | \"success\" | \"tip\"\n title?: string\n children: ReactNode\n}\n\nconst icons = {\n info: Info,\n warning: AlertTriangle,\n error: AlertCircle,\n success: CheckCircle,\n tip: Lightbulb,\n}\n\nconst styles = {\n info: \"cmx-mdx__callout--info bg-blue-50 border-blue-200 text-blue-800\",\n warning: \"cmx-mdx__callout--warning bg-yellow-50 border-yellow-200 text-yellow-800\",\n error: \"cmx-mdx__callout--error bg-red-50 border-red-200 text-red-800\",\n success: \"cmx-mdx__callout--success bg-green-50 border-green-200 text-green-800\",\n tip: \"cmx-mdx__callout--tip bg-purple-50 border-purple-200 text-purple-800\",\n}\n\nconst iconColors = {\n info: \"text-blue-500\",\n warning: \"text-yellow-500\",\n error: \"text-red-500\",\n success: \"text-green-500\",\n tip: \"text-purple-500\",\n}\n\nexport function Callout({ type = \"info\", title, children }: CalloutProps) {\n const Icon = icons[type]\n\n return (\n <div className={`cmx-mdx__callout my-4 p-4 border rounded-lg ${styles[type]}`}>\n <div className=\"cmx-mdx__callout-content flex gap-3\">\n <Icon className={`cmx-mdx__callout-icon w-5 h-5 flex-shrink-0 mt-0.5 ${iconColors[type]}`} />\n <div className=\"cmx-mdx__callout-body flex-1\">\n {title && <p className=\"cmx-mdx__callout-title font-semibold mb-1\">{title}</p>}\n <div className=\"cmx-mdx__callout-text text-sm\">{children}</div>\n </div>\n </div>\n </div>\n )\n}\n","interface EmbedProps {\n url: string\n type?: \"youtube\" | \"twitter\" | \"generic\"\n}\n\nfunction extractYouTubeId(url: string): string | null {\n const patterns = [\n /(?:youtube\\.com\\/watch\\?v=|youtu\\.be\\/|youtube\\.com\\/embed\\/)([^&\\n?#]+)/,\n ]\n for (const pattern of patterns) {\n const match = url.match(pattern)\n if (match) return match[1]\n }\n return null\n}\n\nexport function Embed({ url, type = \"generic\" }: EmbedProps) {\n if (type === \"youtube\") {\n const videoId = extractYouTubeId(url)\n if (videoId) {\n return (\n <div className=\"cmx-mdx__embed cmx-mdx__embed--youtube my-4 aspect-video\">\n <iframe\n src={`https://www.youtube.com/embed/${videoId}`}\n className=\"cmx-mdx__embed-iframe w-full h-full rounded-lg\"\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n />\n </div>\n )\n }\n }\n\n if (type === \"twitter\") {\n // Twitterの埋め込みはクライアントサイドで処理が必要\n return (\n <div className=\"cmx-mdx__embed cmx-mdx__embed--twitter my-4 border border-gray-200 rounded-lg p-4 bg-gray-50\">\n <p className=\"cmx-mdx__embed-label text-sm text-gray-500\">Twitter埋め込み</p>\n <a\n href={url}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"cmx-mdx__embed-link text-blue-500 hover:underline text-sm\"\n >\n {url}\n </a>\n </div>\n )\n }\n\n // Generic embed\n return (\n <div className=\"cmx-mdx__embed cmx-mdx__embed--generic my-4 aspect-video\">\n <iframe\n src={url}\n className=\"cmx-mdx__embed-iframe w-full h-full rounded-lg border border-gray-200\"\n allowFullScreen\n />\n </div>\n )\n}\n","import Link from \"next/link\"\nimport { ReactNode } from \"react\"\n\ninterface ButtonProps {\n href: string\n children: ReactNode\n variant?: \"primary\" | \"secondary\" | \"outline\"\n}\n\nconst variants = {\n primary: \"cmx-mdx__button--primary bg-blue-600 text-white hover:bg-blue-700\",\n secondary: \"cmx-mdx__button--secondary bg-gray-600 text-white hover:bg-gray-700\",\n outline: \"cmx-mdx__button--outline border border-gray-300 text-gray-700 hover:bg-gray-50\",\n}\n\nexport function Button({ href, children, variant = \"primary\" }: ButtonProps) {\n const isExternal = href.startsWith(\"http\")\n\n const className = `cmx-mdx__button inline-block px-4 py-2 rounded-lg font-medium transition-colors ${variants[variant]}`\n\n if (isExternal) {\n return (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={className}\n >\n {children}\n </a>\n )\n }\n\n return (\n <Link href={href} className={className}>\n {children}\n </Link>\n )\n}\n","// CMX Basic MDX Components\n// テンプレートとして提供する標準コンポーネント\n// クラス名: cmx-mdx__[component], cmx-mdx__[component]-[element], cmx-mdx__[component]--[modifier]\n\nexport { Callout } from \"./Callout\"\nexport { Embed } from \"./Embed\"\nexport { Button } from \"./Button\"\n\nimport { Callout } from \"./Callout\"\nimport { Embed } from \"./Embed\"\nimport { Button } from \"./Button\"\n\nexport const basicComponents = {\n Callout,\n Embed,\n Button,\n}\n","import Link from \"next/link\"\n\ninterface BlogCardProps {\n contentId: string\n // 以下はサーバーサイドでcontentIdから解決される\n title?: string\n slug?: string\n excerpt?: string\n}\n\nexport function BlogCard({ contentId, title, slug, excerpt }: BlogCardProps) {\n // contentIdのみの場合(未解決)\n if (!title || !slug) {\n return (\n <div className=\"border border-dashed border-gray-300 rounded-lg p-4 bg-gray-50\">\n <p className=\"text-sm text-gray-500\">記事カード: {contentId}</p>\n </div>\n )\n }\n\n return (\n <Link\n href={`/${slug}`}\n className=\"block border border-gray-200 rounded-lg p-4 hover:border-blue-400 hover:shadow-md transition-all\"\n >\n <h3 className=\"text-lg font-semibold text-gray-900 mb-2\">{title}</h3>\n {excerpt && <p className=\"text-sm text-gray-600 line-clamp-2\">{excerpt}</p>}\n </Link>\n )\n}\n","import NextImage from \"next/image\"\n\ninterface ImageProps {\n assetId: string\n alt?: string\n size?: \"thumbnail\" | \"medium\" | \"large\" | \"original\"\n caption?: string\n // 以下はサーバーサイドでassetIdから解決される\n url?: string\n width?: number\n height?: number\n}\n\nexport function Image({\n assetId,\n alt = \"\",\n size = \"large\",\n caption,\n url,\n width,\n height,\n}: ImageProps) {\n // 未解決の場合\n if (!url) {\n return (\n <figure className=\"my-4\">\n <div className=\"border border-dashed border-gray-300 rounded-lg p-8 bg-gray-50 text-center\">\n <p className=\"text-sm text-gray-500\">画像: {assetId}</p>\n <p className=\"text-xs text-gray-400\">サイズ: {size}</p>\n </div>\n {caption && (\n <figcaption className=\"mt-2 text-sm text-gray-500 text-center\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n }\n\n return (\n <figure className=\"my-4\">\n <NextImage\n src={url}\n alt={alt}\n width={width || 800}\n height={height || 600}\n className=\"rounded-lg\"\n />\n {caption && (\n <figcaption className=\"mt-2 text-sm text-gray-500 text-center\">\n {caption}\n </figcaption>\n )}\n </figure>\n )\n}\n","// CMX Custom MDX Components\n// プロジェクト固有のカスタムコンポーネント(reference解決が必要)\n// これらは企業ごとにカスタマイズされることを想定\n\nexport { BlogCard } from \"./BlogCard\"\nexport { Image } from \"./Image\"\n\nimport { BlogCard } from \"./BlogCard\"\nimport { Image } from \"./Image\"\n\nexport const customComponents = {\n BlogCard,\n Image,\n}\n","// ============================================\n// Standard Markdown Element Components\n// These map to HTML elements generated from Markdown syntax\n// ============================================\n\ntype PropsWithChildren = { children?: React.ReactNode; [key: string]: unknown }\n\n// Headings: # ## ### #### ##### ######\nconst mdxH1 = ({ children, ...props }: PropsWithChildren) => (\n <h1 className=\"text-4xl font-bold mt-8 mb-4\" {...props}>{children}</h1>\n)\nconst mdxH2 = ({ children, ...props }: PropsWithChildren) => (\n <h2 className=\"text-3xl font-bold mt-6 mb-3\" {...props}>{children}</h2>\n)\nconst mdxH3 = ({ children, ...props }: PropsWithChildren) => (\n <h3 className=\"text-2xl font-semibold mt-4 mb-2\" {...props}>{children}</h3>\n)\nconst mdxH4 = ({ children, ...props }: PropsWithChildren) => (\n <h4 className=\"text-xl font-semibold mt-3 mb-2\" {...props}>{children}</h4>\n)\nconst mdxH5 = ({ children, ...props }: PropsWithChildren) => (\n <h5 className=\"text-lg font-medium mt-2 mb-1\" {...props}>{children}</h5>\n)\nconst mdxH6 = ({ children, ...props }: PropsWithChildren) => (\n <h6 className=\"text-base font-medium mt-2 mb-1\" {...props}>{children}</h6>\n)\n\n// Paragraph\nconst mdxP = ({ children, ...props }: PropsWithChildren) => (\n <p className=\"my-4 leading-7\" {...props}>{children}</p>\n)\n\n// Lists: - item / 1. item\nconst mdxUl = ({ children, ...props }: PropsWithChildren) => (\n <ul className=\"my-4 pl-6 list-disc\" {...props}>{children}</ul>\n)\nconst mdxOl = ({ children, ...props }: PropsWithChildren) => (\n <ol className=\"my-4 pl-6 list-decimal\" {...props}>{children}</ol>\n)\nconst mdxLi = ({ children, ...props }: PropsWithChildren) => (\n <li className=\"my-1\" {...props}>{children}</li>\n)\n\n// Blockquote: > quote\nconst mdxBlockquote = ({ children, ...props }: PropsWithChildren) => (\n <blockquote className=\"border-l-4 border-primary pl-4 italic my-4\" {...props}>\n {children}\n </blockquote>\n)\n\n// Code: ```code``` and `inline`\nconst mdxPre = ({ children, ...props }: PropsWithChildren) => (\n <pre className=\"overflow-x-auto rounded-lg bg-slate-900 p-4 text-sm my-4\" {...props}>\n {children}\n </pre>\n)\nconst mdxCode = ({ children, ...props }: PropsWithChildren) => (\n <code className=\"bg-muted px-1.5 py-0.5 rounded text-sm font-mono\" {...props}>\n {children}\n </code>\n)\n\n// Horizontal rule: ---\nconst mdxHr = () => (\n <hr className=\"my-8 border-t border-border\" />\n)\n\n// Links: [text](url)\nconst mdxA = ({ children, href, ...props }: PropsWithChildren & { href?: string }) => (\n <a\n href={href}\n className=\"text-primary underline underline-offset-4 hover:text-primary/80\"\n target={href?.startsWith(\"http\") ? \"_blank\" : undefined}\n rel={href?.startsWith(\"http\") ? \"noopener noreferrer\" : undefined}\n {...props}\n >\n {children}\n </a>\n)\n\n// Images: \nconst mdxImg = ({ src, alt, ...props }: { src?: string; alt?: string; [key: string]: unknown }) => (\n // eslint-disable-next-line @next/next/no-img-element\n <img\n src={src}\n alt={alt || \"\"}\n className=\"max-w-full h-auto rounded-lg my-4\"\n {...props}\n />\n)\n\n// Text formatting: **bold** *italic*\nconst mdxStrong = ({ children, ...props }: PropsWithChildren) => (\n <strong className=\"font-bold\" {...props}>{children}</strong>\n)\nconst mdxEm = ({ children, ...props }: PropsWithChildren) => (\n <em className=\"italic\" {...props}>{children}</em>\n)\n\n// Tables (GFM)\nconst mdxTable = ({ children, ...props }: PropsWithChildren) => (\n <div className=\"my-4 overflow-x-auto\">\n <table className=\"min-w-full border-collapse border border-border\" {...props}>\n {children}\n </table>\n </div>\n)\nconst mdxThead = ({ children, ...props }: PropsWithChildren) => (\n <thead className=\"bg-muted\" {...props}>{children}</thead>\n)\nconst mdxTbody = ({ children, ...props }: PropsWithChildren) => (\n <tbody {...props}>{children}</tbody>\n)\nconst mdxTr = ({ children, ...props }: PropsWithChildren) => (\n <tr className=\"border-b border-border\" {...props}>{children}</tr>\n)\nconst mdxTh = ({ children, ...props }: PropsWithChildren) => (\n <th className=\"px-4 py-2 text-left font-semibold border border-border\" {...props}>{children}</th>\n)\nconst mdxTd = ({ children, ...props }: PropsWithChildren) => (\n <td className=\"px-4 py-2 border border-border\" {...props}>{children}</td>\n)\n\n/**\n * Standard markdown element mappings for MDX\n * Use with MDX's components prop: <MDXContent components={markdownComponents} />\n */\nexport const markdownComponents = {\n h1: mdxH1,\n h2: mdxH2,\n h3: mdxH3,\n h4: mdxH4,\n h5: mdxH5,\n h6: mdxH6,\n p: mdxP,\n ul: mdxUl,\n ol: mdxOl,\n li: mdxLi,\n blockquote: mdxBlockquote,\n pre: mdxPre,\n code: mdxCode,\n hr: mdxHr,\n a: mdxA,\n img: mdxImg,\n strong: mdxStrong,\n em: mdxEm,\n table: mdxTable,\n thead: mdxThead,\n tbody: mdxTbody,\n tr: mdxTr,\n th: mdxTh,\n td: mdxTd,\n}\n","// MDX Components\n// basic: CMXテンプレート(cmx-mdx__プレフィックス付き)\n// custom: プロジェクト固有(reference解決が必要)\n// markdown: 標準Markdown要素(h1, p, ul, etc.)\n\n// Basic Components (CMX templates)\nexport { Callout, Embed, Button, basicComponents } from \"./basic\"\n\n// Custom Components (project-specific)\nexport { BlogCard, Image, customComponents } from \"./custom\"\n\n// Standard Markdown Element Components\nexport { markdownComponents } from \"./markdown\"\n\n// Combined MDX Component Map\nimport { basicComponents } from \"./basic\"\nimport { customComponents } from \"./custom\"\nimport { markdownComponents } from \"./markdown\"\n\nexport const mdxComponents = {\n ...markdownComponents,\n ...basicComponents,\n ...customComponents,\n}\n","import { z } from \"zod\"\n\n// ============================================\n// Component Props Schema Definitions\n// ============================================\n\nexport const componentSchemas = {\n BlogCard: z.object({\n contentId: z.string().uuid().describe(\"参照先コンテンツのUUID\"),\n }),\n\n Image: z.object({\n assetId: z.string().uuid().describe(\"アセットのUUID\"),\n alt: z.string().optional().describe(\"代替テキスト\"),\n size: z\n .enum([\"thumbnail\", \"medium\", \"large\", \"original\"])\n .default(\"large\")\n .describe(\"表示サイズ\"),\n caption: z.string().optional().describe(\"キャプション\"),\n }),\n\n Callout: z.object({\n type: z\n .enum([\"info\", \"warning\", \"error\", \"success\", \"tip\"])\n .default(\"info\")\n .describe(\"タイプ\"),\n title: z.string().optional().describe(\"タイトル\"),\n children: z.string().describe(\"本文(Markdown可)\"),\n }),\n\n Embed: z.object({\n url: z.string().url().describe(\"埋め込みURL\"),\n type: z.enum([\"youtube\", \"twitter\", \"generic\"]).default(\"generic\").describe(\"タイプ\"),\n }),\n\n Button: z.object({\n href: z.string().describe(\"リンク先URL\"),\n children: z.string().describe(\"ボタンテキスト\"),\n variant: z.enum([\"primary\", \"secondary\", \"outline\"]).default(\"primary\").describe(\"スタイル\"),\n }),\n} as const\n\n// ============================================\n// Component Catalog Type\n// ============================================\n\nexport type ComponentName = keyof typeof componentSchemas\nexport type ComponentSource = \"standard\" | \"custom\"\nexport type ComponentKind = \"presentational\" | \"data-bound\"\n\nexport interface ComponentBinding {\n prop: string\n target: \"content\" | \"asset\" | \"dataEntry\"\n strategy: \"by-id\"\n}\n\nexport interface ComponentDefinition<T extends ComponentName = ComponentName> {\n name: T\n displayName: string\n description: string\n category: \"content\" | \"media\" | \"reference\" | \"layout\"\n schema: (typeof componentSchemas)[T]\n examples: string[]\n hasReferences: boolean\n source: \"standard\"\n kind: ComponentKind\n locked: true\n editable: false\n bindings?: ComponentBinding[]\n}\n\nexport interface CatalogForAIComponent {\n name: string\n description: string\n props: Record<string, { type: string; description?: string; required: boolean }>\n examples: string[]\n source: ComponentSource\n kind: ComponentKind\n locked: boolean\n editable: boolean\n bindings?: ComponentBinding[]\n}\n\n// ============================================\n// Component Catalog (Standard / Immutable)\n// ============================================\n\nexport const componentCatalog: Record<ComponentName, ComponentDefinition> = {\n BlogCard: {\n name: \"BlogCard\",\n displayName: \"記事カード\",\n description: \"他の記事へのリンクカードを表示します\",\n category: \"reference\",\n schema: componentSchemas.BlogCard,\n examples: ['<BlogCard contentId=\"123e4567-e89b-12d3-a456-426614174000\" />'],\n hasReferences: true,\n source: \"standard\",\n kind: \"data-bound\",\n locked: true,\n editable: false,\n bindings: [{ prop: \"contentId\", target: \"content\", strategy: \"by-id\" }],\n },\n\n Image: {\n name: \"Image\",\n displayName: \"画像\",\n description: \"アップロード済み画像を表示します\",\n category: \"media\",\n schema: componentSchemas.Image,\n examples: [\n '<Image assetId=\"123e4567-e89b-12d3-a456-426614174000\" alt=\"説明\" />',\n '<Image assetId=\"123e4567-e89b-12d3-a456-426614174000\" size=\"medium\" caption=\"キャプション\" />',\n ],\n hasReferences: true,\n source: \"standard\",\n kind: \"data-bound\",\n locked: true,\n editable: false,\n bindings: [{ prop: \"assetId\", target: \"asset\", strategy: \"by-id\" }],\n },\n\n Callout: {\n name: \"Callout\",\n displayName: \"コールアウト\",\n description: \"注意書きや補足情報を目立たせるボックス\",\n category: \"content\",\n schema: componentSchemas.Callout,\n examples: [\n '<Callout type=\"info\">これは情報です</Callout>',\n '<Callout type=\"warning\" title=\"注意\">重要な注意事項です</Callout>',\n ],\n hasReferences: false,\n source: \"standard\",\n kind: \"presentational\",\n locked: true,\n editable: false,\n },\n\n Embed: {\n name: \"Embed\",\n displayName: \"埋め込み\",\n description: \"YouTube動画やツイートを埋め込みます\",\n category: \"media\",\n schema: componentSchemas.Embed,\n examples: [\n '<Embed url=\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\" type=\"youtube\" />',\n '<Embed url=\"https://twitter.com/example/status/123456789\" type=\"twitter\" />',\n ],\n hasReferences: false,\n source: \"standard\",\n kind: \"presentational\",\n locked: true,\n editable: false,\n },\n\n Button: {\n name: \"Button\",\n displayName: \"ボタン\",\n description: \"アクションを促すボタンリンク\",\n category: \"content\",\n schema: componentSchemas.Button,\n examples: [\n '<Button href=\"/contact\">お問い合わせ</Button>',\n '<Button href=\"https://example.com\" variant=\"secondary\">詳細を見る</Button>',\n ],\n hasReferences: false,\n source: \"standard\",\n kind: \"presentational\",\n locked: true,\n editable: false,\n },\n}\n\n// ============================================\n// Utility Functions\n// ============================================\n\nexport function isValidComponent(name: string): name is ComponentName {\n return name in componentCatalog\n}\n\nexport function validateComponentProps(\n name: ComponentName,\n props: unknown\n): { success: true; data: unknown } | { success: false; error: z.ZodError } {\n const schema = componentSchemas[name]\n const result = schema.safeParse(props)\n if (result.success) {\n return { success: true, data: result.data }\n }\n return { success: false, error: result.error }\n}\n\nexport function getComponentsWithReferences(): ComponentName[] {\n return (Object.keys(componentCatalog) as ComponentName[]).filter(\n (name) => componentCatalog[name].hasReferences\n )\n}\n\nexport function getComponentsByCategory(): Record<string, ComponentDefinition[]> {\n const grouped: Record<string, ComponentDefinition[]> = {}\n for (const def of Object.values(componentCatalog)) {\n if (!grouped[def.category]) {\n grouped[def.category] = []\n }\n grouped[def.category].push(def)\n }\n return grouped\n}\n\nexport function getStandardComponentNames(): ComponentName[] {\n return Object.keys(componentCatalog) as ComponentName[]\n}\n\nexport function isStandardComponentName(name: string): boolean {\n return isValidComponent(name)\n}\n\nexport function getCatalogForAI(): CatalogForAIComponent[] {\n return Object.values(componentCatalog).map((def) => {\n const shape = def.schema.shape as Record<string, z.ZodTypeAny>\n const props: Record<string, { type: string; description?: string; required: boolean }> = {}\n\n for (const [key, zodType] of Object.entries(shape)) {\n const isOptional = zodType.isOptional()\n props[key] = {\n type: getZodTypeName(zodType),\n description: zodType.description,\n required: !isOptional,\n }\n }\n\n return {\n name: def.name,\n description: def.description,\n props,\n examples: def.examples,\n source: def.source,\n kind: def.kind,\n locked: def.locked,\n editable: def.editable,\n bindings: def.bindings,\n }\n })\n}\n\nfunction getZodTypeName(zodType: z.ZodTypeAny): string {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const typeDef = (zodType as any)._zod?.def ?? (zodType as any)._def\n if (!typeDef) return \"unknown\"\n\n const typeName = typeDef.type ?? typeDef.typeName\n\n switch (typeName) {\n case \"string\":\n case \"ZodString\":\n return \"string\"\n case \"number\":\n case \"ZodNumber\":\n return \"number\"\n case \"boolean\":\n case \"ZodBoolean\":\n return \"boolean\"\n case \"enum\":\n case \"ZodEnum\":\n return `enum(${typeDef.values?.join(\"|\") ?? \"\"})`\n case \"array\":\n case \"ZodArray\":\n return \"array\"\n case \"optional\":\n case \"ZodOptional\":\n return typeDef.innerType ? getZodTypeName(typeDef.innerType) : \"unknown\"\n case \"default\":\n case \"ZodDefault\":\n return typeDef.innerType ? getZodTypeName(typeDef.innerType) : \"unknown\"\n default:\n return \"unknown\"\n }\n}\n","import { compile } from \"@mdx-js/mdx\"\nimport { isValidComponent, validateComponentProps, ComponentName } from \"./component-catalog\"\n\n// ============================================\n// Validation Error Types\n// ============================================\n\nexport interface ValidationError {\n type: \"syntax\" | \"forbidden\" | \"component\" | \"props\"\n message: string\n line?: number\n column?: number\n component?: string\n}\n\nexport interface ValidationResult {\n valid: boolean\n errors: ValidationError[]\n warnings: string[]\n references: {\n contentIds: string[]\n assetIds: string[]\n }\n}\n\n// ============================================\n// Forbidden Patterns\n// ============================================\n\nconst FORBIDDEN_PATTERNS = [\n // import/export statements\n { pattern: /^\\s*import\\s+/m, message: \"import文は使用できません\" },\n { pattern: /^\\s*export\\s+/m, message: \"export文は使用できません\" },\n // JS expressions in curly braces (except component props)\n { pattern: /\\{[^}]*(?:=>|function|new\\s+|typeof|instanceof)[^}]*\\}/m, message: \"JavaScript式は使用できません\" },\n // eval, Function constructor\n { pattern: /\\beval\\s*\\(/m, message: \"evalは使用できません\" },\n { pattern: /\\bnew\\s+Function\\s*\\(/m, message: \"Function constructorは使用できません\" },\n // script tags\n { pattern: /<script[\\s>]/i, message: \"scriptタグは使用できません\" },\n // on* event handlers\n { pattern: /\\bon\\w+\\s*=/i, message: \"イベントハンドラ属性は使用できません\" },\n // javascript: URLs\n { pattern: /javascript\\s*:/i, message: \"javascript: URLは使用できません\" },\n // data: URLs (for images - can be XSS vector)\n { pattern: /src\\s*=\\s*[\"']?\\s*data:/i, message: \"data: URLは使用できません\" },\n]\n\n// ============================================\n// Component Extraction\n// ============================================\n\ninterface ExtractedComponent {\n name: string\n props: Record<string, unknown>\n line: number\n}\n\nfunction extractComponents(mdx: string): ExtractedComponent[] {\n const components: ExtractedComponent[] = []\n const lines = mdx.split(\"\\n\")\n\n // Simple regex to find JSX-like components\n // <ComponentName prop=\"value\" prop2={expression} />\n const componentPattern = /<([A-Z][a-zA-Z0-9]*)\\s*([^>]*?)\\s*\\/?>/g\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i]\n let match\n\n while ((match = componentPattern.exec(line)) !== null) {\n const name = match[1]\n const propsString = match[2]\n const props = parseProps(propsString)\n\n components.push({\n name,\n props,\n line: i + 1,\n })\n }\n }\n\n return components\n}\n\nfunction parseProps(propsString: string): Record<string, unknown> {\n const props: Record<string, unknown> = {}\n\n // Match prop=\"value\" or prop={value} patterns\n const propPattern = /(\\w+)\\s*=\\s*(?:\"([^\"]*)\"|'([^']*)'|\\{([^}]*)\\})/g\n let match\n\n while ((match = propPattern.exec(propsString)) !== null) {\n const key = match[1]\n const stringValue = match[2] ?? match[3]\n const expressionValue = match[4]\n\n if (stringValue !== undefined) {\n props[key] = stringValue\n } else if (expressionValue !== undefined) {\n // Try to parse simple values\n const trimmed = expressionValue.trim()\n if (trimmed === \"true\") {\n props[key] = true\n } else if (trimmed === \"false\") {\n props[key] = false\n } else if (/^\\d+$/.test(trimmed)) {\n props[key] = parseInt(trimmed, 10)\n } else if (/^\\d+\\.\\d+$/.test(trimmed)) {\n props[key] = parseFloat(trimmed)\n } else if (trimmed.startsWith(\"[\") && trimmed.endsWith(\"]\")) {\n // Try to parse array\n try {\n props[key] = JSON.parse(trimmed.replace(/'/g, '\"'))\n } catch {\n props[key] = trimmed\n }\n } else {\n props[key] = trimmed\n }\n }\n }\n\n // Handle boolean props without value (e.g., <CodeBlock showLineNumbers />)\n const booleanPattern = /(?:^|\\s)(\\w+)(?=\\s|\\/|>|$)/g\n while ((match = booleanPattern.exec(propsString)) !== null) {\n const key = match[1]\n if (!(key in props)) {\n props[key] = true\n }\n }\n\n return props\n}\n\n// ============================================\n// Extract References\n// ============================================\n\nfunction extractReferences(components: ExtractedComponent[]): {\n contentIds: string[]\n assetIds: string[]\n} {\n const contentIds: string[] = []\n const assetIds: string[] = []\n\n for (const component of components) {\n if (component.name === \"BlogCard\" && typeof component.props.contentId === \"string\") {\n contentIds.push(component.props.contentId)\n }\n if (component.name === \"Image\" && typeof component.props.assetId === \"string\") {\n assetIds.push(component.props.assetId)\n }\n }\n\n return {\n contentIds: [...new Set(contentIds)],\n assetIds: [...new Set(assetIds)],\n }\n}\n\n// ============================================\n// Main Validation Function\n// ============================================\n\nexport async function validateMdx(mdx: string): Promise<ValidationResult> {\n const errors: ValidationError[] = []\n const warnings: string[] = []\n\n // 1. Check forbidden patterns\n for (const { pattern, message } of FORBIDDEN_PATTERNS) {\n if (pattern.test(mdx)) {\n const lines = mdx.split(\"\\n\")\n for (let i = 0; i < lines.length; i++) {\n if (pattern.test(lines[i])) {\n errors.push({\n type: \"forbidden\",\n message,\n line: i + 1,\n })\n break\n }\n }\n }\n }\n\n // 2. Try to compile MDX (syntax check)\n try {\n await compile(mdx, {\n development: false,\n // Minimal compilation to check syntax\n })\n } catch (error) {\n const err = error as Error & { line?: number; column?: number }\n errors.push({\n type: \"syntax\",\n message: err.message,\n line: err.line,\n column: err.column,\n })\n }\n\n // 3. Extract and validate components\n const components = extractComponents(mdx)\n\n for (const component of components) {\n // Check if component is in catalog\n if (!isValidComponent(component.name)) {\n errors.push({\n type: \"component\",\n message: `未知のコンポーネント: ${component.name}`,\n line: component.line,\n component: component.name,\n })\n continue\n }\n\n // Validate props\n const result = validateComponentProps(component.name as ComponentName, component.props)\n if (!result.success) {\n for (const issue of result.error.issues) {\n errors.push({\n type: \"props\",\n message: `${component.name}: ${issue.path.join(\".\")} - ${issue.message}`,\n line: component.line,\n component: component.name,\n })\n }\n }\n }\n\n // 4. Extract references\n const references = extractReferences(components)\n\n return {\n valid: errors.length === 0,\n errors,\n warnings,\n references,\n }\n}\n\n// ============================================\n// Quick Validation (for save)\n// ============================================\n\nexport function quickValidateMdx(mdx: string): {\n valid: boolean\n errors: ValidationError[]\n} {\n const errors: ValidationError[] = []\n\n // Only check forbidden patterns (fast)\n for (const { pattern, message } of FORBIDDEN_PATTERNS) {\n if (pattern.test(mdx)) {\n errors.push({\n type: \"forbidden\",\n message,\n })\n }\n }\n\n return {\n valid: errors.length === 0,\n errors,\n }\n}\n","/**\n * CMX SDK — MDX Rendering\n *\n * Server-side MDX compilation and rendering with reference resolution.\n * Provides `renderMdx` as an async function for Server Components.\n */\n\nimport { compile, run } from \"@mdx-js/mdx\"\nimport * as runtime from \"react/jsx-runtime\"\n\nimport {\n BlogCard,\n Image,\n Callout,\n Embed,\n Button,\n markdownComponents,\n} from \"./mdx/components/index.js\"\n\nimport type {\n References,\n ContentReference,\n AssetReference,\n} from \"./generated/sdk/models/index.js\"\n\n// ============================================\n// Types\n// ============================================\n\nexport interface ResolvedReferences {\n contents: Map<string, ContentReference>\n assets: Map<string, AssetReference>\n}\n\nexport interface RenderOptions {\n /** Additional MDX components to make available (e.g. custom components) */\n additionalComponents?: Record<string, React.ComponentType<any>>\n}\n\nexport interface RenderResult {\n content: React.ReactElement\n references: ResolvedReferences\n}\n\n// ============================================\n// Reference Conversion\n// ============================================\n\nfunction convertReferencesToMaps(refs?: References): ResolvedReferences {\n const contentsMap = new Map<string, ContentReference>()\n const assetsMap = new Map<string, AssetReference>()\n\n if (refs?.contents) {\n Object.entries(refs.contents).forEach(([id, content]) => {\n contentsMap.set(id, content)\n })\n }\n\n if (refs?.assets) {\n Object.entries(refs.assets).forEach(([id, asset]) => {\n assetsMap.set(id, asset)\n })\n }\n\n return { contents: contentsMap, assets: assetsMap }\n}\n\n// ============================================\n// Component Factory\n// ============================================\n\nfunction createResolvedComponents(\n references: ResolvedReferences,\n additionalComponents?: Record<string, React.ComponentType<any>>\n) {\n return {\n // Standard markdown elements\n ...markdownComponents,\n\n // Custom components with reference resolution\n BlogCard: (props: { contentId: string }) => {\n const ref = references.contents.get(props.contentId)\n return (\n <BlogCard\n contentId={props.contentId}\n title={ref?.title}\n slug={ref?.slug}\n excerpt={ref?.description || undefined}\n />\n )\n },\n\n Image: (props: { assetId: string; alt?: string; size?: \"thumbnail\" | \"medium\" | \"large\" | \"original\"; caption?: string }) => {\n const asset = references.assets.get(props.assetId)\n const size = props.size || \"large\"\n let url = asset?.url\n\n // Get the appropriate variant URL\n if (asset?.variants && size !== \"original\") {\n url = asset.variants[size] || asset.url\n }\n\n return (\n <Image\n assetId={props.assetId}\n alt={props.alt || asset?.alt || \"\"}\n size={size}\n caption={props.caption}\n url={url}\n width={asset?.width || undefined}\n height={asset?.height || undefined}\n />\n )\n },\n\n // Components without resolution\n Callout,\n Embed,\n Button,\n\n // User-provided custom components\n ...additionalComponents,\n }\n}\n\n// ============================================\n// MDX Validation\n// ============================================\n\n/**\n * Patterns that indicate potentially dangerous MDX content.\n * These are blocked to prevent arbitrary code execution via MDX injection.\n */\nconst DANGEROUS_PATTERNS = [\n /\\bimport\\s+/, // import statements\n /\\bexport\\s+/, // export statements (except default handled by mdx compiler)\n /\\{.*\\bconstructor\\b/, // constructor access in expressions\n /\\{.*\\b__proto__\\b/, // prototype pollution\n /\\{.*\\bprocess\\b/, // process access\n /\\{.*\\brequire\\s*\\(/, // require() calls\n /\\{.*\\beval\\s*\\(/, // eval() calls\n /\\{.*\\bFunction\\s*\\(/, // Function constructor\n] as const\n\n/**\n * Validate MDX content before compilation.\n * Throws an error if dangerous patterns are detected.\n */\nfunction validateMdx(mdx: string): void {\n for (const pattern of DANGEROUS_PATTERNS) {\n if (pattern.test(mdx)) {\n throw new Error(\n `MDX validation failed: potentially unsafe content detected (${pattern.source}). ` +\n \"MDX content must not contain import/export statements or dynamic code execution.\"\n )\n }\n }\n}\n\n// ============================================\n// MDX Renderer\n// ============================================\n\n/**\n * Render MDX content with pre-resolved references from CMX API.\n *\n * @param mdx - Raw MDX string\n * @param references - References object from the API response (contents & assets)\n * @param options - Additional options (e.g. custom components)\n * @returns Rendered content and resolved references\n *\n * @example\n * ```tsx\n * const { content } = await renderMdx(post.mdx, post.references)\n * return <article>{content}</article>\n * ```\n *\n * @example With custom components\n * ```tsx\n * import { FeatureCard } from '@/components/custom'\n * const { content } = await renderMdx(post.mdx, post.references, {\n * additionalComponents: { FeatureCard }\n * })\n * ```\n */\nexport async function renderMdx(\n mdx: string,\n references?: References,\n options?: RenderOptions\n): Promise<RenderResult> {\n validateMdx(mdx)\n\n const resolvedReferences = convertReferencesToMaps(references)\n const components = createResolvedComponents(resolvedReferences, options?.additionalComponents)\n\n const code = await compile(mdx, {\n outputFormat: \"function-body\",\n development: false,\n })\n\n const { default: MDXContent } = await run(String(code), {\n ...runtime,\n baseUrl: import.meta.url,\n })\n\n const content = <MDXContent components={components} />\n\n return {\n content,\n references: resolvedReferences,\n }\n}\n\n/**\n * Render MDX content without reference resolution (for preview in editor).\n *\n * @param mdx - Raw MDX string\n * @param additionalComponents - Optional custom components\n * @returns Rendered React element\n */\nexport async function renderMdxPreview(\n mdx: string,\n additionalComponents?: Record<string, React.ComponentType<any>>\n): Promise<React.ReactElement> {\n const components = {\n ...markdownComponents,\n BlogCard,\n Image,\n Callout,\n Embed,\n Button,\n ...additionalComponents,\n }\n\n try {\n validateMdx(mdx)\n\n const code = await compile(mdx, {\n outputFormat: \"function-body\",\n development: false,\n })\n\n const { default: MDXContent } = await run(String(code), {\n ...runtime,\n baseUrl: import.meta.url,\n })\n\n return <MDXContent components={components} />\n } catch (error) {\n console.error(\"MDX render error:\", error)\n return (\n <div className=\"p-4 bg-red-50 border border-red-200 rounded-lg\">\n <p className=\"text-red-600 font-medium\">MDX Render Error</p>\n <pre className=\"mt-2 text-sm text-red-500 whitespace-pre-wrap\">\n {error instanceof Error ? error.message : \"Unknown error\"}\n </pre>\n </div>\n )\n }\n}\n"],"mappings":";AAgDO,IAAM,cAAN,cAA0B,MAAM;AAAA,EACrC,YACE,SACgB,QACA,MAChB;AACA,UAAM,OAAO;AAHG;AACA;AAGhB,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,IAAI,aAAsB;AACxB,WAAO,KAAK,WAAW;AAAA,EACzB;AAAA,EAEA,IAAI,iBAA0B;AAC5B,WAAO,KAAK,WAAW;AAAA,EACzB;AAAA,EAEA,IAAI,cAAuB;AACzB,WAAO,KAAK,WAAW;AAAA,EACzB;AAAA,EAEA,IAAI,gBAAyB;AAC3B,WAAO,KAAK,UAAU;AAAA,EACxB;AACF;;;ACvDA,IAAM,kBAAkB;AAKjB,SAAS,mBAA2B;AACzC,QAAM,SAAS,QAAQ,IAAI,eAAe;AAC1C,SAAO,GAAG,MAAM;AAClB;AAKO,SAAS,iBAAyB;AACvC,QAAM,QAAQ,QAAQ,IAAI;AAC1B,MAAI,CAAC,OAAO;AACV,UAAM,IAAI,MAAM,6CAA6C;AAAA,EAC/D;AACA,SAAO;AACT;AAMA,eAAsB,WACpB,MACA,SACY;AACZ,QAAM,EAAE,OAAO,MAAM,WAAW,IAAI;AACpC,QAAM,UAAU,iBAAiB;AACjC,QAAM,MAAM,GAAG,OAAO,GAAG,IAAI;AAE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AAQ,MAAM,UAAU,iBAC5C;AAAA,OACF;AAAA,EAEJ;AACF;","names":["jsx","jsxs","jsx","Link","jsx","jsxs","jsx","jsxs","jsx","compile","jsx","jsxs","validateMdx","compile"]}
|
|
@@ -1,54 +1,83 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
cleanupTempFile,
|
|
4
|
+
downloadTarball
|
|
5
|
+
} from "./chunk-IIQLQIDP.js";
|
|
2
6
|
|
|
3
7
|
// src/commands/init.ts
|
|
4
8
|
import { input, select, confirm } from "@inquirer/prompts";
|
|
5
9
|
import { execSync } from "child_process";
|
|
6
10
|
import { existsSync, mkdirSync, rmSync, readFileSync, writeFileSync } from "fs";
|
|
7
11
|
import { join, resolve } from "path";
|
|
8
|
-
import { createWriteStream } from "fs";
|
|
9
|
-
import { pipeline } from "stream/promises";
|
|
10
|
-
import https from "https";
|
|
11
12
|
import { extract } from "tar";
|
|
12
13
|
var REPO_OWNER = "kzkm-lab";
|
|
13
14
|
var REPO_NAME = "cmx-starter-kit";
|
|
14
15
|
var REPO_BRANCH = "main";
|
|
16
|
+
var DEFAULT_API_URL = "https://app.cmx-ai.org";
|
|
15
17
|
async function downloadAndExtract(targetDir) {
|
|
16
18
|
const tarballUrl = `https://api.github.com/repos/${REPO_OWNER}/${REPO_NAME}/tarball/${REPO_BRANCH}`;
|
|
17
19
|
const tmpFile = join(targetDir, ".tmp-tarball.tar.gz");
|
|
18
|
-
await
|
|
19
|
-
|
|
20
|
-
https.get(url, {
|
|
21
|
-
headers: { "User-Agent": "cmx-sdk", Accept: "application/vnd.github+json" }
|
|
22
|
-
}, (res) => {
|
|
23
|
-
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
24
|
-
const redirectUrl = res.headers.location;
|
|
25
|
-
if (redirectUrl) {
|
|
26
|
-
download(redirectUrl);
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (res.statusCode !== 200) {
|
|
31
|
-
reject(new Error(`\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u306B\u5931\u6557\u3057\u307E\u3057\u305F (HTTP ${res.statusCode})`));
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
const fileStream = createWriteStream(tmpFile);
|
|
35
|
-
pipeline(res, fileStream).then(resolve2).catch(reject);
|
|
36
|
-
}).on("error", reject);
|
|
37
|
-
};
|
|
38
|
-
download(tarballUrl);
|
|
20
|
+
await downloadTarball(tarballUrl, tmpFile, {
|
|
21
|
+
headers: { Accept: "application/vnd.github+json" }
|
|
39
22
|
});
|
|
40
23
|
await extract({
|
|
41
24
|
file: tmpFile,
|
|
42
25
|
cwd: targetDir,
|
|
43
26
|
strip: 1
|
|
44
27
|
});
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
cleanupTempFile(tmpFile);
|
|
29
|
+
}
|
|
30
|
+
async function downloadAndExtractViaApi(targetDir, apiUrl, apiKey) {
|
|
31
|
+
const downloadUrl = `${apiUrl}/api/v1/sdk/download/starter-kit`;
|
|
32
|
+
const tmpFile = join(targetDir, ".tmp-tarball.tar.gz");
|
|
33
|
+
await downloadTarball(downloadUrl, tmpFile, {
|
|
34
|
+
headers: { Authorization: `Bearer ${apiKey}` }
|
|
35
|
+
});
|
|
36
|
+
await extract({
|
|
37
|
+
file: tmpFile,
|
|
38
|
+
cwd: targetDir,
|
|
39
|
+
strip: 1
|
|
40
|
+
});
|
|
41
|
+
cleanupTempFile(tmpFile);
|
|
42
|
+
}
|
|
43
|
+
function writeEnvFile(targetDir, apiUrl, apiKey) {
|
|
44
|
+
const envPath = join(targetDir, ".env");
|
|
45
|
+
const envContent = [
|
|
46
|
+
"# CMX API Configuration (auto-generated by cmx-sdk init)",
|
|
47
|
+
`CMX_API_URL=${apiUrl}`,
|
|
48
|
+
`CMX_API_KEY=${apiKey}`,
|
|
49
|
+
"",
|
|
50
|
+
"# Next.js Configuration",
|
|
51
|
+
"NEXT_PUBLIC_SITE_URL=http://localhost:4000",
|
|
52
|
+
""
|
|
53
|
+
].join("\n");
|
|
54
|
+
if (existsSync(envPath)) {
|
|
55
|
+
let existing = readFileSync(envPath, "utf-8");
|
|
56
|
+
if (existing.includes("CMX_API_URL=")) {
|
|
57
|
+
existing = existing.replace(/^CMX_API_URL=.*$/m, `CMX_API_URL=${apiUrl}`);
|
|
58
|
+
} else {
|
|
59
|
+
existing += `
|
|
60
|
+
CMX_API_URL=${apiUrl}`;
|
|
61
|
+
}
|
|
62
|
+
if (existing.includes("CMX_API_KEY=")) {
|
|
63
|
+
existing = existing.replace(/^CMX_API_KEY=.*$/m, `CMX_API_KEY=${apiKey}`);
|
|
64
|
+
} else {
|
|
65
|
+
existing += `
|
|
66
|
+
CMX_API_KEY=${apiKey}`;
|
|
67
|
+
}
|
|
68
|
+
writeFileSync(envPath, existing, "utf-8");
|
|
69
|
+
} else {
|
|
70
|
+
writeFileSync(envPath, envContent, "utf-8");
|
|
48
71
|
}
|
|
49
72
|
}
|
|
50
73
|
async function init(projectName, options) {
|
|
51
74
|
console.log("\n CMX Starter Kit \u30BB\u30C3\u30C8\u30A2\u30C3\u30D7\n");
|
|
75
|
+
const apiUrl = options.apiUrl || (options.key ? DEFAULT_API_URL : void 0);
|
|
76
|
+
if (!options.key && options.apiUrl) {
|
|
77
|
+
console.error(" \u274C --api-url \u3092\u6307\u5B9A\u3057\u305F\u5834\u5408\u306F --key \u3082\u5FC5\u8981\u3067\u3059");
|
|
78
|
+
process.exit(1);
|
|
79
|
+
}
|
|
80
|
+
const useApiDownload = !!(options.key && apiUrl);
|
|
52
81
|
const name = projectName || await input({
|
|
53
82
|
message: "\u30D7\u30ED\u30B8\u30A7\u30AF\u30C8\u540D\u3092\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044:",
|
|
54
83
|
default: "my-cmx-site",
|
|
@@ -81,7 +110,11 @@ async function init(projectName, options) {
|
|
|
81
110
|
mkdirSync(targetDir, { recursive: true });
|
|
82
111
|
console.log("\n \u23F3 \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u4E2D...");
|
|
83
112
|
try {
|
|
84
|
-
|
|
113
|
+
if (useApiDownload) {
|
|
114
|
+
await downloadAndExtractViaApi(targetDir, apiUrl, options.key);
|
|
115
|
+
} else {
|
|
116
|
+
await downloadAndExtract(targetDir);
|
|
117
|
+
}
|
|
85
118
|
console.log(" \u2713 \u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u30C0\u30A6\u30F3\u30ED\u30FC\u30C9\u3057\u307E\u3057\u305F");
|
|
86
119
|
} catch (error) {
|
|
87
120
|
console.error(`
|
|
@@ -115,6 +148,10 @@ async function init(projectName, options) {
|
|
|
115
148
|
}
|
|
116
149
|
}
|
|
117
150
|
}
|
|
151
|
+
if (useApiDownload) {
|
|
152
|
+
writeEnvFile(targetDir, apiUrl, options.key);
|
|
153
|
+
console.log(" \u2713 .env \u306B API \u8A8D\u8A3C\u60C5\u5831\u3092\u66F8\u304D\u8FBC\u307F\u307E\u3057\u305F");
|
|
154
|
+
}
|
|
118
155
|
console.log(`
|
|
119
156
|
\u{1F4E6} \u4F9D\u5B58\u30D1\u30C3\u30B1\u30FC\u30B8\u3092\u30A4\u30F3\u30B9\u30C8\u30FC\u30EB\u4E2D...`);
|
|
120
157
|
const installCmd = packageManager === "yarn" ? "yarn" : `${packageManager} install`;
|
|
@@ -153,13 +190,25 @@ async function init(projectName, options) {
|
|
|
153
190
|
console.log(" \u26A0\uFE0F Git \u306E\u521D\u671F\u5316\u3092\u30B9\u30AD\u30C3\u30D7\u3057\u307E\u3057\u305F");
|
|
154
191
|
}
|
|
155
192
|
const runCmd = packageManager === "npm" ? "npm run" : packageManager;
|
|
193
|
+
const envSetupMessage = useApiDownload ? "" : `
|
|
194
|
+
\u26A0\uFE0F .env \u30D5\u30A1\u30A4\u30EB\u306B\u4EE5\u4E0B\u306E\u8A2D\u5B9A\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044:
|
|
195
|
+
CMX_API_KEY=your_api_key
|
|
196
|
+
CMX_API_URL=your_api_url
|
|
197
|
+
`;
|
|
198
|
+
const serverStartMessage = includeStudio ? `
|
|
199
|
+
\u958B\u767A\u30B5\u30FC\u30D0\u30FC\u306E\u8D77\u52D5\u65B9\u6CD5:
|
|
200
|
+
Option 1: \u30B5\u30A4\u30C8\u306E\u307F\u8D77\u52D5 (localhost:4000)
|
|
201
|
+
${runCmd} dev
|
|
202
|
+
|
|
203
|
+
Option 2: \u30B5\u30A4\u30C8 + Studio \u540C\u6642\u8D77\u52D5 (\u30B5\u30A4\u30C8: 4000, Studio: 4001)
|
|
204
|
+
npx cmx-sdk studio` : `
|
|
205
|
+
\u958B\u767A\u30B5\u30FC\u30D0\u30FC\u306E\u8D77\u52D5:
|
|
206
|
+
${runCmd} dev # \u30B5\u30A4\u30C8\u3092\u8D77\u52D5 (localhost:4000)`;
|
|
156
207
|
console.log(`
|
|
157
208
|
\u2705 \u30D7\u30ED\u30B8\u30A7\u30AF\u30C8 "${name}" \u3092\u4F5C\u6210\u3057\u307E\u3057\u305F\uFF01
|
|
158
209
|
|
|
159
210
|
\u6B21\u306E\u30B9\u30C6\u30C3\u30D7:
|
|
160
|
-
cd ${name}
|
|
161
|
-
${runCmd} dev # \u30B5\u30A4\u30C8\u3092\u8D77\u52D5 (localhost:4000)${includeStudio ? `
|
|
162
|
-
npx cmx-sdk studio # \u30B5\u30A4\u30C8 + Studio \u3092\u8D77\u52D5` : ""}
|
|
211
|
+
cd ${name}${envSetupMessage}${serverStartMessage}
|
|
163
212
|
|
|
164
213
|
\u{1F4D6} \u30C9\u30AD\u30E5\u30E1\u30F3\u30C8: https://cmx-ai.org/docs
|
|
165
214
|
\u{1F3A8} CMX Admin: https://app.cmx-ai.org
|
|
@@ -17,11 +17,11 @@ async function interactiveMenu() {
|
|
|
17
17
|
});
|
|
18
18
|
switch (action) {
|
|
19
19
|
case "init": {
|
|
20
|
-
const { init } = await import("./init-
|
|
20
|
+
const { init } = await import("./init-NDNG5Q5T.js");
|
|
21
21
|
return init(void 0, {});
|
|
22
22
|
}
|
|
23
23
|
case "add-studio": {
|
|
24
|
-
const { addStudio } = await import("./add-studio-
|
|
24
|
+
const { addStudio } = await import("./add-studio-J7M7KOWM.js");
|
|
25
25
|
return addStudio();
|
|
26
26
|
}
|
|
27
27
|
case "studio": {
|
package/dist/studio-3YGVKWS4.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cmx-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "CMX SDK - Official SDK for building content-driven websites with CMX",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,13 +34,6 @@
|
|
|
34
34
|
"import": "./dist/index.js"
|
|
35
35
|
}
|
|
36
36
|
},
|
|
37
|
-
"scripts": {
|
|
38
|
-
"prebuild": "node scripts/copy-api-client.js",
|
|
39
|
-
"build": "tsup",
|
|
40
|
-
"dev": "tsup --watch",
|
|
41
|
-
"typecheck": "tsc --noEmit",
|
|
42
|
-
"prepublishOnly": "pnpm run build"
|
|
43
|
-
},
|
|
44
37
|
"dependencies": {
|
|
45
38
|
"@inquirer/prompts": "^8.2.0",
|
|
46
39
|
"@mdx-js/mdx": "^3.1.1",
|
|
@@ -62,5 +55,11 @@
|
|
|
62
55
|
"@types/react-dom": "^19",
|
|
63
56
|
"tsup": "^8",
|
|
64
57
|
"typescript": "^5"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"prebuild": "node scripts/copy-api-client.js",
|
|
61
|
+
"build": "tsup",
|
|
62
|
+
"dev": "tsup --watch",
|
|
63
|
+
"typecheck": "tsc --noEmit"
|
|
65
64
|
}
|
|
66
|
-
}
|
|
65
|
+
}
|