@monkvision/network 5.2.4 → 5.3.0

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.2.3",
3
+ "version": "5.2.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.2.3",
32
- "@monkvision/sights": "5.2.3",
31
+ "@monkvision/common": "5.2.5",
32
+ "@monkvision/sights": "5.2.5",
33
33
  "jsonwebtoken": "^9.0.2",
34
34
  "jwt-decode": "^4.0.0",
35
35
  "ky": "^1.2.0",
@@ -37,20 +37,25 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@auth0/auth0-react": "^2.2.4",
40
- "react": "^17.0.2",
41
- "react-dom": "^17.0.2",
40
+ "react": "^19.2.3",
41
+ "react-dom": "^19.2.3",
42
42
  "react-router-dom": "^6.22.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@monkvision/eslint-config-base": "5.2.3",
46
- "@monkvision/eslint-config-typescript": "5.2.3",
47
- "@monkvision/jest-config": "5.2.3",
48
- "@monkvision/prettier-config": "5.2.3",
49
- "@monkvision/types": "5.2.3",
50
- "@monkvision/typescript-config": "5.2.3",
51
- "@types/jest": "^29.2.2",
45
+ "@auth0/auth0-react": "^2.2.4",
46
+ "@monkvision/eslint-config-base": "5.2.5",
47
+ "@monkvision/eslint-config-typescript": "5.2.5",
48
+ "@monkvision/jest-config": "5.2.5",
49
+ "@monkvision/prettier-config": "5.2.5",
50
+ "@monkvision/types": "5.2.5",
51
+ "@monkvision/typescript-config": "5.2.5",
52
+ "@testing-library/dom": "^10.4.1",
53
+ "@testing-library/react": "^16.3.0",
54
+ "@types/jest": "^30",
52
55
  "@types/jsonwebtoken": "^9.0.5",
53
- "@types/node": "^18.11.9",
56
+ "@types/node": "^24.5.2",
57
+ "@types/react": "^19.1.10",
58
+ "@types/react-dom": "^19.1.7",
54
59
  "@types/uuid": "^9",
55
60
  "@typescript-eslint/eslint-plugin": "^5.43.0",
56
61
  "@typescript-eslint/parser": "^5.43.0",
@@ -64,13 +69,14 @@
64
69
  "eslint-plugin-prettier": "^4.2.1",
65
70
  "eslint-plugin-promise": "^6.1.1",
66
71
  "eslint-utils": "^3.0.0",
67
- "jest": "^29.3.1",
72
+ "jest": "^30.2",
68
73
  "mkdirp": "^1.0.4",
69
74
  "prettier": "^2.7.1",
75
+ "react-router-dom": "^6.22.3",
70
76
  "regexpp": "^3.2.0",
71
77
  "rimraf": "^3.0.2",
72
- "ts-jest": "^29.0.3",
73
- "typescript": "^4.8.4"
78
+ "ts-jest": "^29.4.6",
79
+ "typescript": "^5.9.2"
74
80
  },
75
81
  "prettier": "@monkvision/prettier-config",
76
82
  "publishConfig": {
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getDefaultOptions = exports.sdkVersion = void 0;
6
+ exports.sdkVersion = void 0;
7
+ exports.getDefaultOptions = getDefaultOptions;
7
8
  var package_json_1 = __importDefault(require("../../package.json"));
8
9
  var error_1 = require("./error");
9
10
  exports.sdkVersion = package_json_1.default.version;
@@ -37,4 +38,3 @@ function getDefaultOptions(config) {
37
38
  timeout: 30000,
38
39
  };
39
40
  }
40
- exports.getDefaultOptions = getDefaultOptions;
@@ -1,10 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapApiDamagePostRequest = void 0;
3
+ exports.mapApiDamagePostRequest = mapApiDamagePostRequest;
4
4
  function mapApiDamagePostRequest(damageType, vehiclePart) {
5
5
  return {
6
6
  damage_type: damageType,
7
7
  part_type: vehiclePart,
8
8
  };
9
9
  }
10
- exports.mapApiDamagePostRequest = mapApiDamagePostRequest;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.deleteDamage = exports.createDamage = void 0;
53
+ exports.createDamage = createDamage;
54
+ exports.deleteDamage = deleteDamage;
54
55
  var common_1 = require("@monkvision/common");
55
56
  var types_1 = require("@monkvision/types");
56
57
  var ky_1 = __importDefault(require("ky"));
@@ -116,7 +117,6 @@ function createDamage(options, config, dispatch) {
116
117
  });
117
118
  });
118
119
  }
119
- exports.createDamage = createDamage;
120
120
  /**
121
121
  * Delete a damage with the given options. See the `DeleteDamageOptions` interface for more details.
122
122
  *
@@ -152,4 +152,3 @@ function deleteDamage(options, config, dispatch) {
152
152
  });
153
153
  });
154
154
  }
155
- exports.deleteDamage = deleteDamage;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -63,7 +63,7 @@ var MonkNetworkError;
63
63
  * The PDF requested is not available.
64
64
  */
65
65
  MonkNetworkError["UNAVAILABLE_PDF"] = "UnavailablePdf";
66
- })(MonkNetworkError = exports.MonkNetworkError || (exports.MonkNetworkError = {}));
66
+ })(MonkNetworkError || (exports.MonkNetworkError = MonkNetworkError = {}));
67
67
  function getErrorMessage(name) {
68
68
  switch (name) {
69
69
  case MonkNetworkError.MISSING_TOKEN:
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useInspectionPoll = void 0;
3
+ exports.useInspectionPoll = useInspectionPoll;
4
4
  var common_1 = require("@monkvision/common");
5
5
  var monitoring_1 = require("@monkvision/monitoring");
6
6
  var react_1 = require("../react");
@@ -17,4 +17,3 @@ function useInspectionPoll(_a) {
17
17
  onReject: handleError,
18
18
  });
19
19
  }
20
- exports.useInspectionPoll = useInspectionPoll;
@@ -9,7 +9,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.mapApiImage = void 0;
12
+ exports.mapApiImage = mapApiImage;
13
13
  var types_1 = require("@monkvision/types");
14
14
  var utils_1 = require("../utils");
15
15
  var DEFAULT_COMPLIANCE_OPTIONS = {
@@ -83,11 +83,13 @@ function applyCustomComplianceThresholds(issues, complianceResult, customComplia
83
83
  if (!customComplianceThresholds) {
84
84
  return complianceIssues;
85
85
  }
86
- Object.keys(customComplianceThresholds).forEach(function (key) {
87
- var thresholdName = key;
86
+ Object.keys(customComplianceThresholds).forEach(function (thresholdName) {
88
87
  var complianceScore = getComplianceScore(thresholdName, complianceResult);
88
+ // Special case for zoom
89
89
  if (thresholdName === 'zoom' && complianceScore && customComplianceThresholds.zoom) {
90
- complianceIssues = complianceIssues.filter(function (issue) { return ![types_1.ComplianceIssue.TOO_ZOOMED, types_1.ComplianceIssue.NOT_ZOOMED_ENOUGH].includes(issue); });
90
+ complianceIssues = complianceIssues.filter(function (issue) {
91
+ return ![types_1.ComplianceIssue.TOO_ZOOMED, types_1.ComplianceIssue.NOT_ZOOMED_ENOUGH].includes(issue);
92
+ });
91
93
  if (complianceScore < customComplianceThresholds.zoom.min) {
92
94
  complianceIssues.push(types_1.ComplianceIssue.TOO_ZOOMED);
93
95
  }
@@ -100,7 +102,11 @@ function applyCustomComplianceThresholds(issues, complianceResult, customComplia
100
102
  var complianceIssue = getComplianceIssue(thresholdName);
101
103
  if (complianceScore && complianceIssue && customThreshold !== undefined) {
102
104
  complianceIssues = complianceIssues.filter(function (issue) { return issue !== complianceIssue; });
103
- if (complianceScore < customThreshold) {
105
+ if (typeof customThreshold === 'number' && complianceScore < customThreshold) {
106
+ complianceIssues.push(complianceIssue);
107
+ }
108
+ else if (typeof customThreshold === 'object' &&
109
+ (complianceScore < customThreshold.min || complianceScore > customThreshold.max)) {
104
110
  complianceIssues.push(complianceIssue);
105
111
  }
106
112
  }
@@ -180,4 +186,3 @@ function mapApiImage(image, inspectionId, thumbnailDomain, complianceOptions) {
180
186
  warningLights: (_e = image.warning_lights) === null || _e === void 0 ? void 0 : _e.activated_warning_lights,
181
187
  };
182
188
  }
183
- exports.mapApiImage = mapApiImage;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.deleteImage = exports.addImage = exports.ImageUploadType = void 0;
53
+ exports.ImageUploadType = void 0;
54
+ exports.addImage = addImage;
55
+ exports.deleteImage = deleteImage;
54
56
  var ky_1 = __importDefault(require("ky"));
55
57
  var common_1 = require("@monkvision/common");
56
58
  var types_1 = require("@monkvision/types");
@@ -85,7 +87,7 @@ var ImageUploadType;
85
87
  * Upload type corresponding to a manual photo in the VideoCapture process.
86
88
  */
87
89
  ImageUploadType["VIDEO_MANUAL_PHOTO"] = "video_manual_photo";
88
- })(ImageUploadType = exports.ImageUploadType || (exports.ImageUploadType = {}));
90
+ })(ImageUploadType || (exports.ImageUploadType = ImageUploadType = {}));
89
91
  function getImageType(options) {
90
92
  if ([ImageUploadType.CLOSE_UP_2_SHOT, ImageUploadType.PART_SELECT_SHOT].includes(options.uploadType)) {
91
93
  return types_1.ImageType.CLOSE_UP;
@@ -420,7 +422,6 @@ function addImage(options, config, dispatch) {
420
422
  });
421
423
  });
422
424
  }
423
- exports.addImage = addImage;
424
425
  /**
425
426
  * Delete an image from an inspection.
426
427
  *
@@ -466,4 +467,3 @@ function deleteImage(options, config, dispatch) {
466
467
  });
467
468
  });
468
469
  }
469
- exports.deleteImage = deleteImage;
@@ -11,7 +11,11 @@ var __assign = (this && this.__assign) || function () {
11
11
  return __assign.apply(this, arguments);
12
12
  };
13
13
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.mapApiInspectionUrlParamsGet = exports.mapApiAllInspectionsUrlParamsGet = exports.mapApiInspectionPost = exports.mapApiInspectionGet = exports.mapApiAllInspectionsVerboseGet = void 0;
14
+ exports.mapApiAllInspectionsVerboseGet = mapApiAllInspectionsVerboseGet;
15
+ exports.mapApiInspectionGet = mapApiInspectionGet;
16
+ exports.mapApiInspectionPost = mapApiInspectionPost;
17
+ exports.mapApiAllInspectionsUrlParamsGet = mapApiAllInspectionsUrlParamsGet;
18
+ exports.mapApiInspectionUrlParamsGet = mapApiInspectionUrlParamsGet;
15
19
  var types_1 = require("@monkvision/types");
16
20
  var mappers_1 = require("../image/mappers");
17
21
  var config_1 = require("../config");
@@ -278,20 +282,9 @@ function mapWheelAnalysis(response) {
278
282
  : [])) !== null && _b !== void 0 ? _b : []);
279
283
  }
280
284
  function mapInspection(response, ids) {
281
- return {
282
- id: response.id,
283
- entityType: types_1.MonkEntityType.INSPECTION,
284
- tasks: ids.taskIds,
285
- images: ids.imageIds,
286
- damages: ids.damageIds,
287
- parts: ids.partIds,
288
- vehicle: ids.vehicleId,
289
- wheelAnalysis: mapWheelAnalysis(response),
290
- severityResults: ids.severityResultIds,
291
- pricings: ids.pricingIds,
292
- pdfUrl: 'pdf_url' in response ? response.pdf_url : undefined,
293
- additionalData: response.additional_data,
294
- };
285
+ return __assign(__assign({ id: response.id, entityType: types_1.MonkEntityType.INSPECTION, tasks: ids.taskIds, images: ids.imageIds, damages: ids.damageIds, parts: ids.partIds, vehicle: ids.vehicleId, wheelAnalysis: mapWheelAnalysis(response), severityResults: ids.severityResultIds, pricings: ids.pricingIds, pdfUrl: 'pdf_url' in response ? response.pdf_url : undefined }, (response.inspection_type && {
286
+ type: response.inspection_type,
287
+ })), { additionalData: response.additional_data });
295
288
  }
296
289
  function mapApiAllInspectionsVerboseGet(data, thumbnailDomain) {
297
290
  var state = {
@@ -337,7 +330,6 @@ function mapApiAllInspectionsVerboseGet(data, thumbnailDomain) {
337
330
  return acc;
338
331
  }, state);
339
332
  }
340
- exports.mapApiAllInspectionsVerboseGet = mapApiAllInspectionsVerboseGet;
341
333
  function mapApiInspectionGet(response, thumbnailDomain, complianceOptions) {
342
334
  var _a = mapImages(response, thumbnailDomain, complianceOptions), images = _a.images, renderedOutputs = _a.renderedOutputs, views = _a.views, imageIds = _a.imageIds, renderedOutputIds = _a.renderedOutputIds, viewIds = _a.viewIds;
343
335
  var _b = mapDamages(response), damages = _b.damages, damageIds = _b.damageIds;
@@ -371,7 +363,6 @@ function mapApiInspectionGet(response, thumbnailDomain, complianceOptions) {
371
363
  partOperations: [],
372
364
  };
373
365
  }
374
- exports.mapApiInspectionGet = mapApiInspectionGet;
375
366
  function getHumanInTheLoopOptions(options) {
376
367
  if (options.tasks.includes(types_1.TaskName.HUMAN_IN_THE_LOOP)) {
377
368
  return { status: types_1.ProgressStatus.NOT_STARTED };
@@ -516,10 +507,10 @@ function mapApiInspectionPost(options) {
516
507
  }
517
508
  : undefined,
518
509
  damage_severity: options.enablePricingV1 === false ? undefined : { output_format: 'default' },
510
+ inspection_type: options.type,
519
511
  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),
520
512
  };
521
513
  }
522
- exports.mapApiInspectionPost = mapApiInspectionPost;
523
514
  function mapApiAllInspectionsUrlParamsGet(options, verbose, showDeleted) {
524
515
  var _a, _b;
525
516
  var params = new URLSearchParams();
@@ -551,11 +542,9 @@ function mapApiAllInspectionsUrlParamsGet(options, verbose, showDeleted) {
551
542
  var paramsStr = params.toString();
552
543
  return "".concat(paramsStr.length > 0 ? '?' : '').concat(paramsStr);
553
544
  }
554
- exports.mapApiAllInspectionsUrlParamsGet = mapApiAllInspectionsUrlParamsGet;
555
545
  function mapApiInspectionUrlParamsGet(light) {
556
546
  if (!light) {
557
547
  return '';
558
548
  }
559
549
  return '?verbose=light';
560
550
  }
561
- exports.mapApiInspectionUrlParamsGet = mapApiInspectionUrlParamsGet;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.getAllInspectionsCount = exports.getAllInspections = exports.updateAdditionalData = exports.createInspection = exports.getInspection = void 0;
53
+ exports.getInspection = getInspection;
54
+ exports.createInspection = createInspection;
55
+ exports.updateAdditionalData = updateAdditionalData;
56
+ exports.getAllInspections = getAllInspections;
57
+ exports.getAllInspectionsCount = getAllInspectionsCount;
54
58
  var ky_1 = __importDefault(require("ky"));
55
59
  var common_1 = require("@monkvision/common");
56
60
  var config_1 = require("../config");
@@ -87,7 +91,6 @@ function getInspection(options, config, dispatch) {
87
91
  });
88
92
  });
89
93
  }
90
- exports.getInspection = getInspection;
91
94
  /**
92
95
  * Create a new inspection with the given options. See the `CreateInspectionOptions` interface for more details.
93
96
  *
@@ -119,7 +122,6 @@ function createInspection(options, config, _dispatch) {
119
122
  });
120
123
  });
121
124
  }
122
- exports.createInspection = createInspection;
123
125
  /**
124
126
  * Update the additional data of inspection with the given options.
125
127
  * See the `UpdateAdditionalDataOptions` interface for more details.
@@ -166,7 +168,6 @@ function updateAdditionalData(options, config, dispatch) {
166
168
  });
167
169
  });
168
170
  }
169
- exports.updateAdditionalData = updateAdditionalData;
170
171
  /**
171
172
  * Fetch the details of multiple inspections.
172
173
  *
@@ -202,7 +203,6 @@ function getAllInspections(options, config, dispatch) {
202
203
  });
203
204
  });
204
205
  }
205
- exports.getAllInspections = getAllInspections;
206
206
  /**
207
207
  * Gets the count of inspections that match the given filters.
208
208
  *
@@ -229,4 +229,3 @@ function getAllInspectionsCount(options, config, _dispatch) {
229
229
  });
230
230
  });
231
231
  }
232
- exports.getAllInspectionsCount = getAllInspectionsCount;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.getLiveConfig = void 0;
42
+ exports.getLiveConfig = getLiveConfig;
43
43
  var ky_1 = __importDefault(require("ky"));
44
44
  var config_1 = require("../config");
45
45
  /**
@@ -62,4 +62,3 @@ function getLiveConfig(id) {
62
62
  });
63
63
  });
64
64
  }
65
- exports.getLiveConfig = getLiveConfig;
@@ -14,7 +14,6 @@ export interface ApiInspectioAdditionalData extends ApiAdditionalData {
14
14
  use_3d_projection?: boolean;
15
15
  }
16
16
  export interface ApiInspectionGet {
17
- additional_data?: ApiInspectioAdditionalData;
18
17
  damages: ApiDamages;
19
18
  id: string;
20
19
  images: ApiImages;
@@ -25,6 +24,8 @@ export interface ApiInspectionGet {
25
24
  tasks: ApiTasks;
26
25
  vehicle?: ApiVehicleComponent;
27
26
  wheel_analysis?: ApiWheelAnalysis;
27
+ inspection_type?: string;
28
+ additional_data?: ApiInspectioAdditionalData;
28
29
  }
29
30
  export type ApiPaginationOrder = 'asc' | 'desc';
30
31
  export interface ApiPaginationParameters {
@@ -61,6 +62,7 @@ export interface ApiAllInspectionsVerboseGet extends ApiAllInspectionsGet {
61
62
  plate?: string;
62
63
  damages: ApiDamageSimplifiedGet[];
63
64
  parts: ApiPartSimplifiedGet[];
65
+ inspection_type?: string;
64
66
  vehicle?: ApiVehicleComponent;
65
67
  }
66
68
  export interface ApiInspectionsCountGet {
@@ -76,4 +78,5 @@ export interface ApiInspectionPost {
76
78
  images?: ApiImagePost[];
77
79
  vehicle?: ApiVehiclePostPatch;
78
80
  damage_severity?: ApiDamageSeverity;
81
+ inspection_type?: string;
79
82
  }
@@ -51,6 +51,6 @@ export declare function uploadPdf(options: UploadPdfOptions, config: MonkApiConf
51
51
  * @see GetPdfOptions
52
52
  */
53
53
  export declare function getPdf(options: GetPdfOptions, config: MonkApiConfig, dispatch?: Dispatch<MonkGotOneInspectionPdfAction>): Promise<{
54
- response: import("ky").KyResponse;
54
+ response: import("ky").KyResponse<unknown>;
55
55
  body: ApiPdf;
56
56
  }>;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.getPdf = exports.uploadPdf = void 0;
53
+ exports.uploadPdf = uploadPdf;
54
+ exports.getPdf = getPdf;
54
55
  var common_1 = require("@monkvision/common");
55
56
  var ky_1 = __importDefault(require("ky"));
56
57
  var config_1 = require("../config");
@@ -120,7 +121,6 @@ function uploadPdf(options, config, dispatch) {
120
121
  });
121
122
  });
122
123
  }
123
- exports.uploadPdf = uploadPdf;
124
124
  /**
125
125
  * Get a PDF file from an inspection. See the `GetPdfOptions` interface for more details.
126
126
  *
@@ -155,4 +155,3 @@ function getPdf(options, config, dispatch) {
155
155
  });
156
156
  });
157
157
  }
158
- exports.getPdf = getPdf;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapApiPricingPostRequest = exports.mapApiPricingPost = void 0;
3
+ exports.mapApiPricingPost = mapApiPricingPost;
4
+ exports.mapApiPricingPostRequest = mapApiPricingPostRequest;
4
5
  var types_1 = require("@monkvision/types");
5
6
  function mapApiPricingPost(inspectionId, response) {
6
7
  return {
@@ -14,7 +15,6 @@ function mapApiPricingPost(inspectionId, response) {
14
15
  hours: response.hours,
15
16
  };
16
17
  }
17
- exports.mapApiPricingPost = mapApiPricingPost;
18
18
  function mapApiPricingPostRequest(options) {
19
19
  return {
20
20
  pricing: options.pricing >= 0 ? options.pricing : 0,
@@ -22,4 +22,3 @@ function mapApiPricingPostRequest(options) {
22
22
  part_type: options.type === types_1.PricingV2RelatedItemType.PART ? options.vehiclePart : types_1.VehiclePart.IGNORE,
23
23
  };
24
24
  }
25
- exports.mapApiPricingPostRequest = mapApiPricingPostRequest;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.updatePricing = exports.deletePricing = exports.createPricing = void 0;
53
+ exports.createPricing = createPricing;
54
+ exports.deletePricing = deletePricing;
55
+ exports.updatePricing = updatePricing;
54
56
  var common_1 = require("@monkvision/common");
55
57
  var ky_1 = __importDefault(require("ky"));
56
58
  var uuid_1 = require("uuid");
@@ -110,7 +112,6 @@ function createPricing(options, config, dispatch) {
110
112
  });
111
113
  });
112
114
  }
113
- exports.createPricing = createPricing;
114
115
  /**
115
116
  * Delete a pricing with the given options. See the `DeletePricingOptions` interface for more details.
116
117
  *
@@ -146,7 +147,6 @@ function deletePricing(options, config, dispatch) {
146
147
  });
147
148
  });
148
149
  }
149
- exports.deletePricing = deletePricing;
150
150
  /**
151
151
  * Update a pricing with the given options. See the `UpdatePricingOptions` interface for more details.
152
152
  *
@@ -183,4 +183,3 @@ function updatePricing(options, config, dispatch) {
183
183
  });
184
184
  });
185
185
  }
186
- exports.updatePricing = updatePricing;
@@ -33,7 +33,7 @@ export declare function useMonkApi(config: MonkApiConfig): {
33
33
  * @param options The options of the inspection.
34
34
  * @see CreateInspectionOptions
35
35
  */
36
- createInspection: (options: import("@monkvision/types").CreateInspectionOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
36
+ createInspection: (options: import("@monkvision/types").CreateInspectionOptions) => Promise<import("./types").MonkApiResponse>;
37
37
  /**
38
38
  * Add a new image to an inspection.
39
39
  *
@@ -45,7 +45,7 @@ export declare function useMonkApi(config: MonkApiConfig): {
45
45
  *
46
46
  * @param options The options of the request.
47
47
  */
48
- deleteImage: (options: import("./image").DeleteImageOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
48
+ deleteImage: (options: import("./image").DeleteImageOptions) => Promise<import("./types").MonkApiResponse>;
49
49
  /**
50
50
  * Update the progress status of an inspection task.
51
51
  *
@@ -55,7 +55,7 @@ export declare function useMonkApi(config: MonkApiConfig): {
55
55
  *
56
56
  * @param options The options of the request.
57
57
  */
58
- updateTaskStatus: (options: import("./task").UpdateTaskStatusOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
58
+ updateTaskStatus: (options: import("./task").UpdateTaskStatusOptions) => Promise<import("./types").MonkApiResponse>;
59
59
  /**
60
60
  * Start some inspection tasks that were in the NOT_STARTED status. This function actually makes one API call for
61
61
  * each task provided using the `updateTaskStatus`.
@@ -67,7 +67,7 @@ export declare function useMonkApi(config: MonkApiConfig): {
67
67
  *
68
68
  * @see updateTaskStatus
69
69
  */
70
- startInspectionTasks: (options: import("./task").StartInspectionTasksOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>[]>;
70
+ startInspectionTasks: (options: import("./task").StartInspectionTasksOptions) => Promise<import("./types").MonkApiResponse[]>;
71
71
  /**
72
72
  * Fetch a webapp live configuration from the API.
73
73
  *
@@ -81,7 +81,7 @@ export declare function useMonkApi(config: MonkApiConfig): {
81
81
  */
82
82
  updateInspectionVehicle: (options: import("./vehicle").UpdateInspectionVehicleOptions) => Promise<{
83
83
  id: string;
84
- response: import("ky").KyResponse;
84
+ response: import("ky").KyResponse<unknown>;
85
85
  body: import("./models").ApiIdColumn;
86
86
  }>;
87
87
  /**
@@ -89,49 +89,49 @@ export declare function useMonkApi(config: MonkApiConfig): {
89
89
  *
90
90
  * @param options The options of the request.
91
91
  */
92
- updateAdditionalData: (options: import("./inspection").UpdateAdditionalDataOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
92
+ updateAdditionalData: (options: import("./inspection").UpdateAdditionalDataOptions) => Promise<import("./types").MonkApiResponse>;
93
93
  /**
94
94
  * Create a new pricing with the given options. See the `CreatePricingOptions` interface for more details.
95
95
  *
96
96
  * @param options The options of the inspection.
97
97
  * @see CreatePricingOptions
98
98
  */
99
- createPricing: (options: import("./pricing").CreatePricingOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
99
+ createPricing: (options: import("./pricing").CreatePricingOptions) => Promise<import("./types").MonkApiResponse>;
100
100
  /**
101
101
  * Delete a pricing with the given options. See the `DeletePricingOptions` interface for more details.
102
102
  *
103
103
  * @param options The options of the inspection.
104
104
  * @see DeletePricingOptions
105
105
  */
106
- deletePricing: (options: import("./pricing").DeletePricingOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
106
+ deletePricing: (options: import("./pricing").DeletePricingOptions) => Promise<import("./types").MonkApiResponse>;
107
107
  /**
108
108
  * Update a pricing with the given options. See the `UpdatePricingOptions` interface for more details.
109
109
  *
110
110
  * @param options The options of the inspection.
111
111
  * @see UpdatePricingOptions
112
112
  */
113
- updatePricing: (options: import("./pricing").UpdatePricingOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
113
+ updatePricing: (options: import("./pricing").UpdatePricingOptions) => Promise<import("./types").MonkApiResponse>;
114
114
  /**
115
115
  * Create a new damage with the given options. See the `CreateDamageOptions` interface for more details.
116
116
  *
117
117
  * @param options The options of the inspection.
118
118
  * @see CreateDamageOptions
119
119
  */
120
- createDamage: (options: import("./damage").CreateDamageOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
120
+ createDamage: (options: import("./damage").CreateDamageOptions) => Promise<import("./types").MonkApiResponse>;
121
121
  /**
122
122
  * Delete a damage with the given options. See the `DeleteDamageOptions` interface for more details.
123
123
  *
124
124
  * @param options The options of the inspection.
125
125
  * @see DeleteDamageOptions
126
126
  */
127
- deleteDamage: (options: import("./damage").DeleteDamageOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
127
+ deleteDamage: (options: import("./damage").DeleteDamageOptions) => Promise<import("./types").MonkApiResponse>;
128
128
  /**
129
129
  * Upload a PDF file to the API. See the `UploadPdfOptions` interface for more details.
130
130
  *
131
131
  * @param options The options of the inspection.
132
132
  * @see UploadPdfOptions
133
133
  */
134
- uploadPdf: (options: import("./pdf").UploadPdfOptions) => Promise<import("./types").MonkApiResponse<import("./types").MonkId, import("./models").ApiIdColumn>>;
134
+ uploadPdf: (options: import("./pdf").UploadPdfOptions) => Promise<import("./types").MonkApiResponse>;
135
135
  /**
136
136
  * Get a PDF file from an inspection. See the `GetPdfOptions` interface for more details.
137
137
  *
@@ -139,7 +139,7 @@ export declare function useMonkApi(config: MonkApiConfig): {
139
139
  * @see GetPdfOptions
140
140
  */
141
141
  getPdf: (options: import("./pdf").GetPdfOptions) => Promise<{
142
- response: import("ky").KyResponse;
142
+ response: import("ky").KyResponse<unknown>;
143
143
  body: import("./models/pdf").ApiPdf;
144
144
  }>;
145
145
  };
@@ -9,7 +9,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
9
9
  return to.concat(ar || Array.prototype.slice.call(from));
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.useMonkApi = void 0;
12
+ exports.useMonkApi = useMonkApi;
13
13
  var react_1 = require("react");
14
14
  var common_1 = require("@monkvision/common");
15
15
  var monitoring_1 = require("@monkvision/monitoring");
@@ -174,4 +174,3 @@ function useMonkApi(config) {
174
174
  getPdf: reactify(api_1.MonkApi.getPdf, config, dispatch, handleError),
175
175
  };
176
176
  }
177
- exports.useMonkApi = useMonkApi;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.startInspectionTasks = exports.updateTaskStatus = void 0;
53
+ exports.updateTaskStatus = updateTaskStatus;
54
+ exports.startInspectionTasks = startInspectionTasks;
54
55
  var ky_1 = __importDefault(require("ky"));
55
56
  var common_1 = require("@monkvision/common");
56
57
  var types_1 = require("@monkvision/types");
@@ -97,7 +98,6 @@ function updateTaskStatus(options, config, dispatch) {
97
98
  });
98
99
  });
99
100
  }
100
- exports.updateTaskStatus = updateTaskStatus;
101
101
  /**
102
102
  * Start some inspection tasks that were in the NOT_STARTED status. This function actually makes one API call for each
103
103
  * task provided using the `updateTaskStatus`.
@@ -131,4 +131,3 @@ function startInspectionTasks(options, config, dispatch) {
131
131
  });
132
132
  });
133
133
  }
134
- exports.startInspectionTasks = startInspectionTasks;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getThumbnailUrl = exports.THUMBNAIL_RESIZE_RATIO = void 0;
3
+ exports.THUMBNAIL_RESIZE_RATIO = void 0;
4
+ exports.getThumbnailUrl = getThumbnailUrl;
4
5
  /**
5
6
  * The ratio used to resize the dimensions of the thumbnail.
6
7
  */
@@ -18,4 +19,3 @@ function getThumbnailUrl(thumbnailDomain, path, dimensions) {
18
19
  var heightUrlParam = "height=".concat(getResizedDimension(dimensions.height));
19
20
  return "".concat(baseThumbnailUrl, "?").concat(imageUrlParam, "&").concat(widthUrlParam, "&").concat(heightUrlParam);
20
21
  }
21
- exports.getThumbnailUrl = getThumbnailUrl;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.mapApiVehiclePatch = void 0;
3
+ exports.mapApiVehiclePatch = mapApiVehiclePatch;
4
4
  function mapApiVehiclePatch(options) {
5
5
  return {
6
6
  brand: options.brand,
@@ -29,4 +29,3 @@ function mapApiVehiclePatch(options) {
29
29
  owner_info: options.ownerInfo,
30
30
  };
31
31
  }
32
- exports.mapApiVehiclePatch = mapApiVehiclePatch;
@@ -26,6 +26,6 @@ export interface UpdateInspectionVehicleOptions {
26
26
  */
27
27
  export declare function updateInspectionVehicle(options: UpdateInspectionVehicleOptions, config: MonkApiConfig, _dispatch?: Dispatch<MonkAction>): Promise<{
28
28
  id: string;
29
- response: import("ky").KyResponse;
29
+ response: import("ky").KyResponse<unknown>;
30
30
  body: ApiIdColumn;
31
31
  }>;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -50,7 +50,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
50
50
  return (mod && mod.__esModule) ? mod : { "default": mod };
51
51
  };
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
- exports.updateInspectionVehicle = void 0;
53
+ exports.updateInspectionVehicle = updateInspectionVehicle;
54
54
  var ky_1 = __importDefault(require("ky"));
55
55
  var config_1 = require("../config");
56
56
  var mappers_1 = require("./mappers");
@@ -84,4 +84,3 @@ function updateInspectionVehicle(options, config, _dispatch) {
84
84
  });
85
85
  });
86
86
  }
87
- exports.updateInspectionVehicle = updateInspectionVehicle;
@@ -12,4 +12,4 @@ export interface AuthProviderProps {
12
12
  /**
13
13
  * Authentication provider that selects the appropriate Auth0 configuration based on URL parameters.
14
14
  */
15
- export declare function AuthProvider({ configs, children }: PropsWithChildren<AuthProviderProps>): JSX.Element;
15
+ export declare function AuthProvider({ configs, children }: PropsWithChildren<AuthProviderProps>): import("react/jsx-runtime").JSX.Element;
@@ -1,17 +1,6 @@
1
1
  "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.AuthProvider = void 0;
3
+ exports.AuthProvider = AuthProvider;
15
4
  var jsx_runtime_1 = require("react/jsx-runtime");
16
5
  var react_1 = require("react");
17
6
  var auth0_react_1 = require("@auth0/auth0-react");
@@ -38,6 +27,5 @@ function AuthProvider(_a) {
38
27
  if (!config) {
39
28
  return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: children });
40
29
  }
41
- return ((0, jsx_runtime_1.jsxs)(auth0_react_1.Auth0Provider, __assign({ domain: config.domain, clientId: config.clientId, authorizationParams: config.authorizationParams, context: config.context }, { children: [(0, jsx_runtime_1.jsx)(AuthValidator, { clientId: config.clientId }), children] })));
30
+ return ((0, jsx_runtime_1.jsxs)(auth0_react_1.Auth0Provider, { domain: config.domain, clientId: config.clientId, authorizationParams: config.authorizationParams, context: config.context, children: [(0, jsx_runtime_1.jsx)(AuthValidator, { clientId: config.clientId }), children] }));
42
31
  }
43
- exports.AuthProvider = AuthProvider;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.useAuth = void 0;
50
+ exports.useAuth = useAuth;
51
51
  var auth0_react_1 = require("@auth0/auth0-react");
52
52
  var react_1 = require("react");
53
53
  var common_1 = require("@monkvision/common");
@@ -108,4 +108,3 @@ function useAuth(params) {
108
108
  logout: handleLogout,
109
109
  });
110
110
  }
111
- exports.useAuth = useAuth;
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAuthConfig = exports.isTokenValid = exports.isTokenExpired = exports.isUserAuthorized = exports.decodeMonkJwt = void 0;
3
+ exports.decodeMonkJwt = decodeMonkJwt;
4
+ exports.isUserAuthorized = isUserAuthorized;
5
+ exports.isTokenExpired = isTokenExpired;
6
+ exports.isTokenValid = isTokenValid;
7
+ exports.getAuthConfig = getAuthConfig;
4
8
  var jwt_decode_1 = require("jwt-decode");
5
9
  var common_1 = require("@monkvision/common");
6
10
  /**
@@ -9,7 +13,6 @@ var common_1 = require("@monkvision/common");
9
13
  function decodeMonkJwt(token) {
10
14
  return (0, jwt_decode_1.jwtDecode)(token);
11
15
  }
12
- exports.decodeMonkJwt = decodeMonkJwt;
13
16
  /**
14
17
  * Utility function that checks if the given user has all the required authroizations. You can either pass an auth token
15
18
  * to be decoded or the JWT payload directly.
@@ -21,7 +24,6 @@ function isUserAuthorized(tokenOrPayload, permissions) {
21
24
  var payload = typeof tokenOrPayload === 'object' ? tokenOrPayload : decodeMonkJwt(tokenOrPayload);
22
25
  return permissions.every(function (requiredPermission) { var _a; return (_a = payload.permissions) === null || _a === void 0 ? void 0 : _a.includes(requiredPermission); });
23
26
  }
24
- exports.isUserAuthorized = isUserAuthorized;
25
27
  /**
26
28
  * Utility function that checks if an authorization token is expired or not. You can either pass an auth token to be
27
29
  * decoded or the JWT payload directly.
@@ -33,7 +35,6 @@ function isTokenExpired(tokenOrPayload) {
33
35
  var payload = typeof tokenOrPayload === 'object' ? tokenOrPayload : decodeMonkJwt(tokenOrPayload);
34
36
  return !payload.exp || Math.round(Date.now() / 1000) >= payload.exp;
35
37
  }
36
- exports.isTokenExpired = isTokenExpired;
37
38
  /**
38
39
  * Utility function that checks if the stored auth token is valid for the given Auth0 Client ID.
39
40
  */
@@ -42,7 +43,6 @@ function isTokenValid(clientID) {
42
43
  var fetchedClientId = fetchedToken ? decodeMonkJwt(fetchedToken).azp : null;
43
44
  return fetchedClientId === clientID;
44
45
  }
45
- exports.isTokenValid = isTokenValid;
46
46
  /**
47
47
  * Utility function that retrieves the appropriate AuthConfig based on the URL search params.
48
48
  * Priority: TOKEN parameter (decoded azp claim) > CLIENT_ID parameter > first config (default)
@@ -59,4 +59,3 @@ function getAuthConfig(configs) {
59
59
  var matchingConfig = configs.find(function (config) { return config.clientId === targetClientId; });
60
60
  return matchingConfig !== null && matchingConfig !== void 0 ? matchingConfig : configs[0];
61
61
  }
62
- exports.getAuthConfig = getAuthConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/network",
3
- "version": "5.2.4",
3
+ "version": "5.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": "5.2.4",
32
- "@monkvision/sights": "5.2.4",
31
+ "@monkvision/common": "5.3.0",
32
+ "@monkvision/sights": "5.3.0",
33
33
  "jsonwebtoken": "^9.0.2",
34
34
  "jwt-decode": "^4.0.0",
35
35
  "ky": "^1.2.0",
@@ -37,20 +37,25 @@
37
37
  },
38
38
  "peerDependencies": {
39
39
  "@auth0/auth0-react": "^2.2.4",
40
- "react": "^17.0.2",
41
- "react-dom": "^17.0.2",
40
+ "react": "^19.2.3",
41
+ "react-dom": "^19.2.3",
42
42
  "react-router-dom": "^6.22.3"
43
43
  },
44
44
  "devDependencies": {
45
- "@monkvision/eslint-config-base": "5.2.4",
46
- "@monkvision/eslint-config-typescript": "5.2.4",
47
- "@monkvision/jest-config": "5.2.4",
48
- "@monkvision/prettier-config": "5.2.4",
49
- "@monkvision/types": "5.2.4",
50
- "@monkvision/typescript-config": "5.2.4",
51
- "@types/jest": "^29.2.2",
45
+ "@auth0/auth0-react": "^2.2.4",
46
+ "@monkvision/eslint-config-base": "5.3.0",
47
+ "@monkvision/eslint-config-typescript": "5.3.0",
48
+ "@monkvision/jest-config": "5.3.0",
49
+ "@monkvision/prettier-config": "5.3.0",
50
+ "@monkvision/types": "5.3.0",
51
+ "@monkvision/typescript-config": "5.3.0",
52
+ "@testing-library/dom": "^10.4.1",
53
+ "@testing-library/react": "^16.3.0",
54
+ "@types/jest": "^30",
52
55
  "@types/jsonwebtoken": "^9.0.5",
53
- "@types/node": "^18.11.9",
56
+ "@types/node": "^24.5.2",
57
+ "@types/react": "^19.1.10",
58
+ "@types/react-dom": "^19.1.7",
54
59
  "@types/uuid": "^9",
55
60
  "@typescript-eslint/eslint-plugin": "^5.43.0",
56
61
  "@typescript-eslint/parser": "^5.43.0",
@@ -64,13 +69,14 @@
64
69
  "eslint-plugin-prettier": "^4.2.1",
65
70
  "eslint-plugin-promise": "^6.1.1",
66
71
  "eslint-utils": "^3.0.0",
67
- "jest": "^29.3.1",
72
+ "jest": "^30.2",
68
73
  "mkdirp": "^1.0.4",
69
74
  "prettier": "^2.7.1",
75
+ "react-router-dom": "^6.22.3",
70
76
  "regexpp": "^3.2.0",
71
77
  "rimraf": "^3.0.2",
72
- "ts-jest": "^29.0.3",
73
- "typescript": "^4.8.4"
78
+ "ts-jest": "^29.4.6",
79
+ "typescript": "^5.9.2"
74
80
  },
75
81
  "prettier": "@monkvision/prettier-config",
76
82
  "publishConfig": {
@@ -84,5 +90,5 @@
84
90
  "url": "https://github.com/monkvision/monkjs/issues"
85
91
  },
86
92
  "homepage": "https://github.com/monkvision/monkjs",
87
- "gitHead": "9d5fbcb522c5d83f1285eba9b852d2b647295ba1"
93
+ "gitHead": "5e7b906951524069d0074c7142271b0568c53c47"
88
94
  }