onroute-policy-engine 2.1.1 → 2.2.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.
Files changed (80) hide show
  1. package/dist/enum/custom-operator.d.ts +6 -0
  2. package/dist/enum/custom-operator.js +10 -0
  3. package/dist/enum/facts.d.ts +8 -4
  4. package/dist/enum/facts.js +8 -4
  5. package/dist/enum/index.d.ts +2 -0
  6. package/dist/enum/index.js +6 -1
  7. package/dist/enum/permit-app-info.d.ts +8 -5
  8. package/dist/enum/permit-app-info.js +8 -5
  9. package/dist/enum/policy-check.d.ts +11 -0
  10. package/dist/enum/policy-check.js +16 -0
  11. package/dist/enum/validation-result-code.d.ts +1 -0
  12. package/dist/enum/validation-result-code.js +1 -0
  13. package/dist/helper/dimensions.helper.js +7 -3
  14. package/dist/helper/facts.helper.js +64 -0
  15. package/dist/helper/policy-check.helper.d.ts +183 -0
  16. package/dist/helper/policy-check.helper.js +337 -0
  17. package/dist/helper/vehicles.helper.d.ts +45 -1
  18. package/dist/helper/vehicles.helper.js +61 -0
  19. package/dist/policy-engine.d.ts +70 -1
  20. package/dist/policy-engine.js +78 -0
  21. package/dist/rule-operator/custom-operators.d.ts +7 -0
  22. package/dist/rule-operator/custom-operators.js +57 -3
  23. package/dist/types/axle-calculation-results.d.ts +49 -0
  24. package/dist/types/axle-calculation-results.js +8 -0
  25. package/dist/types/axle-configuration.d.ts +12 -0
  26. package/dist/types/axle-configuration.js +6 -0
  27. package/dist/types/bridge-calculation-constants.d.ts +8 -0
  28. package/dist/types/bridge-calculation-result.d.ts +11 -0
  29. package/dist/types/commodity.d.ts +10 -0
  30. package/dist/types/commodity.js +6 -0
  31. package/dist/types/cost-rule.d.ts +8 -0
  32. package/dist/types/cost-rule.js +6 -0
  33. package/dist/types/dimension-modifier.d.ts +27 -0
  34. package/dist/types/dimension-modifier.js +6 -0
  35. package/dist/types/display-code-defaults.d.ts +22 -0
  36. package/dist/types/display-code-defaults.js +6 -0
  37. package/dist/types/facts.d.ts +14 -0
  38. package/dist/types/facts.js +6 -0
  39. package/dist/types/geographic-region.d.ts +10 -0
  40. package/dist/types/geographic-region.js +6 -0
  41. package/dist/types/identified-object.d.ts +8 -0
  42. package/dist/types/identified-object.js +6 -0
  43. package/dist/types/index.d.ts +1 -0
  44. package/dist/types/permit-application.d.ts +109 -0
  45. package/dist/types/permit-application.js +6 -0
  46. package/dist/types/permit-condition.d.ts +18 -0
  47. package/dist/types/permit-condition.js +6 -0
  48. package/dist/types/permit-type.d.ts +18 -0
  49. package/dist/types/permit-type.js +6 -0
  50. package/dist/types/policy-definition.d.ts +24 -0
  51. package/dist/types/policy-definition.js +7 -0
  52. package/dist/types/range-matrix.d.ts +17 -0
  53. package/dist/types/range-matrix.js +6 -0
  54. package/dist/types/region-size-override.d.ts +10 -0
  55. package/dist/types/region-size-override.js +6 -0
  56. package/dist/types/self-issuable.d.ts +7 -0
  57. package/dist/types/self-issuable.js +6 -0
  58. package/dist/types/size-dimension.d.ts +17 -0
  59. package/dist/types/size-dimension.js +6 -0
  60. package/dist/types/special-authorizations.d.ts +9 -0
  61. package/dist/types/special-authorizations.js +6 -0
  62. package/dist/types/standard-tire-size.d.ts +8 -0
  63. package/dist/types/standard-tire-size.js +6 -0
  64. package/dist/types/vehicle-category.d.ts +27 -0
  65. package/dist/types/vehicle-category.js +6 -0
  66. package/dist/types/vehicle-type.d.ts +36 -0
  67. package/dist/types/vehicle-type.js +6 -0
  68. package/dist/types/vehicle.d.ts +27 -0
  69. package/dist/types/vehicle.js +6 -0
  70. package/dist/types/weight-dimension.d.ts +34 -0
  71. package/dist/types/weight-dimension.js +6 -0
  72. package/dist/validation-result.d.ts +1 -0
  73. package/dist/validation-results.js +2 -1
  74. package/dist/version.d.ts +1 -1
  75. package/dist/version.js +1 -1
  76. package/package.json +2 -1
  77. package/.github/workflows/analysis.yml +0 -68
  78. package/.github/workflows/pipeline.yml +0 -60
  79. package/.vscode/launch.json +0 -21
  80. package/eslint.config.mjs +0 -46
@@ -1,68 +0,0 @@
1
- name: Analysis
2
-
3
- on:
4
- pull_request:
5
- types: [opened, reopened, synchronize, ready_for_review, converted_to_draft]
6
-
7
- concurrency:
8
- group: ${{ github.workflow }}-${{ github.ref }}
9
- cancel-in-progress: true
10
-
11
- jobs:
12
- validate:
13
- name: Validate PR
14
- if: (! github.event.pull_request.draft)
15
- uses: bcgov/quickstart-openshift-helpers/.github/workflows/.pr-validate.yml@v0.8.1
16
-
17
- lint:
18
- name: lint
19
- if: (! github.event.pull_request.draft)
20
- runs-on: ubuntu-24.04 # Runs on the latest version of Ubuntu
21
- steps:
22
- - name: Checkout code
23
- uses: actions/checkout@v4 # Checks out the code from the repository
24
-
25
- - name: Set up Node.js
26
- uses: actions/setup-node@v4
27
- with:
28
- node-version: '20.x'
29
-
30
- - name: Install dependencies
31
- run: npm install # Installs project dependencies
32
-
33
- - name: Lint code
34
- run: npx eslint "{src,apps,libs,test}/**/*.ts" # Run ESLint with the specified config
35
-
36
-
37
- # https://github.com/marketplace/actions/aqua-security-trivy
38
- trivy:
39
- name: Trivy Security Scan
40
- if: (! github.event.pull_request.draft)
41
- runs-on: ubuntu-22.04
42
- timeout-minutes: 1
43
- steps:
44
- - uses: actions/checkout@v4
45
- - name: Run Trivy vulnerability scanner in repo mode
46
- uses: aquasecurity/trivy-action@0.24.0
47
- with:
48
- format: "sarif"
49
- output: "trivy-results.sarif"
50
- ignore-unfixed: true
51
- scan-type: "fs"
52
- scanners: "vuln,secret,config"
53
- severity: "CRITICAL,HIGH"
54
-
55
- - name: Upload Trivy scan results to GitHub Security tab
56
- uses: github/codeql-action/upload-sarif@v3
57
- with:
58
- sarif_file: "trivy-results.sarif"
59
-
60
- results:
61
- name: Analysis Results
62
- needs: [validate, lint, trivy]
63
- if: always()
64
- runs-on: ubuntu-22.04
65
- steps:
66
- - if: contains(needs.*.result, 'failure')||contains(needs.*.result, 'canceled')
67
- run: echo "At least one job has failed." && exit 1
68
- - run: echo "Success!"
@@ -1,60 +0,0 @@
1
- ---
2
- name: CI/CD Pipleine For Simple Package Publishing
3
- on:
4
- push:
5
- branches: [main]
6
- workflow_dispatch:
7
- jobs:
8
- build:
9
- runs-on: ubuntu-24.04
10
- permissions:
11
- contents: write
12
- packages: write
13
- steps:
14
- - uses: actions/checkout@v4
15
- deploy:
16
- runs-on: ubuntu-24.04
17
- permissions:
18
- id-token: write # needed for provenance data generation
19
- contents: write
20
- packages: write
21
-
22
- steps:
23
- - name: Checkout Code
24
- uses: actions/checkout@v4
25
-
26
- - name: Get Next Version
27
- id: semver
28
- uses: ietf-tools/semver-action@v1
29
- with:
30
- token: ${{ github.token }}
31
- branch: main
32
-
33
- - name: Injecting Semver Into Package.json
34
- run: |
35
- cat package.json | jq '. + { "version": "${{ steps.semver.outputs.next }}" }' | tee package.json
36
-
37
- - uses: actions/setup-node@v4
38
- with:
39
- node-version: '20.x'
40
- registry-url: 'https://registry.npmjs.org'
41
-
42
- - run: npm ci
43
- - run: npm install genversion --save-dev
44
- - run: npx genversion -e src/version.ts
45
- - run: tsc
46
- - run: npm test
47
-
48
- - name: Publish Package
49
- run: npm publish --provenance --access public
50
- env:
51
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52
-
53
- - name: Create Release
54
- env:
55
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56
- run: |
57
- gh release create "${{ steps.semver.outputs.next }}" \
58
- --repo="${{ github.repository }}" \
59
- --title="${{ steps.semver.outputs.next }}" \
60
- --generate-notes
@@ -1,21 +0,0 @@
1
- {
2
- // Use IntelliSense to learn about possible attributes.
3
- // Hover to view descriptions of existing attributes.
4
- // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
- "version": "0.2.0",
6
- "configurations": [
7
-
8
- {
9
- "type": "node",
10
- "request": "launch",
11
- "name": "Debug Jest Test",
12
- "program": "${workspaceFolder}/node_modules/jest/bin/jest.js",
13
- "args": [
14
- "--runInBand"
15
- ],
16
- "console": "integratedTerminal",
17
- "internalConsoleOptions": "neverOpen",
18
- "cwd": "${workspaceFolder}"
19
- }
20
- ]
21
- }
package/eslint.config.mjs DELETED
@@ -1,46 +0,0 @@
1
- import typescriptEslint from "@typescript-eslint/eslint-plugin";
2
- import globals from "globals";
3
- import tsParser from "@typescript-eslint/parser";
4
- import path from "node:path";
5
- import { fileURLToPath } from "node:url";
6
- import js from "@eslint/js";
7
- import { FlatCompat } from "@eslint/eslintrc";
8
-
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
- const compat = new FlatCompat({
12
- baseDirectory: __dirname,
13
- recommendedConfig: js.configs.recommended,
14
- allConfig: js.configs.all
15
- });
16
-
17
- export default [{
18
- ignores: ["**/.eslintrc.cjs", "**/node_modules/", "**/dist/", "**/.eslintrc.cjs,", "src/_examples/usage"],
19
- }, ...compat.extends("eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"), {
20
- plugins: {
21
- "@typescript-eslint": typescriptEslint,
22
- },
23
-
24
- languageOptions: {
25
- globals: {
26
- ...globals.node,
27
- ...globals.jest,
28
- },
29
-
30
- parser: tsParser,
31
- ecmaVersion: 5,
32
- sourceType: "module",
33
-
34
- parserOptions: {
35
- project: ["./tsconfig.json"],
36
- tsconfigRootDir: __dirname,
37
- },
38
- },
39
-
40
- rules: {
41
- "@typescript-eslint/no-explicit-any": "off",
42
- },
43
- },
44
- {
45
- ignores: ["node_modules/*", "dist/*"]
46
- }];