onroute-policy-engine 1.8.1 → 1.8.2
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/dist/policy-engine.d.ts +1 -1
- package/dist/policy-engine.js +13 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/policy-engine.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export declare class Policy {
|
|
|
27
27
|
* and permittable vehicles for permit types.
|
|
28
28
|
* @param authorizations Special authorizations for a client
|
|
29
29
|
*/
|
|
30
|
-
setSpecialAuthorizations(authorizations
|
|
30
|
+
setSpecialAuthorizations(authorizations?: SpecialAuthorizations | null): void;
|
|
31
31
|
/**
|
|
32
32
|
* Validates a permit application against the policy definition.
|
|
33
33
|
* @param permit The permit application to validate against policy
|
package/dist/policy-engine.js
CHANGED
|
@@ -40,7 +40,7 @@ class Policy {
|
|
|
40
40
|
throw new Error(`Current policy config minimum version is at least one major version behind policy engine: major(${definition.minPEVersion}) < major(${version_1.version}))`);
|
|
41
41
|
}
|
|
42
42
|
this.policyDefinition = definition;
|
|
43
|
-
this.
|
|
43
|
+
this.setSpecialAuthorizations(authorizations);
|
|
44
44
|
this.rulesEngines = (0, rules_engine_helper_1.getRulesEngines)(this);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
@@ -162,8 +162,18 @@ class Policy {
|
|
|
162
162
|
}
|
|
163
163
|
return false;
|
|
164
164
|
}));
|
|
165
|
-
//
|
|
166
|
-
|
|
165
|
+
// Commodities for overweight permits are those which have at least one
|
|
166
|
+
// power unit defined in the weight dimension object of the commodity.
|
|
167
|
+
const commoditiesForOW = (0, lists_helper_1.extractIdentifiedObjects)(this.policyDefinition.commodities.filter((c) => {
|
|
168
|
+
if (c.weight) {
|
|
169
|
+
if (c.weight.powerUnits) {
|
|
170
|
+
if (c.weight.powerUnits.length > 0) {
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return false;
|
|
176
|
+
}));
|
|
167
177
|
if (permitType.sizeDimensionRequired &&
|
|
168
178
|
permitType.weightDimensionRequired) {
|
|
169
179
|
return (0, lists_helper_1.intersectIdMaps)(commoditiesForOS, commoditiesForOW);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "v1.8.
|
|
1
|
+
export declare const version = "v1.8.2";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED