onroute-policy-engine 1.8.0 → 1.8.1

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.
@@ -1,4 +1,4 @@
1
- import { PolicyDefinition, PermitType, Commodity, VehicleType, SizeDimension, AxleConfiguration, BridgeCalculationResult, ConditionForPermit, TrailerType, PowerUnitType, TrailerWeightDimension, PowerUnitWeightDimension, WeightDimension, SingleAxleDimension } from 'onroute-policy-engine/types';
1
+ import { PolicyDefinition, PermitType, Commodity, VehicleType, SizeDimension, AxleConfiguration, BridgeCalculationResult, ConditionForPermit, TrailerType, PowerUnitType, TrailerWeightDimension, PowerUnitWeightDimension, WeightDimension, SingleAxleDimension, StandardTireSize } from 'onroute-policy-engine/types';
2
2
  import { Engine } from 'json-rules-engine';
3
3
  import { ValidationResults } from './validation-results';
4
4
  import { SpecialAuthorizations } from './types/special-authorizations';
@@ -227,4 +227,11 @@ export declare class Policy {
227
227
  * weights for the axle unit at the supplied axleIndex.
228
228
  */
229
229
  selectCorrectWeightDimension(weightDimensions: Array<WeightDimension>, configuration: Array<string>, axleConfiguration: Array<AxleConfiguration>, axleIndex: number): SingleAxleDimension | null;
230
+ /**
231
+ * Get the list of known standard tire sizes, used to populate
232
+ * dropdown lists in front-end interfaces.
233
+ * @returns List of known standard tire sizes, or empty array if
234
+ * none are configured
235
+ */
236
+ getStandardTireSizes(): Array<StandardTireSize>;
230
237
  }
@@ -682,5 +682,19 @@ class Policy {
682
682
  selectCorrectWeightDimension(weightDimensions, configuration, axleConfiguration, axleIndex) {
683
683
  return (0, dimensions_helper_1.selectCorrectWeightDimensionHelper)(this, weightDimensions, configuration, axleConfiguration, axleIndex);
684
684
  }
685
+ /**
686
+ * Get the list of known standard tire sizes, used to populate
687
+ * dropdown lists in front-end interfaces.
688
+ * @returns List of known standard tire sizes, or empty array if
689
+ * none are configured
690
+ */
691
+ getStandardTireSizes() {
692
+ if (this.policyDefinition.standardTireSizes) {
693
+ return this.policyDefinition.standardTireSizes;
694
+ }
695
+ else {
696
+ return new Array();
697
+ }
698
+ }
685
699
  }
686
700
  exports.Policy = Policy;
@@ -16,6 +16,7 @@ export { RegionSizeOverride } from './region-size-override';
16
16
  export { SelfIssuable } from './self-issuable';
17
17
  export { SizeDimension } from './size-dimension';
18
18
  export { SpecialAuthorizations } from './special-authorizations';
19
+ export { StandardTireSize } from './standard-tire-size';
19
20
  export { VehicleCategory, PowerUnitCategory, TrailerCategory, VehicleCategories, } from './vehicle-category';
20
21
  export { VehicleType, PowerUnitType, TrailerType, VehicleTypes, } from './vehicle-type';
21
22
  export { Vehicle, VehicleSizeConfiguration, TrailerSize, PowerUnitWeight, TrailerWeight, } from './vehicle';
@@ -1,4 +1,4 @@
1
- import { GeographicRegion, PermitType, DefaultWeightDimensions, VehicleTypes, Commodity, SizeDimension, VehicleCategories, RangeMatrix, BridgeCalculationConstants, PermitConditionDefinition } from 'onroute-policy-engine/types';
1
+ import { GeographicRegion, PermitType, DefaultWeightDimensions, VehicleTypes, Commodity, SizeDimension, VehicleCategories, RangeMatrix, BridgeCalculationConstants, PermitConditionDefinition, StandardTireSize } from 'onroute-policy-engine/types';
2
2
  import { RuleProperties } from 'json-rules-engine';
3
3
  export type PolicyDefinition = {
4
4
  minPEVersion: string;
@@ -13,4 +13,5 @@ export type PolicyDefinition = {
13
13
  rangeMatrices?: Array<RangeMatrix>;
14
14
  bridgeCalculationConstants: BridgeCalculationConstants;
15
15
  conditions?: Array<PermitConditionDefinition>;
16
+ standardTireSizes?: Array<StandardTireSize>;
16
17
  };
@@ -0,0 +1,4 @@
1
+ export type StandardTireSize = {
2
+ name: string;
3
+ size: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "v1.8.0";
1
+ export declare const version = "v1.8.1";
package/dist/version.js CHANGED
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // Generated by genversion.
5
- exports.version = 'v1.8.0';
5
+ exports.version = 'v1.8.1';
package/package.json CHANGED
@@ -89,5 +89,5 @@
89
89
  ],
90
90
  "testEnvironment": "node"
91
91
  },
92
- "version": "v1.8.0"
92
+ "version": "v1.8.1"
93
93
  }