Commit 798818e2 authored by Ludan Stoecklé's avatar Ludan Stoecklé

1.6.2

parent 8a0b1054
......@@ -19,7 +19,7 @@ stages:
# variables etc.
variables:
ROSAENLG_VERSION: 1.6.1
ROSAENLG_VERSION: 1.6.2
DOCKER_REGISTRY: registry.gitlab.com/rosaenlg-projects/rosaenlg
DOCKER_CLI_ROOT: ${DOCKER_REGISTRY}/cli
DOCKER_SERVER_ROOT: ${DOCKER_REGISTRY}/server
......
{
"name": "browser-ide-demo",
"version": "1.6.1",
"version": "1.6.2",
"description": "Client side demo of NLG templates compilation and rendering using RosaeNLG",
"main": "index.js",
"scripts": {
......@@ -34,7 +34,7 @@
"gulp-inject-string": "^1.1.2",
"gulp-rename": "^1.4.0",
"merge-stream": "^2.0.0",
"rosaenlg": "1.6.1",
"rosaenlg": "1.6.2",
"tinyify": "^2.5.2",
"vue-codemirror": "^4.0.6"
}
......
{
"name": "content-deduplicate",
"version": "0.1.1",
"version": "0.1.2",
"description": "Calculates distances between texts to prevent duplicate content",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -54,6 +54,6 @@
},
"dependencies": {
"k-medoids": "^1.0.6",
"synonym-optimizer": "2.6.1"
"synonym-optimizer": "2.6.2"
}
}
{
"name": "english-determiners",
"version": "2.6.1",
"version": "2.6.2",
"description": "English determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-adjectives",
"version": "2.6.1",
"version": "2.6.2",
"description": "Agreement of adjectives in French",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -45,7 +45,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.6.1"
"french-h-muet-aspire": "2.6.2"
},
"keywords": [
"french",
......
{
"name": "french-determiners",
"version": "2.6.1",
"version": "2.6.2",
"description": "French determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-h-muet-aspire",
"version": "2.6.1",
"version": "2.6.2",
"description": "List of French words that are \"aspiré\" (vs. \"muet\")\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[Dstarting with a h that is \"aspiré\" vs \"muet\"",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-ordinals",
"version": "2.6.1",
"version": "2.6.2",
"description": "Ordinal numbers in French: 12 => douzième",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-verbs",
"version": "2.6.1",
"version": "2.6.2",
"description": "French verbs: conjugation, based on the Lefff contents, and list of transitive and intransitive verbs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -50,7 +50,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.6.1"
"french-h-muet-aspire": "2.6.2"
},
"devDependencies": {
"copyfiles": "^2.1.1",
......
{
"name": "french-words-gender",
"version": "2.6.1",
"version": "2.6.2",
"description": "Gender of French words, based on the Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-adjectives",
"version": "2.6.1",
"version": "2.6.2",
"description": "German adjectives, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-determiners",
"version": "2.6.1",
"version": "2.6.2",
"description": "German determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-dict-helper",
"version": "2.6.1",
"version": "2.6.2",
"description": "Helper functions on an included database derived from german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-ordinals",
"version": "2.6.1",
"version": "2.6.2",
"description": "Ordinal numbers in German: 12 => zwölfte",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-verbs",
"version": "2.6.1",
"version": "2.6.2",
"description": "German verbs, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-words",
"version": "2.6.1",
"version": "2.6.2",
"description": "Gender and case of German words, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "gulp-rosaenlg",
"version": "2.6.1",
"version": "2.6.2",
"description": "RosaeNLG client side packaging helper",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -60,6 +60,6 @@
"browserify": "^16.5.0",
"debug": "^4.1.1",
"minify-stream": "^1.2.1",
"rosaenlg": "1.6.1"
"rosaenlg": "1.6.2"
}
}
{
"name": "italian-adjectives",
"version": "2.6.1",
"version": "2.6.2",
"description": "Italian adjectives, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -58,6 +58,6 @@
"license": "MIT",
"dependencies": {
"debug": "^4.1.1",
"rosaenlg-filter": "2.6.1"
"rosaenlg-filter": "2.6.2"
}
}
{
"name": "italian-determiners",
"version": "2.6.1",
"version": "2.6.2",
"description": "Italian determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-ordinals-cardinals",
"version": "2.6.1",
"version": "2.6.2",
"description": "Ordinal and cardinal numbers in Italian",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-verbs",
"version": "2.6.1",
"version": "2.6.2",
"description": "Italian verbs, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-words",
"version": "2.6.1",
"version": "2.6.2",
"description": "Gender and plural of Italian words, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "lefff-helper",
"version": "2.6.1",
"version": "2.6.2",
"description": "Helper functions on an included database derived from Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "morph-it-helper",
"version": "2.6.1",
"version": "2.6.2",
"description": "Helper functions on an included database derived from morph-it (Free Morphological Lexicon for the Italian Language)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "rosaenlg-cli",
"version": "1.6.1",
"version": "1.6.2",
"description": "RosaeNLG's CLI interface",
"bin": {
"rosaenlg": "./index.js",
......@@ -10,9 +10,9 @@
"dependencies": {
"chalk": "^3.0.0",
"commander": "^4.0.1",
"gulp-rosaenlg": "2.6.1",
"gulp-rosaenlg": "2.6.2",
"mkdirp": "^0.5.1",
"rosaenlg": "1.6.1"
"rosaenlg": "1.6.2"
},
"devDependencies": {
"mocha": "^6.2.2",
......
{
"name": "rosaenlg-filter",
"version": "2.6.1",
"version": "2.6.2",
"description": "Filtering feature of RosaeNLG",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -43,7 +43,7 @@
"better-title-case": "^1.0.1",
"compromise": "^11.14.3",
"debug": "^4.1.1",
"french-h-muet-aspire": "2.6.1",
"french-h-muet-aspire": "2.6.2",
"titlecase-french": "^1.0.1"
},
"keywords": [
......
{
"name": "rosaenlg-node-server",
"version": "1.6.1",
"version": "1.6.2",
"description": "Server for RosaeNLG, written in node.js",
"main": "dist/app.js",
"bin": {
......@@ -75,7 +75,7 @@
"gulp": "^4.0.2",
"gulp-awspublish": "^4.0.1",
"gulp-rename": "^1.4.0",
"gulp-rosaenlg": "2.6.1",
"gulp-rosaenlg": "2.6.2",
"json-refs": "^3.0.13",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
......@@ -92,10 +92,11 @@
"body-parser": "^1.19.0",
"express": "^4.17.1",
"node-cache": "5.0.2",
"rosaenlg": "1.6.1",
"rosaenlg": "1.6.2",
"sha1": "^1.1.1",
"swagger-ui-express": "^4.1.2",
"uuid": "^3.3.3",
"winston": "^3.2.1"
"winston": "^3.2.1",
"winston-aws-cloudwatch": "^3.0.0"
}
}
......@@ -18,7 +18,7 @@ export class RosaeContext {
this.originalPackagedTemplate = packagedTemplateWithUser;
this.templateId = packagedTemplateWithUser.templateId;
winston.info(`RosaeContext constructor for ${this.templateId}`);
winston.info({ templateId: this.templateId, message: `RosaeContext constructor` });
const opts: any = Object.assign({}, packagedTemplateWithUser.compileInfo);
opts.staticFs = packagedTemplateWithUser.templates;
......@@ -36,7 +36,7 @@ export class RosaeContext {
// autotest
const autotest = packagedTemplateWithUser.autotest;
if (autotest != null && autotest.activate) {
winston.info('autotest is activated');
winston.info({ templateId: this.templateId, message: `autotest is activated` });
let renderedBundle: RenderedBundle;
try {
......
......@@ -27,7 +27,7 @@ export default class App {
this.initializeControllers(controllers);
this.server = this.app.listen(this.port, () => {
winston.info(`App listening on the port ${this.port}`);
winston.info({ action: 'startup', message: `App listening on the port ${this.port}` });
});
}
......
......@@ -14,13 +14,22 @@ if (portInEnv) {
const app = new App(
[
new TemplatesController(
process.env.ROSAENLG_HOMEDIR,
process.env.AWS_S3_BUCKET,
process.env.AWS_ACCESS_KEY_ID,
process.env.AWS_SECRET_ACCESS_KEY,
process.env.AWS_S3_ENDPOINT,
),
new TemplatesController({
templatesPath: process.env.ROSAENLG_HOMEDIR,
s3: {
bucketName: process.env.AWS_S3_BUCKET,
accessKeyId: process.env.AWS_S3_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_S3_SECRET_ACCESS_KEY,
endpoint: process.env.AWS_S3_ENDPOINT,
},
cloudwatch: {
logGroupName: process.env.AWS_CW_LOG_GROUP_NAME,
logStreamName: process.env.AWS_CW_LOG_STREAM_NAME,
accessKeyId: process.env.AWS_CW_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_CW_SECRET_ACCESS_KEY,
region: process.env.AWS_CW_REGION,
},
}),
],
port,
);
......
const assert = require('assert');
const chai = require('chai');
const chaiHttp = require('chai-http');
const App = require('../dist/app').default;
const TemplatesController = require('../dist/templates.controller').default;
const helper = require('./helper');
chai.use(chaiHttp);
chai.should();
describe('cloudwatch', function() {
let app;
before(function() {
app = new App(
[
new TemplatesController({
cloudwatch: {
logGroupName: 'rosaenlg-rapidapi',
logStreamName: 'local-test',
accessKeyId: process.env.AWS_CW_ACCESS_KEY_ID,
secretAccessKey: process.env.AWS_CW_SECRET_ACCESS_KEY,
region: 'eu-west-1',
},
}),
],
5001,
).server;
});
after(function(done) {
app.close();
done();
});
it(`should render`, function(done) {
chai
.request(app)
.post(`/templates/render`)
.set('content-type', 'application/json')
.send(helper.getTestTemplate('chanson_with_data'))
.end((err, res) => {
res.should.have.status(200);
res.body.should.be.a('object');
const content = res.body;
assert.equal(content.renderOptions.language, 'fr_FR');
assert.equal(content.status, 'CREATED');
assert(
content.renderedText.indexOf(`Il chantera "Non, je ne regrette rien" d'Édith Piaf`) > -1,
content.renderedText,
);
done();
});
});
});
......@@ -388,7 +388,7 @@ describe('basic', function() {
});
});
after(function(done) {
helper.deleteTemplate(app, 'chanson', done);
helper.deleteTemplate(app, 'basic_a', done);
});
});
});
......@@ -172,7 +172,7 @@ describe('edge', function() {
const template = JSON.parse(helper.getTestTemplate('basic_a'));
template.user = 'DEFAULT_USER';
fs.writeFile(filename, JSON.stringify(template), 'utf8', () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
fs.unlink(filename, () => {
fs.rmdir(testFolder, done);
});
......
......@@ -37,7 +37,7 @@ describe('health', function() {
const testFolder = 'test-health';
before(function(done) {
fs.mkdir(testFolder, () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
done();
});
});
......@@ -63,7 +63,7 @@ describe('health', function() {
const testFolder = 'test-health-bad';
before(function(done) {
fs.mkdir(testFolder, () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
fs.rmdir(testFolder, () => {
done();
});
......
......@@ -23,7 +23,7 @@ describe('persistence', function() {
let app;
before(function(done) {
fs.mkdir(testFolder, () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
done();
});
});
......@@ -133,7 +133,7 @@ describe('persistence', function() {
const templateBasicB = JSON.parse(helper.getTestTemplate('basic_b'));
templateBasicB.user = 'DEFAULT_USER';
fs.writeFile(filenameBasicB, JSON.stringify(templateBasicB), 'utf8', () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
done();
});
});
......@@ -166,7 +166,7 @@ describe('persistence', function() {
before(function(done) {
fs.mkdir(testFolder, () => {
fs.writeFile(filename, 'some { bla bla', 'utf8', () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
done();
});
});
......@@ -194,7 +194,7 @@ describe('persistence', function() {
before(function(done) {
fs.mkdir(testFolder, () => {
fs.writeFile(filename, 'bla bla', 'utf8', () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
done();
});
});
......@@ -220,7 +220,7 @@ describe('persistence', function() {
let app;
before(function(done) {
fs.mkdir(testFolder, () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
fs.rmdir(testFolder, done);
});
});
......@@ -246,7 +246,10 @@ describe('persistence', function() {
describe('wrong templates path', function() {
it('must fail', () =>
assert.throws(() => new App([new TemplatesController('blablabla')], 5000).server, /no such file or directory/));
assert.throws(
() => new App([new TemplatesController({ templatesPath: 'blablabla' })], 5000).server,
/no such file or directory/,
));
});
describe('multiple users', function() {
......@@ -254,7 +257,7 @@ describe('persistence', function() {
let app;
before(function(done) {
fs.mkdir(testFolder, () => {
app = new App([new TemplatesController(testFolder)], 5000).server;
app = new App([new TemplatesController({ templatesPath: testFolder })], 5000).server;
done();
});
});
......
......@@ -22,7 +22,7 @@ describe('reload', function() {
before(function() {
fs.mkdirSync(testFolder);
process.env.ROSAENLG_HOMEDIR = testFolder;
app = new App([new TemplatesController(process.env.ROSAENLG_HOMEDIR)], 5000).server;
app = new App([new TemplatesController({ templatesPath: process.env.ROSAENLG_HOMEDIR })], 5000).server;
});
after(function() {
app.close();
......
......@@ -43,7 +43,14 @@ describe('s3', function() {
},
],
}).run(() => {
app = new App([new TemplatesController(null, bucketName, 'S3RVER', 'S3RVER', s3endpoint)], 5000).server;
app = new App(
[
new TemplatesController({
s3: { bucketName: bucketName, accessKeyId: 'S3RVER', secretAccessKey: 'S3RVER', endpoint: s3endpoint },
}),
],
5000,
).server;
done();<