arkos 1.1.38-test → 1.1.40-test
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/cjs/modules/file-uploader/file-uploader.router.js +3 -3
- package/dist/cjs/modules/file-uploader/file-uploader.router.js.map +1 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/es2020/modules/file-uploader/file-uploader.router.js +3 -3
- package/dist/es2020/modules/file-uploader/file-uploader.router.js.map +1 -1
- package/dist/es2020/types/index.js.map +1 -1
- package/dist/types/types/index.d.ts +1 -43
- package/package.json +1 -1
|
@@ -23,7 +23,7 @@ async function getFileUploaderRouter({ fileUpload }) {
|
|
|
23
23
|
basePathname = "/" + basePathname;
|
|
24
24
|
if (!basePathname.endsWith("/"))
|
|
25
25
|
basePathname = basePathname + "/";
|
|
26
|
-
router.use(basePathname, auth_service_1.default.handleAuthenticationControl("View", authConfigs), auth_service_1.default.handleAccessControl("View", "file-upload", authConfigs), express_2.default.static(path_1.default.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), (0, deepmerge_helper_1.default)({
|
|
26
|
+
router.use(basePathname, auth_service_1.default.handleAuthenticationControl("View", authConfigs.authenticationControl), auth_service_1.default.handleAccessControl("View", "file-upload", authConfigs.accessControl), express_2.default.static(path_1.default.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), (0, deepmerge_helper_1.default)({
|
|
27
27
|
maxAge: "1y",
|
|
28
28
|
etag: true,
|
|
29
29
|
lastModified: true,
|
|
@@ -32,8 +32,8 @@ async function getFileUploaderRouter({ fileUpload }) {
|
|
|
32
32
|
index: false,
|
|
33
33
|
cacheControl: true,
|
|
34
34
|
}, fileUpload?.expressStaticOptions || {})));
|
|
35
|
-
router.post(`${basePathname}:fileType`, auth_service_1.default.handleAuthenticationControl("Create", authConfigs), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs), file_uploader_controller_1.uploadFile);
|
|
36
|
-
router.delete(`${basePathname}:fileType/:fileName`, auth_service_1.default.handleAuthenticationControl("Delete", authConfigs), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs), file_uploader_controller_1.deleteFile);
|
|
35
|
+
router.post(`${basePathname}:fileType`, auth_service_1.default.handleAuthenticationControl("Create", authConfigs.authenticationControl), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs.accessControl), file_uploader_controller_1.uploadFile);
|
|
36
|
+
router.delete(`${basePathname}:fileType/:fileName`, auth_service_1.default.handleAuthenticationControl("Delete", authConfigs.authenticationControl), auth_service_1.default.handleAccessControl("Create", "file-upload", authConfigs.accessControl), file_uploader_controller_1.deleteFile);
|
|
37
37
|
return router;
|
|
38
38
|
}
|
|
39
39
|
//# sourceMappingURL=file-uploader.router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":";;;;;AAYA,sDAsEC;AAlFD,qCAAiC;AACjC,uEAA8E;AAC9E,wEAA+C;AAC/C,yEAAoE;AAEpE,gDAAwB;AACxB,sDAA8B;AAC9B,4FAA6D;AAG7D,MAAM,MAAM,GAAW,IAAA,gBAAM,GAAE,CAAC;AAEzB,KAAK,UAAU,qBAAqB,CAAC,EAAE,UAAU,EAAe;IACrE,MAAM,YAAY,GAAG,MAAM,IAAA,yCAAwB,EAAC,aAAa,CAAC,CAAC;IACnE,IAAI,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAiB,EAAE,GAAG,EAAE,CAAC;IAE/D,IAAI,YAAY,EAAE,CAAC;QACjB,CAAC,EAAE,WAAW,GAAG,EAAE,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,YAAY,GAAG,UAA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,CACX,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Router } from \"express\";\nimport { importPrismaModelModules } from \"../../utils/helpers/models.helpers\";\nimport authService from \"../auth/auth.service\";\nimport { deleteFile, uploadFile } from \"./file-uploader.controller\";\nimport { ArkosConfig } from \"../../types/arkos-config\";\nimport path from \"path\";\nimport express from \"express\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\nimport { AuthConfigs } from \"../../types/auth\";\n\nconst router: Router = Router();\n\nexport async function getFileUploaderRouter({ fileUpload }: ArkosConfig) {\n const modelModules = await importPrismaModelModules(\"file-upload\");\n let { middlewares = {}, authConfigs = {} as AuthConfigs } = {};\n\n if (modelModules) {\n ({ middlewares = {}, authConfigs = {} } = modelModules);\n }\n\n let basePathname = fileUpload?.baseRoute || \"/api/uploads/\";\n\n if (!basePathname.startsWith(\"/\")) basePathname = \"/\" + basePathname;\n if (!basePathname.endsWith(\"/\")) basePathname = basePathname + \"/\";\n\n router.use(\n basePathname,\n authService.handleAuthenticationControl(\n \"View\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"View\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n express.static(\n path.resolve(process.cwd(), fileUpload?.baseUploadDir || \"uploads\"),\n deepmerge(\n {\n maxAge: \"1y\",\n etag: true,\n lastModified: true,\n dotfiles: \"ignore\",\n fallthrough: true,\n index: false,\n cacheControl: true,\n },\n fileUpload?.expressStaticOptions || {}\n )\n )\n );\n\n router.post(\n `${basePathname}:fileType`,\n authService.handleAuthenticationControl(\n \"Create\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n uploadFile\n );\n\n router.delete(\n `${basePathname}:fileType/:fileName`,\n authService.handleAuthenticationControl(\n \"Delete\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n deleteFile\n );\n\n return router;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":";;;AAiEA,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,oCAApB,oBAAoB,QAK/B","sourcesContent":["import { NextFunction, Request, RequestHandler, Response } from \"express\";\n\nexport type PrismaOperations = \"findMany\";\n\nexport type PrismaQueryOptions<T extends Record<string, any>> = {\n queryOptions?: Partial<Parameters<T[\"findMany\"]>[0]>;\n findOne?: Partial<Parameters<T[\"findFirst\"]>[0]>;\n findMany?: Partial<Parameters<T[\"findMany\"]>[0]>;\n deleteMany?: Partial<Parameters<T[\"deleteMany\"]>[0]>;\n updateMany?: Partial<Parameters<T[\"updateMany\"]>[0]>;\n createMany?: Partial<Parameters<T[\"createMany\"]>[0]>;\n createOne?: Partial<Parameters<T[\"create\"]>[0]>;\n updateOne?: Partial<Parameters<T[\"update\"]>[0]>;\n deleteOne?: Partial<Parameters<T[\"delete\"]>[0]>;\n};\n\n/**\n * Interface defining the minimum structure required for Prisma model delegates\n * This allows us to constraint TModel without requiring Prisma imports\n */\nexport type PrismaModelDelegate = Record<\n string,\n (args: Record<string, never>) => any\n>;\n\ntype a = {\n create: (args: { data: never; [key: string]: never }) => Promise<any>;\n createMany: (args: { data: never; [key: string]: never }) => Promise<any>;\n findMany: (args: { [key: string]: never }) => Promise<any[]>;\n findFirst: (args: { where: never; [key: string]: never }) => Promise<any>;\n findUnique: (args: { where: never; [key: string]: never }) => Promise<any>;\n update: (args: {\n where: never;\n data: never;\n [key: string]: never;\n }) => Promise<any>;\n updateMany: (args: {\n where: never;\n data: never;\n [key: string]: never;\n }) => Promise<any>;\n delete: (args: { where: never; [key: string]: never }) => Promise<any>;\n deleteMany: (args: { where: never; [key: string]: never }) => Promise<any>;\n count: (args: { where: never; [key: string]: never }) => Promise<number>;\n};\n\nexport interface UserRole {\n id: string;\n createdAt: Date;\n deletedAt?: Date;\n roleId: string;\n role: AuthRole;\n user: User;\n userId: string;\n}\n\nexport interface AuthRole {\n id: string;\n createdAt: Date;\n deletedAt?: Date;\n name: string;\n permissions: AuthPermission[];\n userRoles: UserRole[];\n}\n\nexport enum AuthPermissionAction {\n Create = \"Create\",\n View = \"View\",\n Update = \"Update\",\n Delete = \"Delete\",\n}\n\nexport interface AuthPermission {\n id: string;\n createdAt: Date;\n deletedAt?: Date;\n resource: string;\n action: AuthPermissionAction;\n roleId: string;\n role: AuthRole;\n}\n\nexport interface User {\n id: string;\n isStaff: boolean;\n isSuperUser: boolean;\n password: string;\n passwordChangedAt?: Date;\n deletedSelfAccountAt: Date;\n isActive: boolean;\n roles?: UserRole[] | any[];\n role?: UserRole | any;\n}\n\nexport interface ArkosRequest<Body = any, Query = any> extends Request {\n user?: User & Record<string, any>;\n relationFields?: Record<string, boolean>;\n include?: Record<string, any>;\n responseData?: Record<string, any> | null | undefined;\n additionalData?: Record<string, any> | null | undefined;\n responseStatus?: number | string | null | undefined;\n body: Body;\n prismaQueryOptions?: Record<string, any>;\n // query: Query extends Request['ParsedQs'];\n}\n\nexport interface ArkosResponse extends Response {}\nexport interface ArkosNextFunction extends NextFunction {}\nexport interface ArkosRequestHandler extends RequestHandler {}\n"]}
|
|
@@ -17,7 +17,7 @@ export async function getFileUploaderRouter({ fileUpload }) {
|
|
|
17
17
|
basePathname = "/" + basePathname;
|
|
18
18
|
if (!basePathname.endsWith("/"))
|
|
19
19
|
basePathname = basePathname + "/";
|
|
20
|
-
router.use(basePathname, authService.handleAuthenticationControl("View", authConfigs), authService.handleAccessControl("View", "file-upload", authConfigs), express.static(path.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), deepmerge({
|
|
20
|
+
router.use(basePathname, authService.handleAuthenticationControl("View", authConfigs.authenticationControl), authService.handleAccessControl("View", "file-upload", authConfigs.accessControl), express.static(path.resolve(process.cwd(), fileUpload?.baseUploadDir || "uploads"), deepmerge({
|
|
21
21
|
maxAge: "1y",
|
|
22
22
|
etag: true,
|
|
23
23
|
lastModified: true,
|
|
@@ -26,8 +26,8 @@ export async function getFileUploaderRouter({ fileUpload }) {
|
|
|
26
26
|
index: false,
|
|
27
27
|
cacheControl: true,
|
|
28
28
|
}, fileUpload?.expressStaticOptions || {})));
|
|
29
|
-
router.post(`${basePathname}:fileType`, authService.handleAuthenticationControl("Create", authConfigs), authService.handleAccessControl("Create", "file-upload", authConfigs), uploadFile);
|
|
30
|
-
router.delete(`${basePathname}:fileType/:fileName`, authService.handleAuthenticationControl("Delete", authConfigs), authService.handleAccessControl("Create", "file-upload", authConfigs), deleteFile);
|
|
29
|
+
router.post(`${basePathname}:fileType`, authService.handleAuthenticationControl("Create", authConfigs.authenticationControl), authService.handleAccessControl("Create", "file-upload", authConfigs.accessControl), uploadFile);
|
|
30
|
+
router.delete(`${basePathname}:fileType/:fileName`, authService.handleAuthenticationControl("Delete", authConfigs.authenticationControl), authService.handleAccessControl("Create", "file-upload", authConfigs.accessControl), deleteFile);
|
|
31
31
|
return router;
|
|
32
32
|
}
|
|
33
33
|
//# sourceMappingURL=file-uploader.router.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-uploader.router.js","sourceRoot":"","sources":["../../../../src/modules/file-uploader/file-uploader.router.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAA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EACD,WAAW,CAAC,mBAAmB,CAC7B,MAAM,EACN,aAAa,EACb,WAAW,CAAC,aAAa,CAC1B,EACD,OAAO,CAAC,MAAM,CACZ,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,UAAU,EAAE,aAAa,IAAI,SAAS,CAAC,EACnE,SAAS,CACP;QACE,MAAM,EAAE,IAAI;QACZ,IAAI,EAAE,IAAI;QACV,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,QAAQ;QAClB,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,KAAK;QACZ,YAAY,EAAE,IAAI;KACnB,EACD,UAAU,EAAE,oBAAoB,IAAI,EAAE,CACvC,CACF,CACF,CAAC;IAEF,MAAM,CAAC,IAAI,CACT,GAAG,YAAY,WAAW,EAC1B,WAAW,CAAC,2BAA2B,CACrC,QAAQ,EACR,WAAW,CAAC,qBAAqB,CAClC,EACD,WAAW,CAAC,mBAAmB,CAC7B,QAAQ,EACR,aAAa,EACb,WAAW,CAAC,aAAa,CAC1B,EACD,UAAU,CACX,CAAC;IAEF,MAAM,CAAC,MAAM,CACX,GAAG,YAAY,qBAAqB,EACpC,WAAW,CAAC,2BAA2B,CACrC,QAAQ,EACR,WAAW,CAAC,qBAAqB,CAClC,EACD,WAAW,CAAC,mBAAmB,CAC7B,QAAQ,EACR,aAAa,EACb,WAAW,CAAC,aAAa,CAC1B,EACD,UAAU,CACX,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import { Router } from \"express\";\nimport { importPrismaModelModules } from \"../../utils/helpers/models.helpers\";\nimport authService from \"../auth/auth.service\";\nimport { deleteFile, uploadFile } from \"./file-uploader.controller\";\nimport { ArkosConfig } from \"../../types/arkos-config\";\nimport path from \"path\";\nimport express from \"express\";\nimport deepmerge from \"../../utils/helpers/deepmerge.helper\";\nimport { AuthConfigs } from \"../../types/auth\";\n\nconst router: Router = Router();\n\nexport async function getFileUploaderRouter({ fileUpload }: ArkosConfig) {\n const modelModules = await importPrismaModelModules(\"file-upload\");\n let { middlewares = {}, authConfigs = {} as AuthConfigs } = {};\n\n if (modelModules) {\n ({ middlewares = {}, authConfigs = {} } = modelModules);\n }\n\n let basePathname = fileUpload?.baseRoute || \"/api/uploads/\";\n\n if (!basePathname.startsWith(\"/\")) basePathname = \"/\" + basePathname;\n if (!basePathname.endsWith(\"/\")) basePathname = basePathname + \"/\";\n\n router.use(\n basePathname,\n authService.handleAuthenticationControl(\n \"View\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"View\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n express.static(\n path.resolve(process.cwd(), fileUpload?.baseUploadDir || \"uploads\"),\n deepmerge(\n {\n maxAge: \"1y\",\n etag: true,\n lastModified: true,\n dotfiles: \"ignore\",\n fallthrough: true,\n index: false,\n cacheControl: true,\n },\n fileUpload?.expressStaticOptions || {}\n )\n )\n );\n\n router.post(\n `${basePathname}:fileType`,\n authService.handleAuthenticationControl(\n \"Create\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n uploadFile\n );\n\n router.delete(\n `${basePathname}:fileType/:fileName`,\n authService.handleAuthenticationControl(\n \"Delete\",\n authConfigs.authenticationControl\n ),\n authService.handleAccessControl(\n \"Create\",\n \"file-upload\",\n authConfigs.accessControl\n ),\n deleteFile\n );\n\n return router;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAiEA,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,yCAAiB,CAAA;IACjB,qCAAa,CAAA;IACb,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B","sourcesContent":["import { NextFunction, Request, RequestHandler, Response } from \"express\";\n\nexport type PrismaOperations = \"findMany\";\n\nexport type PrismaQueryOptions<T extends Record<string, any>> = {\n queryOptions?: Partial<Parameters<T[\"findMany\"]>[0]>;\n findOne?: Partial<Parameters<T[\"findFirst\"]>[0]>;\n findMany?: Partial<Parameters<T[\"findMany\"]>[0]>;\n deleteMany?: Partial<Parameters<T[\"deleteMany\"]>[0]>;\n updateMany?: Partial<Parameters<T[\"updateMany\"]>[0]>;\n createMany?: Partial<Parameters<T[\"createMany\"]>[0]>;\n createOne?: Partial<Parameters<T[\"create\"]>[0]>;\n updateOne?: Partial<Parameters<T[\"update\"]>[0]>;\n deleteOne?: Partial<Parameters<T[\"delete\"]>[0]>;\n};\n\n/**\n * Interface defining the minimum structure required for Prisma model delegates\n * This allows us to constraint TModel without requiring Prisma imports\n */\nexport type PrismaModelDelegate = Record<\n string,\n (args: Record<string, never>) => any\n>;\n\ntype a = {\n create: (args: { data: never; [key: string]: never }) => Promise<any>;\n createMany: (args: { data: never; [key: string]: never }) => Promise<any>;\n findMany: (args: { [key: string]: never }) => Promise<any[]>;\n findFirst: (args: { where: never; [key: string]: never }) => Promise<any>;\n findUnique: (args: { where: never; [key: string]: never }) => Promise<any>;\n update: (args: {\n where: never;\n data: never;\n [key: string]: never;\n }) => Promise<any>;\n updateMany: (args: {\n where: never;\n data: never;\n [key: string]: never;\n }) => Promise<any>;\n delete: (args: { where: never; [key: string]: never }) => Promise<any>;\n deleteMany: (args: { where: never; [key: string]: never }) => Promise<any>;\n count: (args: { where: never; [key: string]: never }) => Promise<number>;\n};\n\nexport interface UserRole {\n id: string;\n createdAt: Date;\n deletedAt?: Date;\n roleId: string;\n role: AuthRole;\n user: User;\n userId: string;\n}\n\nexport interface AuthRole {\n id: string;\n createdAt: Date;\n deletedAt?: Date;\n name: string;\n permissions: AuthPermission[];\n userRoles: UserRole[];\n}\n\nexport enum AuthPermissionAction {\n Create = \"Create\",\n View = \"View\",\n Update = \"Update\",\n Delete = \"Delete\",\n}\n\nexport interface AuthPermission {\n id: string;\n createdAt: Date;\n deletedAt?: Date;\n resource: string;\n action: AuthPermissionAction;\n roleId: string;\n role: AuthRole;\n}\n\nexport interface User {\n id: string;\n isStaff: boolean;\n isSuperUser: boolean;\n password: string;\n passwordChangedAt?: Date;\n deletedSelfAccountAt: Date;\n isActive: boolean;\n roles?: UserRole[] | any[];\n role?: UserRole | any;\n}\n\nexport interface ArkosRequest<Body = any, Query = any> extends Request {\n user?: User & Record<string, any>;\n relationFields?: Record<string, boolean>;\n include?: Record<string, any>;\n responseData?: Record<string, any> | null | undefined;\n additionalData?: Record<string, any> | null | undefined;\n responseStatus?: number | string | null | undefined;\n body: Body;\n prismaQueryOptions?: Record<string, any>;\n // query: Query extends Request['ParsedQs'];\n}\n\nexport interface ArkosResponse extends Response {}\nexport interface ArkosNextFunction extends NextFunction {}\nexport interface ArkosRequestHandler extends RequestHandler {}\n"]}
|
|
@@ -11,49 +11,7 @@ export type PrismaQueryOptions<T extends Record<string, any>> = {
|
|
|
11
11
|
updateOne?: Partial<Parameters<T["update"]>[0]>;
|
|
12
12
|
deleteOne?: Partial<Parameters<T["delete"]>[0]>;
|
|
13
13
|
};
|
|
14
|
-
export
|
|
15
|
-
create: (args: {
|
|
16
|
-
data: never;
|
|
17
|
-
[key: string]: never;
|
|
18
|
-
}) => Promise<any>;
|
|
19
|
-
createMany: (args: {
|
|
20
|
-
data: never;
|
|
21
|
-
[key: string]: never;
|
|
22
|
-
}) => Promise<any>;
|
|
23
|
-
findMany: (args: {
|
|
24
|
-
[key: string]: never;
|
|
25
|
-
}) => Promise<any[]>;
|
|
26
|
-
findFirst: (args: {
|
|
27
|
-
where: never;
|
|
28
|
-
[key: string]: never;
|
|
29
|
-
}) => Promise<any>;
|
|
30
|
-
findUnique: (args: {
|
|
31
|
-
where: never;
|
|
32
|
-
[key: string]: never;
|
|
33
|
-
}) => Promise<any>;
|
|
34
|
-
update: (args: {
|
|
35
|
-
where: never;
|
|
36
|
-
data: never;
|
|
37
|
-
[key: string]: never;
|
|
38
|
-
}) => Promise<any>;
|
|
39
|
-
updateMany: (args: {
|
|
40
|
-
where: never;
|
|
41
|
-
data: never;
|
|
42
|
-
[key: string]: never;
|
|
43
|
-
}) => Promise<any>;
|
|
44
|
-
delete: (args: {
|
|
45
|
-
where: never;
|
|
46
|
-
[key: string]: never;
|
|
47
|
-
}) => Promise<any>;
|
|
48
|
-
deleteMany: (args: {
|
|
49
|
-
where: never;
|
|
50
|
-
[key: string]: never;
|
|
51
|
-
}) => Promise<any>;
|
|
52
|
-
count: (args: {
|
|
53
|
-
where: never;
|
|
54
|
-
[key: string]: never;
|
|
55
|
-
}) => Promise<number>;
|
|
56
|
-
}
|
|
14
|
+
export type PrismaModelDelegate = Record<string, (args: Record<string, never>) => any>;
|
|
57
15
|
export interface UserRole {
|
|
58
16
|
id: string;
|
|
59
17
|
createdAt: Date;
|