@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 +142 -130
- package/dist/index.js +11 -11
- package/dist/index.mjs +11 -11
- package/package.json +1 -1
- package/src/cached/cached.service.ts +9 -9
- package/src/decorators/schema.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,130 +1,142 @@
|
|
|
1
|
-
# @websolutespa/bom-mixer-store
|
|
2
|
-
|
|
3
|
-
## 1.4.
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
-
|
|
59
|
-
|
|
60
|
-
## 1.2.
|
|
61
|
-
|
|
62
|
-
###
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
## 1.
|
|
67
|
-
|
|
68
|
-
### Patch Changes
|
|
69
|
-
|
|
70
|
-
- Fixing:
|
|
71
|
-
|
|
72
|
-
## 1.
|
|
73
|
-
|
|
74
|
-
### Minor Changes
|
|
75
|
-
|
|
76
|
-
-
|
|
77
|
-
|
|
78
|
-
## 1.
|
|
79
|
-
|
|
80
|
-
### Patch Changes
|
|
81
|
-
|
|
82
|
-
- Fixing:
|
|
83
|
-
|
|
84
|
-
## 1.
|
|
85
|
-
|
|
86
|
-
### Minor Changes
|
|
87
|
-
|
|
88
|
-
- Modified
|
|
89
|
-
|
|
90
|
-
## 0.
|
|
91
|
-
|
|
92
|
-
### Patch Changes
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
|
|
96
|
-
## 0.
|
|
97
|
-
|
|
98
|
-
###
|
|
99
|
-
|
|
100
|
-
-
|
|
101
|
-
|
|
102
|
-
## 0.3.
|
|
103
|
-
|
|
104
|
-
###
|
|
105
|
-
|
|
106
|
-
-
|
|
107
|
-
|
|
108
|
-
## 0.
|
|
109
|
-
|
|
110
|
-
###
|
|
111
|
-
|
|
112
|
-
- Added:
|
|
113
|
-
|
|
114
|
-
## 0.
|
|
115
|
-
|
|
116
|
-
###
|
|
117
|
-
|
|
118
|
-
-
|
|
119
|
-
|
|
120
|
-
## 0.
|
|
121
|
-
|
|
122
|
-
### Minor Changes
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
## 0.
|
|
127
|
-
|
|
128
|
-
### Patch Changes
|
|
129
|
-
|
|
130
|
-
-
|
|
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
|
-
|
|
1223
|
-
|
|
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
|
-
|
|
1120
|
-
|
|
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
|
@@ -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
|
-
|
|
77
|
-
|
|
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}`;
|
package/src/decorators/schema.ts
CHANGED
|
@@ -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
|
}
|