v1.0.0 #28

Merged
bizcochito merged 147 commits from develop into main 2024-01-14 19:49:34 +00:00
2 changed files with 15 additions and 6 deletions
Showing only changes of commit e2c02cb32c - Show all commits

View File

@ -3,6 +3,7 @@
"module": "index.ts",
"type": "module",
"devDependencies": {
"@faker-js/faker": "^8.3.1",
"@types/express": "^4.17.21",
"@types/express-list-endpoints": "^6.0.3",
"@types/jest": "^29.5.11",

View File

@ -1,12 +1,20 @@
import authModel from "../src/models/AuthModel";
import imageModel from "../src/models/ImageModel";
import imageModel, { Image } from "../src/models/ImageModel";
import { faker } from '@faker-js/faker';
export default async function () {
await imageModel.create({
url: "https://example.com",
status: "consumed",
tags: ["2girls", "sleeping"],
});
const images = faker.helpers.multiple(() => ({
url: faker.helpers.unique(faker.internet.url),
status: faker.helpers.arrayElement(["available", "unavailable", "consumed"]),
tags: faker.helpers.arrayElements([
"2girls", "sleeping", "touhou",
"pokemon", "closed_eyes", "yume_nikki",
"waifu", "computer", "party", "yuru_camp"
], { min: 0, max: 5 }),
}), {count: {min: 5, max:50}});
// Wait until all images are inserted
await Promise.allSettled(images.map(image => imageModel.create(image)));
await authModel.create({
app: "tester",