Compare commits

..

44 Commits

Author SHA1 Message Date
5d9f4754a5 update-scanner: automatic update
@sapphirecode/eslint-config-ts: 1.1.12 ==> 1.1.13 minor
@sapphirecode/modelling: 1.1.2 ==> 1.1.3 minor
eslint: 6.8.0 ==> 7.2.0 major
2020-06-19 13:09:59 +02:00
2cac260954 update-scanner: automatic update
@sapphirecode/consts: 1.1.21 ==> 1.1.22 minor
@sapphirecode/eslint-config-ts: 1.1.11 ==> 1.1.12 minor
@sapphirecode/modelling: 1.0.40 ==> 1.1.2 minor
eslint: 6.8.0 ==> 7.2.0 major
typescript: 3.9.3 ==> 3.9.5 minor
2020-06-11 20:31:52 +02:00
d298b8e842 update-scanner: automatic update
@sapphirecode/consts: 1.1.20 ==> 1.1.21 minor
@sapphirecode/eslint-config-ts: 1.1.10 ==> 1.1.11 minor
@sapphirecode/modelling: 1.0.39 ==> 1.0.40 minor
eslint: 6.8.0 ==> 7.1.0 major
2020-06-02 08:49:07 +02:00
bd63607477 update-scanner: automatic update
@sapphirecode/eslint-config-ts: 1.1.9 ==> 1.1.10 minor
@sapphirecode/modelling: 1.0.38 ==> 1.0.39 minor
eslint: 6.8.0 ==> 7.1.0 major
2020-05-28 08:51:43 +02:00
55d461fb8e update-scanner: automatic update
@sapphirecode/consts: 1.1.19 ==> 1.1.20 minor
@sapphirecode/eslint-config-ts: 1.1.7 ==> 1.1.9 minor
@sapphirecode/modelling: 1.0.37 ==> 1.0.38 minor
eslint: 6.8.0 ==> 7.1.0 major
typescript: 3.9.2 ==> 3.9.3 minor
2020-05-23 18:23:15 +02:00
895893e76a update-scanner: automatic update
@sapphirecode/consts: 1.1.16 ==> 1.1.19 minor
@sapphirecode/eslint-config-ts: 1.0.45 ==> 1.1.7 minor
@sapphirecode/modelling: 1.0.34 ==> 1.0.37 minor
eslint: 6.8.0 ==> 7.0.0 major
2020-05-17 19:40:24 +02:00
39fbc73c74 update jenkins.js 2020-05-15 13:16:26 +02:00
e1c26e2c5e adapt jenkins.js 2020-05-13 16:07:31 +02:00
d3a93108e2 update-scanner: automatic update
@sapphirecode/eslint-config-ts: 1.0.44 ==> 1.0.45 minor
@sapphirecode/modelling: 1.0.33 ==> 1.0.34 minor
eslint: 6.8.0 ==> 7.0.0 major
typescript: 3.8.3 ==> 3.9.2 minor
2020-05-13 11:10:26 +02:00
7a79aca59b update-scanner: automatic update
@sapphirecode/modelling: 1.0.31 ==> 1.0.33 minor
eslint: 6.8.0 ==> 7.0.0 major
2020-05-09 21:54:04 +02:00
ffb086a774 update-scanner: automatic update
@sapphirecode/consts: 1.1.15 ==> 1.1.16 minor
@sapphirecode/eslint-config-ts: 1.0.43 ==> 1.0.44 minor
@sapphirecode/modelling: 1.0.30 ==> 1.0.31 minor
2020-05-08 13:43:47 +02:00
d1499bb6d4 update-scanner: automatic update
@sapphirecode/eslint-config-ts: 1.0.41 ==> 1.0.43 minor
@sapphirecode/modelling: 1.0.28 ==> 1.0.30 minor
2020-05-07 19:31:54 +02:00
a6d4a35588 update-scanner: automatic update
@sapphirecode/consts: 1.1.14 ==> 1.1.15 minor
@sapphirecode/eslint-config-ts: 1.0.38 ==> 1.0.41 minor
@sapphirecode/modelling: 1.0.27 ==> 1.0.28 minor
2020-05-07 10:33:18 +02:00
2e4bb21354 update-scanner: automatic update
@sapphirecode/consts: 1.1.13 ==> 1.1.14 minor
2020-05-06 10:00:12 +02:00
3ed5253fc4 upda 2020-05-06 08:35:28 +02:00
274f2b4b7a fix 2020-05-06 07:45:02 +02:00
6eae1742d6 fix 2020-05-06 07:33:07 +02:00
cc59df51d0 fix publish 2020-05-05 19:50:12 +02:00
2a950310be move to @sapphirecode scope 2020-05-05 19:23:36 +02:00
9b4ad340a2 remove unnecessary dependencies 2020-05-04 21:40:54 +02:00
dfc0bc3b7e update-scanner: automatic update
@scode/consts: 1.1.9 ==> 1.1.11 minor
@scode/eslint-config-ts: 1.0.29 ==> 1.0.31 minor
@scode/modelling: 1.0.22 ==> 1.0.23 minor
2020-05-04 21:10:13 +02:00
c2ea65a992 update 2020-05-04 20:28:47 +02:00
3de5485650 update 2020-05-04 20:14:56 +02:00
dfd3df544c update-scanner: automatic update
@scode/consts: 1.1.8 ==> 1.1.9 minor
@scode/eslint-config-ts: 1.0.28 ==> 1.0.29 minor
@scode/modelling: 1.0.17 ==> 1.0.18 minor
2020-05-03 18:25:46 +02:00
7fe6dee81c fix 2020-05-03 17:05:04 +02:00
1d7791c2b0 only publish necessary files 2020-05-03 17:04:36 +02:00
3c8dcf3ad2 fix yarn.lock 2020-05-03 17:03:52 +02:00
ab70c46501 apply functions 2020-05-03 16:10:13 +02:00
3af8b97258 version bump 2020-05-02 21:51:56 +02:00
431e21806b Merge branch 'dev'
# Conflicts:
#	package.json
#	yarn.lock
2020-05-02 21:49:45 +02:00
00546001eb update-scanner: automatic update
@scode/eslint-config: 2.0.12 ==> 2.0.13 minor
2020-05-02 17:09:17 +02:00
db3ae308e6 update-scanner: automatic update
@scode/eslint-config: 2.0.11 ==> 2.0.12 minor
2020-04-28 07:41:15 +02:00
20394e65f8 update-scanner: automatic update
ava: 3.8.0 ==> 3.8.1 minor
2020-04-27 13:56:02 +02:00
7b9ce83c71 update-scanner: automatic update
ava: 3.7.1 ==> 3.8.0 minor
2020-04-27 13:02:03 +02:00
27cec2cb0b update-scanner: automatic update
@scode/eslint-config: 2.0.10 ==> 2.0.11 minor
ava: 3.7.0 ==> 3.7.1 minor
2020-04-21 11:16:38 +02:00
a208a2fb50 update-scanner: automatic update
@scode/eslint-config: 2.0.7 ==> 2.0.10 minor
ava: 3.6.0 ==> 3.7.0 minor
2020-04-14 15:39:02 +02:00
52597ca46f fix 2020-04-14 15:03:51 +02:00
efa44f0405 fix lint script 2020-04-14 14:56:08 +02:00
1a98e86954 update-scanner: automatic update
@scode/eslint-config: 2.0.6 ==> 2.0.7 minor
2020-04-09 09:38:18 +02:00
ce4e78e0d5 update-scanner: automatic update 2020-04-08 13:06:19 +02:00
bda39f279f update-scanner: automatic update 2020-04-06 10:00:24 +02:00
111df45892 fix 2020-04-06 09:43:31 +02:00
bff13c3364 update-scanner: automatic update 2020-04-06 08:48:16 +02:00
6f242fb79f update-scanner: automatic update 2020-04-06 07:50:37 +02:00
9 changed files with 2227 additions and 2416 deletions

View File

@ -2,7 +2,7 @@
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Requestor which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
* Created by Timo Hocker <timo@sapphirecode.ovh>, March 2020
*/
module.exports = {
@ -12,6 +12,6 @@ module.exports = {
node: true
},
extends: [
'@scode'
'@sapphirecode'
]
}

1
.npmrc
View File

@ -1 +0,0 @@
@scode:registry=https://npm.scode.ovh

2
Jenkinsfile vendored
View File

@ -5,7 +5,7 @@ pipeline {
VERSION = VersionNumber([
versionNumberString:
'${BUILDS_ALL_TIME}',
versionPrefix: '1.1.',
versionPrefix: '2.0.',
worstResultForIncrement: 'SUCCESS'
])
}

View File

@ -1,33 +1,22 @@
/*
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Requestor which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
*/
/* eslint-disable no-process-exit */
/* eslint-disable no-console */
/* eslint-disable no-sync */
'use strict';
const https = require ('https');
const fs = require ('fs');
const child_process = require ('child_process');
const { execSync: exec_sync } = require ('child_process');
const pkg = JSON.parse (fs.readFileSync ('package.json', 'utf-8'));
[
,, pkg.version
const run_file = fs.createWriteStream ('.jenkins.run.js');
const [
,, ...args
] = process.argv;
fs.writeFileSync ('package.json', JSON.stringify (pkg, null, 2));
child_process.execSync ('yarn lint', { stdio: 'inherit' });
if (typeof pkg.scripts !== 'undefined' && typeof pkg.scripts.test === 'string')
child_process.execSync ('yarn test', { stdio: 'inherit' });
child_process.exec ('git log -1 | grep \'\\[no publish\\]\'')
.addListener ('exit', (code) => {
if (code === 0) {
console.log ('build not marked for deployment');
process.exit (1);
}
else { child_process.execSync ('yarn publish'); }
run_file.on ('close', () => {
exec_sync (`node .jenkins.run.js ${args.join (' ')}`, { stdio: 'inherit' });
});
https.get (
'https://git.scode.ovh/Timo/standard/raw/branch/master/jenkins.run.js',
(msg) => {
msg.pipe (run_file);
}
);

View File

@ -2,7 +2,7 @@
* Copyright (C) Sapphirecode - All Rights Reserved
* This file is part of Requestor which is released under BSD-3-Clause.
* See file 'LICENSE' for full license details.
* Created by Timo Hocker <timo@scode.ovh>, March 2020
* Created by Timo Hocker <timo@sapphirecode.ovh>, March 2020
*/
module.exports = {
@ -12,6 +12,6 @@ module.exports = {
node: true
},
extends: [
'@scode/eslint-config-ts'
'@sapphirecode/eslint-config-ts'
]
}

View File

@ -1,6 +1,6 @@
import { Request, Response, Router } from 'express';
import { http } from '@scode/consts';
import { ControlModel, DatabaseModel } from '@scode/modelling';
import { http } from '@sapphirecode/consts';
import { ControlModel, DatabaseModel } from '@sapphirecode/modelling';
import { CrudHandler } from './CrudHandler';
import { HttpHandler } from './HttpHandler';
import { DatabaseCrudOptionsReader } from './DatabaseCrudOptionsReader';
@ -55,8 +55,7 @@ export class DatabaseCrudHandler extends HttpHandler implements CrudHandler {
cm.update ();
const dm = new this.dm;
for (const key of Object.keys (body_data))
dm.set (key, cm.get (key));
dm.assign (cm);
await dm.write ();
res.status (http.status_created)
@ -76,11 +75,11 @@ export class DatabaseCrudHandler extends HttpHandler implements CrudHandler {
const dm = new this.dm (parseInt (req.headers.id as string));
const found = await dm.read ();
const cm = new this.cm (dm.object);
const cm = new this.cm (dm.get_data ());
cm.update ();
res.status (found ? http.status_ok : http.status_not_found)
.json (cm.object);
.json (cm.get_data ());
}
public async update (req: Request, res: Response): Promise<void> {
@ -105,15 +104,13 @@ export class DatabaseCrudHandler extends HttpHandler implements CrudHandler {
return;
}
const cm = new this.cm (dm.object);
const cm = new this.cm (dm.get_data ());
cm.update ();
for (const key of Object.keys (body_data))
cm.set (key, body_data[key] as string|number|boolean);
cm.assign_object (body_data);
cm.update ();
for (const key of Object.keys (cm.object))
dm.set (key, cm.get (key));
dm.assign (cm);
const written = await dm.write ();

View File

@ -1,5 +1,5 @@
{
"name": "@scode/requestor",
"name": "@sapphirecode/requestor",
"version": "1.0.0",
"description": "Express handler templates",
"main": "dist/index.js",
@ -23,18 +23,18 @@
},
"devDependencies": {
"@ava/typescript": "^1.1.1",
"@scode/eslint-config-ts": "^1.0.27",
"@stryker-mutator/core": "^3.1.0",
"@stryker-mutator/javascript-mutator": "^3.1.0",
"ava": "^3.8.1",
"@sapphirecode/eslint-config-ts": "^1.0.29",
"eslint": "^6.8.0",
"nyc": "^15.0.1",
"typescript": "^3.8.3"
},
"dependencies": {
"@scode/consts": "^1.1.7",
"@scode/modelling": "^1.0.16",
"@sapphirecode/consts": "^1.1.9",
"@sapphirecode/modelling": "^1.0.19",
"@types/express": "^4.17.6",
"express": "^4.17.1"
}
},
"files": [
"LICENSE",
"/dist/"
]
}

1922
yarn-error.log Normal file

File diff suppressed because it is too large Load Diff

2632
yarn.lock

File diff suppressed because it is too large Load Diff