@roottale/cms-client 0.68.0 → 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 +15 -0
- package/dist/server.d.ts +13 -1
- package/dist/server.js +12 -2
- package/dist/server.js.map +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
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
|
+
|
|
3
18
|
## 0.68.0
|
|
4
19
|
|
|
5
20
|
### Minor Changes
|
package/dist/server.d.ts
CHANGED
|
@@ -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. */
|
|
@@ -1357,6 +1367,8 @@ declare function selectSitePatternForSlot(patternSlots: Readonly<Record<string,
|
|
|
1357
1367
|
|
|
1358
1368
|
declare const METADATA_CACHE_TAG = "rt-metadata";
|
|
1359
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";
|
|
1360
1372
|
/** locale를 생략한 요청은 사이트 기본 locale을 조회한다. */
|
|
1361
1373
|
declare function routeMetadataCacheTag(routeKey: string, locale?: string): string;
|
|
1362
1374
|
interface FetchRouteMetadataOptions {
|
|
@@ -1695,4 +1707,4 @@ declare function formatKoreanPhoneNumber(input: string): string;
|
|
|
1695
1707
|
*/
|
|
1696
1708
|
declare function submitInquiry(options: SubmitInquiryOptions): Promise<SubmitInquiryResult>;
|
|
1697
1709
|
|
|
1698
|
-
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.
|
|
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,
|
|
@@ -1205,6 +1213,7 @@ import { MetadataRobotsPolicySchema, MetadataValuesSchema } from "@roottale/cms-
|
|
|
1205
1213
|
import { readMetadataValues, resolveMetadata, formatMetadataDefaults, metadataBodyParagraphs, metadataContentImageUrl, MetadataDefaultRulesSchema } from "@roottale/cms-core";
|
|
1206
1214
|
var METADATA_CACHE_TAG = "rt-metadata";
|
|
1207
1215
|
var SITE_METADATA_DEFAULTS_CACHE_TAG = "rt-metadata-defaults";
|
|
1216
|
+
var CONTENT_POLICY_CACHE_TAG = "rt-content-policy";
|
|
1208
1217
|
function routeMetadataCacheTag(routeKey, locale) {
|
|
1209
1218
|
if (!/^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/.test(routeKey) || routeKey.length > 160) throw new Error("Invalid metadata route key");
|
|
1210
1219
|
const language = locale?.trim().toLowerCase() || "default";
|
|
@@ -1706,6 +1715,7 @@ export {
|
|
|
1706
1715
|
BUSINESS_CACHE_TAG,
|
|
1707
1716
|
CMS_CLIENT_VERSION,
|
|
1708
1717
|
COLLECTIONS_CACHE_TAG,
|
|
1718
|
+
CONTENT_POLICY_CACHE_TAG,
|
|
1709
1719
|
CmsApiError,
|
|
1710
1720
|
DEFAULT_BLOG_SETTINGS,
|
|
1711
1721
|
DEFAULT_SITE_PATTERN_PRESENTATION,
|