@monkvision/network 4.4.4 → 4.4.5

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.4.3",
3
+ "version": "4.4.4",
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.4.3",
32
- "@monkvision/sights": "4.4.3",
31
+ "@monkvision/common": "4.4.4",
32
+ "@monkvision/sights": "4.4.4",
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.4.3",
46
- "@monkvision/eslint-config-typescript": "4.4.3",
47
- "@monkvision/jest-config": "4.4.3",
48
- "@monkvision/prettier-config": "4.4.3",
49
- "@monkvision/types": "4.4.3",
50
- "@monkvision/typescript-config": "4.4.3",
45
+ "@monkvision/eslint-config-base": "4.4.4",
46
+ "@monkvision/eslint-config-typescript": "4.4.4",
47
+ "@monkvision/jest-config": "4.4.4",
48
+ "@monkvision/prettier-config": "4.4.4",
49
+ "@monkvision/types": "4.4.4",
50
+ "@monkvision/typescript-config": "4.4.4",
51
51
  "@types/jest": "^29.2.2",
52
52
  "@types/jsonwebtoken": "^9.0.5",
53
53
  "@types/node": "^18.11.9",
@@ -160,9 +160,14 @@ function mapPricingV2(response) {
160
160
  if (!response.pricing) {
161
161
  return { pricings: pricings, pricingIds: pricingIds };
162
162
  }
163
- Object.values(response.pricing.details).forEach(function (details) {
164
- pricingIds.push(details.id);
165
- pricings.push(mapPricingV2Details(details, response.id));
163
+ Object.values(response.pricing).forEach(function (value) {
164
+ var pricing = value;
165
+ if (pricing) {
166
+ Object.values(pricing.details).forEach(function (details) {
167
+ pricingIds.push(details.id);
168
+ pricings.push(mapPricingV2Details(details, response.id));
169
+ });
170
+ }
166
171
  });
167
172
  return { pricings: pricings, pricingIds: pricingIds };
168
173
  }
@@ -438,6 +443,7 @@ function getPricingOptions(options) {
438
443
  status: types_1.ProgressStatus.TODO,
439
444
  output_format: (_a = taskOptions.outputFormat) !== null && _a !== void 0 ? _a : 'default',
440
445
  config: taskOptions.config,
446
+ methodology: taskOptions.methodology,
441
447
  }
442
448
  : undefined;
443
449
  }
@@ -11,10 +11,19 @@ export interface ApiPricingV2Details {
11
11
  related_item_type: ApiRelatedItemType;
12
12
  }
13
13
  export type ApiDetails = Record<string, ApiPricingV2Details>;
14
- export interface ApiPricingV2 {
14
+ export type ApiPricingMethodology = 'labor_cost' | 'flat_rate';
15
+ export interface PricingLaborCostGet {
16
+ details: ApiDetails;
17
+ total_price?: number;
18
+ }
19
+ export interface PricingFlatRateGet {
15
20
  details: ApiDetails;
16
21
  total_price?: number;
17
22
  }
23
+ export interface ApiPricingV2 {
24
+ labor_cost?: PricingLaborCostGet;
25
+ total_price?: PricingFlatRateGet;
26
+ }
18
27
  export interface ApiPricingPostPatch {
19
28
  pricing: number;
20
29
  related_item_type: PricingV2RelatedItemType;
@@ -1,3 +1,4 @@
1
+ import { ApiPricingMethodology } from './pricingV2';
1
2
  export type ApiBusinessClients = 'default' | 'toyota' | 'veb' | 'tesla';
2
3
  export interface ApiImageInTask {
3
4
  image_id: string;
@@ -74,6 +75,7 @@ export interface ApiPricingTaskPostComponent {
74
75
  callbacks?: ApiCallbacks;
75
76
  output_format?: ApiBusinessClients;
76
77
  config?: string;
78
+ methodology?: ApiPricingMethodology;
77
79
  }
78
80
  export interface ApiTasksComponent {
79
81
  damage_detection?: ApiDamageDetectionTaskPostComponent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "4.4.4",
3
+ "version": "4.4.5",
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.4.4",
32
- "@monkvision/sights": "4.4.4",
31
+ "@monkvision/common": "4.4.5",
32
+ "@monkvision/sights": "4.4.5",
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.4.4",
46
- "@monkvision/eslint-config-typescript": "4.4.4",
47
- "@monkvision/jest-config": "4.4.4",
48
- "@monkvision/prettier-config": "4.4.4",
49
- "@monkvision/types": "4.4.4",
50
- "@monkvision/typescript-config": "4.4.4",
45
+ "@monkvision/eslint-config-base": "4.4.5",
46
+ "@monkvision/eslint-config-typescript": "4.4.5",
47
+ "@monkvision/jest-config": "4.4.5",
48
+ "@monkvision/prettier-config": "4.4.5",
49
+ "@monkvision/types": "4.4.5",
50
+ "@monkvision/typescript-config": "4.4.5",
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": "7abfa7fbb0b482a6dd916c92cfc994f2b4e74257"
87
+ "gitHead": "06828436c12ee0507d0b7316b657674193bc7975"
88
88
  }