@se-studio/contentful-rest-api 1.8.0 → 1.10.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.
Files changed (81) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/api/article-type.js +7 -7
  3. package/dist/api/article.js +1 -1
  4. package/dist/api/asset.js +2 -2
  5. package/dist/api/banner.js +5 -5
  6. package/dist/api/breadcrumb.js +1 -1
  7. package/dist/api/componentPreview.js +7 -7
  8. package/dist/api/context.js +14 -14
  9. package/dist/api/custom-type.js +1 -1
  10. package/dist/api/helpers.d.ts.map +1 -1
  11. package/dist/api/helpers.js +17 -10
  12. package/dist/api/helpers.js.map +1 -1
  13. package/dist/api/index.d.ts +1 -1
  14. package/dist/api/index.d.ts.map +1 -1
  15. package/dist/api/index.js +21 -21
  16. package/dist/api/index.js.map +1 -1
  17. package/dist/api/links.d.ts +6 -0
  18. package/dist/api/links.d.ts.map +1 -1
  19. package/dist/api/links.js +31 -10
  20. package/dist/api/links.js.map +1 -1
  21. package/dist/api/page.js +2 -2
  22. package/dist/api/person.js +7 -7
  23. package/dist/api/preview.js +1 -1
  24. package/dist/api/redirects.js +5 -5
  25. package/dist/api/server-asset.js +1 -1
  26. package/dist/api/sitemap.js +1 -1
  27. package/dist/api/tag-type.js +6 -6
  28. package/dist/api/tag.js +7 -7
  29. package/dist/api/template.js +4 -4
  30. package/dist/client.js +2 -2
  31. package/dist/cms-integrity.d.ts +10 -0
  32. package/dist/cms-integrity.d.ts.map +1 -0
  33. package/dist/cms-integrity.js +7 -0
  34. package/dist/cms-integrity.js.map +1 -0
  35. package/dist/converters/animationEnricher.js +1 -1
  36. package/dist/converters/article.js +7 -7
  37. package/dist/converters/asset.js +1 -1
  38. package/dist/converters/banner.js +2 -2
  39. package/dist/converters/collection.js +3 -3
  40. package/dist/converters/component.js +4 -4
  41. package/dist/converters/customType.js +5 -5
  42. package/dist/converters/enrichAssets.js +4 -4
  43. package/dist/converters/externalComponent.js +3 -3
  44. package/dist/converters/helpers.js +1 -1
  45. package/dist/converters/htmlComponent.js +1 -1
  46. package/dist/converters/iconCollector.js +1 -1
  47. package/dist/converters/index.js +12 -12
  48. package/dist/converters/link.js +3 -3
  49. package/dist/converters/navigationItem.js +3 -3
  50. package/dist/converters/page.js +6 -6
  51. package/dist/converters/pageVariantMerge.js +6 -6
  52. package/dist/converters/person.js +5 -5
  53. package/dist/converters/pictureBlurEnricher.js +1 -1
  54. package/dist/converters/redirect.js +1 -1
  55. package/dist/converters/resolver.js +4 -4
  56. package/dist/converters/tag.js +6 -6
  57. package/dist/converters/tagType.js +3 -3
  58. package/dist/converters/template.js +2 -2
  59. package/dist/index.d.ts +2 -1
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +8 -7
  62. package/dist/index.js.map +1 -1
  63. package/dist/revalidation/handlers.js +3 -3
  64. package/dist/revalidation/index.js +2 -2
  65. package/dist/revalidation/nextjs-route.js +1 -1
  66. package/dist/revalidation/route.js +3 -3
  67. package/dist/revalidation/utils.js +1 -1
  68. package/dist/routing/index.d.ts +2 -0
  69. package/dist/routing/index.d.ts.map +1 -0
  70. package/dist/routing/index.js +2 -0
  71. package/dist/routing/index.js.map +1 -0
  72. package/dist/routing/marketing-site-url-calculators.d.ts +21 -0
  73. package/dist/routing/marketing-site-url-calculators.d.ts.map +1 -0
  74. package/dist/routing/marketing-site-url-calculators.js +43 -0
  75. package/dist/routing/marketing-site-url-calculators.js.map +1 -0
  76. package/dist/server.js +5 -5
  77. package/dist/types.d.ts +4 -0
  78. package/dist/types.d.ts.map +1 -1
  79. package/dist/utils/index.js +5 -5
  80. package/dist/utils/retry.js +1 -1
  81. package/package.json +19 -9
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Node-safe entry for smoke CMS integrity checks (no Next.js `next/cache` dependency at load time).
3
+ */
4
+ export { createBaseConverterContext } from './api/context.js';
5
+ export { contentfulAllArticleLinksForIntegrity } from './api/links.js';
6
+ export type { IContentfulArticleLink } from './converters/article.js';
7
+ export type { BaseConverterContext } from './converters/helpers.js';
8
+ export { createMarketingSiteUrlCalculators, type MarketingSiteRoutingOptions, } from './routing/index.js';
9
+ export type { CmsResponse, ContentfulConfig, FetchOptions } from './types.js';
10
+ //# sourceMappingURL=cms-integrity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cms-integrity.d.ts","sourceRoot":"","sources":["../src/cms-integrity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AACvE,YAAY,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACtE,YAAY,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EACL,iCAAiC,EACjC,KAAK,2BAA2B,GACjC,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Node-safe entry for smoke CMS integrity checks (no Next.js `next/cache` dependency at load time).
3
+ */
4
+ export { createBaseConverterContext } from './api/context.js';
5
+ export { contentfulAllArticleLinksForIntegrity } from './api/links.js';
6
+ export { createMarketingSiteUrlCalculators, } from './routing/index.js';
7
+ //# sourceMappingURL=cms-integrity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cms-integrity.js","sourceRoot":"","sources":["../src/cms-integrity.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,0BAA0B,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,MAAM,gBAAgB,CAAC;AAGvE,OAAO,EACL,iCAAiC,GAElC,MAAM,oBAAoB,CAAC"}
@@ -1,4 +1,4 @@
1
- import { assetTag } from '../revalidation/tags';
1
+ import { assetTag } from '../revalidation/tags.js';
2
2
  function getLottieDimensions(lottieJson) {
3
3
  const width = lottieJson.w || lottieJson.width || 0;
4
4
  const height = lottieJson.h || lottieJson.height || 0;
@@ -1,11 +1,11 @@
1
1
  import { isCollection, normalizeResolvedArticleAuthors, } from '@se-studio/core-data-types';
2
- import { getPrimaryTag } from '../utils/tags';
3
- import { lookupMediaEntry } from './asset';
4
- import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, lookupDownloadAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers';
5
- import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector';
6
- import { resolveNavigation } from './navigationItem';
7
- import { resolveLink, resolveLinks, resolvePageContent, resolveRichTextDocument, resolveSchema, } from './resolver';
8
- import { resolveTemplate } from './template';
2
+ import { getPrimaryTag } from '../utils/tags.js';
3
+ import { lookupMediaEntry } from './asset.js';
4
+ import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, lookupDownloadAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers.js';
5
+ import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector.js';
6
+ import { resolveNavigation } from './navigationItem.js';
7
+ import { resolveLink, resolveLinks, resolvePageContent, resolveRichTextDocument, resolveSchema, } from './resolver.js';
8
+ import { resolveTemplate } from './template.js';
9
9
  /**
10
10
  * Resolves the article template using a hierarchy:
11
11
  * 1. Article's explicit template field (if set)
@@ -1,4 +1,4 @@
1
- import { lookupAsset, makeContentfulDescription, makeContentfulTitle, stringOrUndefined, } from './helpers';
1
+ import { lookupAsset, makeContentfulDescription, makeContentfulTitle, stringOrUndefined, } from './helpers.js';
2
2
  export function convertAssetToVisual(context, asset, options) {
3
3
  if (!asset)
4
4
  return undefined;
@@ -1,5 +1,5 @@
1
- import { lookupEntries } from './helpers';
2
- import { resolveLink } from './resolver';
1
+ import { lookupEntries } from './helpers.js';
2
+ import { resolveLink } from './resolver.js';
3
3
  /**
4
4
  * Converts a Contentful banner entry to an IBanner object
5
5
  */
@@ -1,6 +1,6 @@
1
- import { createResponsiveVisual, lookupMediaEntry } from './asset';
2
- import { DEFAULT_POSITION_FIELDS, lookupAsset, lookupIconAsset, } from './helpers';
3
- import { resolveCollectionContent, resolveLink, resolveRichTextDocument } from './resolver';
1
+ import { createResponsiveVisual, lookupMediaEntry } from './asset.js';
2
+ import { DEFAULT_POSITION_FIELDS, lookupAsset, lookupIconAsset, } from './helpers.js';
3
+ import { resolveCollectionContent, resolveLink, resolveRichTextDocument } from './resolver.js';
4
4
  /**
5
5
  * Base converter for Contentful Collection entries to ICollection type
6
6
  *
@@ -1,7 +1,7 @@
1
- import { arrayOrUndefined, notEmpty } from '../utils';
2
- import { createResponsiveVisual, lookupMediaEntry } from './asset';
3
- import { DEFAULT_POSITION_FIELDS, lookupAsset, lookupIconAsset, } from './helpers';
4
- import { resolveLinks, resolveRichTextDocument } from './resolver';
1
+ import { arrayOrUndefined, notEmpty } from '../utils/index.js';
2
+ import { createResponsiveVisual, lookupMediaEntry } from './asset.js';
3
+ import { DEFAULT_POSITION_FIELDS, lookupAsset, lookupIconAsset, } from './helpers.js';
4
+ import { resolveLinks, resolveRichTextDocument } from './resolver.js';
5
5
  /**
6
6
  * Base converter for Contentful Component entries to IComponent type
7
7
  *
@@ -1,8 +1,8 @@
1
- import { addPositionMetadata, createInternalLink, lookupAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers';
2
- import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector';
3
- import { resolveNavigation } from './navigationItem';
4
- import { resolvePageContent, resolveSchema } from './resolver';
5
- import { resolveTemplate } from './template';
1
+ import { addPositionMetadata, createInternalLink, lookupAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers.js';
2
+ import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector.js';
3
+ import { resolveNavigation } from './navigationItem.js';
4
+ import { resolvePageContent, resolveSchema } from './resolver.js';
5
+ import { resolveTemplate } from './template.js';
6
6
  /**
7
7
  * Base converter for Contentful Custom Type entries to IBaseCustomType
8
8
  *
@@ -1,7 +1,7 @@
1
- import { enrichAnimationAssets } from './animationEnricher';
2
- import { enrichExternalVideoEmbeds } from './externalVideoEnricher';
3
- import { enrichPictureBlurPlaceholders } from './pictureBlurEnricher';
4
- import { enrichVideoAssets } from './videoEnricher';
1
+ import { enrichAnimationAssets } from './animationEnricher.js';
2
+ import { enrichExternalVideoEmbeds } from './externalVideoEnricher.js';
3
+ import { enrichPictureBlurPlaceholders } from './pictureBlurEnricher.js';
4
+ import { enrichVideoAssets } from './videoEnricher.js';
5
5
  /**
6
6
  * Runs asset-enrichment steps in parallel and returns the map of pre-fetched oEmbed data for
7
7
  * ConverterContext.
@@ -1,6 +1,6 @@
1
- import { createResponsiveVisual } from './asset';
2
- import { DEFAULT_POSITION_FIELDS, lookupAsset, lookupDownloadAsset, makeContentfulTitle, } from './helpers';
3
- import { resolveLink, resolveRichTextDocument } from './resolver';
1
+ import { createResponsiveVisual } from './asset.js';
2
+ import { DEFAULT_POSITION_FIELDS, lookupAsset, lookupDownloadAsset, makeContentfulTitle, } from './helpers.js';
3
+ import { resolveLink, resolveRichTextDocument } from './resolver.js';
4
4
  /**
5
5
  * Base converter for Contentful ExternalComponent entries to IExternalComponent type
6
6
  *
@@ -1,5 +1,5 @@
1
1
  import { getContentTypeKey } from '@se-studio/core-data-types';
2
- import { PAGE_RESOLUTION_SCOPE } from '../api/listing-fetch-params';
2
+ import { PAGE_RESOLUTION_SCOPE } from '../api/listing-fetch-params.js';
3
3
  export function resolveBuildYear(value) {
4
4
  const buildYear = new Date().getFullYear();
5
5
  return value.replaceAll('#buildYear#', buildYear.toString());
@@ -1,4 +1,4 @@
1
- import { DEFAULT_POSITION_FIELDS, makeContentfulTitle } from './helpers';
1
+ import { DEFAULT_POSITION_FIELDS, makeContentfulTitle } from './helpers.js';
2
2
  /**
3
3
  * Converts a Contentful htmlComponent entry to an IBaseHtmlComponent.
4
4
  *
@@ -1,5 +1,5 @@
1
1
  import { isSvgImage } from '@se-studio/core-data-types';
2
- import { fetchSvgContent, processSvgForSprite } from './svgProcessor';
2
+ import { fetchSvgContent, processSvgForSprite } from './svgProcessor.js';
3
3
  /**
4
4
  * Extract SVG image from a visual if it's marked as an icon.
5
5
  * Only returns SVG images that have isIcon: true (set during conversion from icon fields).
@@ -5,16 +5,16 @@
5
5
  * to typed objects. Use the base converters and compose with enhancers to
6
6
  * create custom converters for your specific needs.
7
7
  */
8
- export { createResponsiveVisual } from './asset';
9
- export { baseCollectionConverter } from './collection';
10
- export { baseComponentConverter } from './component';
11
- export { baseExternalComponentConverter } from './externalComponent';
12
- export { lookupAsset, } from './helpers';
13
- export { baseHtmlComponentConverter } from './htmlComponent';
14
- export { baseNavigationItemConverter, resolveNavigation } from './navigationItem';
15
- export { basePageConverter, calculatePageHref, calculatePageVariantHref, } from './page';
16
- export { mergeAlternatePageContentsInTree } from './pageVariantMerge';
17
- export { baseRedirectConverter } from './redirect';
18
- export { resolveLink, resolveLinks, resolveRichTextDocument, } from './resolver';
19
- export { baseTagTypeConverter, baseTagTypeLinkConverter } from './tagType';
8
+ export { createResponsiveVisual } from './asset.js';
9
+ export { baseCollectionConverter } from './collection.js';
10
+ export { baseComponentConverter } from './component.js';
11
+ export { baseExternalComponentConverter } from './externalComponent.js';
12
+ export { lookupAsset, } from './helpers.js';
13
+ export { baseHtmlComponentConverter } from './htmlComponent.js';
14
+ export { baseNavigationItemConverter, resolveNavigation } from './navigationItem.js';
15
+ export { basePageConverter, calculatePageHref, calculatePageVariantHref, } from './page.js';
16
+ export { mergeAlternatePageContentsInTree } from './pageVariantMerge.js';
17
+ export { baseRedirectConverter } from './redirect.js';
18
+ export { resolveLink, resolveLinks, resolveRichTextDocument, } from './resolver.js';
19
+ export { baseTagTypeConverter, baseTagTypeLinkConverter } from './tagType.js';
20
20
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
- import { createResponsiveVisual } from './asset';
2
- import { lookupAsset, lookupDownloadAsset, lookupIconAsset, makeContentfulTitle, resolveBuildYear, } from './helpers';
3
- import { resolveLink } from './resolver';
1
+ import { createResponsiveVisual } from './asset.js';
2
+ import { lookupAsset, lookupDownloadAsset, lookupIconAsset, makeContentfulTitle, resolveBuildYear, } from './helpers.js';
3
+ import { resolveLink } from './resolver.js';
4
4
  /**
5
5
  * Converts a Contentful link entry to an ILinkProps object
6
6
  * Handles all link types: internal, external, download, and blank
@@ -1,6 +1,6 @@
1
- import { createResponsiveVisual } from './asset';
2
- import { lookupIconAsset, makeContentfulTitle, resolveBuildYear, } from './helpers';
3
- import { resolveLink, resolveNavigationItem, resolveRichTextDocument } from './resolver';
1
+ import { createResponsiveVisual } from './asset.js';
2
+ import { lookupIconAsset, makeContentfulTitle, resolveBuildYear, } from './helpers.js';
3
+ import { resolveLink, resolveNavigationItem, resolveRichTextDocument } from './resolver.js';
4
4
  function createLink(context, entry) {
5
5
  const { sys: { id }, fields, } = entry;
6
6
  const { title, link, text, internal, icon: navIcon, mobileIcon: mobileNavIcon, useTitle, ...otherFields } = fields;
@@ -1,10 +1,10 @@
1
1
  import { isCollection } from '@se-studio/core-data-types';
2
- import { lookupMediaEntry } from './asset';
3
- import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers';
4
- import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector';
5
- import { resolveNavigation } from './navigationItem';
6
- import { resolveLink, resolvePageContent, resolveSchema } from './resolver';
7
- import { resolveTemplate } from './template';
2
+ import { lookupMediaEntry } from './asset.js';
3
+ import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers.js';
4
+ import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector.js';
5
+ import { resolveNavigation } from './navigationItem.js';
6
+ import { resolveLink, resolvePageContent, resolveSchema } from './resolver.js';
7
+ import { resolveTemplate } from './template.js';
8
8
  /**
9
9
  * Base converter for Contentful Page entries to IPage type
10
10
  *
@@ -1,10 +1,10 @@
1
1
  import { isCollection } from '@se-studio/core-data-types';
2
- import { lookupMediaEntry } from './asset';
3
- import { addPositionMetadata, lookupAsset, makeContentfulDescription, makeContentfulTitle, } from './helpers';
4
- import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector';
5
- import { resolveNavigation } from './navigationItem';
6
- import { basePageConverter } from './page';
7
- import { resolveLink, resolvePageContent, resolveSchema } from './resolver';
2
+ import { lookupMediaEntry } from './asset.js';
3
+ import { addPositionMetadata, lookupAsset, makeContentfulDescription, makeContentfulTitle, } from './helpers.js';
4
+ import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector.js';
5
+ import { resolveNavigation } from './navigationItem.js';
6
+ import { basePageConverter } from './page.js';
7
+ import { resolveLink, resolvePageContent, resolveSchema } from './resolver.js';
8
8
  /**
9
9
  * Replace or remove one content block (by source entry id) in a page content tree.
10
10
  * Walks top-level items and nested collection {@link IBaseCollection.contents}.
@@ -1,8 +1,8 @@
1
- import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers';
2
- import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector';
3
- import { resolveNavigation } from './navigationItem';
4
- import { resolvePageContent, resolveRichTextDocument, resolveSchema } from './resolver';
5
- import { resolveTemplate } from './template';
1
+ import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers.js';
2
+ import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector.js';
3
+ import { resolveNavigation } from './navigationItem.js';
4
+ import { resolvePageContent, resolveRichTextDocument, resolveSchema } from './resolver.js';
5
+ import { resolveTemplate } from './template.js';
6
6
  /**
7
7
  * Base converter for Person entries to IPersonLink type
8
8
  * Used when a person is referenced as a link in content
@@ -1,4 +1,4 @@
1
- import { assetTag } from '../revalidation/tags';
1
+ import { assetTag } from '../revalidation/tags.js';
2
2
  /**
3
3
  * Tiny raster width for LQIP-style blur data URLs. Kept small to limit fetch size and base64 payload.
4
4
  */
@@ -1,4 +1,4 @@
1
- import { resolveLink } from './resolver';
1
+ import { resolveLink } from './resolver.js';
2
2
  /**
3
3
  * Converts a Contentful redirect entry to an IRedirect object.
4
4
  *
@@ -1,7 +1,7 @@
1
- import { arrayOrUndefined } from '../utils';
2
- import { convertExternalVideoEntryToVisual, convertMediaEntryToVisual } from './asset';
3
- import { lookupAsset, lookupDownloadAsset } from './helpers';
4
- import { baseSchemaConverter } from './schema';
1
+ import { arrayOrUndefined } from '../utils/index.js';
2
+ import { convertExternalVideoEntryToVisual, convertMediaEntryToVisual } from './asset.js';
3
+ import { lookupAsset, lookupDownloadAsset } from './helpers.js';
4
+ import { baseSchemaConverter } from './schema.js';
5
5
  function resolveHelper(context, fromId, entry, getResolver) {
6
6
  const id = entry.sys.id;
7
7
  const possibleEntry = context.includes.get(id);
@@ -1,9 +1,9 @@
1
- import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers';
2
- import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector';
3
- import { resolveNavigation } from './navigationItem';
4
- import { resolvePageContent, resolveSchema } from './resolver';
5
- import { baseTagTypeConverter } from './tagType';
6
- import { resolveTemplate } from './template';
1
+ import { addPositionMetadata, calculateContentCount, createInternalLink, lookupAsset, makeContentfulDescription, makeContentfulTitle, shouldResolveContents, shouldResolveNavigation, } from './helpers.js';
2
+ import { collectIconsFromContent, collectIconsFromNavigation, deduplicateIcons, } from './iconCollector.js';
3
+ import { resolveNavigation } from './navigationItem.js';
4
+ import { resolvePageContent, resolveSchema } from './resolver.js';
5
+ import { baseTagTypeConverter } from './tagType.js';
6
+ import { resolveTemplate } from './template.js';
7
7
  export function baseTagLinkConverter(context, entry) {
8
8
  const { sys, fields } = entry;
9
9
  const { name, cmsLabel, tagType: tagTypeLink, show, ...simpleFields } = fields;
@@ -1,6 +1,6 @@
1
- import { addPositionMetadata, createInternalLink, shouldResolveContents, } from './helpers';
2
- import { resolvePageContent } from './resolver';
3
- import { resolveTemplate } from './template';
1
+ import { addPositionMetadata, createInternalLink, shouldResolveContents, } from './helpers.js';
2
+ import { resolvePageContent } from './resolver.js';
3
+ import { resolveTemplate } from './template.js';
4
4
  export function baseTagTypeConverter(context, entry, customTypeEntry) {
5
5
  const { sys, fields } = entry;
6
6
  const { id } = sys;
@@ -1,5 +1,5 @@
1
- import { resolveNavigation } from './navigationItem';
2
- import { resolvePageContent, resolveSchema } from './resolver';
1
+ import { resolveNavigation } from './navigationItem.js';
2
+ import { resolvePageContent, resolveSchema } from './resolver.js';
3
3
  /**
4
4
  * Resolves a template entry from an unresolved link
5
5
  *
package/dist/index.d.ts CHANGED
@@ -17,12 +17,13 @@
17
17
  * );
18
18
  * ```
19
19
  */
20
- export { type AnyEntryRestResult, type ArticleTypeFetchOptions, type BreadcrumbLookup, type BreadcrumbLookupEntry, buildFetchOptions, type CmsContentType, type CmsFetchProfile, type ConverterResolutionScope, contentfulAllArticleLinks, contentfulAllArticleTypeLinks, contentfulAllCustomTypeLinks, contentfulAllPageLinks, contentfulAllPersonLinks, contentfulAllTagLinks, contentfulAllTagTypeLinks, contentfulAnyEntryRest, contentfulArticleRest, contentfulArticleSitemapEntries, contentfulArticleTypeRest, contentfulArticleTypeSitemapEntries, contentfulAssetRest, contentfulBannerRest, contentfulComponentRest, contentfulCustomTypeRest, contentfulPageRest, contentfulPageSitemapEntries, contentfulPersonRest, contentfulPersonSitemapEntries, contentfulRedirectsRest, contentfulTagRest, contentfulTagSitemapEntries, contentfulTagTypeRest, contentfulTemplateRest, coreGetContentfulConfig, createBaseConverterContext, createSitemapProvider, type DefaultChainModifier, filterRelatedArticles, getAllSitemapEntries, getBreadcrumbLookup, getDefaultInclude, getListingLinkFetchParams, getPreviewEntryInfo, getResolutionScope, type IContentfulRichText, type IFetchedTemplate, type ISitemapEntry, isBrowserViewable, LISTING_RESOLUTION_SCOPE, PAGE_RESOLUTION_SCOPE, type PersonFetchOptions, type PreviewContentType, type PreviewEntryInfo, type RelatedArticlesOptions, resolveIncludeDepth, type SitemapChangeFrequency, type SitemapConfig, type SitemapContentTypeConfig, type SitemapEntryProvider, type TagFetchOptions, type TagTypeFetchOptions, } from './api';
20
+ export { type AnyEntryRestResult, type ArticleTypeFetchOptions, type BreadcrumbLookup, type BreadcrumbLookupEntry, buildFetchOptions, type CmsContentType, type CmsFetchProfile, type ConverterResolutionScope, contentfulAllArticleLinks, contentfulAllArticleLinksForIntegrity, contentfulAllArticleTypeLinks, contentfulAllCustomTypeLinks, contentfulAllPageLinks, contentfulAllPersonLinks, contentfulAllTagLinks, contentfulAllTagTypeLinks, contentfulAnyEntryRest, contentfulArticleRest, contentfulArticleSitemapEntries, contentfulArticleTypeRest, contentfulArticleTypeSitemapEntries, contentfulAssetRest, contentfulBannerRest, contentfulComponentRest, contentfulCustomTypeRest, contentfulPageRest, contentfulPageSitemapEntries, contentfulPersonRest, contentfulPersonSitemapEntries, contentfulRedirectsRest, contentfulTagRest, contentfulTagSitemapEntries, contentfulTagTypeRest, contentfulTemplateRest, coreGetContentfulConfig, createBaseConverterContext, createSitemapProvider, type DefaultChainModifier, filterRelatedArticles, getAllSitemapEntries, getBreadcrumbLookup, getDefaultInclude, getListingLinkFetchParams, getPreviewEntryInfo, getResolutionScope, type IContentfulRichText, type IFetchedTemplate, type ISitemapEntry, isBrowserViewable, LISTING_RESOLUTION_SCOPE, PAGE_RESOLUTION_SCOPE, type PersonFetchOptions, type PreviewContentType, type PreviewEntryInfo, type RelatedArticlesOptions, resolveIncludeDepth, type SitemapChangeFrequency, type SitemapConfig, type SitemapContentTypeConfig, type SitemapEntryProvider, type TagFetchOptions, type TagTypeFetchOptions, } from './api';
21
21
  export type { ContentfulFetchClient as ContentfulClient } from './client';
22
22
  export { type ContentfulFetchClient, createContentfulClient, createContentfulPreviewClient, getContentfulClient, } from './client';
23
23
  export type { ContentResolverFunction } from './converters';
24
24
  export { type BaseConverterContext, baseCollectionConverter, baseComponentConverter, baseExternalComponentConverter, baseNavigationItemConverter, basePageConverter, type ConverterContext, calculatePageHref, calculatePageVariantHref, createResponsiveVisual, type IContentfulArticle, type IContentfulArticleLink, type IContentfulCollection, type IContentfulComponent, type IContentfulExternalComponent, type IContentfulPerson, lookupAsset, mergeAlternatePageContentsInTree, resolveLink, resolveLinks, resolveNavigation, resolveRichTextDocument, type UrlCalculators, } from './converters';
25
25
  export { AllTags, ArticleTag, ArticleTypeTag, AssetTag, articleTag, articleTypeIndexTag, articleTypeTag, assetTag, BannerTag, CustomTypeTag, customTypeTag, GlobalTag, getCacheTags, getCacheTagsForPreview, getCacheTagsForProduction, LocationTag, locationTag, NavigationTag, PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, TagTag, TemplateTag, tagTag, templateTag, } from './revalidation';
26
+ export { createMarketingSiteUrlCalculators, type MarketingSiteRoutingOptions, } from './routing';
26
27
  export type { CmsError, CmsResponse, ContentfulConfig, FetchOptions, RetryConfig, } from './types';
27
28
  export { type ArticleForTagSelection, AuthenticationError, arrayOrUndefined, ContentfulError, calculateBackoffDelay, EntryNotFoundError, filterVisibleTags, getPrimaryTag, getRetryAfter, isContentfulError, isRateLimitError, isRetryableError, isTagShowEnabled, isTagVisible, isValidDate, notEmpty, type PrimaryTagSelector, RateLimitError, RateLimiter, safeDate, type TagVisibilityFields, ValidationError, withRetry, } from './utils';
28
29
  export { buildRedirectMap, filterSitemapEntriesExcludingRedirects, type RedirectMap, type RedirectMapEntry, } from './utils/redirectMap';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,yBAAyB,EACzB,mCAAmC,EAEnC,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EAEzB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,kBAAkB,EAEvB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,mBAAmB,GACzB,MAAM,OAAO,CAAC;AAEf,YAAY,EAAE,qBAAqB,IAAI,gBAAgB,EAAE,MAA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B,EAChB,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,KAAK,kBAAkB,EACvB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,KAAK,mBAAmB,EACxB,eAAe,EACf,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,sCAAsC,EACtC,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC1B,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,wBAAwB,EAC7B,yBAAyB,EACzB,qCAAqC,EACrC,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,yBAAyB,EACzB,mCAAmC,EAEnC,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EACrB,KAAK,oBAAoB,EACzB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EAEzB,mBAAmB,EACnB,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EACrB,KAAK,kBAAkB,EAEvB,KAAK,kBAAkB,EACvB,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,GACjC,MAAM,WAAW,CAAC;AAEnB,YAAY,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,KAAK,kBAAkB,EACvB,cAAc,EACd,WAAW,EACX,QAAQ,EACR,KAAK,mBAAmB,EACxB,eAAe,EACf,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,sCAAsC,EACtC,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -18,22 +18,23 @@
18
18
  * ```
19
19
  */
20
20
  // API functions
21
- export { buildFetchOptions, contentfulAllArticleLinks, contentfulAllArticleTypeLinks, contentfulAllCustomTypeLinks, contentfulAllPageLinks, contentfulAllPersonLinks, contentfulAllTagLinks, contentfulAllTagTypeLinks, contentfulAnyEntryRest, contentfulArticleRest, contentfulArticleSitemapEntries, contentfulArticleTypeRest, contentfulArticleTypeSitemapEntries,
21
+ export { buildFetchOptions, contentfulAllArticleLinks, contentfulAllArticleLinksForIntegrity, contentfulAllArticleTypeLinks, contentfulAllCustomTypeLinks, contentfulAllPageLinks, contentfulAllPersonLinks, contentfulAllTagLinks, contentfulAllTagTypeLinks, contentfulAnyEntryRest, contentfulArticleRest, contentfulArticleSitemapEntries, contentfulArticleTypeRest, contentfulArticleTypeSitemapEntries,
22
22
  // Asset/download functions
23
23
  contentfulAssetRest, contentfulBannerRest, contentfulComponentRest, contentfulCustomTypeRest, contentfulPageRest, contentfulPageSitemapEntries, contentfulPersonRest, contentfulPersonSitemapEntries, contentfulRedirectsRest, contentfulTagRest, contentfulTagSitemapEntries, contentfulTagTypeRest, contentfulTemplateRest, coreGetContentfulConfig, createBaseConverterContext, createSitemapProvider, filterRelatedArticles, getAllSitemapEntries, getBreadcrumbLookup, getDefaultInclude, getListingLinkFetchParams,
24
24
  // Preview
25
- getPreviewEntryInfo, getResolutionScope, isBrowserViewable, LISTING_RESOLUTION_SCOPE, PAGE_RESOLUTION_SCOPE, resolveIncludeDepth, } from './api';
25
+ getPreviewEntryInfo, getResolutionScope, isBrowserViewable, LISTING_RESOLUTION_SCOPE, PAGE_RESOLUTION_SCOPE, resolveIncludeDepth, } from './api/index.js';
26
26
  // Client exports
27
- export { createContentfulClient, createContentfulPreviewClient, getContentfulClient, } from './client';
27
+ export { createContentfulClient, createContentfulPreviewClient, getContentfulClient, } from './client.js';
28
28
  // Converter exports
29
- export { baseCollectionConverter, baseComponentConverter, baseExternalComponentConverter, baseNavigationItemConverter, basePageConverter, calculatePageHref, calculatePageVariantHref, createResponsiveVisual, lookupAsset, mergeAlternatePageContentsInTree, resolveLink, resolveLinks, resolveNavigation, resolveRichTextDocument, } from './converters';
29
+ export { baseCollectionConverter, baseComponentConverter, baseExternalComponentConverter, baseNavigationItemConverter, basePageConverter, calculatePageHref, calculatePageVariantHref, createResponsiveVisual, lookupAsset, mergeAlternatePageContentsInTree, resolveLink, resolveLinks, resolveNavigation, resolveRichTextDocument, } from './converters/index.js';
30
30
  // Revalidation utilities
31
31
  export { AllTags, ArticleTag, ArticleTypeTag, AssetTag, articleTag, articleTypeIndexTag, articleTypeTag, assetTag, BannerTag, CustomTypeTag, customTypeTag, GlobalTag, getCacheTags,
32
32
  // Utility functions
33
33
  getCacheTagsForPreview, getCacheTagsForProduction, LocationTag, locationTag, NavigationTag,
34
34
  // Tag constants and functions
35
- PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, TagTag, TemplateTag, tagTag, templateTag, } from './revalidation';
35
+ PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, TagTag, TemplateTag, tagTag, templateTag, } from './revalidation/index.js';
36
+ export { createMarketingSiteUrlCalculators, } from './routing/index.js';
36
37
  // Error handling and retry utilities
37
- export { AuthenticationError, arrayOrUndefined, ContentfulError, calculateBackoffDelay, EntryNotFoundError, filterVisibleTags, getPrimaryTag, getRetryAfter, isContentfulError, isRateLimitError, isRetryableError, isTagShowEnabled, isTagVisible, isValidDate, notEmpty, RateLimitError, RateLimiter, safeDate, ValidationError, withRetry, } from './utils';
38
- export { buildRedirectMap, filterSitemapEntriesExcludingRedirects, } from './utils/redirectMap';
38
+ export { AuthenticationError, arrayOrUndefined, ContentfulError, calculateBackoffDelay, EntryNotFoundError, filterVisibleTags, getPrimaryTag, getRetryAfter, isContentfulError, isRateLimitError, isRetryableError, isTagShowEnabled, isTagVisible, isValidDate, notEmpty, RateLimitError, RateLimiter, safeDate, ValidationError, withRetry, } from './utils/index.js';
39
+ export { buildRedirectMap, filterSitemapEntriesExcludingRedirects, } from './utils/redirectMap.js';
39
40
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,gBAAgB;AAChB,OAAO,EAKL,iBAAiB,EAIjB,yBAAyB,EACzB,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,yBAAyB,EACzB,mCAAmC;AACnC,2BAA2B;AAC3B,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,uBAA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,EAER,eAAe,EACf,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,sCAAsC,GAGvC,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,gBAAgB;AAChB,OAAO,EAKL,iBAAiB,EAIjB,yBAAyB,EACzB,qCAAqC,EACrC,6BAA6B,EAC7B,4BAA4B,EAC5B,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,EACzB,sBAAsB,EACtB,qBAAqB,EACrB,+BAA+B,EAC/B,yBAAyB,EACzB,mCAAmC;AACnC,2BAA2B;AAC3B,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,wBAAwB,EACxB,kBAAkB,EAClB,4BAA4B,EAC5B,oBAAoB,EACpB,8BAA8B,EAC9B,uBAAuB,EACvB,iBAAiB,EACjB,2BAA2B,EAC3B,qBAAqB,EACrB,sBAAsB,EACtB,uBAAuB,EACvB,0BAA0B,EAC1B,qBAAqB,EAErB,qBAAqB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB;AACzB,UAAU;AACV,mBAAmB,EACnB,kBAAkB,EAKlB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAMrB,mBAAmB,GAOpB,MAAM,OAAO,CAAC;AAGf,iBAAiB;AACjB,OAAO,EAEL,sBAAsB,EACtB,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAElB,oBAAoB;AACpB,OAAO,EAEL,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,2BAA2B,EAC3B,iBAAiB,EAEjB,iBAAiB,EACjB,wBAAwB,EACxB,sBAAsB,EAOtB,WAAW,EACX,gCAAgC,EAChC,WAAW,EACX,YAAY,EACZ,iBAAiB,EACjB,uBAAuB,GAExB,MAAM,cAAc,CAAC;AACtB,yBAAyB;AACzB,OAAO,EACL,OAAO,EACP,UAAU,EACV,cAAc,EACd,QAAQ,EACR,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,SAAS,EACT,aAAa,EACb,aAAa,EACb,SAAS,EACT,YAAY;AACZ,oBAAoB;AACpB,sBAAsB,EACtB,yBAAyB,EACzB,WAAW,EACX,WAAW,EACX,aAAa;AACb,8BAA8B;AAC9B,OAAO,EACP,cAAc,EACd,SAAS,EACT,OAAO,EACP,cAAc,EACd,SAAS,EACT,MAAM,EACN,WAAW,EACX,MAAM,EACN,WAAW,GACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,iCAAiC,GAElC,MAAM,WAAW,CAAC;AASnB,qCAAqC;AACrC,OAAO,EAEL,mBAAmB,EACnB,gBAAgB,EAChB,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,WAAW,EACX,QAAQ,EAER,cAAc,EACd,WAAW,EACX,QAAQ,EAER,eAAe,EACf,SAAS,GACV,MAAM,SAAS,CAAC;AACjB,OAAO,EACL,gBAAgB,EAChB,sCAAsC,GAGvC,MAAM,qBAAqB,CAAC"}
@@ -1,5 +1,5 @@
1
- import { revalidateSingleTag, revalidateTags } from './server-utils';
2
- import { ArticleTag, ArticleTypeIndexTag, ArticleTypeTag, AssetTag, articleTag, articleTypeIndexTag, assetTag, BannerTag, CustomTypeTag, GlobalTag, LocationTag, locationTag, NavigationTag, PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, RedirectTag, TagTag, TemplateTag, tagTag, templateTag, } from './tags';
1
+ import { revalidateSingleTag, revalidateTags } from './server-utils.js';
2
+ import { ArticleTag, ArticleTypeIndexTag, ArticleTypeTag, AssetTag, articleTag, articleTypeIndexTag, assetTag, BannerTag, CustomTypeTag, GlobalTag, LocationTag, locationTag, NavigationTag, PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, RedirectTag, TagTag, TemplateTag, tagTag, templateTag, } from './tags.js';
3
3
  // Default locale for Contentful
4
4
  const defaultLocale = 'en-US';
5
5
  // Content type handlers
@@ -111,7 +111,7 @@ export async function revalidateEntry(handler, content, contentType, preview = f
111
111
  }
112
112
  // Revalidate deleted entry by content type (collection tags only)
113
113
  export async function revalidateDeletedEntry(contentType, preview = false) {
114
- const { getCacheTagsForProduction } = await import('./utils');
114
+ const { getCacheTagsForProduction } = await import('./utils.js');
115
115
  const tags = getCacheTagsForProduction(contentType);
116
116
  if (preview) {
117
117
  await revalidateSingleTag(GlobalTag, `delete ${contentType} (preview mode)`);
@@ -1,4 +1,4 @@
1
1
  // Revalidation utilities exports (Client-safe)
2
- export * from './tags';
3
- export * from './utils';
2
+ export * from './tags.js';
3
+ export * from './utils.js';
4
4
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
1
  import { NextResponse } from 'next/server';
2
- import { handleRevalidation } from './route';
2
+ import { handleRevalidation } from './route.js';
3
3
  /**
4
4
  * Create a Next.js API route handler for Contentful revalidation
5
5
  *
@@ -1,9 +1,9 @@
1
1
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
2
2
  /* eslint-disable @typescript-eslint/no-explicit-any */
3
3
  import { NextResponse } from 'next/server';
4
- import { contentTypeHandlers, revalidateAsset, revalidateDeletedAsset, revalidateDeletedEntry, revalidateEntry, } from './handlers';
5
- import { revalidateSingleTag } from './server-utils';
6
- import { AllTags, GlobalTag } from './tags';
4
+ import { contentTypeHandlers, revalidateAsset, revalidateDeletedAsset, revalidateDeletedEntry, revalidateEntry, } from './handlers.js';
5
+ import { revalidateSingleTag } from './server-utils.js';
6
+ import { AllTags, GlobalTag } from './tags.js';
7
7
  // Handle asset publishing
8
8
  async function publishAsset(content, preview) {
9
9
  return await revalidateAsset(content, 'publish asset', preview);
@@ -1,4 +1,4 @@
1
- import { ArticleTag, ArticleTypeTag, AssetTag, articleTag, articleTypeTag, assetTag, BannerTag, CustomTypeTag, customTypeTag, GlobalTag, LocationTag, locationTag, PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, TagTag, tagTag, } from './tags';
1
+ import { ArticleTag, ArticleTypeTag, AssetTag, articleTag, articleTypeTag, assetTag, BannerTag, CustomTypeTag, customTypeTag, GlobalTag, LocationTag, locationTag, PageTag, PageVariantTag, PersonTag, pageTag, pageVariantTag, personTag, TagTag, tagTag, } from './tags.js';
2
2
  /**
3
3
  * Get cache tags for preview mode
4
4
  * @returns Array containing only the global tag
@@ -0,0 +1,2 @@
1
+ export { createMarketingSiteUrlCalculators, type MarketingSiteRoutingOptions, } from './marketing-site-url-calculators.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,KAAK,2BAA2B,GACjC,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createMarketingSiteUrlCalculators, } from './marketing-site-url-calculators.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/routing/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,GAElC,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { UrlCalculators } from '../converters/helpers';
2
+ export interface MarketingSiteRoutingOptions {
3
+ /** Base path for article type indexes, e.g. `/resources`. */
4
+ articleTypesBasePath: string;
5
+ /** Base path for tag/topic indexes, e.g. `/topics`. */
6
+ tagsBasePath: string;
7
+ /** Base path for people/team pages, e.g. `/team`. */
8
+ peopleBasePath: string;
9
+ /** Topic slug when an article has no primary tag. Default `other`. */
10
+ defaultTopic?: string;
11
+ /** When true, article URLs include the primary tag segment. */
12
+ enablePrimaryTagPartOfSlug?: boolean;
13
+ /** Article type slugs whose URLs omit the topic segment (e.g. ebooks). */
14
+ topiclessArticleTypeSlugs?: readonly string[];
15
+ }
16
+ /**
17
+ * Builds {@link UrlCalculators} for SE marketing sites from declarative routing options.
18
+ * Used by smoke CMS integrity checks and shared with converter-context patterns in apps.
19
+ */
20
+ export declare function createMarketingSiteUrlCalculators(options: MarketingSiteRoutingOptions): UrlCalculators;
21
+ //# sourceMappingURL=marketing-site-url-calculators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing-site-url-calculators.d.ts","sourceRoot":"","sources":["../../src/routing/marketing-site-url-calculators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,WAAW,2BAA2B;IAC1C,6DAA6D;IAC7D,oBAAoB,EAAE,MAAM,CAAC;IAC7B,uDAAuD;IACvD,YAAY,EAAE,MAAM,CAAC;IACrB,qDAAqD;IACrD,cAAc,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,0BAA0B,CAAC,EAAE,OAAO,CAAC;IACrC,0EAA0E;IAC1E,yBAAyB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC/C;AAOD;;;GAGG;AACH,wBAAgB,iCAAiC,CAC/C,OAAO,EAAE,2BAA2B,GACnC,cAAc,CAoChB"}
@@ -0,0 +1,43 @@
1
+ import { calculatePageHref, calculatePageVariantHref } from '../converters/page.js';
2
+ function normalizeBasePath(path) {
3
+ const trimmed = path.replace(/\/$/, '');
4
+ return trimmed.startsWith('/') ? trimmed : `/${trimmed}`;
5
+ }
6
+ /**
7
+ * Builds {@link UrlCalculators} for SE marketing sites from declarative routing options.
8
+ * Used by smoke CMS integrity checks and shared with converter-context patterns in apps.
9
+ */
10
+ export function createMarketingSiteUrlCalculators(options) {
11
+ const articlesBase = normalizeBasePath(options.articleTypesBasePath);
12
+ const tagsBase = normalizeBasePath(options.tagsBasePath);
13
+ const peopleBase = normalizeBasePath(options.peopleBasePath);
14
+ const defaultTopic = options.defaultTopic ?? 'other';
15
+ const enablePrimaryTagPartOfSlug = options.enablePrimaryTagPartOfSlug ?? true;
16
+ const topicless = new Set(options.topiclessArticleTypeSlugs ?? []);
17
+ const articleTypeIndex = (slug) => `${articlesBase}/${slug}/`;
18
+ const articleTypeTagIndex = (articleTypeSlug, tagSlug) => `${articlesBase}/${articleTypeSlug}/${tagSlug}/`;
19
+ const articleUrl = (articleTypeSlug, slug, primaryTagSlug) => {
20
+ if (topicless.has(articleTypeSlug)) {
21
+ return `${articlesBase}/${articleTypeSlug}/${slug}/`;
22
+ }
23
+ if (enablePrimaryTagPartOfSlug) {
24
+ const topic = primaryTagSlug || defaultTopic;
25
+ return `${articlesBase}/${articleTypeSlug}/${topic}/${slug}/`;
26
+ }
27
+ return `${articlesBase}/${articleTypeSlug}/${slug}/`;
28
+ };
29
+ return {
30
+ page: calculatePageHref,
31
+ pageVariant: calculatePageVariantHref,
32
+ article: articleUrl,
33
+ articleType: articleTypeIndex,
34
+ articleTypeTag: articleTypeTagIndex,
35
+ tag: (slug) => `${tagsBase}/${slug}/`,
36
+ tagType: (slug) => `${tagsBase}/${slug}/`,
37
+ person: (slug) => `${peopleBase}/${slug}/`,
38
+ team: () => `${peopleBase}/`,
39
+ customType: (slug) => `/${slug}/`,
40
+ download: (assetId, filename) => `/download/${assetId}/${encodeURIComponent(filename)}`,
41
+ };
42
+ }
43
+ //# sourceMappingURL=marketing-site-url-calculators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"marketing-site-url-calculators.js","sourceRoot":"","sources":["../../src/routing/marketing-site-url-calculators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAiBjF,SAAS,iBAAiB,CAAC,IAAY;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,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OAAO,GAAG,YAAY,IAAI,eAAe,IAAI,IAAI,GAAG,CAAC;IACvD,CAAC,CAAC;IAEF,OAAO;QACL,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,wBAAwB;QACrC,OAAO,EAAE,UAAU;QACnB,WAAW,EAAE,gBAAgB;QAC7B,cAAc,EAAE,mBAAmB;QACnC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,QAAQ,IAAI,IAAI,GAAG;QACrC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,QAAQ,IAAI,IAAI,GAAG;QACzC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,UAAU,IAAI,IAAI,GAAG;QAC1C,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,UAAU,GAAG;QAC5B,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,IAAI,GAAG;QACjC,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,EAAE,CAAC,aAAa,OAAO,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE;KACxF,CAAC;AACJ,CAAC"}
package/dist/server.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import 'server-only';
2
2
  // Download handler
3
- export { createDownloadHandler, } from './api/server-asset';
4
- export { contentTypeHandlers, revalidateAsset, revalidateDeletedAsset, revalidateDeletedEntry, revalidateEntry, } from './revalidation/handlers';
3
+ export { createDownloadHandler, } from './api/server-asset.js';
4
+ export { contentTypeHandlers, revalidateAsset, revalidateDeletedAsset, revalidateDeletedEntry, revalidateEntry, } from './revalidation/handlers.js';
5
5
  // Revalidation handlers and routes
6
- export { createRevalidationHandler, } from './revalidation/nextjs-route';
7
- export { handleRevalidation } from './revalidation/route';
6
+ export { createRevalidationHandler, } from './revalidation/nextjs-route.js';
7
+ export { handleRevalidation } from './revalidation/route.js';
8
8
  // Revalidation utilities
9
- export { revalidateSingleTag, revalidateTags } from './revalidation/server-utils';
9
+ export { revalidateSingleTag, revalidateTags } from './revalidation/server-utils.js';
10
10
  //# sourceMappingURL=server.js.map