feature: initial commit

This commit is contained in:
Andy Burke 2025-06-24 15:40:30 -07:00
commit 2c27f003c9
15 changed files with 1601 additions and 0 deletions

37
models/user.ts Normal file
View file

@ -0,0 +1,37 @@
import { FSDB_COLLECTION } from 'jsr:@andyburke/fsdb';
import { FSDB_INDEXER_SYMLINKS } from 'jsr:@andyburke/fsdb/indexers';
import { by_character } from 'jsr:@andyburke/fsdb/organizers';
export type USER = {
id: string;
username: string;
timestamps: {
created: string;
updated: string;
};
};
export const USER_STORE = new FSDB_COLLECTION<USER>({
name: 'users',
indexers: {
// email: new FSDB_INDEXER_SYMLINKS<USER>({
// name: 'email',
// field: 'email',
// organize: by_email
// }),
username: new FSDB_INDEXER_SYMLINKS<USER>({
name: 'username',
field: 'username',
organize: by_character
}),
normalized_username: new FSDB_INDEXER_SYMLINKS<USER>({
name: 'normalized_username',
get_values_to_index: (user) => {
return [user.username.toLowerCase()];
},
organize: by_character
})
}
});