feed-common 1.31.0 → 1.31.1
Sign up to get free protection for your applications and to get access to all the features.
- package/.vscode/settings.json +1 -1
- package/CHANGELOG.md +7 -0
- package/dist/utils/profile.d.ts.map +1 -1
- package/dist/utils/profile.js +4 -0
- package/dist/utils/profile.js.map +1 -1
- package/package.json +1 -1
- package/src/utils/profile.ts +20 -16
package/.vscode/settings.json
CHANGED
package/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
## [1.31.1](https://github.com/advertikon/package-maxify-feed-common/compare/v1.31.0...v1.31.1) (2024-08-06)
|
2
|
+
|
3
|
+
|
4
|
+
### Bug Fixes
|
5
|
+
|
6
|
+
* rule stuff ([ff67d01](https://github.com/advertikon/package-maxify-feed-common/commit/ff67d0158c7b8b84643f1ac3e97ee30addefe8bd))
|
7
|
+
|
1
8
|
# [1.31.0](https://github.com/advertikon/package-maxify-feed-common/compare/v1.30.2...v1.31.0) (2024-08-06)
|
2
9
|
|
3
10
|
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EACV,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EACrB,MAAM,2BAA2B,CAAC;AAInC;;;;GAIG;AACH,wBAAgB,oBAAoB,
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AACA,OAAO,EACH,UAAU,EACV,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,oBAAoB,EACpB,2BAA2B,EAC3B,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,kBAAkB,EACrB,MAAM,2BAA2B,CAAC;AAInC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,qBAAqB,EAAE,GAAG,MAA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oBAAoB,GAAG,oBAAoB,CAczF"}
|
package/dist/utils/profile.js
CHANGED
@@ -100,6 +100,10 @@ export function getOperatorCounterpart(operator) {
|
|
100
100
|
return RULES_OPERATORS.LESS_OR_EQUAL;
|
101
101
|
case RULES_OPERATORS.LESS_OR_EQUAL:
|
102
102
|
return RULES_OPERATORS.GREATER_OR_EQUAL;
|
103
|
+
case RULES_OPERATORS.EMPTY:
|
104
|
+
return RULES_OPERATORS.NOT_EMPTY;
|
105
|
+
case RULES_OPERATORS.NOT_EMPTY:
|
106
|
+
return RULES_OPERATORS.EMPTY;
|
103
107
|
default:
|
104
108
|
throw new Error(`Unknown operator ${String(operator)}`);
|
105
109
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/utils/profile.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAC3F,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,KAA8B;IAC/D,OAAO,KAAK;SACP,GAAG,CAAC,CAAC,CAAC,EAAE;QACL,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACvB,IACI,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,EAAE;gBAChB,CAAC,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS;gBAC9B,CAAC,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ;gBAC5B,CAAC,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,EACxB,C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;QAClC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;IACzB,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,OAA6B;IAC/D,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;QAC1B,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACpG,CAAC;IAED,OAAO,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC,EAAE;QAC/C,IAAI,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC;YAC1B,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACpG,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACnB,CAAC"}
|
package/package.json
CHANGED
package/src/utils/profile.ts
CHANGED
@@ -19,7 +19,7 @@ import { code } from './utils.js';
|
|
19
19
|
* @param rules
|
20
20
|
* @returns
|
21
21
|
*/
|
22
|
-
export function checkRuleDuplication
|
22
|
+
export function checkRuleDuplication(rules: ProductUploadRuleItem[]): string[] {
|
23
23
|
return rules
|
24
24
|
.map(r => {
|
25
25
|
for (const rule of rules) {
|
@@ -42,7 +42,7 @@ export function checkRuleDuplication (rules: ProductUploadRuleItem[]): string[]
|
|
42
42
|
* @param rules
|
43
43
|
* @returns
|
44
44
|
*/
|
45
|
-
export function checkRuleAlwaysness
|
45
|
+
export function checkRuleAlwaysness(rules: ProductUploadRuleItem[]): string[] {
|
46
46
|
return rules
|
47
47
|
.map(r => {
|
48
48
|
for (const rule of rules) {
|
@@ -60,7 +60,7 @@ export function checkRuleAlwaysness (rules: ProductUploadRuleItem[]): string[] {
|
|
60
60
|
* @param sections
|
61
61
|
* @returns
|
62
62
|
*/
|
63
|
-
export function checkRuleDeadlocks
|
63
|
+
export function checkRuleDeadlocks(input: ProductUploadRuleSection[]): string[] {
|
64
64
|
const totalList = [] as string[][];
|
65
65
|
const sections = structuredClone(input);
|
66
66
|
|
@@ -86,7 +86,7 @@ export function checkRuleDeadlocks (input: ProductUploadRuleSection[]): string[]
|
|
86
86
|
return sections.some(s => s.ruleItems.length === 0) ? totalList.flat() : [];
|
87
87
|
}
|
88
88
|
|
89
|
-
function isExclusive
|
89
|
+
function isExclusive(rule1: ProductUploadRuleItem, rule2: ProductUploadRuleItem): boolean {
|
90
90
|
return (
|
91
91
|
rule1.id !== rule2.id &&
|
92
92
|
rule1.attribute === rule2.attribute &&
|
@@ -95,7 +95,7 @@ function isExclusive (rule1: ProductUploadRuleItem, rule2: ProductUploadRuleItem
|
|
95
95
|
);
|
96
96
|
}
|
97
97
|
|
98
|
-
export function getOperatorCounterpart
|
98
|
+
export function getOperatorCounterpart(operator: keyof RuleOperatorsType): keyof RuleOperatorsType {
|
99
99
|
switch (operator) {
|
100
100
|
case RULES_OPERATORS.EQUALS:
|
101
101
|
return RULES_OPERATORS.NOT_EQUALS;
|
@@ -125,16 +125,20 @@ export function getOperatorCounterpart (operator: keyof RuleOperatorsType): keyo
|
|
125
125
|
return RULES_OPERATORS.LESS_OR_EQUAL;
|
126
126
|
case RULES_OPERATORS.LESS_OR_EQUAL:
|
127
127
|
return RULES_OPERATORS.GREATER_OR_EQUAL;
|
128
|
+
case RULES_OPERATORS.EMPTY:
|
129
|
+
return RULES_OPERATORS.NOT_EMPTY;
|
130
|
+
case RULES_OPERATORS.NOT_EMPTY:
|
131
|
+
return RULES_OPERATORS.EMPTY;
|
128
132
|
default:
|
129
133
|
throw new Error(`Unknown operator ${String(operator)}`);
|
130
134
|
}
|
131
135
|
}
|
132
136
|
|
133
|
-
export function getEmptyRuleItem
|
137
|
+
export function getEmptyRuleItem(attribute: ProductUploadRuleFilterType['value'] = ''): ProductUploadRuleItem {
|
134
138
|
return { attribute, operator: '', value: '', id: code() };
|
135
139
|
}
|
136
140
|
|
137
|
-
export function sortMappings
|
141
|
+
export function sortMappings(a: ProductUploadMapping, b: ProductUploadMapping): number {
|
138
142
|
if (!a.attribute) {
|
139
143
|
return 1;
|
140
144
|
}
|
@@ -165,7 +169,7 @@ export function sortMappings (a: ProductUploadMapping, b: ProductUploadMapping):
|
|
165
169
|
return 0;
|
166
170
|
}
|
167
171
|
|
168
|
-
export function hasRules
|
172
|
+
export function hasRules(rules: ProductUploadRules): boolean {
|
169
173
|
return Array.isArray(rules?.sections) && rules.sections.some(section => section.ruleItems.length > 0);
|
170
174
|
}
|
171
175
|
|
@@ -175,7 +179,7 @@ export function hasRules (rules: ProductUploadRules): boolean {
|
|
175
179
|
* @param b
|
176
180
|
* @returns
|
177
181
|
*/
|
178
|
-
export function compareRules
|
182
|
+
export function compareRules(
|
179
183
|
a: ProductUploadRules = { sections: [] },
|
180
184
|
b: ProductUploadRules = { sections: [] }
|
181
185
|
): boolean {
|
@@ -215,7 +219,7 @@ export function compareRules (
|
|
215
219
|
return matchedSections.length === a.sections.length;
|
216
220
|
}
|
217
221
|
|
218
|
-
function compareValues
|
222
|
+
function compareValues(a: any, b: any): boolean {
|
219
223
|
if (Array.isArray(a) && Array.isArray(b)) {
|
220
224
|
return a.length === b.length && a.every(i => b.includes(i));
|
221
225
|
}
|
@@ -223,7 +227,7 @@ function compareValues (a: any, b: any): boolean {
|
|
223
227
|
return a === b;
|
224
228
|
}
|
225
229
|
|
226
|
-
export function compareMappings
|
230
|
+
export function compareMappings(a: ProductUploadMapping[], b: ProductUploadMapping[]): boolean {
|
227
231
|
const matchedMappings = [] as number[];
|
228
232
|
|
229
233
|
if (a.length !== b.length) {
|
@@ -254,19 +258,19 @@ export function compareMappings (a: ProductUploadMapping[], b: ProductUploadMapp
|
|
254
258
|
return matchedMappings.length === a.length;
|
255
259
|
}
|
256
260
|
|
257
|
-
export function optionIsString
|
261
|
+
export function optionIsString(option: OptionType): option is string {
|
258
262
|
return typeof option === 'string';
|
259
263
|
}
|
260
264
|
|
261
|
-
export function optionIsItem
|
265
|
+
export function optionIsItem(option: OptionType): option is OptionTypeItem {
|
262
266
|
return typeof option !== 'string' && 'value' in option;
|
263
267
|
}
|
264
268
|
|
265
|
-
export function optionIsGroup
|
269
|
+
export function optionIsGroup(option: OptionType): option is OptionTypeGroup {
|
266
270
|
return typeof option !== 'string' && 'options' in option;
|
267
271
|
}
|
268
272
|
|
269
|
-
export function detectProfileChange
|
273
|
+
export function detectProfileChange(
|
270
274
|
a: ProductUploadProfile,
|
271
275
|
b: ProductUploadProfile
|
272
276
|
): { name: boolean; rules: boolean; mappings: boolean; id: boolean } {
|
@@ -305,7 +309,7 @@ export function detectProfileChange (
|
|
305
309
|
return changes;
|
306
310
|
}
|
307
311
|
|
308
|
-
export function sanitizeUploadProfile
|
312
|
+
export function sanitizeUploadProfile(profile: ProductUploadProfile): ProductUploadProfile {
|
309
313
|
if (profile.rules?.sections) {
|
310
314
|
profile.rules.sections = profile.rules.sections.filter(section => section.ruleItems.length > 0);
|
311
315
|
}
|