react-native-persona 2.1.3 → 2.2.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.
Files changed (65) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/{RNPersonaInquiry.podspec → RNPersonaInquiry2.podspec} +2 -2
  3. package/android/README.md +14 -0
  4. package/android/build.gradle +22 -98
  5. package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
  6. package/android/src/main/AndroidManifest.xml +1 -1
  7. package/android/src/main/java/com/withpersona/{sdk/reactnative/PersonaInquiryModule.java → sdk2/reactnative/PersonaInquiryModule2.java} +16 -12
  8. package/android/src/main/java/com/withpersona/{sdk/reactnative/PersonaInquiryPackage.java → sdk2/reactnative/PersonaInquiryPackage2.java} +3 -3
  9. package/android/src/main/java/com/withpersona/{sdk → sdk2}/reactnative/exceptions/InvalidConfiguration.java +1 -1
  10. package/android/src/main/res/values/theme.xml +2 -3
  11. package/ios/{PersonaInquiry.swift → PersonaInquiry2.swift} +13 -13
  12. package/ios/PersonaInquiryBridge.m +1 -1
  13. package/lib/commonjs/fields.js +141 -0
  14. package/lib/commonjs/fields.js.map +1 -0
  15. package/lib/commonjs/index.js +413 -0
  16. package/lib/commonjs/index.js.map +1 -0
  17. package/lib/commonjs/util.js +36 -0
  18. package/lib/commonjs/util.js.map +1 -0
  19. package/lib/module/fields.js +132 -0
  20. package/lib/module/fields.js.map +1 -0
  21. package/lib/module/index.js +380 -0
  22. package/lib/module/index.js.map +1 -0
  23. package/lib/module/util.js +29 -0
  24. package/lib/module/util.js.map +1 -0
  25. package/{generatedTypes/persona-tools/config.d.ts → lib/typescript/persona-tools/Config.d.ts} +0 -0
  26. package/{generatedTypes → lib/typescript}/persona-tools/Theme.d.ts +0 -0
  27. package/{generatedTypes → lib/typescript}/persona-tools/index.d.ts +0 -0
  28. package/{generatedTypes → lib/typescript}/persona-tools/lib/AndroidResourcePrinter.d.ts +2 -2
  29. package/{generatedTypes → lib/typescript}/persona-tools/lib/prompts.d.ts +0 -0
  30. package/{generatedTypes → lib/typescript}/persona-tools/tools/AndroidThemeGenerator.d.ts +0 -0
  31. package/{generatedTypes → lib/typescript}/persona-tools/tools/IosThemeInstructions.d.ts +0 -0
  32. package/{generatedTypes → lib/typescript}/src/fields.d.ts +0 -0
  33. package/{generatedTypes → lib/typescript}/src/index.d.ts +6 -5
  34. package/{generatedTypes → lib/typescript}/src/util.d.ts +0 -0
  35. package/package.json +73 -17
  36. package/persona-tools/{config.ts → Config.ts} +7 -7
  37. package/persona-tools/Theme.ts +107 -107
  38. package/persona-tools/index.ts +9 -9
  39. package/persona-tools/lib/AndroidResourcePrinter.ts +4 -4
  40. package/persona-tools/tools/AndroidThemeGenerator.ts +18 -18
  41. package/persona-tools/tools/IosThemeInstructions.ts +8 -8
  42. package/src/fields.ts +7 -7
  43. package/src/index.ts +24 -23
  44. package/src/util.ts +2 -2
  45. package/generatedTypes/persona-tools/lib/AndroidResourcePrinter.spec.d.ts +0 -1
  46. package/generatedTypes/src/fields.spec.d.ts +0 -1
  47. package/generatedTypes/src/util.spec.d.ts +0 -1
  48. package/jest.config.js +0 -10
  49. package/persona-tools/Theme.js +0 -186
  50. package/persona-tools/config.js +0 -72
  51. package/persona-tools/index.js +0 -30
  52. package/persona-tools/lib/AndroidResourcePrinter.js +0 -573
  53. package/persona-tools/lib/AndroidResourcePrinter.spec.js +0 -914
  54. package/persona-tools/lib/AndroidResourcePrinter.spec.ts +0 -952
  55. package/persona-tools/lib/prompts.js +0 -39
  56. package/persona-tools/tools/AndroidThemeGenerator.js +0 -55
  57. package/persona-tools/tools/IosThemeInstructions.js +0 -34
  58. package/src/fields.js +0 -88
  59. package/src/fields.spec.js +0 -18
  60. package/src/fields.spec.ts +0 -17
  61. package/src/index.js +0 -271
  62. package/src/util.js +0 -29
  63. package/src/util.spec.js +0 -17
  64. package/src/util.spec.ts +0 -22
  65. package/tsconfig.json +0 -29
package/CHANGELOG.md CHANGED
@@ -7,6 +7,14 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
8
  ## Unreleased
9
9
 
10
+ ## [v2.2.0] - 2022-02-16
11
+
12
+ ### Changed
13
+
14
+ - Upgrade to iOS Inquiry SDK 2.2.2
15
+ - Upgrade to Android Inquiry SDK 2.2.4
16
+ - Update iOS and Android's namespace to allow for 1.x and 2.x implementations in parallel
17
+
10
18
  ## [v2.1.3] - 2022-01-31
11
19
 
12
20
  ### Changed
@@ -3,7 +3,7 @@ require 'json'
3
3
  package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4
4
 
5
5
  Pod::Spec.new do |s|
6
- s.name = 'RNPersonaInquiry'
6
+ s.name = 'RNPersonaInquiry2'
7
7
  s.version = package['version']
8
8
  s.summary = package['description']
9
9
  s.description = <<-DESC
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
22
22
  s.requires_arc = true
23
23
 
24
24
  s.dependency 'React-Core'
25
- s.dependency 'PersonaInquirySDK', '~> 2.1.3'
25
+ s.dependency 'PersonaInquirySDK2', '2.2.2'
26
26
 
27
27
  s.static_framework = true
28
28
  end
@@ -0,0 +1,14 @@
1
+ README
2
+ ======
3
+
4
+ If you want to publish the lib as a maven dependency, follow these steps before publishing a new version to npm:
5
+
6
+ 1. Be sure to have the Android [SDK](https://developer.android.com/studio/index.html) and [NDK](https://developer.android.com/ndk/guides/index.html) installed
7
+ 2. Be sure to have a `local.properties` file in this folder that points to the Android SDK and NDK
8
+ ```
9
+ ndk.dir=/Users/{username}/Library/Android/sdk/ndk-bundle
10
+ sdk.dir=/Users/{username}/Library/Android/sdk
11
+ ```
12
+ 3. Delete the `maven` folder
13
+ 4. Run `./gradlew installArchives`
14
+ 5. Verify that latest set of generated files is in the maven folder with the correct version number
@@ -1,34 +1,15 @@
1
- // android/build.gradle
2
-
3
- // based on:
4
- //
5
- // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle
6
- // original location:
7
- // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/build.gradle
8
- //
9
- // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle
10
- // original location:
11
- // - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle
12
-
13
1
  def DEFAULT_COMPILE_SDK_VERSION = 29
14
- def DEFAULT_BUILD_TOOLS_VERSION = '29.0.3'
15
2
  def DEFAULT_MIN_SDK_VERSION = 21
16
3
  def DEFAULT_TARGET_SDK_VERSION = 29
17
4
 
18
- def safeExtGet(prop, fallback) {
19
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
20
- }
21
-
22
5
  buildscript {
23
- // The Android Gradle plugin is only required when opening the android folder stand-alone.
24
- // This avoids unnecessary downloads and potential conflicts when the library is included as a
25
- // module dependency in an application project.
26
- // ref: https://docs.gradle.org/current/userguide/tutorial_using_tasks.html#sec:build_script_external_dependencies
27
6
  if (project == rootProject) {
28
7
  repositories {
29
8
  google()
9
+ mavenCentral()
30
10
  jcenter()
31
11
  }
12
+
32
13
  dependencies {
33
14
  classpath 'com.android.tools.build:gradle:3.6.1'
34
15
  }
@@ -36,42 +17,49 @@ buildscript {
36
17
  }
37
18
 
38
19
  apply plugin: 'com.android.library'
39
- apply plugin: 'maven'
20
+
21
+ def safeExtGet(prop, fallback) {
22
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
23
+ }
40
24
 
41
25
  android {
42
26
  compileSdkVersion safeExtGet('compileSdkVersion', DEFAULT_COMPILE_SDK_VERSION)
43
- buildToolsVersion safeExtGet('buildToolsVersion', DEFAULT_BUILD_TOOLS_VERSION)
44
27
  defaultConfig {
45
28
  minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
46
29
  targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
47
30
  versionCode 1
48
31
  versionName "1.0"
49
32
  }
33
+
34
+ buildTypes {
35
+ release {
36
+ minifyEnabled false
37
+ }
38
+ }
39
+ lintOptions {
40
+ disable 'GradleCompatible'
41
+ }
50
42
  compileOptions {
51
43
  sourceCompatibility JavaVersion.VERSION_1_8
52
44
  targetCompatibility JavaVersion.VERSION_1_8
53
45
  }
54
- lintOptions {
55
- abortOnError false
56
- }
57
46
  }
58
47
 
59
48
  repositories {
60
- // ref: https://www.baeldung.com/maven-local-repository
61
49
  mavenLocal()
62
50
  maven {
63
51
  // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
64
- url "$rootDir/../node_modules/react-native/android"
65
- }
66
- maven {
67
- // Android JSC is installed from npm
68
- url "$rootDir/../node_modules/jsc-android/dist"
52
+ url("$rootDir/../node_modules/react-native/android")
69
53
  }
54
+ google()
55
+ mavenCentral()
56
+ jcenter()
70
57
  maven {
71
58
  url "https://sdk.withpersona.com/android/releases"
72
59
  }
73
60
  google()
74
- jcenter()
61
+ mavenCentral()
62
+ maven { url 'https://jitpack.io' }
75
63
  }
76
64
 
77
65
  dependencies {
@@ -79,69 +67,5 @@ dependencies {
79
67
  implementation 'com.facebook.react:react-native:+' // From node_modules
80
68
 
81
69
  // NOTE: After updating, please update the `sdkVersions.android` in example/package.json
82
- implementation 'com.withpersona.sdk:inquiry:2.1.3'
83
- }
84
-
85
- def configureReactNativePom(def pom) {
86
- def packageJson = new groovy.json.JsonSlurper().parseText(file('../package.json').text)
87
-
88
- pom.project {
89
- name packageJson.title
90
- artifactId packageJson.name
91
- version = packageJson.version
92
- group = "com.withpersona.sdk.reactnative"
93
- description packageJson.description
94
-
95
- developers {
96
- developer {
97
- id packageJson.author.username
98
- name packageJson.author.name
99
- }
100
- }
101
- }
102
- }
103
-
104
- afterEvaluate { project ->
105
- // some Gradle build hooks ref:
106
- // https://www.oreilly.com/library/view/gradle-beyond-the/9781449373801/ch03.html
107
- task androidJavadoc(type: Javadoc) {
108
- source = android.sourceSets.main.java.srcDirs
109
- classpath += files(android.bootClasspath)
110
- classpath += files(project.getConfigurations().getByName('compile').asList())
111
- include '**/*.java'
112
- }
113
-
114
- task androidJavadocJar(type: Jar, dependsOn: androidJavadoc) {
115
- classifier = 'javadoc'
116
- from androidJavadoc.destinationDir
117
- }
118
-
119
- task androidSourcesJar(type: Jar) {
120
- classifier = 'sources'
121
- from android.sourceSets.main.java.srcDirs
122
- include '**/*.java'
123
- }
124
-
125
- android.libraryVariants.all { variant ->
126
- def name = variant.name.capitalize()
127
- def javaCompileTask = variant.javaCompileProvider.get()
128
-
129
- task "jar${name}"(type: Jar, dependsOn: javaCompileTask) {
130
- from javaCompileTask.destinationDir
131
- }
132
- }
133
-
134
- artifacts {
135
- archives androidSourcesJar
136
- archives androidJavadocJar
137
- }
138
-
139
- task installArchives(type: Upload) {
140
- configuration = configurations.archives
141
- repositories.mavenDeployer {
142
- // Deploy to react-native-event-bridge/maven, ready to publish to npm
143
- repository url: "file://${projectDir}/../android/maven"
144
- configureReactNativePom pom
145
- }
146
- }
70
+ implementation 'com.withpersona.sdk2:inquiry:2.2.4'
147
71
  }
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-6.9.2-all.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
@@ -1 +1 @@
1
- <manifest package="com.withpersona.sdk.reactnative" />
1
+ <manifest package="com.withpersona.sdk2.reactnative" />
@@ -1,4 +1,4 @@
1
- package com.withpersona.sdk.reactnative;
1
+ package com.withpersona.sdk2.reactnative;
2
2
 
3
3
  import android.app.Activity;
4
4
  import android.content.Intent;
@@ -12,22 +12,22 @@ import com.facebook.react.bridge.ReactMethod;
12
12
  import com.facebook.react.bridge.ReadableMap;
13
13
  import com.facebook.react.bridge.WritableMap;
14
14
  import com.facebook.react.modules.core.DeviceEventManagerModule;
15
- import com.withpersona.sdk.inquiry.Environment;
16
- import com.withpersona.sdk.inquiry.Fields;
17
- import com.withpersona.sdk.inquiry.Inquiry;
18
- import com.withpersona.sdk.inquiry.InquiryBuilder;
19
- import com.withpersona.sdk.inquiry.InquiryField;
20
- import com.withpersona.sdk.inquiry.InquiryResponse;
21
- import com.withpersona.sdk.inquiry.InquiryTemplateBuilder;
15
+ import com.withpersona.sdk2.inquiry.Environment;
16
+ import com.withpersona.sdk2.inquiry.Fields;
17
+ import com.withpersona.sdk2.inquiry.Inquiry;
18
+ import com.withpersona.sdk2.inquiry.InquiryBuilder;
19
+ import com.withpersona.sdk2.inquiry.InquiryField;
20
+ import com.withpersona.sdk2.inquiry.InquiryResponse;
21
+ import com.withpersona.sdk2.inquiry.InquiryTemplateBuilder;
22
22
  import java.util.ArrayList;
23
23
  import java.util.HashMap;
24
24
  import java.util.Map;
25
25
  import org.jetbrains.annotations.NotNull;
26
26
 
27
- public class PersonaInquiryModule extends ReactContextBaseJavaModule
27
+ public class PersonaInquiryModule2 extends ReactContextBaseJavaModule
28
28
  implements ActivityEventListener {
29
29
 
30
- private static final int PERSONA_INQUIRY_REQUEST_CODE = 31415;
30
+ private static final int PERSONA_INQUIRY_REQUEST_CODE = 31416;
31
31
  private static final String INQUIRY_ID = "inquiryId";
32
32
  private static final String TEMPLATE_ID = "templateId";
33
33
  private static final String ACCOUNT_ID = "accountId";
@@ -39,7 +39,7 @@ public class PersonaInquiryModule extends ReactContextBaseJavaModule
39
39
 
40
40
  private final ReactApplicationContext reactContext;
41
41
 
42
- public PersonaInquiryModule(ReactApplicationContext reactContext) {
42
+ public PersonaInquiryModule2(ReactApplicationContext reactContext) {
43
43
  super(reactContext);
44
44
  this.reactContext = reactContext;
45
45
  reactContext.addActivityEventListener(this);
@@ -120,7 +120,7 @@ public class PersonaInquiryModule extends ReactContextBaseJavaModule
120
120
  @NotNull
121
121
  @Override
122
122
  public String getName() {
123
- return "PersonaInquiry";
123
+ return "PersonaInquiry2";
124
124
  }
125
125
 
126
126
  /**
@@ -140,6 +140,8 @@ public class PersonaInquiryModule extends ReactContextBaseJavaModule
140
140
  if (inquiryId != null) {
141
141
  InquiryBuilder builder = Inquiry.fromInquiry(inquiryId);
142
142
 
143
+ builder = builder.theme(R.style.Persona_Inquiry2_Theme);
144
+
143
145
  String sessionToken = options.hasKey(ACCESS_TOKEN) ? options.getString(ACCESS_TOKEN) : null;
144
146
  if (sessionToken != null) {
145
147
  builder = builder.sessionToken(sessionToken);
@@ -153,6 +155,8 @@ public class PersonaInquiryModule extends ReactContextBaseJavaModule
153
155
  if (templateId != null) {
154
156
  InquiryTemplateBuilder builder = Inquiry.fromTemplate(templateId);
155
157
 
158
+ builder = builder.theme(R.style.Persona_Inquiry2_Theme);
159
+
156
160
  String referenceId = options.hasKey(REFERENCE_ID) ? options.getString(REFERENCE_ID) : null;
157
161
  if (referenceId != null) {
158
162
  builder = builder.referenceId(referenceId);
@@ -1,4 +1,4 @@
1
- package com.withpersona.sdk.reactnative;
1
+ package com.withpersona.sdk2.reactnative;
2
2
 
3
3
  import java.util.Arrays;
4
4
  import java.util.Collections;
@@ -9,10 +9,10 @@ import com.facebook.react.bridge.NativeModule;
9
9
  import com.facebook.react.bridge.ReactApplicationContext;
10
10
  import com.facebook.react.uimanager.ViewManager;
11
11
 
12
- public class PersonaInquiryPackage implements ReactPackage {
12
+ public class PersonaInquiryPackage2 implements ReactPackage {
13
13
  @Override
14
14
  public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
15
- return Arrays.<NativeModule>asList(new PersonaInquiryModule(reactContext));
15
+ return Arrays.<NativeModule>asList(new PersonaInquiryModule2(reactContext));
16
16
  }
17
17
 
18
18
  @Override
@@ -1,4 +1,4 @@
1
- package com.withpersona.sdk.reactnative.exceptions;
1
+ package com.withpersona.sdk2.reactnative.exceptions;
2
2
 
3
3
  public class InvalidConfiguration extends IllegalArgumentException {
4
4
  public InvalidConfiguration(String errorMessage) {
@@ -1,5 +1,4 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <resources>
3
- <style name="PersonaReactNativeTheme">
4
- </style>
5
- </resources>
3
+ <style name="Persona.Inquiry2.Theme" parent="@style/Base.Persona.Inquiry2.Theme" />
4
+ </resources>
@@ -1,22 +1,22 @@
1
1
  //
2
- // PersonaInquiry.swift
3
- // PersonaInquiry
2
+ // PersonaInquiry2.swift
3
+ // PersonaInquiry2
4
4
  //
5
5
  // Copyright © 2020 Persona. All rights reserved.
6
6
  //
7
7
 
8
8
  import Foundation
9
- import Persona
9
+ import Persona2
10
10
 
11
- @objc(PersonaInquiry)
12
- class PersonaInquiry: RCTEventEmitter {
11
+ @objc(PersonaInquiry2)
12
+ class PersonaInquiry2: RCTEventEmitter {
13
13
 
14
14
  override func supportedEvents() -> [String] {
15
15
  ["onComplete", "onCanceled", "onError"]
16
16
  }
17
17
 
18
18
  override static func moduleName() -> String {
19
- "PersonaInquiry"
19
+ "PersonaInquiry2"
20
20
  }
21
21
 
22
22
  override static func requiresMainQueueSetup() -> Bool {
@@ -68,7 +68,7 @@ class PersonaInquiry: RCTEventEmitter {
68
68
 
69
69
  // MARK: - Inquiry Delegate Methods
70
70
 
71
- extension PersonaInquiry: InquiryDelegate {
71
+ extension PersonaInquiry2: InquiryDelegate {
72
72
  func inquiryComplete(inquiryId: String, status: String, fields: [String: InquiryField]) {
73
73
  sendEvent(
74
74
  withName: "onComplete",
@@ -103,7 +103,7 @@ extension PersonaInquiry: InquiryDelegate {
103
103
 
104
104
  // MARK: - Helpers
105
105
 
106
- extension PersonaInquiry {
106
+ extension PersonaInquiry2 {
107
107
 
108
108
  enum InvalidConfiguration: Error {
109
109
  case argumentError(String)
@@ -382,7 +382,7 @@ extension PersonaInquiry {
382
382
  if let successAssetName = dictionary["successAssetName"],
383
383
  let successAssetWidth = int(from: dictionary["successAssetWidth"]),
384
384
  let successAssetHeight = int(from: dictionary["successAssetHeight"]),
385
- let successAssetPath = Bundle(for: PersonaInquiry.self).path(forResource: successAssetName, ofType: "svg") {
385
+ let successAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: successAssetName, ofType: "svg") {
386
386
  let customSuccessAsset = InquiryTheme.SVGAsset(
387
387
  path: successAssetPath,
388
388
  size: CGSize(width: successAssetWidth, height: successAssetHeight)
@@ -394,7 +394,7 @@ extension PersonaInquiry {
394
394
  if let verificationFailAssetName = dictionary["verificationFailAssetName"],
395
395
  let verificationFailAssetWidth = int(from: dictionary["verificationFailAssetWidth"]),
396
396
  let verificationFailAssetHeight = int(from: dictionary["verificationFailAssetHeight"]),
397
- let verificationFailAssetPath = Bundle(for: PersonaInquiry.self).path(forResource: verificationFailAssetName, ofType: "svg") {
397
+ let verificationFailAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: verificationFailAssetName, ofType: "svg") {
398
398
  let customVerificationFailAsset = InquiryTheme.SVGAsset(
399
399
  path: verificationFailAssetPath,
400
400
  size: CGSize(width: verificationFailAssetWidth, height: verificationFailAssetHeight)
@@ -406,7 +406,7 @@ extension PersonaInquiry {
406
406
  if let failAssetName = dictionary["failAssetName"],
407
407
  let failAssetWidth = int(from: dictionary["failAssetWidth"]),
408
408
  let failAssetHeight = int(from: dictionary["failAssetHeight"]),
409
- let failAssetPath = Bundle(for: PersonaInquiry.self).path(forResource: failAssetName, ofType: "svg") {
409
+ let failAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: failAssetName, ofType: "svg") {
410
410
  let customFailAsset = InquiryTheme.SVGAsset(
411
411
  path: failAssetPath,
412
412
  size: CGSize(width: failAssetWidth, height: failAssetHeight)
@@ -418,7 +418,7 @@ extension PersonaInquiry {
418
418
  if let loadingAnimationAssetName = dictionary["loadingAnimationAssetName"],
419
419
  let loadingAnimationAssetWidth = int(from: dictionary["loadingAnimationAssetWidth"]),
420
420
  let loadingAnimationAssetHeight = int(from: dictionary["loadingAnimationAssetHeight"]),
421
- let loadingAnimationAssetPath = Bundle(for: PersonaInquiry.self).path(forResource: loadingAnimationAssetName, ofType: "json") {
421
+ let loadingAnimationAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: loadingAnimationAssetName, ofType: "json") {
422
422
  let customLoadingAnimationAsset = InquiryTheme.AnimationAsset(
423
423
  path: loadingAnimationAssetPath,
424
424
  size: CGSize(width: loadingAnimationAssetWidth, height: loadingAnimationAssetHeight)
@@ -430,7 +430,7 @@ extension PersonaInquiry {
430
430
  if let processingAnimationAssetName = dictionary["processingAnimationAssetName"],
431
431
  let processingAnimationAssetWidth = int(from: dictionary["processingAnimationAssetWidth"]),
432
432
  let processingAnimationAssetHeight = int(from: dictionary["processingAnimationAssetHeight"]),
433
- let processingAnimationAssetPath = Bundle(for: PersonaInquiry.self).path(forResource: processingAnimationAssetName, ofType: "json") {
433
+ let processingAnimationAssetPath = Bundle(for: PersonaInquiry2.self).path(forResource: processingAnimationAssetName, ofType: "json") {
434
434
  let customProcessingAnimationAsset = InquiryTheme.AnimationAsset(
435
435
  path: processingAnimationAssetPath,
436
436
  size: CGSize(width: processingAnimationAssetWidth, height: processingAnimationAssetHeight)
@@ -1,7 +1,7 @@
1
1
  #import "React/RCTBridgeModule.h"
2
2
  #import "React/RCTEventEmitter.h"
3
3
 
4
- @interface RCT_EXTERN_MODULE(PersonaInquiry, RCTEventEmitter)
4
+ @interface RCT_EXTERN_MODULE(PersonaInquiry2, RCTEventEmitter)
5
5
 
6
6
  RCT_EXTERN_METHOD(startInquiry:(NSDictionary *)options)
7
7
 
@@ -0,0 +1,141 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.InquiryField = exports.Fields = void 0;
7
+
8
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+
10
+ let InquiryField;
11
+ exports.InquiryField = InquiryField;
12
+
13
+ (function (_InquiryField) {
14
+ class Integer {
15
+ constructor(value) {
16
+ _defineProperty(this, "type", 'integer');
17
+
18
+ _defineProperty(this, "value", void 0);
19
+
20
+ this.value = value;
21
+ }
22
+
23
+ }
24
+
25
+ _InquiryField.Integer = Integer;
26
+
27
+ class String {
28
+ constructor(value) {
29
+ _defineProperty(this, "type", 'string');
30
+
31
+ _defineProperty(this, "value", void 0);
32
+
33
+ this.value = value;
34
+ }
35
+
36
+ }
37
+
38
+ _InquiryField.String = String;
39
+
40
+ class Boolean {
41
+ constructor(value) {
42
+ _defineProperty(this, "type", 'boolean');
43
+
44
+ _defineProperty(this, "value", void 0);
45
+
46
+ this.value = value;
47
+ }
48
+
49
+ }
50
+
51
+ _InquiryField.Boolean = Boolean;
52
+
53
+ class Unknown {
54
+ constructor(type) {
55
+ _defineProperty(this, "type", void 0);
56
+
57
+ this.type = type;
58
+ }
59
+
60
+ }
61
+
62
+ _InquiryField.Unknown = Unknown;
63
+
64
+ function parse(_ref) {
65
+ let {
66
+ type,
67
+ value
68
+ } = _ref;
69
+
70
+ if (value == null) {
71
+ return null;
72
+ }
73
+
74
+ switch (type) {
75
+ case 'integer':
76
+ return new InquiryField.Integer(Number.parseInt(value));
77
+
78
+ case 'string':
79
+ return new InquiryField.String(value);
80
+
81
+ case 'boolean':
82
+ return new InquiryField.Boolean(JSON.parse(value));
83
+
84
+ case 'unknown':
85
+ return new InquiryField.Unknown(value);
86
+
87
+ default:
88
+ return new InquiryField.Unknown(type);
89
+ }
90
+ }
91
+
92
+ _InquiryField.parse = parse;
93
+ })(InquiryField || (exports.InquiryField = InquiryField = {}));
94
+
95
+ let Fields;
96
+ exports.Fields = Fields;
97
+
98
+ (function (_Fields) {
99
+ function builder() {
100
+ return new Fields.Builder();
101
+ }
102
+
103
+ _Fields.builder = builder;
104
+
105
+ class Builder {
106
+ constructor() {
107
+ _defineProperty(this, "_fields", void 0);
108
+
109
+ this._fields = {};
110
+ }
111
+
112
+ integer(fieldKey, value) {
113
+ this._fields = { ...this._fields,
114
+ [fieldKey]: new InquiryField.Integer(value)
115
+ };
116
+ return this;
117
+ }
118
+
119
+ boolean(fieldKey, value) {
120
+ this._fields = { ...this._fields,
121
+ [fieldKey]: new InquiryField.Boolean(value)
122
+ };
123
+ return this;
124
+ }
125
+
126
+ string(fieldKey, value) {
127
+ this._fields = { ...this._fields,
128
+ [fieldKey]: new InquiryField.String(value)
129
+ };
130
+ return this;
131
+ }
132
+
133
+ build() {
134
+ return this._fields;
135
+ }
136
+
137
+ }
138
+
139
+ _Fields.Builder = Builder;
140
+ })(Fields || (exports.Fields = Fields = {}));
141
+ //# sourceMappingURL=fields.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["fields.ts"],"names":["Integer","constructor","value","String","Boolean","Unknown","type","parse","InquiryField","Number","parseInt","JSON","builder","Fields","Builder","_fields","integer","fieldKey","boolean","string","build"],"mappings":";;;;;;;;;;;;;AAUS,QAAMA,OAAN,CAAsC;AAI3CC,IAAAA,WAAW,CAACC,KAAD,EAAiB;AAAA,oCAHJ,SAGI;;AAAA;;AAC1B,WAAKA,KAAL,GAAaA,KAAb;AACD;;AAN0C;;;;AAStC,QAAMC,MAAN,CAAqC;AAI1CF,IAAAA,WAAW,CAACC,KAAD,EAAiB;AAAA,oCAHJ,QAGI;;AAAA;;AAC1B,WAAKA,KAAL,GAAaA,KAAb;AACD;;AANyC;;;;AASrC,QAAME,OAAN,CAAsC;AAI3CH,IAAAA,WAAW,CAACC,KAAD,EAAkB;AAAA,oCAHL,SAGK;;AAAA;;AAC3B,WAAKA,KAAL,GAAaA,KAAb;AACD;;AAN0C;;;;AAStC,QAAMG,OAAN,CAAsC;AAG3CJ,IAAAA,WAAW,CAACK,IAAD,EAAe;AAAA;;AACxB,WAAKA,IAAL,GAAYA,IAAZ;AACD;;AAL0C;;;;AAQtC,WAASC,KAAT,OAAsE;AAAA,QAAvD;AAAED,MAAAA,IAAF;AAAQJ,MAAAA;AAAR,KAAuD;;AAC3E,QAAIA,KAAK,IAAI,IAAb,EAAmB;AACjB,aAAO,IAAP;AACD;;AACD,YAAQI,IAAR;AACE,WAAK,SAAL;AACE,eAAO,IAAIE,YAAY,CAACR,OAAjB,CAAyBS,MAAM,CAACC,QAAP,CAAgBR,KAAhB,CAAzB,CAAP;;AACF,WAAK,QAAL;AACE,eAAO,IAAIM,YAAY,CAACL,MAAjB,CAAwBD,KAAxB,CAAP;;AACF,WAAK,SAAL;AACE,eAAO,IAAIM,YAAY,CAACJ,OAAjB,CAAyBO,IAAI,CAACJ,KAAL,CAAWL,KAAX,CAAzB,CAAP;;AACF,WAAK,SAAL;AACE,eAAO,IAAIM,YAAY,CAACH,OAAjB,CAAyBH,KAAzB,CAAP;;AACF;AACE,eAAO,IAAIM,YAAY,CAACH,OAAjB,CAAyBC,IAAzB,CAAP;AAVJ;AAYD;;;GApDcE,Y,4BAAAA,Y;;;;;;AA0DR,WAASI,OAAT,GAA4B;AACjC,WAAO,IAAIC,MAAM,CAACC,OAAX,EAAP;AACD;;;;AAEM,QAAMA,OAAN,CAAc;AAGnBb,IAAAA,WAAW,GAAG;AAAA;;AACZ,WAAKc,OAAL,GAAe,EAAf;AACD;;AAEMC,IAAAA,OAAO,CAACC,QAAD,EAAmBf,KAAnB,EAAmC;AAC/C,WAAKa,OAAL,GAAe,EACb,GAAG,KAAKA,OADK;AAEb,SAACE,QAAD,GAAY,IAAIT,YAAY,CAACR,OAAjB,CAAyBE,KAAzB;AAFC,OAAf;AAKA,aAAO,IAAP;AACD;;AAEMgB,IAAAA,OAAO,CAACD,QAAD,EAAmBf,KAAnB,EAAoC;AAChD,WAAKa,OAAL,GAAe,EACb,GAAG,KAAKA,OADK;AAEb,SAACE,QAAD,GAAY,IAAIT,YAAY,CAACJ,OAAjB,CAAyBF,KAAzB;AAFC,OAAf;AAKA,aAAO,IAAP;AACD;;AAEMiB,IAAAA,MAAM,CAACF,QAAD,EAAmBf,KAAnB,EAAmC;AAC9C,WAAKa,OAAL,GAAe,EACb,GAAG,KAAKA,OADK;AAEb,SAACE,QAAD,GAAY,IAAIT,YAAY,CAACL,MAAjB,CAAwBD,KAAxB;AAFC,OAAf;AAKA,aAAO,IAAP;AACD;;AAEMkB,IAAAA,KAAK,GAAW;AACrB,aAAO,KAAKL,OAAZ;AACD;;AApCkB;;;GALNF,M,sBAAAA,M","sourcesContent":["interface InquiryField {\n readonly type: string;\n}\n\nexport type RawInquiryField = {\n type: string;\n value?: any;\n};\n\nexport namespace InquiryField {\n export class Integer implements InquiryField {\n readonly type: string = 'integer';\n readonly value?: number;\n\n constructor(value?: number) {\n this.value = value;\n }\n }\n\n export class String implements InquiryField {\n readonly type: string = 'string';\n readonly value?: string;\n\n constructor(value?: string) {\n this.value = value;\n }\n }\n\n export class Boolean implements InquiryField {\n readonly type: string = 'boolean';\n readonly value?: boolean;\n\n constructor(value?: boolean) {\n this.value = value;\n }\n }\n\n export class Unknown implements InquiryField {\n readonly type: string;\n\n constructor(type: string) {\n this.type = type;\n }\n }\n\n export function parse({ type, value }: RawInquiryField): InquiryField | null {\n if (value == null) {\n return null;\n }\n switch (type) {\n case 'integer':\n return new InquiryField.Integer(Number.parseInt(value));\n case 'string':\n return new InquiryField.String(value);\n case 'boolean':\n return new InquiryField.Boolean(JSON.parse(value));\n case 'unknown':\n return new InquiryField.Unknown(value);\n default:\n return new InquiryField.Unknown(type);\n }\n }\n}\n\nexport type Fields = Record<string, InquiryField | null>;\n\nexport namespace Fields {\n export function builder(): Builder {\n return new Fields.Builder();\n }\n\n export class Builder {\n private _fields: Record<string, InquiryField>;\n\n constructor() {\n this._fields = {};\n }\n\n public integer(fieldKey: string, value?: number) {\n this._fields = {\n ...this._fields,\n [fieldKey]: new InquiryField.Integer(value),\n };\n\n return this;\n }\n\n public boolean(fieldKey: string, value?: boolean) {\n this._fields = {\n ...this._fields,\n [fieldKey]: new InquiryField.Boolean(value),\n };\n\n return this;\n }\n\n public string(fieldKey: string, value?: string) {\n this._fields = {\n ...this._fields,\n [fieldKey]: new InquiryField.String(value),\n };\n\n return this;\n }\n\n public build(): Fields {\n return this._fields;\n }\n }\n}\n"]}