@websolutespa/bom-mixer-store 1.4.4 → 1.4.6

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,130 +1,142 @@
1
- # @websolutespa/bom-mixer-store
2
-
3
- ## 1.4.4
4
-
5
- ### Patch Changes
6
-
7
- - Added: Schema decorator
8
- - Modified: RemoteMenuService, RemotePageService, RemoteService
9
- - Updated dependencies
10
- - @websolutespa/bom-core@0.6.5
11
-
12
- ## 1.4.3
13
-
14
- ### Patch Changes
15
-
16
- - Modified: CachedService, Decorators, LocalApi, MockApi, MockStore, RemoteApi, RemoteStore, StoreHandler
17
-
18
- ## 1.4.2
19
-
20
- ### Patch Changes
21
-
22
- - Added: Decorators, CachedService, RemotePageService, RemoteMenuService, StoreStrategy.DecoratedApi, nextPhase, storeCacheDuration
23
- - Modified: RemoteStore
24
- - Updated dependencies
25
- - @websolutespa/bom-core@0.6.4
26
-
27
- ## 1.4.1
28
-
29
- ### Patch Changes
30
-
31
- - Modified: MockPageService
32
- - Updated dependencies
33
- - @websolutespa/bom-core@0.6.3
34
-
35
- ## 1.4.0
36
-
37
- ### Minor Changes
38
-
39
- - Added: BuildStrategy
40
-
41
- ## 1.3.0
42
-
43
- ### Minor Changes
44
-
45
- - Added: storeIndexHandler
46
- - Modified: Store, StoreHandler, RemoteService, MockService, MockPageService, MockMenuService, StaticService
47
-
48
- ## 1.2.2
49
-
50
- ### Patch Changes
51
-
52
- - Modified: MockMenuService IPageRelationResult
53
-
54
- ## 1.2.1
55
-
56
- ### Patch Changes
57
-
58
- - Fixing: MockMenuService collectPages
59
-
60
- ## 1.2.0
61
-
62
- ### Minor Changes
63
-
64
- - Updating: next 13
65
-
66
- ## 1.1.1
67
-
68
- ### Patch Changes
69
-
70
- - Fixing: check redirects by pattern
71
-
72
- ## 1.1.0
73
-
74
- ### Minor Changes
75
-
76
- - Modified: store refactor
77
-
78
- ## 1.0.1
79
-
80
- ### Patch Changes
81
-
82
- - Fixing: localhost url
83
-
84
- ## 1.0.0
85
-
86
- ### Minor Changes
87
-
88
- - Modified routes, added redirects
89
-
90
- ## 0.3.2
91
-
92
- ### Patch Changes
93
-
94
- - Modified: MockMenuService
95
-
96
- ## 0.3.1
97
-
98
- ### Patch Changes
99
-
100
- - Added: source files
101
-
102
- ## 0.3.0
103
-
104
- ### Minor Changes
105
-
106
- - Added: splat routes
107
-
108
- ## 0.2.0
109
-
110
- ### Minor Changes
111
-
112
- - Added: @websolutespa/bom-core
113
-
114
- ## 0.1.1
115
-
116
- ### Patch Changes
117
-
118
- - Modified: store service
119
-
120
- ## 0.1.0
121
-
122
- ### Minor Changes
123
-
124
- - mock refactor
125
-
126
- ## 0.0.2
127
-
128
- ### Patch Changes
129
-
130
- - Added: first release
1
+ # @websolutespa/bom-mixer-store
2
+
3
+ ## 1.4.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Fixing: CachedService findMany DecoratedApi
8
+
9
+ ## 1.4.5
10
+
11
+ ### Patch Changes
12
+
13
+ - Fixing: decorateSchema
14
+
15
+ ## 1.4.4
16
+
17
+ ### Patch Changes
18
+
19
+ - Added: Schema decorator
20
+ - Modified: RemoteMenuService, RemotePageService, RemoteService
21
+ - Updated dependencies
22
+ - @websolutespa/bom-core@0.6.5
23
+
24
+ ## 1.4.3
25
+
26
+ ### Patch Changes
27
+
28
+ - Modified: CachedService, Decorators, LocalApi, MockApi, MockStore, RemoteApi, RemoteStore, StoreHandler
29
+
30
+ ## 1.4.2
31
+
32
+ ### Patch Changes
33
+
34
+ - Added: Decorators, CachedService, RemotePageService, RemoteMenuService, StoreStrategy.DecoratedApi, nextPhase, storeCacheDuration
35
+ - Modified: RemoteStore
36
+ - Updated dependencies
37
+ - @websolutespa/bom-core@0.6.4
38
+
39
+ ## 1.4.1
40
+
41
+ ### Patch Changes
42
+
43
+ - Modified: MockPageService
44
+ - Updated dependencies
45
+ - @websolutespa/bom-core@0.6.3
46
+
47
+ ## 1.4.0
48
+
49
+ ### Minor Changes
50
+
51
+ - Added: BuildStrategy
52
+
53
+ ## 1.3.0
54
+
55
+ ### Minor Changes
56
+
57
+ - Added: storeIndexHandler
58
+ - Modified: Store, StoreHandler, RemoteService, MockService, MockPageService, MockMenuService, StaticService
59
+
60
+ ## 1.2.2
61
+
62
+ ### Patch Changes
63
+
64
+ - Modified: MockMenuService IPageRelationResult
65
+
66
+ ## 1.2.1
67
+
68
+ ### Patch Changes
69
+
70
+ - Fixing: MockMenuService collectPages
71
+
72
+ ## 1.2.0
73
+
74
+ ### Minor Changes
75
+
76
+ - Updating: next 13
77
+
78
+ ## 1.1.1
79
+
80
+ ### Patch Changes
81
+
82
+ - Fixing: check redirects by pattern
83
+
84
+ ## 1.1.0
85
+
86
+ ### Minor Changes
87
+
88
+ - Modified: store refactor
89
+
90
+ ## 1.0.1
91
+
92
+ ### Patch Changes
93
+
94
+ - Fixing: localhost url
95
+
96
+ ## 1.0.0
97
+
98
+ ### Minor Changes
99
+
100
+ - Modified routes, added redirects
101
+
102
+ ## 0.3.2
103
+
104
+ ### Patch Changes
105
+
106
+ - Modified: MockMenuService
107
+
108
+ ## 0.3.1
109
+
110
+ ### Patch Changes
111
+
112
+ - Added: source files
113
+
114
+ ## 0.3.0
115
+
116
+ ### Minor Changes
117
+
118
+ - Added: splat routes
119
+
120
+ ## 0.2.0
121
+
122
+ ### Minor Changes
123
+
124
+ - Added: @websolutespa/bom-core
125
+
126
+ ## 0.1.1
127
+
128
+ ### Patch Changes
129
+
130
+ - Modified: store service
131
+
132
+ ## 0.1.0
133
+
134
+ ### Minor Changes
135
+
136
+ - mock refactor
137
+
138
+ ## 0.0.2
139
+
140
+ ### Patch Changes
141
+
142
+ - Added: first release
package/dist/index.js CHANGED
@@ -513,11 +513,11 @@ function collectRelations_(item, relations = []) {
513
513
 
514
514
  // src/decorators/schema.ts
515
515
  async function decorateSchema_(store, item, schema) {
516
- return { ...item, schema };
516
+ return { ...item, schema: item.schema || schema };
517
517
  }
518
518
  async function decorateSchemas_(store, items, schema) {
519
519
  return items.map((item) => {
520
- return { ...item, schema };
520
+ return { ...item, schema: item.schema || schema };
521
521
  });
522
522
  }
523
523
 
@@ -1219,16 +1219,16 @@ var CachedService = class extends import_bom_core10.JsonService {
1219
1219
  const { market, locale, ...otherParams } = params;
1220
1220
  const serializedParams = (0, import_bom_core10.qsSerialize)({ market, locale });
1221
1221
  const key = `findMany?${serializedParams}`;
1222
- return await this.fromCache_(async () => {
1223
- let items = await this.service_.findMany({ market, locale });
1224
- if (otherParams.where) {
1225
- items = this.whereItems_(items, otherParams.where);
1226
- }
1227
- if (otherParams.sort) {
1228
- items = this.sortCollection_(items, otherParams.sort);
1229
- }
1230
- return items;
1222
+ let items = await this.fromCache_(async () => {
1223
+ return await this.service_.findMany({ market, locale });
1231
1224
  }, key);
1225
+ if (otherParams.where) {
1226
+ items = this.whereItems_(items, otherParams.where);
1227
+ }
1228
+ if (otherParams.sort) {
1229
+ items = this.sortCollection_(items, otherParams.sort);
1230
+ }
1231
+ return items;
1232
1232
  } else {
1233
1233
  const serializedParams = (0, import_bom_core10.qsSerialize)(params);
1234
1234
  const key = `findMany?${serializedParams}`;
package/dist/index.mjs CHANGED
@@ -410,11 +410,11 @@ function collectRelations_(item, relations = []) {
410
410
 
411
411
  // src/decorators/schema.ts
412
412
  async function decorateSchema_(store, item, schema) {
413
- return { ...item, schema };
413
+ return { ...item, schema: item.schema || schema };
414
414
  }
415
415
  async function decorateSchemas_(store, items, schema) {
416
416
  return items.map((item) => {
417
- return { ...item, schema };
417
+ return { ...item, schema: item.schema || schema };
418
418
  });
419
419
  }
420
420
 
@@ -1116,16 +1116,16 @@ var CachedService = class extends JsonService3 {
1116
1116
  const { market, locale, ...otherParams } = params;
1117
1117
  const serializedParams = qsSerialize({ market, locale });
1118
1118
  const key = `findMany?${serializedParams}`;
1119
- return await this.fromCache_(async () => {
1120
- let items = await this.service_.findMany({ market, locale });
1121
- if (otherParams.where) {
1122
- items = this.whereItems_(items, otherParams.where);
1123
- }
1124
- if (otherParams.sort) {
1125
- items = this.sortCollection_(items, otherParams.sort);
1126
- }
1127
- return items;
1119
+ let items = await this.fromCache_(async () => {
1120
+ return await this.service_.findMany({ market, locale });
1128
1121
  }, key);
1122
+ if (otherParams.where) {
1123
+ items = this.whereItems_(items, otherParams.where);
1124
+ }
1125
+ if (otherParams.sort) {
1126
+ items = this.sortCollection_(items, otherParams.sort);
1127
+ }
1128
+ return items;
1129
1129
  } else {
1130
1130
  const serializedParams = qsSerialize(params);
1131
1131
  const key = `findMany?${serializedParams}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@websolutespa/bom-mixer-store",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "description": "Mixer Store module of the BOM Repository",
5
5
  "keywords": [
6
6
  "bom",
@@ -73,16 +73,16 @@ export class CachedService<T extends IEntity = IEntity> extends JsonService<T> {
73
73
  const { market, locale, ...otherParams } = params;
74
74
  const serializedParams = qsSerialize({ market, locale });
75
75
  const key = `findMany?${serializedParams}`;
76
- return await this.fromCache_(async () => {
77
- let items = await this.service_.findMany({ market, locale });
78
- if (otherParams.where) {
79
- items = this.whereItems_(items, otherParams.where);
80
- }
81
- if (otherParams.sort) {
82
- items = this.sortCollection_(items, otherParams.sort);
83
- }
84
- return items;
76
+ let items = await this.fromCache_(async () => {
77
+ return await this.service_.findMany({ market, locale });
85
78
  }, key) as B[];
79
+ if (otherParams.where) {
80
+ items = this.whereItems_(items, otherParams.where);
81
+ }
82
+ if (otherParams.sort) {
83
+ items = this.sortCollection_(items, otherParams.sort);
84
+ }
85
+ return items;
86
86
  } else {
87
87
  const serializedParams = qsSerialize(params);
88
88
  const key = `findMany?${serializedParams}`;
@@ -1,11 +1,11 @@
1
1
  import { ISchema, IStore } from '@websolutespa/bom-core';
2
2
 
3
3
  export async function decorateSchema_<T extends ISchema = ISchema>(store: IStore, item: T, schema: string): Promise<T | T & { schema: string }> {
4
- return { ...item, schema };
4
+ return { ...item, schema: item.schema || schema };
5
5
  }
6
6
 
7
7
  export async function decorateSchemas_<T extends ISchema = ISchema>(store: IStore, items: T[], schema: string): Promise<(T & { schema: string })[]> {
8
8
  return items.map(item => {
9
- return { ...item, schema };
9
+ return { ...item, schema: item.schema || schema };
10
10
  });
11
11
  }