@monkvision/network 5.3.2 → 5.3.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": "5.3.1",
3
+ "version": "5.3.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": "5.3.1",
32
- "@monkvision/sights": "5.3.1",
31
+ "@monkvision/common": "5.3.4",
32
+ "@monkvision/sights": "5.3.4",
33
33
  "jsonwebtoken": "^9.0.2",
34
34
  "jwt-decode": "^4.0.0",
35
35
  "ky": "^1.2.0",
@@ -43,12 +43,12 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@auth0/auth0-react": "^2.2.4",
46
- "@monkvision/eslint-config-base": "5.3.1",
47
- "@monkvision/eslint-config-typescript": "5.3.1",
48
- "@monkvision/jest-config": "5.3.1",
49
- "@monkvision/prettier-config": "5.3.1",
50
- "@monkvision/types": "5.3.1",
51
- "@monkvision/typescript-config": "5.3.1",
46
+ "@monkvision/eslint-config-base": "5.3.4",
47
+ "@monkvision/eslint-config-typescript": "5.3.4",
48
+ "@monkvision/jest-config": "5.3.4",
49
+ "@monkvision/prettier-config": "5.3.4",
50
+ "@monkvision/types": "5.3.4",
51
+ "@monkvision/typescript-config": "5.3.4",
52
52
  "@testing-library/dom": "^10.4.1",
53
53
  "@testing-library/react": "^16.3.0",
54
54
  "@types/jest": "^30",
@@ -101,6 +101,12 @@ function getImageLabel(options) {
101
101
  if (options.uploadType === ImageUploadType.VIDEO_FRAME) {
102
102
  return {
103
103
  en: "Video Frame ".concat(options.frameIndex),
104
+ ro: "Cadru video ".concat(options.frameIndex),
105
+ pl: "Klatka wideo ".concat(options.frameIndex),
106
+ da: "Videoramme ".concat(options.frameIndex),
107
+ sv: "Videoram ".concat(options.frameIndex),
108
+ es: "Fotograma de video ".concat(options.frameIndex),
109
+ pt: "Fotograma de v\u00EDdeo ".concat(options.frameIndex),
104
110
  fr: "Trame Vid\u00E9o ".concat(options.frameIndex),
105
111
  de: "Videobild ".concat(options.frameIndex),
106
112
  nl: "Videoframe ".concat(options.frameIndex),
@@ -110,6 +116,12 @@ function getImageLabel(options) {
110
116
  if (options.uploadType === ImageUploadType.VIDEO_MANUAL_PHOTO) {
111
117
  return {
112
118
  en: "Video Manual Photo",
119
+ ro: "Fotografie manual\u0103 din video",
120
+ pl: "Zdj\u0119cie r\u0119czne z wideo",
121
+ da: "Manuelt foto fra video",
122
+ sv: "Manuellt foto fr\u00E5n video",
123
+ es: "Foto manual del video",
124
+ pt: "Foto manual do v\u00EDdeo",
113
125
  fr: "Photo Manuelle Vid\u00E9o",
114
126
  de: "Foto Manuell Video",
115
127
  nl: "Foto-handleiding Video",
@@ -120,6 +132,12 @@ function getImageLabel(options) {
120
132
  var partsTranslation = options.vehicleParts.map(function (part) { return common_1.vehiclePartLabels[part]; });
121
133
  return {
122
134
  en: "Close Up on ".concat(partsTranslation.map(function (part) { return part.en; }).join(', ')),
135
+ ro: "Prim-plan pe ".concat(partsTranslation.map(function (part) { return part.ro; }).join(', ')),
136
+ pl: "Zbli\u017Cenie na ".concat(partsTranslation.map(function (part) { return part.pl; }).join(', ')),
137
+ da: "N\u00E6rbillede af ".concat(partsTranslation.map(function (part) { return part.da; }).join(', ')),
138
+ sv: "N\u00E4rbild p\u00E5 ".concat(partsTranslation.map(function (part) { return part.sv; }).join(', ')),
139
+ es: "Primer plano de ".concat(partsTranslation.map(function (part) { return part.es; }).join(', ')),
140
+ pt: "Plano Aproximado de ".concat(partsTranslation.map(function (part) { return part.pt; }).join(', ')),
123
141
  fr: "Photo Zoom\u00E9e sur ".concat(partsTranslation.map(function (part) { return part.en; }).join(', ')),
124
142
  de: "Gezoomtes an ".concat(partsTranslation.map(function (part) { return part.en; }).join(', ')),
125
143
  nl: "Nabij aan ".concat(partsTranslation.map(function (part) { return part.en; }).join(', ')),
@@ -128,6 +146,12 @@ function getImageLabel(options) {
128
146
  }
129
147
  return {
130
148
  en: options.firstShot ? 'Close Up (part)' : 'Close Up (damage)',
149
+ ro: options.firstShot ? 'Prim-plan (piesă)' : 'Prim-plan (deteriorare)',
150
+ pl: options.firstShot ? 'Zbliżenie (część)' : 'Zbliżenie (uszkodzenie)',
151
+ da: options.firstShot ? 'Nærbillede (del)' : 'Nærbillede (skade)',
152
+ sv: options.firstShot ? 'Närbild (del)' : 'Närbild (skada)',
153
+ es: options.firstShot ? 'Primer plano (parte)' : 'Primer plano (daño)',
154
+ pt: options.firstShot ? 'Plano Aproximado (parte)' : 'Plano Aproximado (dano)',
131
155
  fr: options.firstShot ? 'Photo Zoomée (partie)' : 'Photo Zoomée (dégât)',
132
156
  de: options.firstShot ? 'Gezoomtes Foto (Teil)' : 'Close Up (Schaden)',
133
157
  nl: options.firstShot ? 'Nabij (onderdeel)' : 'Nabij (schade)',
@@ -400,6 +400,11 @@ function getDamageDetectionOptions(options) {
400
400
  generate_subimages_parts: taskOptions.generateSubimageParts
401
401
  ? { generate_tight: false }
402
402
  : undefined,
403
+ dampart_confidence_score: taskOptions.dampartConfidenceScore
404
+ ? {
405
+ size_bucket_limits_cm: taskOptions.dampartConfidenceScore,
406
+ }
407
+ : undefined,
403
408
  }
404
409
  : undefined;
405
410
  }
@@ -72,6 +72,7 @@ export interface UpdateAdditionalDataOptions {
72
72
  id: string;
73
73
  /**
74
74
  * Callback function that takes optional additional data and returns the updated additional data.
75
+ * If the callback has no parameters, the current additional data is not fetched from the API.
75
76
  */
76
77
  callback: (additionalData?: AdditionalData) => AdditionalData;
77
78
  }
@@ -79,6 +80,9 @@ export interface UpdateAdditionalDataOptions {
79
80
  * Update the additional data of inspection with the given options.
80
81
  * See the `UpdateAdditionalDataOptions` interface for more details.
81
82
  *
83
+ * If the callback function has no parameters (callback.length === 0),
84
+ * the current additional data is not fetched from the API for better performance.
85
+ *
82
86
  * @param options The options of the request.
83
87
  * @param config The API config.
84
88
  * @param [dispatch] Optional MonkState dispatch function that you can pass if you want this request to handle React
@@ -126,6 +126,9 @@ function createInspection(options, config, _dispatch) {
126
126
  * Update the additional data of inspection with the given options.
127
127
  * See the `UpdateAdditionalDataOptions` interface for more details.
128
128
  *
129
+ * If the callback function has no parameters (callback.length === 0),
130
+ * the current additional data is not fetched from the API for better performance.
131
+ *
129
132
  * @param options The options of the request.
130
133
  * @param config The API config.
131
134
  * @param [dispatch] Optional MonkState dispatch function that you can pass if you want this request to handle React
@@ -134,23 +137,28 @@ function createInspection(options, config, _dispatch) {
134
137
  */
135
138
  function updateAdditionalData(options, config, dispatch) {
136
139
  return __awaiter(this, void 0, void 0, function () {
137
- var entities, inspection, newAdditionalData, kyOptions, response, body;
140
+ var currentAdditionalData, entities, inspection, newAdditionalData, kyOptions, response, body;
138
141
  return __generator(this, function (_a) {
139
142
  switch (_a.label) {
140
- case 0: return [4 /*yield*/, getInspection({ id: options.id }, config)];
143
+ case 0:
144
+ if (!(options.callback.length > 0)) return [3 /*break*/, 2];
145
+ return [4 /*yield*/, getInspection({ id: options.id }, config)];
141
146
  case 1:
142
147
  entities = (_a.sent()).entities;
143
148
  inspection = entities.inspections.find(function (i) { return i.id === options.id; });
144
149
  if (!inspection) {
145
150
  throw new Error('Inspection does not exist');
146
151
  }
147
- newAdditionalData = options.callback(inspection.additionalData);
152
+ currentAdditionalData = inspection.additionalData;
153
+ _a.label = 2;
154
+ case 2:
155
+ newAdditionalData = options.callback(currentAdditionalData);
148
156
  kyOptions = (0, config_1.getDefaultOptions)(config);
149
157
  return [4 /*yield*/, ky_1.default.patch("inspections/".concat(options.id), __assign(__assign({}, kyOptions), { json: { additional_data: newAdditionalData } }))];
150
- case 2:
158
+ case 3:
151
159
  response = _a.sent();
152
160
  return [4 /*yield*/, response.json()];
153
- case 3:
161
+ case 4:
154
162
  body = _a.sent();
155
163
  dispatch === null || dispatch === void 0 ? void 0 : dispatch({
156
164
  type: common_1.MonkActionType.UPDATED_ONE_INSPECTION_ADDITIONAL_DATA,
@@ -71,6 +71,10 @@ export interface GenerateVisualOutput {
71
71
  generate_parts?: boolean;
72
72
  generate_damages?: boolean;
73
73
  }
74
+ export type ApiSizeBucketLimitsCm = [number] | [number, number] | [number, number, number] | [number, number, number, number];
75
+ export interface ApiDampartConfidenceScore {
76
+ size_bucket_limits_cm: ApiSizeBucketLimitsCm;
77
+ }
74
78
  export interface ApiDamageDetectionTaskPostComponent {
75
79
  status?: ApiTaskPostProgressStatus;
76
80
  callbacks?: ApiCallbacks;
@@ -79,6 +83,7 @@ export interface ApiDamageDetectionTaskPostComponent {
79
83
  generate_subimages_damages?: ApiGenerateSubImages;
80
84
  generate_visual_output?: GenerateVisualOutput;
81
85
  scoring?: Record<string, unknown>;
86
+ dampart_confidence_score?: ApiDampartConfidenceScore;
82
87
  }
83
88
  export interface ApiWheelAnalysisTaskPostComponent {
84
89
  status?: ApiTaskPostProgressStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "5.3.2",
3
+ "version": "5.3.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": "5.3.2",
32
- "@monkvision/sights": "5.3.2",
31
+ "@monkvision/common": "5.3.5",
32
+ "@monkvision/sights": "5.3.5",
33
33
  "jsonwebtoken": "^9.0.2",
34
34
  "jwt-decode": "^4.0.0",
35
35
  "ky": "^1.2.0",
@@ -43,12 +43,12 @@
43
43
  },
44
44
  "devDependencies": {
45
45
  "@auth0/auth0-react": "^2.2.4",
46
- "@monkvision/eslint-config-base": "5.3.2",
47
- "@monkvision/eslint-config-typescript": "5.3.2",
48
- "@monkvision/jest-config": "5.3.2",
49
- "@monkvision/prettier-config": "5.3.2",
50
- "@monkvision/types": "5.3.2",
51
- "@monkvision/typescript-config": "5.3.2",
46
+ "@monkvision/eslint-config-base": "5.3.5",
47
+ "@monkvision/eslint-config-typescript": "5.3.5",
48
+ "@monkvision/jest-config": "5.3.5",
49
+ "@monkvision/prettier-config": "5.3.5",
50
+ "@monkvision/types": "5.3.5",
51
+ "@monkvision/typescript-config": "5.3.5",
52
52
  "@testing-library/dom": "^10.4.1",
53
53
  "@testing-library/react": "^16.3.0",
54
54
  "@types/jest": "^30",
@@ -90,5 +90,5 @@
90
90
  "url": "https://github.com/monkvision/monkjs/issues"
91
91
  },
92
92
  "homepage": "https://github.com/monkvision/monkjs",
93
- "gitHead": "b88f9ea85e87e4fc6678e9873473ee70bfab723e"
93
+ "gitHead": "cfca4988f50b55abca344f0ae3408a7798d61978"
94
94
  }