@websolutespa/bom-core 2.0.1-next.2 → 3.0.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.
- package/CHANGELOG.md +369 -375
- package/dist/index.d.ts +248 -46
- package/dist/index.js +62 -38
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,375 +1,369 @@
|
|
|
1
|
-
# @websolutespa/bom-core
|
|
2
|
-
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
###
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
|
|
15
|
-
## 1.
|
|
16
|
-
|
|
17
|
-
### Patch Changes
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
|
|
21
|
-
## 1.
|
|
22
|
-
|
|
23
|
-
###
|
|
24
|
-
|
|
25
|
-
-
|
|
26
|
-
|
|
27
|
-
## 1.8.
|
|
28
|
-
|
|
29
|
-
### Patch Changes
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
## 1.8.
|
|
34
|
-
|
|
35
|
-
### Patch Changes
|
|
36
|
-
|
|
37
|
-
- Modified:
|
|
38
|
-
|
|
39
|
-
## 1.8.
|
|
40
|
-
|
|
41
|
-
### Patch Changes
|
|
42
|
-
|
|
43
|
-
- Modified:
|
|
44
|
-
|
|
45
|
-
## 1.8.
|
|
46
|
-
|
|
47
|
-
### Patch Changes
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
## 1.8.
|
|
52
|
-
|
|
53
|
-
### Patch Changes
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
## 1.8.
|
|
58
|
-
|
|
59
|
-
### Patch Changes
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
## 1.8.
|
|
64
|
-
|
|
65
|
-
### Patch Changes
|
|
66
|
-
|
|
67
|
-
- Modified:
|
|
68
|
-
|
|
69
|
-
## 1.8.
|
|
70
|
-
|
|
71
|
-
### Patch Changes
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
## 1.8.
|
|
76
|
-
|
|
77
|
-
### Patch Changes
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
|
|
81
|
-
## 1.8.
|
|
82
|
-
|
|
83
|
-
### Patch Changes
|
|
84
|
-
|
|
85
|
-
- Modified: IQuerable
|
|
86
|
-
|
|
87
|
-
## 1.8.
|
|
88
|
-
|
|
89
|
-
### Patch Changes
|
|
90
|
-
|
|
91
|
-
-
|
|
92
|
-
|
|
93
|
-
## 1.8.
|
|
94
|
-
|
|
95
|
-
### Patch Changes
|
|
96
|
-
|
|
97
|
-
-
|
|
98
|
-
|
|
99
|
-
## 1.8.
|
|
100
|
-
|
|
101
|
-
### Patch Changes
|
|
102
|
-
|
|
103
|
-
-
|
|
104
|
-
|
|
105
|
-
## 1.8.
|
|
106
|
-
|
|
107
|
-
### Patch Changes
|
|
108
|
-
|
|
109
|
-
-
|
|
110
|
-
|
|
111
|
-
## 1.8.
|
|
112
|
-
|
|
113
|
-
### Patch Changes
|
|
114
|
-
|
|
115
|
-
-
|
|
116
|
-
|
|
117
|
-
## 1.8.
|
|
118
|
-
|
|
119
|
-
### Patch Changes
|
|
120
|
-
|
|
121
|
-
- Modified:
|
|
122
|
-
|
|
123
|
-
## 1.8.
|
|
124
|
-
|
|
125
|
-
### Patch Changes
|
|
126
|
-
|
|
127
|
-
-
|
|
128
|
-
|
|
129
|
-
## 1.8.
|
|
130
|
-
|
|
131
|
-
### Patch Changes
|
|
132
|
-
|
|
133
|
-
- Added:
|
|
134
|
-
|
|
135
|
-
## 1.8.
|
|
136
|
-
|
|
137
|
-
### Patch Changes
|
|
138
|
-
|
|
139
|
-
-
|
|
140
|
-
|
|
141
|
-
## 1.8.
|
|
142
|
-
|
|
143
|
-
### Patch Changes
|
|
144
|
-
|
|
145
|
-
- Modified:
|
|
146
|
-
|
|
147
|
-
## 1.8.
|
|
148
|
-
|
|
149
|
-
### Patch Changes
|
|
150
|
-
|
|
151
|
-
- Modified:
|
|
152
|
-
|
|
153
|
-
## 1.8.
|
|
154
|
-
|
|
155
|
-
###
|
|
156
|
-
|
|
157
|
-
- Modified:
|
|
158
|
-
|
|
159
|
-
## 1.
|
|
160
|
-
|
|
161
|
-
###
|
|
162
|
-
|
|
163
|
-
-
|
|
164
|
-
|
|
165
|
-
## 1.7.
|
|
166
|
-
|
|
167
|
-
### Patch Changes
|
|
168
|
-
|
|
169
|
-
-
|
|
170
|
-
|
|
171
|
-
## 1.7.
|
|
172
|
-
|
|
173
|
-
### Patch Changes
|
|
174
|
-
|
|
175
|
-
- Fixing: ILocalized type
|
|
176
|
-
|
|
177
|
-
## 1.7.
|
|
178
|
-
|
|
179
|
-
### Patch Changes
|
|
180
|
-
|
|
181
|
-
-
|
|
182
|
-
|
|
183
|
-
## 1.7.
|
|
184
|
-
|
|
185
|
-
### Patch Changes
|
|
186
|
-
|
|
187
|
-
- Modified:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
|
|
196
|
-
## 1.7.
|
|
197
|
-
|
|
198
|
-
### Patch Changes
|
|
199
|
-
|
|
200
|
-
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
|
|
209
|
-
## 1.7.
|
|
210
|
-
|
|
211
|
-
### Patch Changes
|
|
212
|
-
|
|
213
|
-
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
- Added:
|
|
221
|
-
|
|
222
|
-
## 1.7.
|
|
223
|
-
|
|
224
|
-
### Patch Changes
|
|
225
|
-
|
|
226
|
-
-
|
|
227
|
-
|
|
228
|
-
## 1.7.
|
|
229
|
-
|
|
230
|
-
### Patch Changes
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
|
|
234
|
-
## 1.7.
|
|
235
|
-
|
|
236
|
-
### Patch Changes
|
|
237
|
-
|
|
238
|
-
-
|
|
239
|
-
|
|
240
|
-
## 1.7.
|
|
241
|
-
|
|
242
|
-
### Patch Changes
|
|
243
|
-
|
|
244
|
-
-
|
|
245
|
-
|
|
246
|
-
## 1.7.
|
|
247
|
-
|
|
248
|
-
### Patch Changes
|
|
249
|
-
|
|
250
|
-
-
|
|
251
|
-
|
|
252
|
-
## 1.7.
|
|
253
|
-
|
|
254
|
-
###
|
|
255
|
-
|
|
256
|
-
-
|
|
257
|
-
|
|
258
|
-
## 1.
|
|
259
|
-
|
|
260
|
-
###
|
|
261
|
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
##
|
|
265
|
-
|
|
266
|
-
### Patch Changes
|
|
267
|
-
|
|
268
|
-
-
|
|
269
|
-
|
|
270
|
-
## 0.6.
|
|
271
|
-
|
|
272
|
-
### Patch Changes
|
|
273
|
-
|
|
274
|
-
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
-
|
|
289
|
-
|
|
290
|
-
## 0.6.
|
|
291
|
-
|
|
292
|
-
### Patch Changes
|
|
293
|
-
|
|
294
|
-
-
|
|
295
|
-
|
|
296
|
-
## 0.6.
|
|
297
|
-
|
|
298
|
-
### Patch Changes
|
|
299
|
-
|
|
300
|
-
-
|
|
301
|
-
|
|
302
|
-
## 0.6.
|
|
303
|
-
|
|
304
|
-
###
|
|
305
|
-
|
|
306
|
-
- Added
|
|
307
|
-
|
|
308
|
-
## 0.
|
|
309
|
-
|
|
310
|
-
### Minor Changes
|
|
311
|
-
|
|
312
|
-
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
- Added:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
-
|
|
327
|
-
|
|
328
|
-
## 0.
|
|
329
|
-
|
|
330
|
-
### Minor Changes
|
|
331
|
-
|
|
332
|
-
-
|
|
333
|
-
|
|
334
|
-
## 0.
|
|
335
|
-
|
|
336
|
-
###
|
|
337
|
-
|
|
338
|
-
-
|
|
339
|
-
|
|
340
|
-
## 0.2.
|
|
341
|
-
|
|
342
|
-
###
|
|
343
|
-
|
|
344
|
-
-
|
|
345
|
-
|
|
346
|
-
## 0.2
|
|
347
|
-
|
|
348
|
-
###
|
|
349
|
-
|
|
350
|
-
- Modified
|
|
351
|
-
|
|
352
|
-
## 0.1.
|
|
353
|
-
|
|
354
|
-
### Patch Changes
|
|
355
|
-
|
|
356
|
-
- Modified:
|
|
357
|
-
|
|
358
|
-
## 0.1.
|
|
359
|
-
|
|
360
|
-
###
|
|
361
|
-
|
|
362
|
-
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
- Added:
|
|
370
|
-
|
|
371
|
-
## 0.0.1
|
|
372
|
-
|
|
373
|
-
### Patch Changes
|
|
374
|
-
|
|
375
|
-
- Added: first release
|
|
1
|
+
# @websolutespa/bom-core
|
|
2
|
+
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Release: Bom 3.0
|
|
8
|
+
|
|
9
|
+
## 1.8.24
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Added: IApp global
|
|
14
|
+
|
|
15
|
+
## 1.8.23
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 0c7f05f: Modified: IRoute isRoot noindex, routeService
|
|
20
|
+
|
|
21
|
+
## 1.8.22
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Fixing: JsonService whereItem\_ unresolved relations
|
|
26
|
+
|
|
27
|
+
## 1.8.21
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- Modified: IMeta
|
|
32
|
+
|
|
33
|
+
## 1.8.20
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- Modified: isMedia, category, route
|
|
38
|
+
|
|
39
|
+
## 1.8.19
|
|
40
|
+
|
|
41
|
+
### Patch Changes
|
|
42
|
+
|
|
43
|
+
- f0d17f3: Modified: page market filtering
|
|
44
|
+
|
|
45
|
+
## 1.8.18
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Modified: type IComponent
|
|
50
|
+
|
|
51
|
+
## 1.8.17
|
|
52
|
+
|
|
53
|
+
### Patch Changes
|
|
54
|
+
|
|
55
|
+
- Added: isMedia, eachMedia, eachValue, isComponent, hasComponents, components utils
|
|
56
|
+
|
|
57
|
+
## 1.8.16
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Modified: collectFeatureTypes
|
|
62
|
+
|
|
63
|
+
## 1.8.15
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Modified: passwordStrategy
|
|
68
|
+
|
|
69
|
+
## 1.8.14
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- Added: passwordStrategy
|
|
74
|
+
|
|
75
|
+
## 1.8.13
|
|
76
|
+
|
|
77
|
+
### Patch Changes
|
|
78
|
+
|
|
79
|
+
- Modified: IQuerable
|
|
80
|
+
|
|
81
|
+
## 1.8.12
|
|
82
|
+
|
|
83
|
+
### Patch Changes
|
|
84
|
+
|
|
85
|
+
- Modified: IQuerable
|
|
86
|
+
|
|
87
|
+
## 1.8.11
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- Added: isUnresolvedCategory, isUndecoratedCategory
|
|
92
|
+
|
|
93
|
+
## 1.8.10
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Modified: ILayout, IMenu
|
|
98
|
+
|
|
99
|
+
## 1.8.9
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Added: isMenu assertions
|
|
104
|
+
|
|
105
|
+
## 1.8.8
|
|
106
|
+
|
|
107
|
+
### Patch Changes
|
|
108
|
+
|
|
109
|
+
- f343ad7: Modified: RouteService collectRoutes
|
|
110
|
+
|
|
111
|
+
## 1.8.7
|
|
112
|
+
|
|
113
|
+
### Patch Changes
|
|
114
|
+
|
|
115
|
+
- Modified: routeService getPickedProps
|
|
116
|
+
|
|
117
|
+
## 1.8.6
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- Modified: collectRoutes
|
|
122
|
+
|
|
123
|
+
## 1.8.5
|
|
124
|
+
|
|
125
|
+
### Patch Changes
|
|
126
|
+
|
|
127
|
+
- Added: base64 encoder/decoder
|
|
128
|
+
|
|
129
|
+
## 1.8.4
|
|
130
|
+
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Added: ImageStrategy.Token
|
|
134
|
+
|
|
135
|
+
## 1.8.3
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- Modified: IAnchor
|
|
140
|
+
|
|
141
|
+
## 1.8.2
|
|
142
|
+
|
|
143
|
+
### Patch Changes
|
|
144
|
+
|
|
145
|
+
- Modified: IMedia
|
|
146
|
+
|
|
147
|
+
## 1.8.1
|
|
148
|
+
|
|
149
|
+
### Patch Changes
|
|
150
|
+
|
|
151
|
+
- Modified: Market & Language
|
|
152
|
+
|
|
153
|
+
## 1.8.0
|
|
154
|
+
|
|
155
|
+
### Minor Changes
|
|
156
|
+
|
|
157
|
+
- f8a1d97: Modified: extracted all website sample components & features
|
|
158
|
+
|
|
159
|
+
## 1.7.16
|
|
160
|
+
|
|
161
|
+
### Patch Changes
|
|
162
|
+
|
|
163
|
+
- Added: MenuCategory strategy
|
|
164
|
+
|
|
165
|
+
## 1.7.15
|
|
166
|
+
|
|
167
|
+
### Patch Changes
|
|
168
|
+
|
|
169
|
+
- Fixing: ILocalized type modified IOverride
|
|
170
|
+
|
|
171
|
+
## 1.7.13
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- Fixing: ILocalized type adding AtLeastOne
|
|
176
|
+
|
|
177
|
+
## 1.7.12
|
|
178
|
+
|
|
179
|
+
### Patch Changes
|
|
180
|
+
|
|
181
|
+
- Modified: RouteService, MenuService to handle isHidden Category segments
|
|
182
|
+
|
|
183
|
+
## 1.7.11
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Modified: JsonService where clauses, limit, sort
|
|
188
|
+
- Added: JsonService tests
|
|
189
|
+
|
|
190
|
+
## 1.7.10
|
|
191
|
+
|
|
192
|
+
### Patch Changes
|
|
193
|
+
|
|
194
|
+
- Fixing: getProto
|
|
195
|
+
|
|
196
|
+
## 1.7.9
|
|
197
|
+
|
|
198
|
+
### Patch Changes
|
|
199
|
+
|
|
200
|
+
- Added: asSortedOptions
|
|
201
|
+
- Modified: type guards
|
|
202
|
+
|
|
203
|
+
## 1.7.8
|
|
204
|
+
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- Fixing: downgrading eslint to v8.56.0
|
|
208
|
+
|
|
209
|
+
## 1.7.7
|
|
210
|
+
|
|
211
|
+
### Patch Changes
|
|
212
|
+
|
|
213
|
+
- Modified: Media resolveMediaType
|
|
214
|
+
- Added: isMediaImage, isMediaVideo, isMediaJson, isMediaPdf
|
|
215
|
+
|
|
216
|
+
## 1.7.6
|
|
217
|
+
|
|
218
|
+
### Patch Changes
|
|
219
|
+
|
|
220
|
+
- Added: getProto
|
|
221
|
+
|
|
222
|
+
## 1.7.5
|
|
223
|
+
|
|
224
|
+
### Patch Changes
|
|
225
|
+
|
|
226
|
+
- Modified: Logger
|
|
227
|
+
|
|
228
|
+
## 1.7.4
|
|
229
|
+
|
|
230
|
+
### Patch Changes
|
|
231
|
+
|
|
232
|
+
- Added: getOrigin, getHost
|
|
233
|
+
|
|
234
|
+
## 1.7.3
|
|
235
|
+
|
|
236
|
+
### Patch Changes
|
|
237
|
+
|
|
238
|
+
- Updating: dependencies
|
|
239
|
+
|
|
240
|
+
## 1.7.2
|
|
241
|
+
|
|
242
|
+
### Patch Changes
|
|
243
|
+
|
|
244
|
+
- Fixing: JsonService containsClause
|
|
245
|
+
|
|
246
|
+
## 1.7.1
|
|
247
|
+
|
|
248
|
+
### Patch Changes
|
|
249
|
+
|
|
250
|
+
- Added: JsonService containsClause
|
|
251
|
+
|
|
252
|
+
## 1.7.0
|
|
253
|
+
|
|
254
|
+
### Minor Changes
|
|
255
|
+
|
|
256
|
+
- 28e86bd: Modified: IPage, Store services & decorators
|
|
257
|
+
|
|
258
|
+
## 1.6.0
|
|
259
|
+
|
|
260
|
+
### Patch Changes
|
|
261
|
+
|
|
262
|
+
- 6cbf4cb: Added: IAction, IEndUser, IConsentPreference, IPreference, ILegalNotice
|
|
263
|
+
|
|
264
|
+
## 0.6.6
|
|
265
|
+
|
|
266
|
+
### Patch Changes
|
|
267
|
+
|
|
268
|
+
- Modified: collectRoutes
|
|
269
|
+
|
|
270
|
+
## 0.6.5
|
|
271
|
+
|
|
272
|
+
### Patch Changes
|
|
273
|
+
|
|
274
|
+
- Added: collectFeatureTypes, collectOptions
|
|
275
|
+
- Modified: Category, collectRoutes, getRouteHref, entity
|
|
276
|
+
|
|
277
|
+
## 0.6.4
|
|
278
|
+
|
|
279
|
+
### Patch Changes
|
|
280
|
+
|
|
281
|
+
- Added: typeGuards, IPagedResult
|
|
282
|
+
- Modified: IUndecoratedMenuCustom
|
|
283
|
+
|
|
284
|
+
## 0.6.3
|
|
285
|
+
|
|
286
|
+
### Patch Changes
|
|
287
|
+
|
|
288
|
+
- Added: isReservedCollectionDescription
|
|
289
|
+
|
|
290
|
+
## 0.6.2
|
|
291
|
+
|
|
292
|
+
### Patch Changes
|
|
293
|
+
|
|
294
|
+
- Modified: IMedia
|
|
295
|
+
|
|
296
|
+
## 0.6.1
|
|
297
|
+
|
|
298
|
+
### Patch Changes
|
|
299
|
+
|
|
300
|
+
- Added: defaultMarket, defaultLocale
|
|
301
|
+
|
|
302
|
+
## 0.6.0
|
|
303
|
+
|
|
304
|
+
### Minor Changes
|
|
305
|
+
|
|
306
|
+
- Added Logger, IPaginationResult
|
|
307
|
+
|
|
308
|
+
## 0.5.0
|
|
309
|
+
|
|
310
|
+
### Minor Changes
|
|
311
|
+
|
|
312
|
+
- Modified: JsonService, qs
|
|
313
|
+
- Added: asEquatable, cloneItem, typeGuards
|
|
314
|
+
|
|
315
|
+
## 0.4.1
|
|
316
|
+
|
|
317
|
+
### Patch Changes
|
|
318
|
+
|
|
319
|
+
- Added: IAnchor, babelCase
|
|
320
|
+
- Modified: IApplication, IPageRelation
|
|
321
|
+
|
|
322
|
+
## 0.4.0
|
|
323
|
+
|
|
324
|
+
### Minor Changes
|
|
325
|
+
|
|
326
|
+
- Updating: next 13
|
|
327
|
+
|
|
328
|
+
## 0.3.0
|
|
329
|
+
|
|
330
|
+
### Minor Changes
|
|
331
|
+
|
|
332
|
+
- Modified: HttpService
|
|
333
|
+
|
|
334
|
+
## 0.2.1
|
|
335
|
+
|
|
336
|
+
### Patch Changes
|
|
337
|
+
|
|
338
|
+
- Added: env ROOT_CATEGORY
|
|
339
|
+
|
|
340
|
+
## 0.2.0
|
|
341
|
+
|
|
342
|
+
### Minor Changes
|
|
343
|
+
|
|
344
|
+
- Modified routes, added redirects
|
|
345
|
+
|
|
346
|
+
## 0.1.2
|
|
347
|
+
|
|
348
|
+
### Patch Changes
|
|
349
|
+
|
|
350
|
+
- Modified: MockMenuService
|
|
351
|
+
|
|
352
|
+
## 0.1.1
|
|
353
|
+
|
|
354
|
+
### Patch Changes
|
|
355
|
+
|
|
356
|
+
- Modified: ILocalizable
|
|
357
|
+
|
|
358
|
+
## 0.1.0
|
|
359
|
+
|
|
360
|
+
### Minor Changes
|
|
361
|
+
|
|
362
|
+
- Added: splat routes
|
|
363
|
+
- Added: variants
|
|
364
|
+
|
|
365
|
+
## 0.0.1
|
|
366
|
+
|
|
367
|
+
### Patch Changes
|
|
368
|
+
|
|
369
|
+
- Added: first release
|
package/dist/index.d.ts
CHANGED
|
@@ -144,45 +144,6 @@ type IAnchor = {
|
|
|
144
144
|
title: string;
|
|
145
145
|
};
|
|
146
146
|
|
|
147
|
-
type IEquatable = number | string;
|
|
148
|
-
type SchemaType = string;
|
|
149
|
-
type ISchema = {
|
|
150
|
-
id: IEquatable;
|
|
151
|
-
schema?: string;
|
|
152
|
-
};
|
|
153
|
-
type IEntity = ISchema & Record<string, unknown>;
|
|
154
|
-
type INamedEntity = IEntity & {
|
|
155
|
-
name: ILocalizable;
|
|
156
|
-
};
|
|
157
|
-
type ITitledEntity = IEntity & {
|
|
158
|
-
title: ILocalizable;
|
|
159
|
-
};
|
|
160
|
-
type IOption = Record<string, any> & {
|
|
161
|
-
id: IEquatable;
|
|
162
|
-
name: string;
|
|
163
|
-
};
|
|
164
|
-
type IFeature = Record<string, any> & {
|
|
165
|
-
id: IEquatable;
|
|
166
|
-
title: string;
|
|
167
|
-
};
|
|
168
|
-
type IFeatureType = IEntity & {
|
|
169
|
-
id: string;
|
|
170
|
-
title: string;
|
|
171
|
-
mode: string;
|
|
172
|
-
features: IFeature[];
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
176
|
-
|
|
177
|
-
type IComponent = {
|
|
178
|
-
id?: IEquatable;
|
|
179
|
-
blockType?: string;
|
|
180
|
-
schema?: string;
|
|
181
|
-
anchor?: IAnchor;
|
|
182
|
-
seoWeight?: Headings;
|
|
183
|
-
[key: string]: unknown;
|
|
184
|
-
};
|
|
185
|
-
|
|
186
147
|
type IMediaType = 'image' | 'video' | 'json' | 'pdf' | string;
|
|
187
148
|
type IMediaInfo = {
|
|
188
149
|
id: string;
|
|
@@ -239,6 +200,68 @@ declare function isMediaPdf(media: {
|
|
|
239
200
|
}): media is IMediaPdf;
|
|
240
201
|
declare function isMedia(item: unknown): item is IMedia;
|
|
241
202
|
|
|
203
|
+
type IAppExtended = Record<string, any>;
|
|
204
|
+
type IApp<T extends IAppExtended = IAppExtended> = {
|
|
205
|
+
id: 'app';
|
|
206
|
+
brand: {
|
|
207
|
+
name: string;
|
|
208
|
+
businessName?: string;
|
|
209
|
+
appName?: string;
|
|
210
|
+
logo?: IMedia;
|
|
211
|
+
email?: string;
|
|
212
|
+
telephone?: string;
|
|
213
|
+
address?: string;
|
|
214
|
+
city?: string;
|
|
215
|
+
provinceCode?: string;
|
|
216
|
+
zipCode?: string;
|
|
217
|
+
countryCode?: string;
|
|
218
|
+
twitterName?: string;
|
|
219
|
+
social: {
|
|
220
|
+
key: string;
|
|
221
|
+
url: string;
|
|
222
|
+
}[];
|
|
223
|
+
};
|
|
224
|
+
} & T;
|
|
225
|
+
|
|
226
|
+
type IEquatable = number | string;
|
|
227
|
+
type SchemaType = string;
|
|
228
|
+
type ISchema = {
|
|
229
|
+
id: IEquatable;
|
|
230
|
+
schema?: string;
|
|
231
|
+
};
|
|
232
|
+
type IEntity = ISchema & Record<string, unknown>;
|
|
233
|
+
type INamedEntity = IEntity & {
|
|
234
|
+
name: ILocalizable;
|
|
235
|
+
};
|
|
236
|
+
type ITitledEntity = IEntity & {
|
|
237
|
+
title: ILocalizable;
|
|
238
|
+
};
|
|
239
|
+
type IOption = Record<string, any> & {
|
|
240
|
+
id: IEquatable;
|
|
241
|
+
name: string;
|
|
242
|
+
};
|
|
243
|
+
type IFeature = Record<string, any> & {
|
|
244
|
+
id: IEquatable;
|
|
245
|
+
title: string;
|
|
246
|
+
};
|
|
247
|
+
type IFeatureType = IEntity & {
|
|
248
|
+
id: string;
|
|
249
|
+
title: string;
|
|
250
|
+
mode: string;
|
|
251
|
+
features: IFeature[];
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
type Headings = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
255
|
+
|
|
256
|
+
type IComponent = {
|
|
257
|
+
id?: IEquatable;
|
|
258
|
+
blockType?: string;
|
|
259
|
+
schema?: string;
|
|
260
|
+
anchor?: IAnchor;
|
|
261
|
+
seoWeight?: Headings;
|
|
262
|
+
[key: string]: unknown;
|
|
263
|
+
};
|
|
264
|
+
|
|
242
265
|
type IMeta = {
|
|
243
266
|
title?: string;
|
|
244
267
|
description?: string;
|
|
@@ -359,14 +382,16 @@ type IMarket = IEntity & {
|
|
|
359
382
|
|
|
360
383
|
type IRoute = {
|
|
361
384
|
category: IEquatable;
|
|
362
|
-
resolvedCategory: IEquatable;
|
|
363
385
|
id: string;
|
|
364
386
|
isDefault?: boolean;
|
|
387
|
+
isRoot?: boolean;
|
|
365
388
|
locale: string;
|
|
366
389
|
market: string;
|
|
367
390
|
media?: IMedia;
|
|
391
|
+
noindex?: boolean;
|
|
368
392
|
order?: number;
|
|
369
393
|
page: IEquatable;
|
|
394
|
+
resolvedCategory: IEquatable;
|
|
370
395
|
schema: string;
|
|
371
396
|
template?: string;
|
|
372
397
|
title: string;
|
|
@@ -457,6 +482,10 @@ type IPageUnresolvedRelation = {
|
|
|
457
482
|
value: IEquatable | IEquatable[];
|
|
458
483
|
};
|
|
459
484
|
|
|
485
|
+
declare enum MenuCategoryStrategy {
|
|
486
|
+
Default = "default",// show hidden categories recursively,
|
|
487
|
+
ExcludeHidden = "exclude-hidden"
|
|
488
|
+
}
|
|
460
489
|
type IMenuBase = {
|
|
461
490
|
abstract?: ILocalizable;
|
|
462
491
|
extra?: ILocalizable;
|
|
@@ -526,10 +555,6 @@ type IUndecoratedMenuBase = {
|
|
|
526
555
|
media?: IMedia;
|
|
527
556
|
type: string;
|
|
528
557
|
};
|
|
529
|
-
declare enum MenuCategoryStrategy {
|
|
530
|
-
Default = "default",// show hidden categories recursively,
|
|
531
|
-
ExcludeHidden = "exclude-hidden"
|
|
532
|
-
}
|
|
533
558
|
type IUndecoratedMenuCategory = Omit<IUndecoratedMenuBase, 'type'> & {
|
|
534
559
|
type: 'category';
|
|
535
560
|
category: string;
|
|
@@ -562,12 +587,13 @@ type IUndecoratedMenu = IEntity & {
|
|
|
562
587
|
items: IUndecoratedMenuItem[];
|
|
563
588
|
};
|
|
564
589
|
|
|
565
|
-
type ILayout = {
|
|
590
|
+
type ILayout<T extends IAppExtended = IAppExtended> = {
|
|
566
591
|
labels: ILabel[];
|
|
567
592
|
locale: string;
|
|
568
593
|
locales: ILocale[];
|
|
569
594
|
market: string;
|
|
570
595
|
markets: IMarket[];
|
|
596
|
+
app: IPrettify<IApp<T>>;
|
|
571
597
|
menu: Record<string, ILocalizedMenu>;
|
|
572
598
|
topLevelHrefs: Record<string, string>;
|
|
573
599
|
topLevelRoutes: Record<string, IRouteLink>;
|
|
@@ -631,11 +657,19 @@ type QueryParams = {
|
|
|
631
657
|
sort?: string;
|
|
632
658
|
where?: Where;
|
|
633
659
|
};
|
|
660
|
+
type GlobalQueryParams = {
|
|
661
|
+
depth?: number;
|
|
662
|
+
draft?: boolean;
|
|
663
|
+
locale?: string;
|
|
664
|
+
market?: string;
|
|
665
|
+
richText?: boolean;
|
|
666
|
+
};
|
|
634
667
|
|
|
635
668
|
type IPagedResult<T extends IEntity = IEntity> = {
|
|
636
669
|
docs: T[];
|
|
637
670
|
} & Pagination;
|
|
638
671
|
type IQuerable<T extends IEntity = IEntity> = {
|
|
672
|
+
findGlobal<B extends T = T>(params?: GlobalQueryParams, token?: string): Promise<B | undefined>;
|
|
639
673
|
findOne<B extends T = T>(id: IEquatable, params?: QueryParams, token?: string): Promise<B | undefined>;
|
|
640
674
|
findMany<B extends T = T>(params?: QueryParams, token?: string): Promise<B[]>;
|
|
641
675
|
findPaged<B extends T = T>(params?: QueryParams, token?: string): Promise<IPagedResult<B>>;
|
|
@@ -892,6 +926,7 @@ declare class JsonService<T extends IEntity = IEntity> implements IQuerable<T> {
|
|
|
892
926
|
constructor(items: T[]);
|
|
893
927
|
getItems<B extends T = T>(): Promise<B[]>;
|
|
894
928
|
protected whereId_(id: IEquatable): WhereField;
|
|
929
|
+
findGlobal<B extends T = T>(params?: GlobalQueryParams): Promise<B | undefined>;
|
|
895
930
|
findOne<B extends T = T>(id: IEquatable, params?: QueryParams): Promise<B | undefined>;
|
|
896
931
|
findMany<B extends T = T>(params?: QueryParams): Promise<B[]>;
|
|
897
932
|
findPaged<B extends T = T>(params?: QueryParams): Promise<IPagedResult<B>>;
|
|
@@ -1003,6 +1038,170 @@ declare class Logger {
|
|
|
1003
1038
|
|
|
1004
1039
|
declare const defaultMarket: string;
|
|
1005
1040
|
|
|
1041
|
+
/**
|
|
1042
|
+
* STORE
|
|
1043
|
+
*/
|
|
1044
|
+
|
|
1045
|
+
type IMockStore = {
|
|
1046
|
+
collections: {
|
|
1047
|
+
[key: string]: IMockCollection[];
|
|
1048
|
+
} & {
|
|
1049
|
+
category: IMockCategory[];
|
|
1050
|
+
label: IMockLabel[];
|
|
1051
|
+
locale: IMockLocale[];
|
|
1052
|
+
market: IMockMarket[];
|
|
1053
|
+
menu?: IMockMenu[];
|
|
1054
|
+
redirect?: IMockCollection[];
|
|
1055
|
+
template?: IMockTemplate[];
|
|
1056
|
+
};
|
|
1057
|
+
pages: Record<string, IMockPage[]>;
|
|
1058
|
+
};
|
|
1059
|
+
type IMockPage = {
|
|
1060
|
+
id?: IEquatable;
|
|
1061
|
+
title: ILocalizable;
|
|
1062
|
+
abstract?: ILocalizable;
|
|
1063
|
+
description?: ILocalizable;
|
|
1064
|
+
media?: IMockMedia;
|
|
1065
|
+
meta?: IMockMeta;
|
|
1066
|
+
components?: IMockComponent[];
|
|
1067
|
+
category: string;
|
|
1068
|
+
slug?: ILocalizable;
|
|
1069
|
+
template?: string;
|
|
1070
|
+
isDefault?: boolean;
|
|
1071
|
+
isProtected?: boolean;
|
|
1072
|
+
useSplat?: boolean;
|
|
1073
|
+
order?: number;
|
|
1074
|
+
markets?: string[];
|
|
1075
|
+
$inherit?: boolean;
|
|
1076
|
+
[key: string]: unknown;
|
|
1077
|
+
};
|
|
1078
|
+
type IMockComponent = {
|
|
1079
|
+
schema?: string;
|
|
1080
|
+
anchor?: IAnchor;
|
|
1081
|
+
[key: string]: unknown;
|
|
1082
|
+
};
|
|
1083
|
+
type IMockMeta = {
|
|
1084
|
+
title?: ILocalizable;
|
|
1085
|
+
description?: ILocalizable;
|
|
1086
|
+
keywords?: ILocalizable;
|
|
1087
|
+
robots?: ILocalizable;
|
|
1088
|
+
};
|
|
1089
|
+
type IMockTemplate = {
|
|
1090
|
+
id: string;
|
|
1091
|
+
name: string;
|
|
1092
|
+
collections?: string[];
|
|
1093
|
+
};
|
|
1094
|
+
type IMockCategory = {
|
|
1095
|
+
id: string;
|
|
1096
|
+
title: ILocalizable;
|
|
1097
|
+
slug?: ILocalizable;
|
|
1098
|
+
category?: string;
|
|
1099
|
+
isHidden?: boolean;
|
|
1100
|
+
};
|
|
1101
|
+
type IMockLocale = {
|
|
1102
|
+
id: ILocaleId;
|
|
1103
|
+
title: ILocalizable;
|
|
1104
|
+
isDefault?: boolean;
|
|
1105
|
+
};
|
|
1106
|
+
type IMockMarket = {
|
|
1107
|
+
id: string;
|
|
1108
|
+
title: ILocalizable;
|
|
1109
|
+
isDefault?: boolean;
|
|
1110
|
+
isActive?: boolean;
|
|
1111
|
+
defaultLanguage?: ILocaleId;
|
|
1112
|
+
countries?: string[];
|
|
1113
|
+
languages?: ILocaleId[];
|
|
1114
|
+
};
|
|
1115
|
+
type IMockLabel = {
|
|
1116
|
+
id: string;
|
|
1117
|
+
text: ILocalizable;
|
|
1118
|
+
};
|
|
1119
|
+
type IMockMedia = {
|
|
1120
|
+
id?: IEquatable;
|
|
1121
|
+
title?: ILocalizable;
|
|
1122
|
+
abstract?: ILocalizable;
|
|
1123
|
+
alt?: ILocalizable;
|
|
1124
|
+
type: IMediaType;
|
|
1125
|
+
src: string;
|
|
1126
|
+
[key: string]: unknown;
|
|
1127
|
+
};
|
|
1128
|
+
type IMockCollection = {
|
|
1129
|
+
id?: IEquatable;
|
|
1130
|
+
title?: ILocalizable;
|
|
1131
|
+
abstract?: ILocalizable;
|
|
1132
|
+
description?: ILocalizable;
|
|
1133
|
+
media?: IMockMedia;
|
|
1134
|
+
order?: number;
|
|
1135
|
+
markets?: string[];
|
|
1136
|
+
$inherit?: boolean;
|
|
1137
|
+
[key: string]: unknown;
|
|
1138
|
+
};
|
|
1139
|
+
type IMockRedirect = {
|
|
1140
|
+
status: string;
|
|
1141
|
+
from: string;
|
|
1142
|
+
to?: string;
|
|
1143
|
+
name: string;
|
|
1144
|
+
order?: number;
|
|
1145
|
+
isActive?: boolean;
|
|
1146
|
+
};
|
|
1147
|
+
/**
|
|
1148
|
+
* MENU
|
|
1149
|
+
*/
|
|
1150
|
+
type IMockMenu = {
|
|
1151
|
+
id: string;
|
|
1152
|
+
items: IMockMenuItem[];
|
|
1153
|
+
};
|
|
1154
|
+
type IMockMenuItem = IMockMenuGroup | IMockMenuCategory | IMockMenuPage | IMockMenuLink | IMockMenuCustom;
|
|
1155
|
+
type IMockMenuGroup = IMockMenuBase & {
|
|
1156
|
+
type: 'group';
|
|
1157
|
+
title?: ILocalizable;
|
|
1158
|
+
items: IMockMenuItem[];
|
|
1159
|
+
};
|
|
1160
|
+
type IMockMenuCategory = IMockMenuBase & IMockMenuExtra & {
|
|
1161
|
+
type: 'category';
|
|
1162
|
+
category: string;
|
|
1163
|
+
customTitle?: ILocalizable;
|
|
1164
|
+
strategy?: MenuCategoryStrategy;
|
|
1165
|
+
maxDepth?: number;
|
|
1166
|
+
};
|
|
1167
|
+
type IMockMenuPage = IMockMenuBase & IMockMenuExtra & {
|
|
1168
|
+
type: 'page';
|
|
1169
|
+
page: IMockSingleRelation;
|
|
1170
|
+
customTitle?: ILocalizable;
|
|
1171
|
+
};
|
|
1172
|
+
type IMockMenuLink = IMockMenuBase & {
|
|
1173
|
+
type: 'link';
|
|
1174
|
+
title: ILocalizable;
|
|
1175
|
+
href: string;
|
|
1176
|
+
target?: ('_self' | '_blank' | '_parent' | '_top' | '_unfencedTop') & string;
|
|
1177
|
+
};
|
|
1178
|
+
type IMockMenuCustom = IMockMenuBase & {
|
|
1179
|
+
type: 'custom';
|
|
1180
|
+
title: ILocalizable;
|
|
1181
|
+
blockType: string;
|
|
1182
|
+
};
|
|
1183
|
+
type IMockMenuBase = {
|
|
1184
|
+
abstract?: ILocalizable;
|
|
1185
|
+
media?: IMockMedia;
|
|
1186
|
+
markets?: string[];
|
|
1187
|
+
customClass?: string;
|
|
1188
|
+
};
|
|
1189
|
+
type IMockMenuExtra = {
|
|
1190
|
+
extra?: ILocalizable;
|
|
1191
|
+
};
|
|
1192
|
+
type IMockRelation = {
|
|
1193
|
+
relationTo: string;
|
|
1194
|
+
value: IEquatable | IEquatable[];
|
|
1195
|
+
};
|
|
1196
|
+
type IMockSingleRelation = {
|
|
1197
|
+
relationTo: string;
|
|
1198
|
+
value: IEquatable;
|
|
1199
|
+
};
|
|
1200
|
+
type IMockManyRelation = {
|
|
1201
|
+
relationTo: string;
|
|
1202
|
+
value: IEquatable[];
|
|
1203
|
+
};
|
|
1204
|
+
|
|
1006
1205
|
declare const passwordStrategy: string;
|
|
1007
1206
|
|
|
1008
1207
|
/**
|
|
@@ -1065,6 +1264,9 @@ declare function getOrigin(headers?: IncomingHttpHeaders | Headers): string;
|
|
|
1065
1264
|
|
|
1066
1265
|
/**
|
|
1067
1266
|
* Represents the route strategy options.
|
|
1267
|
+
* - **Auto** dynamically add/remove prefixes based on number of markets & languages.
|
|
1268
|
+
* - **Default** add prefixes based on !isDefault market or language flag.
|
|
1269
|
+
* - **Manual** add prefixes based on !isHidden market or language flag.
|
|
1068
1270
|
*/
|
|
1069
1271
|
declare enum RouteStrategy {
|
|
1070
1272
|
Auto = "auto",
|
|
@@ -1366,4 +1568,4 @@ declare function asServerProps(props: any): any;
|
|
|
1366
1568
|
declare function awaitAll(array: any, callback: (item: any, index: number) => Promise<any>): Promise<any[]>;
|
|
1367
1569
|
declare function merge(target: any, source: any): any;
|
|
1368
1570
|
|
|
1369
|
-
export { type DeepPartial, type DeepRequired, type DeepRequiredProps, type Dynamic, type FetchError, type FetchRequestOptions, type FetchService, type FindParams, type FindWhereParams, type Headings, type IAction, type IActionEmailData, type IAnchor, type ICategorized, type ICategory, type ICategoryItem, type IClassName, type IClassNameCollection, type IClassNameValue, type ICollectionDescription, type IComponent, type IConfig, type IConsentPreference, type IContextBaseParams, type IContextParams, type IDecoratedNav, type IEmailConfig, type IEndUser, type IEntity, type IEquatable, type IFeature, type IFeatureType, type IImageResize, type ILabel, type ILayout, type ILegalNotice, type ILetter, type ILocale, type ILocaleId, type ILocalizable, type ILocalized, type ILocalizedMenu, type ILocalizedString, type IMarket, type IMedia, type IMediaImage, type IMediaInfo, type IMediaJson, type IMediaPdf, type IMediaType, type IMediaVideo, type IMemoryStore, type IMenu, type IMenuBase, type IMenuCategory, type IMenuCustom, type IMenuGroup, type IMenuHref, type IMenuItem, type IMenuLink, type IMenuPage, type IMenuRoute, type INamedEntity, type IOption, type IOverride, type IOverrideReturnValue, type IOverrideValue, type IPackages, type IPage, type IPageItem, type IPageRelation, type IPageRelationResult, type IPageUnresolvedRelation, type IPagedResult, type IPaginationResult, type IPartial, type IPreference, type IPrettify, type IQuerable, type IRedirect, type IRoute, type IRouteCanonical, type IRouteLink, type IRouteParams, type ISchema, type ISerializedCollection, type ISerializedStore, type IServerSideContext, type IServerSideSplatContext, type IStaticContext, type IStore, type ITemplate, type ITitledEntity, type IUndecoratedMenu, type IUndecoratedMenuBase, type IUndecoratedMenuCategory, type IUndecoratedMenuCustom, type IUndecoratedMenuGroup, type IUndecoratedMenuItem, type IUndecoratedMenuLink, type IUndecoratedMenuPage, type IUndecoratedNav, ImageStrategy, type Json, JsonService, type LiteralUnion, Logger, LoggerLevel, MenuCategoryStrategy, type NextApiRequestCookies, type Operator, type PageProps, type Pagination, type PreviewData, type Primitive, type QueryParams, RedirectReason, type RequireAtLeastOne, RouteStrategy, type SchemaType, type ServerSidePropsContext, type Shift, type ShiftUnion, type StaticPropsContext, type User, type UserRole, type UserWithRoles, type ValueOf, type Where, type WhereAndOr, type WhereBase, type WhereField, arrayShuffle, asCategoryId, asEntityId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, base64ToString, camelToSnakeCase, cloneItem, collectFeatureTypes, collectFeatureTypes__, collectOptions, collectRoutes, consoleWarn, decryptImageResize, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, eachMedia, eachValue, encryptImageToken, enumToList, excludeComponent, findCategoryInCategories, findChildCategories, findRouteOfCategory, findRoutesOfCategory, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getHost, getIsDevelopment, getIsProduction, getOrigin, getParentCategoriesById, getParentCategory, getProto, getRootCategory, getRouteHref, groupComponents, hasComponents, hasMarket, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isComponent, isComponentOfType, isDevelopment, isEntity, isEquatable, isHeaders, isIncomingHttpHeaders, isLocalizedString, isMedia, isMediaImage, isMediaJson, isMediaPdf, isMediaVideo, isMenuCategory, isMenuGroup, isMenuHref, isMenuLink, isMenuPage, isMenuRoute, isNonEmptyArray, isNotNullString, isNumber, isObject, isProduction, isPromise, isRelation, isReservedCollectionDescription, isStage, isString, isUndecoratedCategory, isUndecoratedMenuCategory, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedCategory, isUnresolvedRelation, isValidCollectionDescription, isValidString, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, passwordStrategy, pickComponent, pickHero, prependHero, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, stringToBase64, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };
|
|
1571
|
+
export { type DeepPartial, type DeepRequired, type DeepRequiredProps, type Dynamic, type FetchError, type FetchRequestOptions, type FetchService, type FindParams, type FindWhereParams, type GlobalQueryParams, type Headings, type IAction, type IActionEmailData, type IAnchor, type IApp, type IAppExtended, type ICategorized, type ICategory, type ICategoryItem, type IClassName, type IClassNameCollection, type IClassNameValue, type ICollectionDescription, type IComponent, type IConfig, type IConsentPreference, type IContextBaseParams, type IContextParams, type IDecoratedNav, type IEmailConfig, type IEndUser, type IEntity, type IEquatable, type IFeature, type IFeatureType, type IImageResize, type ILabel, type ILayout, type ILegalNotice, type ILetter, type ILocale, type ILocaleId, type ILocalizable, type ILocalized, type ILocalizedMenu, type ILocalizedString, type IMarket, type IMedia, type IMediaImage, type IMediaInfo, type IMediaJson, type IMediaPdf, type IMediaType, type IMediaVideo, type IMemoryStore, type IMenu, type IMenuBase, type IMenuCategory, type IMenuCustom, type IMenuGroup, type IMenuHref, type IMenuItem, type IMenuLink, type IMenuPage, type IMenuRoute, type IMockCategory, type IMockCollection, type IMockComponent, type IMockLabel, type IMockLocale, type IMockManyRelation, type IMockMarket, type IMockMedia, type IMockMenu, type IMockMenuBase, type IMockMenuCategory, type IMockMenuCustom, type IMockMenuExtra, type IMockMenuGroup, type IMockMenuItem, type IMockMenuLink, type IMockMenuPage, type IMockMeta, type IMockPage, type IMockRedirect, type IMockRelation, type IMockSingleRelation, type IMockStore, type IMockTemplate, type INamedEntity, type IOption, type IOverride, type IOverrideReturnValue, type IOverrideValue, type IPackages, type IPage, type IPageItem, type IPageRelation, type IPageRelationResult, type IPageUnresolvedRelation, type IPagedResult, type IPaginationResult, type IPartial, type IPreference, type IPrettify, type IQuerable, type IRedirect, type IRoute, type IRouteCanonical, type IRouteLink, type IRouteParams, type ISchema, type ISerializedCollection, type ISerializedStore, type IServerSideContext, type IServerSideSplatContext, type IStaticContext, type IStore, type ITemplate, type ITitledEntity, type IUndecoratedMenu, type IUndecoratedMenuBase, type IUndecoratedMenuCategory, type IUndecoratedMenuCustom, type IUndecoratedMenuGroup, type IUndecoratedMenuItem, type IUndecoratedMenuLink, type IUndecoratedMenuPage, type IUndecoratedNav, ImageStrategy, type Json, JsonService, type LiteralUnion, Logger, LoggerLevel, MenuCategoryStrategy, type NextApiRequestCookies, type Operator, type PageProps, type Pagination, type PreviewData, type Primitive, type QueryParams, RedirectReason, type RequireAtLeastOne, RouteStrategy, type SchemaType, type ServerSidePropsContext, type Shift, type ShiftUnion, type StaticPropsContext, type User, type UserRole, type UserWithRoles, type ValueOf, type Where, type WhereAndOr, type WhereBase, type WhereField, arrayShuffle, asCategoryId, asEntityId, asEquatable, asEquatableNumber, asEquatableString, asServerProps, asSortedOptions, awaitAll, base64ToString, camelToSnakeCase, cloneItem, collectFeatureTypes, collectFeatureTypes__, collectOptions, collectRoutes, consoleWarn, decryptImageResize, deepMerge, defaultLocale, defaultMarket, eachCategorized, eachMarketLocale, eachMedia, eachValue, encryptImageToken, enumToList, excludeComponent, findCategoryInCategories, findChildCategories, findRouteOfCategory, findRoutesOfCategory, getCategorySegments, getCategorySegmentsByCategory, getClassNames, getCollectionDescription, getEnv, getHost, getIsDevelopment, getIsProduction, getOrigin, getParentCategoriesById, getParentCategory, getProto, getRootCategory, getRouteHref, groupComponents, hasComponents, hasMarket, httpDelete, httpFetch, httpGet, httpPatch, httpPost, httpPut, isArray, isBrowser, isComponent, isComponentOfType, isDevelopment, isEntity, isEquatable, isHeaders, isIncomingHttpHeaders, isLocalizedString, isMedia, isMediaImage, isMediaJson, isMediaPdf, isMediaVideo, isMenuCategory, isMenuGroup, isMenuHref, isMenuLink, isMenuPage, isMenuRoute, isNonEmptyArray, isNotNullString, isNumber, isObject, isProduction, isPromise, isRelation, isReservedCollectionDescription, isStage, isString, isUndecoratedCategory, isUndecoratedMenuCategory, isUndecoratedMenuItem, isUndecoratedMenuPage, isUndecoratedNav, isUnresolvedCategory, isUnresolvedRelation, isValidCollectionDescription, isValidString, localize, localizeItem, localizeValue, localizedToString, merge, pascalCaseToCamelCase, pascalCaseToCharCase, pascalCaseToKebabCase, pascalCaseToSnakeCase, passwordStrategy, pickComponent, pickHero, prependHero, qsDeserialize, qsDeserializeRaw, qsSerialize, qsSerializeRaw, resolveMediaType, stringToBase64, toCamelCase, toCharCase, toDisplayName, toFindParams, toKebabCase, toPascalCase, toPluralName, toSnakeCase, toTitleCase, toValidCollectionName, unknownCaseToPascalCase, uuidv4, withSchema };
|
package/dist/index.js
CHANGED
|
@@ -414,6 +414,11 @@ function isMedia(item) {
|
|
|
414
414
|
}
|
|
415
415
|
|
|
416
416
|
// src/types/menu.ts
|
|
417
|
+
var MenuCategoryStrategy = /* @__PURE__ */ ((MenuCategoryStrategy2) => {
|
|
418
|
+
MenuCategoryStrategy2["Default"] = "default";
|
|
419
|
+
MenuCategoryStrategy2["ExcludeHidden"] = "exclude-hidden";
|
|
420
|
+
return MenuCategoryStrategy2;
|
|
421
|
+
})(MenuCategoryStrategy || {});
|
|
417
422
|
function isMenuHref(item) {
|
|
418
423
|
return ["category", "link", "page", "route"].includes(item.type);
|
|
419
424
|
}
|
|
@@ -432,11 +437,6 @@ function isMenuPage(item) {
|
|
|
432
437
|
function isMenuRoute(item) {
|
|
433
438
|
return item.type === "route";
|
|
434
439
|
}
|
|
435
|
-
var MenuCategoryStrategy = /* @__PURE__ */ ((MenuCategoryStrategy2) => {
|
|
436
|
-
MenuCategoryStrategy2["Default"] = "default";
|
|
437
|
-
MenuCategoryStrategy2["ExcludeHidden"] = "exclude-hidden";
|
|
438
|
-
return MenuCategoryStrategy2;
|
|
439
|
-
})(MenuCategoryStrategy || {});
|
|
440
440
|
|
|
441
441
|
// src/types/querable.ts
|
|
442
442
|
function toFindParams(idOrParams) {
|
|
@@ -778,8 +778,12 @@ async function httpDelete(url, options = {}) {
|
|
|
778
778
|
}
|
|
779
779
|
|
|
780
780
|
// src/image/image.ts
|
|
781
|
-
function
|
|
782
|
-
|
|
781
|
+
function getImageSecret() {
|
|
782
|
+
const secret = process.env.MIXER_SECRET || "";
|
|
783
|
+
if (!secret) {
|
|
784
|
+
throw "getImageSecret MIXER_SECRET not defined";
|
|
785
|
+
}
|
|
786
|
+
return secret;
|
|
783
787
|
}
|
|
784
788
|
function textToArrayBuffer_(text) {
|
|
785
789
|
const encoder = new TextEncoder();
|
|
@@ -812,11 +816,11 @@ function decrypt_(base64, secret) {
|
|
|
812
816
|
}
|
|
813
817
|
function encryptImageToken(imageResize) {
|
|
814
818
|
const text = JSON.stringify(imageResize);
|
|
815
|
-
const token = encrypt_(text,
|
|
819
|
+
const token = encrypt_(text, getImageSecret());
|
|
816
820
|
return token;
|
|
817
821
|
}
|
|
818
822
|
function decryptImageResize(token) {
|
|
819
|
-
const text = decrypt_(token,
|
|
823
|
+
const text = decrypt_(token, getImageSecret());
|
|
820
824
|
const data = JSON.parse(text);
|
|
821
825
|
return data;
|
|
822
826
|
}
|
|
@@ -837,6 +841,15 @@ var JsonService = class {
|
|
|
837
841
|
equals: id
|
|
838
842
|
};
|
|
839
843
|
}
|
|
844
|
+
async findGlobal(params = {}) {
|
|
845
|
+
const items = await this.getItems();
|
|
846
|
+
if (items.length > 0) {
|
|
847
|
+
return await this.decorateOne_(items[0], params);
|
|
848
|
+
} else {
|
|
849
|
+
console.log("JsonService.findGlobal.notfound", params);
|
|
850
|
+
return void 0;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
840
853
|
async findOne(id, params = {}) {
|
|
841
854
|
let items = await this.getItems();
|
|
842
855
|
params.where = params.where || {};
|
|
@@ -1520,60 +1533,71 @@ var RouteStrategy = /* @__PURE__ */ ((RouteStrategy2) => {
|
|
|
1520
1533
|
RouteStrategy2["Manual"] = "manual";
|
|
1521
1534
|
return RouteStrategy2;
|
|
1522
1535
|
})(RouteStrategy || {});
|
|
1523
|
-
var ROUTE_STRATEGY = process.env.ROUTE_STRATEGY || "
|
|
1524
|
-
function getPickedProps(item) {
|
|
1525
|
-
const pickedProps = Object.fromEntries(Object.entries(item).filter(([k, v]) => [
|
|
1526
|
-
"category",
|
|
1527
|
-
"isDefault",
|
|
1528
|
-
"media",
|
|
1529
|
-
"order",
|
|
1530
|
-
"template",
|
|
1531
|
-
"updatedAt",
|
|
1532
|
-
"useSplat",
|
|
1533
|
-
// 'createdAt',
|
|
1534
|
-
"updatedAt",
|
|
1535
|
-
"_status"
|
|
1536
|
-
].includes(k)));
|
|
1537
|
-
return pickedProps;
|
|
1538
|
-
}
|
|
1536
|
+
var ROUTE_STRATEGY = process.env.ROUTE_STRATEGY || "manual" /* Manual */;
|
|
1539
1537
|
function collectRoutes(store, categories, markets, locales, medias) {
|
|
1540
1538
|
const routes = [];
|
|
1541
1539
|
if (locales.length > 0 && markets.length > 0) {
|
|
1542
1540
|
const rootCategory = getRootCategory(categories);
|
|
1543
1541
|
eachCategorized(store, (item, key) => {
|
|
1544
1542
|
const segments = getCategorySegments(categories, item);
|
|
1545
|
-
const visibleSegments = segments.filter((x) => Boolean(x.isHidden) === false);
|
|
1543
|
+
const visibleSegments = segments.filter((x) => x.id !== rootCategory?.id && Boolean(x.isHidden) === false);
|
|
1546
1544
|
const visibleCategory = visibleSegments.length > 0 ? visibleSegments[visibleSegments.length - 1] : rootCategory;
|
|
1547
1545
|
if (visibleCategory) {
|
|
1548
1546
|
const slugs = visibleSegments.map((x) => ({ slug: x.slug }));
|
|
1549
1547
|
if (Boolean(item.isDefault) === false) {
|
|
1550
1548
|
slugs.push({ slug: item.slug });
|
|
1551
1549
|
}
|
|
1552
|
-
const defaultLocale2 = locales.find((x) => x.isDefault) || locales[0];
|
|
1553
|
-
const defaultMarket2 = markets.find((x) => x.isDefault) || markets[0];
|
|
1554
|
-
const defaultMarketLocale = defaultMarket2 && defaultMarket2.defaultLanguage ? asEntityId(defaultMarket2.defaultLanguage) : defaultLocale2.id;
|
|
1555
1550
|
const isRootCategory = rootCategory && item.category === rootCategory.id && item.isDefault;
|
|
1556
1551
|
eachMarketLocale(markets, locales, (market, locale, markets2, locales2) => {
|
|
1557
1552
|
if (hasMarket(item, market)) {
|
|
1558
1553
|
const title = localize(item.title, locale.id);
|
|
1559
1554
|
const id = getRouteHref(slugs, market, locale, markets2, locales2);
|
|
1560
|
-
const
|
|
1561
|
-
|
|
1555
|
+
const {
|
|
1556
|
+
_status,
|
|
1557
|
+
category,
|
|
1558
|
+
isDefault,
|
|
1559
|
+
media,
|
|
1560
|
+
order,
|
|
1561
|
+
template,
|
|
1562
|
+
updatedAt,
|
|
1563
|
+
useSplat
|
|
1564
|
+
} = item;
|
|
1562
1565
|
const route = {
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
id: isDefaultRootCategory ?
|
|
1566
|
+
_status,
|
|
1567
|
+
category,
|
|
1568
|
+
// id: isDefaultRootCategory ? '/' : id,
|
|
1569
|
+
id,
|
|
1566
1570
|
locale: locale.id,
|
|
1567
1571
|
market: market.id,
|
|
1572
|
+
media,
|
|
1568
1573
|
page: item.id,
|
|
1574
|
+
resolvedCategory: visibleCategory.id,
|
|
1569
1575
|
schema: key,
|
|
1570
|
-
|
|
1576
|
+
template,
|
|
1577
|
+
title,
|
|
1578
|
+
updatedAt
|
|
1571
1579
|
};
|
|
1580
|
+
if (isDefault) {
|
|
1581
|
+
route.isDefault = true;
|
|
1582
|
+
}
|
|
1583
|
+
if (isRootCategory) {
|
|
1584
|
+
route.isRoot = true;
|
|
1585
|
+
}
|
|
1586
|
+
const noindex = (item.meta?.robots || "").includes("noindex");
|
|
1587
|
+
if (noindex) {
|
|
1588
|
+
route.noindex = true;
|
|
1589
|
+
}
|
|
1590
|
+
if (order != null) {
|
|
1591
|
+
route.order = order;
|
|
1592
|
+
}
|
|
1593
|
+
if (useSplat) {
|
|
1594
|
+
route.useSplat = true;
|
|
1595
|
+
}
|
|
1572
1596
|
const mediaId = typeof item.media === "string" ? item.media : void 0;
|
|
1573
1597
|
if (Array.isArray(medias) && mediaId) {
|
|
1574
|
-
const
|
|
1575
|
-
if (
|
|
1576
|
-
route.media =
|
|
1598
|
+
const media2 = item.media && medias.find((x) => x.id === mediaId);
|
|
1599
|
+
if (media2) {
|
|
1600
|
+
route.media = media2;
|
|
1577
1601
|
}
|
|
1578
1602
|
}
|
|
1579
1603
|
routes.push(route);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@websolutespa/bom-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Core module of the BOM Repository",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bom",
|
|
@@ -29,14 +29,14 @@
|
|
|
29
29
|
"peerDependencies": {},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/pluralize": "0.0.33",
|
|
32
|
-
"@types/react": "19.2.
|
|
33
|
-
"@websolutespa/eslint-config": "
|
|
34
|
-
"@websolutespa/test": "
|
|
35
|
-
"@websolutespa/tsconfig": "
|
|
32
|
+
"@types/react": "19.2.10",
|
|
33
|
+
"@websolutespa/eslint-config": "*",
|
|
34
|
+
"@websolutespa/test": "*",
|
|
35
|
+
"@websolutespa/tsconfig": "*",
|
|
36
36
|
"eslint": "9.31.0",
|
|
37
37
|
"npm-run-all": "4.1.5",
|
|
38
38
|
"raw-loader": "4.0.2",
|
|
39
|
-
"react": "19.2.
|
|
39
|
+
"react": "19.2.3",
|
|
40
40
|
"tsup": "8.5.0",
|
|
41
41
|
"typescript": "5.8.3",
|
|
42
42
|
"vitest": "3.2.3"
|