@opencrvs/mosip 1.7.0-alpha.11 → 1.7.0-alpha.13

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 CHANGED
@@ -13,7 +13,7 @@
13
13
  * @description E-Signet REDIRECT button form definition. Calls E-Signet /authorize (this field may not be supported in the latest release of OpenCRVS yet)
14
14
  *
15
15
  */
16
- export declare const esignet: (event: string, sectionId: string, esignetAuthUrl: string, openIdProviderClientId: string, openIdProviderClaims: string | undefined, fieldName: string, callbackFieldName: string) => {
16
+ export declare const esignet: (esignetAuthUrl: string, openIdProviderClientId: string, openIdProviderClaims: string | undefined, fieldName: string, callbackFieldName: string) => {
17
17
  name: string;
18
18
  validator: never[];
19
19
  icon: {
@@ -50,14 +50,12 @@ export declare const popupButton: ({ url, }: {
50
50
  };
51
51
  /**
52
52
  *
53
- * @description esignet callback button form definition. Calls mosip-api/esignet-api /esignet/get-oidp-user-info (this field may not be supported in the latest release of OpenCRVS yet)
53
+ * @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
54
54
  *
55
55
  */
56
- export declare const esignetCallback: ({ fieldName, event, sectionId, getOIDPUserInfoUrl, openIdProviderClientId, }: {
56
+ export declare const esignetCallback: ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientId, }: {
57
57
  fieldName: string;
58
- event: string;
59
- sectionId: string;
60
- getOIDPUserInfoUrl: string;
58
+ mosipAPIUserInfoUrl: string;
61
59
  openIdProviderClientId: string;
62
60
  }) => {
63
61
  name: string;
package/build/forms.js CHANGED
@@ -17,7 +17,7 @@ exports.idVerificationFields = exports.idPendingVerificationBanner = exports.ver
17
17
  * @description E-Signet REDIRECT button form definition. Calls E-Signet /authorize (this field may not be supported in the latest release of OpenCRVS yet)
18
18
  *
19
19
  */
20
- const esignet = (event, sectionId, esignetAuthUrl, openIdProviderClientId, openIdProviderClaims = "name,family_name,given_name,middle_name,birthdate,address", fieldName, callbackFieldName) => {
20
+ const esignet = (esignetAuthUrl, openIdProviderClientId, openIdProviderClaims = "name,family_name,given_name,middle_name,birthdate,address", fieldName, callbackFieldName) => {
21
21
  const url = new URL(esignetAuthUrl);
22
22
  url.searchParams.append("client_id", openIdProviderClientId || "mock-client_id");
23
23
  url.searchParams.append("response_type", "code");
@@ -25,7 +25,7 @@ const esignet = (event, sectionId, esignetAuthUrl, openIdProviderClientId, openI
25
25
  url.searchParams.append("acr_values", "mosip:idp:acr:static-code");
26
26
  url.searchParams.append("claims", openIdProviderClaims);
27
27
  url.searchParams.append("state", "fetch-on-mount");
28
- url.searchParams.append("redirect_uri", '${window.location.origin}/drafts/${window.location.pathname.split("/")[2]}/events/${event}/${sectionId}/group/${sectionId}');
28
+ url.searchParams.append("redirect_uri", '${window.location.href}');
29
29
  return {
30
30
  name: fieldName,
31
31
  validator: [],
@@ -70,10 +70,10 @@ url, }) => {
70
70
  exports.popupButton = popupButton;
71
71
  /**
72
72
  *
73
- * @description esignet callback button form definition. Calls mosip-api/esignet-api /esignet/get-oidp-user-info (this field may not be supported in the latest release of OpenCRVS yet)
73
+ * @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
74
74
  *
75
75
  */
76
- const esignetCallback = ({ fieldName, event, sectionId, getOIDPUserInfoUrl, openIdProviderClientId, }) => ({
76
+ const esignetCallback = ({ fieldName, mosipAPIUserInfoUrl, openIdProviderClientId, }) => ({
77
77
  name: fieldName,
78
78
  type: "HTTP",
79
79
  custom: true,
@@ -84,13 +84,13 @@ const esignetCallback = ({ fieldName, event, sectionId, getOIDPUserInfoUrl, open
84
84
  validator: [],
85
85
  hideInPreview: true,
86
86
  options: {
87
- url: getOIDPUserInfoUrl,
87
+ url: mosipAPIUserInfoUrl,
88
88
  headers: {
89
89
  "Content-type": "application/json",
90
90
  },
91
91
  body: {
92
92
  clientId: openIdProviderClientId,
93
- redirectUri: '${window.location.origin}/drafts/${window.location.pathname.split("/")[2]}/events/${event}/${sectionId}/group/${sectionId}',
93
+ redirectUri: '${window.location.href}',
94
94
  },
95
95
  method: "POST",
96
96
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opencrvs/mosip",
3
- "version": "1.7.0-alpha.11",
3
+ "version": "1.7.0-alpha.13",
4
4
  "license": "MPL-2.0",
5
5
  "main": "./build/index.js",
6
6
  "exports": {
package/src/forms.ts CHANGED
@@ -17,8 +17,6 @@
17
17
  *
18
18
  */
19
19
  export const esignet = (
20
- event: string,
21
- sectionId: string,
22
20
  esignetAuthUrl: string,
23
21
  openIdProviderClientId: string,
24
22
  openIdProviderClaims: string = "name,family_name,given_name,middle_name,birthdate,address",
@@ -38,7 +36,7 @@ export const esignet = (
38
36
  url.searchParams.append("state", "fetch-on-mount");
39
37
  url.searchParams.append(
40
38
  "redirect_uri",
41
- '${window.location.origin}/drafts/${window.location.pathname.split("/")[2]}/events/${event}/${sectionId}/group/${sectionId}',
39
+ '${window.location.href}',
42
40
  );
43
41
 
44
42
  return {
@@ -88,21 +86,17 @@ export const popupButton = ({
88
86
 
89
87
  /**
90
88
  *
91
- * @description esignet callback button form definition. Calls mosip-api/esignet-api /esignet/get-oidp-user-info (this field may not be supported in the latest release of OpenCRVS yet)
89
+ * @description esignet callback button form definition. Calls https://mosip-api.{{hostname}}/esignet/get-oidp-user-info
92
90
  *
93
91
  */
94
92
 
95
93
  export const esignetCallback = ({
96
94
  fieldName,
97
- event,
98
- sectionId,
99
- getOIDPUserInfoUrl,
95
+ mosipAPIUserInfoUrl,
100
96
  openIdProviderClientId,
101
97
  }: {
102
98
  fieldName: string;
103
- event: string;
104
- sectionId: string;
105
- getOIDPUserInfoUrl: string;
99
+ mosipAPIUserInfoUrl: string;
106
100
  openIdProviderClientId: string;
107
101
  }) => ({
108
102
  name: fieldName,
@@ -115,14 +109,14 @@ export const esignetCallback = ({
115
109
  validator: [],
116
110
  hideInPreview: true,
117
111
  options: {
118
- url: getOIDPUserInfoUrl,
112
+ url: mosipAPIUserInfoUrl,
119
113
  headers: {
120
114
  "Content-type": "application/json",
121
115
  },
122
116
  body: {
123
117
  clientId: openIdProviderClientId,
124
118
  redirectUri:
125
- '${window.location.origin}/drafts/${window.location.pathname.split("/")[2]}/events/${event}/${sectionId}/group/${sectionId}',
119
+ '${window.location.href}',
126
120
  },
127
121
 
128
122
  method: "POST",