@monkvision/network 5.0.6 → 5.0.7

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/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "5.0.5",
3
+ "version": "5.0.6",
4
4
  "license": "BSD-3-Clause-Clear",
5
5
  "packageManager": "yarn@3.2.4",
6
6
  "description": "MonkJs core package used to communicate with the API",
@@ -28,8 +28,8 @@
28
28
  "lint:fix": "yarn run prettier:fix && yarn run eslint:fix"
29
29
  },
30
30
  "dependencies": {
31
- "@monkvision/common": "5.0.5",
32
- "@monkvision/sights": "5.0.5",
31
+ "@monkvision/common": "5.0.6",
32
+ "@monkvision/sights": "5.0.6",
33
33
  "jsonwebtoken": "^9.0.2",
34
34
  "jwt-decode": "^4.0.0",
35
35
  "ky": "^1.2.0",
@@ -42,12 +42,12 @@
42
42
  "react-router-dom": "^6.22.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@monkvision/eslint-config-base": "5.0.5",
46
- "@monkvision/eslint-config-typescript": "5.0.5",
47
- "@monkvision/jest-config": "5.0.5",
48
- "@monkvision/prettier-config": "5.0.5",
49
- "@monkvision/types": "5.0.5",
50
- "@monkvision/typescript-config": "5.0.5",
45
+ "@monkvision/eslint-config-base": "5.0.6",
46
+ "@monkvision/eslint-config-typescript": "5.0.6",
47
+ "@monkvision/jest-config": "5.0.6",
48
+ "@monkvision/prettier-config": "5.0.6",
49
+ "@monkvision/types": "5.0.6",
50
+ "@monkvision/typescript-config": "5.0.6",
51
51
  "@types/jest": "^29.2.2",
52
52
  "@types/jsonwebtoken": "^9.0.5",
53
53
  "@types/node": "^18.11.9",
@@ -123,9 +123,9 @@ function mapCompliance(sightId, complianceResult, complianceOptions) {
123
123
  };
124
124
  }
125
125
  function mapApiImage(image, inspectionId, thumbnailDomain, complianceOptions) {
126
- var _a, _b, _c;
126
+ var _a, _b, _c, _d, _e;
127
127
  var sightId = (_a = image.additional_data) === null || _a === void 0 ? void 0 : _a.sight_id;
128
- var _d = mapCompliance(sightId, image.compliances, complianceOptions), status = _d.status, complianceIssues = _d.complianceIssues;
128
+ var _f = mapCompliance(sightId, image.compliances, complianceOptions), status = _f.status, complianceIssues = _f.complianceIssues;
129
129
  return {
130
130
  id: image.id,
131
131
  entityType: types_1.MonkEntityType.IMAGE,
@@ -160,6 +160,8 @@ function mapApiImage(image, inspectionId, thumbnailDomain, complianceOptions) {
160
160
  additionalData: image.additional_data,
161
161
  renderedOutputs: [],
162
162
  views: [],
163
+ odometer: (_d = image.odometer) === null || _d === void 0 ? void 0 : _d.value,
164
+ warningLights: (_e = image.warning_lights) === null || _e === void 0 ? void 0 : _e.activated_warning_lights,
163
165
  };
164
166
  }
165
167
  exports.mapApiImage = mapApiImage;
@@ -148,7 +148,13 @@ function createBeautyShotImageData(options, filetype) {
148
148
  var _a, _b;
149
149
  var filename = "".concat(options.sightId, "-").concat(options.inspectionId, "-").concat(Date.now(), ".").concat(filetype);
150
150
  var tasks = options.tasks.filter(function (task) {
151
- return ![types_1.TaskName.COMPLIANCES, types_1.TaskName.HUMAN_IN_THE_LOOP, types_1.TaskName.IMAGES_OCR].includes(task);
151
+ return ![
152
+ types_1.TaskName.COMPLIANCES,
153
+ types_1.TaskName.HUMAN_IN_THE_LOOP,
154
+ types_1.TaskName.IMAGES_OCR,
155
+ types_1.TaskName.ODOMETER,
156
+ types_1.TaskName.WARNING_LIGHTS,
157
+ ].includes(task);
152
158
  });
153
159
  tasks.push({
154
160
  name: types_1.TaskName.COMPLIANCES,
@@ -167,6 +173,18 @@ function createBeautyShotImageData(options, filetype) {
167
173
  image_details: { image_type: 'VIN' },
168
174
  });
169
175
  }
176
+ if (options.tasks.includes(types_1.TaskName.ODOMETER)) {
177
+ tasks.push({
178
+ name: types_1.TaskName.ODOMETER,
179
+ wait_for_result: true,
180
+ });
181
+ }
182
+ if (options.tasks.includes(types_1.TaskName.WARNING_LIGHTS)) {
183
+ tasks.push({
184
+ name: types_1.TaskName.WARNING_LIGHTS,
185
+ wait_for_result: true,
186
+ });
187
+ }
170
188
  var body = {
171
189
  acquisition: {
172
190
  strategy: 'upload_multipart_form_keys',
@@ -448,6 +448,20 @@ function getPricingOptions(options) {
448
448
  }
449
449
  : undefined;
450
450
  }
451
+ function getOdometerOptions(options) {
452
+ return options.tasks.includes(types_1.TaskName.ODOMETER)
453
+ ? {
454
+ status: types_1.ProgressStatus.NOT_STARTED,
455
+ }
456
+ : undefined;
457
+ }
458
+ function getWarningLightsOptions(options) {
459
+ return options.tasks.includes(types_1.TaskName.WARNING_LIGHTS)
460
+ ? {
461
+ status: types_1.ProgressStatus.NOT_STARTED,
462
+ }
463
+ : undefined;
464
+ }
451
465
  function getTasksOptions(options) {
452
466
  return {
453
467
  damage_detection: getDamageDetectionOptions(options),
@@ -455,6 +469,8 @@ function getTasksOptions(options) {
455
469
  images_ocr: getImagesOCROptions(options),
456
470
  human_in_the_loop: getHumanInTheLoopOptions(options),
457
471
  pricing: getPricingOptions(options),
472
+ odometer: getOdometerOptions(options),
473
+ warning_lights: getWarningLightsOptions(options),
458
474
  };
459
475
  }
460
476
  function mapApiInspectionPost(options) {
@@ -1,9 +1,9 @@
1
- import { TranslationObject } from '@monkvision/types';
1
+ import { MileageUnit, TranslationObject, WarningLights } from '@monkvision/types';
2
2
  import type { ApiAdditionalData, ApiCenterOnElement, ApiLabelPrediction } from './common';
3
3
  import type { ApiRenderedOutputs } from './renderedOutput';
4
4
  import type { ApiImageComplianceResults } from './compliance';
5
5
  import type { ApiViews } from './view';
6
- import { ApiBusinessTaskName, ApiHinlTaskPost, ApiImageCompliancesTaskPost, ApiImagesOCRTaskPost } from './task';
6
+ import { ApiBusinessTaskName, ApiHinlTaskPost, ApiImageCompliancesTaskPost, ApiImagesOCRTaskPost, ApiImagesOdometerTaskPost, ApiImagesWarningLightsTaskPost } from './task';
7
7
  export type ApiImageType = 'unknown' | 'beauty_shot' | 'close_up';
8
8
  export type ApiImageSubType = 'close_up_part' | 'close_up_damage';
9
9
  export interface ApiRelatedImage {
@@ -23,6 +23,18 @@ export interface ApiImageAdditionalData extends ApiAdditionalData {
23
23
  sight_id?: string;
24
24
  label?: TranslationObject;
25
25
  }
26
+ export interface ApiImageOdometer {
27
+ unit?: MileageUnit;
28
+ value?: number;
29
+ confidence_score?: number;
30
+ error?: string;
31
+ rotation?: string;
32
+ visualization_url?: string;
33
+ }
34
+ export interface ApiImageWarningLights {
35
+ activated_warning_lights: WarningLights[];
36
+ light_to_score: Record<WarningLights, number>;
37
+ }
26
38
  export interface ApiImage {
27
39
  additional_data?: ApiImageAdditionalData;
28
40
  binary_size: number;
@@ -39,6 +51,8 @@ export interface ApiImage {
39
51
  name?: string;
40
52
  path: string;
41
53
  viewpoint?: ApiLabelPrediction;
54
+ odometer?: ApiImageOdometer;
55
+ warning_lights?: ApiImageWarningLights;
42
56
  }
43
57
  export interface ApiImageWithViews extends ApiImage {
44
58
  rendered_outputs?: ApiRenderedOutputs;
@@ -63,7 +77,7 @@ export interface ApiCompliance {
63
77
  coverage_360?: ApiCoverage360Parameters;
64
78
  zoom_level?: ApiComplianceParameters;
65
79
  }
66
- export type ApiImagePostTask = Omit<ApiBusinessTaskName, 'repair_estimate' | 'images_ocr' | 'image_editing' | 'inspection_pdf' | 'pricing' | 'zoom_level' | 'coverage_360' | 'iqa_compliance' | 'human_in_the_loop'> | ApiImageCompliancesTaskPost | ApiHinlTaskPost | ApiImagesOCRTaskPost;
80
+ export type ApiImagePostTask = Extract<ApiBusinessTaskName, 'damage_detection' | 'wheel_analysis' | 'dashboard_ocr' | 'compliances'> | ApiImageCompliancesTaskPost | ApiHinlTaskPost | ApiImagesOCRTaskPost | ApiImagesOdometerTaskPost | ApiImagesWarningLightsTaskPost;
67
81
  export interface ApiImagePost {
68
82
  acquisition: ApiAcquisition;
69
83
  tasks?: ApiImagePostTask[];
@@ -25,6 +25,14 @@ export interface ApiImagesOCRTaskPost {
25
25
  name: 'images_ocr';
26
26
  image_details: ApiImagesOCRImageDetails;
27
27
  }
28
+ export interface ApiImagesOdometerTaskPost {
29
+ name: 'odometer';
30
+ wait_for_result?: boolean;
31
+ }
32
+ export interface ApiImagesWarningLightsTaskPost {
33
+ name: 'warning_lights';
34
+ wait_for_result?: boolean;
35
+ }
28
36
  export type ApiTaskProgressStatus = 'NOT_STARTED' | 'TODO' | 'IN_PROGRESS' | 'DONE' | 'ERROR' | 'ABORTED' | 'VALIDATED';
29
37
  export interface ApiTaskGet {
30
38
  id: string;
@@ -83,10 +91,18 @@ export interface ApiPricingTaskPostComponent {
83
91
  config?: string;
84
92
  methodology?: ApiPricingMethodology;
85
93
  }
94
+ export interface ApiOdometerTaskPostComponent {
95
+ status?: ApiTaskPostProgressStatus;
96
+ }
97
+ export interface ApiWarningLightsTaskPostComponent {
98
+ status?: ApiTaskPostProgressStatus;
99
+ }
86
100
  export interface ApiTasksComponent {
87
101
  damage_detection?: ApiDamageDetectionTaskPostComponent;
88
102
  wheel_analysis?: ApiWheelAnalysisTaskPostComponent;
89
103
  images_ocr?: ApiImagesOCRTaskPostComponent;
90
104
  human_in_the_loop?: ApiHinlTaskPostComponent;
91
105
  pricing?: ApiPricingTaskPostComponent;
106
+ odometer?: ApiOdometerTaskPostComponent;
107
+ warning_lights?: ApiWarningLightsTaskPostComponent;
92
108
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "5.0.6",
3
+ "version": "5.0.7",
4
4
  "license": "BSD-3-Clause-Clear",
5
5
  "packageManager": "yarn@3.2.4",
6
6
  "description": "MonkJs core package used to communicate with the API",
@@ -28,8 +28,8 @@
28
28
  "lint:fix": "yarn run prettier:fix && yarn run eslint:fix"
29
29
  },
30
30
  "dependencies": {
31
- "@monkvision/common": "5.0.6",
32
- "@monkvision/sights": "5.0.6",
31
+ "@monkvision/common": "5.0.7",
32
+ "@monkvision/sights": "5.0.7",
33
33
  "jsonwebtoken": "^9.0.2",
34
34
  "jwt-decode": "^4.0.0",
35
35
  "ky": "^1.2.0",
@@ -42,12 +42,12 @@
42
42
  "react-router-dom": "^6.22.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@monkvision/eslint-config-base": "5.0.6",
46
- "@monkvision/eslint-config-typescript": "5.0.6",
47
- "@monkvision/jest-config": "5.0.6",
48
- "@monkvision/prettier-config": "5.0.6",
49
- "@monkvision/types": "5.0.6",
50
- "@monkvision/typescript-config": "5.0.6",
45
+ "@monkvision/eslint-config-base": "5.0.7",
46
+ "@monkvision/eslint-config-typescript": "5.0.7",
47
+ "@monkvision/jest-config": "5.0.7",
48
+ "@monkvision/prettier-config": "5.0.7",
49
+ "@monkvision/types": "5.0.7",
50
+ "@monkvision/typescript-config": "5.0.7",
51
51
  "@types/jest": "^29.2.2",
52
52
  "@types/jsonwebtoken": "^9.0.5",
53
53
  "@types/node": "^18.11.9",
@@ -84,5 +84,5 @@
84
84
  "url": "https://github.com/monkvision/monkjs/issues"
85
85
  },
86
86
  "homepage": "https://github.com/monkvision/monkjs",
87
- "gitHead": "ce8fde13e8e69c1805f8475f10e604614be084cf"
87
+ "gitHead": "cc203a32128aa4878cd3a745ab4f89d3fd314038"
88
88
  }