fix(core): update

This commit is contained in:
2024-05-30 15:08:09 +02:00
parent 1c417e15cc
commit 9f1c880c6a
9 changed files with 6268 additions and 3274 deletions

View File

@ -1,12 +1,12 @@
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
import { expect, expectAsync, tap } from '@push.rocks/tapbundle';
import * as smartguard from '../ts/index.js';
import * as smartexpress from '@pushrocks/smartexpress';
import * as smartrequest from '@pushrocks/smartrequest';
import * as typedserver from '@api.global/typedserver';
import * as smartrequest from '@push.rocks/smartrequest';
let smartexpressInstance: smartexpress.Server;
let smartexpressInstance: typedserver.servertools.Server;
tap.test('should create a demo smartexpress instance', async () => {
smartexpressInstance = new smartexpress.Server({
smartexpressInstance = new typedserver.servertools.Server({
cors: true,
forceSsl: false,
defaultAnswer: async () => 'hi there',
@ -16,8 +16,8 @@ tap.test('should create a demo smartexpress instance', async () => {
tap.test('should be able to create smartguards for a request', async () => {
interface IRequestGuardData {
req: smartexpress.Request;
res: smartexpress.Response;
req: typedserver.Request;
res: typedserver.Response;
}
const ipGuard = new smartguard.Guard<IRequestGuardData>(async (dataArg) => {
console.log('executing ip guard');
@ -32,7 +32,7 @@ tap.test('should be able to create smartguards for a request', async () => {
smartexpressInstance.addRoute(
'/testroute',
new smartexpress.Handler('ALL', async (req, res) => {
new typedserver.servertools.Handler('ALL', async (req, res) => {
await smartguard.passGuards(
{
req,