@blaze-cms/nextjs-tools 0.146.0-node18-tooltips.38 → 0.146.0-node18-core-styles-tooltips.52
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 +124 -34
- package/README.md +7 -8
- package/example.env +1 -1
- package/lib/helpers/check-url.js +1 -1
- package/lib/helpers/check-url.js.map +1 -1
- package/lib-es/helpers/check-url.js +1 -1
- package/lib-es/helpers/check-url.js.map +1 -1
- package/package.json +19 -19
- package/src/helpers/check-url.js +1 -1
- package/tests/unit/src/application/query/__snapshots__/index.test.js.snap +6 -0
- package/tests/unit/src/helpers/static-route-handlers/__snapshots__/generic-file-handler.test.js.snap +2 -0
- package/tests/unit/src/helpers/static-route-handlers/__snapshots__/llms.test.js.snap +1 -0
- package/tests/unit/src/helpers/static-route-handlers/__snapshots__/robots-txt.test.js.snap +1 -0
- package/tests/unit/src/helpers/static-route-handlers/__snapshots__/sitemap-file.test.js.snap +2 -0
- package/tests/unit/src/helpers/static-route-handlers/__snapshots__/sitemap.test.js.snap +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,12 +3,37 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [0.146.0-node18-tooltips.
|
|
6
|
+
# [0.146.0-node18-core-styles-tooltips.52](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.51...v0.146.0-node18-core-styles-tooltips.52) (2026-02-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.146.0-node18-core-styles-tooltips.51](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.50...v0.146.0-node18-core-styles-tooltips.51) (2026-02-16)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [0.146.0-node18-core-styles-tooltips.46](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.45...v0.146.0-node18-core-styles-tooltips.46) (2026-01-16)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [0.146.0-node18-core-styles-tooltips.45](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.44...v0.146.0-node18-core-styles-tooltips.45) (2026-01-15)
|
|
7
31
|
|
|
8
32
|
|
|
9
33
|
### Bug Fixes
|
|
10
34
|
|
|
11
35
|
* changed plugin logic ([451b8af](https://github.com/thebyte9/blaze/commit/451b8afd47fade28b0143c128cf645fe90557424))
|
|
36
|
+
* snapshots ([2283a3d](https://github.com/thebyte9/blaze/commit/2283a3da71117b93fc3f52d8ddb6373fd10fa2eb))
|
|
12
37
|
|
|
13
38
|
|
|
14
39
|
### Features
|
|
@@ -19,7 +44,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
19
44
|
|
|
20
45
|
|
|
21
46
|
|
|
22
|
-
# [0.146.0-node18-tooltips.
|
|
47
|
+
# [0.146.0-node18-core-styles-tooltips.44](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.43...v0.146.0-node18-core-styles-tooltips.44) (2026-01-02)
|
|
23
48
|
|
|
24
49
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
25
50
|
|
|
@@ -27,7 +52,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
27
52
|
|
|
28
53
|
|
|
29
54
|
|
|
30
|
-
# [0.146.0-node18-tooltips.
|
|
55
|
+
# [0.146.0-node18-core-styles-tooltips.43](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.42...v0.146.0-node18-core-styles-tooltips.43) (2025-12-17)
|
|
31
56
|
|
|
32
57
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
33
58
|
|
|
@@ -35,7 +60,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
35
60
|
|
|
36
61
|
|
|
37
62
|
|
|
38
|
-
# [0.146.0-node18-tooltips.
|
|
63
|
+
# [0.146.0-node18-core-styles-tooltips.42](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.41...v0.146.0-node18-core-styles-tooltips.42) (2025-12-17)
|
|
39
64
|
|
|
40
65
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
41
66
|
|
|
@@ -43,7 +68,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
43
68
|
|
|
44
69
|
|
|
45
70
|
|
|
46
|
-
# [0.146.0-node18-tooltips.
|
|
71
|
+
# [0.146.0-node18-core-styles-tooltips.41](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.40...v0.146.0-node18-core-styles-tooltips.41) (2025-12-15)
|
|
47
72
|
|
|
48
73
|
|
|
49
74
|
### Features
|
|
@@ -54,7 +79,39 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
54
79
|
|
|
55
80
|
|
|
56
81
|
|
|
57
|
-
# [0.146.0-node18-tooltips.
|
|
82
|
+
# [0.146.0-node18-core-styles-tooltips.38](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.37...v0.146.0-node18-core-styles-tooltips.38) (2025-12-04)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
# [0.146.0-node18-core-styles-tooltips.34](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.33...v0.146.0-node18-core-styles-tooltips.34) (2025-11-27)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
# [0.146.0-node18-core-styles-tooltips.32](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.31...v0.146.0-node18-core-styles-tooltips.32) (2025-11-26)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
# [0.146.0-node18-core-styles-tooltips.31](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.30...v0.146.0-node18-core-styles-tooltips.31) (2025-11-26)
|
|
107
|
+
|
|
108
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
# [0.146.0-node18-core-styles-tooltips.30](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.29...v0.146.0-node18-core-styles-tooltips.30) (2025-11-25)
|
|
58
115
|
|
|
59
116
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
60
117
|
|
|
@@ -62,7 +119,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
62
119
|
|
|
63
120
|
|
|
64
121
|
|
|
65
|
-
# [0.146.0-node18-tooltips.
|
|
122
|
+
# [0.146.0-node18-core-styles-tooltips.29](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.28...v0.146.0-node18-core-styles-tooltips.29) (2025-11-17)
|
|
66
123
|
|
|
67
124
|
|
|
68
125
|
### Features
|
|
@@ -73,7 +130,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
73
130
|
|
|
74
131
|
|
|
75
132
|
|
|
76
|
-
# [0.146.0-node18-tooltips.
|
|
133
|
+
# [0.146.0-node18-core-styles-tooltips.27](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.26...v0.146.0-node18-core-styles-tooltips.27) (2025-11-13)
|
|
134
|
+
|
|
135
|
+
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
# [0.146.0-node18-core-styles-tooltips.26](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.25...v0.146.0-node18-core-styles-tooltips.26) (2025-11-12)
|
|
77
142
|
|
|
78
143
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
79
144
|
|
|
@@ -81,7 +146,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
81
146
|
|
|
82
147
|
|
|
83
148
|
|
|
84
|
-
# [0.146.0-node18-tooltips.
|
|
149
|
+
# [0.146.0-node18-core-styles-tooltips.25](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.24...v0.146.0-node18-core-styles-tooltips.25) (2025-11-07)
|
|
85
150
|
|
|
86
151
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
87
152
|
|
|
@@ -89,7 +154,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
89
154
|
|
|
90
155
|
|
|
91
156
|
|
|
92
|
-
# [0.146.0-node18-tooltips.
|
|
157
|
+
# [0.146.0-node18-core-styles-tooltips.24](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.23...v0.146.0-node18-core-styles-tooltips.24) (2025-11-03)
|
|
93
158
|
|
|
94
159
|
|
|
95
160
|
### Bug Fixes
|
|
@@ -105,7 +170,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
105
170
|
|
|
106
171
|
|
|
107
172
|
|
|
108
|
-
# [0.146.0-node18-tooltips.
|
|
173
|
+
# [0.146.0-node18-core-styles-tooltips.23](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.22...v0.146.0-node18-core-styles-tooltips.23) (2025-10-27)
|
|
109
174
|
|
|
110
175
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
111
176
|
|
|
@@ -113,7 +178,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
113
178
|
|
|
114
179
|
|
|
115
180
|
|
|
116
|
-
# [0.146.0-node18-tooltips.
|
|
181
|
+
# [0.146.0-node18-core-styles-tooltips.22](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.21...v0.146.0-node18-core-styles-tooltips.22) (2025-10-20)
|
|
117
182
|
|
|
118
183
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
119
184
|
|
|
@@ -121,7 +186,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
121
186
|
|
|
122
187
|
|
|
123
188
|
|
|
124
|
-
# [0.146.0-node18-tooltips.
|
|
189
|
+
# [0.146.0-node18-core-styles-tooltips.21](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.20...v0.146.0-node18-core-styles-tooltips.21) (2025-10-07)
|
|
125
190
|
|
|
126
191
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
127
192
|
|
|
@@ -129,7 +194,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
129
194
|
|
|
130
195
|
|
|
131
196
|
|
|
132
|
-
# [0.146.0-node18-tooltips.
|
|
197
|
+
# [0.146.0-node18-core-styles-tooltips.20](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.19...v0.146.0-node18-core-styles-tooltips.20) (2025-10-03)
|
|
133
198
|
|
|
134
199
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
135
200
|
|
|
@@ -137,7 +202,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
137
202
|
|
|
138
203
|
|
|
139
204
|
|
|
140
|
-
# [0.146.0-node18-tooltips.
|
|
205
|
+
# [0.146.0-node18-core-styles-tooltips.19](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.18...v0.146.0-node18-core-styles-tooltips.19) (2025-10-01)
|
|
141
206
|
|
|
142
207
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
143
208
|
|
|
@@ -145,7 +210,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
145
210
|
|
|
146
211
|
|
|
147
212
|
|
|
148
|
-
# [0.146.0-node18-tooltips.
|
|
213
|
+
# [0.146.0-node18-core-styles-tooltips.18](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.17...v0.146.0-node18-core-styles-tooltips.18) (2025-09-29)
|
|
149
214
|
|
|
150
215
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
151
216
|
|
|
@@ -153,7 +218,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
153
218
|
|
|
154
219
|
|
|
155
220
|
|
|
156
|
-
# [0.146.0-node18-tooltips.
|
|
221
|
+
# [0.146.0-node18-core-styles-tooltips.15](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.14...v0.146.0-node18-core-styles-tooltips.15) (2025-09-23)
|
|
157
222
|
|
|
158
223
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
159
224
|
|
|
@@ -161,15 +226,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
161
226
|
|
|
162
227
|
|
|
163
228
|
|
|
164
|
-
# [0.146.0-node18-tooltips.
|
|
229
|
+
# [0.146.0-node18-core-styles-tooltips.14](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.13...v0.146.0-node18-core-styles-tooltips.14) (2025-09-18)
|
|
165
230
|
|
|
166
|
-
|
|
231
|
+
|
|
232
|
+
### Bug Fixes
|
|
233
|
+
|
|
234
|
+
* force debug link to open in new tab ([#4907](https://github.com/thebyte9/blaze/issues/4907)) ([59abc33](https://github.com/thebyte9/blaze/commit/59abc3356636f5f8eb6ff911101947c878dbd213))
|
|
167
235
|
|
|
168
236
|
|
|
169
237
|
|
|
170
238
|
|
|
171
239
|
|
|
172
|
-
# [0.146.0-node18-tooltips.
|
|
240
|
+
# [0.146.0-node18-core-styles-tooltips.13](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.12...v0.146.0-node18-core-styles-tooltips.13) (2025-09-15)
|
|
173
241
|
|
|
174
242
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
175
243
|
|
|
@@ -177,7 +245,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
177
245
|
|
|
178
246
|
|
|
179
247
|
|
|
180
|
-
# [0.146.0-node18-tooltips.
|
|
248
|
+
# [0.146.0-node18-core-styles-tooltips.12](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.11...v0.146.0-node18-core-styles-tooltips.12) (2025-08-27)
|
|
181
249
|
|
|
182
250
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
183
251
|
|
|
@@ -185,26 +253,30 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
185
253
|
|
|
186
254
|
|
|
187
255
|
|
|
188
|
-
# [0.146.0-node18-tooltips.
|
|
256
|
+
# [0.146.0-node18-core-styles-tooltips.11](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.10...v0.146.0-node18-core-styles-tooltips.11) (2025-08-27)
|
|
189
257
|
|
|
190
|
-
|
|
258
|
+
|
|
259
|
+
### Features
|
|
260
|
+
|
|
261
|
+
* add support for custom 404 page using custom error 404 slug and fallback rendering ([#4839](https://github.com/thebyte9/blaze/issues/4839)) ([67554a3](https://github.com/thebyte9/blaze/commit/67554a3febc2871d73bd127753edf3b918a1a0b7))
|
|
262
|
+
* chart component ([#4846](https://github.com/thebyte9/blaze/issues/4846)) ([f74bd5a](https://github.com/thebyte9/blaze/commit/f74bd5aecc6078e725f92c523d8da0916a612d88))
|
|
191
263
|
|
|
192
264
|
|
|
193
265
|
|
|
194
266
|
|
|
195
267
|
|
|
196
|
-
# [0.146.0-node18-tooltips.
|
|
268
|
+
# [0.146.0-node18-core-styles-tooltips.8](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.7...v0.146.0-node18-core-styles-tooltips.8) (2025-07-25)
|
|
197
269
|
|
|
198
270
|
|
|
199
271
|
### Bug Fixes
|
|
200
272
|
|
|
201
|
-
*
|
|
273
|
+
* restore favion loading in the frontend ([#4851](https://github.com/thebyte9/blaze/issues/4851)) ([f1c31bb](https://github.com/thebyte9/blaze/commit/f1c31bb2213f79b1d4b6b1ae6e5d5bd2b150fdf8))
|
|
202
274
|
|
|
203
275
|
|
|
204
276
|
|
|
205
277
|
|
|
206
278
|
|
|
207
|
-
# [0.146.0-node18-tooltips.
|
|
279
|
+
# [0.146.0-node18-core-styles-tooltips.5](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.4...v0.146.0-node18-core-styles-tooltips.5) (2025-07-18)
|
|
208
280
|
|
|
209
281
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
210
282
|
|
|
@@ -212,7 +284,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
212
284
|
|
|
213
285
|
|
|
214
286
|
|
|
215
|
-
# [0.146.0-node18-tooltips.
|
|
287
|
+
# [0.146.0-node18-core-styles-tooltips.4](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.3...v0.146.0-node18-core-styles-tooltips.4) (2025-07-10)
|
|
288
|
+
|
|
289
|
+
|
|
290
|
+
### Bug Fixes
|
|
291
|
+
|
|
292
|
+
* respond to live blog item size changes for laze loaded image, live blog title and global light box fix ([#4730](https://github.com/thebyte9/blaze/issues/4730)) ([5dd38d8](https://github.com/thebyte9/blaze/commit/5dd38d8d9e5983c55d3053d440eb7ab618688920))
|
|
293
|
+
|
|
294
|
+
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
# [0.146.0-node18-core-styles-tooltips.2](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.1...v0.146.0-node18-core-styles-tooltips.2) (2025-06-20)
|
|
216
299
|
|
|
217
300
|
**Note:** Version bump only for package @blaze-cms/nextjs-tools
|
|
218
301
|
|
|
@@ -220,24 +303,34 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
220
303
|
|
|
221
304
|
|
|
222
305
|
|
|
223
|
-
# [0.146.0-node18-tooltips.
|
|
306
|
+
# [0.146.0-node18-core-styles-tooltips.1](https://github.com/thebyte9/blaze/compare/v0.146.0-node18-core-styles-tooltips.0...v0.146.0-node18-core-styles-tooltips.1) (2025-06-20)
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
### Features
|
|
310
|
+
|
|
311
|
+
* added frontend links for editor mode ([#4801](https://github.com/thebyte9/blaze/issues/4801)) ([d5de370](https://github.com/thebyte9/blaze/commit/d5de370203abf467fcc3819d06c7375f4a6c1eb9))
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
# [0.146.0-node18-core-styles-tooltips.0](https://github.com/thebyte9/blaze/compare/v0.145.0...v0.146.0-node18-core-styles-tooltips.0) (2025-06-18)
|
|
224
318
|
|
|
225
319
|
|
|
226
320
|
### Bug Fixes
|
|
227
321
|
|
|
322
|
+
* adds default root selector to readme ([cfb5095](https://github.com/thebyte9/blaze/commit/cfb50956d95df485fe4486f632d32400b46806f7))
|
|
228
323
|
* bumped apollo versions ([b371dc7](https://github.com/thebyte9/blaze/commit/b371dc7e7bbe814a0cc4d57af2b959ab5e1b1bfd))
|
|
229
324
|
* fixed breaking tests, updated next to 14 ([fecb0e1](https://github.com/thebyte9/blaze/commit/fecb0e1d822bd69ebbaa084072a219f0fddd23f1))
|
|
230
325
|
* fixed more tests ([46a2fb9](https://github.com/thebyte9/blaze/commit/46a2fb9467f9f3c9cf320c9caf36c66503cc1f49))
|
|
231
326
|
* fixed remaining failing tests ([8a5963f](https://github.com/thebyte9/blaze/commit/8a5963ff8a0bf615a2ced9fb77b8986a9b05d80c))
|
|
327
|
+
* fixes readme layout ([9dbdd8e](https://github.com/thebyte9/blaze/commit/9dbdd8ee96cb4a716e1e42c224939ac22ac6af0d))
|
|
232
328
|
* lint errors for reegex ([daaf750](https://github.com/thebyte9/blaze/commit/daaf7506d22f9578072c71f5557d0b6bf6185018))
|
|
233
329
|
* linting fix for reading return values from promise executor functions ([7edb563](https://github.com/thebyte9/blaze/commit/7edb563a4cbfa37188f26c1ae709ffe8ed837d69))
|
|
234
330
|
* linting fixed automatically ([73135b9](https://github.com/thebyte9/blaze/commit/73135b9b8b0d5407e2e1dfba42ab2381f290607f))
|
|
235
331
|
* only do parent redirect when there are graphql errors ([#4697](https://github.com/thebyte9/blaze/issues/4697)) ([1ec63ba](https://github.com/thebyte9/blaze/commit/1ec63ba95c21c11d41721f07346945742d7237ae))
|
|
236
332
|
* prevent 404 error when no data is returned from and improve redi… ([#4688](https://github.com/thebyte9/blaze/issues/4688)) ([3a5af3d](https://github.com/thebyte9/blaze/commit/3a5af3ddf65d67456971d2d75525235c30965633))
|
|
237
|
-
* respond to live blog item size changes for laze loaded image, live blog title and global light box fix ([#4730](https://github.com/thebyte9/blaze/issues/4730)) ([5dd38d8](https://github.com/thebyte9/blaze/commit/5dd38d8d9e5983c55d3053d440eb7ab618688920))
|
|
238
|
-
* restore favion loading in the frontend ([#4851](https://github.com/thebyte9/blaze/issues/4851)) ([f1c31bb](https://github.com/thebyte9/blaze/commit/f1c31bb2213f79b1d4b6b1ae6e5d5bd2b150fdf8))
|
|
239
333
|
* set blank cache-control header to override nextjs default of 0 ([#4783](https://github.com/thebyte9/blaze/issues/4783)) ([2f1653e](https://github.com/thebyte9/blaze/commit/2f1653ed3756a90575c48f8a2253776958c6c0ff))
|
|
240
|
-
* show pagebuilder tabs when no components added ([#4844](https://github.com/thebyte9/blaze/issues/4844)) ([2cbb24d](https://github.com/thebyte9/blaze/commit/2cbb24df95b38d4c8f4575814daadebd74ba04d4))
|
|
241
334
|
* udpated yarn lock ([0cd4fa4](https://github.com/thebyte9/blaze/commit/0cd4fa4a185fca4b80b57e472badb771dd649ec2))
|
|
242
335
|
* updated with dev ([90f545f](https://github.com/thebyte9/blaze/commit/90f545f1beabb35e26ba6fb2b45a7a0dfd072927))
|
|
243
336
|
* updated with dev ([729bb6e](https://github.com/thebyte9/blaze/commit/729bb6ee7e87946081d51564a4ab45538f7be1e7))
|
|
@@ -248,10 +341,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
248
341
|
|
|
249
342
|
### Features
|
|
250
343
|
|
|
251
|
-
* add support for custom 404 page using custom error 404 slug and fallback rendering ([#4839](https://github.com/thebyte9/blaze/issues/4839)) ([67554a3](https://github.com/thebyte9/blaze/commit/67554a3febc2871d73bd127753edf3b918a1a0b7))
|
|
252
|
-
* added frontend links for editor mode ([#4801](https://github.com/thebyte9/blaze/issues/4801)) ([d5de370](https://github.com/thebyte9/blaze/commit/d5de370203abf467fcc3819d06c7375f4a6c1eb9))
|
|
253
344
|
* allow . (dot) character in route regex ([#4552](https://github.com/thebyte9/blaze/issues/4552)) ([9be0fe0](https://github.com/thebyte9/blaze/commit/9be0fe0dd0dac2e0891c2d965a20c6b2e02165cc))
|
|
254
|
-
* chart component ([#4846](https://github.com/thebyte9/blaze/issues/4846)) ([f74bd5a](https://github.com/thebyte9/blaze/commit/f74bd5aecc6078e725f92c523d8da0916a612d88))
|
|
255
345
|
* debug sidebar now shows on error if enabled ([#4667](https://github.com/thebyte9/blaze/issues/4667)) ([01d43e1](https://github.com/thebyte9/blaze/commit/01d43e19c160980cfc8259c1a951ab70ebe70eb0))
|
|
256
346
|
* open frontend debug toolbar with a url param ([#4771](https://github.com/thebyte9/blaze/issues/4771)) ([37b8ea5](https://github.com/thebyte9/blaze/commit/37b8ea59a5ed4be0912465717adeb079fd6b3a89))
|
|
257
347
|
* updated react to 18 ([9335f84](https://github.com/thebyte9/blaze/commit/9335f8432b376494501abb9c3deef1ddaa9b35a8))
|
package/README.md
CHANGED
|
@@ -90,16 +90,15 @@ If is possible to create a custom error page by adding a page with the slug "cus
|
|
|
90
90
|
## Environment variables
|
|
91
91
|
|
|
92
92
|
| Name | Description | Type | Default |
|
|
93
|
-
|
|
93
|
+
|---|---|---|---|
|
|
94
94
|
| BLAZE_FRONTEND_HOST | Frontend host (used to identify host) | String | |
|
|
95
|
-
| BLAZE_ROUTE_REGEX | Override default route regex | /^\/[a-z0-9
|
|
95
|
+
| BLAZE_ROUTE_REGEX | Override default route regex | Regex | /^\/[a-z0-9€_\/]+(?:[-\/\.]{1,2}[a-z0-9\/€_\/]+)*$|^\/$/ |
|
|
96
96
|
| BLAZE_CACHE_CONTROL_HEADER | Cache-Control header to set on page requests | String | "" |
|
|
97
|
-
| BLAZE_STATIC_ROUTE_STORE_KEY | Override store for static file routes | default |
|
|
98
|
-
| BLAZE_ROUTE_PATTERN_SITEMAP | Override sitemap route | /sitemap.xml |
|
|
97
|
+
| BLAZE_STATIC_ROUTE_STORE_KEY | Override store for static file routes | String | default |
|
|
98
|
+
| BLAZE_ROUTE_PATTERN_SITEMAP | Override sitemap route | String | /sitemap.xml |
|
|
99
99
|
| BLAZE_CONTENT_SITEMAP_URL_PREFIX | Prefix for sitemap URL, used in frontend static route e.g. /sitemap/sitemap-0.xml. This needs to match the value set in the API app. | String | |
|
|
100
|
-
| BLAZE_ROOT_SELECTOR_CLASSES_LIMIT | The number of root-selector classes to display.
|
|
101
|
-
| BLAZE_BUILD_ENV_PREFIX_REGEX | '\|' separated list of allowed environment variable prefixes. Any environment variable that matches this prefix pattern will be dynamically added to the next environment config and will be available in code for use. If the environment variable has a "BUILD_" prefix, then this prefix will be removed from the next environment variable name before assigning it. i.e. BUILD_THIRD_PARTY_ENV will become THIRD_PARTY_ENV in the build. Prefixes BLAZE\|GOOGLE\|JWPLAYER\|DFP are added for backward compatibility and will be deprecated. We recommend to use new and change existing environment variables with "BUILD_" prefix. | BLAZE\|GOOGLE\|JWPLAYER\|DFP\|BUILD |
|
|
102
|
-
| BLAZE_CONTENT_SITEMAP_URL_PREFIX | Prefix for sitemap URL, used in frontend static route e.g. /sitemap/sitemap-0.xml. This needs to match value set in API app. | String | |
|
|
100
|
+
| BLAZE_ROOT_SELECTOR_CLASSES_LIMIT | The number of root-selector classes to display. If the variable is not set, it defaults to 1, displaying only the highest-level parent class. | String | 1 |
|
|
101
|
+
| BLAZE_BUILD_ENV_PREFIX_REGEX | '\|' separated list of allowed environment variable prefixes. Any environment variable that matches this prefix pattern will be dynamically added to the next environment config and will be available in code for use. If the environment variable has a "BUILD_" prefix, then this prefix will be removed from the next environment variable name before assigning it. i.e. BUILD_THIRD_PARTY_ENV will become THIRD_PARTY_ENV in the build. Prefixes BLAZE\|GOOGLE\|JWPLAYER\|DFP are added for backward compatibility and will be deprecated. We recommend to use new and change existing environment variables with "BUILD_" prefix. | String | BLAZE\|GOOGLE\|JWPLAYER\|DFP\|BUILD |
|
|
103
102
|
| BLAZE_DISABLE_REDIRECT_WITH_QUERY | Do not add query string to redirects | String | |
|
|
104
103
|
|
|
105
104
|
## Events emitted
|
|
@@ -206,7 +205,7 @@ When checking new code or build configs make sure to check the [following things
|
|
|
206
205
|
|
|
207
206
|
## Root selector classes
|
|
208
207
|
|
|
209
|
-
To make styling of sections of a site simpler, it is possible to enable setting root selector classes at the top of the Resolver page structure that are generated based on the url hierarchy.
|
|
208
|
+
To make styling of sections of a site simpler, it is possible to enable setting root selector classes at the top of the Resolver page structure that are generated based on the url hierarchy. If the variable is not set, it defaults to 1, displaying only the highest-level parent class.
|
|
210
209
|
|
|
211
210
|
For example the following url, `/parent/child/article-123` might be broken into the following classes
|
|
212
211
|
|
package/example.env
CHANGED
|
@@ -3,6 +3,6 @@ BLAZE_FRONTEND_HOST=thisisblaze.com
|
|
|
3
3
|
BLAZE_ROUTE_PATTERN_SITEMAP="/sitemap.xml"
|
|
4
4
|
BLAZE_CONTENT_SITEMAP_URL_PREFIX="sitemap"
|
|
5
5
|
#BLAZE_ROUTE_REGEX="^\/[a-z0-9€_\/]+(?:[-\/]{1,2}[a-z0-9\/€_\/]+)*$|^\/$"
|
|
6
|
-
BLAZE_ROOT_SELECTOR_CLASSES_LIMIT="
|
|
6
|
+
BLAZE_ROOT_SELECTOR_CLASSES_LIMIT="1"
|
|
7
7
|
BLAZE_CACHE_CONTROL_HEADER="max-age=0"
|
|
8
8
|
BLAZE_DISABLE_REDIRECT_WITH_QUERY=""
|
package/lib/helpers/check-url.js
CHANGED
|
@@ -34,7 +34,7 @@ var _getRootSelectorClasses = _interopRequireDefault(require("./get-root-selecto
|
|
|
34
34
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
35
35
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
36
36
|
var getRootClassesLimit = function getRootClassesLimit() {
|
|
37
|
-
return Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
|
|
37
|
+
return Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);
|
|
38
38
|
};
|
|
39
39
|
var checkUrl = /*#__PURE__*/function () {
|
|
40
40
|
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(props) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-url.js","names":["_queryString","require","_reactPageBuilder","_coreAuthUi","_constants","_query","_checkParent","_interopRequireDefault","_checkPreviewUrl","_handleStaticRoutes","_getPageData","_getRootSelectorClasses","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","_ref","_asyncToGenerator2","_regenerator","mark","_callee","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","_parseUrl","url","handler","previewData","urlCheckOptions","result","wrap","_callee$","_context","prev","next","getFullUrl","parseUrl","BLAZE_STATUS_URL","abrupt","isStatusPage","handleStaticRoutes","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","BLAZE_X_FRAME_OPTIONS_DEFAULT","getHeader","BLAZE_CACHE_CONTROL_HEADER","checkPreviewUrl","checkAccessToken","cache","extract","getPreviewData","doUrlCheck","handle404Error","sent","stop","_x","_ref2","_callee2","_result$pageData","_result$pageData2","rootSelectorClasses","_callee2$","_context2","getPageData","pageData","getRootSelectorClasses","isPreview","_x2","_x3","getHost","_ref3","_ref3$headers","headers","BLAZE_FRONTEND_HOST","host","concat","HTTPS","_window","window","_window$location","location","protocol","hostname","port","urlPort","COLON","DOUBLE_SLASH","_ref4","_callee3","args","_args$errorCheckCode","errorCheckCode","_yield$apolloClient$q","_yield$apolloClient$q2","_yield$apolloClient$q3","_yield$apolloClient$q4","_yield$apolloClient$q5","itemId","itemEntity","urlTo","_yield$apolloClient$q6","_callee3$","_context3","ROUTE_REGEX","test","Error","checkUrlQuery","variables","data","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","getUnpublishedEntityName","t0","handleUrlError","_x4","handleError","err","error","networkError","writeHead","write","end","graphQLErrors","NOT_FOUND_STATUS_CODE","errorCode","_ref5","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","_ref6","_ref6$cacheControlMax","cacheControlMaxAge","Location","href","redirecting","_x5","_x6","_handleUrlError","_callee4","parentUrl","parentPATH","_callee4$","_context4","ERROR_URLS","custom404","checkParent","_default","exports"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,mBAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,YAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,uBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AAAiE,SAAAW,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA,WAAAW,SAAA,CAAAZ,CAAA,IAAAY,SAAA,CAAAZ,CAAA,QAAAA,CAAA,OAAAF,OAAA,CAAAI,MAAA,CAAAD,CAAA,OAAAa,OAAA,WAAAd,CAAA,QAAAe,gBAAA,aAAAhB,CAAA,EAAAC,CAAA,EA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AG7BkF,WAAW,CAACC,GAAG,EAAEvG,GAAG,EAAEmC,cAAc,EAAEhC,QAAQ,CAAC;QAAA;QAAA;UAAA,OAAAkI,SAAA,CAAAhG,IAAA;MAAA;IAAA,GAAA4F,QAAA;EAAA,CACvD;EAAA,OAAAD,eAAA,CAAAvJ,KAAA,OAAAE,SAAA;AAAA;AAAA,IAAA8J,QAAA,GAAAC,OAAA,cAEcnJ,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"check-url.js","names":["_queryString","require","_reactPageBuilder","_coreAuthUi","_constants","_query","_checkParent","_interopRequireDefault","_checkPreviewUrl","_handleStaticRoutes","_getPageData","_getRootSelectorClasses","ownKeys","e","r","t","Object","keys","getOwnPropertySymbols","o","filter","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","arguments","length","forEach","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","_ref","_asyncToGenerator2","_regenerator","mark","_callee","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","_parseUrl","url","handler","previewData","urlCheckOptions","result","wrap","_callee$","_context","prev","next","getFullUrl","parseUrl","BLAZE_STATUS_URL","abrupt","isStatusPage","handleStaticRoutes","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","BLAZE_X_FRAME_OPTIONS_DEFAULT","getHeader","BLAZE_CACHE_CONTROL_HEADER","checkPreviewUrl","checkAccessToken","cache","extract","getPreviewData","doUrlCheck","handle404Error","sent","stop","_x","_ref2","_callee2","_result$pageData","_result$pageData2","rootSelectorClasses","_callee2$","_context2","getPageData","pageData","getRootSelectorClasses","isPreview","_x2","_x3","getHost","_ref3","_ref3$headers","headers","BLAZE_FRONTEND_HOST","host","concat","HTTPS","_window","window","_window$location","location","protocol","hostname","port","urlPort","COLON","DOUBLE_SLASH","_ref4","_callee3","args","_args$errorCheckCode","errorCheckCode","_yield$apolloClient$q","_yield$apolloClient$q2","_yield$apolloClient$q3","_yield$apolloClient$q4","_yield$apolloClient$q5","itemId","itemEntity","urlTo","_yield$apolloClient$q6","_callee3$","_context3","ROUTE_REGEX","test","Error","checkUrlQuery","variables","data","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","getUnpublishedEntityName","t0","handleUrlError","_x4","handleError","err","error","networkError","writeHead","write","end","graphQLErrors","NOT_FOUND_STATUS_CODE","errorCode","_ref5","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","_ref6","_ref6$cacheControlMax","cacheControlMaxAge","Location","href","redirecting","_x5","_x6","_handleUrlError","_callee4","parentUrl","parentPATH","_callee4$","_context4","ERROR_URLS","custom404","checkParent","_default","exports"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AASA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,gBAAA,GAAAD,sBAAA,CAAAN,OAAA;AACA,IAAAQ,mBAAA,GAAAF,sBAAA,CAAAN,OAAA;AACA,IAAAS,YAAA,GAAAH,sBAAA,CAAAN,OAAA;AACA,IAAAU,uBAAA,GAAAJ,sBAAA,CAAAN,OAAA;AAAiE,SAAAW,QAAAC,CAAA,EAAAC,CAAA,QAAAC,CAAA,GAAAC,MAAA,CAAAC,IAAA,CAAAJ,CAAA,OAAAG,MAAA,CAAAE,qBAAA,QAAAC,CAAA,GAAAH,MAAA,CAAAE,qBAAA,CAAAL,CAAA,GAAAC,CAAA,KAAAK,CAAA,GAAAA,CAAA,CAAAC,MAAA,WAAAN,CAAA,WAAAE,MAAA,CAAAK,wBAAA,CAAAR,CAAA,EAAAC,CAAA,EAAAQ,UAAA,OAAAP,CAAA,CAAAQ,IAAA,CAAAC,KAAA,CAAAT,CAAA,EAAAI,CAAA,YAAAJ,CAAA;AAAA,SAAAU,cAAAZ,CAAA,aAAAC,CAAA,MAAAA,CAAA,GAAAY,SAAA,CAAAC,MAAA,EAAAb,CAAA,UAAAC,CAAA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,MAClCqC,cAAc,IAAIgG,UAAU;YAAAE,SAAA,CAAArH,IAAA;YAAA;UAAA;UAAA,OAAAqH,SAAA,CAAAjH,MAAA,WACvBmG,UAAU,CAACvH,GAAG,EAAEmI,UAAU,CAAC;QAAA;UAAA,OAAAE,SAAA,CAAAjH,MAAA,WAG7BkF,WAAW,CAACC,GAAG,EAAEvG,GAAG,EAAEmC,cAAc,EAAEhC,QAAQ,CAAC;QAAA;QAAA;UAAA,OAAAkI,SAAA,CAAAhG,IAAA;MAAA;IAAA,GAAA4F,QAAA;EAAA,CACvD;EAAA,OAAAD,eAAA,CAAAvJ,KAAA,OAAAE,SAAA;AAAA;AAAA,IAAA8J,QAAA,GAAAC,OAAA,cAEcnJ,QAAQ","ignoreList":[]}
|
|
@@ -11,7 +11,7 @@ import checkPreviewUrl from './check-preview-url';
|
|
|
11
11
|
import handleStaticRoutes from './handle-static-routes';
|
|
12
12
|
import getPageData from './get-page-data';
|
|
13
13
|
import getRootSelectorClasses from './get-root-selector-classes';
|
|
14
|
-
const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
|
|
14
|
+
const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);
|
|
15
15
|
const checkUrl = async props => {
|
|
16
16
|
const {
|
|
17
17
|
asPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-url.js","names":["parseUrl","getUnpublishedEntityName","checkAccessToken","HTTPS","DOUBLE_SLASH","COLON","NOT_FOUND_STATUS_CODE","BLAZE_X_FRAME_OPTIONS_DEFAULT","ROUTE_REGEX","ERROR_URLS","checkUrlQuery","checkParent","checkPreviewUrl","handleStaticRoutes","getPageData","getRootSelectorClasses","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","getFullUrl","url","BLAZE_STATUS_URL","isStatusPage","handler","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","getHeader","BLAZE_CACHE_CONTROL_HEADER","previewData","_objectSpread","Object","keys","cache","extract","length","getPreviewData","urlCheckOptions","result","doUrlCheck","handle404Error","pageData","rootSelectorClasses","isPreview","getHost","headers","BLAZE_FRONTEND_HOST","host","location","protocol","hostname","port","window","urlPort","args","errorCheckCode","test","Error","data","itemId","itemEntity","urlTo","variables","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","err","handleUrlError","handleError","error","networkError","writeHead","write","end","graphQLErrors","errorCode","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","cacheControlMaxAge","Location","href","redirecting","custom404","parentUrl","parentPATH"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,gBAAgB,QAAQ,yBAAyB;AAC1D,SACEC,KAAK,EACLC,YAAY,EACZC,KAAK,EACLC,qBAAqB,EACrBC,6BAA6B,EAC7BC,WAAW,EACXC,UAAU,QACL,cAAc;AACrB,SAASC,aAAa,QAAQ,sBAAsB;AACpD,OAAOC,WAAW,MAAM,gBAAgB;AACxC,OAAOC,eAAe,MAAM,qBAAqB;AACjD,OAAOC,kBAAkB,MAAM,wBAAwB;AACvD,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,sBAAsB,MAAM,6BAA6B;AAEhE,MAAMC,mBAAmB,GAAGA,CAAA,KAAMC,MAAM,CAACC,OAAO,CAACC,GAAG,CAACC,iCAAiC,CAAC;AAEvF,MAAMC,QAAQ,GAAG,MAAMC,KAAK,IAAI;EAC9B,MAAM;IAAEC,MAAM;IAAEC,YAAY;IAAEC,GAAG;IAAEC,GAAG;IAAEC,KAAK;IAAEC,QAAQ;IAAEC;EAAW,CAAC,GAAGP,KAAK;EAC7E,MAAMQ,OAAO,GAAGC,UAAU,CAACL,GAAG,EAAEH,MAAM,CAAC;EACvC,MAAM;IAAES;EAAI,CAAC,GAAGhC,QAAQ,CAACuB,MAAM,CAAC;EAEhC,IAAIL,OAAO,CAACC,GAAG,CAACc,gBAAgB,IAAID,GAAG,KAAKd,OAAO,CAACC,GAAG,CAACc,gBAAgB,EAAE;IACxE,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AC6F,SAAS;MACzBnC,cAAc,EAAE7D;IAAqB,EACtC,CAAC;IAEF,IAAI8C,cAAc,EAAE;MAClB,MAAMmD,SAAS,GAAG5F,WAAW,CAACY,MAAM,CAAC;MACrC,IAAIgF,SAAS,EAAE;QACb,OAAON,UAAU,CAACxE,GAAG,EAAE8E,SAAS,CAAC;MACnC;IACF;IACA,OAAOrD,MAAM;EACf;EAEA,MAAMsD,UAAU,GAAG7F,WAAW,CAACY,MAAM,CAAC;EACtC,IAAI6B,cAAc,IAAIoD,UAAU,EAAE;IAChC,OAAOP,UAAU,CAACxE,GAAG,EAAE+E,UAAU,CAAC;EACpC;EAEA,OAAOrB,WAAW,CAACF,GAAG,EAAExD,GAAG,EAAE2B,cAAc,EAAExB,QAAQ,CAAC;AACxD;AAEA,eAAeP,QAAQ","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"check-url.js","names":["parseUrl","getUnpublishedEntityName","checkAccessToken","HTTPS","DOUBLE_SLASH","COLON","NOT_FOUND_STATUS_CODE","BLAZE_X_FRAME_OPTIONS_DEFAULT","ROUTE_REGEX","ERROR_URLS","checkUrlQuery","checkParent","checkPreviewUrl","handleStaticRoutes","getPageData","getRootSelectorClasses","getRootClassesLimit","Number","process","env","BLAZE_ROOT_SELECTOR_CLASSES_LIMIT","checkUrl","props","asPath","apolloClient","res","req","query","blazeApp","disableSsr","fullUrl","getFullUrl","url","BLAZE_STATUS_URL","isStatusPage","handler","getHandler","setHeader","BLAZE_X_FRAME_OPTIONS","getHeader","BLAZE_CACHE_CONTROL_HEADER","previewData","_objectSpread","Object","keys","cache","extract","length","getPreviewData","urlCheckOptions","result","doUrlCheck","handle404Error","pageData","rootSelectorClasses","isPreview","getHost","headers","BLAZE_FRONTEND_HOST","host","location","protocol","hostname","port","window","urlPort","args","errorCheckCode","test","Error","data","itemId","itemEntity","urlTo","variables","setCustomCacheControlHeaders","handleRedirect","events","emit","message","statusCode","err","handleUrlError","handleError","error","networkError","writeHead","write","end","graphQLErrors","errorCode","errorMessage","customError","redirectUrl","BLAZE_DISABLE_REDIRECT_WITH_QUERY","queryString","split","doRedirect","cacheControlMaxAge","Location","href","redirecting","custom404","parentUrl","parentPATH"],"sources":["../../src/helpers/check-url.js"],"sourcesContent":["import { parseUrl } from 'query-string';\nimport { getUnpublishedEntityName } from '@blaze-cms/react-page-builder';\nimport { checkAccessToken } from '@blaze-cms/core-auth-ui';\nimport {\n HTTPS,\n DOUBLE_SLASH,\n COLON,\n NOT_FOUND_STATUS_CODE,\n BLAZE_X_FRAME_OPTIONS_DEFAULT,\n ROUTE_REGEX,\n ERROR_URLS\n} from '../constants';\nimport { checkUrlQuery } from '../application/query';\nimport checkParent from './check-parent';\nimport checkPreviewUrl from './check-preview-url';\nimport handleStaticRoutes from './handle-static-routes';\nimport getPageData from './get-page-data';\nimport getRootSelectorClasses from './get-root-selector-classes';\n\nconst getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);\n\nconst checkUrl = async props => {\n const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;\n const fullUrl = getFullUrl(req, asPath);\n const { url } = parseUrl(asPath);\n\n if (process.env.BLAZE_STATUS_URL && url === process.env.BLAZE_STATUS_URL) {\n return { isStatusPage: true };\n }\n\n if (res) {\n const handler = handleStaticRoutes.getHandler(asPath);\n\n res.setHeader(\n 'X-Frame-Options',\n process.env.BLAZE_X_FRAME_OPTIONS || BLAZE_X_FRAME_OPTIONS_DEFAULT\n );\n\n if (!res.getHeader('Cache-Control')) {\n res.setHeader('Cache-Control', process.env.BLAZE_CACHE_CONTROL_HEADER || ' ');\n }\n\n if (handler) {\n return handler(props);\n }\n }\n\n const previewData = checkPreviewUrl(url, query);\n\n if (!previewData && disableSsr) return { disableSsr: true };\n\n await checkAccessToken(apolloClient, {\n ...props,\n disableSsr: !Object.keys(apolloClient.cache.extract()).length // empty cache means SSR was disabled\n });\n\n if (previewData) return getPreviewData(previewData, apolloClient);\n const urlCheckOptions = { asPath, url, apolloClient, res };\n const result = await doUrlCheck({\n ...urlCheckOptions,\n handle404Error: true,\n blazeApp\n });\n return { ...result, fullUrl } || {};\n};\n\nconst getPreviewData = async (previewData, apolloClient) => {\n const result = await getPageData({ ...previewData, apolloClient });\n const { pageData: { url } = {} } = result;\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n return { ...previewData, rootSelectorClasses, ...result, isPreview: true };\n};\n\nconst getHost = ({ headers = {} }) =>\n process.env.BLAZE_FRONTEND_HOST ||\n headers['x-request-host'] ||\n headers['x-forwarded-host'] ||\n headers.host;\n\nconst getFullUrl = (req, asPath) => {\n if (req) {\n return `${HTTPS}${getHost(req)}${asPath}`;\n }\n const {\n location: { protocol, hostname, port }\n } = window;\n const urlPort = port ? `${COLON}${port}` : '';\n\n return `${protocol}${DOUBLE_SLASH}${hostname}${urlPort}${asPath}`;\n};\n\nconst doUrlCheck = async args => {\n const { asPath, url, apolloClient, res, blazeApp, errorCheckCode = false } = args;\n try {\n if (!ROUTE_REGEX.test(url)) {\n throw Error('Invalid URL');\n }\n const { data: { checkUrl: { itemId, itemEntity, urlTo, pageData = {} } = {} } = {} } =\n await apolloClient.query({\n query: checkUrlQuery,\n variables: { url }\n });\n\n setCustomCacheControlHeaders(pageData, res);\n\n if (urlTo && (urlTo !== url || errorCheckCode)) {\n return handleRedirect({ errorCheckCode, url, urlTo, asPath, res });\n }\n const rootSelectorClasses = getRootSelectorClasses(url, getRootClassesLimit());\n\n if (errorCheckCode) {\n blazeApp.events.emit('monitor:log', { message: `Serving custom ${errorCheckCode} page` });\n if (res) res.statusCode = errorCheckCode;\n }\n\n return {\n pageData,\n rootSelectorClasses,\n itemId,\n itemEntity: getUnpublishedEntityName(itemEntity)\n };\n } catch (err) {\n return handleUrlError(err, args);\n }\n};\n\nconst handleError = (err, res, handle404Error, blazeApp) => {\n blazeApp.events.emit('monitor:log', { error: err });\n if (!res) return {};\n if (err.networkError) {\n res.writeHead(500, { 'Content-Type': 'text/plain' });\n res.write('500 Internal Server Error\\n');\n res.end();\n } else if (handle404Error && err.graphQLErrors && err.graphQLErrors.length) {\n res.statusCode = NOT_FOUND_STATUS_CODE;\n return { errorCode: NOT_FOUND_STATUS_CODE };\n }\n\n return {};\n};\n\nfunction handleRedirect({ errorCheckCode, url, urlTo, asPath, res }) {\n if (errorCheckCode) {\n const errorMessage = `Cannot redirect ${url}`;\n const customError = new Error(errorMessage);\n customError.graphQLErrors = [errorMessage];\n throw customError;\n }\n let redirectUrl = urlTo;\n if (process.env.BLAZE_DISABLE_REDIRECT_WITH_QUERY !== 'true') {\n const queryString = asPath.split('?')[1];\n redirectUrl = queryString ? `${urlTo}?${queryString}` : urlTo;\n }\n\n return doRedirect(res, redirectUrl);\n}\n\nfunction setCustomCacheControlHeaders(pageData, res) {\n const { cacheControlMaxAge = null } = pageData || {};\n\n if (res && cacheControlMaxAge !== null && cacheControlMaxAge >= 0) {\n res.setHeader('Cache-Control', `max-age=${cacheControlMaxAge}`);\n }\n}\n\nfunction doRedirect(res, redirectUrl) {\n if (res) {\n res.writeHead(301, { Location: redirectUrl });\n res.end();\n } else {\n window.location.href = redirectUrl;\n }\n\n return { redirecting: true };\n}\n\nasync function handleUrlError(err, args) {\n const { asPath, res, handle404Error, blazeApp, errorCheckCode } = args;\n if (!err.graphQLErrors || !err.graphQLErrors.length) {\n return handleError(err, res, handle404Error, blazeApp);\n }\n\n if (!errorCheckCode) {\n const result = await doUrlCheck({\n ...args,\n url: ERROR_URLS.custom404,\n errorCheckCode: NOT_FOUND_STATUS_CODE\n });\n\n if (handle404Error) {\n const parentUrl = checkParent(asPath);\n if (parentUrl) {\n return doRedirect(res, parentUrl);\n }\n }\n return result;\n }\n\n const parentPATH = checkParent(asPath);\n if (handle404Error && parentPATH) {\n return doRedirect(res, parentPATH);\n }\n\n return handleError(err, res, handle404Error, blazeApp);\n}\n\nexport default checkUrl;\n"],"mappings":";;;AAAA,SAASA,QAAQ,QAAQ,cAAc;AACvC,S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AAU,EAAE;IAChC,OAAOP,UAAU,CAACxE,GAAG,EAAE+E,UAAU,CAAC;EACpC;EAEA,OAAOrB,WAAW,CAACF,GAAG,EAAExD,GAAG,EAAE2B,cAAc,EAAExB,QAAQ,CAAC;AACxD;AAEA,eAAeP,QAAQ","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/nextjs-tools",
|
|
3
|
-
"version": "0.146.0-node18-tooltips.
|
|
3
|
+
"version": "0.146.0-node18-core-styles-tooltips.52",
|
|
4
4
|
"description": "Blaze nextjs tools",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -28,23 +28,23 @@
|
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@apollo/client": "3.13.8",
|
|
31
|
-
"@blaze-cms/core-auth-ui": "0.146.0-node18-tooltips.
|
|
32
|
-
"@blaze-cms/core-errors": "0.146.0-node18-tooltips.
|
|
33
|
-
"@blaze-cms/core-errors-ui": "0.146.0-node18-tooltips.
|
|
34
|
-
"@blaze-cms/core-ui": "0.146.0-node18-tooltips.
|
|
35
|
-
"@blaze-cms/nextjs-components": "0.146.0-node18-tooltips.
|
|
36
|
-
"@blaze-cms/plugin-auth-fe": "0.146.0-node18-tooltips.
|
|
37
|
-
"@blaze-cms/plugin-auth-local-fe": "0.146.0-node18-tooltips.
|
|
38
|
-
"@blaze-cms/plugin-chart": "0.146.0-node18-tooltips.
|
|
39
|
-
"@blaze-cms/plugin-google-maps-fe": "0.146.0-node18-tooltips.
|
|
40
|
-
"@blaze-cms/plugin-gtm-fe": "0.146.0-node18-tooltips.
|
|
41
|
-
"@blaze-cms/plugin-page-builder-fe": "0.146.0-node18-tooltips.
|
|
42
|
-
"@blaze-cms/plugin-preview-fe": "0.146.0-node18-tooltips.
|
|
43
|
-
"@blaze-cms/plugin-search-ui": "0.146.0-node18-tooltips.
|
|
44
|
-
"@blaze-cms/plugin-structured-data-fe": "0.146.0-node18-tooltips.
|
|
45
|
-
"@blaze-cms/plugin-translation-fe": "0.146.0-node18-tooltips.
|
|
46
|
-
"@blaze-cms/react-page-builder": "0.146.0-node18-tooltips.
|
|
47
|
-
"@blaze-cms/setup-ui": "0.146.0-node18-tooltips.
|
|
31
|
+
"@blaze-cms/core-auth-ui": "0.146.0-node18-core-styles-tooltips.46",
|
|
32
|
+
"@blaze-cms/core-errors": "0.146.0-node18-core-styles-tooltips.46",
|
|
33
|
+
"@blaze-cms/core-errors-ui": "0.146.0-node18-core-styles-tooltips.46",
|
|
34
|
+
"@blaze-cms/core-ui": "0.146.0-node18-core-styles-tooltips.46",
|
|
35
|
+
"@blaze-cms/nextjs-components": "0.146.0-node18-core-styles-tooltips.46",
|
|
36
|
+
"@blaze-cms/plugin-auth-fe": "0.146.0-node18-core-styles-tooltips.46",
|
|
37
|
+
"@blaze-cms/plugin-auth-local-fe": "0.146.0-node18-core-styles-tooltips.46",
|
|
38
|
+
"@blaze-cms/plugin-chart": "0.146.0-node18-core-styles-tooltips.46",
|
|
39
|
+
"@blaze-cms/plugin-google-maps-fe": "0.146.0-node18-core-styles-tooltips.52",
|
|
40
|
+
"@blaze-cms/plugin-gtm-fe": "0.146.0-node18-core-styles-tooltips.52",
|
|
41
|
+
"@blaze-cms/plugin-page-builder-fe": "0.146.0-node18-core-styles-tooltips.52",
|
|
42
|
+
"@blaze-cms/plugin-preview-fe": "0.146.0-node18-core-styles-tooltips.46",
|
|
43
|
+
"@blaze-cms/plugin-search-ui": "0.146.0-node18-core-styles-tooltips.46",
|
|
44
|
+
"@blaze-cms/plugin-structured-data-fe": "0.146.0-node18-core-styles-tooltips.46",
|
|
45
|
+
"@blaze-cms/plugin-translation-fe": "0.146.0-node18-core-styles-tooltips.46",
|
|
46
|
+
"@blaze-cms/react-page-builder": "0.146.0-node18-core-styles-tooltips.52",
|
|
47
|
+
"@blaze-cms/setup-ui": "0.146.0-node18-core-styles-tooltips.46",
|
|
48
48
|
"@blaze-react/switches": "0.8.0-alpha.112",
|
|
49
49
|
"autoprefixer": "^10.2.3",
|
|
50
50
|
"core-js": "^3.2.1",
|
|
@@ -72,5 +72,5 @@
|
|
|
72
72
|
"lib/*",
|
|
73
73
|
"lib-es/*"
|
|
74
74
|
],
|
|
75
|
-
"gitHead": "
|
|
75
|
+
"gitHead": "a023f9c35df5a4c7eceba4d6f21c669bb04b8f6b"
|
|
76
76
|
}
|
package/src/helpers/check-url.js
CHANGED
|
@@ -17,7 +17,7 @@ import handleStaticRoutes from './handle-static-routes';
|
|
|
17
17
|
import getPageData from './get-page-data';
|
|
18
18
|
import getRootSelectorClasses from './get-root-selector-classes';
|
|
19
19
|
|
|
20
|
-
const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT);
|
|
20
|
+
const getRootClassesLimit = () => Number(process.env.BLAZE_ROOT_SELECTOR_CLASSES_LIMIT || 1);
|
|
21
21
|
|
|
22
22
|
const checkUrl = async props => {
|
|
23
23
|
const { asPath, apolloClient, res, req, query, blazeApp, disableSsr } = props;
|
|
@@ -4,6 +4,7 @@ exports[`Application query should get check url query 1`] = `
|
|
|
4
4
|
Object {
|
|
5
5
|
"definitions": Array [
|
|
6
6
|
Object {
|
|
7
|
+
"description": undefined,
|
|
7
8
|
"directives": Array [],
|
|
8
9
|
"kind": "OperationDefinition",
|
|
9
10
|
"name": Object {
|
|
@@ -385,6 +386,7 @@ Object {
|
|
|
385
386
|
"variableDefinitions": Array [
|
|
386
387
|
Object {
|
|
387
388
|
"defaultValue": undefined,
|
|
389
|
+
"description": undefined,
|
|
388
390
|
"directives": Array [],
|
|
389
391
|
"kind": "VariableDefinition",
|
|
390
392
|
"type": Object {
|
|
@@ -420,6 +422,7 @@ exports[`Application query should get page query 1`] = `
|
|
|
420
422
|
Object {
|
|
421
423
|
"definitions": Array [
|
|
422
424
|
Object {
|
|
425
|
+
"description": undefined,
|
|
423
426
|
"directives": Array [],
|
|
424
427
|
"kind": "OperationDefinition",
|
|
425
428
|
"name": Object {
|
|
@@ -748,6 +751,7 @@ Object {
|
|
|
748
751
|
"variableDefinitions": Array [
|
|
749
752
|
Object {
|
|
750
753
|
"defaultValue": undefined,
|
|
754
|
+
"description": undefined,
|
|
751
755
|
"directives": Array [],
|
|
752
756
|
"kind": "VariableDefinition",
|
|
753
757
|
"type": Object {
|
|
@@ -783,6 +787,7 @@ exports[`Application query should match get entity schema 1`] = `
|
|
|
783
787
|
Object {
|
|
784
788
|
"definitions": Array [
|
|
785
789
|
Object {
|
|
790
|
+
"description": undefined,
|
|
786
791
|
"directives": Array [],
|
|
787
792
|
"kind": "OperationDefinition",
|
|
788
793
|
"name": Object {
|
|
@@ -864,6 +869,7 @@ Object {
|
|
|
864
869
|
"variableDefinitions": Array [
|
|
865
870
|
Object {
|
|
866
871
|
"defaultValue": undefined,
|
|
872
|
+
"description": undefined,
|
|
867
873
|
"directives": Array [],
|
|
868
874
|
"kind": "VariableDefinition",
|
|
869
875
|
"type": Object {
|
package/tests/unit/src/helpers/static-route-handlers/__snapshots__/generic-file-handler.test.js.snap
CHANGED
|
@@ -5,6 +5,7 @@ Object {
|
|
|
5
5
|
"fileQuery": Object {
|
|
6
6
|
"definitions": Array [
|
|
7
7
|
Object {
|
|
8
|
+
"description": undefined,
|
|
8
9
|
"directives": Array [],
|
|
9
10
|
"kind": "OperationDefinition",
|
|
10
11
|
"name": Object {
|
|
@@ -86,6 +87,7 @@ Object {
|
|
|
86
87
|
"variableDefinitions": Array [
|
|
87
88
|
Object {
|
|
88
89
|
"defaultValue": undefined,
|
|
90
|
+
"description": undefined,
|
|
89
91
|
"directives": Array [],
|
|
90
92
|
"kind": "VariableDefinition",
|
|
91
93
|
"type": Object {
|
package/tests/unit/src/helpers/static-route-handlers/__snapshots__/sitemap-file.test.js.snap
CHANGED
|
@@ -5,6 +5,7 @@ Object {
|
|
|
5
5
|
"fileQuery": Object {
|
|
6
6
|
"definitions": Array [
|
|
7
7
|
Object {
|
|
8
|
+
"description": undefined,
|
|
8
9
|
"directives": Array [],
|
|
9
10
|
"kind": "OperationDefinition",
|
|
10
11
|
"name": Object {
|
|
@@ -127,6 +128,7 @@ Object {
|
|
|
127
128
|
"variableDefinitions": Array [
|
|
128
129
|
Object {
|
|
129
130
|
"defaultValue": undefined,
|
|
131
|
+
"description": undefined,
|
|
130
132
|
"directives": Array [],
|
|
131
133
|
"kind": "VariableDefinition",
|
|
132
134
|
"type": Object {
|