@roottale/cms-client 0.67.1 → 0.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # @roottale/cms-client
2
2
 
3
+ ## 0.69.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 30b830f: 분류 기반 경로에서 선언한 첫 분류 선택, 미분류 대체 경로와 예약 경로를 공통 계산기로 처리합니다. 기존 분류 하나 필수 규칙은 그대로 유지합니다.
8
+
9
+ 공개 필드와 본문에 기반한 콘텐츠 공개·검색 색인 정책 및 목록 선택 계약을 추가합니다. FRONT의 본문, 목록, sitemap과 관리자 메타데이터가 같은 평가기를 사용하며 강제 검색 제외 사유와 정책 전용 웹훅 캐시 무효화를 제공합니다. 정책을 선언하지 않은 연동의 동작은 유지됩니다.
10
+
11
+ 글 조회에 캐시 태그 옵션을 공개하고 RootTaleBlogPost에 독립 categoryHref 속성을 추가해 별도 breadcrumb가 있는 사이트도 분류 링크를 정확히 연결할 수 있습니다. 정책 적용 예제와 공개 문서를 함께 제공합니다.
12
+
13
+ ### Patch Changes
14
+
15
+ - Updated dependencies [30b830f]
16
+ - @roottale/cms-core@0.69.0
17
+
18
+ ## 0.68.0
19
+
20
+ ### Minor Changes
21
+
22
+ - d7130d8: 기존 고객 사이트의 검색·공유 기본값을 선언형 계약으로 보존합니다. 문자열 커스텀 필드 템플릿, 본문 문단 대체값, Unicode와 단어 경계 말줄임, 고정 이미지 기본값, 모델별 강제 robots와 분류 공개 경로를 지원합니다. 수동 SEO 설정은 우선하며 강제 검색 차단은 유지합니다.
23
+
24
+ 분류 조회 SDK에 색인 전환 상태와 추가 캐시 태그를 연결하고 외부 연동 문서·실행 예제를 함께 제공합니다.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [d7130d8]
29
+ - @roottale/cms-core@0.68.0
30
+
3
31
  ## 0.67.1
4
32
 
5
33
  ### Patch Changes
package/dist/server.d.ts CHANGED
@@ -3,7 +3,7 @@ export { InquiryAnswer, InquiryFormDefinition, InquiryFormField, InquiryKind } f
3
3
  import { InquiryAttribution } from './attribution.js';
4
4
  export { parseAttributionJson } from './attribution.js';
5
5
  import { PublicRouteMetadata } from '@roottale/cms-core';
6
- export { MetadataDefaultRules, MetadataDefaultRulesSchema, MetadataDefaultsDeclaration, MetadataDefaultsInput, MetadataField, MetadataPatch, MetadataResolutionInput, MetadataRobotsPolicy, MetadataTextRule, MetadataValues, PublicRouteMetadata, formatMetadataDefaults, metadataContentImageUrl, readMetadataValues, resolveMetadata } from '@roottale/cms-core';
6
+ export { MetadataDefaultRules, MetadataDefaultRulesSchema, MetadataDefaultsDeclaration, MetadataDefaultsInput, MetadataField, MetadataPatch, MetadataResolutionInput, MetadataRobotsPolicy, MetadataTextRule, MetadataValues, PublicRouteMetadata, formatMetadataDefaults, metadataBodyParagraphs, metadataContentImageUrl, readMetadataValues, resolveMetadata } from '@roottale/cms-core';
7
7
 
8
8
  /**
9
9
  * `@roottale/cms-client/server` — RootTale CMS Public API server-side fetch client.
@@ -31,6 +31,8 @@ interface CmsTermRef {
31
31
  taxonomy: CmsTaxonomyKind;
32
32
  slug: string;
33
33
  name: string;
34
+ termOrder?: number;
35
+ parentId?: string | null;
34
36
  }
35
37
  interface CmsArchiveRelatedPost {
36
38
  id: string;
@@ -251,6 +253,8 @@ interface FetchPostsOptions {
251
253
  signal?: AbortSignal;
252
254
  /** ISR revalidate 초(opt-in, W0-9). 미지정 시 현행 동작 유지. */
253
255
  revalidate?: number;
256
+ /** Next fetch cache tags. Use CONTENT_POLICY_CACHE_TAG for declared policy facts. */
257
+ tags?: string[];
254
258
  }
255
259
  interface FetchPostOptions {
256
260
  apiKey: string;
@@ -264,6 +268,8 @@ interface FetchPostOptions {
264
268
  signal?: AbortSignal;
265
269
  /** ISR revalidate 초(opt-in, W0-9). 미지정 시 현행 동작 유지. */
266
270
  revalidate?: number;
271
+ /** Next fetch cache tags. Use CONTENT_POLICY_CACHE_TAG for declared policy facts. */
272
+ tags?: string[];
267
273
  }
268
274
  declare class CmsApiError extends Error {
269
275
  readonly status: number;
@@ -643,6 +649,9 @@ interface CmsContentModel {
643
649
  readonly categoryDepth: number;
644
650
  /** `leaf`면 하위 분류가 없는 분류에 단계와 무관하게 글을 붙인다. 생략은 `deepest`. */
645
651
  readonly entryCategory?: "deepest" | "leaf";
652
+ readonly categorySelection?: "first";
653
+ readonly categoryFallbackSlug?: string;
654
+ readonly reservedCategorySlugs?: readonly string[];
646
655
  readonly templateKey?: string;
647
656
  readonly listPaths?: readonly string[];
648
657
  };
@@ -742,6 +751,7 @@ interface CmsCategoryCount {
742
751
  name: string;
743
752
  /** 부모 category term id. 루트면 null. */
744
753
  parentId?: string | null;
754
+ termOrder?: number;
745
755
  /** 요청 스코프(미소속/특정 스트림) 안에서 이 분류에 걸린 발행 글 수. 0 가능. */
746
756
  publishedPostCount: number;
747
757
  /** 이 분류가 귀속된 콘텐츠 유형 key (ADR-0060). 미귀속·구버전 응답이면 null. */
@@ -767,6 +777,8 @@ interface CmsCategoryCount {
767
777
  }
768
778
  interface CmsCategoryCounts {
769
779
  categories: CmsCategoryCount[];
780
+ /** Apply hubPromoted metadata policy only after explicit site activation. */
781
+ categoryIndexActivated?: boolean;
770
782
  /** 분류 수가 서버 상한을 넘어 일부가 빠졌으면 true — 소비처는 경고를 남길 것. */
771
783
  truncated: boolean;
772
784
  }
@@ -787,6 +799,8 @@ interface FetchCategoryCountsOptions {
787
799
  signal?: AbortSignal;
788
800
  /** ISR revalidate 초(opt-in). 미지정 시 현행 동작 유지. */
789
801
  revalidate?: number;
802
+ /** Additional Next.js data-cache tags (for example METADATA_CACHE_TAG). */
803
+ tags?: string[];
790
804
  }
791
805
  /**
792
806
  * 사이트의 모든 분류와 발행 글 수를 가져온다. 네트워크/서버 에러는 **throw** —
@@ -1353,6 +1367,8 @@ declare function selectSitePatternForSlot(patternSlots: Readonly<Record<string,
1353
1367
 
1354
1368
  declare const METADATA_CACHE_TAG = "rt-metadata";
1355
1369
  declare const SITE_METADATA_DEFAULTS_CACHE_TAG = "rt-metadata-defaults";
1370
+ /** Add to public post/term fetches whose fields determine a declared content policy. */
1371
+ declare const CONTENT_POLICY_CACHE_TAG = "rt-content-policy";
1356
1372
  /** locale를 생략한 요청은 사이트 기본 locale을 조회한다. */
1357
1373
  declare function routeMetadataCacheTag(routeKey: string, locale?: string): string;
1358
1374
  interface FetchRouteMetadataOptions {
@@ -1691,4 +1707,4 @@ declare function formatKoreanPhoneNumber(input: string): string;
1691
1707
  */
1692
1708
  declare function submitInquiry(options: SubmitInquiryOptions): Promise<SubmitInquiryResult>;
1693
1709
 
1694
- export { type ActionDockAction, type ActionDockKind, type ActionDockPosition, type ActionDockSettings, type AnalyticsTagConfig, type AnalyticsTagProvider, type AnnouncementItem, type AnnouncementSettings, type AnnouncementTone, type AnnouncementVariant, type ArticleSchemaInput, BLOG_SETTINGS_CACHE_TAG, BUSINESS_CACHE_TAG, type BusinessDayCode, type BusinessOpeningHours, type BusinessType, CMS_CLIENT_VERSION, COLLECTIONS_CACHE_TAG, CmsApiError, type CmsArchiveRelatedGroup, type CmsArchiveRelatedPost, type CmsCategoryCount, type CmsCategoryCounts, type CmsContentModel, type CmsExposureCampaign, type CmsExposureDecision, type CmsFieldMetaEntry, type CmsPostContent, type CmsPostContentPage, type CmsPostPreviewContent, type CmsPostPreviewInfo, type CmsPostTranslationRef, type CmsPostType, type CmsRouteCollection, type CmsSearchHit, type CmsSitePattern, type CmsSitePatternPresentation, type CmsTaxonomyKind, type CmsTermRef, DEFAULT_BLOG_SETTINGS, DEFAULT_SITE_PATTERN_PRESENTATION, EXPOSURE_CACHE_TAG, type FetchAnalyticsOptions, type FetchAuthorsOptions, type FetchBlogSettingsOptions, type FetchBusinessProfileOptions, type FetchCategoryCountsOptions, type FetchCollectionsOptions, type FetchContentModelsOptions, type FetchExposureDecisionOptions, type FetchExposureOptions, type FetchInquiryFormOptions, type FetchMenuOptions, type FetchMenusOptions, type FetchPageBySlugOptions, type FetchPostOptions, type FetchPostPreviewOptions, type FetchPostsOptions, type FetchRedirectsOptions, type FetchRouteMetadataOptions, type FetchSiteInquiriesOptions, type FetchSiteInquiryOptions, type FetchSitePatternsOptions, type FetchThemeOptions, type FormInquiryReceipt, INQUIRY_ERROR_MESSAGES, InquiryAttribution, type InquiryBoardSettings, type InquiryVertical, LOCAL_BUSINESS_MAX_SERVICES, LOCAL_BUSINESS_SERVICE_MAX_LENGTH, type LocalBusinessProfileInput, MENUS_CACHE_TAG, METADATA_CACHE_TAG, POST_FOOTER_PATTERN_SLOT, type PublishedInquiryForm, type ResolvedPostDisplay, type RootTaleAuthor, type RootTaleBlogPostCta, type RootTaleBlogSettings, type RootTaleBusinessProfile, type RootTaleMenu, type RootTaleMenuItem, type RootTaleRedirect, type RootTaleSiteProfile, type RootTaleSitemapSettings, type RootTaleTheme, type RssFeedInput, type RssItemInput, SETTINGS_CACHE_TAGS, SITE_METADATA_DEFAULTS_CACHE_TAG, SITE_PATTERNS_CACHE_TAG, type SearchPostsOptions, type SiteAnalyticsTags, type SiteInquiryDetail, type SiteInquiryListItem, type SiteInquiryListPage, type SiteInquiryStatus, type SiteNavColumn, type SiteNavCta, type SiteNavGroup, type SiteNavLink, type SiteNavSettings, type SiteVerificationMetadata, type SiteVerificationSettings, type SubmitFormInquiryFields, type SubmitFormInquiryOptions, type SubmitFormInquiryResult, type SubmitInquiryFields, type SubmitInquiryOptions, type SubmitInquiryResult, type SubmitSiteInquiryFields, type SubmitSiteInquiryOptions, type SubmitSiteInquiryResult, THEME_CACHE_TAG, articleSchema, breadcrumbSchema, businessProfileFromWire, collectionPageSchema, contentIdMeta, faqSchema, fetchAnalyticsConfig, fetchAuthors, fetchBlogSettings, fetchBusinessProfile, fetchCategoryCounts, fetchCollections, fetchCollectionsSafeDefault, fetchContentModels, fetchExposure, fetchExposureDecision, fetchInquiryForm, fetchMenu, fetchMenus, fetchPageBySlug, fetchPost, fetchPostPreview, fetchPosts, fetchRedirects, fetchRouteMetadata, fetchSiteInquiries, fetchSiteInquiry, fetchSitePatterns, fetchTheme, formatKoreanPhoneNumber, generateRssXml, inquiryErrorMessage, isPreviewExpiredError, jsonLdJson, jsonLdScript, localBusinessSchema, metadataContractChecksum, organizationSchema, parseInquiryRedirect, profilePageSchema, resolvePostDisplay, resolveSearchHitPath, routeMetadataCacheTag, rssItemsFromPosts, searchPosts, selectRelatedPosts, selectSitePatternForSlot, sitePatternPresentationAttributes, siteVerificationMetadata, submitFormInquiry, submitInquiry, submitSiteInquiry, websiteSchema };
1710
+ export { type ActionDockAction, type ActionDockKind, type ActionDockPosition, type ActionDockSettings, type AnalyticsTagConfig, type AnalyticsTagProvider, type AnnouncementItem, type AnnouncementSettings, type AnnouncementTone, type AnnouncementVariant, type ArticleSchemaInput, BLOG_SETTINGS_CACHE_TAG, BUSINESS_CACHE_TAG, type BusinessDayCode, type BusinessOpeningHours, type BusinessType, CMS_CLIENT_VERSION, COLLECTIONS_CACHE_TAG, CONTENT_POLICY_CACHE_TAG, CmsApiError, type CmsArchiveRelatedGroup, type CmsArchiveRelatedPost, type CmsCategoryCount, type CmsCategoryCounts, type CmsContentModel, type CmsExposureCampaign, type CmsExposureDecision, type CmsFieldMetaEntry, type CmsPostContent, type CmsPostContentPage, type CmsPostPreviewContent, type CmsPostPreviewInfo, type CmsPostTranslationRef, type CmsPostType, type CmsRouteCollection, type CmsSearchHit, type CmsSitePattern, type CmsSitePatternPresentation, type CmsTaxonomyKind, type CmsTermRef, DEFAULT_BLOG_SETTINGS, DEFAULT_SITE_PATTERN_PRESENTATION, EXPOSURE_CACHE_TAG, type FetchAnalyticsOptions, type FetchAuthorsOptions, type FetchBlogSettingsOptions, type FetchBusinessProfileOptions, type FetchCategoryCountsOptions, type FetchCollectionsOptions, type FetchContentModelsOptions, type FetchExposureDecisionOptions, type FetchExposureOptions, type FetchInquiryFormOptions, type FetchMenuOptions, type FetchMenusOptions, type FetchPageBySlugOptions, type FetchPostOptions, type FetchPostPreviewOptions, type FetchPostsOptions, type FetchRedirectsOptions, type FetchRouteMetadataOptions, type FetchSiteInquiriesOptions, type FetchSiteInquiryOptions, type FetchSitePatternsOptions, type FetchThemeOptions, type FormInquiryReceipt, INQUIRY_ERROR_MESSAGES, InquiryAttribution, type InquiryBoardSettings, type InquiryVertical, LOCAL_BUSINESS_MAX_SERVICES, LOCAL_BUSINESS_SERVICE_MAX_LENGTH, type LocalBusinessProfileInput, MENUS_CACHE_TAG, METADATA_CACHE_TAG, POST_FOOTER_PATTERN_SLOT, type PublishedInquiryForm, type ResolvedPostDisplay, type RootTaleAuthor, type RootTaleBlogPostCta, type RootTaleBlogSettings, type RootTaleBusinessProfile, type RootTaleMenu, type RootTaleMenuItem, type RootTaleRedirect, type RootTaleSiteProfile, type RootTaleSitemapSettings, type RootTaleTheme, type RssFeedInput, type RssItemInput, SETTINGS_CACHE_TAGS, SITE_METADATA_DEFAULTS_CACHE_TAG, SITE_PATTERNS_CACHE_TAG, type SearchPostsOptions, type SiteAnalyticsTags, type SiteInquiryDetail, type SiteInquiryListItem, type SiteInquiryListPage, type SiteInquiryStatus, type SiteNavColumn, type SiteNavCta, type SiteNavGroup, type SiteNavLink, type SiteNavSettings, type SiteVerificationMetadata, type SiteVerificationSettings, type SubmitFormInquiryFields, type SubmitFormInquiryOptions, type SubmitFormInquiryResult, type SubmitInquiryFields, type SubmitInquiryOptions, type SubmitInquiryResult, type SubmitSiteInquiryFields, type SubmitSiteInquiryOptions, type SubmitSiteInquiryResult, THEME_CACHE_TAG, articleSchema, breadcrumbSchema, businessProfileFromWire, collectionPageSchema, contentIdMeta, faqSchema, fetchAnalyticsConfig, fetchAuthors, fetchBlogSettings, fetchBusinessProfile, fetchCategoryCounts, fetchCollections, fetchCollectionsSafeDefault, fetchContentModels, fetchExposure, fetchExposureDecision, fetchInquiryForm, fetchMenu, fetchMenus, fetchPageBySlug, fetchPost, fetchPostPreview, fetchPosts, fetchRedirects, fetchRouteMetadata, fetchSiteInquiries, fetchSiteInquiry, fetchSitePatterns, fetchTheme, formatKoreanPhoneNumber, generateRssXml, inquiryErrorMessage, isPreviewExpiredError, jsonLdJson, jsonLdScript, localBusinessSchema, metadataContractChecksum, organizationSchema, parseInquiryRedirect, profilePageSchema, resolvePostDisplay, resolveSearchHitPath, routeMetadataCacheTag, rssItemsFromPosts, searchPosts, selectRelatedPosts, selectSitePatternForSlot, sitePatternPresentationAttributes, siteVerificationMetadata, submitFormInquiry, submitInquiry, submitSiteInquiry, websiteSchema };
package/dist/server.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
 
5
5
  // src/server-base.ts
6
6
  var DEFAULT_BASE_URL = "https://api.roottale.com";
7
- var CLIENT_VERSION = true ? "0.67.1" : "dev";
7
+ var CLIENT_VERSION = true ? "0.69.0" : "dev";
8
8
  var CMS_CLIENT_VERSION = CLIENT_VERSION;
9
9
  function authHeaders(apiKey) {
10
10
  return {
@@ -129,7 +129,11 @@ function postFromWire(wire) {
129
129
  }))
130
130
  } : {}
131
131
  })),
132
- terms: wire.terms ?? [],
132
+ terms: (wire.terms ?? []).map(({ term_order, parent_id, ...term }) => ({
133
+ ...term,
134
+ ...term_order !== void 0 ? { termOrder: term_order } : {},
135
+ ...parent_id !== void 0 ? { parentId: parent_id } : {}
136
+ })),
133
137
  archiveRelated: (wire.archive_related ?? []).map((group) => ({
134
138
  collectionKey: group.collection_key,
135
139
  label: group.label,
@@ -394,6 +398,9 @@ async function fetchContentModels(options) {
394
398
  kind: "category_tree",
395
399
  basePath: rawPresentation.basePath,
396
400
  categoryDepth: rawPresentation.categoryDepth,
401
+ ...rawPresentation.categorySelection === "first" ? { categorySelection: "first" } : {},
402
+ ...typeof rawPresentation.categoryFallbackSlug === "string" ? { categoryFallbackSlug: rawPresentation.categoryFallbackSlug } : {},
403
+ ...Array.isArray(rawPresentation.reservedCategorySlugs) ? { reservedCategorySlugs: rawPresentation.reservedCategorySlugs.filter((slug) => typeof slug === "string") } : {},
397
404
  ...rawPresentation.entryCategory === "leaf" || rawPresentation.entryCategory === "deepest" ? { entryCategory: rawPresentation.entryCategory } : {},
398
405
  ...typeof rawPresentation.templateKey === "string" ? { templateKey: rawPresentation.templateKey } : {},
399
406
  ...withListPaths
@@ -553,6 +560,7 @@ async function fetchCategoryCounts(options) {
553
560
  slug,
554
561
  name,
555
562
  parentId: typeof o.parent_id === "string" ? o.parent_id : null,
563
+ ...typeof o.term_order === "number" && Number.isInteger(o.term_order) ? { termOrder: o.term_order } : {},
556
564
  publishedPostCount: toNonNegativeInt(o.published_post_count),
557
565
  collectionKey: typeof o.collection_key === "string" ? o.collection_key : null,
558
566
  hubPromoted: o.hub_promoted === true,
@@ -569,7 +577,8 @@ async function fetchCategoryCounts(options) {
569
577
  }
570
578
  ];
571
579
  }),
572
- truncated: json.truncated === true
580
+ truncated: json.truncated === true,
581
+ ...typeof json.category_index_activated === "boolean" ? { categoryIndexActivated: json.category_index_activated } : {}
573
582
  };
574
583
  }
575
584
 
@@ -1201,9 +1210,10 @@ function selectSitePatternForSlot(patternSlots, patterns, slot = POST_FOOTER_PAT
1201
1210
 
1202
1211
  // src/server-metadata.ts
1203
1212
  import { MetadataRobotsPolicySchema, MetadataValuesSchema } from "@roottale/cms-core";
1204
- import { readMetadataValues, resolveMetadata, formatMetadataDefaults, metadataContentImageUrl, MetadataDefaultRulesSchema } from "@roottale/cms-core";
1213
+ import { readMetadataValues, resolveMetadata, formatMetadataDefaults, metadataBodyParagraphs, metadataContentImageUrl, MetadataDefaultRulesSchema } from "@roottale/cms-core";
1205
1214
  var METADATA_CACHE_TAG = "rt-metadata";
1206
1215
  var SITE_METADATA_DEFAULTS_CACHE_TAG = "rt-metadata-defaults";
1216
+ var CONTENT_POLICY_CACHE_TAG = "rt-content-policy";
1207
1217
  function routeMetadataCacheTag(routeKey, locale) {
1208
1218
  if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(routeKey) || routeKey.length > 160) throw new Error("Invalid metadata route key");
1209
1219
  const language = locale?.trim().toLowerCase() || "default";
@@ -1705,6 +1715,7 @@ export {
1705
1715
  BUSINESS_CACHE_TAG,
1706
1716
  CMS_CLIENT_VERSION,
1707
1717
  COLLECTIONS_CACHE_TAG,
1718
+ CONTENT_POLICY_CACHE_TAG,
1708
1719
  CmsApiError,
1709
1720
  DEFAULT_BLOG_SETTINGS,
1710
1721
  DEFAULT_SITE_PATTERN_PRESENTATION,
@@ -1757,6 +1768,7 @@ export {
1757
1768
  jsonLdJson,
1758
1769
  jsonLdScript,
1759
1770
  localBusinessSchema,
1771
+ metadataBodyParagraphs,
1760
1772
  metadataContentImageUrl,
1761
1773
  metadataContractChecksum,
1762
1774
  organizationSchema,