2023-12-29 14:24:29 +00:00
|
|
|
import authModel from "../src/models/AuthModel";
|
2024-01-06 12:25:24 +00:00
|
|
|
import imageModel, { Image } from "../src/models/ImageModel";
|
2024-01-06 20:24:12 +00:00
|
|
|
import { faker } from "@faker-js/faker";
|
2023-12-29 14:24:29 +00:00
|
|
|
|
|
|
|
export default async function () {
|
2024-01-06 20:24:12 +00:00
|
|
|
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 } }
|
|
|
|
);
|
2024-01-06 12:25:24 +00:00
|
|
|
|
|
|
|
// Wait until all images are inserted
|
2024-01-06 20:24:12 +00:00
|
|
|
await Promise.allSettled(images.map((image) => imageModel.create(image)));
|
2023-12-29 14:24:29 +00:00
|
|
|
|
2023-12-29 18:37:35 +00:00
|
|
|
await authModel.create({
|
|
|
|
app: "tester",
|
|
|
|
secret: "test",
|
|
|
|
});
|
2023-12-29 14:24:29 +00:00
|
|
|
}
|