idmission-web-sdk 1.0.202 → 1.0.203

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.
@@ -20,7 +20,7 @@ export interface DocumentCaptureProps extends PropsWithChildren {
20
20
  /** Callback function that fires when the user has completed the flow instead of making a call to IDmission's servers, allowing customers to specify their own submission logic. Arguments: the request payload that would have been dispatched to IDmission's API, which contains the images/documents/video submitted by the user. Note that when this parameter is supplied, `onComplete` will never fire, and the customer will need to implement their own error handling/retry logic. Use at your own risk! */
21
21
  onSubmit?: (req: SubmissionRequest) => void;
22
22
  /** Callback function that fires when the user completes the DocumentCapture flow. Arguments: the SubmissionResponse from IDmission's API is passed as an argument to the customer's application for further handling, which indicates whether the user passed the validation check, and the request payload dispatched to IDmission's API, which contains the images submitted by the user. */
23
- onComplete?: () => void;
23
+ onComplete?: (documentId: string) => void;
24
24
  /** Callback function that fires when the user clicks the exit button during ID or selfie capture. */
25
25
  onExitCapture?: () => void;
26
26
  /** Callback function that fires when the user clicks the exit button from the loading overlay, declining to engage with IDmission. Binding this callback results in the cancel button being rendered on the loading overlay. */
@@ -35,7 +35,7 @@ export type DocumentCaptureScreenProps = {
35
35
  cameraFeedMode?: CameraFeedMode;
36
36
  instructions?: ReactNode;
37
37
  onCaptureClicked?: () => void;
38
- onSuccess?: (blob: Blob) => void;
38
+ onSuccess?: (documentId: string) => void;
39
39
  classNames?: DocumentCaptureScreenClassNames;
40
40
  verbiage?: DocumentCaptureScreenVerbiage;
41
41
  };
@@ -4,7 +4,7 @@ import { CameraFeedMode } from '../../lib/camera/CameraFeedWrapper';
4
4
  export type DocumentCaptureWizardClassNames = DocumentCaptureScreenClassNames;
5
5
  export type DocumentCaptureWizardVerbiage = DocumentCaptureScreenVerbiage;
6
6
  export type DocumentCaptureWizardProps = {
7
- onSuccess?: () => void;
7
+ onSuccess?: (documentId: string) => void;
8
8
  onExitCapture?: () => void;
9
9
  onUserCancel?: () => void;
10
10
  aspectRatio?: number;
@@ -48,7 +48,7 @@ var LanguageDetector__default = /*#__PURE__*/_interopDefaultLegacy(LanguageDetec
48
48
  var i18n__default = /*#__PURE__*/_interopDefaultLegacy(i18n);
49
49
  var SignatureCanvas__default = /*#__PURE__*/_interopDefaultLegacy(SignatureCanvas);
50
50
 
51
- var webSdkVersion = '1.0.202';
51
+ var webSdkVersion = '1.0.203';
52
52
 
53
53
  function getPlatform() {
54
54
  if (typeof window === 'undefined') return;
@@ -1266,8 +1266,9 @@ var SubmissionProvider = function SubmissionProvider(_a) {
1266
1266
  console.log(bytesUploaded, bytesTotal, percentage + '%');
1267
1267
  },
1268
1268
  onSuccess: function onSuccess() {
1269
+ var _a;
1269
1270
  console.log('Download from %s', upload.url);
1270
- resolve(upload.url);
1271
+ resolve('urn:documentsv1:' + ((_a = upload.url.split('/files/').pop()) === null || _a === void 0 ? void 0 : _a.split('+').shift()));
1271
1272
  },
1272
1273
  onError: function onError(error) {
1273
1274
  console.log('Failed because: ' + error);
@@ -17206,6 +17207,7 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
17206
17207
  }
17207
17208
  function onSubmitClick() {
17208
17209
  return tslib.__awaiter(this, void 0, void 0, function () {
17210
+ var documentId;
17209
17211
  return tslib.__generator(this, function (_a) {
17210
17212
  switch (_a.label) {
17211
17213
  case 0:
@@ -17215,14 +17217,14 @@ var DocumentCaptureScreen = function DocumentCaptureScreen(_a) {
17215
17217
  });
17216
17218
  return [4 /*yield*/, uploadDocument(imageBlob)];
17217
17219
  case 1:
17218
- _a.sent();
17220
+ documentId = _a.sent();
17219
17221
  dispatch({
17220
17222
  type: 'uploadCompleted'
17221
17223
  });
17222
17224
  return [4 /*yield*/, submit()];
17223
17225
  case 2:
17224
17226
  _a.sent();
17225
- onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(imageBlob);
17227
+ onSuccess === null || onSuccess === void 0 ? void 0 : onSuccess(documentId);
17226
17228
  return [3 /*break*/, 4];
17227
17229
  case 3:
17228
17230
  _a.sent();