Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrated player changes #175

Open
wants to merge 12 commits into
base: dev
Choose a base branch
from
8 changes: 8 additions & 0 deletions src/FireboltExampleInvoker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add comment here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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 {
Expand Down
12 changes: 12 additions & 0 deletions src/pubsub/handlers/setApiResponseHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function description

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

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' });
}
}
}