diff --git a/copilot/_studio_dependencies/ProxyScript/copilot.js b/copilot/_studio_dependencies/ProxyScript/copilot.js new file mode 100644 index 0000000..eb998bc --- /dev/null +++ b/copilot/_studio_dependencies/ProxyScript/copilot.js @@ -0,0 +1,57 @@ +/* + Proxy Script for CoPilot integration with IVAS +*/ +console.log({ script: "copilot", body: req.body}); + +req.body.event.metadata = _.merge(req.body.event.metadata, { + channel: copilot_settings.channel +}); + +const messengerUrl = `${copilot_settings.nlu.apiBaseURL}ProxyScript/run/${req.params.workspaceId}/${req.params.branch}/${copilot_settings.messengerRouteName}`; +(async () => { + try { + const { data: recognizedData } = await axios({ + url: messengerUrl, + method: "post", + data: req.body, + // headers: { + // Authorization: `Bearer ${copilot_settings.ops.token}` + // } + }); + res.send(recognizedData); + } catch (error) { + console.log(error.message); + res.send({ + answers: ['Something went wrong. Please try again.'], + outputs: {} + }); + } +})();/* + Proxy Script for CoPilot integration with IVAS +*/ +console.log({ script: "copilot", body: req.body}); + +req.body.event.metadata = _.merge(req.body.event.metadata, { + channel: copilot_settings.channel +}); + +const messengerUrl = `${copilot_settings.nlu.apiBaseURL}ProxyScript/run/${req.params.workspaceId}/${req.params.branch}/${copilot_settings.messengerRouteName}`; +(async () => { + try { + const { data: recognizedData } = await axios({ + url: messengerUrl, + method: "post", + data: req.body, + // headers: { + // Authorization: `Bearer ${copilot_settings.ops.token}` + // } + }); + res.send(recognizedData); + } catch (error) { + console.log(error.message); + res.send({ + answers: ['Something went wrong. Please try again.'], + outputs: {} + }); + } +})(); \ No newline at end of file diff --git a/copilot-extension/README.md b/copilot/copilot-extension/README.md similarity index 100% rename from copilot-extension/README.md rename to copilot/copilot-extension/README.md diff --git a/copilot-extension/images/icon-128.png b/copilot/copilot-extension/images/icon-128.png similarity index 100% rename from copilot-extension/images/icon-128.png rename to copilot/copilot-extension/images/icon-128.png diff --git a/copilot-extension/images/icon-16.png b/copilot/copilot-extension/images/icon-16.png similarity index 100% rename from copilot-extension/images/icon-16.png rename to copilot/copilot-extension/images/icon-16.png diff --git a/copilot-extension/images/icon-32.png b/copilot/copilot-extension/images/icon-32.png similarity index 100% rename from copilot-extension/images/icon-32.png rename to copilot/copilot-extension/images/icon-32.png diff --git a/copilot-extension/images/icon-48.png b/copilot/copilot-extension/images/icon-48.png similarity index 100% rename from copilot-extension/images/icon-48.png rename to copilot/copilot-extension/images/icon-48.png diff --git a/copilot-extension/manifest.json b/copilot/copilot-extension/manifest.json similarity index 100% rename from copilot-extension/manifest.json rename to copilot/copilot-extension/manifest.json diff --git a/copilot-extension/service-worker.js b/copilot/copilot-extension/service-worker.js similarity index 100% rename from copilot-extension/service-worker.js rename to copilot/copilot-extension/service-worker.js diff --git a/copilot-extension/src/pages/panel/panel.css b/copilot/copilot-extension/src/pages/panel/panel.css similarity index 100% rename from copilot-extension/src/pages/panel/panel.css rename to copilot/copilot-extension/src/pages/panel/panel.css diff --git a/copilot-extension/src/pages/side-panel/index.html b/copilot/copilot-extension/src/pages/side-panel/index.html similarity index 100% rename from copilot-extension/src/pages/side-panel/index.html rename to copilot/copilot-extension/src/pages/side-panel/index.html