@monkvision/network 4.2.9 → 4.3.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.
package/lib/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "4.2.8",
3
+ "version": "4.3.0",
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": "4.2.8",
32
- "@monkvision/sights": "4.2.8",
31
+ "@monkvision/common": "4.3.0",
32
+ "@monkvision/sights": "4.3.0",
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": "4.2.8",
46
- "@monkvision/eslint-config-typescript": "4.2.8",
47
- "@monkvision/jest-config": "4.2.8",
48
- "@monkvision/prettier-config": "4.2.8",
49
- "@monkvision/types": "4.2.8",
50
- "@monkvision/typescript-config": "4.2.8",
45
+ "@monkvision/eslint-config-base": "4.3.0",
46
+ "@monkvision/eslint-config-typescript": "4.3.0",
47
+ "@monkvision/jest-config": "4.3.0",
48
+ "@monkvision/prettier-config": "4.3.0",
49
+ "@monkvision/types": "4.3.0",
50
+ "@monkvision/typescript-config": "4.3.0",
51
51
  "@types/jest": "^29.2.2",
52
52
  "@types/jsonwebtoken": "^9.0.5",
53
53
  "@types/node": "^18.11.9",
@@ -367,12 +367,30 @@ function getImagesOCROptions(options) {
367
367
  }
368
368
  : undefined;
369
369
  }
370
+ function getPricingOptions(options) {
371
+ var _a;
372
+ if (options.tasks.includes(types_1.TaskName.PRICING)) {
373
+ return {
374
+ status: types_1.ProgressStatus.TODO,
375
+ output_format: 'default',
376
+ };
377
+ }
378
+ var taskOptions = options.tasks.find(function (task) { return typeof task === 'object' && task.name === types_1.TaskName.PRICING; });
379
+ return taskOptions
380
+ ? {
381
+ status: types_1.ProgressStatus.TODO,
382
+ output_format: (_a = taskOptions.outputFormat) !== null && _a !== void 0 ? _a : 'default',
383
+ config: taskOptions.config,
384
+ }
385
+ : undefined;
386
+ }
370
387
  function getTasksOptions(options) {
371
388
  return {
372
389
  damage_detection: getDamageDetectionOptions(options),
373
390
  wheel_analysis: getWheelAnalysisOptions(options),
374
391
  images_ocr: getImagesOCROptions(options),
375
392
  human_in_the_loop: getHumanInTheLoopOptions(options),
393
+ pricing: getPricingOptions(options),
376
394
  };
377
395
  }
378
396
  function mapApiInspectionPost(options) {
@@ -412,8 +430,7 @@ function mapApiInspectionPost(options) {
412
430
  additional_data: options.vehicle.additionalData,
413
431
  }
414
432
  : undefined,
415
- damage_severity: { output_format: 'default' },
416
- pricing: options.usePricingV2 ? { output_format: 'default' } : undefined,
433
+ damage_severity: { output_format: 'toyota' },
417
434
  additional_data: __assign({ user_agent: navigator.userAgent, connection: navigator.connection, monk_sdk_version: config_1.sdkVersion, damage_detection_version: 'v2', use_dynamic_crops: (_a = options.useDynamicCrops) !== null && _a !== void 0 ? _a : true, is_video_capture: (_b = options.isVideoCapture) !== null && _b !== void 0 ? _b : false }, options.additionalData),
418
435
  };
419
436
  }
@@ -4,7 +4,7 @@ import type { ApiImagePost, ApiImages } from './image';
4
4
  import type { ApiParts } from './part';
5
5
  import type { ApiPricingV2 } from './pricingV2';
6
6
  import type { ApiSeverityResults } from './severityResult';
7
- import type { ApiTasks } from './task';
7
+ import type { ApiBusinessClients, ApiTasks } from './task';
8
8
  import type { ApiVehicleComponent } from './vehicle';
9
9
  import type { ApiWheelAnalysis } from './wheelAnalysis';
10
10
  import { ApiVehiclePostPatch } from './vehicle';
@@ -26,7 +26,6 @@ export interface ApiInspectionGet {
26
26
  vehicle?: ApiVehicleComponent;
27
27
  wheel_analysis?: ApiWheelAnalysis;
28
28
  }
29
- export type ApiBusinessClients = 'default' | 'toyota' | 'veb';
30
29
  export interface ApiDamageSeverity {
31
30
  output_format: ApiBusinessClients;
32
31
  }
@@ -36,5 +35,4 @@ export interface ApiInspectionPost {
36
35
  images?: ApiImagePost[];
37
36
  vehicle?: ApiVehiclePostPatch;
38
37
  damage_severity?: ApiDamageSeverity;
39
- pricing?: ApiDamageSeverity;
40
38
  }
@@ -1,3 +1,4 @@
1
+ export type ApiBusinessClients = 'default' | 'toyota' | 'veb' | 'tesla';
1
2
  export interface ApiImageInTask {
2
3
  image_id: string;
3
4
  }
@@ -68,9 +69,16 @@ export interface ApiHinlTaskPostComponent {
68
69
  status?: ApiTaskPostProgressStatus;
69
70
  callbacks?: ApiCallbacks;
70
71
  }
72
+ export interface ApiPricingTaskPostComponent {
73
+ status?: ApiTaskPostProgressStatus;
74
+ callbacks?: ApiCallbacks;
75
+ output_format?: ApiBusinessClients;
76
+ config?: string;
77
+ }
71
78
  export interface ApiTasksComponent {
72
79
  damage_detection?: ApiDamageDetectionTaskPostComponent;
73
80
  wheel_analysis?: ApiWheelAnalysisTaskPostComponent;
74
81
  images_ocr?: ApiImagesOCRTaskPostComponent;
75
82
  human_in_the_loop?: ApiHinlTaskPostComponent;
83
+ pricing?: ApiPricingTaskPostComponent;
76
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "4.2.9",
3
+ "version": "4.3.1",
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": "4.2.9",
32
- "@monkvision/sights": "4.2.9",
31
+ "@monkvision/common": "4.3.1",
32
+ "@monkvision/sights": "4.3.1",
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": "4.2.9",
46
- "@monkvision/eslint-config-typescript": "4.2.9",
47
- "@monkvision/jest-config": "4.2.9",
48
- "@monkvision/prettier-config": "4.2.9",
49
- "@monkvision/types": "4.2.9",
50
- "@monkvision/typescript-config": "4.2.9",
45
+ "@monkvision/eslint-config-base": "4.3.1",
46
+ "@monkvision/eslint-config-typescript": "4.3.1",
47
+ "@monkvision/jest-config": "4.3.1",
48
+ "@monkvision/prettier-config": "4.3.1",
49
+ "@monkvision/types": "4.3.1",
50
+ "@monkvision/typescript-config": "4.3.1",
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": "7454a8e35d2722a1c88c65d5aea1a302d559b161"
87
+ "gitHead": "64ca3fd02f17c661e49184ccaf45a9e66fdd5610"
88
88
  }