idwise-nfc-react-native-sdk 0.0.1-alpha1

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.
Files changed (125) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +48 -0
  3. package/android/build.gradle +117 -0
  4. package/android/gradle.properties +7 -0
  5. package/android/src/main/AndroidManifest.xml +3 -0
  6. package/android/src/main/AndroidManifestNew.xml +2 -0
  7. package/android/src/main/java/com/idwisemobilesdk/IdwiseMobileSdkModule.kt +236 -0
  8. package/android/src/main/java/com/idwisemobilesdk/IdwiseMobileSdkPackage.kt +17 -0
  9. package/idwise-react-native-sdk.podspec +65 -0
  10. package/ios/IDWiseNFC.framework/Assets.car +0 -0
  11. package/ios/IDWiseNFC.framework/BulletCell.nib +0 -0
  12. package/ios/IDWiseNFC.framework/BulletCellRTL.nib +0 -0
  13. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/DocumentCategorySelectionViewController.nib/objects-13.0+.nib +0 -0
  14. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/DocumentCategorySelectionViewController.nib/runtime.nib +0 -0
  15. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/Info.plist +0 -0
  16. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/objects-13.0+.nib +0 -0
  17. package/ios/IDWiseNFC.framework/DocumentCategorySelectionViewController.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/runtime.nib +0 -0
  18. package/ios/IDWiseNFC.framework/DocumentTypeTableViewCell.nib +0 -0
  19. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/HuT-DA-csJ-view-fPz-Uk-RnY.nib/objects-13.0+.nib +0 -0
  20. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/HuT-DA-csJ-view-fPz-Uk-RnY.nib/runtime.nib +0 -0
  21. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/Info.plist +0 -0
  22. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/UIViewController-HuT-DA-csJ.nib/objects-13.0+.nib +0 -0
  23. package/ios/IDWiseNFC.framework/DocumentViewController.storyboardc/UIViewController-HuT-DA-csJ.nib/runtime.nib +0 -0
  24. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/ErrorFeedbackViewController.nib/objects-13.0+.nib +0 -0
  25. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/ErrorFeedbackViewController.nib/runtime.nib +0 -0
  26. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/Info.plist +0 -0
  27. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/objects-13.0+.nib +0 -0
  28. package/ios/IDWiseNFC.framework/ErrorFeedbackViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/runtime.nib +0 -0
  29. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/Info.plist +0 -0
  30. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/UIViewController-Y6W-OH-hqX.nib/objects-13.0+.nib +0 -0
  31. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/UIViewController-Y6W-OH-hqX.nib/runtime.nib +0 -0
  32. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/objects-13.0+.nib +0 -0
  33. package/ios/IDWiseNFC.framework/FinishJourneyViewContoller.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib/runtime.nib +0 -0
  34. package/ios/IDWiseNFC.framework/Headers/IDWise.h +18 -0
  35. package/ios/IDWiseNFC.framework/IDWiseNFC +0 -0
  36. package/ios/IDWiseNFC.framework/Info.plist +0 -0
  37. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/A5G-4b-J84-view-Avi-oP-H2l.nib/objects-13.0+.nib +0 -0
  38. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/A5G-4b-J84-view-Avi-oP-H2l.nib/runtime.nib +0 -0
  39. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/Info.plist +0 -0
  40. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/UIViewController-A5G-4b-J84.nib/objects-13.0+.nib +0 -0
  41. package/ios/IDWiseNFC.framework/JourneyIntroductionViewController.storyboardc/UIViewController-A5G-4b-J84.nib/runtime.nib +0 -0
  42. package/ios/IDWiseNFC.framework/MenuCell.nib +0 -0
  43. package/ios/IDWiseNFC.framework/MenuWidgetView.nib +0 -0
  44. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
  45. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
  46. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.abi.json +46777 -0
  47. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.private.swiftinterface +539 -0
  48. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
  49. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftinterface +539 -0
  50. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
  51. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.abi.json +46770 -0
  52. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +539 -0
  53. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
  54. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +539 -0
  55. package/ios/IDWiseNFC.framework/Modules/IDWiseNFC.swiftmodule/x86_64-apple-ios-simulator.swiftmodule +0 -0
  56. package/ios/IDWiseNFC.framework/Mulish-Bold.ttf +0 -0
  57. package/ios/IDWiseNFC.framework/Mulish-Light.ttf +0 -0
  58. package/ios/IDWiseNFC.framework/Mulish-Regular.ttf +0 -0
  59. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/Info.plist +0 -0
  60. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/ProcessJourneyViewController.nib/objects-13.0+.nib +0 -0
  61. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/ProcessJourneyViewController.nib/runtime.nib +0 -0
  62. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/yS7-79-T86-view-owr-v5-NaP.nib/objects-13.0+.nib +0 -0
  63. package/ios/IDWiseNFC.framework/ProcessJourneyViewController.storyboardc/yS7-79-T86-view-owr-v5-NaP.nib/runtime.nib +0 -0
  64. package/ios/IDWiseNFC.framework/ProgressBarMenuScreen.nib/objects-13.0+.nib +0 -0
  65. package/ios/IDWiseNFC.framework/ProgressBarMenuScreen.nib/runtime.nib +0 -0
  66. package/ios/IDWiseNFC.framework/ProgressBarView.nib/objects-13.0+.nib +0 -0
  67. package/ios/IDWiseNFC.framework/ProgressBarView.nib/runtime.nib +0 -0
  68. package/ios/IDWiseNFC.framework/RegulaSDKController.storyboardc/Info.plist +0 -0
  69. package/ios/IDWiseNFC.framework/RegulaSDKController.storyboardc/RegulaSDKController.nib +0 -0
  70. package/ios/IDWiseNFC.framework/RegulaSDKController.storyboardc/Y6W-OH-hqX-view-5EZ-qb-Rvc.nib +0 -0
  71. package/ios/IDWiseNFC.framework/SelfieViewController.storyboardc/Info.plist +0 -0
  72. package/ios/IDWiseNFC.framework/SelfieViewController.storyboardc/Od6-6k-VCn-view-avu-y3-b61.nib +0 -0
  73. package/ios/IDWiseNFC.framework/SelfieViewController.storyboardc/UIViewController-Od6-6k-VCn.nib +0 -0
  74. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/Info.plist +0 -0
  75. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/StartJourneyViewController.nib/objects-13.0+.nib +0 -0
  76. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/StartJourneyViewController.nib/runtime.nib +0 -0
  77. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/objects-13.0+.nib +0 -0
  78. package/ios/IDWiseNFC.framework/StartJourneyViewController.storyboardc/eni-V6-pg3-view-IG7-Dw-aVZ.nib/runtime.nib +0 -0
  79. package/ios/IDWiseNFC.framework/StepCell.nib +0 -0
  80. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/analytics/coremldata.bin +0 -0
  81. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/coremldata.bin +0 -0
  82. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/metadata.json +115 -0
  83. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/analytics/coremldata.bin +0 -0
  84. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/coremldata.bin +0 -0
  85. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model/coremldata.bin +0 -0
  86. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model.espresso.net +4737 -0
  87. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model.espresso.shape +1789 -0
  88. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/model.espresso.weights +0 -0
  89. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model0/neural_network_optionals/coremldata.bin +0 -0
  90. package/ios/IDWiseNFC.framework/document_detector.mlmodelc/model1/coremldata.bin +0 -0
  91. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/analytics/coremldata.bin +0 -0
  92. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/coremldata.bin +0 -0
  93. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/metadata.json +79 -0
  94. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model/coremldata.bin +0 -0
  95. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model.espresso.net +2250 -0
  96. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model.espresso.shape +718 -0
  97. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/model.espresso.weights +0 -0
  98. package/ios/IDWiseNFC.framework/document_quality_model.mlmodelc/neural_network_optionals/coremldata.bin +0 -0
  99. package/ios/IDWiseNFC.framework/en.lproj/Localizable.strings +0 -0
  100. package/ios/IDWiseNFC.framework/journey_image_config.json +96 -0
  101. package/ios/IDWiseNFC.framework/regula.license +0 -0
  102. package/ios/IdwiseMobileSdk-Bridging-Header.h +2 -0
  103. package/ios/IdwiseMobileSdk.mm +37 -0
  104. package/ios/IdwiseMobileSdk.swift +269 -0
  105. package/lib/commonjs/IDWise.js +74 -0
  106. package/lib/commonjs/IDWise.js.map +1 -0
  107. package/lib/commonjs/IDWiseConstants.js +26 -0
  108. package/lib/commonjs/IDWiseConstants.js.map +1 -0
  109. package/lib/commonjs/IDWiseEventListeners.js +79 -0
  110. package/lib/commonjs/IDWiseEventListeners.js.map +1 -0
  111. package/lib/commonjs/index.js +15 -0
  112. package/lib/commonjs/index.js.map +1 -0
  113. package/lib/module/IDWise.js +68 -0
  114. package/lib/module/IDWise.js.map +1 -0
  115. package/lib/module/IDWiseConstants.js +20 -0
  116. package/lib/module/IDWiseConstants.js.map +1 -0
  117. package/lib/module/IDWiseEventListeners.js +70 -0
  118. package/lib/module/IDWiseEventListeners.js.map +1 -0
  119. package/lib/module/index.js +7 -0
  120. package/lib/module/index.js.map +1 -0
  121. package/package.json +164 -0
  122. package/src/IDWise.js +123 -0
  123. package/src/IDWiseConstants.js +23 -0
  124. package/src/IDWiseEventListeners.js +105 -0
  125. package/src/index.js +4 -0
@@ -0,0 +1,96 @@
1
+ {
2
+ "journey_document": "document",
3
+ "journey_selfie": "selfie",
4
+ "journey_document_opt_selfie": "one_documents_one_selfie",
5
+ "journey_document_prompt_opt_selfie": "one_documents_one_selfie",
6
+ "journey_two_documents_selfie": "two_documents_one_selfie",
7
+ "journey_two_documents_opts_selfie": "two_documents_one_selfie",
8
+ "journey_document_selfie_mcs": "one_documents_one_selfie",
9
+ "journey_document_selfie_mcs_try_again": "one_documents_one_selfie",
10
+ "journey_document_selfie_mcs_resume_sequential": "one_documents_one_selfie",
11
+ "journey_document_selfie_mcs_invalid": "one_documents_one_selfie_invalid",
12
+ "journey_document_selfie_mcs_invalid_resume_journey": "one_documents_one_selfie_invalid",
13
+ "journey_two_documents_selfie_mcs": "two_documents_one_selfie",
14
+ "journey_two_documents_opt_selfie_mcs": "two_documents_one_selfie",
15
+ "journey_document_mcs": "document",
16
+ "journey_document_selfie": "one_documents_one_selfie",
17
+ "journey_document_selfie_invalid": "one_documents_one_selfie_invalid",
18
+ "journey_two_documents_opt_selfie": "two_documents_one_selfie",
19
+ "journey_selfie_opt_two_documents_opt": "one_selfie_two_documents",
20
+ "journey_document_opt_selfie_mcs": "one_documents_one_selfie",
21
+ "journey_document_prompt_opt_selfie_mcs": "one_documents_one_selfie",
22
+ "journey_two_documents_opts_selfie_mcs": "two_documents_one_selfie",
23
+ "journey_selfie_opt_two_documents_opt_mcs": "one_selfie_two_documents",
24
+ "selfie": {
25
+ "0": [
26
+ "selfie"
27
+ ]
28
+ },
29
+ "document": {
30
+ "0": [
31
+ "dl_front"
32
+ ],
33
+ "1": [
34
+ "dl_back"
35
+ ]
36
+ },
37
+ "one_documents_one_selfie": {
38
+ "0": [
39
+ "dl_front"
40
+ ],
41
+ "1": [
42
+ "dl_back"
43
+ ],
44
+ "2": [
45
+ "selfie"
46
+ ]
47
+ },
48
+ "one_documents_one_selfie_invalid": {
49
+ "0": [
50
+ "invalid_document",
51
+ "dl_front"
52
+ ],
53
+ "1": [
54
+ "invalid_document",
55
+ "dl_back"
56
+ ],
57
+ "2": [
58
+ "invalid_selfie",
59
+ "selfie"
60
+ ]
61
+ },
62
+ "two_documents_one_selfie": {
63
+ "0": [
64
+ "dl_front"
65
+ ],
66
+ "1": [
67
+ "dl_back"
68
+ ],
69
+ "2": [
70
+ "dl_front"
71
+ ],
72
+ "3": [
73
+ "dl_back"
74
+ ],
75
+ "4": [
76
+ "selfie"
77
+ ]
78
+ },
79
+ "one_selfie_two_documents": {
80
+ "0": [
81
+ "selfie"
82
+ ],
83
+ "1": [
84
+ "dl_front"
85
+ ],
86
+ "2": [
87
+ "dl_back"
88
+ ],
89
+ "3": [
90
+ "dl_front"
91
+ ],
92
+ "4": [
93
+ "dl_back"
94
+ ]
95
+ }
96
+ }
@@ -0,0 +1,2 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <React/RCTViewManager.h>
@@ -0,0 +1,37 @@
1
+ #import <React/RCTBridgeModule.h>
2
+ #import <Foundation/Foundation.h>
3
+ #import <React/RCTEventEmitter.h>
4
+
5
+
6
+ @interface RCT_EXTERN_MODULE(IdwiseMobileSdk,RCTEventEmitter)
7
+
8
+ RCT_EXTERN_METHOD(initialize:(NSString *)clientKey
9
+ :(NSString *)theme)
10
+
11
+ RCT_EXTERN_METHOD(startJourney:(NSString *)journeyDefinitionId
12
+ :(NSString *)referenceNo
13
+ :(NSString *)locale)
14
+ RCT_EXTERN_METHOD(startDynamicJourney:(NSString *)journeyDefinitionId
15
+ :(NSString *)referenceNo
16
+ :(NSString *)locale)
17
+ RCT_EXTERN_METHOD(resumeDynamicJourney:(NSString *)journeyDefinitionId
18
+ :(NSString *)journeyId
19
+ :(NSString *)locale)
20
+ RCT_EXTERN_METHOD(resumeJourney:(NSString *)journeyDefinitionId
21
+ :(NSString *)journeyId
22
+ :(NSString *)locale)
23
+ RCT_EXTERN_METHOD(getJourneySummary)
24
+ RCT_EXTERN_METHOD(finishDynamicJourney)
25
+ RCT_EXTERN_METHOD(skipStep:(NSString *)stepId)
26
+ RCT_EXTERN_METHOD(startStep:(NSString *)stepId)
27
+ RCT_EXTERN_METHOD(startStepFromFileUpload:(NSString *)stepId
28
+ :(NSData *)data
29
+ )
30
+ RCT_EXTERN_METHOD(supportedEvents)
31
+
32
+ + (BOOL)requiresMainQueueSetup
33
+ {
34
+ return NO;
35
+ }
36
+
37
+ @end
@@ -0,0 +1,269 @@
1
+ import Foundation
2
+ import IDWiseNFC
3
+ import React
4
+
5
+ @objc(IdwiseMobileSdk)
6
+ class IdwiseMobileSdk: RCTEventEmitter {
7
+
8
+ var journeyID = ""
9
+
10
+ public static var emitter: RCTEventEmitter!
11
+
12
+ open override func supportedEvents() -> [String] {
13
+ [
14
+ "onJourneyStarted", "onJourneyResumed", "onJourneyCancelled", "onError", "onJourneyError",
15
+ "onJourneyFinished",
16
+ "onJourneySummary", "onStepCaptured", "onStepResult", "onStepCancelled", "onStepSkipped",
17
+ "onInitializeError",
18
+ "onJourneySummaryError",
19
+ ]
20
+ }
21
+
22
+ override init() {
23
+ super.init()
24
+ IdwiseMobileSdk.emitter = self
25
+ }
26
+
27
+ @objc func initialize(_ clientKey: String, _ theme: String) {
28
+ var sdkTheme: IDWiseSDKTheme = .systemDefault
29
+ if theme == "LIGHT" {
30
+ sdkTheme = .light
31
+ } else if theme == "DARK" {
32
+ sdkTheme = .dark
33
+ }
34
+ IDWise.initialize(clientKey: clientKey, theme: sdkTheme) { err in
35
+ if let error = err {
36
+ IdwiseMobileSdk.emitter.sendEvent(
37
+ withName: "onInitializeError",
38
+ body: ["errorCode": error.code, "errorMessage": error.message] as [String: Any])
39
+ }
40
+ }
41
+
42
+ }
43
+
44
+ @objc func startJourney(
45
+ _ journeyDefinitionID: String,
46
+ _ referenceNo: String,
47
+ _ locale: String
48
+ ) {
49
+ if referenceNo.isEmpty {
50
+ DispatchQueue.main.async {
51
+ IDWise.startJourney(
52
+ journeyDefinitionId: journeyDefinitionID, locale: locale, journeyDelegate: self)
53
+ }
54
+ } else {
55
+ DispatchQueue.main.async {
56
+ IDWise.startJourney(
57
+ journeyDefinitionId: journeyDefinitionID, referenceNumber: referenceNo, locale: locale,
58
+ journeyDelegate: self)
59
+ }
60
+ }
61
+ }
62
+
63
+ @objc func startDynamicJourney(
64
+ _ journeyDefinitionId: String,
65
+ _ referenceNo: String,
66
+ _ locale: String
67
+ ) {
68
+ if referenceNo.isEmpty {
69
+ DispatchQueue.main.async {
70
+ IDWise.startDynamicJourney(
71
+ journeyDefinitionId: journeyDefinitionId,
72
+ locale: locale,
73
+ journeyDelegate: self,
74
+ stepDelegate: self)
75
+ }
76
+ } else {
77
+ DispatchQueue.main.async {
78
+ IDWise.startDynamicJourney(
79
+ journeyDefinitionId: journeyDefinitionId,
80
+ referenceNumber: referenceNo,
81
+ locale: locale,
82
+ journeyDelegate: self,
83
+ stepDelegate: self)
84
+ }
85
+ }
86
+ }
87
+
88
+ @objc func resumeJourney(
89
+ _ journeyDefinitionId: String,
90
+ _ journeyId: String,
91
+ _ locale: String
92
+ ) {
93
+ /*DispatchQueue.main.async {
94
+ IDWise.resumeJourney(
95
+ journeyDefinitionId: journeyDefinitionId, journeyId: journeyId, locale: locale,
96
+ journeyDelegate: self)
97
+ }*/
98
+ }
99
+
100
+ @objc func resumeDynamicJourney(
101
+ _ journeyDefinitionId: String,
102
+ _ journeyId: String,
103
+ _ locale: String
104
+ ) {
105
+ DispatchQueue.main.async {
106
+ IDWise.resumeDynamicJourney(
107
+ journeyDefinitionId: journeyDefinitionId, journeyId: journeyId, locale: locale,
108
+ journeyDelegate: self, stepDelegate: self)
109
+ }
110
+ }
111
+
112
+ @objc func skipStep(_ stepId: String) {
113
+ DispatchQueue.main.async {
114
+ IDWise.skipStep(stepId: stepId)
115
+ }
116
+ }
117
+
118
+ @objc func startStep(_ stepId: String) {
119
+ DispatchQueue.main.async {
120
+ IDWise.startStep(stepId: stepId)
121
+ }
122
+ }
123
+
124
+ @objc func startStepFromFileUpload(
125
+ _ stepId: String,
126
+ _ data: Data
127
+ ) {
128
+ DispatchQueue.main.async {
129
+ IDWise.startStepFromFileUpload(stepId: stepId, data: data)
130
+ }
131
+ }
132
+
133
+ @objc func getJourneySummary() {
134
+ IDWise.getJourneySummary(
135
+ callback: { journeySummary, error in
136
+ if let summary = journeySummary {
137
+
138
+ // encoding JSON response so react-native can consume it correctly
139
+ var journeyStepSummaries = ""
140
+
141
+ do {
142
+ let encodedStepSummaries = try JSONEncoder().encode(summary)
143
+ if let jsonString = String(
144
+ data: encodedStepSummaries,
145
+ encoding: .utf8)
146
+ {
147
+ journeyStepSummaries = jsonString
148
+ }
149
+
150
+ } catch {}
151
+
152
+ IdwiseMobileSdk.emitter.sendEvent(
153
+ withName: "onJourneySummary",
154
+ body: ["summary": journeyStepSummaries] as [String: Any])
155
+ } else {
156
+ if let err = error {
157
+ IdwiseMobileSdk.emitter.sendEvent(
158
+ withName: "onJourneySummaryError",
159
+ body: ["errorCode": err.code, "errorMessage": err.message] as [String: Any])
160
+ }
161
+ }
162
+
163
+ })
164
+ }
165
+
166
+ @objc func finishDynamicJourney() {
167
+ DispatchQueue.main.async {
168
+ IDWise.finishDynamicJourney()
169
+ }
170
+ }
171
+
172
+ @objc func unloadSDK() {
173
+ DispatchQueue.main.async {
174
+ IDWise.unloadSDK()
175
+ }
176
+ }
177
+
178
+ // Delegate Methods bridging
179
+ @objc func journeyStarted(_ callback: RCTResponseSenderBlock) {
180
+
181
+ }
182
+
183
+ }
184
+
185
+ extension IdwiseMobileSdk: IDWiseSDKJourneyDelegate {
186
+
187
+ @objc func JourneyStarted(journeyID: String) {
188
+ print("Journey started with journey Id : \(journeyID)")
189
+ self.journeyID = journeyID
190
+ IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyStarted", body: ["journeyId": journeyID])
191
+ }
192
+
193
+ func onJourneyResumed(journeyID: String) {
194
+ self.journeyID = journeyID
195
+ IdwiseMobileSdk.emitter.sendEvent(withName: "onJourneyResumed", body: ["journeyId": journeyID])
196
+ print("Journey resumed with journey Id : \(journeyID)")
197
+
198
+ }
199
+
200
+ func JourneyFinished() {
201
+ IdwiseMobileSdk.emitter.sendEvent(
202
+ withName: "onJourneyFinished", body: ["journeyId": self.journeyID])
203
+ print("Journey Finished")
204
+ }
205
+
206
+ func JourneyCancelled() {
207
+ print("Journey Cancelled")
208
+ IdwiseMobileSdk.emitter.sendEvent(
209
+ withName: "onJourneyCancelled", body: ["journeyId": self.journeyID])
210
+
211
+ }
212
+
213
+ func onError(error: IDWiseSDKError) {
214
+ IdwiseMobileSdk.emitter.sendEvent(
215
+ withName: "onJourneyError",
216
+ body: ["errorCode": error.code, "errorMessage": error.message] as [String: Any])
217
+ }
218
+ }
219
+
220
+ extension IdwiseMobileSdk: IDWiseSDKStepDelegate {
221
+ func onStepCaptured(stepId: Int, capturedImage: UIImage?) {
222
+ let base64EncodedString = convertImageToBase64String(img: capturedImage)
223
+ let response =
224
+ ["stepId": "\(stepId)", "capturedImage": base64EncodedString] as [String: String]
225
+
226
+ IdwiseMobileSdk.emitter.sendEvent(withName: "onStepCaptured", body: response)
227
+ }
228
+
229
+ func onStepResult(stepId: Int, stepResult: StepResult?) {
230
+
231
+ // encoding JSON response so react-native can consume it correctly
232
+
233
+ var stepResultObj = ""
234
+ do {
235
+ let encodedStepResult = try JSONEncoder().encode(stepResult)
236
+ if let jsonString = String(
237
+ data: encodedStepResult,
238
+ encoding: .utf8)
239
+ {
240
+ stepResultObj = jsonString
241
+ }
242
+ } catch {}
243
+
244
+ IdwiseMobileSdk.emitter.sendEvent(
245
+ withName: "onStepResult",
246
+ body: ["stepId": stepId, "stepResult": stepResultObj] as [String: Any])
247
+ }
248
+
249
+ func onStepConfirmed(stepId: String) {
250
+
251
+ }
252
+
253
+ func onStepCancelled(stepId: String) {
254
+
255
+ IdwiseMobileSdk.emitter.sendEvent(
256
+ withName: "onStepCancelled", body: ["stepId": stepId])
257
+ }
258
+
259
+ func onStepSkipped(stepId: String) {
260
+
261
+ IdwiseMobileSdk.emitter.sendEvent(
262
+ withName: "onStepSkipped", body: ["stepId": stepId])
263
+ }
264
+
265
+ func convertImageToBase64String(img: UIImage?) -> String {
266
+ return img?.jpegData(compressionQuality: 1)?.base64EncodedString() ?? ""
267
+ }
268
+
269
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IDWise = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _IDWiseEventListeners = require("./IDWiseEventListeners");
9
+ const LINKING_ERROR = `The package 'idwise-mobile-sdk' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
10
+ ios: "- You have run 'pod install'\n",
11
+ default: ''
12
+ }) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
13
+ const RNIDWise = _reactNative.NativeModules.IdwiseMobileSdk ? _reactNative.NativeModules.IdwiseMobileSdk : new Proxy({}, {
14
+ get() {
15
+ throw new Error(LINKING_ERROR);
16
+ }
17
+ });
18
+ const initialize = (clientKey, theme, callback) => {
19
+ console.log('IDWise - initialize');
20
+ (0, _IDWiseEventListeners.setInitializeEventListeners)(callback);
21
+ RNIDWise.initialize(clientKey, theme);
22
+ };
23
+ const startJourney = (journeyDefinitionId, referenceNo, locale, journeyCallback) => {
24
+ console.log('IDWise - startJourney');
25
+ (0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
26
+ (0, _IDWiseEventListeners.setStepEventListeners)(null);
27
+ RNIDWise.startJourney(journeyDefinitionId, referenceNo, locale);
28
+ };
29
+ const startDynamicJourney = (journeyDefinitionId, referenceNo, locale, journeyCallback, stepCallback) => {
30
+ console.log('IDWise - startDynamicJourney');
31
+ (0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
32
+ (0, _IDWiseEventListeners.setStepEventListeners)(stepCallback);
33
+ RNIDWise.startDynamicJourney(journeyDefinitionId, referenceNo, locale);
34
+ };
35
+ const resumeDynamicJourney = (journeyDefinitionId, journeyId, locale, journeyCallback, stepCallback) => {
36
+ console.log('IDWise - resumeDynamicJourney');
37
+ (0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
38
+ (0, _IDWiseEventListeners.setStepEventListeners)(stepCallback);
39
+ RNIDWise.resumeDynamicJourney(journeyDefinitionId, journeyId, locale);
40
+ };
41
+ const resumeJourney = (journeyDefinitionId, journeyId, locale, journeyCallback) => {
42
+ console.log('IDWise - resumeJourney');
43
+ (0, _IDWiseEventListeners.setJourneyEventListeners)(journeyCallback);
44
+ RNIDWise.resumeJourney(journeyDefinitionId, journeyId, locale);
45
+ };
46
+ const startStep = stepId => RNIDWise.startStep(stepId);
47
+ const skipStep = stepId => RNIDWise.skipStep(stepId);
48
+ const getJourneySummary = callback => {
49
+ console.log('IDWise - getJourneySummary');
50
+ (0, _IDWiseEventListeners.setJourneySummaryEventListener)(callback);
51
+ RNIDWise.getJourneySummary();
52
+ };
53
+ const finishDynamicJourney = () => {
54
+ console.log('IDWise - finishDynamicJourney');
55
+ RNIDWise.finishDynamicJourney();
56
+ };
57
+ const unloadSDK = () => {
58
+ console.log('IDWise - unloadSDK');
59
+ RNIDWise.unloadSDK();
60
+ };
61
+ const IDWise = exports.IDWise = {
62
+ initialize,
63
+ startJourney,
64
+ startDynamicJourney,
65
+ resumeDynamicJourney,
66
+ startStep,
67
+ getJourneySummary,
68
+ finishDynamicJourney,
69
+ skipStep,
70
+ //TODO: uncomment below once it is implemented on iOS
71
+ //resumeJourney,
72
+ unloadSDK
73
+ };
74
+ //# sourceMappingURL=IDWise.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_IDWiseEventListeners","LINKING_ERROR","Platform","select","ios","default","RNIDWise","NativeModules","IdwiseMobileSdk","Proxy","get","Error","initialize","clientKey","theme","callback","console","log","setInitializeEventListeners","startJourney","journeyDefinitionId","referenceNo","locale","journeyCallback","setJourneyEventListeners","setStepEventListeners","startDynamicJourney","stepCallback","resumeDynamicJourney","journeyId","resumeJourney","startStep","stepId","skipStep","getJourneySummary","setJourneySummaryEventListener","finishDynamicJourney","unloadSDK","IDWise","exports"],"sourceRoot":"../../src","sources":["IDWise.js"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AAOA,MAAME,aAAa,GAChB,4EAA2E,GAC5EC,qBAAQ,CAACC,MAAM,CAAC;EAAEC,GAAG,EAAE,gCAAgC;EAAEC,OAAO,EAAE;AAAG,CAAC,CAAC,GACvE,sDAAsD,GACtD,+BAA+B;AAEjC,MAAMC,QAAQ,GAAGC,0BAAa,CAACC,eAAe,GAC1CD,0BAAa,CAACC,eAAe,GAC7B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACV,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMW,UAAU,GAAGA,CAACC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,KAAK;EACjDC,OAAO,CAACC,GAAG,CAAC,qBAAqB,CAAC;EAClC,IAAAC,iDAA2B,EAACH,QAAQ,CAAC;EAErCT,QAAQ,CAACM,UAAU,CAACC,SAAS,EAAEC,KAAK,CAAC;AACvC,CAAC;AAED,MAAMK,YAAY,GAAGA,CACnBC,mBAAmB,EACnBC,WAAW,EACXC,MAAM,EACNC,eAAe,KACZ;EACHP,OAAO,CAACC,GAAG,CAAC,uBAAuB,CAAC;EACpC,IAAAO,8CAAwB,EAACD,eAAe,CAAC;EACzC,IAAAE,2CAAqB,EAAC,IAAI,CAAC;EAE3BnB,QAAQ,CAACa,YAAY,CAACC,mBAAmB,EAAEC,WAAW,EAAEC,MAAM,CAAC;AACjE,CAAC;AAED,MAAMI,mBAAmB,GAAGA,CAC1BN,mBAAmB,EACnBC,WAAW,EACXC,MAAM,EACNC,eAAe,EACfI,YAAY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AE5CX,QAAQ,CAAC8B,oBAAoB,CAAC,CAAC;AACjC,CAAC;AAED,MAAMC,SAAS,GAAGA,CAAA,KAAM;EACtBrB,OAAO,CAACC,GAAG,CAAC,oBAAoB,CAAC;EACjCX,QAAQ,CAAC+B,SAAS,CAAC,CAAC;AACtB,CAAC;AAEM,MAAMC,MAAM,GAAAC,OAAA,CAAAD,MAAA,GAAG;EACpB1B,UAAU;EACVO,YAAY;EACZO,mBAAmB;EACnBE,oBAAoB;EACpBG,SAAS;EACTG,iBAAiB;EACjBE,oBAAoB;EACpBH,QAAQ;EACR;EACA;EACAI;AACF,CAAC"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.IDWiseSDKTheme = exports.IDWiseEvents = void 0;
7
+ const IDWiseEvents = exports.IDWiseEvents = {
8
+ EVENT_INITIALIZE_ERRROR: 'onInitializeError',
9
+ EVENT_JOURNEY_STARTED: 'onJourneyStarted',
10
+ EVENT_JOURNEY_RESUMED: 'onJourneyResumed',
11
+ EVENT_JOURNEY_FINISHED: 'onJourneyFinished',
12
+ EVENT_JOURNEY_CANCELLED: 'onJourneyCancelled',
13
+ EVENT_JOURNEY_ERROR: 'onJourneyError',
14
+ EVENT_JOURNEY_SUMMARY: 'onJourneySummary',
15
+ EVENT_JOURNEY_SUMMARY_ERROR: 'onJourneySummaryError',
16
+ EVENT_STEP_CAPTURED: 'onStepCaptured',
17
+ EVENT_STEP_RESULT: 'onStepResult',
18
+ EVENT_STEP_CANCELLED: 'onStepCancelled',
19
+ EVENT_STEP_SKIPPED: 'onStepSkipped'
20
+ };
21
+ const IDWiseSDKTheme = exports.IDWiseSDKTheme = {
22
+ LIGHT: 'LIGHT',
23
+ DARK: 'DARK',
24
+ SYSTEM_DEFAULT: 'SYSTEM_DEFAULT'
25
+ };
26
+ //# sourceMappingURL=IDWiseConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IDWiseEvents","exports","EVENT_INITIALIZE_ERRROR","EVENT_JOURNEY_STARTED","EVENT_JOURNEY_RESUMED","EVENT_JOURNEY_FINISHED","EVENT_JOURNEY_CANCELLED","EVENT_JOURNEY_ERROR","EVENT_JOURNEY_SUMMARY","EVENT_JOURNEY_SUMMARY_ERROR","EVENT_STEP_CAPTURED","EVENT_STEP_RESULT","EVENT_STEP_CANCELLED","EVENT_STEP_SKIPPED","IDWiseSDKTheme","LIGHT","DARK","SYSTEM_DEFAULT"],"sourceRoot":"../../src","sources":["IDWiseConstants.js"],"mappings":";;;;;;AAAO,MAAMA,YAAY,GAAAC,OAAA,CAAAD,YAAA,GAAG;EAC1BE,uBAAuB,EAAE,mBAAmB;EAE5CC,qBAAqB,EAAE,kBAAkB;EACzCC,qBAAqB,EAAE,kBAAkB;EACzCC,sBAAsB,EAAE,mBAAmB;EAC3CC,uBAAuB,EAAE,oBAAoB;EAC7CC,mBAAmB,EAAE,gBAAgB;EAErCC,qBAAqB,EAAE,kBAAkB;EACzCC,2BAA2B,EAAE,uBAAuB;EAEpDC,mBAAmB,EAAE,gBAAgB;EACrCC,iBAAiB,EAAE,cAAc;EACjCC,oBAAoB,EAAE,iBAAiB;EACvCC,kBAAkB,EAAE;AACtB,CAAC;AAEM,MAAMC,cAAc,GAAAb,OAAA,CAAAa,cAAA,GAAG;EAC5BC,KAAK,EAAE,OAAO;EACdC,IAAI,EAAE,MAAM;EACZC,cAAc,EAAE;AAClB,CAAC"}
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.setStepEventListeners = exports.setJourneySummaryEventListener = exports.setJourneyEventListeners = exports.setInitializeEventListeners = void 0;
7
+ var _reactNative = require("react-native");
8
+ var _IDWiseConstants = require("./IDWiseConstants");
9
+ const RNIDWise = _reactNative.NativeModules.IdwiseMobileSdk ? _reactNative.NativeModules.IdwiseMobileSdk : new Proxy({}, {
10
+ get() {
11
+ throw new Error(LINKING_ERROR);
12
+ }
13
+ });
14
+ const eventEmitter = new _reactNative.NativeEventEmitter(RNIDWise);
15
+ const setInitializeEventListeners = idwiseInitializeCallback => {
16
+ console.log('IDWise - setInitializeEventListeners');
17
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_INITIALIZE_ERRROR);
18
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_INITIALIZE_ERRROR, event => {
19
+ idwiseInitializeCallback === null || idwiseInitializeCallback === void 0 || idwiseInitializeCallback.onError(event);
20
+ });
21
+ };
22
+ exports.setInitializeEventListeners = setInitializeEventListeners;
23
+ const setJourneyEventListeners = idwiseJourneyCallback => {
24
+ console.log('IDWise - setJourneyEventListeners');
25
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_STARTED);
26
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_RESUMED);
27
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_FINISHED);
28
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_CANCELLED);
29
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_ERROR);
30
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_STARTED, event => {
31
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyStarted(event);
32
+ });
33
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_RESUMED, event => {
34
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyResumed(event);
35
+ });
36
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_FINISHED, event => {
37
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyFinished(event);
38
+ });
39
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_CANCELLED, event => {
40
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onJourneyCancelled(event);
41
+ });
42
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_ERROR, event => {
43
+ idwiseJourneyCallback === null || idwiseJourneyCallback === void 0 || idwiseJourneyCallback.onError(event);
44
+ });
45
+ };
46
+ exports.setJourneyEventListeners = setJourneyEventListeners;
47
+ const setStepEventListeners = idwiseStepCallback => {
48
+ console.log('IDWise - setStepEventListener');
49
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_STEP_CAPTURED);
50
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_STEP_RESULT);
51
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_STEP_CANCELLED);
52
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_STEP_SKIPPED);
53
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_STEP_CAPTURED, event => {
54
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepCaptured(event.stepId, event.capturedImage);
55
+ });
56
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_STEP_RESULT, event => {
57
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepResult(event.stepId, JSON.parse(event.stepResult));
58
+ });
59
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_STEP_CANCELLED, event => {
60
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepCancelled(event);
61
+ });
62
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_STEP_SKIPPED, event => {
63
+ idwiseStepCallback === null || idwiseStepCallback === void 0 || idwiseStepCallback.onStepSkipped(event);
64
+ });
65
+ };
66
+ exports.setStepEventListeners = setStepEventListeners;
67
+ const setJourneySummaryEventListener = idwiseJourneySummaryCallback => {
68
+ console.log('IDWise - setJourneySummaryEventListener');
69
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_SUMMARY);
70
+ eventEmitter.removeAllListeners(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_SUMMARY_ERROR);
71
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_SUMMARY, event => {
72
+ idwiseJourneySummaryCallback === null || idwiseJourneySummaryCallback === void 0 || idwiseJourneySummaryCallback.onJourneySummary(JSON.parse(event.summary));
73
+ });
74
+ eventEmitter.addListener(_IDWiseConstants.IDWiseEvents.EVENT_JOURNEY_SUMMARY_ERROR, event => {
75
+ idwiseJourneySummaryCallback === null || idwiseJourneySummaryCallback === void 0 || idwiseJourneySummaryCallback.onError(JSON.parse(event.error));
76
+ });
77
+ };
78
+ exports.setJourneySummaryEventListener = setJourneySummaryEventListener;
79
+ //# sourceMappingURL=IDWiseEventListeners.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_IDWiseConstants","RNIDWise","NativeModules","IdwiseMobileSdk","Proxy","get","Error","LINKING_ERROR","eventEmitter","NativeEventEmitter","setInitializeEventListeners","idwiseInitializeCallback","console","log","removeAllListeners","IDWiseEvents","EVENT_INITIALIZE_ERRROR","addListener","event","onError","exports","setJourneyEventListeners","idwiseJourneyCallback","EVENT_JOURNEY_STARTED","EVENT_JOURNEY_RESUMED","EVENT_JOURNEY_FINISHED","EVENT_JOURNEY_CANCELLED","EVENT_JOURNEY_ERROR","onJourneyStarted","onJourneyResumed","onJourneyFinished","onJourneyCancelled","setStepEventListeners","idwiseStepCallback","EVENT_STEP_CAPTURED","EVENT_STEP_RESULT","EVENT_STEP_CANCELLED","EVENT_STEP_SKIPPED","onStepCaptured","stepId","capturedImage","onStepResult","JSON","parse","stepResult","onStepCancelled","onStepSkipped","setJourneySummaryEventListener","idwiseJourneySummaryCallback","EVENT_JOURNEY_SUMMARY","EVENT_JOURNEY_SUMMARY_ERROR","onJourneySummary","summary","error"],"sourceRoot":"../../src","sources":["IDWiseEventListeners.js"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAEA,MAAME,QAAQ,GAAGC,0BAAa,CAACC,eAAe,GAC1CD,0BAAa,CAACC,eAAe,GAC7B,IAAIC,KAAK,CACP,CAAC,CAAC,EACF;EACEC,GAAGA,CAAA,EAAG;IACJ,MAAM,IAAIC,KAAK,CAACC,aAAa,CAAC;EAChC;AACF,CACF,CAAC;AAEL,MAAMC,YAAY,GAAG,IAAIC,+BAAkB,CAACR,QAAQ,CAAC;AAErD,MAAMS,2BAA2B,GAAIC,wBAAwB,IAAK;EAChEC,OAAO,CAACC,GAAG,CAAC,sCAAsC,CAAC;EACnDL,YAAY,CAACM,kBAAkB,CAACC,6BAAY,CAACC,uBAAuB,CAAC;EAErER,YAAY,CAACS,WAAW,CAACF,6BAAY,CAACC,uBAAuB,EAAGE,KAAK,IAAK;IACxEP,wBAAwB,aAAxBA,wBAAwB,eAAxBA,wBAAwB,CAAEQ,OAAO,CAACD,KAAK,CAAC;EAC1C,CAAC,CAAC;AACJ,CAAC;AAACE,OAAA,CAAAV,2BAAA,GAAAA,2BAAA;AAEF,MAAMW,wBAAwB,GAAIC,qBAAqB,IAAK;EAC1DV,OAAO,CAACC,GAAG,CAAC,mCAAmC,CAAC;EAChDL,YAAY,CAACM,kBAAkB,CAACC,6BAAY,CAACQ,qBAAqB,CAAC;EACnEf,YAAY,CAACM,kBAAkB,CAACC,6BAAY,CAACS,qBAAqB,CAAC;EACnEhB,YAAY,CAACM,kBAAkB,CAACC,6BAAY,CAACU,sBAAsB,CAAC;EACpEjB,YAAY,CAACM,kBAAkB,CAACC,6BAAY,CAACW,uBAAuB,CAAC;EACrElB,YAAY,CAACM,kBAAkB,CAACC,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A4B,aAA5BA,4BAA4B,eAA5BA,4BAA4B,CAAEG,gBAAgB,CAACT,IAAI,CAACC,KAAK,CAACzB,KAAK,CAACkC,OAAO,CAAC,CAAC;EAC3E,CAAC,CAAC;EAEF5C,YAAY,CAACS,WAAW,CACtBF,6BAAY,CAACmC,2BAA2B,EACvChC,KAAK,IAAK;IACT8B,4BAA4B,aAA5BA,4BAA4B,eAA5BA,4BAA4B,CAAE7B,OAAO,CAACuB,IAAI,CAACC,KAAK,CAACzB,KAAK,CAACmC,KAAK,CAAC,CAAC;EAChE,CACF,CAAC;AACH,CAAC;AAACjC,OAAA,CAAA2B,8BAAA,GAAAA,8BAAA"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var IDWise = _interopRequireWildcard(require("./IDWise"));
8
+ var _IDWiseConstants = require("./IDWiseConstants");
9
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
10
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
11
+ var _default = exports.default = {
12
+ IDWise,
13
+ IDWiseSDKTheme: _IDWiseConstants.IDWiseSDKTheme
14
+ };
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["IDWise","_interopRequireWildcard","require","_IDWiseConstants","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_default","exports","IDWiseSDKTheme"],"sourceRoot":"../../src","sources":["index.js"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAD,OAAA;AAAmD,SAAAE,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAJ,wBAAAI,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAd,CAAA,oBAAAc,CAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAc,CAAA,SAAAI,CAAA,GAAAR,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAI,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAI,CAAA,IAAAV,CAAA,CAAAM,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAL,C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