@quintype/framework 7.22.0 → 7.22.1-stories-by-external-id.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quintype/framework",
|
|
3
|
-
"version": "7.22.
|
|
3
|
+
"version": "7.22.1-stories-by-external-id.1",
|
|
4
4
|
"description": "Libraries to help build Quintype Node.js apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"engines": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"npm": "^8.5.0"
|
|
9
9
|
},
|
|
10
10
|
"scripts": {
|
|
11
|
-
"prepublishOnly": "
|
|
11
|
+
"prepublishOnly": "./bin-dev-scripts/standard-version-release.sh",
|
|
12
12
|
"test": "NODE_ENV=test npx mocha --recursive --require ./test/babel",
|
|
13
13
|
"watch-test": "NODE_ENV=test npx mocha --recursive --watch --require ./test/babel",
|
|
14
14
|
"coverage": "nyc --all npm test",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@ampproject/toolbox-optimizer": "2.8.3",
|
|
34
34
|
"@quintype/amp": "^2.17.13",
|
|
35
|
-
"@quintype/backend": "^2.3.
|
|
35
|
+
"@quintype/backend": "^2.3.4-stories-by-external-id.1",
|
|
36
36
|
"@quintype/components": "^3.3.0",
|
|
37
37
|
"@quintype/prerender-node": "^3.2.26",
|
|
38
38
|
"@quintype/seo": "^1.43.0-config-amp-story-path.1",
|
|
@@ -15,6 +15,7 @@ const { customUrlToCacheKey } = require("../caching");
|
|
|
15
15
|
const { addLightPageHeaders } = require("../impl/light-page-impl");
|
|
16
16
|
const { getOneSignalScript } = require("./onesignal-script");
|
|
17
17
|
const { getRedirectUrl } = require("../redirect-url-helper");
|
|
18
|
+
const { Story } = require("../impl/api-client-impl");
|
|
18
19
|
|
|
19
20
|
const ABORT_HANDLER = "__ABORT__";
|
|
20
21
|
function abortHandler() {
|
|
@@ -70,6 +71,19 @@ function loadDataForIsomorphicRoute(
|
|
|
70
71
|
|
|
71
72
|
return result;
|
|
72
73
|
}
|
|
74
|
+
|
|
75
|
+
const story = await Story.getStoryByExternalId(client, url.pathname);
|
|
76
|
+
if (story) {
|
|
77
|
+
const params = Object.assign({}, url.query, otherParams, { storySlug: story.slug });
|
|
78
|
+
const result = await loadData("story-page", params, config, client, {
|
|
79
|
+
host,
|
|
80
|
+
next: abortHandler,
|
|
81
|
+
domainSlug,
|
|
82
|
+
cookies,
|
|
83
|
+
mobileApiEnabled,
|
|
84
|
+
});
|
|
85
|
+
return result;
|
|
86
|
+
}
|
|
73
87
|
}
|
|
74
88
|
}
|
|
75
89
|
|