tango-app-api-client 3.3.0-beta.2 → 3.3.0-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-client",
3
- "version": "3.3.0-beta.2",
3
+ "version": "3.3.0-beta.3",
4
4
  "description": "client",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "mongodb": "^6.3.0",
26
26
  "nodemon": "^3.0.3",
27
27
  "swagger-ui-express": "^5.0.0",
28
- "tango-api-schema": "^2.1.15",
28
+ "tango-api-schema": "^2.1.27",
29
29
  "tango-app-api-middleware": "^3.1.30",
30
30
  "winston": "^3.11.0",
31
31
  "winston-daily-rotate-file": "^5.0.0"
@@ -953,6 +953,7 @@ export async function domainDetailsConfiguration( req, res ) {
953
953
  const openSearch = JSON.parse( process.env.OPENSEARCH );
954
954
  const updateAck = await domainDetailsConfigurationUpdate( {
955
955
  clientId: req.params?.id, domainName: req.body?.domainName, isEnable: req.body?.isEnable,
956
+ enableWhitelisting: req.body?.enableWhitelisting, allowedIps: req.body?.allowedIps, enableOtp: req.body?.enableOtp,
956
957
  } );
957
958
 
958
959
  let updateKeys = [];
@@ -131,6 +131,11 @@ export const domainDetailsSchemaBody = joi.object(
131
131
  .pattern( /\..*/ )
132
132
  .message( 'Enter a valid domain' ) ).optional(),
133
133
  isEnable: joi.boolean().optional(),
134
+ enableWhitelisting: joi.boolean().optional(),
135
+ allowedIps: joi.array().items( joi.string()
136
+ .pattern( /\b((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b/ )
137
+ .message( 'Enter a valid ip address' ) ).optional(),
138
+ enableOtp: joi.boolean().optional(),
134
139
  },
135
140
  );
136
141
 
@@ -161,12 +161,15 @@ export function featureConfigurationUpdate( {
161
161
  } );
162
162
  }
163
163
 
164
- export function domainDetailsConfigurationUpdate( { clientId, domainName, isEnable } ) {
164
+ export function domainDetailsConfigurationUpdate( { clientId, domainName, isEnable, enableWhitelisting, allowedIps, enableOtp } ) {
165
165
  return clientModel.updateOne( { clientId: clientId },
166
166
  {
167
167
  $set: {
168
- 'ssoLogin.domainName': domainName,
169
- 'ssoLogin.isEnable': isEnable,
168
+ 'domainConfig.ssoLogin.domainName': domainName,
169
+ 'domainConfig.ssoLogin.isEnable': isEnable,
170
+ 'domainConfig.ipWhitelisting.enableWhitelisting': enableWhitelisting,
171
+ 'domainConfig.ipWhitelisting.allowedIps': allowedIps,
172
+ 'domainConfig.enableOtp': enableOtp,
170
173
  },
171
174
  } );
172
175
  }