feat: continue work

Signed-off-by: Avior <github@avior.me>
This commit is contained in:
2023-06-28 01:15:56 +02:00
parent d76f412b82
commit 9530be5c43
16 changed files with 148 additions and 86 deletions

View File

@ -24,7 +24,7 @@ export default class RateLimiter {
/**
* timeSpan in seconds
*/
public static timeSpan = 600
public static timeSpan = 60
private static instance: RateLimiter = new RateLimiter()
public static getInstance(): RateLimiter {

View File

@ -6,10 +6,12 @@ import { objectLoop } from '@dzeio/object-util'
export default class ResponseBuilder {
private _body: BodyInit | null | undefined
public body(body: string | object | null | undefined) {
if (typeof body === 'object') {
public body(body: string | Buffer | object | null | undefined) {
if (typeof body === 'object' && !(body instanceof Buffer)) {
this._body = JSON.stringify(body)
this.addHeader('Content-Type', 'application/json')
} else if (body instanceof Buffer) {
this._body = body.toString()
} else {
this._body = body
}

View File

@ -2,7 +2,7 @@ import DaoFactory from '../models/DaoFactory'
import CookieManager from './CookieManager'
import { buildRFC7807 } from './RFCs/RFC7807'
interface Permission {
export interface Permission {
name: string
/**
* if set it will be usable by users