idmission-web-sdk 2.2.56 → 2.2.57
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/dist/components/submission/SubmissionProvider.d.ts.map +1 -1
- package/dist/sdk2.cjs.development.js +16 -3
- package/dist/sdk2.cjs.development.js.map +1 -1
- package/dist/sdk2.cjs.production.js +1 -1
- package/dist/sdk2.cjs.production.js.map +1 -1
- package/dist/sdk2.esm.js +16 -3
- package/dist/sdk2.esm.js.map +1 -1
- package/dist/sdk2.umd.development.js +16 -3
- package/dist/sdk2.umd.development.js.map +1 -1
- package/dist/sdk2.umd.production.js +1 -1
- package/dist/sdk2.umd.production.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +1 -1
package/dist/sdk2.esm.js
CHANGED
|
@@ -203,7 +203,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
203
203
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
204
204
|
};
|
|
205
205
|
|
|
206
|
-
var webSdkVersion = '2.2.
|
|
206
|
+
var webSdkVersion = '2.2.57';
|
|
207
207
|
|
|
208
208
|
function getPlatform() {
|
|
209
209
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -1305,7 +1305,7 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1305
1305
|
var uploadDocument = useCallback(function (src, metadata) {
|
|
1306
1306
|
return new Promise(function (resolve, reject) {
|
|
1307
1307
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
1308
|
-
var blob, _a, upload, _b, _c;
|
|
1308
|
+
var blob, _a, documentId, upload, _b, _c;
|
|
1309
1309
|
var _d, _e;
|
|
1310
1310
|
var _f;
|
|
1311
1311
|
return __generator(this, function (_g) {
|
|
@@ -1343,9 +1343,22 @@ var SubmissionProvider = function SubmissionProvider(_a) {
|
|
|
1343
1343
|
percentage: (bytesUploaded / bytesTotal * 100).toFixed(2) + '%',
|
|
1344
1344
|
metadata: metadata
|
|
1345
1345
|
});
|
|
1346
|
+
}, _d.onAfterResponse = function (_req, res) {
|
|
1347
|
+
var contentType = res.getHeader('Content-Type');
|
|
1348
|
+
if (!(contentType === null || contentType === void 0 ? void 0 : contentType.startsWith('application/json'))) return;
|
|
1349
|
+
var body = res.getBody();
|
|
1350
|
+
if (!body) return;
|
|
1351
|
+
try {
|
|
1352
|
+
var parsedId = JSON.parse(body).id;
|
|
1353
|
+
if (parsedId.startsWith('urn:documentsv1:')) {
|
|
1354
|
+
documentId = parsedId;
|
|
1355
|
+
}
|
|
1356
|
+
} catch (e) {
|
|
1357
|
+
warn('Failed to parse documents service response body', e);
|
|
1358
|
+
}
|
|
1346
1359
|
}, _d.onSuccess = function () {
|
|
1347
1360
|
var _a, _b;
|
|
1348
|
-
|
|
1361
|
+
documentId || (documentId = "urn:documentsv1:".concat((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
|
|
1349
1362
|
(_b = onDocumentUploaded.current) === null || _b === void 0 ? void 0 : _b.call(onDocumentUploaded, documentId, metadata);
|
|
1350
1363
|
resolve(documentId);
|
|
1351
1364
|
}, _d.onError = function (error) {
|