create-prisma-php-app 2.0.0-alpha.9 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.htaccess +31 -4
- package/dist/index.js +40 -49
- package/dist/postcss.config.js +1 -0
- package/dist/src/Lib/AI/ChatGPTClient.php +1 -1
- package/dist/src/Lib/Auth/Auth.php +3 -3
- package/dist/src/Lib/Auth/AuthConfig.php +5 -3
- package/dist/src/Lib/Request.php +32 -36
- package/dist/src/Lib/StateManager.php +2 -2
- package/dist/src/Lib/Websocket/ConnectionManager.php +4 -2
- package/dist/src/app/css/tailwind.css +1 -1
- package/package.json +1 -1
- package/dist/prisma/schema.prisma +0 -37
- package/dist/prisma/seed.ts +0 -74
- package/dist/settings/prisma-schema.json +0 -103
- package/dist/settings/prisma-sdk.ts +0 -28
- package/dist/src/Lib/Prisma/Classes/PPHPUtility.php +0 -854
- package/dist/src/Lib/Prisma/Model/IModel.php +0 -24
package/dist/prisma/seed.ts
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
// import { PrismaClient } from "@prisma/client";
|
|
2
|
-
|
|
3
|
-
// const prisma = new PrismaClient();
|
|
4
|
-
|
|
5
|
-
// // UserRole
|
|
6
|
-
// const userRoleData = [
|
|
7
|
-
// {
|
|
8
|
-
// name: "Admin",
|
|
9
|
-
// },
|
|
10
|
-
// {
|
|
11
|
-
// name: "User",
|
|
12
|
-
// },
|
|
13
|
-
// ];
|
|
14
|
-
|
|
15
|
-
// // User
|
|
16
|
-
// const userData = [
|
|
17
|
-
// {
|
|
18
|
-
// name: "Juan",
|
|
19
|
-
// email: "j@gmail.com",
|
|
20
|
-
// password: "$2b$10$mgjotYzIXwrK1MCWmu4tgeUVnLcb.qzvqwxOq4FXEL8k2obwXivDi", // TODO: template password 1234 (bcrypt) testing only
|
|
21
|
-
// roleId: 1,
|
|
22
|
-
// },
|
|
23
|
-
// ];
|
|
24
|
-
|
|
25
|
-
// async function main() {
|
|
26
|
-
// ========================================
|
|
27
|
-
// Code for PostgreSQL
|
|
28
|
-
// ----------------------------------------
|
|
29
|
-
// UserRole
|
|
30
|
-
// ----------------------------------------
|
|
31
|
-
// await prisma.userRole.deleteMany();
|
|
32
|
-
// await prisma.userRole.createMany({ data: userRoleData });
|
|
33
|
-
// await prisma.$executeRaw`ALTER SEQUENCE "UserRole_id_seq" RESTART WITH 1`;
|
|
34
|
-
// ----------------------------------------
|
|
35
|
-
// User
|
|
36
|
-
// ----------------------------------------
|
|
37
|
-
// await prisma.user.deleteMany();
|
|
38
|
-
// await prisma.user.createMany({ data: userData });
|
|
39
|
-
// ========================================
|
|
40
|
-
// Code for MySQL
|
|
41
|
-
// ----------------------------------------
|
|
42
|
-
// UserRole
|
|
43
|
-
// ----------------------------------------
|
|
44
|
-
// await prisma.userRole.deleteMany();
|
|
45
|
-
// await prisma.userRole.createMany({ data: userRoleData });
|
|
46
|
-
// await prisma.$executeRaw`ALTER TABLE UserRole AUTO_INCREMENT = 1`;
|
|
47
|
-
// ----------------------------------------
|
|
48
|
-
// User
|
|
49
|
-
// ----------------------------------------
|
|
50
|
-
// await prisma.user.deleteMany();
|
|
51
|
-
// await prisma.user.createMany({ data: userData });
|
|
52
|
-
// ========================================
|
|
53
|
-
// Code for SQLite
|
|
54
|
-
// ========================================
|
|
55
|
-
// UserRole
|
|
56
|
-
// ----------------------------------------
|
|
57
|
-
// await prisma.userRole.deleteMany();
|
|
58
|
-
// await prisma.userRole.createMany({ data: userRoleData });
|
|
59
|
-
// SQLite automatically handles ID incrementation and does not require manual sequence reset
|
|
60
|
-
// ----------------------------------------
|
|
61
|
-
// User
|
|
62
|
-
// ----------------------------------------
|
|
63
|
-
// await prisma.user.deleteMany();
|
|
64
|
-
// await prisma.user.createMany({ data: userData });
|
|
65
|
-
// ========================================
|
|
66
|
-
// }
|
|
67
|
-
|
|
68
|
-
// main()
|
|
69
|
-
// .catch((e) => {
|
|
70
|
-
// throw e;
|
|
71
|
-
// })
|
|
72
|
-
// .finally(async () => {
|
|
73
|
-
// await prisma.$disconnect();
|
|
74
|
-
// });
|
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"datamodel": {
|
|
3
|
-
"enums": [],
|
|
4
|
-
"models": []
|
|
5
|
-
},
|
|
6
|
-
"schema": {
|
|
7
|
-
"inputObjectTypes": {},
|
|
8
|
-
"outputObjectTypes": {
|
|
9
|
-
"prisma": [
|
|
10
|
-
{
|
|
11
|
-
"name": "Query",
|
|
12
|
-
"fields": []
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
"name": "Mutation",
|
|
16
|
-
"fields": [
|
|
17
|
-
{
|
|
18
|
-
"name": "executeRaw",
|
|
19
|
-
"args": [
|
|
20
|
-
{
|
|
21
|
-
"name": "query",
|
|
22
|
-
"isRequired": true,
|
|
23
|
-
"isNullable": false,
|
|
24
|
-
"inputTypes": [
|
|
25
|
-
{
|
|
26
|
-
"type": "String",
|
|
27
|
-
"location": "scalar",
|
|
28
|
-
"isList": false
|
|
29
|
-
}
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"name": "parameters",
|
|
34
|
-
"isRequired": false,
|
|
35
|
-
"isNullable": false,
|
|
36
|
-
"inputTypes": [
|
|
37
|
-
{
|
|
38
|
-
"type": "Json",
|
|
39
|
-
"location": "scalar",
|
|
40
|
-
"isList": false
|
|
41
|
-
}
|
|
42
|
-
]
|
|
43
|
-
}
|
|
44
|
-
],
|
|
45
|
-
"isNullable": false,
|
|
46
|
-
"outputType": {
|
|
47
|
-
"type": "Json",
|
|
48
|
-
"location": "scalar",
|
|
49
|
-
"isList": false
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"name": "queryRaw",
|
|
54
|
-
"args": [
|
|
55
|
-
{
|
|
56
|
-
"name": "query",
|
|
57
|
-
"isRequired": true,
|
|
58
|
-
"isNullable": false,
|
|
59
|
-
"inputTypes": [
|
|
60
|
-
{
|
|
61
|
-
"type": "String",
|
|
62
|
-
"location": "scalar",
|
|
63
|
-
"isList": false
|
|
64
|
-
}
|
|
65
|
-
]
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"name": "parameters",
|
|
69
|
-
"isRequired": false,
|
|
70
|
-
"isNullable": false,
|
|
71
|
-
"inputTypes": [
|
|
72
|
-
{
|
|
73
|
-
"type": "Json",
|
|
74
|
-
"location": "scalar",
|
|
75
|
-
"isList": false
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
"isNullable": false,
|
|
81
|
-
"outputType": {
|
|
82
|
-
"type": "Json",
|
|
83
|
-
"location": "scalar",
|
|
84
|
-
"isList": false
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
]
|
|
88
|
-
}
|
|
89
|
-
]
|
|
90
|
-
},
|
|
91
|
-
"enumTypes": {}
|
|
92
|
-
},
|
|
93
|
-
"mappings": {
|
|
94
|
-
"modelOperations": [],
|
|
95
|
-
"otherOperations": {
|
|
96
|
-
"read": [],
|
|
97
|
-
"write": [
|
|
98
|
-
"executeRaw",
|
|
99
|
-
"queryRaw"
|
|
100
|
-
]
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { resolve } from "path";
|
|
2
|
-
import { readFileSync, writeFileSync } from "fs";
|
|
3
|
-
import psdk from "@prisma/internals";
|
|
4
|
-
import { getFileMeta } from "./utils.js";
|
|
5
|
-
|
|
6
|
-
const { __dirname } = getFileMeta();
|
|
7
|
-
const { getDMMF } = psdk;
|
|
8
|
-
const schemaPath: string = resolve(__dirname, "../prisma/schema.prisma");
|
|
9
|
-
const prismaSchemaJsonPath: string = resolve(__dirname, "prisma-schema.json");
|
|
10
|
-
|
|
11
|
-
export const prismaSdk = async (): Promise<void> => {
|
|
12
|
-
try {
|
|
13
|
-
const schema = readFileSync(schemaPath, "utf-8");
|
|
14
|
-
|
|
15
|
-
// Parse the schema into DMMF (Data Model Meta Format) and then convert to JSON
|
|
16
|
-
const dmmf = await getDMMF({ datamodel: schema });
|
|
17
|
-
|
|
18
|
-
// Write the DMMF schema to JSON
|
|
19
|
-
writeFileSync(prismaSchemaJsonPath, JSON.stringify(dmmf, null, 2));
|
|
20
|
-
console.log("Schema converted to JSON!");
|
|
21
|
-
} catch (error) {
|
|
22
|
-
console.error("Error parsing schema:", error);
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
if (process.argv[1] && process.argv[1].endsWith("prisma-sdk.ts")) {
|
|
27
|
-
prismaSdk();
|
|
28
|
-
}
|