release/0.1.0
HerrHase 3 years ago
parent 1954e233d6
commit 2606d51e0e

@ -0,0 +1,16 @@
{
"/public/js/spritemap.js": "/public/js/spritemap.js?id=2dda73ecee3bb668b395026efda6524c",
"/public/js/app.js": "/public/js/app.js?id=42bfe8fc554ce4641883c055b1d30a2c",
"/public/css/styles.css": "/public/css/styles.css?id=d8096bd2ff84ae29cb0ecf810064b218",
"/public/css/demo.html": "/public/css/demo.html?id=a54a5d205e3152fb64b33dda63ffa555",
"/public/css/IBMPlexMono-Bold.eot": "/public/css/IBMPlexMono-Bold.eot?id=ef1fadf711db80a00542b202ab14f7ee",
"/public/css/IBMPlexMono-Bold.ttf": "/public/css/IBMPlexMono-Bold.ttf?id=e46cace25a93f48a2ec32800717827cb",
"/public/css/IBMPlexMono-Bold.woff": "/public/css/IBMPlexMono-Bold.woff?id=8864bd7cb954c4646045e3fc0bdec90c",
"/public/css/IBMPlexMono-Bold.woff2": "/public/css/IBMPlexMono-Bold.woff2?id=c6d3f08fe7a9fecab40d748b98c87cc5",
"/public/css/IBMPlexMono.eot": "/public/css/IBMPlexMono.eot?id=d68f064d6b86ff47b38ad486a3362d82",
"/public/css/IBMPlexMono.ttf": "/public/css/IBMPlexMono.ttf?id=60d8ae961dba3289c1d2d54e0b85c9b7",
"/public/css/IBMPlexMono.woff": "/public/css/IBMPlexMono.woff?id=18a7a5a76b4176759e2e1b3e674a7f82",
"/public/css/IBMPlexMono.woff2": "/public/css/IBMPlexMono.woff2?id=428bd06c5eb0362494016994c26188b4",
"/public/css/OFL.txt": "/public/css/OFL.txt?id=5c7bb1d9d37e52d30b53224261c955b2",
"/public/css/stylesheet.css": "/public/css/stylesheet.css?id=a3e561da46246c3c582cddec544ad25f"
}

23503
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -1,9 +1,19 @@
require('./bootstrap.js')
import AppList from './components/list.riot'
import AppSidebar from './components/sidebar.riot'
import AppTasks from './components/tasks.riot'
import AppTaskNew from './components/task-new.riot'
import AppTaskForm from './components/task-form.riot'
// register components
riot.register('app-list', AppList)
riot.register('app-sidebar', AppSidebar)
riot.register('app-tasks', AppTasks)
riot.register('app-task-new', AppTaskNew)
riot.register('app-task-form', AppTaskForm)
// mount components
riot.mount('app-list')
riot.mount('app-sidebar')
riot.mount('app-tasks')
riot.mount('app-task-new')
riot.mount('app-task-form')

@ -1,3 +0,0 @@
<app-action>
</app-action>

@ -1,3 +0,0 @@
<app-filter>
</app-filter>

@ -1,6 +1,6 @@
<app-list>
<div class="app-list">
xxx
<app-login>
<div class="app-login">
</div>
<script>
@ -15,4 +15,4 @@
}
</script>
</app-list>
</app-login>

@ -0,0 +1,89 @@
<app-sidebar>
<div class={ getClasses() }>
<div class="sidebar__inner">
<!-- header -->
<div class="bar">
<div class="bar__main">
<slot name="title" />
</div>
<div class="bar__end">
<button class="button button--transparent" type="button" onclick={ (event) => { handleClose(event) } }>
<svg class="icon fill-text-contrast" aria-hidden="true">
<use xlink:href="/symbol-defs.svg#icon-close"></use>
</svg>
</button>
</div>
</div>
<!-- body -->
<div class="sidebar__body">
<slot name="form" data={ state.data } />
</div>
<!-- footer -->
<div class="sidebar__footer">
<button class="button m-bottom-0" type="submit" form="app-users-form">
Save
<svg class="icon fill-success p-left-3" aria-hidden="true">
<use xlink:href="/symbol-defs.svg#icon-check"></use>
</svg>
</button>
<button class="button m-bottom-0" type="submit" form="app-users-form" close>
Save and Close
<svg class="icon fill-success p-left-3" aria-hidden="true">
<use xlink:href="/symbol-defs.svg#icon-arrow-right"></use>
</svg>
</button>
</div>
</div>
</div>
<script>
import observable from '@riotjs/observable'
/**
*
*
*
*/
export default {
state: {
isOpen: false
},
onMounted()
{
observable(this.root)
this.root.on('open', () => {
this.state.isOpen = true
this.update()
})
},
/**
*
*
*/
getClasses()
{
let classes = [
'sidebar'
]
if (this.state.isOpen === true) {
classes.push('sidebar--open')
}
return classes.join(' ')
}
}
</script>
</app-sidebar>

@ -0,0 +1,122 @@
<app-task-form>
<app-sidebar>
<span slot="title">
<virtual if={ state.current.name }>
Edit Task { state.current.name }
</virtual>
<virtual if={ !state.current.name }>
New Task
</virtual>
</span>
<form class="form" slot="form" onsubmit={ (event) => { state.validator.submit(event) } }>
<div class="field-group">
<label class="field-label">
name
<input class="field-text" name="name" type="text" />
<field-error name="name"></field-error>
</label>
</div>
<div class="field-group">
<label class="field-label">
url
<input class="field-text" name="url" type="text" />
<field-error name="url"></field-error>
</label>
</div>
<div class="field-group">
<label class="field-label">
requestHandler
<select class="field-choice" name="requesthandler">
<option></option>
<option each={ handler in state.requestHandlers }></option>
</select>
<field-error name="requesthandler"></field-error>
</label>
</div>
</form>
</app-sidebar>
<script>
import FormValidator from '@tiny-components/validator/src/formValidator.js'
import FieldError from '@tiny-components/validator/src/fieldError.riot'
import taskFormStore from './../stores/taskForm.js'
import * as riot from 'riot'
riot.register('field-error', FieldError)
riot.mount('field-error')
/**
*
*
*/
export default {
state: {
requestHandlers: [],
validator: undefined,
current: {
},
isOpen: false
},
/**
*
*
*/
onMounted()
{
// creating formValidator
this.state.validator = new FormValidator(this.$('.form'), {
'name': {
'presence': true
},
'url': {
'presence': true
},
'requestHandler': {
'presence': true
}
})
// adding on success
this.state.validator.onSuccess((event, data) => {
this.handleSuccess(event, data)
})
taskFormStore.on('toggle-form', () => {
if (this.state.isOpen) {
this.state.isOpen = false
} else {
this.state.isOpen = true
}
this.update()
})
this.update()
},
/**
*
* @param {object} event
*
*/
handleSubmit(event)
{
}
}
</script>
</app-task-form>

@ -0,0 +1,43 @@
<app-action-new>
<button class="button m-bottom-0 m-top-5" onclick={ (event) => { handleNew(event) } }>
<svg class="icon fill-text-contrast" aria-hidden="true">
<use xlink:href="/symbol-defs.svg#icon-close"></use>
</svg>
New
</button>
<script>
import taskFormStore from './../stores/taskForm.js'
/**
*
*
*
*/
export default {
state: {
form: undefined
},
onMounted()
{
this.state.form = document.querySelector('#task-form').firstChild
},
/**
*
* @param {[type]} event
* @return {[type]}
*/
handleNew(event)
{
document.querySelector('#task-form').firstChild.trigger('open')
}
}
</script>
</app-action-new>

@ -0,0 +1,120 @@
<app-tasks>
<div class="tasks">
<table class="table table--stripped">
<thead>
<tr>
<th class="table__th">
name
</th>
<th class="table__th">
url
</th>
<th class="table__th">
requestHandler
</th>
<th class="table__th">
actions
</th>
<th class="table__th">
cron
</th>
<th class="table__th"></th>
<tr>
</thead>
<tbody>
<tr if={ state.tasks.length > 0 } each={ task in state.tasks }>
<td class="table__td">
{ task.name }
</td>
<td class="table__td">
{ task.url }
</td>
<td class="table__td">
{ task.requestHandler }
</td>
<td class="table__td">
<virtual each={ action in task.actions }>
<span>
{ action.className }
</span>
<span if={ actions.options }>
{ JSON.stringify(action.options) }
</span>
</virtual>
</td>
<td class="table__td">
{ task.cron }
</td>
<td class="table__td">
<button class="button" onclick={ (event) => { handleEdit(event, task) } }>
Edit
</button>
<button class="button" onclick={ (event) => { handleDelete(event, task) } }>
Delete
</button>
</td>
</tr>
<tr if={ state.tasks.length === 0 }>
<td class="table__td center" colspan="6">
Nothing found
</td>
</tr>
</tbody>
</table>
</div>
<script>
/**
*
*
*
*/
export default
{
state: {
tasks: []
},
/**
*
*
*/
onMounted()
{
this.getTasks()
},
/**
*
*
*/
getTasks()
{
fetch('/api/task', (response) => {
this.state.tasks = response.data
})
},
/**
*
*
*/
handleDelete(event, action)
{
},
/**
*
*
*/
handleEdit(event, action)
{
}
}
</script>
</app-tasks>

@ -0,0 +1,34 @@
/**
*
*
*
* @author Björn Hase
*
*
*/
import observable from '@riotjs/observable'
export default observable(
{
/**
*
* @param {object} data
*
*/
toggle(data)
{
this.trigger('toggle-form')
},
/**
*
* @param {object} data
*
*/
edit(data)
{
this.trigger('edit-form', data)
}
})

@ -4368,6 +4368,12 @@
}
}
},
"immutable": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/immutable/-/immutable-4.0.0.tgz",
"integrity": "sha512-zIE9hX70qew5qTUjSS7wi1iwj/l7+m54KWU247nhM3v806UdGj1yDndXj+IOYxxtW9zyLI+xqFNZjTuDaLUqFw==",
"dev": true
},
"import-fresh": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
@ -6323,6 +6329,27 @@
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"dev": true
},
"sass": {
"version": "1.49.9",
"resolved": "https://registry.npmjs.org/sass/-/sass-1.49.9.tgz",
"integrity": "sha512-YlYWkkHP9fbwaFRZQRXgDi3mXZShslVmmo+FVK3kHLUELHHEYrCmL1x6IUjC7wLS6VuJSAFXRQS/DxdsC4xL1A==",
"dev": true,
"requires": {
"chokidar": ">=3.0.0 <4.0.0",
"immutable": "^4.0.0",
"source-map-js": ">=0.6.2 <2.0.0"
}
},
"sass-loader": {
"version": "12.6.0",
"resolved": "https://registry.npmjs.org/sass-loader/-/sass-loader-12.6.0.tgz",
"integrity": "sha512-oLTaH0YCtX4cfnJZxKSLAyglED0naiYfNG1iXfU5w1LNZ+ukoA5DtyDIN5zmKVZwYNJP4KRc5Y3hkWga+7tYfA==",
"dev": true,
"requires": {
"klona": "^2.0.4",
"neo-async": "^2.6.2"
}
},
"schema-utils": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-2.7.1.tgz",

@ -2,6 +2,7 @@
"name": "frontend",
"version": "0.1.0",
"dependencies": {
"@riotjs/observable": "^4.1.1",
"@tiny-components/plain-ui": "^0.5.0",
"@tiny-components/validator": "^0.1.0",
"got": "^12.0.1",
@ -11,6 +12,8 @@
"@riotjs/webpack-loader": "^6.0.0",
"laravel-mix": "^6.0.43",
"laravel-mix-purgecss": "^6.0.0",
"sass": "^1.49.9",
"sass-loader": "^12.6.0",
"svg-spritemap-webpack-plugin": "^4.4.0"
}
}

@ -1,12 +1,19 @@
{% layout 'layout.liquid' %}
{% block app_main %}
<div class="container">
<div class="grid justify-center">
<div class="col-12 col-md-8">
<app-view></app-view>
<div class="container-full">
<div class="grid">
<div class="col-12">
<app-task-new></app-task-new>
</div>
</div>
<div class="grid">
<div class="col-12">
<app-tasks></app-tasks>
</div>
</div>
<app-task-form id="task-form"></app-task-form>
</div>
{% endblock %}

@ -3,7 +3,9 @@
<head>
<meta charset="utf-8">
<title></title>
<title>
Super Hog
</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
@ -25,13 +27,25 @@
</header>
<main>
<noscript>
<div class="container-full">
<div class="grid justify-center">
<div class="col-12">
<div class="panel panel--border-highlight border-color-danger m-bottom-4">
Only works with Javascript!
</div>
</div>
</div>
</div>
</noscript>
{% block app_main %}{% endblock %}
</main>
<footer>
<div class="container">
<div class="container-full">
<div class="grid justify-center">
<div class="col-12 col-md-8">
<div class="col-12">
<hr / class="m-top-8">
<div class="group">
<div class="group__item">
@ -46,10 +60,6 @@
</div>
</footer>
<noscript>
<p>Only works with Javascript!</p>
</noscript>
<script>
const csrfToken = '{{ csrfToken }}'
</script>

@ -0,0 +1,15 @@
{% layout 'layout.liquid' %}
{% block app_main %}
<div class="container">
<div class="grid justify-center">
<div class="col-12 col-md-8">
<app-login></app-login>
</div>
</div>
</div>
{% endblock %}
{% block script %}
<script async src="/js/app.js"></script>
{% endblock %}

@ -63,5 +63,5 @@ mix
},
processCssUrls: false
})
.copyDirectory('node_modules/@tentakelfabrik/plain-ui/src/fonts/**', '../../public/css')
.copyDirectory('node_modules/@tiny-components/plain-ui/src/fonts/**', '../../public/css')
.version()

@ -12,21 +12,30 @@ const server = fastify()
* add plugins
*
*/
import { Liquid } from 'liquidjs'
import pov from 'point-of-view'
import liquid from './plugins/liquid.js'
const engine = new Liquid({
root: path.join(path.resolve(), '../frontend/views'),
extname: '.liquid',
})
server.register(liquid)
server.register(pov, {
engine: {
liquid: engine
}
})
/**
* add routes
*
*/
import authHttp from './http/api/auth.js'
import actionHttp from './http/api/action.js'
import indexHttp from './http/index.js'
import staticHttp from './http/static.js'
server
.register(authHttp, {
.register(actionHttp, {
'prefix': '/api'
})
.register(indexHttp)

@ -0,0 +1,109 @@
import DOMPurify from 'isomorphic-dompurify'
import ActionRepository from './../../repositories/actionRepository.js'
/**
*
*
* @author Björn Hase, me@herr-hase.wtf
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/HerrHase/super-hog
*
*/
export default async function(fastify, opts)
{
const actionRepository = new ActionRepository()
/**
*
*
* @param {object} request
* @param {object} response
*
*/
fastify.get('/action', async function (request, reply)
{
// getting actions
const actions = await actionRepository.find({ 'selector': {
'type': 'action'
}})
// send 200 and send set-token
reply
.code(200)
.send({
'data': actions
})
})
/**
*
*
* @param {object} request
* @param {object} response
*
*/
fastify.post('/action', async function (request, reply)
{
// getting actions
const action = await actionRepository.create()
// send 200 and send set-token
reply
.code(200)
.send({
'data': action
})
})
/**
*
*
* @param {object} request
* @param {object} response
*
*/
fastify.put('/action/:id', async function (request, reply)
{
// getting actions
const action = await actionRepository.update({
})
// send 200 and send set-token
reply
.code(200)
.send({
'data': action
})
})
/**
* delete single action
*
*
* @param {object} request
* @param {object} response
*
*/
fastify.delete('/action/:id', async function (request, reply)
{
// getting actions
const action = await actionRepository.findOne({
'id': request.query.id
})
if (!action) {
return reply
.code(404)
.send()
}
// send 200 and send set-token
reply
.code(200)
.send({
'success': true
})
})
}

@ -7,9 +7,9 @@ import token from '@fastify/csrf'
* - logout user
*
*
* @author Björn Hase, Tentakelfabrik
* @author Björn Hase, me@herr-hase.wtf
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://github.com/tentakelfabrik/fastify-lowdb-riotjs-lessons-learned
* @link https://gitea.node001.net/HerrHase/super-hog
*
*/
@ -22,9 +22,9 @@ export default async function(fastify, opts)
* @param {object} response
*
*/
fastify.get('/', async function(request, response)
fastify.get('/', (request, response) =>
{
response.view('./../..fronted/views/index.liquid')
response.view('../frontend/views/index')
})
/**

@ -12,6 +12,16 @@
"ajv": "^6.12.6"
}
},
"@fastify/csrf": {
"version": "4.0.1",
"resolved": "https://registry.npmjs.org/@fastify/csrf/-/csrf-4.0.1.tgz",
"integrity": "sha512-LkMtGoj0PhnkcbB8W/oWkUKciDY8dnOYEhDUh3h8TmbzhuYd+PtVTMZjM1DcAaSNxLYTjZqe2aX6Rn7tXJO9XA==",
"requires": {
"rndm": "^1.2.0",
"tsscmp": "^1.0.6",
"uid-safe": "^2.1.5"
}
},
"abstract-logging": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/abstract-logging/-/abstract-logging-2.0.1.tgz",
@ -502,6 +512,11 @@
"resolved": "https://registry.npmjs.org/quick-format-unescaped/-/quick-format-unescaped-4.0.4.tgz",
"integrity": "sha512-tYC1Q1hgyRuHgloV/YXs2w15unPVh8qfu/qCTfhTYamaw7fyhumKa2yGpdSo87vY32rIclj+4fWYQXUMs9EHvg=="
},
"random-bytes": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz",
"integrity": "sha1-T2ih3Arli9P7lYSMMDJNt11kNgs="
},
"range-parser": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
@ -537,6 +552,11 @@
"resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz",
"integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA=="
},
"rndm": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/rndm/-/rndm-1.2.0.tgz",
"integrity": "sha1-8z/pz7Urv9UgqhgyO8ZdsRCht2w="
},
"safe-buffer": {
"version": "5.2.1",
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
@ -657,6 +677,19 @@
"resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",
"integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA=="
},
"tsscmp": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/tsscmp/-/tsscmp-1.0.6.tgz",
"integrity": "sha512-LxhtAkPDTkVCMQjt2h6eBVY28KCjikZqZfMcC15YBeNjkgUpdCfBu5HoiOTDu86v6smE8yOjyEktJ8hlbANHQA=="
},
"uid-safe": {
"version": "2.1.5",
"resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz",
"integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==",
"requires": {
"random-bytes": "~1.0.0"
}
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",

@ -6,6 +6,7 @@
},
"type": "module",
"dependencies": {
"@fastify/csrf": "^4.0.1",
"dotenv": "^10.0.0",
"fastify": "^3.27.0",
"fastify-auth": "^1.1.0",

@ -5,13 +5,16 @@ import path from 'path'
/**
* plugin: usindg render engine liquidjs
*
* @author Björn Hase, me@herr-hase.wtf
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/HerrHase/super-hog
*
*/
function plugin(fastify, options, next) {
async function plugin(fastify, options)
{
const engine = new Liquid({
root: path.join(path.resolve(), '/views'),
root: path.join(path.resolve(), '/../../frontend/views'),
extname: '.liquid',
})
@ -22,4 +25,4 @@ function plugin(fastify, options, next) {
})
}
module.exports = plugin
export default plugin

@ -0,0 +1,24 @@
import Repository from './repository.js'
/**
* Action
*
* @author Björn Hase, me@herr-hase.wtf
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/HerrHase/super-hog
*
*/
class ActionRepository extends Repository
{
constructor()
{
super()
this.type = 'action'
this.index.push('id')
this.index.push('name')
}
}
export default ActionRepository

@ -0,0 +1,166 @@
import PouchDB from 'pouchdb'
import PouchDBfind from 'pouchdb-find'
/**
* Repository
*
* @author Björn Hase, me@herr-hase.wtf
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/HerrHase/super-hog
*
*/
class Repository
{
constructor()
{
PouchDB.plugin(PouchDBfind)
this.db = new PouchDB('./../../storage/database', {
revs_limit: 0
})
// adding index
this.index = [
'type'
]
if (this.index && this.index.lenth > 0) {
this.addIndex(this.index)
}
}
/**
* add index
*
* @param {array} fields
*
*/
async addIndex(fields)
{
try {
await this.db.createIndex({
index: {
fields: fields
}
})
} catch (error) {
console.log(error);
}
}
/**
*
*
* @param {array} data
* @param {function} success
*
*/
create(data)
{
//data._id = uuidv4()
data.type = this.type
// if beforeCreate exists
if (typeof this['beforeCreate'] === 'function') {
data = this.beforeCreate(data)
}
return this.db.post(data)
.then((response) => {
console.log(response)
// if afterCreate exists
if (typeof this['afterCreate'] === 'function') {
this.afterCreate(response)
}
return response
})
}
/**
*
*
* @param {array} data
* @param {function} success
*
*/
update(data)
{
// if beforeUpdate exists
if (typeof this['beforeUpdate'] === 'function') {
data = this.beforeUpdate(data)
}
return this.db.put(data)
.then((response) => {
// if beforeUpdate exists
if (typeof this['afterUpdate'] === 'function') {
this.afterUpdate(response)
}
return response
})
}
/**
*
*
* @param {string} id
* @param {function} success
*
*/
remove(id, success)
{
this.db.get(id).then((documents) => {
// if beforeUpdate exists
if (typeof this['beforeRemove'] === 'function') {
this.beforeRemove(documents)
}
this.db.remove(documents, {}, success)
// if beforeUpdate exists
if (typeof this['afterRemove'] === 'function') {
this.afterRemove(documents)
}
})
}
/**
* find documents
*
* @param {object} fields
* @param {object} query
* @param {function} success
*/
find(query)
{
return this.db.find(query).then((documents) => {
return documents.docs
})
}
/**
* find documents
*
* @param {object} fields
* @param {object} query
* @param {function} success
*/
findOne(query)
{
return this.db.find(query).then((documents) => {
if (documents.docs.length === 0) {
return null
} else {
return documents.docs[0]
}
})
}
}
export default Repository

@ -0,0 +1,70 @@
import Repository from './repository.js'
import bcrypt from 'bcrypt'
/**
*
*
* @author Björn Hase, me@herr-hase.wtf
* @license http://opensource.org/licenses/MIT The MIT License
* @link https://gitea.node001.net/HerrHase/super-hog
*
*/
class UserRepository extends Repository
{
constructor()
{
super()
this.type = 'user'
this.index.push('username')
this.index.push('sessionId')
}
/**
*
* @param {[type]} data
* @return {[type]}
*/
beforeCreate(data)
{
if (data.password) {
const salt = bcrypt.genSaltSync(15)
data.password = bcrypt.hashSync(data.password, salt)
}
return data
}
/**
* getting user by username
*
* @param {string} username
* @return {promise}
*/
async findOneByUsername(username)
{
return this.findOne({
'selector': {
'username': username
}
})
}
/**
* getting user by sessionToken
*
* @param {string} sessionToken
* @return {promise}
*/
findOneBySessionId(sessionId)
{
return this.findOne({
'selector': {
'sessionId': sessionId
}
})
}
}
export default UserRepository

@ -0,0 +1,19 @@
/**
*
*
*
*/
export default {
schema: {
body: {
username: { type: 'string' },
password: { type: 'string' }
},
response: {
200: {
type: 'object'
}
}
}
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,93 @@
Copyright © 2017 IBM Corp. with Reserved Font Name "Plex"
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

@ -0,0 +1,233 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex, noarchive">
<meta name="format-detection" content="telephone=no">
<title>Transfonter demo</title>
<link href="stylesheet.css" rel="stylesheet">
<style>
/*
http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed,
figure, figcaption, footer, header, hgroup,
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
margin: 0;
padding: 0;
border: 0;
font-size: 100%;
font: inherit;
vertical-align: baseline;
}
/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
display: block;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: '';
content: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
/* demo styles */
body {
background: #f0f0f0;
color: #000;
}
.page {
background: #fff;
width: 920px;
margin: 0 auto;
padding: 20px 20px 0 20px;
overflow: hidden;
}
.font-container {
overflow-x: auto;
overflow-y: hidden;
margin-bottom: 40px;
line-height: 1.3;
white-space: nowrap;
padding-bottom: 5px;
}
h1 {
position: relative;
background: #444;
font-size: 32px;
color: #fff;
padding: 10px 20px;
margin: 0 -20px 12px -20px;
}
.letters {
font-size: 25px;
margin-bottom: 20px;
}
.s10:before {
content: '10px';
}
.s11:before {
content: '11px';
}
.s12:before {
content: '12px';
}
.s14:before {
content: '14px';
}
.s18:before {
content: '18px';
}
.s24:before {
content: '24px';
}
.s30:before {
content: '30px';
}
.s36:before {
content: '36px';
}
.s48:before {
content: '48px';
}
.s60:before {
content: '60px';
}
.s72:before {
content: '72px';
}
.s10:before, .s11:before, .s12:before, .s14:before,
.s18:before, .s24:before, .s30:before, .s36:before,
.s48:before, .s60:before, .s72:before {
font-family: Arial, sans-serif;
font-size: 10px;
font-weight: normal;
font-style: normal;
color: #999;
padding-right: 6px;
}
pre {
display: block;
position: relative;
padding: 9px;
margin: 0 0 10px;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
font-size: 13px;
line-height: 1.428571429;
color: #333;
font-weight: normal;
font-style: normal;
background-color: #f5f5f5;
border: 1px solid #ccc;
overflow-x: auto;
border-radius: 4px;
}
pre:after {
display: block;
position: absolute;
right: 0;
top: 0;
content: 'Usage';
line-height: 1;
padding: 5px 8px;
font-size: 12px;
color: #767676;
background-color: #fff;
border: 1px solid #ccc;
border-right: none;
border-top: none;
border-radius: 0 4px 0 4px;
z-index: 10;
}
/* responsive */
@media (max-width: 959px) {
.page {
width: auto;
margin: 0;
}
}
</style>
</head>
<body>
<div class="page">
<div class="demo">
<h1 style="font-family: 'IBM Plex Mono'; font-weight: normal; font-style: normal;">IBM Plex Mono</h1>
<pre>.your-style {
font-family: 'IBM Plex Mono';
font-weight: normal;
font-style: normal;
}</pre>
<div class="font-container" style="font-family: 'IBM Plex Mono'; font-weight: normal; font-style: normal;">
<p class="letters">
abcdefghijklmnopqrstuvwxyz<br>
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br>
0123456789.:,;()*!?'@#<>$%&^+-=~
</p>
<p class="s10" style="font-size: 10px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s11" style="font-size: 11px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s12" style="font-size: 12px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s14" style="font-size: 14px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s18" style="font-size: 18px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s24" style="font-size: 24px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s30" style="font-size: 30px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s36" style="font-size: 36px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s48" style="font-size: 48px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s60" style="font-size: 60px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s72" style="font-size: 72px;">The quick brown fox jumps over the lazy dog.</p>
</div>
</div>
<div class="demo">
<h1 style="font-family: 'IBM Plex Mono'; font-weight: bold; font-style: normal;">IBM Plex Mono Bold</h1>
<pre>.your-style {
font-family: 'IBM Plex Mono';
font-weight: bold;
font-style: normal;
}</pre>
<div class="font-container" style="font-family: 'IBM Plex Mono'; font-weight: bold; font-style: normal;">
<p class="letters">
abcdefghijklmnopqrstuvwxyz<br>
ABCDEFGHIJKLMNOPQRSTUVWXYZ<br>
0123456789.:,;()*!?'@#<>$%&^+-=~
</p>
<p class="s10" style="font-size: 10px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s11" style="font-size: 11px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s12" style="font-size: 12px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s14" style="font-size: 14px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s18" style="font-size: 18px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s24" style="font-size: 24px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s30" style="font-size: 30px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s36" style="font-size: 36px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s48" style="font-size: 48px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s60" style="font-size: 60px;">The quick brown fox jumps over the lazy dog.</p>
<p class="s72" style="font-size: 72px;">The quick brown fox jumps over the lazy dog.</p>
</div>
</div>
</div>
</body>
</html>

File diff suppressed because it is too large Load Diff

@ -0,0 +1,24 @@
@font-face {
font-family: 'IBM Plex Mono';
src: url('IBMPlexMono.eot');
src: url('IBMPlexMono.eot?#iefix') format('embedded-opentype'),
url('IBMPlexMono.woff2') format('woff2'),
url('IBMPlexMono.woff') format('woff'),
url('IBMPlexMono.ttf') format('truetype');
font-weight: normal;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: 'IBM Plex Mono';
src: url('IBMPlexMono-Bold.eot');
src: url('IBMPlexMono-Bold.eot?#iefix') format('embedded-opentype'),
url('IBMPlexMono-Bold.woff2') format('woff2'),
url('IBMPlexMono-Bold.woff') format('woff'),
url('IBMPlexMono-Bold.ttf') format('truetype');
font-weight: bold;
font-style: normal;
font-display: swap;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,13 @@
(self["webpackChunkfrontend"] = self["webpackChunkfrontend"] || []).push([["spritemap"],{
/***/ "?c20d":
/*!******************************!*\
!*** spritemap-dummy-module ***!
\******************************/
/***/ (() => {
/***/ })
}]);

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1 @@
MANIFEST-000033

@ -0,0 +1,5 @@
2022/03/31-00:53:26.133389 7f0745274700 Recovering log #32
2022/03/31-00:53:26.133482 7f0745274700 Level-0 table #34: started
2022/03/31-00:53:26.141397 7f0745274700 Level-0 table #34: 237 bytes OK
2022/03/31-00:53:26.161662 7f0745274700 Delete type=0 #32
2022/03/31-00:53:26.161696 7f0745274700 Delete type=3 #30

@ -0,0 +1,5 @@
2022/03/29-22:43:15.594165 7f0939d36700 Recovering log #28
2022/03/29-22:43:15.594268 7f0939d36700 Level-0 table #31: started
2022/03/29-22:43:15.602015 7f0939d36700 Level-0 table #31: 237 bytes OK
2022/03/29-22:43:15.622567 7f0939d36700 Delete type=0 #28
2022/03/29-22:43:15.622595 7f0939d36700 Delete type=3 #26

Binary file not shown.

11633
yarn.lock

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save