BREAKING CHANGE: Migrate database system to prisma

This commit is contained in:
Siwoo Jeon 2024-09-22 18:58:26 +09:00
parent abf62a00af
commit 7a4a724e14
Signed by: migan
GPG key ID: 036E9A8C5E8E48DA
55 changed files with 11425 additions and 986 deletions

View file

@ -1,7 +1,7 @@
{ {
"recommendations": [ "recommendations": [
"arcanis.vscode-zipfs", "arcanis.vscode-zipfs",
"esbenp.prettier-vscode", "dbaeumer.vscode-eslint",
"dbaeumer.vscode-eslint" "esbenp.prettier-vscode"
] ]
} }

View file

@ -3,8 +3,8 @@
"**/.yarn": true, "**/.yarn": true,
"**/.pnp.*": true "**/.pnp.*": true
}, },
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs", "prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib", "typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true, "typescript.enablePromptUseWorkspaceTsdk": true
"eslint.nodePath": ".yarn/sdks"
} }

File diff suppressed because one or more lines are too long

925
.yarn/releases/yarn-4.5.0.cjs vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint/bin/eslint.js your application uses // Defer to the real eslint/bin/eslint.js your application uses
module.exports = absRequire(`eslint/bin/eslint.js`); module.exports = wrapWithUserWrapper(absRequire(`eslint/bin/eslint.js`));

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint your application uses // Defer to the real eslint your application uses
module.exports = absRequire(`eslint`); module.exports = wrapWithUserWrapper(absRequire(`eslint`));

32
.yarn/sdks/eslint/lib/types/index.d.ts vendored Normal file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint`));

View file

@ -0,0 +1,32 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/rules
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint/rules your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/rules`));

View file

@ -0,0 +1,32 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/universal
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint/universal your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));

View file

@ -0,0 +1,32 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/use-at-your-own-risk
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint/use-at-your-own-risk your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));

32
.yarn/sdks/eslint/lib/universal.js vendored Normal file
View file

@ -0,0 +1,32 @@
#!/usr/bin/env node
const {existsSync} = require(`fs`);
const {createRequire, register} = require(`module`);
const {resolve} = require(`path`);
const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
const isPnpLoaderEnabled = existsSync(absPnpLoaderPath);
if (existsSync(absPnpApiPath)) {
if (!process.versions.pnp) {
// Setup the environment to be able to require eslint/universal
require(absPnpApiPath).setup();
if (isPnpLoaderEnabled && register) {
register(pathToFileURL(absPnpLoaderPath));
}
}
}
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint/universal your application uses
module.exports = wrapWithUserWrapper(absRequire(`eslint/universal`));

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real eslint/use-at-your-own-risk your application uses // Defer to the real eslint/use-at-your-own-risk your application uses
module.exports = absRequire(`eslint/use-at-your-own-risk`); module.exports = wrapWithUserWrapper(absRequire(`eslint/use-at-your-own-risk`));

View file

@ -1,14 +1,27 @@
{ {
"name": "eslint", "name": "eslint",
"version": "9.5.0-sdk", "version": "9.11.0-sdk",
"main": "./lib/api.js", "main": "./lib/api.js",
"type": "commonjs", "type": "commonjs",
"bin": { "bin": {
"eslint": "./bin/eslint.js" "eslint": "./bin/eslint.js"
}, },
"exports": { "exports": {
".": {
"types": "./lib/types/index.d.ts",
"default": "./lib/api.js"
},
"./package.json": "./package.json", "./package.json": "./package.json",
".": "./lib/api.js", "./use-at-your-own-risk": {
"./use-at-your-own-risk": "./lib/unsupported-api.js" "types": "./lib/types/use-at-your-own-risk.d.ts",
"default": "./lib/unsupported-api.js"
},
"./rules": {
"types": "./lib/types/rules/index.d.ts"
},
"./universal": {
"types": "./lib/types/universal.d.ts",
"default": "./lib/universal.js"
}
} }
} }

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real prettier/bin/prettier.cjs your application uses // Defer to the real prettier/bin/prettier.cjs your application uses
module.exports = absRequire(`prettier/bin/prettier.cjs`); module.exports = wrapWithUserWrapper(absRequire(`prettier/bin/prettier.cjs`));

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../.pnp.cjs"; const relPnpApiPath = "../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real prettier your application uses // Defer to the real prettier your application uses
module.exports = absRequire(`prettier`); module.exports = wrapWithUserWrapper(absRequire(`prettier`));

View file

@ -1,6 +1,6 @@
{ {
"name": "prettier", "name": "prettier",
"version": "3.3.2-sdk", "version": "3.3.3-sdk",
"main": "./index.cjs", "main": "./index.cjs",
"type": "commonjs", "type": "commonjs",
"bin": "./bin/prettier.cjs" "bin": "./bin/prettier.cjs"

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript/bin/tsc your application uses // Defer to the real typescript/bin/tsc your application uses
module.exports = absRequire(`typescript/bin/tsc`); module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsc`));

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript/bin/tsserver your application uses // Defer to the real typescript/bin/tsserver your application uses
module.exports = absRequire(`typescript/bin/tsserver`); module.exports = wrapWithUserWrapper(absRequire(`typescript/bin/tsserver`));

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript/lib/tsc.js your application uses // Defer to the real typescript/lib/tsc.js your application uses
module.exports = absRequire(`typescript/lib/tsc.js`); module.exports = wrapWithUserWrapper(absRequire(`typescript/lib/tsc.js`));

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,7 +24,15 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const moduleWrapper = tsserver => { const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
const moduleWrapper = exports => {
return wrapWithUserWrapper(moduleWrapperFn(exports));
};
const moduleWrapperFn = tsserver => {
if (!process.versions.pnp) { if (!process.versions.pnp) {
return tsserver; return tsserver;
} }

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,7 +24,15 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const moduleWrapper = tsserver => { const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
const moduleWrapper = exports => {
return wrapWithUserWrapper(moduleWrapperFn(exports));
};
const moduleWrapperFn = tsserver => {
if (!process.versions.pnp) { if (!process.versions.pnp) {
return tsserver; return tsserver;
} }

View file

@ -8,6 +8,7 @@ const {pathToFileURL} = require(`url`);
const relPnpApiPath = "../../../../.pnp.cjs"; const relPnpApiPath = "../../../../.pnp.cjs";
const absPnpApiPath = resolve(__dirname, relPnpApiPath); const absPnpApiPath = resolve(__dirname, relPnpApiPath);
const absUserWrapperPath = resolve(__dirname, `./sdk.user.cjs`);
const absRequire = createRequire(absPnpApiPath); const absRequire = createRequire(absPnpApiPath);
const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`); const absPnpLoaderPath = resolve(absPnpApiPath, `../.pnp.loader.mjs`);
@ -23,5 +24,9 @@ if (existsSync(absPnpApiPath)) {
} }
} }
const wrapWithUserWrapper = existsSync(absUserWrapperPath)
? exports => absRequire(absUserWrapperPath)(exports)
: exports => exports;
// Defer to the real typescript your application uses // Defer to the real typescript your application uses
module.exports = absRequire(`typescript`); module.exports = wrapWithUserWrapper(absRequire(`typescript`));

View file

@ -1,6 +1,6 @@
{ {
"name": "typescript", "name": "typescript",
"version": "5.5.2-sdk", "version": "5.6.2-sdk",
"main": "./lib/typescript.js", "main": "./lib/typescript.js",
"type": "commonjs", "type": "commonjs",
"bin": { "bin": {

View file

@ -1 +1 @@
yarnPath: .yarn/releases/yarn-4.3.1.cjs yarnPath: .yarn/releases/yarn-4.5.0.cjs

View file

@ -1,4 +1,8 @@
# docker (option)
MYSQL_USER= MYSQL_USER=
MYSQL_PASSWORD= MYSQL_PASSWORD=
MYSQL_DATABASE= MYSQL_DATABASE=
MYSQL_ROOT_PASSWORD= MYSQL_ROOT_PASSWORD=
# prisma (require)
DATABASE_URL=

View file

@ -1,9 +1,10 @@
{ {
"name": "muffinbot", "name": "muffinbot",
"version": "4.0.0-pudding.e240910a", "version": "4.0.0-pudding.e240922a",
"main": "dist/index.js", "main": "dist/index.js",
"private": true, "private": true,
"dependencies": { "dependencies": {
"@prisma/client": "^5.19.1",
"@sapphire/decorators": "^6.1.0", "@sapphire/decorators": "^6.1.0",
"@sapphire/discord.js-utilities": "^7.3.0", "@sapphire/discord.js-utilities": "^7.3.0",
"@sapphire/framework": "^5.2.1", "@sapphire/framework": "^5.2.1",
@ -24,12 +25,14 @@
"@types/semver": "^7.5.8", "@types/semver": "^7.5.8",
"@typescript-eslint/eslint-plugin": "^8.6.0", "@typescript-eslint/eslint-plugin": "^8.6.0",
"@typescript-eslint/parser": "^8.6.0", "@typescript-eslint/parser": "^8.6.0",
"@yarnpkg/pnpify": "^4.1.2",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"eslint": "^9.11.0", "eslint": "^9.11.0",
"eslint-config-prettier": "^9.1.0", "eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1", "eslint-plugin-prettier": "^5.2.1",
"globals": "^15.9.0", "globals": "^15.9.0",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"prisma": "^5.19.1",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"tsup": "^8.3.0", "tsup": "^8.3.0",
"typescript": "^5.6.2" "typescript": "^5.6.2"
@ -43,5 +46,5 @@
"@types/ws": "^8.5.11", "@types/ws": "^8.5.11",
"ws": "8.18.0" "ws": "8.18.0"
}, },
"packageManager": "yarn@4.3.1" "packageManager": "yarn@4.5.0"
} }

1
prisma/default.d.ts vendored Normal file
View file

@ -0,0 +1 @@
export * from "./index"

1
prisma/default.js Normal file
View file

@ -0,0 +1 @@
module.exports = { ...require('.') }

1
prisma/edge.d.ts vendored Normal file
View file

@ -0,0 +1 @@
export * from "./default"

202
prisma/edge.js Normal file
View file

@ -0,0 +1,202 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
PrismaClientKnownRequestError,
PrismaClientUnknownRequestError,
PrismaClientRustPanicError,
PrismaClientInitializationError,
PrismaClientValidationError,
NotFoundError,
getPrismaClient,
sqltag,
empty,
join,
raw,
Decimal,
Debug,
objectEnumValues,
makeStrictEnum,
Extensions,
warnOnce,
defineDmmfProperty,
Public,
getRuntime
} = require('./runtime/edge.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.19.1
* Query Engine version: 69d742ee20b815d88e17e54db4a2a7a3b30324e3
*/
Prisma.prismaVersion = {
client: "5.19.1",
engine: "69d742ee20b815d88e17e54db4a2a7a3b30324e3"
}
Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
Prisma.PrismaClientInitializationError = PrismaClientInitializationError
Prisma.PrismaClientValidationError = PrismaClientValidationError
Prisma.NotFoundError = NotFoundError
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = sqltag
Prisma.empty = empty
Prisma.join = join
Prisma.raw = raw
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = Extensions.getExtensionContext
Prisma.defineExtension = Extensions.defineExtension
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.LearnScalarFieldEnum = {
id: 'id',
command: 'command',
result: 'result',
user_id: 'user_id',
created_at: 'created_at'
};
exports.Prisma.Nsfw_contentScalarFieldEnum = {
id: 'id',
text: 'text',
created_at: 'created_at',
persona: 'persona'
};
exports.Prisma.StatementScalarFieldEnum = {
id: 'id',
text: 'text',
search_text: 'search_text',
conversation: 'conversation',
created_at: 'created_at',
in_response_to: 'in_response_to',
search_in_response_to: 'search_in_response_to',
persona: 'persona'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.ModelName = {
learn: 'learn',
nsfw_content: 'nsfw_content',
statement: 'statement'
};
/**
* Create the Client
*/
const config = {
"generator": {
"name": "client",
"provider": {
"fromEnvVar": null,
"value": "prisma-client-js"
},
"output": {
"value": "C:\\Users\\migan\\projects\\Muffin-NOT-Ai\\prisma",
"fromEnvVar": null
},
"config": {
"engineType": "library"
},
"binaryTargets": [
{
"fromEnvVar": null,
"value": "windows",
"native": true
}
],
"previewFeatures": [],
"sourceFilePath": "C:\\Users\\migan\\projects\\Muffin-NOT-Ai\\prisma\\schema.prisma",
"isCustomOutput": true
},
"relativeEnvPaths": {
"rootEnvPath": null,
"schemaEnvPath": "../.env"
},
"relativePath": "",
"clientVersion": "5.19.1",
"engineVersion": "69d742ee20b815d88e17e54db4a2a7a3b30324e3",
"datasourceNames": [
"db"
],
"activeProvider": "mysql",
"inlineDatasources": {
"db": {
"url": {
"fromEnvVar": "DATABASE_URL",
"value": null
}
}
},
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel learn {\n id Int @id @default(autoincrement())\n command String @db.VarChar(255)\n result String @db.VarChar(255)\n user_id String @db.VarChar(255)\n created_at DateTime @default(now()) @db.DateTime(0)\n}\n\nmodel nsfw_content {\n id Int @id @default(autoincrement())\n text String @default(\"\") @db.VarChar(255)\n created_at DateTime? @default(now()) @db.DateTime(0)\n persona String @default(\"\") @db.VarChar(50)\n}\n\nmodel statement {\n id Int @id @default(autoincrement())\n text String @db.VarChar(255)\n search_text String @default(\"\") @db.VarChar(255)\n conversation String @default(\"\") @db.VarChar(32)\n created_at DateTime? @default(now()) @db.DateTime(0)\n in_response_to String? @db.VarChar(255)\n search_in_response_to String @default(\"\") @db.VarChar(255)\n persona String @default(\"\") @db.VarChar(50)\n}\n",
"inlineSchemaHash": "9c4fd3a80b1a8ccfab7d3088752694bb8d9d16041b08a9297ffc2268d5dd1468",
"copyEngine": true
}
config.dirname = '/'
config.runtimeDataModel = JSON.parse("{\"models\":{\"learn\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"command\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"result\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"created_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"nsfw_content\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"text\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"created_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"persona\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"statement\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"text\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"search_text\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"conversation\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"created_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"in_response_to\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"search_in_response_to\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"persona\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}")
defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
config.engineWasm = undefined
config.injectableEdgeEnv = () => ({
parsed: {
DATABASE_URL: typeof globalThis !== 'undefined' && globalThis['DATABASE_URL'] || typeof process !== 'undefined' && process.env && process.env.DATABASE_URL || undefined
}
})
if (typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined) {
Debug.enable(typeof globalThis !== 'undefined' && globalThis['DEBUG'] || typeof process !== 'undefined' && process.env && process.env.DEBUG || undefined)
}
const PrismaClient = getPrismaClient(config)
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

194
prisma/index-browser.js Normal file
View file

@ -0,0 +1,194 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime
} = require('./runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.19.1
* Query Engine version: 69d742ee20b815d88e17e54db4a2a7a3b30324e3
*/
Prisma.prismaVersion = {
client: "5.19.1",
engine: "69d742ee20b815d88e17e54db4a2a7a3b30324e3"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.NotFoundError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.LearnScalarFieldEnum = {
id: 'id',
command: 'command',
result: 'result',
user_id: 'user_id',
created_at: 'created_at'
};
exports.Prisma.Nsfw_contentScalarFieldEnum = {
id: 'id',
text: 'text',
created_at: 'created_at',
persona: 'persona'
};
exports.Prisma.StatementScalarFieldEnum = {
id: 'id',
text: 'text',
search_text: 'search_text',
conversation: 'conversation',
created_at: 'created_at',
in_response_to: 'in_response_to',
search_in_response_to: 'search_in_response_to',
persona: 'persona'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.ModelName = {
learn: 'learn',
nsfw_content: 'nsfw_content',
statement: 'statement'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

4531
prisma/index.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

223
prisma/index.js Normal file
View file

@ -0,0 +1,223 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
PrismaClientKnownRequestError,
PrismaClientUnknownRequestError,
PrismaClientRustPanicError,
PrismaClientInitializationError,
PrismaClientValidationError,
NotFoundError,
getPrismaClient,
sqltag,
empty,
join,
raw,
Decimal,
Debug,
objectEnumValues,
makeStrictEnum,
Extensions,
warnOnce,
defineDmmfProperty,
Public,
getRuntime
} = require('./runtime/library.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.19.1
* Query Engine version: 69d742ee20b815d88e17e54db4a2a7a3b30324e3
*/
Prisma.prismaVersion = {
client: "5.19.1",
engine: "69d742ee20b815d88e17e54db4a2a7a3b30324e3"
}
Prisma.PrismaClientKnownRequestError = PrismaClientKnownRequestError;
Prisma.PrismaClientUnknownRequestError = PrismaClientUnknownRequestError
Prisma.PrismaClientRustPanicError = PrismaClientRustPanicError
Prisma.PrismaClientInitializationError = PrismaClientInitializationError
Prisma.PrismaClientValidationError = PrismaClientValidationError
Prisma.NotFoundError = NotFoundError
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = sqltag
Prisma.empty = empty
Prisma.join = join
Prisma.raw = raw
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = Extensions.getExtensionContext
Prisma.defineExtension = Extensions.defineExtension
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
const path = require('path')
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.LearnScalarFieldEnum = {
id: 'id',
command: 'command',
result: 'result',
user_id: 'user_id',
created_at: 'created_at'
};
exports.Prisma.Nsfw_contentScalarFieldEnum = {
id: 'id',
text: 'text',
created_at: 'created_at',
persona: 'persona'
};
exports.Prisma.StatementScalarFieldEnum = {
id: 'id',
text: 'text',
search_text: 'search_text',
conversation: 'conversation',
created_at: 'created_at',
in_response_to: 'in_response_to',
search_in_response_to: 'search_in_response_to',
persona: 'persona'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.ModelName = {
learn: 'learn',
nsfw_content: 'nsfw_content',
statement: 'statement'
};
/**
* Create the Client
*/
const config = {
"generator": {
"name": "client",
"provider": {
"fromEnvVar": null,
"value": "prisma-client-js"
},
"output": {
"value": "C:\\Users\\migan\\projects\\Muffin-NOT-Ai\\prisma",
"fromEnvVar": null
},
"config": {
"engineType": "library"
},
"binaryTargets": [
{
"fromEnvVar": null,
"value": "windows",
"native": true
}
],
"previewFeatures": [],
"sourceFilePath": "C:\\Users\\migan\\projects\\Muffin-NOT-Ai\\prisma\\schema.prisma",
"isCustomOutput": true
},
"relativeEnvPaths": {
"rootEnvPath": null,
"schemaEnvPath": "../.env"
},
"relativePath": "",
"clientVersion": "5.19.1",
"engineVersion": "69d742ee20b815d88e17e54db4a2a7a3b30324e3",
"datasourceNames": [
"db"
],
"activeProvider": "mysql",
"inlineDatasources": {
"db": {
"url": {
"fromEnvVar": "DATABASE_URL",
"value": null
}
}
},
"inlineSchema": "generator client {\n provider = \"prisma-client-js\"\n output = \"./\"\n}\n\ndatasource db {\n provider = \"mysql\"\n url = env(\"DATABASE_URL\")\n}\n\nmodel learn {\n id Int @id @default(autoincrement())\n command String @db.VarChar(255)\n result String @db.VarChar(255)\n user_id String @db.VarChar(255)\n created_at DateTime @default(now()) @db.DateTime(0)\n}\n\nmodel nsfw_content {\n id Int @id @default(autoincrement())\n text String @default(\"\") @db.VarChar(255)\n created_at DateTime? @default(now()) @db.DateTime(0)\n persona String @default(\"\") @db.VarChar(50)\n}\n\nmodel statement {\n id Int @id @default(autoincrement())\n text String @db.VarChar(255)\n search_text String @default(\"\") @db.VarChar(255)\n conversation String @default(\"\") @db.VarChar(32)\n created_at DateTime? @default(now()) @db.DateTime(0)\n in_response_to String? @db.VarChar(255)\n search_in_response_to String @default(\"\") @db.VarChar(255)\n persona String @default(\"\") @db.VarChar(50)\n}\n",
"inlineSchemaHash": "9c4fd3a80b1a8ccfab7d3088752694bb8d9d16041b08a9297ffc2268d5dd1468",
"copyEngine": true
}
const fs = require('fs')
config.dirname = __dirname
if (!fs.existsSync(path.join(__dirname, 'schema.prisma'))) {
const alternativePaths = [
"prisma",
"",
]
const alternativePath = alternativePaths.find((altPath) => {
return fs.existsSync(path.join(process.cwd(), altPath, 'schema.prisma'))
}) ?? alternativePaths[0]
config.dirname = path.join(process.cwd(), alternativePath)
config.isBundled = true
}
config.runtimeDataModel = JSON.parse("{\"models\":{\"learn\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"command\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"result\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"user_id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"created_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"nsfw_content\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"text\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"created_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"persona\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false},\"statement\":{\"dbName\":null,\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":true,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"Int\",\"default\":{\"name\":\"autoincrement\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"text\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"search_text\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"conversation\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"created_at\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"DateTime\",\"default\":{\"name\":\"now\",\"args\":[]},\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"in_response_to\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":false,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":false,\"type\":\"String\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"search_in_response_to\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false},{\"name\":\"persona\",\"kind\":\"scalar\",\"isList\":false,\"isRequired\":true,\"isUnique\":false,\"isId\":false,\"isReadOnly\":false,\"hasDefaultValue\":true,\"type\":\"String\",\"default\":\"\",\"isGenerated\":false,\"isUpdatedAt\":false}],\"primaryKey\":null,\"uniqueFields\":[],\"uniqueIndexes\":[],\"isGenerated\":false}},\"enums\":{},\"types\":{}}")
defineDmmfProperty(exports.Prisma, config.runtimeDataModel)
config.engineWasm = undefined
const { warnEnvConflicts } = require('./runtime/library.js')
warnEnvConflicts({
rootEnvPath: config.relativeEnvPaths.rootEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.rootEnvPath),
schemaEnvPath: config.relativeEnvPaths.schemaEnvPath && path.resolve(config.dirname, config.relativeEnvPaths.schemaEnvPath)
})
const PrismaClient = getPrismaClient(config)
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)
// file annotations for bundling tools to include these files
path.join(__dirname, "query_engine-windows.dll.node");
path.join(process.cwd(), "prisma/query_engine-windows.dll.node")
// file annotations for bundling tools to include these files
path.join(__dirname, "schema.prisma");
path.join(process.cwd(), "prisma/schema.prisma")

97
prisma/package.json Normal file
View file

@ -0,0 +1,97 @@
{
"name": "prisma-client-5902b136c7a189de6f0ec62ae01cda891eb55abfeb7f60fc08b3eec5b4dbbd1b",
"main": "index.js",
"types": "index.d.ts",
"browser": "index-browser.js",
"exports": {
"./package.json": "./package.json",
".": {
"require": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"import": {
"node": "./index.js",
"edge-light": "./wasm.js",
"workerd": "./wasm.js",
"worker": "./wasm.js",
"browser": "./index-browser.js",
"default": "./index.js"
},
"default": "./index.js"
},
"./edge": {
"types": "./edge.d.ts",
"require": "./edge.js",
"import": "./edge.js",
"default": "./edge.js"
},
"./react-native": {
"types": "./react-native.d.ts",
"require": "./react-native.js",
"import": "./react-native.js",
"default": "./react-native.js"
},
"./extension": {
"types": "./extension.d.ts",
"require": "./extension.js",
"import": "./extension.js",
"default": "./extension.js"
},
"./index-browser": {
"types": "./index.d.ts",
"require": "./index-browser.js",
"import": "./index-browser.js",
"default": "./index-browser.js"
},
"./index": {
"types": "./index.d.ts",
"require": "./index.js",
"import": "./index.js",
"default": "./index.js"
},
"./wasm": {
"types": "./wasm.d.ts",
"require": "./wasm.js",
"import": "./wasm.js",
"default": "./wasm.js"
},
"./runtime/library": {
"types": "./runtime/library.d.ts",
"require": "./runtime/library.js",
"import": "./runtime/library.js",
"default": "./runtime/library.js"
},
"./runtime/binary": {
"types": "./runtime/binary.d.ts",
"require": "./runtime/binary.js",
"import": "./runtime/binary.js",
"default": "./runtime/binary.js"
},
"./generator-build": {
"require": "./generator-build/index.js",
"import": "./generator-build/index.js",
"default": "./generator-build/index.js"
},
"./sql": {
"require": {
"types": "./sql.d.ts",
"node": "./sql.js",
"default": "./sql.js"
},
"import": {
"types": "./sql.d.ts",
"node": "./sql.mjs",
"default": "./sql.mjs"
},
"default": "./sql.js"
},
"./*": "./*"
},
"version": "5.19.1",
"sideEffects": false
}

Binary file not shown.

File diff suppressed because one or more lines are too long

31
prisma/runtime/edge.js Normal file

File diff suppressed because one or more lines are too long

365
prisma/runtime/index-browser.d.ts vendored Normal file
View file

@ -0,0 +1,365 @@
declare class AnyNull extends NullTypesEnumValue {
}
declare type Args<T, F extends Operation> = T extends {
[K: symbol]: {
types: {
operations: {
[K in F]: {
args: any;
};
};
};
};
} ? T[symbol]['types']['operations'][F]['args'] : any;
declare class DbNull extends NullTypesEnumValue {
}
export declare namespace Decimal {
export type Constructor = typeof Decimal;
export type Instance = Decimal;
export type Rounding = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8;
export type Modulo = Rounding | 9;
export type Value = string | number | Decimal;
// http://mikemcl.github.io/decimal.js/#constructor-properties
export interface Config {
precision?: number;
rounding?: Rounding;
toExpNeg?: number;
toExpPos?: number;
minE?: number;
maxE?: number;
crypto?: boolean;
modulo?: Modulo;
defaults?: boolean;
}
}
export declare class Decimal {
readonly d: number[];
readonly e: number;
readonly s: number;
constructor(n: Decimal.Value);
absoluteValue(): Decimal;
abs(): Decimal;
ceil(): Decimal;
clampedTo(min: Decimal.Value, max: Decimal.Value): Decimal;
clamp(min: Decimal.Value, max: Decimal.Value): Decimal;
comparedTo(n: Decimal.Value): number;
cmp(n: Decimal.Value): number;
cosine(): Decimal;
cos(): Decimal;
cubeRoot(): Decimal;
cbrt(): Decimal;
decimalPlaces(): number;
dp(): number;
dividedBy(n: Decimal.Value): Decimal;
div(n: Decimal.Value): Decimal;
dividedToIntegerBy(n: Decimal.Value): Decimal;
divToInt(n: Decimal.Value): Decimal;
equals(n: Decimal.Value): boolean;
eq(n: Decimal.Value): boolean;
floor(): Decimal;
greaterThan(n: Decimal.Value): boolean;
gt(n: Decimal.Value): boolean;
greaterThanOrEqualTo(n: Decimal.Value): boolean;
gte(n: Decimal.Value): boolean;
hyperbolicCosine(): Decimal;
cosh(): Decimal;
hyperbolicSine(): Decimal;
sinh(): Decimal;
hyperbolicTangent(): Decimal;
tanh(): Decimal;
inverseCosine(): Decimal;
acos(): Decimal;
inverseHyperbolicCosine(): Decimal;
acosh(): Decimal;
inverseHyperbolicSine(): Decimal;
asinh(): Decimal;
inverseHyperbolicTangent(): Decimal;
atanh(): Decimal;
inverseSine(): Decimal;
asin(): Decimal;
inverseTangent(): Decimal;
atan(): Decimal;
isFinite(): boolean;
isInteger(): boolean;
isInt(): boolean;
isNaN(): boolean;
isNegative(): boolean;
isNeg(): boolean;
isPositive(): boolean;
isPos(): boolean;
isZero(): boolean;
lessThan(n: Decimal.Value): boolean;
lt(n: Decimal.Value): boolean;
lessThanOrEqualTo(n: Decimal.Value): boolean;
lte(n: Decimal.Value): boolean;
logarithm(n?: Decimal.Value): Decimal;
log(n?: Decimal.Value): Decimal;
minus(n: Decimal.Value): Decimal;
sub(n: Decimal.Value): Decimal;
modulo(n: Decimal.Value): Decimal;
mod(n: Decimal.Value): Decimal;
naturalExponential(): Decimal;
exp(): Decimal;
naturalLogarithm(): Decimal;
ln(): Decimal;
negated(): Decimal;
neg(): Decimal;
plus(n: Decimal.Value): Decimal;
add(n: Decimal.Value): Decimal;
precision(includeZeros?: boolean): number;
sd(includeZeros?: boolean): number;
round(): Decimal;
sine() : Decimal;
sin() : Decimal;
squareRoot(): Decimal;
sqrt(): Decimal;
tangent() : Decimal;
tan() : Decimal;
times(n: Decimal.Value): Decimal;
mul(n: Decimal.Value) : Decimal;
toBinary(significantDigits?: number): string;
toBinary(significantDigits: number, rounding: Decimal.Rounding): string;
toDecimalPlaces(decimalPlaces?: number): Decimal;
toDecimalPlaces(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
toDP(decimalPlaces?: number): Decimal;
toDP(decimalPlaces: number, rounding: Decimal.Rounding): Decimal;
toExponential(decimalPlaces?: number): string;
toExponential(decimalPlaces: number, rounding: Decimal.Rounding): string;
toFixed(decimalPlaces?: number): string;
toFixed(decimalPlaces: number, rounding: Decimal.Rounding): string;
toFraction(max_denominator?: Decimal.Value): Decimal[];
toHexadecimal(significantDigits?: number): string;
toHexadecimal(significantDigits: number, rounding: Decimal.Rounding): string;
toHex(significantDigits?: number): string;
toHex(significantDigits: number, rounding?: Decimal.Rounding): string;
toJSON(): string;
toNearest(n: Decimal.Value, rounding?: Decimal.Rounding): Decimal;
toNumber(): number;
toOctal(significantDigits?: number): string;
toOctal(significantDigits: number, rounding: Decimal.Rounding): string;
toPower(n: Decimal.Value): Decimal;
pow(n: Decimal.Value): Decimal;
toPrecision(significantDigits?: number): string;
toPrecision(significantDigits: number, rounding: Decimal.Rounding): string;
toSignificantDigits(significantDigits?: number): Decimal;
toSignificantDigits(significantDigits: number, rounding: Decimal.Rounding): Decimal;
toSD(significantDigits?: number): Decimal;
toSD(significantDigits: number, rounding: Decimal.Rounding): Decimal;
toString(): string;
truncated(): Decimal;
trunc(): Decimal;
valueOf(): string;
static abs(n: Decimal.Value): Decimal;
static acos(n: Decimal.Value): Decimal;
static acosh(n: Decimal.Value): Decimal;
static add(x: Decimal.Value, y: Decimal.Value): Decimal;
static asin(n: Decimal.Value): Decimal;
static asinh(n: Decimal.Value): Decimal;
static atan(n: Decimal.Value): Decimal;
static atanh(n: Decimal.Value): Decimal;
static atan2(y: Decimal.Value, x: Decimal.Value): Decimal;
static cbrt(n: Decimal.Value): Decimal;
static ceil(n: Decimal.Value): Decimal;
static clamp(n: Decimal.Value, min: Decimal.Value, max: Decimal.Value): Decimal;
static clone(object?: Decimal.Config): Decimal.Constructor;
static config(object: Decimal.Config): Decimal.Constructor;
static cos(n: Decimal.Value): Decimal;
static cosh(n: Decimal.Value): Decimal;
static div(x: Decimal.Value, y: Decimal.Value): Decimal;
static exp(n: Decimal.Value): Decimal;
static floor(n: Decimal.Value): Decimal;
static hypot(...n: Decimal.Value[]): Decimal;
static isDecimal(object: any): object is Decimal;
static ln(n: Decimal.Value): Decimal;
static log(n: Decimal.Value, base?: Decimal.Value): Decimal;
static log2(n: Decimal.Value): Decimal;
static log10(n: Decimal.Value): Decimal;
static max(...n: Decimal.Value[]): Decimal;
static min(...n: Decimal.Value[]): Decimal;
static mod(x: Decimal.Value, y: Decimal.Value): Decimal;
static mul(x: Decimal.Value, y: Decimal.Value): Decimal;
static noConflict(): Decimal.Constructor; // Browser only
static pow(base: Decimal.Value, exponent: Decimal.Value): Decimal;
static random(significantDigits?: number): Decimal;
static round(n: Decimal.Value): Decimal;
static set(object: Decimal.Config): Decimal.Constructor;
static sign(n: Decimal.Value): number;
static sin(n: Decimal.Value): Decimal;
static sinh(n: Decimal.Value): Decimal;
static sqrt(n: Decimal.Value): Decimal;
static sub(x: Decimal.Value, y: Decimal.Value): Decimal;
static sum(...n: Decimal.Value[]): Decimal;
static tan(n: Decimal.Value): Decimal;
static tanh(n: Decimal.Value): Decimal;
static trunc(n: Decimal.Value): Decimal;
static readonly default?: Decimal.Constructor;
static readonly Decimal?: Decimal.Constructor;
static readonly precision: number;
static readonly rounding: Decimal.Rounding;
static readonly toExpNeg: number;
static readonly toExpPos: number;
static readonly minE: number;
static readonly maxE: number;
static readonly crypto: boolean;
static readonly modulo: Decimal.Modulo;
static readonly ROUND_UP: 0;
static readonly ROUND_DOWN: 1;
static readonly ROUND_CEIL: 2;
static readonly ROUND_FLOOR: 3;
static readonly ROUND_HALF_UP: 4;
static readonly ROUND_HALF_DOWN: 5;
static readonly ROUND_HALF_EVEN: 6;
static readonly ROUND_HALF_CEIL: 7;
static readonly ROUND_HALF_FLOOR: 8;
static readonly EUCLID: 9;
}
declare type Exact<A, W> = (A extends unknown ? (W extends A ? {
[K in keyof A]: Exact<A[K], W[K]>;
} : W) : never) | (A extends Narrowable ? A : never);
export declare function getRuntime(): GetRuntimeOutput;
declare type GetRuntimeOutput = {
id: Runtime;
prettyName: string;
isEdge: boolean;
};
declare class JsonNull extends NullTypesEnumValue {
}
/**
* Generates more strict variant of an enum which, unlike regular enum,
* throws on non-existing property access. This can be useful in following situations:
* - we have an API, that accepts both `undefined` and `SomeEnumType` as an input
* - enum values are generated dynamically from DMMF.
*
* In that case, if using normal enums and no compile-time typechecking, using non-existing property
* will result in `undefined` value being used, which will be accepted. Using strict enum
* in this case will help to have a runtime exception, telling you that you are probably doing something wrong.
*
* Note: if you need to check for existence of a value in the enum you can still use either
* `in` operator or `hasOwnProperty` function.
*
* @param definition
* @returns
*/
export declare function makeStrictEnum<T extends Record<PropertyKey, string | number>>(definition: T): T;
declare type Narrowable = string | number | bigint | boolean | [];
declare class NullTypesEnumValue extends ObjectEnumValue {
_getNamespace(): string;
}
/**
* Base class for unique values of object-valued enums.
*/
declare abstract class ObjectEnumValue {
constructor(arg?: symbol);
abstract _getNamespace(): string;
_getName(): string;
toString(): string;
}
export declare const objectEnumValues: {
classes: {
DbNull: typeof DbNull;
JsonNull: typeof JsonNull;
AnyNull: typeof AnyNull;
};
instances: {
DbNull: DbNull;
JsonNull: JsonNull;
AnyNull: AnyNull;
};
};
declare type Operation = 'findFirst' | 'findFirstOrThrow' | 'findUnique' | 'findUniqueOrThrow' | 'findMany' | 'create' | 'createMany' | 'createManyAndReturn' | 'update' | 'updateMany' | 'upsert' | 'delete' | 'deleteMany' | 'aggregate' | 'count' | 'groupBy' | '$queryRaw' | '$executeRaw' | '$queryRawUnsafe' | '$executeRawUnsafe' | 'findRaw' | 'aggregateRaw' | '$runCommandRaw';
declare namespace Public {
export {
validator
}
}
export { Public }
declare type Runtime = "edge-routine" | "workerd" | "deno" | "lagon" | "react-native" | "netlify" | "electron" | "node" | "bun" | "edge-light" | "fastly" | "unknown";
declare function validator<V>(): <S>(select: Exact<S, V>) => S;
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation>(client: C, model: M, operation: O): <S>(select: Exact<S, Args<C[M], O>>) => S;
declare function validator<C, M extends Exclude<keyof C, `$${string}`>, O extends keyof C[M] & Operation, P extends keyof Args<C[M], O>>(client: C, model: M, operation: O, prop: P): <S>(select: Exact<S, Args<C[M], O>[P]>) => S;
export { }

File diff suppressed because one or more lines are too long

3353
prisma/runtime/library.d.ts vendored Normal file

File diff suppressed because it is too large Load diff

143
prisma/runtime/library.js Normal file

File diff suppressed because one or more lines are too long

80
prisma/runtime/react-native.js vendored Normal file

File diff suppressed because one or more lines are too long

32
prisma/runtime/wasm.js Normal file

File diff suppressed because one or more lines are too long

35
prisma/schema.prisma Normal file
View file

@ -0,0 +1,35 @@
generator client {
provider = "prisma-client-js"
output = "./"
}
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
}
model learn {
id Int @id @default(autoincrement())
command String @db.VarChar(255)
result String @db.VarChar(255)
user_id String @db.VarChar(255)
created_at DateTime @default(now()) @db.DateTime(0)
}
model nsfw_content {
id Int @id @default(autoincrement())
text String @default("") @db.VarChar(255)
created_at DateTime? @default(now()) @db.DateTime(0)
persona String @default("") @db.VarChar(50)
}
model statement {
id Int @id @default(autoincrement())
text String @db.VarChar(255)
search_text String @default("") @db.VarChar(255)
conversation String @default("") @db.VarChar(32)
created_at DateTime? @default(now()) @db.DateTime(0)
in_response_to String? @db.VarChar(255)
search_in_response_to String @default("") @db.VarChar(255)
persona String @default("") @db.VarChar(50)
}

1
prisma/wasm.d.ts vendored Normal file
View file

@ -0,0 +1 @@
export * from "./index"

194
prisma/wasm.js Normal file
View file

@ -0,0 +1,194 @@
Object.defineProperty(exports, "__esModule", { value: true });
const {
Decimal,
objectEnumValues,
makeStrictEnum,
Public,
getRuntime
} = require('./runtime/index-browser.js')
const Prisma = {}
exports.Prisma = Prisma
exports.$Enums = {}
/**
* Prisma Client JS version: 5.19.1
* Query Engine version: 69d742ee20b815d88e17e54db4a2a7a3b30324e3
*/
Prisma.prismaVersion = {
client: "5.19.1",
engine: "69d742ee20b815d88e17e54db4a2a7a3b30324e3"
}
Prisma.PrismaClientKnownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)};
Prisma.PrismaClientUnknownRequestError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientRustPanicError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientInitializationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.PrismaClientValidationError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.NotFoundError = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.Decimal = Decimal
/**
* Re-export of sql-template-tag
*/
Prisma.sql = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.empty = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.join = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.raw = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.validator = Public.validator
/**
* Extensions
*/
Prisma.getExtensionContext = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
Prisma.defineExtension = () => {
const runtimeName = getRuntime().prettyName;
throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
)}
/**
* Shorthand utilities for JSON filtering
*/
Prisma.DbNull = objectEnumValues.instances.DbNull
Prisma.JsonNull = objectEnumValues.instances.JsonNull
Prisma.AnyNull = objectEnumValues.instances.AnyNull
Prisma.NullTypes = {
DbNull: objectEnumValues.classes.DbNull,
JsonNull: objectEnumValues.classes.JsonNull,
AnyNull: objectEnumValues.classes.AnyNull
}
/**
* Enums
*/
exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
ReadUncommitted: 'ReadUncommitted',
ReadCommitted: 'ReadCommitted',
RepeatableRead: 'RepeatableRead',
Serializable: 'Serializable'
});
exports.Prisma.LearnScalarFieldEnum = {
id: 'id',
command: 'command',
result: 'result',
user_id: 'user_id',
created_at: 'created_at'
};
exports.Prisma.Nsfw_contentScalarFieldEnum = {
id: 'id',
text: 'text',
created_at: 'created_at',
persona: 'persona'
};
exports.Prisma.StatementScalarFieldEnum = {
id: 'id',
text: 'text',
search_text: 'search_text',
conversation: 'conversation',
created_at: 'created_at',
in_response_to: 'in_response_to',
search_in_response_to: 'search_in_response_to',
persona: 'persona'
};
exports.Prisma.SortOrder = {
asc: 'asc',
desc: 'desc'
};
exports.Prisma.NullsOrder = {
first: 'first',
last: 'last'
};
exports.Prisma.ModelName = {
learn: 'learn',
nsfw_content: 'nsfw_content',
statement: 'statement'
};
/**
* This is a stub Prisma Client that will error at runtime if called.
*/
class PrismaClient {
constructor() {
return new Proxy(this, {
get(target, prop) {
let message
const runtime = getRuntime()
if (runtime.isEdge) {
message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
- Use Prisma Accelerate: https://pris.ly/d/accelerate
- Use Driver Adapters: https://pris.ly/d/driver-adapters
`;
} else {
message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
}
message += `
If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
throw new Error(message)
}
})
}
}
exports.PrismaClient = PrismaClient
Object.assign(exports, Prisma)

View file

@ -1,10 +1,12 @@
import { SapphireClient, container, LogLevel } from '@sapphire/framework' import { SapphireClient, container, LogLevel } from '@sapphire/framework'
import { GatewayIntentBits, Partials, type Snowflake } from 'discord.js' import { GatewayIntentBits, Partials, type Snowflake } from 'discord.js'
import { ChatBot, NODE_ENV, MaaDatabase } from './modules' import { ChatBot, NODE_ENV } from './modules'
import { version } from '../package.json' import { version } from '../package.json'
import { PrismaClient } from '../prisma'
import config from '../config.json' import config from '../config.json'
import semver from 'semver' import semver from 'semver'
// Load pieces
import './interaction-handlers/_load' import './interaction-handlers/_load'
import './listeners/_load' import './listeners/_load'
import './Commands/_load' import './Commands/_load'
@ -12,7 +14,7 @@ import './Commands/_load'
container.config = config container.config = config
container.prefix = config.bot.prefix container.prefix = config.bot.prefix
container.version = version container.version = version
container.database = new MaaDatabase() container.database = new PrismaClient()
container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트'] container.dokdoAliases = ['dokdo', 'dok', 'Dokdo', 'Dok', '테스트']
container.chatBot = new ChatBot(container.database) container.chatBot = new ChatBot(container.database)
@ -61,7 +63,7 @@ export default class MuffinBot extends SapphireClient {
declare module '@sapphire/framework' { declare module '@sapphire/framework' {
interface Container { interface Container {
database: MaaDatabase database: PrismaClient
chatBot: ChatBot chatBot: ChatBot
prefix: string prefix: string
version: string version: string

View file

@ -11,7 +11,6 @@ import {
codeBlock, codeBlock,
} from 'discord.js' } from 'discord.js'
import { ApplyOptions } from '@sapphire/decorators' import { ApplyOptions } from '@sapphire/decorators'
import { type LearnData } from '../modules'
@ApplyOptions<Command.Options>({ @ApplyOptions<Command.Options>({
name: '삭제', name: '삭제',
@ -26,24 +25,25 @@ class DeleteLearnCommand extends Command {
public async messageRun(msg: Message, args: Args) { public async messageRun(msg: Message, args: Args) {
const command = await args.rest('string').catch(() => null) const command = await args.rest('string').catch(() => null)
const options: SelectMenuComponentOptionData[] = [] const options: SelectMenuComponentOptionData[] = []
const db = this.container.database
const [datas] = await db.database.execute<LearnData[]>(
'SELECT * FROM learn WHERE command = ? AND user_id = ?;',
[command, msg.author.id],
)
if (!command) { if (!command) {
return await msg.channel.send( return await msg.reply(
`사용법: \n\`\`\`${(this.detailedDescription as DetailedDescriptionCommandObject).usage}\`\`\``, `사용법: \n\`\`\`${(this.detailedDescription as DetailedDescriptionCommandObject).usage}\`\`\``,
) )
} }
const datas = await this.container.database.learn.findMany({
where: {
command,
user_id: msg.author.id,
},
})
if (!datas) { if (!datas) {
return await msg.channel.send('해당하는 걸 찾ㅈ을 수 없어요.') return await msg.reply('해당하는 걸 찾ㅈ을 수 없어요.')
} }
datas.forEach(data => { datas.forEach(data => {
console.log(data)
options.push({ options.push({
label: `${data.id}`, label: `${data.id}`,
value: `maa$deleteLearn-${data.id}`, value: `maa$deleteLearn-${data.id}`,

View file

@ -52,7 +52,6 @@ class LearnCommand extends Command {
'간미', '간미',
] ]
const disallowed = ['@everyone', '@here', `<@${config.bot.owner_ID}>`] const disallowed = ['@everyone', '@here', `<@${config.bot.owner_ID}>`]
const db = this.container.database
for (const ig of ignore) { for (const ig of ignore) {
if (command.includes(ig)) { if (command.includes(ig)) {
@ -66,10 +65,12 @@ class LearnCommand extends Command {
} }
} }
await db.learn.insert({ await this.container.database.learn.create({
user_id: msg.author.id, data: {
command, user_id: msg.author.id,
result, command,
result,
},
}) })
await msg.reply(`${command}을/를 배웠ㅇ어요.`) await msg.reply(`${command}을/를 배웠ㅇ어요.`)
} }

View file

@ -1,6 +1,5 @@
import { ApplyOptions } from '@sapphire/decorators'
import { type ResponseData } from '../modules'
import { Command, container } from '@sapphire/framework' import { Command, container } from '@sapphire/framework'
import { ApplyOptions } from '@sapphire/decorators'
import { type Message } from 'discord.js' import { type Message } from 'discord.js'
@ApplyOptions<Command.Options>({ @ApplyOptions<Command.Options>({
@ -14,11 +13,15 @@ import { type Message } from 'discord.js'
class LearnDataCommand extends Command { class LearnDataCommand extends Command {
public async messageRun(msg: Message<true>) { public async messageRun(msg: Message<true>) {
const db = this.container.database const db = this.container.database
const data = await db.statement.all() const data = await db.statement.findMany()
const nsfwData = await db.nsfwContent.all() const nsfwData = await db.nsfw_content.findMany()
const learnData = await db.learn.all() const learnData = await db.learn.findMany()
const userData = await db.learn.findOneAnotherKey('user_id', msg.author.id) const userData = await db.learn.findMany({
const muffin: ResponseData[] = [] where: {
user_id: msg.author.id,
},
})
const muffin: any[] = []
data.forEach(row => { data.forEach(row => {
if (row.persona === 'muffin') muffin.push(row) if (row.persona === 'muffin') muffin.push(row)
else return else return

View file

@ -13,13 +13,15 @@ import { Command, container } from '@sapphire/framework'
class ListCommand extends Command { class ListCommand extends Command {
public async messageRun(msg: Message<boolean>) { public async messageRun(msg: Message<boolean>) {
const db = this.container.database const db = this.container.database
const data = await db.learn.findOneAnotherKey('user_id', msg.author.id) const data = await db.learn.findMany({
where: {
user_id: msg.author.id,
},
})
const list: string[] = [] const list: string[] = []
if (!data[0]) { if (!data[0]) {
return await msg.channel.send( return await msg.reply('당신ㄴ은 단어를 가르쳐준 기억이 없ㅅ는데요.')
'당신ㄴ은 단어를 가르쳐준 기억이 없ㅅ는데요.',
)
} }
for (const listData of data) { for (const listData of data) {

View file

@ -18,10 +18,14 @@ class DeleteLearnHandler extends InteractionHandler {
public async run(interaction: StringSelectMenuInteraction) { public async run(interaction: StringSelectMenuInteraction) {
await interaction.deferUpdate() await interaction.deferUpdate()
const id = interaction.values[0].slice('maa$deleteLearn-'.length) const id = Number(interaction.values[0].slice('maa$deleteLearn-'.length))
const db = this.container.database const db = this.container.database
await db.learn.delete(id) await db.learn.delete({
where: {
id,
},
})
await interaction.editReply({ await interaction.editReply({
embeds: [ embeds: [

View file

@ -4,7 +4,7 @@ import { noPerm } from '../modules'
import Dokdo from 'dokdo' import Dokdo from 'dokdo'
class MessageCreateListener extends Listener { class MessageCreateListener extends Listener {
public async run(msg: Message) { public async run(msg: Message<true>) {
const prefix = this.container.prefix const prefix = this.container.prefix
const dokdo = new Dokdo(this.container.client, { const dokdo = new Dokdo(this.container.client, {
aliases: ['dokdo', 'dok'], aliases: ['dokdo', 'dok'],
@ -14,7 +14,7 @@ class MessageCreateListener extends Listener {
}) })
if (msg.author.bot) return if (msg.author.bot) return
if (msg.content.startsWith(prefix)) { if (msg.content.startsWith(prefix)) {
if (this.container.release === 'PRE-RELEASE') { if (this.container.release === 'PREVIEW') {
await msg.reply({ await msg.reply({
embeds: [ embeds: [
{ {

View file

@ -1,19 +1,19 @@
import type { Client, Message, TextChannel } from 'discord.js' import type { Client, Message, TextChannel } from 'discord.js'
import type { PrismaClient } from '../../prisma'
import { container } from '@sapphire/framework' import { container } from '@sapphire/framework'
import type { MaaDatabase } from './database'
export default class ChatBot { export default class ChatBot {
public constructor(public db: MaaDatabase) { public constructor(public db: PrismaClient) {}
setInterval(async () => {
this.db.ping()
}, 60000)
}
public async getResponse(msg: Message): Promise<string> { public async getResponse(msg: Message): Promise<string> {
const prefix = container.prefix const prefix = container.prefix
const data = await this.db.statement.all() const data = await this.db.statement.findMany()
const args = msg.content.slice(prefix.length).trim().split(/ +/g).join(' ') const args = msg.content.slice(prefix.length).trim().split(/ +/g).join(' ')
const learn = await this.db.learn.findOne(args) const learn = await this.db.learn.findMany({
where: {
command: args,
},
})
const learnData = learn[Math.floor(Math.random() * learn.length)] const learnData = learn[Math.floor(Math.random() * learn.length)]
const randomNumber = Math.round(Math.random() * (2 - 1) + 1) const randomNumber = Math.round(Math.random() * (2 - 1) + 1)
@ -30,7 +30,7 @@ export default class ChatBot {
let response: string let response: string
if ((msg.channel as TextChannel).nsfw) { if ((msg.channel as TextChannel).nsfw) {
const NSFWData = await this.db.nsfwContent.all() const NSFWData = await this.db.nsfw_content.findMany()
const dataList = [...data, ...NSFWData] const dataList = [...data, ...NSFWData]
response = dataList[Math.floor(Math.random() * dataList.length)].text response = dataList[Math.floor(Math.random() * dataList.length)].text
} else { } else {
@ -50,19 +50,23 @@ export default class ChatBot {
if (msg.author.bot) return if (msg.author.bot) return
if (msg.author.id === container.config.train.user_ID) { if (msg.author.id === container.config.train.user_ID) {
const response = await this.getResponse(msg) const response = await this.getResponse(msg)
await this.db.statement.insert({ await this.db.statement.create({
text: msg.content, data: {
persona: 'muffin', text: msg.content,
in_response_to: response, persona: 'muffin',
in_response_to: response,
},
}) })
} else { } else {
if (!(msg.channel as TextChannel).nsfw) return if (!(msg.channel as TextChannel).nsfw) return
if (!msg.content.startsWith(prefix)) return if (!msg.content.startsWith(prefix)) return
const persona = `user:${msg.author.username.slice(0, 50).toLowerCase()}` const persona = `user:${msg.author.username.slice(0, 50).toLowerCase()}`
const text = msg.content.replace(prefix, '') const text = msg.content.replace(prefix, '')
await this.db.nsfwContent.insert({ await this.db.nsfw_content.create({
text, data: {
persona, text,
persona,
},
}) })
} }
}) })

661
yarn.lock

File diff suppressed because it is too large Load diff