@se-studio/contentful-rest-api 1.14.8 → 1.14.10
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 +12 -0
- package/dist/api/breadcrumb.d.ts +1 -1
- package/dist/api/breadcrumb.d.ts.map +1 -1
- package/dist/api/breadcrumb.js +19 -8
- package/dist/api/breadcrumb.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @se-studio/contentful-rest-api
|
|
2
2
|
|
|
3
|
+
## 1.14.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Restore `tagType` in `getBreadcrumbLookup` so tag type index paths resolve breadcrumb labels. Spaces without `tagType.slug` still fall back to minimal fields via existing link fetch logic.
|
|
8
|
+
|
|
9
|
+
## 1.14.9
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Skip tagType fetch in `getBreadcrumbLookup` so spaces without `tagType.slug` (e.g. point.me) do not 422 when resolving breadcrumb labels.
|
|
14
|
+
|
|
3
15
|
## 1.14.8
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/api/breadcrumb.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export type BreadcrumbLookup = Map<string, BreadcrumbLookupEntry>;
|
|
|
18
18
|
* Keys are normalized paths (e.g. "/locations/new-york/"); values are title and optional breadcrumb override.
|
|
19
19
|
*
|
|
20
20
|
* Uses force-cache with revalidate 3600. Cache invalidation is driven by the
|
|
21
|
-
* underlying link fetches (page, article, articleType, tag, person tags).
|
|
21
|
+
* underlying link fetches (page, article, articleType, tag, tagType, person tags).
|
|
22
22
|
* Safe to call on every request; responses are cached.
|
|
23
23
|
*
|
|
24
24
|
* @param context - Converter context with urlCalculators
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/api/breadcrumb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"breadcrumb.d.ts","sourceRoot":"","sources":["../../src/api/breadcrumb.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAU/D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,GAAG,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;AAoBlE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAuB3B"}
|
package/dist/api/breadcrumb.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { buildListingLinkCacheOptions } from '../navigation/cacheOptions.js';
|
|
2
|
+
import { contentfulAllArticleLinks, contentfulAllArticleTypeLinks, contentfulAllPageLinks, contentfulAllPersonLinks, contentfulAllTagLinks, contentfulAllTagTypeLinks, } from './links.js';
|
|
2
3
|
function normalizeHref(href) {
|
|
3
4
|
if (!href)
|
|
4
5
|
return '/';
|
|
@@ -18,7 +19,7 @@ function addLinksToLookup(lookup, links) {
|
|
|
18
19
|
* Keys are normalized paths (e.g. "/locations/new-york/"); values are title and optional breadcrumb override.
|
|
19
20
|
*
|
|
20
21
|
* Uses force-cache with revalidate 3600. Cache invalidation is driven by the
|
|
21
|
-
* underlying link fetches (page, article, articleType, tag, person tags).
|
|
22
|
+
* underlying link fetches (page, article, articleType, tag, tagType, person tags).
|
|
22
23
|
* Safe to call on every request; responses are cached.
|
|
23
24
|
*
|
|
24
25
|
* @param context - Converter context with urlCalculators
|
|
@@ -37,13 +38,23 @@ function addLinksToLookup(lookup, links) {
|
|
|
37
38
|
* ```
|
|
38
39
|
*/
|
|
39
40
|
export async function getBreadcrumbLookup(context, config, options) {
|
|
40
|
-
const
|
|
41
|
+
const cacheOptions = buildListingLinkCacheOptions(options);
|
|
42
|
+
// Breadcrumbs need routable entry links — not customType or link wrappers.
|
|
43
|
+
const [pages, articles, articleTypes, tags, tagTypes, persons] = await Promise.all([
|
|
44
|
+
contentfulAllPageLinks(context, config, cacheOptions),
|
|
45
|
+
contentfulAllArticleLinks(context, config, cacheOptions),
|
|
46
|
+
contentfulAllArticleTypeLinks(context, config, cacheOptions),
|
|
47
|
+
contentfulAllTagLinks(context, config, cacheOptions),
|
|
48
|
+
contentfulAllTagTypeLinks(context, config, cacheOptions),
|
|
49
|
+
contentfulAllPersonLinks(context, config, cacheOptions),
|
|
50
|
+
]);
|
|
41
51
|
const lookup = new Map();
|
|
42
|
-
addLinksToLookup(lookup,
|
|
43
|
-
addLinksToLookup(lookup,
|
|
44
|
-
addLinksToLookup(lookup,
|
|
45
|
-
addLinksToLookup(lookup,
|
|
46
|
-
addLinksToLookup(lookup,
|
|
52
|
+
addLinksToLookup(lookup, pages.data);
|
|
53
|
+
addLinksToLookup(lookup, articles.data);
|
|
54
|
+
addLinksToLookup(lookup, articleTypes.data);
|
|
55
|
+
addLinksToLookup(lookup, tags.data);
|
|
56
|
+
addLinksToLookup(lookup, tagTypes.data);
|
|
57
|
+
addLinksToLookup(lookup, persons.data);
|
|
47
58
|
return lookup;
|
|
48
59
|
}
|
|
49
60
|
//# sourceMappingURL=breadcrumb.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/api/breadcrumb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"breadcrumb.js","sourceRoot":"","sources":["../../src/api/breadcrumb.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,EACL,yBAAyB,EACzB,6BAA6B,EAC7B,sBAAsB,EACtB,wBAAwB,EACxB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,SAAS,CAAC;AAiBjB,SAAS,aAAa,CAAC,IAAY;IACjC,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,CAAC;IACtB,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC;AACvF,CAAC;AAED,SAAS,gBAAgB,CACvB,MAAwB,EACxB,KAA4D;IAE5D,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,UAAU,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5C,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,SAAS;SACnD,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAA6B,EAC7B,MAAwB,EACxB,OAAqB;IAErB,MAAM,YAAY,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAE3D,2EAA2E;IAC3E,MAAM,CAAC,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,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