cmx-sdk 0.2.15 → 0.2.16

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.
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/dist/cli.js CHANGED
@@ -4677,6 +4677,7 @@ async function uploadAsset(options) {
4677
4677
  formData.append("file", new Blob([fileBuffer], { type: mimeType }), basename2(options.file));
4678
4678
  if (options.alt) formData.append("alt", options.alt);
4679
4679
  if (options.description) formData.append("description", options.description);
4680
+ if (options.aiSummary) formData.append("aiSummary", options.aiSummary);
4680
4681
  if (options.group) formData.append("group", options.group);
4681
4682
  if (options.tags) formData.append("tags", options.tags);
4682
4683
  console.log(`\u30A2\u30BB\u30C3\u30C8\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3057\u3066\u3044\u307E\u3059: ${options.file}...`);
@@ -4799,6 +4800,7 @@ async function updateAsset(options) {
4799
4800
  };
4800
4801
  if (options.alt !== void 0) requestBody.alt = options.alt;
4801
4802
  if (options.description !== void 0) requestBody.description = options.description;
4803
+ if (options.aiSummary !== void 0) requestBody.aiSummary = options.aiSummary;
4802
4804
  if (options.clearGroup) {
4803
4805
  requestBody.groupSlug = null;
4804
4806
  } else if (options.group !== void 0) {
@@ -4967,9 +4969,9 @@ program.command("remove-collection-data-type").description("\u30B3\u30EC\u30AF\u
4967
4969
  program.command("link-collection-data-type").description("\u65E2\u5B58\u306E\u30B0\u30ED\u30FC\u30D0\u30EB\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u3092\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u3078\u7D10\u3065\u3051").requiredOption("--collection <slug>", "\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--data-type <slug>", "\u7D10\u3065\u3051\u308B\u30B0\u30ED\u30FC\u30D0\u30EB\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--field-slug <slug>", "\u53C2\u7167\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--label <label>", "\u53C2\u7167\u30D5\u30A3\u30FC\u30EB\u30C9\u306E\u8868\u793A\u540D").option("--reference-type <type>", "\u53C2\u7167\u30BF\u30A4\u30D7\uFF08single \u307E\u305F\u306F multiple\u3001\u65E2\u5B9A: single\uFF09", "single").action(linkCollectionDataType);
4968
4970
  program.command("list-collection-presets").description("\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u5411\u3051\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u30D7\u30EA\u30BB\u30C3\u30C8\u4E00\u89A7\u3092\u8868\u793A").option("--type <type>", "\u30B3\u30EC\u30AF\u30B7\u30E7\u30F3\u7A2E\u5225 (post, news, doc, page)").action(listCollectionPresets);
4969
4971
  program.command("create-data-entry").description("\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u3092\u4F5C\u6210").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").option("--json <json>", "\u30A8\u30F3\u30C8\u30EA\u30FC\u5185\u5BB9\u306E JSON \u6587\u5B57\u5217").option("--file <file>", "\u30A8\u30F3\u30C8\u30EA\u30FC\u5185\u5BB9 JSON \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9").option("--status <status>", "\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08draft, review, published\uFF09").action(createDataEntry);
4970
- program.command("upload-asset").description("\u30A2\u30BB\u30C3\u30C8\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08MCP Assets API\uFF09").requiredOption("--file <path>", "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9").option("--alt <text>", "\u4EE3\u66FF\u30C6\u30AD\u30B9\u30C8").option("--description <text>", "\u8AAC\u660E").option("--group <slug>", "\u30A2\u30BB\u30C3\u30C8\u30B0\u30EB\u30FC\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").option("--tags <tags>", "\u30BF\u30B0\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09").option("--mime <type>", "MIME type\uFF08\u672A\u6307\u5B9A\u6642\u306F\u62E1\u5F35\u5B50\u304B\u3089\u63A8\u5B9A\uFF09").action(uploadAsset);
4972
+ program.command("upload-asset").description("\u30A2\u30BB\u30C3\u30C8\u3092\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\uFF08MCP Assets API\uFF09").requiredOption("--file <path>", "\u30A2\u30C3\u30D7\u30ED\u30FC\u30C9\u3059\u308B\u30D5\u30A1\u30A4\u30EB\u30D1\u30B9").option("--alt <text>", "\u4EE3\u66FF\u30C6\u30AD\u30B9\u30C8").option("--description <text>", "\u8AAC\u660E").option("--ai-summary <text>", "AI\u5411\u3051\u30B5\u30DE\u30EA\uFF08\u753B\u50CF\u5185\u5BB9\u306E\u6587\u7AE0\u8AAC\u660E\uFF09").option("--group <slug>", "\u30A2\u30BB\u30C3\u30C8\u30B0\u30EB\u30FC\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").option("--tags <tags>", "\u30BF\u30B0\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09").option("--mime <type>", "MIME type\uFF08\u672A\u6307\u5B9A\u6642\u306F\u62E1\u5F35\u5B50\u304B\u3089\u63A8\u5B9A\uFF09").action(uploadAsset);
4971
4973
  program.command("list-assets").description("\u30A2\u30BB\u30C3\u30C8\u3092\u691C\u7D22\u30FB\u4E00\u89A7\u8868\u793A\uFF08MCP Assets API\uFF09").option("--group <slug>", "\u30B0\u30EB\u30FC\u30D7\u30B9\u30E9\u30C3\u30B0\u3067\u7D5E\u308A\u8FBC\u307F").option("--tags <tags>", "\u30BF\u30B0\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09\u3067\u7D5E\u308A\u8FBC\u307F").option("--query <text>", "\u691C\u7D22\u30AF\u30A8\u30EA\uFF08alt/description \u3092\u691C\u7D22\uFF09").option("--mime <type>", "MIME type\uFF08\u4F8B: image, video, image/png\uFF09").option("--limit <number>", "\u53D6\u5F97\u4EF6\u6570\uFF08\u6700\u592750\uFF09").option("--offset <number>", "\u30AA\u30D5\u30BB\u30C3\u30C8").action(listAssets);
4972
- program.command("update-asset").description("\u30A2\u30BB\u30C3\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u66F4\u65B0\uFF08MCP Assets API\uFF09").requiredOption("--id <id>", "\u30A2\u30BB\u30C3\u30C8 ID").option("--alt <text>", "\u4EE3\u66FF\u30C6\u30AD\u30B9\u30C8\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--description <text>", "\u8AAC\u660E\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--group <slug>", "\u30B0\u30EB\u30FC\u30D7\u30B9\u30E9\u30C3\u30B0").option("--clear-group", "\u30B0\u30EB\u30FC\u30D7\u3092\u89E3\u9664").option("--tags <tags>", "\u30BF\u30B0\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09").option("--clear-tags", "\u30BF\u30B0\u3092\u5168\u524A\u9664").action(updateAsset);
4974
+ program.command("update-asset").description("\u30A2\u30BB\u30C3\u30C8\u306E\u30E1\u30BF\u30C7\u30FC\u30BF\u3092\u66F4\u65B0\uFF08MCP Assets API\uFF09").requiredOption("--id <id>", "\u30A2\u30BB\u30C3\u30C8 ID").option("--alt <text>", "\u4EE3\u66FF\u30C6\u30AD\u30B9\u30C8\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--description <text>", "\u8AAC\u660E\uFF08\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--ai-summary <text>", "AI\u5411\u3051\u30B5\u30DE\u30EA\uFF08\u753B\u50CF\u5185\u5BB9\u306E\u6587\u7AE0\u8AAC\u660E\u3002\u7A7A\u6587\u5B57\u3067\u30AF\u30EA\u30A2\uFF09").option("--group <slug>", "\u30B0\u30EB\u30FC\u30D7\u30B9\u30E9\u30C3\u30B0").option("--clear-group", "\u30B0\u30EB\u30FC\u30D7\u3092\u89E3\u9664").option("--tags <tags>", "\u30BF\u30B0\uFF08\u30AB\u30F3\u30DE\u533A\u5207\u308A\uFF09").option("--clear-tags", "\u30BF\u30B0\u3092\u5168\u524A\u9664").action(updateAsset);
4973
4975
  program.command("list-data-entries").description("\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u3054\u3068\u306E\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u4E00\u89A7\u3092\u8868\u793A").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").option("--sort-by <field>", "\u4E26\u3073\u66FF\u3048\u5BFE\u8C61\u30D5\u30A3\u30FC\u30EB\u30C9").option("--sort-order <order>", "\u4E26\u3073\u9806 (asc \u307E\u305F\u306F desc)").option("--limit <number>", "\u53D6\u5F97\u4EF6\u6570\u306E\u4E0A\u9650").option("--offset <number>", "\u30B9\u30AD\u30C3\u30D7\u4EF6\u6570").option("--status <status>", "\u30B9\u30C6\u30FC\u30BF\u30B9\u3067\u7D5E\u308A\u8FBC\u307F\uFF08draft, review, published\uFF09").action(listDataEntries);
4974
4976
  program.command("get-data-entry").description("\u5358\u4E00\u306E\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u3092\u53D6\u5F97").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--id <id>", "\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC ID").action(getDataEntry);
4975
4977
  program.command("update-data-entry").description("\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC\u3092\u66F4\u65B0").requiredOption("--type-slug <slug>", "\u30C7\u30FC\u30BF\u30BF\u30A4\u30D7\u306E\u30B9\u30E9\u30C3\u30B0").requiredOption("--id <id>", "\u30C7\u30FC\u30BF\u30A8\u30F3\u30C8\u30EA\u30FC ID").option("--json <json>", "\u66F4\u65B0\u5185\u5BB9\u306E JSON \u6587\u5B57\u5217").option("--file <file>", "\u66F4\u65B0\u5185\u5BB9 JSON \u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9").option("--status <status>", "\u30B9\u30C6\u30FC\u30BF\u30B9\uFF08draft, review, published\uFF09").action(updateDataEntry);
package/dist/index.d.ts CHANGED
@@ -222,6 +222,15 @@ interface PublicContentDetail {
222
222
  slug: string;
223
223
  title: string;
224
224
  description: string | null;
225
+ /**
226
+ * カバー画像URL(deprecated: coverImageAssetId を使用)
227
+ * @deprecated
228
+ */
229
+ coverImageUrl: string | null;
230
+ /** カバー画像アセットID */
231
+ coverImageAssetId: string | null;
232
+ /** カバー画像外部URL */
233
+ coverImageExternalUrl: string | null;
225
234
  publishedAt: string | null;
226
235
  updatedAt: string | null;
227
236
  mdx: string;
@@ -306,6 +315,15 @@ interface PublicContentListItem {
306
315
  slug: string;
307
316
  title: string;
308
317
  description: string | null;
318
+ /**
319
+ * カバー画像URL(deprecated: coverImageAssetId を使用)
320
+ * @deprecated
321
+ */
322
+ coverImageUrl: string | null;
323
+ /** カバー画像アセットID */
324
+ coverImageAssetId: string | null;
325
+ /** カバー画像外部URL */
326
+ coverImageExternalUrl: string | null;
309
327
  publishedAt: string | null;
310
328
  updatedAt: string | null;
311
329
  }
@@ -453,8 +471,15 @@ interface CreateContentRequest {
453
471
  * @maxLength 1000
454
472
  */
455
473
  summary?: string;
456
- /** カバー画像URL */
474
+ /**
475
+ * カバー画像URL(deprecated: coverImageAssetId を使用)
476
+ * @deprecated
477
+ */
457
478
  coverImageUrl?: string;
479
+ /** カバー画像アセットID */
480
+ coverImageAssetId?: string | null;
481
+ /** カバー画像外部URL(アセットシステム外の画像) */
482
+ coverImageExternalUrl?: string | null;
458
483
  /** 作成と同時に公開する */
459
484
  autoPublish?: boolean;
460
485
  }
@@ -956,7 +981,7 @@ type GetManageCollectionPresetsParams = {
956
981
  */
957
982
  type GetManageContentsIdParams = {
958
983
  /**
959
- * 取得するフィールド(カンマ区切り)。指定可能: id, collectionId, slug, title, description, summary, coverImageUrl, status, parentId, sortOrder, locale, publishedAt, createdAt, updatedAt, mdx, frontmatterJson, seoJson
984
+ * 取得するフィールド(カンマ区切り)。指定可能: id, collectionId, slug, title, description, summary, coverImageUrl, coverImageAssetId, coverImageExternalUrl, status, parentId, sortOrder, locale, publishedAt, createdAt, updatedAt, mdx, frontmatterJson, seoJson
960
985
  */
961
986
  fields?: string;
962
987
  };
@@ -990,7 +1015,7 @@ type GetManageContentsParams = {
990
1015
  */
991
1016
  offset?: number | null;
992
1017
  /**
993
- * 取得するフィールド(カンマ区切り)。指定可能: id, collectionId, slug, title, description, summary, coverImageUrl, status, parentId, sortOrder, locale, publishedAt, createdAt, updatedAt
1018
+ * 取得するフィールド(カンマ区切り)。指定可能: id, collectionId, slug, title, description, summary, coverImageUrl, coverImageAssetId, coverImageExternalUrl, status, parentId, sortOrder, locale, publishedAt, createdAt, updatedAt
994
1019
  */
995
1020
  fields?: string;
996
1021
  };
@@ -1004,7 +1029,7 @@ type GetManageContentsParams = {
1004
1029
  */
1005
1030
  type GetManageDataTypeSlugIdParams = {
1006
1031
  /**
1007
- * 取得するフィールド(カンマ区切り)。指定可能: id, dataTypeId, dataJson, status, sortOrder, createdAt, updatedAt
1032
+ * 取得するフィールド(カンマ区切り)。指定可能: id, dataTypeId, dataJson, aiSummary, status, sortOrder, createdAt, updatedAt
1008
1033
  */
1009
1034
  fields?: string;
1010
1035
  };
@@ -1083,7 +1108,7 @@ type GetManageDataTypeSlugParams = {
1083
1108
  */
1084
1109
  offset?: number | null;
1085
1110
  /**
1086
- * 取得するエントリフィールド(カンマ区切り)。指定可能: id, dataTypeId, dataJson, status, sortOrder, createdAt, updatedAt
1111
+ * 取得するエントリフィールド(カンマ区切り)。指定可能: id, dataTypeId, dataJson, aiSummary, status, sortOrder, createdAt, updatedAt
1087
1112
  */
1088
1113
  fields?: string;
1089
1114
  };
@@ -1578,6 +1603,8 @@ interface SdkContentDetail {
1578
1603
  description: string | null;
1579
1604
  summary: string | null;
1580
1605
  coverImageUrl: string | null;
1606
+ coverImageAssetId: string | null;
1607
+ coverImageExternalUrl: string | null;
1581
1608
  frontmatterJson: SdkContentDetailFrontmatterJson;
1582
1609
  seoJson: SdkContentDetailSeoJson;
1583
1610
  status: ContentStatus;
@@ -1606,6 +1633,8 @@ interface SdkContentItem {
1606
1633
  description: string | null;
1607
1634
  summary: string | null;
1608
1635
  coverImageUrl: string | null;
1636
+ coverImageAssetId: string | null;
1637
+ coverImageExternalUrl: string | null;
1609
1638
  status: ContentStatus;
1610
1639
  parentId: string | null;
1611
1640
  sortOrder: number;
@@ -1877,6 +1906,7 @@ interface SdkDataEntryResponse {
1877
1906
  id: string;
1878
1907
  dataTypeId: string;
1879
1908
  dataJson: SdkDataEntryResponseDataJson;
1909
+ aiSummary: string | null;
1880
1910
  /** データエントリのステータス */
1881
1911
  status: SdkDataEntryResponseStatus;
1882
1912
  sortOrder: number;
@@ -2451,8 +2481,15 @@ interface UpdateContentRequest {
2451
2481
  * @maxLength 1000
2452
2482
  */
2453
2483
  summary?: string | null;
2454
- /** カバー画像URL */
2484
+ /**
2485
+ * カバー画像URL(deprecated: coverImageAssetId を使用)
2486
+ * @deprecated
2487
+ */
2455
2488
  coverImageUrl?: string | null;
2489
+ /** カバー画像アセットID */
2490
+ coverImageAssetId?: string | null;
2491
+ /** カバー画像外部URL(アセットシステム外の画像) */
2492
+ coverImageExternalUrl?: string | null;
2456
2493
  }
2457
2494
 
2458
2495
  /**
File without changes
File without changes
File without changes
File without changes
File without changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmx-sdk",
3
- "version": "0.2.15",
3
+ "version": "0.2.16",
4
4
  "description": "CMX SDK - Official SDK for building content-driven websites with CMX",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -35,6 +35,20 @@
35
35
  },
36
36
  "./styles/cmx-mdx.css": "./dist/styles/cmx-mdx.css"
37
37
  },
38
+ "scripts": {
39
+ "prebuild": "node scripts/copy-api-client.js",
40
+ "sync:starter-kit-docs": "pnpm --filter @cmx/api-server generate:openapi && node scripts/sync-starter-kit-docs.mjs --write",
41
+ "sync:starter-kit-docs:check": "pnpm --filter @cmx/api-server generate:openapi && node scripts/sync-starter-kit-docs.mjs --check",
42
+ "check:sdk-command-api-usage": "node scripts/check-sdk-command-api-usage.mjs",
43
+ "check:generated-sync": "node scripts/check-generated-sync.mjs",
44
+ "test:contracts": "tsx scripts/check-cli-contracts.ts",
45
+ "verify:release": "pnpm run check:sdk-command-api-usage && pnpm run check:generated-sync && pnpm run test:contracts",
46
+ "build": "tsup",
47
+ "postbuild": "rm -rf dist/styles && cp -r src/mdx/styles dist/styles",
48
+ "dev": "tsup --watch",
49
+ "typecheck": "tsc --noEmit",
50
+ "prepublishOnly": "pnpm run verify:release && pnpm run sync:starter-kit-docs:check && pnpm run build"
51
+ },
38
52
  "dependencies": {
39
53
  "@inquirer/prompts": "^8.2.1",
40
54
  "@mdx-js/mdx": "^3.1.1",
@@ -58,18 +72,5 @@
58
72
  "tsup": "^8.5.1",
59
73
  "tsx": "^4.21.0",
60
74
  "typescript": "^5.9.3"
61
- },
62
- "scripts": {
63
- "prebuild": "node scripts/copy-api-client.js",
64
- "sync:starter-kit-docs": "pnpm --filter @cmx/api-server generate:openapi && node scripts/sync-starter-kit-docs.mjs --write",
65
- "sync:starter-kit-docs:check": "pnpm --filter @cmx/api-server generate:openapi && node scripts/sync-starter-kit-docs.mjs --check",
66
- "check:sdk-command-api-usage": "node scripts/check-sdk-command-api-usage.mjs",
67
- "check:generated-sync": "node scripts/check-generated-sync.mjs",
68
- "test:contracts": "tsx scripts/check-cli-contracts.ts",
69
- "verify:release": "pnpm run check:sdk-command-api-usage && pnpm run check:generated-sync && pnpm run test:contracts",
70
- "build": "tsup",
71
- "postbuild": "rm -rf dist/styles && cp -r src/mdx/styles dist/styles",
72
- "dev": "tsup --watch",
73
- "typecheck": "tsc --noEmit"
74
75
  }
75
- }
76
+ }