Commit c0bdc533 authored by Ludan Stoecklé's avatar Ludan Stoecklé

1.7.1

parent 907eb35c
......@@ -4,6 +4,7 @@ stages:
- docker_build
- docker_test
- docker_release
- docker_release_mirror
# stuff for some steps only
......@@ -19,7 +20,7 @@ stages:
# variables etc.
variables:
ROSAENLG_VERSION: 1.7.0
ROSAENLG_VERSION: 1.7.1
DOCKER_REGISTRY: registry.gitlab.com/rosaenlg-projects/rosaenlg
DOCKER_CLI_ROOT: ${DOCKER_REGISTRY}/cli
DOCKER_SERVER_ROOT: ${DOCKER_REGISTRY}/server
......@@ -176,3 +177,18 @@ docker_release_server:
only:
- /^v[0-9]+\.[0-9]+\.[0-9]+$/
# when: manual
mirror_on_ecr:
stage: docker_release_mirror
image: guss77/dind-awscli
services:
- docker:dind
script:
- aws --version
- docker --version
- docker pull registry.gitlab.com/rosaenlg-projects/rosaenlg/server:$ROSAENLG_VERSION
- $(aws ecr get-login --no-include-email --region eu-west-1)
- docker tag registry.gitlab.com/rosaenlg-projects/rosaenlg/server:$ROSAENLG_VERSION 581498010210.dkr.ecr.eu-west-1.amazonaws.com/rosaenlg/server:$ROSAENLG_VERSION
- docker push 581498010210.dkr.ecr.eu-west-1.amazonaws.com/rosaenlg/server:$ROSAENLG_VERSION
\ No newline at end of file
{
"lerna": "3.16.4",
"lerna": "3.20.2",
"packages": [
"packages/*"
],
......
{
"name": "browser-ide-demo",
"version": "1.7.0",
"version": "1.7.1",
"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.7.0",
"rosaenlg": "1.7.1",
"tinyify": "^2.5.2",
"vue-codemirror": "^4.0.6"
}
......
......@@ -76,12 +76,8 @@ window.onload = function() {
}
},
save() {
// thanks to https://discuss.codemirror.net/t/implementing-save-clear-buttons-solved/1280
const textFileAsBlob = new Blob([this.code], { type: 'text/plain' });
userDownload(filename, content) {
const downloadLink = document.createElement('a');
const filename = `${this.exampleName}.pug`;
downloadLink.download = filename;
// hidden link title name
......@@ -89,7 +85,7 @@ window.onload = function() {
window.URL = window.URL || window.webkitURL;
downloadLink.href = window.URL.createObjectURL(textFileAsBlob);
downloadLink.href = window.URL.createObjectURL(content);
downloadLink.onclick = event => {
document.body.removeChild(event.target);
......@@ -101,6 +97,32 @@ window.onload = function() {
downloadLink.click();
},
save() {
// thanks to https://discuss.codemirror.net/t/implementing-save-clear-buttons-solved/1280
const textFileAsBlob = new Blob([this.code], { type: 'text/plain' });
this.userDownload(`${this.exampleName}.pug`, textFileAsBlob);
},
package() {
// could use some share code like gulp-rosaenlg but is practical like this
const name = this.exampleName.replace(/[^\w]/gi, '');
const packaged = {
templateId: name,
entryTemplate: `${name}.pug`,
compileInfo: {
activate: false,
compileDebug: false,
language: language,
},
templates: {},
};
packaged.templates[`${name}.pug`] = this.code;
const contentAsBlob = new Blob([JSON.stringify(packaged)], { type: 'application/json' });
this.userDownload(`${name}.json`, contentAsBlob);
},
compileRender() {
pugTemplate = this.code;
try {
......
......@@ -38,6 +38,7 @@
</div>
<button v-on:click="compileRender()">Compile and render</button>
<button v-on:click="save()">Save</button>
<button v-on:click="package()">Package</button>
<span id="langlinks">
<a href="demo_en_US.html">English</a>
<a href="demo_fr_FR.html">French</a>
......
......@@ -3,6 +3,7 @@
["fruits", "fruits.pug"],
["fruits extended", "fruits_extended.pug"],
["tutorial", "tutorial.pug"],
["tutorial for API, with external data option", "tutorial_api.pug"],
["conjugation", "conjugation.pug"],
["choosebest", "synonyms.pug"],
["compile error", "comperror.pug"],
......
-
let phones_default = [
{
name: 'OnePlus 5T',
colors: ['Black', 'Red', 'White'],
displaySize: 6,
screenRatio: 80.43,
battery: 3300,
bluetooh: 5
},
{
name: 'OnePlus 5',
colors: ['Gold', 'Gray'],
displaySize: 5.5,
screenRatio: 72.93,
battery: 3300,
bluetooh: 5
},
{
name: 'OnePlus 3T',
colors: ['Black', 'Gold', 'Gray'],
displaySize: 5.5,
screenRatio: 73.15,
battery: 3400,
bluetooh: 4.2
}
];
mixin colors
| #[+value(phone, {'NOT_IT':true})]'s available #[+syn('colors', 'tints', 'tones')]
| are
eachz color in phone.colors with { separator:',', last_separator:'and', end:'.' }
| #{color}
mixin itHasADisplay
| #[+value(phone)] has a display with
mixin display
itemz { begin_with_general: 'itHasADisplay', separator:',', last_separator:'and', mix:true }
item
| a physical size of #[+value(phone.displaySize)] inches
item
| a screen-to-body ratio of #[+value(phone.screenRatio)] %
mixin intro
synz
syn
| the #[+value(phone)] is really a fantastic phone.
syn
| i really love the new #[+value(phone)].
syn
| #[+value(phone)] : a great phone !
mixin phone_chunks
itemz {separator: '.', end:'.', mix:true}
item
| #[+colors]
item
| #[+display]
if !hasSaid('BATTERY')
| along with a battery of #[+value(phone.battery)] mAh
recordSaid('BATTERY')
item
if !hasSaid('BATTERY')
| #[+value(phone)] has a battery of #[+value(phone.battery)] mAh
recordSaid('BATTERY')
mixin phone_ref(obj, params)
| #{obj.name}
mixin phone_refexpr(obj, params)
synz {mode:'sequence'}
syn
| the phone
syn
| this phone
syn
if !hasFlag(params, 'NOT_IT')
| it
mixin phone
| #[+intro] .
| #[+phone_chunks]
-
if (!phones) { // if not provided in the API we take default values for tests
phones = phones_default;
}
let phone;
each phoneElt in phones
- phone = phoneElt;
p
-
phone.ref = 'phone_ref';
phone.refexpr = 'phone_refexpr';
| #[+phone]
deleteSaid('BATTERY')
{
"name": "content-deduplicate",
"version": "0.2.0",
"version": "0.2.1",
"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.7.0"
"synonym-optimizer": "2.7.1"
}
}
{
"name": "english-determiners",
"version": "2.7.0",
"version": "2.7.1",
"description": "English determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-adjectives",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0"
"french-h-muet-aspire": "2.7.1"
},
"keywords": [
"french",
......
{
"name": "french-determiners",
"version": "2.7.0",
"version": "2.7.1",
"description": "French determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-h-muet-aspire",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0",
"version": "2.7.1",
"description": "Ordinal numbers in French: 12 => douzième",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-verbs",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0"
"french-h-muet-aspire": "2.7.1"
},
"devDependencies": {
"copyfiles": "^2.1.1",
......
{
"name": "french-words-gender",
"version": "2.7.0",
"version": "2.7.1",
"description": "Gender of French words, based on the Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-adjectives",
"version": "2.7.0",
"version": "2.7.1",
"description": "German adjectives, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-determiners",
"version": "2.7.0",
"version": "2.7.1",
"description": "German determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-dict-helper",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0",
"version": "2.7.1",
"description": "Ordinal numbers in German: 12 => zwölfte",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-verbs",
"version": "2.7.0",
"version": "2.7.1",
"description": "German verbs, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-words",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0",
"version": "2.7.1",
"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.7.0"
"rosaenlg": "1.7.1"
}
}
{
"name": "italian-adjectives",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0"
"rosaenlg-filter": "2.7.1"
}
}
{
"name": "italian-determiners",
"version": "2.7.0",
"version": "2.7.1",
"description": "Italian determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-ordinals-cardinals",
"version": "2.7.0",
"version": "2.7.1",
"description": "Ordinal and cardinal numbers in Italian",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-verbs",
"version": "2.7.0",
"version": "2.7.1",
"description": "Italian verbs, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-words",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0",
"version": "2.7.1",
"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.7.0",
"version": "2.7.1",
"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.7.0",
"version": "1.7.1",
"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.7.0",
"gulp-rosaenlg": "2.7.1",
"mkdirp": "^0.5.1",
"rosaenlg": "1.7.0"
"rosaenlg": "1.7.1"
},
"devDependencies": {
"mocha": "^6.2.2",
......
{
"name": "rosaenlg-filter",
"version": "2.7.0",
"version": "2.7.1",
"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.7.0",
"french-h-muet-aspire": "2.7.1",
"titlecase-french": "^1.0.1"
},
"keywords": [
......
......@@ -30,7 +30,7 @@ function swagger(done) {
function(res) {
// dynamically add version
const packageJson = JSON.parse(fs.readFileSync('package.json'));
res.resolved.version = packageJson.version;
res.resolved.info.version = packageJson.version;
fs.writeFileSync('dist/openApiDocumentation_merged.json', JSON.stringify(res.resolved), 'utf8');
},
function(err) {
......
{
"name": "rosaenlg-node-server",
"version": "1.7.0",
"version": "1.7.1",
"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.7.0",
"gulp-rosaenlg": "2.7.1",
"json-refs": "^3.0.13",
"mocha": "^6.2.2",
"nyc": "^14.1.1",
......@@ -92,7 +92,7 @@
"body-parser": "^1.19.0",
"express": "^4.17.1",
"node-cache": "5.0.2",
"rosaenlg": "1.7.0",
"rosaenlg": "1.7.1",
"sha1": "^1.1.1",
"swagger-ui-express": "^4.1.2",
"uuid": "^3.3.3",
......
......@@ -83,7 +83,7 @@
"/templates": {
"get": {
"summary": "Get the IDs of the templates for user.",
"description": "Contains both the loaded templates and the ones which could be loaded",
"description": "Contains both the loaded templates and the ones which are on the permanent storage",
"parameters": [
{
"$ref": "#/components/parameters/userInHeader"
......
......@@ -61,6 +61,7 @@ export default class TemplatesController {
private templatesPath: string | undefined;
private s3: aws.S3;
private s3bucketName: string | undefined;
private logBackendName: 'disk' | 's3';
// eslint-disable-next-line new-cap
public router = express.Router();
......@@ -86,14 +87,6 @@ export default class TemplatesController {
return user + '#' + templateId + '.json';
}
private backendName(): 's3' | 'disk' {
if (this.templatesPath) {