react-native-persona 2.2.0 → 2.2.3
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 +29 -0
- package/README.md +149 -2
- package/RNPersonaInquiry2.podspec +1 -1
- package/android/build.gradle +1 -2
- package/android/src/main/java/com/withpersona/sdk2/reactnative/PersonaInquiryModule2.java +8 -2
- package/bin/persona-tool +1 -2
- package/ios/PersonaInquiry2.swift +4 -0
- package/lib/commonjs/index.js +66 -4
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js +497 -0
- package/lib/commonjs/persona-tool/AndroidResourcePrinter.js.map +1 -0
- package/lib/commonjs/persona-tool/Config.js +95 -0
- package/lib/commonjs/persona-tool/Config.js.map +1 -0
- package/lib/commonjs/persona-tool/Theme.js +199 -0
- package/lib/commonjs/persona-tool/Theme.js.map +1 -0
- package/lib/commonjs/persona-tool/index.js +41 -0
- package/lib/commonjs/persona-tool/index.js.map +1 -0
- package/lib/commonjs/persona-tool/prompts.js +48 -0
- package/lib/commonjs/persona-tool/prompts.js.map +1 -0
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js +99 -0
- package/lib/commonjs/persona-tool/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js +50 -0
- package/lib/commonjs/persona-tool/tools/IosThemeInstructions.js.map +1 -0
- package/lib/commonjs/versions.js +25 -0
- package/lib/commonjs/versions.js.map +1 -0
- package/lib/module/index.js +58 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/persona-tool/AndroidResourcePrinter.js +489 -0
- package/lib/module/persona-tool/AndroidResourcePrinter.js.map +1 -0
- package/lib/module/persona-tool/Config.js +82 -0
- package/lib/module/persona-tool/Config.js.map +1 -0
- package/lib/module/persona-tool/Theme.js +183 -0
- package/lib/module/persona-tool/Theme.js.map +1 -0
- package/lib/module/persona-tool/index.js +33 -0
- package/lib/module/persona-tool/index.js.map +1 -0
- package/lib/module/persona-tool/prompts.js +31 -0
- package/lib/module/persona-tool/prompts.js.map +1 -0
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js +72 -0
- package/lib/module/persona-tool/tools/AndroidThemeGenerator.js.map +1 -0
- package/lib/module/persona-tool/tools/IosThemeInstructions.js +37 -0
- package/lib/module/persona-tool/tools/IosThemeInstructions.js.map +1 -0
- package/lib/module/versions.js +14 -0
- package/lib/module/versions.js.map +1 -0
- package/lib/typescript/{src/fields.d.ts → fields.d.ts} +0 -0
- package/lib/typescript/{src/index.d.ts → index.d.ts} +50 -0
- package/lib/typescript/{persona-tools/lib → persona-tool}/AndroidResourcePrinter.d.ts +2 -2
- package/lib/typescript/{persona-tools → persona-tool}/Config.d.ts +0 -0
- package/lib/typescript/{persona-tools → persona-tool}/Theme.d.ts +0 -0
- package/lib/typescript/{persona-tools → persona-tool}/index.d.ts +0 -0
- package/lib/typescript/{persona-tools/lib → persona-tool}/prompts.d.ts +1 -1
- package/lib/typescript/{persona-tools → persona-tool}/tools/AndroidThemeGenerator.d.ts +0 -0
- package/lib/typescript/{persona-tools → persona-tool}/tools/IosThemeInstructions.d.ts +0 -0
- package/lib/typescript/{src/util.d.ts → util.d.ts} +0 -0
- package/lib/typescript/versions.d.ts +6 -0
- package/package.json +4 -5
- package/src/index.ts +65 -3
- package/{persona-tools/lib → src/persona-tool}/AndroidResourcePrinter.ts +182 -182
- package/{persona-tools → src/persona-tool}/Config.ts +0 -0
- package/{persona-tools → src/persona-tool}/Theme.ts +0 -0
- package/{persona-tools → src/persona-tool}/index.ts +1 -1
- package/{persona-tools/lib → src/persona-tool}/prompts.ts +11 -11
- package/{persona-tools → src/persona-tool}/tools/AndroidThemeGenerator.ts +2 -2
- package/{persona-tools → src/persona-tool}/tools/IosThemeInstructions.ts +1 -1
- package/src/versions.ts +12 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Fields } from './fields';
|
|
2
2
|
export { Fields };
|
|
3
|
+
import { Versions } from './versions';
|
|
4
|
+
export { Versions };
|
|
3
5
|
declare const Unique: unique symbol;
|
|
4
6
|
export declare type Opaque<T, Tag> = T & {
|
|
5
7
|
[Unique]: Tag;
|
|
@@ -58,6 +60,42 @@ export declare class Inquiry {
|
|
|
58
60
|
private onErrorListener?;
|
|
59
61
|
constructor(options: InquiryOptions);
|
|
60
62
|
private clearListeners;
|
|
63
|
+
/**
|
|
64
|
+
* Create an Inquiry flow builder based on a template ID.
|
|
65
|
+
*
|
|
66
|
+
* You can find your template ID on the Dashboard under Inquiries > Templates.
|
|
67
|
+
* {@link https://app.withpersona.com/dashboard/inquiry-templates}
|
|
68
|
+
*
|
|
69
|
+
* @param templateId template ID from your Persona Dashboard
|
|
70
|
+
* @return builder for the Inquiry flow
|
|
71
|
+
*/
|
|
72
|
+
static fromTemplate(templateId: string): TemplateBuilder;
|
|
73
|
+
/**
|
|
74
|
+
* Create an Inquiry flow builder based on a template ID version.
|
|
75
|
+
*
|
|
76
|
+
* You can find your template ID version on the Dashboard under the
|
|
77
|
+
* settings view of a specific template.
|
|
78
|
+
* {@link https://app.withpersona.com/dashboard/inquiry-templates}
|
|
79
|
+
*
|
|
80
|
+
* @param templateVersion template version from your Persona Dashboard
|
|
81
|
+
* @return builder for the Inquiry flow
|
|
82
|
+
*/
|
|
83
|
+
static fromTemplateVersion(templateVersion: string): TemplateBuilder;
|
|
84
|
+
/**
|
|
85
|
+
* Create an Inquiry flow builder based on an inquiry ID.
|
|
86
|
+
*
|
|
87
|
+
* You will need to generate the inquiry ID on the server. To try it out, you can create an
|
|
88
|
+
* inquiry from the Persona Dashboard under "Inquiries". Click on the "Create Inquiry" button
|
|
89
|
+
* and copy the inquiry ID from the URL.
|
|
90
|
+
* {@link https://app.withpersona.com/dashboard/inquiries}
|
|
91
|
+
*
|
|
92
|
+
* @param inquiryId inquiry ID from your server
|
|
93
|
+
* @return builder for the Inquiry flow
|
|
94
|
+
*/
|
|
95
|
+
static fromInquiry(inquiryId: string): InquiryBuilder;
|
|
96
|
+
/**
|
|
97
|
+
* Launch the Persona Inquiry.
|
|
98
|
+
*/
|
|
61
99
|
start(): void;
|
|
62
100
|
}
|
|
63
101
|
declare class InquiryBuilder {
|
|
@@ -100,9 +138,21 @@ declare class TemplateBuilder {
|
|
|
100
138
|
iosTheme(themeObject: Object): TemplateBuilder;
|
|
101
139
|
build(): Inquiry;
|
|
102
140
|
}
|
|
141
|
+
/**
|
|
142
|
+
* @deprecated Use the `Inquiry` static methods instead
|
|
143
|
+
*/
|
|
103
144
|
declare namespace InquiryBuilders {
|
|
145
|
+
/**
|
|
146
|
+
* @deprecated Use {@link Inquiry#fromInquiry} instead
|
|
147
|
+
*/
|
|
104
148
|
function fromInquiry(inquiryId: string): InquiryBuilder;
|
|
149
|
+
/**
|
|
150
|
+
* @deprecated Use {@link Inquiry#fromTemplate} instead
|
|
151
|
+
*/
|
|
105
152
|
function fromTemplate(templateId: string): TemplateBuilder;
|
|
153
|
+
/**
|
|
154
|
+
* @deprecated Use {@link Inquiry#fromTemplateVersion} instead
|
|
155
|
+
*/
|
|
106
156
|
function fromTemplateVersion(templateVersion: string): TemplateBuilder;
|
|
107
157
|
}
|
|
108
158
|
export default InquiryBuilders;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AndroidThemeObject } from
|
|
2
|
-
import type { XMLBuilder } from
|
|
1
|
+
import type { AndroidThemeObject } from './Theme';
|
|
2
|
+
import type { XMLBuilder } from 'xmlbuilder2/lib/interfaces';
|
|
3
3
|
declare class AndroidResourcePrinter {
|
|
4
4
|
theme: AndroidThemeObject;
|
|
5
5
|
root: XMLBuilder;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-persona",
|
|
3
3
|
"title": "React Native Persona",
|
|
4
|
-
"version": "2.2.
|
|
4
|
+
"version": "2.2.3",
|
|
5
5
|
"description": "Launch a mobile native implementation of the Persona inquiry flow from React Native.",
|
|
6
6
|
"main": "lib/commonjs/index",
|
|
7
7
|
"module": "lib/module/index",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"react-native": "src/index",
|
|
10
10
|
"source": "src/index",
|
|
11
11
|
"bin": {
|
|
12
|
-
"persona-tool": "
|
|
12
|
+
"persona-tool": "bin/persona-tool"
|
|
13
13
|
},
|
|
14
14
|
"scripts": {
|
|
15
15
|
"test": "jest",
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"android",
|
|
27
27
|
"ios",
|
|
28
28
|
"bin",
|
|
29
|
-
"persona-tools",
|
|
30
29
|
"RNPersonaInquiry2.podspec",
|
|
31
30
|
"!lib/typescript/example",
|
|
32
31
|
"!android/build",
|
|
@@ -44,10 +43,10 @@
|
|
|
44
43
|
"name": "Persona Identities, Inc.",
|
|
45
44
|
"email": "support@withpersona.com"
|
|
46
45
|
},
|
|
47
|
-
"homepage": "https://docs.withpersona.com/docs/react-native-sdk-
|
|
46
|
+
"homepage": "https://docs.withpersona.com/docs/react-native-sdk-integration",
|
|
48
47
|
"license": "MIT",
|
|
49
48
|
"licenseFilename": "LICENSE",
|
|
50
|
-
"readmeFilename": "
|
|
49
|
+
"readmeFilename": "PUBLIC.md",
|
|
51
50
|
"peerDependencies": {
|
|
52
51
|
"react": "*",
|
|
53
52
|
"react-native": "*"
|
package/src/index.ts
CHANGED
|
@@ -5,8 +5,13 @@ import {
|
|
|
5
5
|
} from 'react-native';
|
|
6
6
|
import { processThemeValues } from './util';
|
|
7
7
|
import { Fields, InquiryField, RawInquiryField } from './fields';
|
|
8
|
+
|
|
8
9
|
export { Fields };
|
|
9
10
|
|
|
11
|
+
import { Versions } from './versions';
|
|
12
|
+
|
|
13
|
+
export { Versions };
|
|
14
|
+
|
|
10
15
|
const { PersonaInquiry2 } = NativeModules;
|
|
11
16
|
|
|
12
17
|
// Using Opaque types + Smart Constructor enforces validation at
|
|
@@ -174,6 +179,51 @@ export class Inquiry {
|
|
|
174
179
|
if (this.onErrorListener) this.onErrorListener.remove();
|
|
175
180
|
}
|
|
176
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Create an Inquiry flow builder based on a template ID.
|
|
184
|
+
*
|
|
185
|
+
* You can find your template ID on the Dashboard under Inquiries > Templates.
|
|
186
|
+
* {@link https://app.withpersona.com/dashboard/inquiry-templates}
|
|
187
|
+
*
|
|
188
|
+
* @param templateId template ID from your Persona Dashboard
|
|
189
|
+
* @return builder for the Inquiry flow
|
|
190
|
+
*/
|
|
191
|
+
static fromTemplate(templateId: string) {
|
|
192
|
+
return new TemplateBuilder(makeTemplateId(templateId), null);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Create an Inquiry flow builder based on a template ID version.
|
|
197
|
+
*
|
|
198
|
+
* You can find your template ID version on the Dashboard under the
|
|
199
|
+
* settings view of a specific template.
|
|
200
|
+
* {@link https://app.withpersona.com/dashboard/inquiry-templates}
|
|
201
|
+
*
|
|
202
|
+
* @param templateVersion template version from your Persona Dashboard
|
|
203
|
+
* @return builder for the Inquiry flow
|
|
204
|
+
*/
|
|
205
|
+
static fromTemplateVersion(templateVersion: string) {
|
|
206
|
+
return new TemplateBuilder(null, makeTemplateVersion(templateVersion));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Create an Inquiry flow builder based on an inquiry ID.
|
|
211
|
+
*
|
|
212
|
+
* You will need to generate the inquiry ID on the server. To try it out, you can create an
|
|
213
|
+
* inquiry from the Persona Dashboard under "Inquiries". Click on the "Create Inquiry" button
|
|
214
|
+
* and copy the inquiry ID from the URL.
|
|
215
|
+
* {@link https://app.withpersona.com/dashboard/inquiries}
|
|
216
|
+
*
|
|
217
|
+
* @param inquiryId inquiry ID from your server
|
|
218
|
+
* @return builder for the Inquiry flow
|
|
219
|
+
*/
|
|
220
|
+
static fromInquiry(inquiryId: string) {
|
|
221
|
+
return new InquiryBuilder(makeInquiryId(inquiryId));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Launch the Persona Inquiry.
|
|
226
|
+
*/
|
|
177
227
|
start() {
|
|
178
228
|
this.onCompleteListener = eventEmitter.addListener(
|
|
179
229
|
'onComplete',
|
|
@@ -407,17 +457,29 @@ class TemplateBuilder {
|
|
|
407
457
|
}
|
|
408
458
|
}
|
|
409
459
|
|
|
460
|
+
/**
|
|
461
|
+
* @deprecated Use the `Inquiry` static methods instead
|
|
462
|
+
*/
|
|
410
463
|
namespace InquiryBuilders {
|
|
464
|
+
/**
|
|
465
|
+
* @deprecated Use {@link Inquiry#fromInquiry} instead
|
|
466
|
+
*/
|
|
411
467
|
export function fromInquiry(inquiryId: string) {
|
|
412
|
-
return
|
|
468
|
+
return Inquiry.fromInquiry(inquiryId);
|
|
413
469
|
}
|
|
414
470
|
|
|
471
|
+
/**
|
|
472
|
+
* @deprecated Use {@link Inquiry#fromTemplate} instead
|
|
473
|
+
*/
|
|
415
474
|
export function fromTemplate(templateId: string) {
|
|
416
|
-
return
|
|
475
|
+
return Inquiry.fromTemplate(templateId);
|
|
417
476
|
}
|
|
418
477
|
|
|
478
|
+
/**
|
|
479
|
+
* @deprecated Use {@link Inquiry#fromTemplateVersion} instead
|
|
480
|
+
*/
|
|
419
481
|
export function fromTemplateVersion(templateVersion: string) {
|
|
420
|
-
return
|
|
482
|
+
return Inquiry.fromTemplateVersion(templateVersion);
|
|
421
483
|
}
|
|
422
484
|
}
|
|
423
485
|
|