@c-rex/services 0.3.0-build.51 → 0.3.0-build.53
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/dist/generated/client-requests.js +2 -1
- package/dist/generated/client-requests.js.map +1 -1
- package/dist/generated/client-requests.mjs +2 -1
- package/dist/generated/client-requests.mjs.map +1 -1
- package/dist/html-enrichment/index.js +6 -2
- package/dist/html-enrichment/index.js.map +1 -1
- package/dist/html-enrichment/index.mjs +6 -2
- package/dist/html-enrichment/index.mjs.map +1 -1
- package/dist/index.js +19 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -4
- package/dist/index.mjs.map +1 -1
- package/dist/read-models/index.d.mts +4 -1
- package/dist/read-models/index.d.ts +4 -1
- package/dist/read-models/index.js +17 -1
- package/dist/read-models/index.js.map +1 -1
- package/dist/read-models/index.mjs +22 -2
- package/dist/read-models/index.mjs.map +1 -1
- package/dist/toc-structure.d.mts +17 -2
- package/dist/toc-structure.d.ts +17 -2
- package/dist/toc-structure.js +21 -0
- package/dist/toc-structure.js.map +1 -1
- package/dist/toc-structure.mjs +18 -0
- package/dist/toc-structure.mjs.map +1 -1
- package/dist/vcard/index.js +0 -1
- package/dist/vcard/index.js.map +1 -1
- package/dist/vcard/index.mjs +0 -1
- package/dist/vcard/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -491,7 +491,8 @@ var baseClientRequest = async (endpoint, queryParams, options, extra) => {
|
|
|
491
491
|
url: endpoint,
|
|
492
492
|
method: "GET",
|
|
493
493
|
params: queryParams,
|
|
494
|
-
responseType: extra?.responseType
|
|
494
|
+
responseType: extra?.responseType,
|
|
495
|
+
authMode: extra?.authMode
|
|
495
496
|
}
|
|
496
497
|
}),
|
|
497
498
|
credentials: "include",
|
|
@@ -1244,7 +1245,6 @@ var fetchOrganizationProfileById = async (id, query, context) => {
|
|
|
1244
1245
|
{ id },
|
|
1245
1246
|
resolveOrganizationProfileQuery(query)
|
|
1246
1247
|
);
|
|
1247
|
-
console.log("[OrganizationProfile] Raw VCARD response:", organization);
|
|
1248
1248
|
return toOrganizationProfile(organization, {
|
|
1249
1249
|
uiLanguage: context.uiLanguage,
|
|
1250
1250
|
displayNameFallback: context.fallbackName,
|
|
@@ -2843,7 +2843,13 @@ import {
|
|
|
2843
2843
|
CREX_READMODEL_CACHE_STATIC_PAGES_TAG
|
|
2844
2844
|
} from "@c-rex/core/requests";
|
|
2845
2845
|
import { CrexLogger as CrexLogger2 } from "@c-rex/core/logger";
|
|
2846
|
-
import {
|
|
2846
|
+
import {
|
|
2847
|
+
CREX_TOKEN_HEADER_KEY,
|
|
2848
|
+
RENDITION_LINK_RELS,
|
|
2849
|
+
TOKEN_SOURCES
|
|
2850
|
+
} from "@c-rex/constants";
|
|
2851
|
+
import { cookies as cookies2 } from "next/headers";
|
|
2852
|
+
import { CrexSDK as CrexSDK2 } from "@c-rex/core/sdk";
|
|
2847
2853
|
var DEFAULT_SORT = ["-informationSubjects.id"];
|
|
2848
2854
|
var DEFAULT_PAGE_SIZE = 100;
|
|
2849
2855
|
var RENDITION_FETCH_TIMEOUT_MS = 5e3;
|
|
@@ -2981,9 +2987,23 @@ var getStaticPagesCached = unstable_cache5(
|
|
|
2981
2987
|
]
|
|
2982
2988
|
}
|
|
2983
2989
|
);
|
|
2990
|
+
var getCurrentUserAuthToken = async () => {
|
|
2991
|
+
try {
|
|
2992
|
+
const config = new CrexSDK2().getServerConfig();
|
|
2993
|
+
if (config.OIDC.tokenSource !== TOKEN_SOURCES.USER_LOGIN) return void 0;
|
|
2994
|
+
const token = (await cookies2()).get(CREX_TOKEN_HEADER_KEY)?.value.trim();
|
|
2995
|
+
return token || void 0;
|
|
2996
|
+
} catch {
|
|
2997
|
+
return void 0;
|
|
2998
|
+
}
|
|
2999
|
+
};
|
|
2984
3000
|
var getStaticPages = async (query) => {
|
|
2985
3001
|
try {
|
|
2986
|
-
const
|
|
3002
|
+
const authToken = await getCurrentUserAuthToken();
|
|
3003
|
+
const pages = authToken ? await withServerRequestContext(
|
|
3004
|
+
{ skipCookieTokenLookup: true, authToken },
|
|
3005
|
+
() => fetchStaticPages(query)
|
|
3006
|
+
) : await getStaticPagesCached(query);
|
|
2987
3007
|
return { status: "ok", pages };
|
|
2988
3008
|
} catch (error) {
|
|
2989
3009
|
const logger = new CrexLogger2();
|