@transmitsecurity/platform-web-sdk 2.2.0 → 2.3.2-beta-25104222190.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/CHANGELOG.md +5 -0
- package/dist/common.cjs +1 -1
- package/dist/common.js +1 -1
- package/dist/drs.cjs +1 -1
- package/dist/drs.js +1 -1
- package/dist/ido.cjs +1 -1
- package/dist/ido.d.ts +53 -44
- package/dist/ido.js +1 -1
- package/dist/idv.cjs +1 -1
- package/dist/idv.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/ts-platform-websdk.js +1 -1
- package/dist/web-sdk-drs+idv+webauthn+ido.js +1 -1
- package/dist/web-sdk.d.ts +54 -45
- package/dist/webauthn.cjs +1 -1
- package/dist/webauthn.js +1 -1
- package/package.json +7 -1
package/dist/ido.d.ts
CHANGED
|
@@ -51,6 +51,10 @@ interface StartJourneyOptions {
|
|
|
51
51
|
* Should client-server communication be double encrypted? Defaults to false.
|
|
52
52
|
*/
|
|
53
53
|
encrypted?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* An optional admin debug token to be passed to the Journey.
|
|
56
|
+
*/
|
|
57
|
+
adminDebugToken?: string;
|
|
54
58
|
}
|
|
55
59
|
/**
|
|
56
60
|
* @interface
|
|
@@ -61,6 +65,10 @@ interface StartSsoJourneyOptions {
|
|
|
61
65
|
* Should client-server communication be double encrypted? Defaults to false.
|
|
62
66
|
*/
|
|
63
67
|
encrypted?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
* An optional admin debug token to be passed to the Journey.
|
|
70
|
+
*/
|
|
71
|
+
adminDebugToken?: string;
|
|
64
72
|
}
|
|
65
73
|
/**
|
|
66
74
|
* @enum
|
|
@@ -217,7 +225,7 @@ declare enum IdoServiceResponseType {
|
|
|
217
225
|
/**
|
|
218
226
|
* @enum
|
|
219
227
|
* @description The enum for the Journey step ID, used when the journey step is a predefined typed action.
|
|
220
|
-
* The actions that do not use this are "
|
|
228
|
+
* The actions that do not use this are "Collect information" and "Login Form" which allow the journey author to define a custom ID.
|
|
221
229
|
* See also {@link IdoServiceResponse.journeyStepId}.
|
|
222
230
|
*/
|
|
223
231
|
declare enum IdoJourneyActionType {
|
|
@@ -244,7 +252,7 @@ declare enum IdoJourneyActionType {
|
|
|
244
252
|
* }
|
|
245
253
|
* }
|
|
246
254
|
* ```
|
|
247
|
-
* The client response does not need to include any data: `
|
|
255
|
+
* The client response does not need to include any data: `ido.submitClientResponse(ClientResponseOptionType.ClientInput);`
|
|
248
256
|
*/
|
|
249
257
|
Information = "action:information",
|
|
250
258
|
/**
|
|
@@ -254,7 +262,7 @@ declare enum IdoJourneyActionType {
|
|
|
254
262
|
*
|
|
255
263
|
* The {@link IdoServiceResponse} object does not include any data.
|
|
256
264
|
*
|
|
257
|
-
* The client response does not need to include any data: `
|
|
265
|
+
* The client response does not need to include any data: `ido.submitClientResponse(ClientResponseOptionType.ClientInput);`
|
|
258
266
|
*/
|
|
259
267
|
DebugBreak = "action:debug_break",
|
|
260
268
|
/**
|
|
@@ -263,7 +271,7 @@ declare enum IdoJourneyActionType {
|
|
|
263
271
|
* The {@link IdoServiceResponse} object includes information that can be presented as a QR to scan by another device.
|
|
264
272
|
* The response will remain the same while the cross session message was not consumed by the journey executed by the other device.
|
|
265
273
|
*
|
|
266
|
-
* The client response does not need to include any data: `
|
|
274
|
+
* The client response does not need to include any data: `ido.submitClientResponse(ClientResponseOptionType.ClientInput);`
|
|
267
275
|
*/
|
|
268
276
|
WaitForAnotherDevice = "action:wait_for_another_device",
|
|
269
277
|
/**
|
|
@@ -291,7 +299,7 @@ declare enum IdoJourneyActionType {
|
|
|
291
299
|
/**
|
|
292
300
|
* @description `journeyStepId` for WebAuthn Registration action.
|
|
293
301
|
*
|
|
294
|
-
* Data received in the {@link IdoServiceResponse} object: the input parameters that you need to send to `
|
|
302
|
+
* Data received in the {@link IdoServiceResponse} object: the input parameters that you need to send to `webauthn.register()`
|
|
295
303
|
* ```json
|
|
296
304
|
* {
|
|
297
305
|
* "data": {
|
|
@@ -303,10 +311,10 @@ declare enum IdoJourneyActionType {
|
|
|
303
311
|
* }
|
|
304
312
|
* ```
|
|
305
313
|
*
|
|
306
|
-
* Before responding, activate `
|
|
314
|
+
* Before responding, activate `webauthn.register()` to obtain the `webauthn_encoded_result` value.
|
|
307
315
|
* This will present the user with the WebAuthn registration UI. Use the result to send the client response:
|
|
308
316
|
* ```json
|
|
309
|
-
*
|
|
317
|
+
* ido.submitClientResponse(
|
|
310
318
|
* ClientResponseOptionType.ClientInput,
|
|
311
319
|
* {
|
|
312
320
|
* "webauthn_encoded_result": "<WEBAUTHN_ENCODED_RESULT_FROM_SDK>"
|
|
@@ -315,9 +323,9 @@ declare enum IdoJourneyActionType {
|
|
|
315
323
|
*/
|
|
316
324
|
WebAuthnRegistration = "action:webauthn_registration",
|
|
317
325
|
/**
|
|
318
|
-
* @description `journeyStepId` for instructing the use of
|
|
326
|
+
* @description `journeyStepId` for instructing the use of Fraud Prevention trigger action, as part of the Risk Recommendation journey step.
|
|
319
327
|
*
|
|
320
|
-
* Data received in the {@link IdoServiceResponse} object: the input parameters that you need to send to `
|
|
328
|
+
* Data received in the {@link IdoServiceResponse} object: the input parameters that you need to send to `drs.triggerActionEvent()`
|
|
321
329
|
* ```json
|
|
322
330
|
* {
|
|
323
331
|
* "data": {
|
|
@@ -327,13 +335,13 @@ declare enum IdoJourneyActionType {
|
|
|
327
335
|
* },
|
|
328
336
|
* }
|
|
329
337
|
* ```
|
|
330
|
-
* Before responding, activate `
|
|
338
|
+
* Before responding, activate `drs.triggerActionEvent()` to obtain the `action_token` value. This is a silent action, and does not require user interaction.
|
|
331
339
|
* Use the result to send the client response:
|
|
332
340
|
* ```json
|
|
333
|
-
*
|
|
341
|
+
* ido.submitClientResponse(
|
|
334
342
|
* ClientResponseOptionType.ClientInput,
|
|
335
343
|
* {
|
|
336
|
-
* "action_token": "<
|
|
344
|
+
* "action_token": "<Fraud Prevention action token>"
|
|
337
345
|
* })
|
|
338
346
|
* ```
|
|
339
347
|
*/
|
|
@@ -356,12 +364,12 @@ declare enum IdoJourneyActionType {
|
|
|
356
364
|
* }
|
|
357
365
|
* ```
|
|
358
366
|
* Use this data to redirect the user to the identity verification endpoint.
|
|
359
|
-
* Since this redirects to a different page, make sure you store the SDK state by calling `
|
|
360
|
-
* After the user completes the identity verification, you can restore the SDK state and continue the journey, by calling `
|
|
367
|
+
* Since this redirects to a different page, make sure you store the SDK state by calling `ido.serializeState()`, and saving the response data in the session storage.
|
|
368
|
+
* After the user completes the identity verification, you can restore the SDK state and continue the journey, by calling `ido.restoreFromSerializedState()` with the stored state.
|
|
361
369
|
*
|
|
362
370
|
* Once done, send the following client response:
|
|
363
371
|
* ```json
|
|
364
|
-
*
|
|
372
|
+
* ido.submitClientResponse(
|
|
365
373
|
* ClientResponseOptionType.ClientInput,
|
|
366
374
|
* {
|
|
367
375
|
* "payload": {
|
|
@@ -394,7 +402,7 @@ declare enum IdoJourneyActionType {
|
|
|
394
402
|
*
|
|
395
403
|
* - For simple submit of OTP passcode:
|
|
396
404
|
* ```json
|
|
397
|
-
*
|
|
405
|
+
* ido.submitClientResponse(
|
|
398
406
|
* ClientResponseOptionType.ClientInput,
|
|
399
407
|
* {
|
|
400
408
|
* "passcode": "<passcode>"
|
|
@@ -402,7 +410,7 @@ declare enum IdoJourneyActionType {
|
|
|
402
410
|
* ```
|
|
403
411
|
*
|
|
404
412
|
* - In Order to request resend of OTP (restart the action):
|
|
405
|
-
*
|
|
413
|
+
* `ido.submitClientResponse(ClientResponseOptionType.Resend)`
|
|
406
414
|
*
|
|
407
415
|
*/
|
|
408
416
|
EmailOTPAuthentication = "transmit_platform_email_otp_authentication",
|
|
@@ -428,7 +436,7 @@ declare enum IdoJourneyActionType {
|
|
|
428
436
|
*
|
|
429
437
|
* - For simple submit of OTP passcode:
|
|
430
438
|
* ```json
|
|
431
|
-
*
|
|
439
|
+
* ido.submitClientResponse(
|
|
432
440
|
* ClientResponseOptionType.ClientInput,
|
|
433
441
|
* {
|
|
434
442
|
* "passcode": "<passcode>"
|
|
@@ -436,7 +444,7 @@ declare enum IdoJourneyActionType {
|
|
|
436
444
|
* ```
|
|
437
445
|
*
|
|
438
446
|
* - In Order to request resend of OTP (restart the action):
|
|
439
|
-
*
|
|
447
|
+
* `ido.submitClientResponse(ClientResponseOptionType.Resend)`
|
|
440
448
|
*
|
|
441
449
|
*/
|
|
442
450
|
SmsOTPAuthentication = "transmit_platform_sms_otp_authentication",
|
|
@@ -462,7 +470,7 @@ declare enum IdoJourneyActionType {
|
|
|
462
470
|
*
|
|
463
471
|
* - For simple submit of OTP passcode:
|
|
464
472
|
* ```json
|
|
465
|
-
*
|
|
473
|
+
* ido.submitClientResponse(
|
|
466
474
|
* ClientResponseOptionType.ClientInput,
|
|
467
475
|
* {
|
|
468
476
|
* "passcode": "<passcode>"
|
|
@@ -470,7 +478,7 @@ declare enum IdoJourneyActionType {
|
|
|
470
478
|
* ```
|
|
471
479
|
*
|
|
472
480
|
* - In Order to request resend of OTP (restart the action):
|
|
473
|
-
*
|
|
481
|
+
* `ido.submitClientResponse(ClientResponseOptionType.Resend)`
|
|
474
482
|
*
|
|
475
483
|
*/
|
|
476
484
|
GenericOTPAuthentication = "transmit_platform_generic_otp_authentication",
|
|
@@ -492,7 +500,7 @@ declare enum IdoJourneyActionType {
|
|
|
492
500
|
* The user should use this to register the TOTP secret in their authenticator app.
|
|
493
501
|
* Once the user has completed the registration, send the following empty client response:
|
|
494
502
|
* ```json
|
|
495
|
-
*
|
|
503
|
+
* ido.submitClientResponse(
|
|
496
504
|
* ClientResponseOptionType.ClientInput
|
|
497
505
|
* )
|
|
498
506
|
* ```
|
|
@@ -521,7 +529,7 @@ declare enum IdoJourneyActionType {
|
|
|
521
529
|
*
|
|
522
530
|
* - For simple submit of validation passcode:
|
|
523
531
|
* ```json
|
|
524
|
-
*
|
|
532
|
+
* ido.submitClientResponse(
|
|
525
533
|
* ClientResponseOptionType.ClientInput,
|
|
526
534
|
* {
|
|
527
535
|
* "passcode": "<passcode>"
|
|
@@ -529,7 +537,7 @@ declare enum IdoJourneyActionType {
|
|
|
529
537
|
* ```
|
|
530
538
|
*
|
|
531
539
|
* - In Order to request resend of OTP (restart the action):
|
|
532
|
-
*
|
|
540
|
+
* `ido.submitClientResponse(ClientResponseOptionType.Resend)`
|
|
533
541
|
*
|
|
534
542
|
*/
|
|
535
543
|
EmailValidation = "transmit_platform_email_validation",
|
|
@@ -554,7 +562,7 @@ declare enum IdoJourneyActionType {
|
|
|
554
562
|
*
|
|
555
563
|
* - For simple submit of validation passcode:
|
|
556
564
|
* ```json
|
|
557
|
-
*
|
|
565
|
+
* ido.submitClientResponse(
|
|
558
566
|
* ClientResponseOptionType.ClientInput,
|
|
559
567
|
* {
|
|
560
568
|
* "passcode": "<passcode>"
|
|
@@ -562,7 +570,7 @@ declare enum IdoJourneyActionType {
|
|
|
562
570
|
* ```
|
|
563
571
|
*
|
|
564
572
|
* - In Order to request resend of OTP (restart the action):
|
|
565
|
-
*
|
|
573
|
+
* `ido.submitClientResponse(ClientResponseOptionType.Resend)`
|
|
566
574
|
*
|
|
567
575
|
*/
|
|
568
576
|
SmsValidation = "transmit_platform_sms_validation",
|
|
@@ -591,7 +599,7 @@ declare enum IdoJourneyActionType {
|
|
|
591
599
|
*
|
|
592
600
|
* - For submitting the TOTP code:
|
|
593
601
|
* ```json
|
|
594
|
-
*
|
|
602
|
+
* ido.submitClientResponse(
|
|
595
603
|
* ClientResponseOptionType.ClientInput,
|
|
596
604
|
* {
|
|
597
605
|
* "totp_code": "<6_DIGIT_TOTP_CODE>"
|
|
@@ -624,7 +632,7 @@ declare enum IdoJourneyActionType {
|
|
|
624
632
|
*
|
|
625
633
|
* Once done, send the following client response:
|
|
626
634
|
* ```json
|
|
627
|
-
*
|
|
635
|
+
* ido.submitClientResponse(
|
|
628
636
|
* ClientResponseOptionType.ClientInput,
|
|
629
637
|
* {
|
|
630
638
|
* "idp_response" : {
|
|
@@ -655,16 +663,16 @@ declare enum IdoJourneyActionType {
|
|
|
655
663
|
* }
|
|
656
664
|
* }
|
|
657
665
|
* ```
|
|
658
|
-
* Before responding, call `
|
|
666
|
+
* Before responding, call `webauthn.approve.modal()` to obtain the `webauthn_encoded_result` value.
|
|
659
667
|
* ```javascript
|
|
660
|
-
* const result = await
|
|
668
|
+
* const result = await webauthn.approve.modal(
|
|
661
669
|
* response.data.approval_data // Transaction details to be approved
|
|
662
670
|
* );
|
|
663
671
|
* ```
|
|
664
672
|
*
|
|
665
673
|
* Then submit the result:
|
|
666
674
|
* ```javascript
|
|
667
|
-
*
|
|
675
|
+
* ido.submitClientResponse(
|
|
668
676
|
* ClientResponseOptionType.ClientInput,
|
|
669
677
|
* {
|
|
670
678
|
* "webauthn_encoded_result": result
|
|
@@ -708,7 +716,7 @@ declare enum IdoJourneyActionType {
|
|
|
708
716
|
*
|
|
709
717
|
* For organization selection, send the following client response:
|
|
710
718
|
* ```javascript
|
|
711
|
-
*
|
|
719
|
+
* ido.submitClientResponse(
|
|
712
720
|
* ClientResponseOptionType.ClientInput,
|
|
713
721
|
* {
|
|
714
722
|
* "organization_id": "<ORGANIZATION_ID>"
|
|
@@ -743,7 +751,7 @@ declare enum IdoJourneyActionType {
|
|
|
743
751
|
*
|
|
744
752
|
* For device selection, send the following client response:
|
|
745
753
|
* ```javascript
|
|
746
|
-
*
|
|
754
|
+
* ido.submitClientResponse(
|
|
747
755
|
* ClientResponseOptionType.ClientInput,
|
|
748
756
|
* {
|
|
749
757
|
* "selected_device_code": "<DEVICE_CODE>"
|
|
@@ -775,17 +783,17 @@ declare enum IdoJourneyActionType {
|
|
|
775
783
|
* ```javascript
|
|
776
784
|
* // The application should implement its own polling mechanism
|
|
777
785
|
* // and call this method periodically to check the status
|
|
778
|
-
*
|
|
786
|
+
* ido.submitClientResponse(ClientResponseOptionType.ClientInput)
|
|
779
787
|
* ```
|
|
780
788
|
*
|
|
781
789
|
* - To cancel the authentication:
|
|
782
790
|
* ```javascript
|
|
783
|
-
*
|
|
791
|
+
* ido.submitClientResponse(ClientResponseOptionType.Cancel)
|
|
784
792
|
* ```
|
|
785
793
|
*
|
|
786
794
|
* - To resend the push notification:
|
|
787
795
|
* ```javascript
|
|
788
|
-
*
|
|
796
|
+
* ido.submitClientResponse(ClientResponseOptionType.Resend)
|
|
789
797
|
* ```
|
|
790
798
|
*
|
|
791
799
|
* Note: The application is responsible for implementing the polling mechanism
|
|
@@ -818,7 +826,7 @@ interface IdoServiceResponse {
|
|
|
818
826
|
readonly errorData?: IdoSdkError;
|
|
819
827
|
/**
|
|
820
828
|
* @description Contains the Journey step ID, allowing the client side to choose the correct handler and UI.
|
|
821
|
-
* This will be either a form ID for the "
|
|
829
|
+
* This will be either a form ID for the "Collect information" and "Login Form" journey steps,
|
|
822
830
|
* or one of {@link IdoJourneyActionType} for other actions.
|
|
823
831
|
*/
|
|
824
832
|
readonly journeyStepId?: IdoJourneyActionType | string;
|
|
@@ -852,7 +860,8 @@ interface IdoSdk {
|
|
|
852
860
|
* @throws {@link ErrorCode.InvalidInitOptions} in case of invalid init options.
|
|
853
861
|
* @example
|
|
854
862
|
* // Initialize an instance of the Identity Orchestration SDK using the unified SDK
|
|
855
|
-
*
|
|
863
|
+
* import { initialize } from '@transmitsecurity/platform-web-sdk';
|
|
864
|
+
* initialize({
|
|
856
865
|
* clientId: 'my-client-id',
|
|
857
866
|
* ido: { serverPath: 'https://api.transmitsecurity.io/ido'}
|
|
858
867
|
* });
|
|
@@ -869,7 +878,7 @@ interface IdoSdk {
|
|
|
869
878
|
* @example
|
|
870
879
|
* // Start a Journey with the id 'my-journey-id'
|
|
871
880
|
* try {
|
|
872
|
-
* const idoResponse = await
|
|
881
|
+
* const idoResponse = await ido.startJourney('my-journey-id', { additionalParams: 'additionalParams' });
|
|
873
882
|
* // Handle Journey response
|
|
874
883
|
* } catch(error) {
|
|
875
884
|
* switch(sdkError.errorCode) ...
|
|
@@ -886,7 +895,7 @@ interface IdoSdk {
|
|
|
886
895
|
* @example
|
|
887
896
|
* // Start a Journey with the Interaction ID '2456E855-05A0-4992-85C1-A2519CBB4AA7'
|
|
888
897
|
* try {
|
|
889
|
-
* const idoResponse = await
|
|
898
|
+
* const idoResponse = await ido.startSsoJourney('2456E855-05A0-4992-85C1-A2519CBB4AA7');
|
|
890
899
|
* // Handle Journey response
|
|
891
900
|
* } catch(error) {
|
|
892
901
|
* switch(sdkError.errorCode) ...
|
|
@@ -915,7 +924,7 @@ interface IdoSdk {
|
|
|
915
924
|
*
|
|
916
925
|
* // Submit the client input. The data inside the JSON correspond to the expected fields from the Journey step.
|
|
917
926
|
* try {
|
|
918
|
-
* const idoResponse = await
|
|
927
|
+
* const idoResponse = await ido.submitClientResponse(selectedInputOption, {
|
|
919
928
|
* 'userEmail': 'user@input.email',
|
|
920
929
|
* 'userPhone': '111-222-3333',
|
|
921
930
|
* });
|
|
@@ -932,7 +941,7 @@ interface IdoSdk {
|
|
|
932
941
|
serializeState(): string;
|
|
933
942
|
/**
|
|
934
943
|
* @description Restores the SDK state from a serialized state, can be used to recover from page redirects or refresh.
|
|
935
|
-
* The application code also receives the latest communication from the
|
|
944
|
+
* The application code also receives the latest communication from the Mosaic server.
|
|
936
945
|
* @param state - The state to restore from.
|
|
937
946
|
* @returns The last {@link IdoServiceResponse} that was received before the state was saved.
|
|
938
947
|
* @throws {@link ErrorCode.InvalidState} - Throws error if the provided state string is invalid.
|
|
@@ -940,8 +949,8 @@ interface IdoSdk {
|
|
|
940
949
|
restoreFromSerializedState(state: string): IdoServiceResponse;
|
|
941
950
|
/**
|
|
942
951
|
* @description This method will generate a debug PIN
|
|
943
|
-
*
|
|
944
|
-
*
|
|
952
|
+
* const debugPin = await ido.generateDebugPin();
|
|
953
|
+
* console.log(`Debug PIN: ${debugPin}`); // Output: Debug PIN: 1234
|
|
945
954
|
*/
|
|
946
955
|
generateDebugPin(): Promise<string>;
|
|
947
956
|
}
|