idmission-web-sdk 2.2.57 → 2.2.58

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.
@@ -234,7 +234,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
234
234
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
235
235
  };
236
236
 
237
- var webSdkVersion = '2.2.57';
237
+ var webSdkVersion = '2.2.58';
238
238
 
239
239
  function getPlatform() {
240
240
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -1389,7 +1389,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1389
1389
  }
1390
1390
  }, _d.onSuccess = function () {
1391
1391
  var _a, _b;
1392
- documentId || (documentId = "urn:documentsv1:".concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
1392
+ documentId || (documentId = "urn:documentsv1:".concat(getEnvFromUrl(upload.url), ":").concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
1393
1393
  (_b = onDocumentUploaded.current) === null || _b === void 0 ? void 0 : _b.call(onDocumentUploaded, documentId, metadata);
1394
1394
  resolve(documentId);
1395
1395
  }, _d.onError = function (error) {
@@ -1944,6 +1944,20 @@ function calculateMd5(blob) {
1944
1944
  };
1945
1945
  });
1946
1946
  }
1947
+ function getEnvFromUrl(url) {
1948
+ if (url.startsWith('https://portal-api.idmission.com')) {
1949
+ return 'prod';
1950
+ } else if (url.startsWith('https://portal-api-uat.idmission.com')) {
1951
+ return 'uat';
1952
+ } else if (url.startsWith('https://portal-api-demo.idmission.com')) {
1953
+ return 'demo';
1954
+ } else if (url.startsWith('https://portal-api-dev.idmission.com')) {
1955
+ return 'dev';
1956
+ } else if (url.startsWith('http://localhost:10000')) {
1957
+ return 'local';
1958
+ }
1959
+ return 'unknown';
1960
+ }
1947
1961
 
1948
1962
  var visionTasksBasePath = "https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@0.10.7/wasm";
1949
1963
  var visionRuntimePreloading = false;