@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 CHANGED
@@ -1,375 +1,369 @@
1
- # @websolutespa/bom-core
2
-
3
- ## 2.0.1-next.2
4
-
5
- ### Patch Changes
6
-
7
- - Updating: dependencies and build step
8
-
9
- ## 2.0.1-next.0
10
-
11
- ### Major Changes
12
-
13
- - e74b305: Release: Payload 3.7.0
14
-
15
- ## 1.10.0-next.1
16
-
17
- ### Patch Changes
18
-
19
- - 64289c4: Updating: React 19.x, Payload 3.x
20
-
21
- ## 1.10.0-next.0
22
-
23
- ### Minor Changes
24
-
25
- - Updating: React 19.x, Payload 3.x
26
-
27
- ## 1.8.22
28
-
29
- ### Patch Changes
30
-
31
- - Fixing: JsonService whereItem\_ unresolved relations
32
-
33
- ## 1.8.21
34
-
35
- ### Patch Changes
36
-
37
- - Modified: IMeta
38
-
39
- ## 1.8.20
40
-
41
- ### Patch Changes
42
-
43
- - Modified: isMedia, category, route
44
-
45
- ## 1.8.19
46
-
47
- ### Patch Changes
48
-
49
- - f0d17f3: Modified: page market filtering
50
-
51
- ## 1.8.18
52
-
53
- ### Patch Changes
54
-
55
- - Modified: type IComponent
56
-
57
- ## 1.8.17
58
-
59
- ### Patch Changes
60
-
61
- - Added: isMedia, eachMedia, eachValue, isComponent, hasComponents, components utils
62
-
63
- ## 1.8.16
64
-
65
- ### Patch Changes
66
-
67
- - Modified: collectFeatureTypes
68
-
69
- ## 1.8.15
70
-
71
- ### Patch Changes
72
-
73
- - Modified: passwordStrategy
74
-
75
- ## 1.8.14
76
-
77
- ### Patch Changes
78
-
79
- - Added: passwordStrategy
80
-
81
- ## 1.8.13
82
-
83
- ### Patch Changes
84
-
85
- - Modified: IQuerable
86
-
87
- ## 1.8.12
88
-
89
- ### Patch Changes
90
-
91
- - Modified: IQuerable
92
-
93
- ## 1.8.11
94
-
95
- ### Patch Changes
96
-
97
- - Added: isUnresolvedCategory, isUndecoratedCategory
98
-
99
- ## 1.8.10
100
-
101
- ### Patch Changes
102
-
103
- - Modified: ILayout, IMenu
104
-
105
- ## 1.8.9
106
-
107
- ### Patch Changes
108
-
109
- - Added: isMenu assertions
110
-
111
- ## 1.8.8
112
-
113
- ### Patch Changes
114
-
115
- - f343ad7: Modified: RouteService collectRoutes
116
-
117
- ## 1.8.7
118
-
119
- ### Patch Changes
120
-
121
- - Modified: routeService getPickedProps
122
-
123
- ## 1.8.6
124
-
125
- ### Patch Changes
126
-
127
- - Modified: collectRoutes
128
-
129
- ## 1.8.5
130
-
131
- ### Patch Changes
132
-
133
- - Added: base64 encoder/decoder
134
-
135
- ## 1.8.4
136
-
137
- ### Patch Changes
138
-
139
- - Added: ImageStrategy.Token
140
-
141
- ## 1.8.3
142
-
143
- ### Patch Changes
144
-
145
- - Modified: IAnchor
146
-
147
- ## 1.8.2
148
-
149
- ### Patch Changes
150
-
151
- - Modified: IMedia
152
-
153
- ## 1.8.1
154
-
155
- ### Patch Changes
156
-
157
- - Modified: Market & Language
158
-
159
- ## 1.8.0
160
-
161
- ### Minor Changes
162
-
163
- - f8a1d97: Modified: extracted all website sample components & features
164
-
165
- ## 1.7.16
166
-
167
- ### Patch Changes
168
-
169
- - Added: MenuCategory strategy
170
-
171
- ## 1.7.15
172
-
173
- ### Patch Changes
174
-
175
- - Fixing: ILocalized type modified IOverride
176
-
177
- ## 1.7.13
178
-
179
- ### Patch Changes
180
-
181
- - Fixing: ILocalized type adding AtLeastOne
182
-
183
- ## 1.7.12
184
-
185
- ### Patch Changes
186
-
187
- - Modified: RouteService, MenuService to handle isHidden Category segments
188
-
189
- ## 1.7.11
190
-
191
- ### Patch Changes
192
-
193
- - Modified: JsonService where clauses, limit, sort
194
- - Added: JsonService tests
195
-
196
- ## 1.7.10
197
-
198
- ### Patch Changes
199
-
200
- - Fixing: getProto
201
-
202
- ## 1.7.9
203
-
204
- ### Patch Changes
205
-
206
- - Added: asSortedOptions
207
- - Modified: type guards
208
-
209
- ## 1.7.8
210
-
211
- ### Patch Changes
212
-
213
- - Fixing: downgrading eslint to v8.56.0
214
-
215
- ## 1.7.7
216
-
217
- ### Patch Changes
218
-
219
- - Modified: Media resolveMediaType
220
- - Added: isMediaImage, isMediaVideo, isMediaJson, isMediaPdf
221
-
222
- ## 1.7.6
223
-
224
- ### Patch Changes
225
-
226
- - Added: getProto
227
-
228
- ## 1.7.5
229
-
230
- ### Patch Changes
231
-
232
- - Modified: Logger
233
-
234
- ## 1.7.4
235
-
236
- ### Patch Changes
237
-
238
- - Added: getOrigin, getHost
239
-
240
- ## 1.7.3
241
-
242
- ### Patch Changes
243
-
244
- - Updating: dependencies
245
-
246
- ## 1.7.2
247
-
248
- ### Patch Changes
249
-
250
- - Fixing: JsonService containsClause
251
-
252
- ## 1.7.1
253
-
254
- ### Patch Changes
255
-
256
- - Added: JsonService containsClause
257
-
258
- ## 1.7.0
259
-
260
- ### Minor Changes
261
-
262
- - 28e86bd: Modified: IPage, Store services & decorators
263
-
264
- ## 1.6.0
265
-
266
- ### Patch Changes
267
-
268
- - 6cbf4cb: Added: IAction, IEndUser, IConsentPreference, IPreference, ILegalNotice
269
-
270
- ## 0.6.6
271
-
272
- ### Patch Changes
273
-
274
- - Modified: collectRoutes
275
-
276
- ## 0.6.5
277
-
278
- ### Patch Changes
279
-
280
- - Added: collectFeatureTypes, collectOptions
281
- - Modified: Category, collectRoutes, getRouteHref, entity
282
-
283
- ## 0.6.4
284
-
285
- ### Patch Changes
286
-
287
- - Added: typeGuards, IPagedResult
288
- - Modified: IUndecoratedMenuCustom
289
-
290
- ## 0.6.3
291
-
292
- ### Patch Changes
293
-
294
- - Added: isReservedCollectionDescription
295
-
296
- ## 0.6.2
297
-
298
- ### Patch Changes
299
-
300
- - Modified: IMedia
301
-
302
- ## 0.6.1
303
-
304
- ### Patch Changes
305
-
306
- - Added: defaultMarket, defaultLocale
307
-
308
- ## 0.6.0
309
-
310
- ### Minor Changes
311
-
312
- - Added Logger, IPaginationResult
313
-
314
- ## 0.5.0
315
-
316
- ### Minor Changes
317
-
318
- - Modified: JsonService, qs
319
- - Added: asEquatable, cloneItem, typeGuards
320
-
321
- ## 0.4.1
322
-
323
- ### Patch Changes
324
-
325
- - Added: IAnchor, babelCase
326
- - Modified: IApplication, IPageRelation
327
-
328
- ## 0.4.0
329
-
330
- ### Minor Changes
331
-
332
- - Updating: next 13
333
-
334
- ## 0.3.0
335
-
336
- ### Minor Changes
337
-
338
- - Modified: HttpService
339
-
340
- ## 0.2.1
341
-
342
- ### Patch Changes
343
-
344
- - Added: env ROOT_CATEGORY
345
-
346
- ## 0.2.0
347
-
348
- ### Minor Changes
349
-
350
- - Modified routes, added redirects
351
-
352
- ## 0.1.2
353
-
354
- ### Patch Changes
355
-
356
- - Modified: MockMenuService
357
-
358
- ## 0.1.1
359
-
360
- ### Patch Changes
361
-
362
- - Modified: ILocalizable
363
-
364
- ## 0.1.0
365
-
366
- ### Minor Changes
367
-
368
- - Added: splat routes
369
- - Added: variants
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 getSecret() {
782
- return process.env.IMAGE_SECRET || "IMAGE_SECRET";
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, getSecret());
819
+ const token = encrypt_(text, getImageSecret());
816
820
  return token;
817
821
  }
818
822
  function decryptImageResize(token) {
819
- const text = decrypt_(token, getSecret());
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 || "auto" /* Auto */;
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 isDefaultRootCategory = isRootCategory && market.id === defaultMarket2.id && locale.id === defaultMarketLocale;
1561
- const pickedProps = getPickedProps(item);
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
- ...pickedProps,
1564
- resolvedCategory: visibleCategory.id,
1565
- id: isDefaultRootCategory ? "/" : id,
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
- title
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 media = item.media && medias.find((x) => x.id === mediaId);
1575
- if (media) {
1576
- route.media = 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": "2.0.1-next.2",
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.1",
33
- "@websolutespa/eslint-config": "2.0.1-next.2",
34
- "@websolutespa/test": "2.0.1-next.2",
35
- "@websolutespa/tsconfig": "2.0.1-next.2",
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.1",
39
+ "react": "19.2.3",
40
40
  "tsup": "8.5.0",
41
41
  "typescript": "5.8.3",
42
42
  "vitest": "3.2.3"