From 853414c32f4a4d6dc878294ec06d4d9a6c36caa7 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Wed, 18 Sep 2024 20:42:33 +0530 Subject: [PATCH 1/7] integrated player changes --- src/FireboltExampleInvoker.js | 8 ++++++++ src/ValidationView.js | 4 +++- src/pubsub/handlers/setApiResponseHandler.js | 12 ++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/FireboltExampleInvoker.js b/src/FireboltExampleInvoker.js index ffa1f666..b814b05e 100644 --- a/src/FireboltExampleInvoker.js +++ b/src/FireboltExampleInvoker.js @@ -100,6 +100,14 @@ export const MODULE_MAP = { discovery: DISCOVERY_MODULE_MAP, }; +// importing additional invoker which has external sdk's being exported and adding those modules in the MODULE_MAP +try { + const additionalInvoker = require('../plugins/AdditionalExampleInvoker').default; + Object.assign(MODULE_MAP, additionalInvoker); +} catch (err) { + logger.error(`Unable to import additional invoker - ${err.message}`, 'MODULE_MAP'); +} + let instance = null; export default class FireboltExampleInvoker { diff --git a/src/ValidationView.js b/src/ValidationView.js index a998aca0..f53317b3 100644 --- a/src/ValidationView.js +++ b/src/ValidationView.js @@ -180,7 +180,9 @@ export default class ValidationView extends lng.Component { // Combine defaultSDKs and additionalSDKs into one array const allSDKs = [...CONSTANTS.defaultSDKs, ...CONSTANTS.additionalSDKs]; // Find the SDK configuration for the specified sdk mode - const sdkConfig = allSDKs.find((sdk) => sdkMode.includes(sdk.name.toUpperCase())); + const sdkConfigs = allSDKs.filter((sdk) => sdkMode.toUpperCase().includes(sdk.name.toUpperCase())); + const exactMatch = sdkConfigs.find((sdk) => sdkMode.toUpperCase() === sdk.name.toUpperCase()); + const sdkConfig = exactMatch || (sdkConfigs.length === 1 && sdkConfigs[0]) || sdkConfigs; // If SDK config found and validation method exists if (sdkConfig && sdkConfig.validation) { if (!sdkConfig.validation()) { diff --git a/src/pubsub/handlers/setApiResponseHandler.js b/src/pubsub/handlers/setApiResponseHandler.js index 364e26de..4eb54a3b 100644 --- a/src/pubsub/handlers/setApiResponseHandler.js +++ b/src/pubsub/handlers/setApiResponseHandler.js @@ -45,6 +45,8 @@ export default class SetApiResponseHandler extends BaseHandler { return this.setResponseAckChallenge(message); case 'userinterest': return this.setResponseUserInterestChallenge(message); + case 'external': + return this.setExternalResponse(message); default: const defaultIdString = JSON.stringify({ report: 'Selected module provider is not available', @@ -102,4 +104,14 @@ export default class SetApiResponseHandler extends BaseHandler { const reportIdString = JSON.stringify({ report: 'Received UserInterest apiResponse parameters' }); return reportIdString; } + + // importing external Api resonse function, which can set the pre-requisite values to external modules + setExternalResponse(message) { + try { + const externalFunction = require('../../../plugins/setExternalApiResponse'); + return externalFunction.setExternalApiResponse(message); + } catch (err) { + return JSON.stringify({ report: 'Unable to import and set the data for external module' }); + } + } } From d3d3840245b91b3285321ee1b5743b34a82e1b0b Mon Sep 17 00:00:00 2001 From: Kummithi Guru Eswar Sainath Reddy <148111540+Eswar2103@users.noreply.github.com> Date: Thu, 3 Oct 2024 14:57:27 +0530 Subject: [PATCH 2/7] Change AdditionalExampleInvoker import to FireboltExtensionInvoker --- src/FireboltExampleInvoker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FireboltExampleInvoker.js b/src/FireboltExampleInvoker.js index b814b05e..773835c3 100644 --- a/src/FireboltExampleInvoker.js +++ b/src/FireboltExampleInvoker.js @@ -102,7 +102,7 @@ export const MODULE_MAP = { // importing additional invoker which has external sdk's being exported and adding those modules in the MODULE_MAP try { - const additionalInvoker = require('../plugins/AdditionalExampleInvoker').default; + const additionalInvoker = require('../plugins/FireboltExtensionInvoker').default; Object.assign(MODULE_MAP, additionalInvoker); } catch (err) { logger.error(`Unable to import additional invoker - ${err.message}`, 'MODULE_MAP'); From 2acd2f420c1bed5f5681e8cdfc58777683946c30 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 8 Oct 2024 15:43:46 +0530 Subject: [PATCH 3/7] update constant --- src/constant.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/constant.js b/src/constant.js index dbc62c97..9ea653dc 100644 --- a/src/constant.js +++ b/src/constant.js @@ -115,7 +115,6 @@ export const CONSTANTS = { EXCLUDED_VALUES: [null, undefined], FIREBOLT_CONST: 'firebolt', CERTIFICATION: false, - METHODS_T0_IGNORE_WHICH_HAS_SET: ['privacy.settings', 'securestorage.setForApp'], ERROR_MESSAGEREGEX: new RegExp('((-)[0-9]{5}): ([A-Za-z ]*)'), LOCK_TIME: 20000, MAX_FAILURES: 3, From 5526258b9d23b1c2df183d2c7d2397f9a59b6044 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 8 Oct 2024 15:51:01 +0530 Subject: [PATCH 4/7] revert update --- src/constant.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/constant.js b/src/constant.js index 9ea653dc..dbc62c97 100644 --- a/src/constant.js +++ b/src/constant.js @@ -115,6 +115,7 @@ export const CONSTANTS = { EXCLUDED_VALUES: [null, undefined], FIREBOLT_CONST: 'firebolt', CERTIFICATION: false, + METHODS_T0_IGNORE_WHICH_HAS_SET: ['privacy.settings', 'securestorage.setForApp'], ERROR_MESSAGEREGEX: new RegExp('((-)[0-9]{5}): ([A-Za-z ]*)'), LOCK_TIME: 20000, MAX_FAILURES: 3, From e2e502c6fb93116429c2407c17b582443a48719b Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Tue, 8 Oct 2024 15:59:07 +0530 Subject: [PATCH 5/7] merge dev --- src/FireboltExampleInvoker.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/FireboltExampleInvoker.js b/src/FireboltExampleInvoker.js index 773835c3..4f7ce0e3 100644 --- a/src/FireboltExampleInvoker.js +++ b/src/FireboltExampleInvoker.js @@ -107,7 +107,6 @@ try { } catch (err) { logger.error(`Unable to import additional invoker - ${err.message}`, 'MODULE_MAP'); } - let instance = null; export default class FireboltExampleInvoker { From a270082e10bbedcadcaeb522defcc362268a355c Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 11 Oct 2024 15:55:45 +0530 Subject: [PATCH 6/7] merge dev --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 5984c4fe..9ab40ff7 100644 --- a/README.md +++ b/README.md @@ -153,4 +153,3 @@ To activate Mock Firebolt, there are specific start-up scripts that exist inside For pinChallenge and acknowledgeChallenge UI prompts , a timeout of 15s is added so that, if no action is taken when the prompts displays on the screen (i.e; neither yes/no/back button ), the prompts will be automatically dismissed with "null" value as the response. The prompt is displayed when the user needs to grant/deny a particular api, or the user has to enter a pin in-case of pinChallenge. If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed. - From 4bbbc5d9e455effbb52c08a03f41b67ceb1bc475 Mon Sep 17 00:00:00 2001 From: Nandana-NNR Date: Fri, 11 Oct 2024 16:22:22 +0530 Subject: [PATCH 7/7] revert dummy commit --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9ab40ff7..50bed960 100644 --- a/README.md +++ b/README.md @@ -152,4 +152,4 @@ To activate Mock Firebolt, there are specific start-up scripts that exist inside For pinChallenge and acknowledgeChallenge UI prompts , a timeout of 15s is added so that, if no action is taken when the prompts displays on the screen (i.e; neither yes/no/back button ), the prompts will be automatically dismissed with "null" value as the response. The prompt is displayed when the user needs to grant/deny a particular api, or the user has to enter a pin in-case of pinChallenge. -If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed. +If user wants to grant an api, yes button is pressed, for deniel - no button, and incase if the user wants to dismiss the prompt without any action, back button is pressed. \ No newline at end of file