@opencrvs/mosip 1.7.0-alpha.25 → 1.7.0-alpha.27
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/build/forms.d.ts +11 -6
- package/build/forms.js +19 -8
- package/package.json +1 -1
- package/src/forms.ts +30 -10
package/build/forms.d.ts
CHANGED
|
@@ -31,6 +31,11 @@ export declare const esignet: (esignetAuthUrl: string, openIdProviderClientId: s
|
|
|
31
31
|
action: string;
|
|
32
32
|
expression: string;
|
|
33
33
|
}[];
|
|
34
|
+
mapping: {
|
|
35
|
+
mutation: {
|
|
36
|
+
operation: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
34
39
|
options: {
|
|
35
40
|
url: string;
|
|
36
41
|
callback: {
|
|
@@ -67,6 +72,11 @@ export declare const esignetCallback: ({ fieldName, mosipAPIUserInfoUrl, openIdP
|
|
|
67
72
|
};
|
|
68
73
|
validator: never[];
|
|
69
74
|
hideInPreview: boolean;
|
|
75
|
+
mapping: {
|
|
76
|
+
mutation: {
|
|
77
|
+
operation: string;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
70
80
|
options: {
|
|
71
81
|
url: string;
|
|
72
82
|
headers: {
|
|
@@ -83,11 +93,6 @@ export declare const esignetHidden: () => {
|
|
|
83
93
|
name: string;
|
|
84
94
|
type: string;
|
|
85
95
|
};
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* @description QR reader type definition (this field may not be supported in the latest release of OpenCRVS yet)
|
|
89
|
-
*
|
|
90
|
-
*/
|
|
91
96
|
export declare const idReader: (event: string, sectionId: string, conditionals: any[], readers: any[]) => {
|
|
92
97
|
name: string;
|
|
93
98
|
customQuestionMappingId: string;
|
|
@@ -161,7 +166,7 @@ export declare const verified: (event: string, sectionId: string, mapping: any,
|
|
|
161
166
|
validator: never[];
|
|
162
167
|
mapping: any;
|
|
163
168
|
};
|
|
164
|
-
type VerificationStatus = "verified" | "failed" | "authenticated";
|
|
169
|
+
type VerificationStatus = "verified" | "failed" | "authenticated" | "failedFetchIdDetails";
|
|
165
170
|
export declare const idVerificationBanner: (event: string, sectionId: string, status: VerificationStatus, conditionals?: any[]) => {
|
|
166
171
|
name: string;
|
|
167
172
|
type: string;
|
package/build/forms.js
CHANGED
|
@@ -46,6 +46,11 @@ const esignet = (esignetAuthUrl, openIdProviderClientId, openIdProviderClaims =
|
|
|
46
46
|
expression: "!!$form.redirectCallbackFetch",
|
|
47
47
|
},
|
|
48
48
|
],
|
|
49
|
+
mapping: {
|
|
50
|
+
mutation: {
|
|
51
|
+
operation: "ignoreFieldTransformer",
|
|
52
|
+
},
|
|
53
|
+
},
|
|
49
54
|
options: {
|
|
50
55
|
url: url.toString(),
|
|
51
56
|
callback: {
|
|
@@ -83,6 +88,11 @@ const esignetCallback = ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientI
|
|
|
83
88
|
},
|
|
84
89
|
validator: [],
|
|
85
90
|
hideInPreview: true,
|
|
91
|
+
mapping: {
|
|
92
|
+
mutation: {
|
|
93
|
+
operation: "ignoreFieldTransformer",
|
|
94
|
+
},
|
|
95
|
+
},
|
|
86
96
|
options: {
|
|
87
97
|
url: mosipAPIUserInfoUrl,
|
|
88
98
|
headers: {
|
|
@@ -103,11 +113,6 @@ const esignetHidden = () => {
|
|
|
103
113
|
};
|
|
104
114
|
};
|
|
105
115
|
exports.esignetHidden = esignetHidden;
|
|
106
|
-
/**
|
|
107
|
-
*
|
|
108
|
-
* @description QR reader type definition (this field may not be supported in the latest release of OpenCRVS yet)
|
|
109
|
-
*
|
|
110
|
-
*/
|
|
111
116
|
const idReader = (event, sectionId, conditionals, readers) => {
|
|
112
117
|
const fieldName = "idReader";
|
|
113
118
|
const fieldId = `${event}.${sectionId}.${sectionId}-view-group.${fieldName}`;
|
|
@@ -163,7 +168,10 @@ const verified = (event, sectionId, mapping, esignetConfig) => {
|
|
|
163
168
|
initialValue: esignetConfig
|
|
164
169
|
? {
|
|
165
170
|
dependsOn: ["idReader", esignetConfig.callback.fieldName],
|
|
166
|
-
expression: `Boolean($form?.idReader)? "pending"
|
|
171
|
+
expression: `Boolean($form?.idReader)? "pending"
|
|
172
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.data)? "authenticated"
|
|
173
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.error)? "failedFetchIdDetails"
|
|
174
|
+
: ""`,
|
|
167
175
|
}
|
|
168
176
|
: {
|
|
169
177
|
dependsOn: ["idReader"],
|
|
@@ -187,7 +195,9 @@ const idVerificationBanner = (event, sectionId, status, conditionals = []) => {
|
|
|
187
195
|
hideInPreview: true,
|
|
188
196
|
custom: true,
|
|
189
197
|
bannerType: status,
|
|
190
|
-
idFieldName: status === "authenticated"
|
|
198
|
+
idFieldName: status === "authenticated" || "failedFetchIdDetails"
|
|
199
|
+
? "esignetCallback"
|
|
200
|
+
: "idReader",
|
|
191
201
|
label: {
|
|
192
202
|
id: "form.field.label.empty",
|
|
193
203
|
defaultMessage: "",
|
|
@@ -236,7 +246,7 @@ const idReaderFields = (event, section, qrConfig, esignetConfig, verifiedCustomF
|
|
|
236
246
|
const fields = [
|
|
237
247
|
(0, exports.idReader)(event, section, conditionals.concat({
|
|
238
248
|
action: "hide",
|
|
239
|
-
expression: "$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || !!$form?.esignetCallback?.loading",
|
|
249
|
+
expression: "$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || $form?.verified === 'failedFetchIdDetails' || !!$form?.esignetCallback?.loading",
|
|
240
250
|
}), readers),
|
|
241
251
|
];
|
|
242
252
|
if (esignetConfig) {
|
|
@@ -271,6 +281,7 @@ const idVerificationFields = (event, sectionId, mapping, conditionals = [], esig
|
|
|
271
281
|
(0, exports.idVerificationBanner)(event, sectionId, "verified", conditionals),
|
|
272
282
|
(0, exports.idVerificationBanner)(event, sectionId, "failed", conditionals),
|
|
273
283
|
(0, exports.idVerificationBanner)(event, sectionId, "authenticated", conditionals),
|
|
284
|
+
(0, exports.idVerificationBanner)(event, sectionId, "failedFetchIdDetails", conditionals),
|
|
274
285
|
];
|
|
275
286
|
};
|
|
276
287
|
exports.idVerificationFields = idVerificationFields;
|
package/package.json
CHANGED
package/src/forms.ts
CHANGED
|
@@ -54,6 +54,11 @@ export const esignet = (
|
|
|
54
54
|
expression: "!!$form.redirectCallbackFetch",
|
|
55
55
|
},
|
|
56
56
|
],
|
|
57
|
+
mapping: {
|
|
58
|
+
mutation: {
|
|
59
|
+
operation: "ignoreFieldTransformer",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
57
62
|
options: {
|
|
58
63
|
url: url.toString(),
|
|
59
64
|
callback: {
|
|
@@ -103,6 +108,11 @@ export const esignetCallback = ({
|
|
|
103
108
|
},
|
|
104
109
|
validator: [],
|
|
105
110
|
hideInPreview: true,
|
|
111
|
+
mapping: {
|
|
112
|
+
mutation: {
|
|
113
|
+
operation: "ignoreFieldTransformer",
|
|
114
|
+
},
|
|
115
|
+
},
|
|
106
116
|
options: {
|
|
107
117
|
url: mosipAPIUserInfoUrl,
|
|
108
118
|
headers: {
|
|
@@ -124,12 +134,6 @@ export const esignetHidden = () => {
|
|
|
124
134
|
};
|
|
125
135
|
};
|
|
126
136
|
|
|
127
|
-
/**
|
|
128
|
-
*
|
|
129
|
-
* @description QR reader type definition (this field may not be supported in the latest release of OpenCRVS yet)
|
|
130
|
-
*
|
|
131
|
-
*/
|
|
132
|
-
|
|
133
137
|
export const idReader = (
|
|
134
138
|
event: string,
|
|
135
139
|
sectionId: string,
|
|
@@ -222,7 +226,10 @@ export const verified = (
|
|
|
222
226
|
initialValue: esignetConfig
|
|
223
227
|
? {
|
|
224
228
|
dependsOn: ["idReader", esignetConfig.callback.fieldName],
|
|
225
|
-
expression: `Boolean($form?.idReader)? "pending"
|
|
229
|
+
expression: `Boolean($form?.idReader)? "pending"
|
|
230
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.data)? "authenticated"
|
|
231
|
+
: Boolean($form?.${esignetConfig.callback.fieldName}?.error)? "failedFetchIdDetails"
|
|
232
|
+
: ""`,
|
|
226
233
|
}
|
|
227
234
|
: {
|
|
228
235
|
dependsOn: ["idReader"],
|
|
@@ -237,7 +244,11 @@ function capitalize(str: string) {
|
|
|
237
244
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
238
245
|
}
|
|
239
246
|
|
|
240
|
-
type VerificationStatus =
|
|
247
|
+
type VerificationStatus =
|
|
248
|
+
| "verified"
|
|
249
|
+
| "failed"
|
|
250
|
+
| "authenticated"
|
|
251
|
+
| "failedFetchIdDetails";
|
|
241
252
|
|
|
242
253
|
export const idVerificationBanner = (
|
|
243
254
|
event: string,
|
|
@@ -254,7 +265,10 @@ export const idVerificationBanner = (
|
|
|
254
265
|
hideInPreview: true,
|
|
255
266
|
custom: true,
|
|
256
267
|
bannerType: status,
|
|
257
|
-
idFieldName:
|
|
268
|
+
idFieldName:
|
|
269
|
+
status === "authenticated" || "failedFetchIdDetails"
|
|
270
|
+
? "esignetCallback"
|
|
271
|
+
: "idReader",
|
|
258
272
|
label: {
|
|
259
273
|
id: "form.field.label.empty",
|
|
260
274
|
defaultMessage: "",
|
|
@@ -325,7 +339,7 @@ export const idReaderFields = (
|
|
|
325
339
|
conditionals.concat({
|
|
326
340
|
action: "hide",
|
|
327
341
|
expression:
|
|
328
|
-
"$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || !!$form?.esignetCallback?.loading",
|
|
342
|
+
"$form?.verified === 'verified' || $form?.verified === 'authenticated' || $form?.verified === 'failed' || $form?.verified === 'failedFetchIdDetails' || !!$form?.esignetCallback?.loading",
|
|
329
343
|
}),
|
|
330
344
|
readers,
|
|
331
345
|
),
|
|
@@ -390,5 +404,11 @@ export const idVerificationFields = (
|
|
|
390
404
|
idVerificationBanner(event, sectionId, "verified", conditionals),
|
|
391
405
|
idVerificationBanner(event, sectionId, "failed", conditionals),
|
|
392
406
|
idVerificationBanner(event, sectionId, "authenticated", conditionals),
|
|
407
|
+
idVerificationBanner(
|
|
408
|
+
event,
|
|
409
|
+
sectionId,
|
|
410
|
+
"failedFetchIdDetails",
|
|
411
|
+
conditionals,
|
|
412
|
+
),
|
|
393
413
|
];
|
|
394
414
|
};
|