-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copy contents and update folder structure using GitHub Actions
- Loading branch information
1 parent
238d134
commit 58da0e3
Showing
277 changed files
with
3,698 additions
and
490 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
DataMapper/v1/hbs/backoffice/hbs/hbs/reflect_waiting_time.handlebars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"durationInSeconds": "{{durationInSeconds}}", | ||
"positionInUnassignedChats": "{{positionInUnassignedChats}}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import express from 'express'; | ||
|
||
const router = express.Router(); | ||
|
||
router.post('/', (req, res) => { | ||
const { object, name } = req.body; | ||
|
||
const serviceParameters = object.services['train-bot'].command; | ||
const index = serviceParameters.indexOf('--fixed-model-name'); | ||
|
||
if(index !== -1 && index < serviceParameters.length -1) { | ||
const fileName = serviceParameters[index + 1]; | ||
res.json(fileName.split(name)[1]) | ||
} else { | ||
res.json('1_0'); | ||
} | ||
|
||
|
||
}); | ||
|
||
export default router; |
31 changes: 31 additions & 0 deletions
31
DataMapper/v1/training/hbs/js/docker/updateVersionForBot.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import express from 'express'; | ||
|
||
const router = express.Router(); | ||
|
||
router.post('/', (req, res) => { | ||
const { object, servicesArray, newVersion } = req.body; | ||
servicesArray.forEach((service) => { | ||
if(service === 'train-bot') { | ||
const selectedService = object.services[service]; | ||
selectedService.command = replaceNextElementInArray(selectedService.command,'--fixed-model-name',`${newVersion}`) | ||
} else if(service === 'test-bot') { | ||
const selectedService = object.services[service]; | ||
selectedService.command = replaceNextElementInArray(selectedService.command,'--out',`results/${newVersion}`) | ||
} else if(service === 'test-bot-cv') { | ||
const selectedService = object.services[service]; | ||
selectedService.command = replaceNextElementInArray(selectedService.command,'--out',`results/cross-${newVersion}`) | ||
} | ||
}); | ||
res.json(object); | ||
}); | ||
|
||
const replaceNextElementInArray = (array, element, newInput) => { | ||
const index = array.indexOf(element); | ||
|
||
if(index !== -1 && index < array.length -1) { | ||
array[index + 1] = newInput.toString(); | ||
} | ||
return array; | ||
}; | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,42 @@ | ||
import fs from 'fs'; | ||
import fs from "fs"; | ||
import express from "express"; | ||
import path from "path"; | ||
|
||
const router = express.Router(); | ||
|
||
function customIsValidFilePath(file_path) { | ||
const illegalCharacterPattern = /[\\?%*:|"<>.]/; | ||
return illegalCharacterPattern.test(file_path); | ||
const illegalCharacterPattern = /[\\?%*:|"<>.]/; | ||
return illegalCharacterPattern.test(file_path); | ||
} | ||
|
||
function customBuildContentFilePath(file_path) { | ||
return path.join(process.env.CONTENT_FOLDER || "", file_path); | ||
return path.join(import.meta.env.CONTENT_FOLDER || "", file_path); | ||
} | ||
|
||
router.post('/', (req, res) => { | ||
const filePath = req.body.file_path; | ||
const deletePath = customBuildContentFilePath(filePath); | ||
router.post("/", (req, res) => { | ||
const filePath = req.body.file_path; | ||
const deletePath = customBuildContentFilePath(filePath); | ||
|
||
if (!customIsValidFilePath(filePath)) { | ||
return res.status(400).json({ | ||
error: true, | ||
message: 'File path contains illegal characters', | ||
}); | ||
if (!customIsValidFilePath(filePath)) { | ||
return res.status(400).json({ | ||
error: true, | ||
message: "File path contains illegal characters", | ||
}); | ||
} | ||
|
||
fs.unlink(deletePath, (err) => { | ||
if (err) { | ||
return res.status(500).json({ | ||
error: true, | ||
message: "Unable to delete file", | ||
}); | ||
} | ||
|
||
fs.unlink(deletePath, (err) => { | ||
if (err) { | ||
return res.status(500).json({ | ||
error: true, | ||
message: 'Unable to delete file', | ||
}); | ||
} | ||
|
||
return res.status(200).json({ | ||
error: false, | ||
message: 'File deleted successfully', | ||
}); | ||
return res.status(200).json({ | ||
error: false, | ||
message: "File deleted successfully", | ||
}); | ||
}); | ||
}); | ||
|
||
export default router; |
14 changes: 14 additions & 0 deletions
14
DataMapper/v1/training/hbs/js/util/incrementDoubleDigitStringVersion.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import express from 'express'; | ||
|
||
const router = express.Router(); | ||
|
||
router.post('/', (req, res) => { | ||
const { version } = req.body; | ||
const splitVersion = version.split('_'); | ||
const majorV = splitVersion[0]; | ||
let minorV = parseInt(splitVersion[1]); | ||
minorV += 1; | ||
res.json(`${majorV}_${minorV}`); | ||
}); | ||
|
||
export default router; |
13 changes: 13 additions & 0 deletions
13
DataMapper/v1/training/hbs/js/util/removeServicesConnectedToIntent.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import express from 'express'; | ||
|
||
const router = express.Router(); | ||
|
||
router.post('/', (req, res) => { | ||
const { connections, services } = req.body; | ||
const usedServiceIds = new Set(connections.map(x => x.service)); | ||
const unusedServices = services.filter(x => !usedServiceIds.has(x.serviceId)); | ||
|
||
return res.status(200).send(unusedServices); | ||
}); | ||
|
||
export default router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[ | ||
{{#each records}} | ||
{ | ||
"id": "{{ this.fileName }}", | ||
"name": "{{ this.fileName }}", | ||
"lastTrained": "{{ this.trainedDate }}", | ||
"state": "{{ this.state }}" | ||
}{{#unless @last}},{{/unless}} | ||
{{/each}} | ||
] |
Oops, something went wrong.