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.
@@ -211,7 +211,7 @@
211
211
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
212
212
  };
213
213
 
214
- var webSdkVersion = '2.2.57';
214
+ var webSdkVersion = '2.2.58';
215
215
 
216
216
  function getPlatform() {
217
217
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -2330,7 +2330,7 @@
2330
2330
  }
2331
2331
  }, _d.onSuccess = function () {
2332
2332
  var _a, _b;
2333
- documentId || (documentId = "urn:documentsv1:".concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
2333
+ documentId || (documentId = "urn:documentsv1:".concat(getEnvFromUrl(upload.url), ":").concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
2334
2334
  (_b = onDocumentUploaded.current) === null || _b === void 0 ? void 0 : _b.call(onDocumentUploaded, documentId, metadata);
2335
2335
  resolve(documentId);
2336
2336
  }, _d.onError = function (error) {
@@ -2885,6 +2885,20 @@
2885
2885
  };
2886
2886
  });
2887
2887
  }
2888
+ function getEnvFromUrl(url) {
2889
+ if (url.startsWith('https://portal-api.idmission.com')) {
2890
+ return 'prod';
2891
+ } else if (url.startsWith('https://portal-api-uat.idmission.com')) {
2892
+ return 'uat';
2893
+ } else if (url.startsWith('https://portal-api-demo.idmission.com')) {
2894
+ return 'demo';
2895
+ } else if (url.startsWith('https://portal-api-dev.idmission.com')) {
2896
+ return 'dev';
2897
+ } else if (url.startsWith('http://localhost:10000')) {
2898
+ return 'local';
2899
+ }
2900
+ return 'unknown';
2901
+ }
2888
2902
 
2889
2903
  // This could've been more streamlined with internal state instead of abusing
2890
2904
  // refs to such extent, but then composing hooks and components could not opt out of unnecessary renders.