refactor: use sync bcrypt to avoid issues with worker perms

refactor: fix up includes
This commit is contained in:
Andy Burke 2025-07-24 12:09:24 -07:00
parent e397bc884b
commit 1a02dcfcc3
27 changed files with 104 additions and 178 deletions

View file

@ -1,11 +1,11 @@
import lurid from 'jsr:@andyburke/lurid';
import lurid from '@andyburke/lurid';
import { get_session, get_user, PRECHECK_TABLE, require_user } from '../../../../../utils/prechecks.ts';
import { ROOM, ROOMS } from '../../../../../models/room.ts';
import * as CANNED_RESPONSES from '../../../../../utils/canned_responses.ts';
import { EVENT, get_events_collection_for_room } from '../../../../../models/event.ts';
import parse_body from '../../../../../utils/bodyparser.ts';
import { FSDB_COLLECTION, FSDB_SEARCH_OPTIONS, WALK_ENTRY } from 'jsr:@andyburke/fsdb';
import * as path from 'jsr:@std/path';
import { FSDB_COLLECTION, FSDB_SEARCH_OPTIONS, WALK_ENTRY } from '@andyburke/fsdb';
import * as path from '@std/path';
export const PRECHECKS: PRECHECK_TABLE = {};
@ -79,8 +79,8 @@ export async function GET(request: Request, meta: Record<string, any>): Promise<
};
const results = (await events.all(options))
.map((entry) => entry.load())
.sort((lhs_item, rhs_item) => rhs_item.timestamps.created.localeCompare(lhs_item.timestamps.created));
.map((entry: WALK_ENTRY<EVENT>) => entry.load())
.sort((lhs_item: EVENT, rhs_item: EVENT) => rhs_item.timestamps.created.localeCompare(lhs_item.timestamps.created));
// long-polling support
if (results.length === 0 && meta.query.wait) {
@ -106,10 +106,12 @@ export async function GET(request: Request, meta: Record<string, any>): Promise<
events.on('create', on_create);
request.signal.addEventListener('abort', () => {
events.off('create', on_create);
clearTimeout(timeout);
reject(new Error('request aborted'));
});
Deno.addSignalListener('SIGINT', () => {
events.off('create', on_create);
clearTimeout(timeout);
return resolve(Response.json(results, {
status: 200,
headers

View file

@ -1,10 +1,10 @@
import lurid from 'jsr:@andyburke/lurid';
import lurid from '@andyburke/lurid';
import parse_body from '../../../utils/bodyparser.ts';
import { get_session, get_user, require_user } from '../../../utils/prechecks.ts';
import * as CANNED_RESPONSES from '../../../utils/canned_responses.ts';
import { PRECHECK_TABLE } from '../../../utils/prechecks.ts';
import { ROOM, ROOMS } from '../../../models/room.ts';
import { WALK_ENTRY } from 'jsr:@andyburke/fsdb';
import { WALK_ENTRY } from '@andyburke/fsdb';
export const PRECHECKS: PRECHECK_TABLE = {};