arkos 1.4.10-beta → 1.4.11-beta
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/app.js +1 -1
- package/dist/cjs/app.js.map +1 -1
- package/dist/cjs/modules/auth/auth.router.js +39 -4
- package/dist/cjs/modules/auth/auth.router.js.map +1 -1
- package/dist/cjs/modules/auth/utils/auth-openapi-generator.js +372 -0
- package/dist/cjs/modules/auth/utils/auth-openapi-generator.js.map +1 -0
- package/dist/cjs/modules/auth/utils/auth-prisma-json-schema-generator.js +102 -0
- package/dist/cjs/modules/auth/utils/auth-prisma-json-schema-generator.js.map +1 -0
- package/dist/cjs/modules/base/base.middlewares.js +1 -1
- package/dist/cjs/modules/base/base.middlewares.js.map +1 -1
- package/dist/cjs/modules/base/types/base.service.types.js.map +1 -1
- package/dist/cjs/modules/base/utils/helpers/base.router.helpers.js +46 -14
- package/dist/cjs/modules/base/utils/helpers/base.router.helpers.js.map +1 -1
- package/dist/cjs/modules/base/utils/helpers/base.service.helpers.js +17 -5
- package/dist/cjs/modules/base/utils/helpers/base.service.helpers.js.map +1 -1
- package/dist/cjs/modules/base/utils/model-openapi-generator.js +443 -0
- package/dist/cjs/modules/base/utils/model-openapi-generator.js.map +1 -0
- package/dist/cjs/modules/error-handler/error-handler.controller.js +0 -2
- package/dist/cjs/modules/error-handler/error-handler.controller.js.map +1 -1
- package/dist/cjs/modules/error-handler/utils/error-handler.helpers.js +0 -106
- package/dist/cjs/modules/error-handler/utils/error-handler.helpers.js.map +1 -1
- package/dist/cjs/modules/file-upload/file-upload.router.js +19 -0
- package/dist/cjs/modules/file-upload/file-upload.router.js.map +1 -1
- package/dist/cjs/modules/file-upload/utils/file-upload-json-schema-generator.js +351 -0
- package/dist/cjs/modules/file-upload/utils/file-upload-json-schema-generator.js.map +1 -0
- package/dist/cjs/modules/swagger/swagger.router.js +35 -16
- package/dist/cjs/modules/swagger/swagger.router.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-swagger-default-configs.js +1 -2
- package/dist/cjs/modules/swagger/utils/helpers/get-swagger-default-configs.js.map +1 -1
- package/dist/cjs/modules/swagger/utils/helpers/openapi-schema-converter.js +68 -31
- package/dist/cjs/modules/swagger/utils/helpers/openapi-schema-converter.js.map +1 -1
- package/dist/cjs/server.js +0 -6
- package/dist/cjs/server.js.map +1 -1
- package/dist/cjs/types/arkos-config.js.map +1 -1
- package/dist/cjs/types/{arkos-config/utils.js → arkos-prisma-input.bak.js} +1 -1
- package/dist/cjs/types/arkos-prisma-input.bak.js.map +1 -0
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/utils/arkos-router/arkos-router-openapi-manager.js +3 -12
- package/dist/cjs/utils/arkos-router/arkos-router-openapi-manager.js.map +1 -1
- package/dist/cjs/utils/arkos-router/index.js +47 -8
- package/dist/cjs/utils/arkos-router/index.js.map +1 -1
- package/dist/cjs/utils/arkos-router/types/openapi-config.js.map +1 -1
- package/dist/cjs/utils/arkos-router/utils/helpers/index.js +15 -2
- package/dist/cjs/utils/arkos-router/utils/helpers/index.js.map +1 -1
- package/dist/cjs/utils/cli/generate.js +4 -4
- package/dist/cjs/utils/cli/generate.js.map +1 -1
- package/dist/cjs/utils/cli/index.js +11 -11
- package/dist/cjs/utils/cli/index.js.map +1 -1
- package/dist/cjs/utils/cli/utils/cli.helpers.js +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js +29 -5
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js +26 -5
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator-dto-generator.js +52 -0
- package/dist/cjs/utils/cli/utils/template-generator/templates/class-validator-dto-generator.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/zod/create-schema-template.js +10 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/zod/create-schema-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/zod/update-schema-template.js +9 -2
- package/dist/cjs/utils/cli/utils/template-generator/templates/zod/update-schema-template.js.map +1 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/zod-schema-generator.js +26 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/zod-schema-generator.js.map +1 -1
- package/dist/cjs/utils/helpers/routers.helpers.js +2 -4
- package/dist/cjs/utils/helpers/routers.helpers.js.map +1 -1
- package/dist/cjs/utils/prisma/prisma-json-schema-generator.js +144 -257
- package/dist/cjs/utils/prisma/prisma-json-schema-generator.js.map +1 -1
- package/dist/cjs/utils/prisma/prisma-schema-parser.js +15 -2
- package/dist/cjs/utils/prisma/prisma-schema-parser.js.map +1 -1
- package/dist/cjs/utils/prisma/types.js.map +1 -1
- package/dist/esm/app.js +1 -1
- package/dist/esm/app.js.map +1 -1
- package/dist/esm/modules/auth/auth.router.js +39 -4
- package/dist/esm/modules/auth/auth.router.js.map +1 -1
- package/dist/esm/modules/auth/utils/auth-openapi-generator.js +367 -0
- package/dist/esm/modules/auth/utils/auth-openapi-generator.js.map +1 -0
- package/dist/esm/modules/auth/utils/auth-prisma-json-schema-generator.js +97 -0
- package/dist/esm/modules/auth/utils/auth-prisma-json-schema-generator.js.map +1 -0
- package/dist/esm/modules/base/base.middlewares.js +1 -1
- package/dist/esm/modules/base/base.middlewares.js.map +1 -1
- package/dist/esm/modules/base/types/base.service.types.js.map +1 -1
- package/dist/esm/modules/base/utils/helpers/base.router.helpers.js +46 -13
- package/dist/esm/modules/base/utils/helpers/base.router.helpers.js.map +1 -1
- package/dist/esm/modules/base/utils/helpers/base.service.helpers.js +17 -5
- package/dist/esm/modules/base/utils/helpers/base.service.helpers.js.map +1 -1
- package/dist/esm/modules/base/utils/model-openapi-generator.js +438 -0
- package/dist/esm/modules/base/utils/model-openapi-generator.js.map +1 -0
- package/dist/esm/modules/error-handler/error-handler.controller.js +0 -2
- package/dist/esm/modules/error-handler/error-handler.controller.js.map +1 -1
- package/dist/esm/modules/error-handler/utils/error-handler.helpers.js +0 -87
- package/dist/esm/modules/error-handler/utils/error-handler.helpers.js.map +1 -1
- package/dist/esm/modules/file-upload/file-upload.router.js +19 -0
- package/dist/esm/modules/file-upload/file-upload.router.js.map +1 -1
- package/dist/esm/modules/file-upload/utils/file-upload-json-schema-generator.js +346 -0
- package/dist/esm/modules/file-upload/utils/file-upload-json-schema-generator.js.map +1 -0
- package/dist/esm/modules/swagger/swagger.router.js +35 -16
- package/dist/esm/modules/swagger/swagger.router.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/get-swagger-default-configs.js +1 -2
- package/dist/esm/modules/swagger/utils/helpers/get-swagger-default-configs.js.map +1 -1
- package/dist/esm/modules/swagger/utils/helpers/openapi-schema-converter.js +68 -31
- package/dist/esm/modules/swagger/utils/helpers/openapi-schema-converter.js.map +1 -1
- package/dist/esm/server.js +0 -5
- package/dist/esm/server.js.map +1 -1
- package/dist/esm/types/arkos-config.js.map +1 -1
- package/dist/esm/types/arkos-prisma-input.bak.js +2 -0
- package/dist/esm/types/arkos-prisma-input.bak.js.map +1 -0
- package/dist/esm/types/index.js.map +1 -1
- package/dist/esm/utils/arkos-router/arkos-router-openapi-manager.js +3 -12
- package/dist/esm/utils/arkos-router/arkos-router-openapi-manager.js.map +1 -1
- package/dist/esm/utils/arkos-router/index.js +47 -8
- package/dist/esm/utils/arkos-router/index.js.map +1 -1
- package/dist/esm/utils/arkos-router/types/openapi-config.js.map +1 -1
- package/dist/esm/utils/arkos-router/utils/helpers/index.js +15 -2
- package/dist/esm/utils/arkos-router/utils/helpers/index.js.map +1 -1
- package/dist/esm/utils/cli/generate.js +4 -4
- package/dist/esm/utils/cli/generate.js.map +1 -1
- package/dist/esm/utils/cli/index.js +11 -11
- package/dist/esm/utils/cli/index.js.map +1 -1
- package/dist/esm/utils/cli/utils/cli.helpers.js +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js +29 -5
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/create-dto-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js +26 -5
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator/update-dto-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator-dto-generator.js +52 -0
- package/dist/esm/utils/cli/utils/template-generator/templates/class-validator-dto-generator.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/zod/create-schema-template.js +10 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/zod/create-schema-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/zod/update-schema-template.js +9 -2
- package/dist/esm/utils/cli/utils/template-generator/templates/zod/update-schema-template.js.map +1 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/zod-schema-generator.js +26 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/zod-schema-generator.js.map +1 -1
- package/dist/esm/utils/helpers/routers.helpers.js +2 -4
- package/dist/esm/utils/helpers/routers.helpers.js.map +1 -1
- package/dist/esm/utils/prisma/prisma-json-schema-generator.js +144 -257
- package/dist/esm/utils/prisma/prisma-json-schema-generator.js.map +1 -1
- package/dist/esm/utils/prisma/prisma-schema-parser.js +15 -2
- package/dist/esm/utils/prisma/prisma-schema-parser.js.map +1 -1
- package/dist/esm/utils/prisma/types.js.map +1 -1
- package/dist/types/modules/auth/utils/auth-openapi-generator.d.ts +9 -0
- package/dist/types/modules/auth/utils/auth-prisma-json-schema-generator.d.ts +13 -0
- package/dist/types/modules/base/base.middlewares.d.ts +3 -0
- package/dist/types/modules/base/types/base.service.types.d.ts +0 -3
- package/dist/types/modules/base/utils/helpers/base.router.helpers.d.ts +0 -1
- package/dist/types/modules/base/utils/helpers/base.service.helpers.d.ts +1 -1
- package/dist/types/modules/base/utils/model-openapi-generator.d.ts +12 -0
- package/dist/types/modules/error-handler/utils/error-handler.helpers.d.ts +0 -19
- package/dist/types/modules/file-upload/utils/file-upload-json-schema-generator.d.ts +12 -0
- package/dist/types/modules/swagger/utils/helpers/get-swagger-default-configs.d.ts +1 -2
- package/dist/types/modules/swagger/utils/helpers/openapi-schema-converter.d.ts +27 -3
- package/dist/types/server.d.ts +0 -6
- package/dist/types/types/arkos-config.d.ts +1 -1
- package/dist/types/types/arkos-prisma-input.bak.d.ts +237 -0
- package/dist/types/types/index.d.ts +0 -48
- package/dist/types/utils/arkos-router/types/openapi-config.d.ts +3 -2
- package/dist/types/utils/helpers/routers.helpers.d.ts +1 -1
- package/dist/types/utils/prisma/prisma-json-schema-generator.d.ts +12 -42
- package/dist/types/utils/prisma/prisma-schema-parser.d.ts +2 -0
- package/dist/types/utils/prisma/types.d.ts +2 -1
- package/package.json +3 -1
- package/dist/cjs/components/arkos-policy/index.js +0 -38
- package/dist/cjs/components/arkos-policy/index.js.map +0 -1
- package/dist/cjs/components/arkos-policy/types.js +0 -3
- package/dist/cjs/components/arkos-policy/types.js.map +0 -1
- package/dist/cjs/exports/config.js +0 -6
- package/dist/cjs/exports/config.js.map +0 -1
- package/dist/cjs/modules/base/utils/helpers/base.controller.helpers.js +0 -80
- package/dist/cjs/modules/base/utils/helpers/base.controller.helpers.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/built-in-route-path-object-manager.js +0 -7
- package/dist/cjs/modules/swagger/utils/built-in-route-path-object-manager.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/get-open-api-login-html.js +0 -276
- package/dist/cjs/modules/swagger/utils/get-open-api-login-html.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +0 -482
- package/dist/cjs/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js +0 -505
- package/dist/cjs/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/get-system-json-schema-paths.js +0 -37
- package/dist/cjs/modules/swagger/utils/helpers/get-system-json-schema-paths.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-class-validator-json-schemas.js +0 -50
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-class-validator-json-schemas.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-prisma-json-schemas.js +0 -32
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-prisma-json-schemas.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-system-json-schemas.js +0 -49
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-system-json-schemas.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-zod-json-schemas.js +0 -34
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/generate-zod-json-schemas.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js +0 -508
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-parent-routes-paths.js +0 -573
- package/dist/cjs/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-parent-routes-paths.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/missing-json-schemas-generator.js +0 -261
- package/dist/cjs/modules/swagger/utils/helpers/missing-json-schemas-generator.js.map +0 -1
- package/dist/cjs/modules/swagger/utils/helpers/swagger.router.helpers.js +0 -114
- package/dist/cjs/modules/swagger/utils/helpers/swagger.router.helpers.js.map +0 -1
- package/dist/cjs/paths.js +0 -9
- package/dist/cjs/paths.js.map +0 -1
- package/dist/cjs/types/arkos-config/utils.js.map +0 -1
- package/dist/cjs/types/arkos.js +0 -3
- package/dist/cjs/types/arkos.js.map +0 -1
- package/dist/cjs/utils/arkos-router/utils/helpers/apply-arkos-router-proxy.js +0 -152
- package/dist/cjs/utils/arkos-router/utils/helpers/apply-arkos-router-proxy.js.map +0 -1
- package/dist/cjs/utils/cli/utils/template-generator/templates/policy-template.js +0 -53
- package/dist/cjs/utils/cli/utils/template-generator/templates/policy-template.js.map +0 -1
- package/dist/cjs/utils/helpers/exit-error.js +0 -12
- package/dist/cjs/utils/helpers/exit-error.js.map +0 -1
- package/dist/cjs/utils/initialize-app.js +0 -56
- package/dist/cjs/utils/initialize-app.js.map +0 -1
- package/dist/cjs/utils/setup-app.js +0 -119
- package/dist/cjs/utils/setup-app.js.map +0 -1
- package/dist/esm/components/arkos-policy/index.js +0 -32
- package/dist/esm/components/arkos-policy/index.js.map +0 -1
- package/dist/esm/components/arkos-policy/types.js +0 -2
- package/dist/esm/components/arkos-policy/types.js.map +0 -1
- package/dist/esm/exports/config.js +0 -3
- package/dist/esm/exports/config.js.map +0 -1
- package/dist/esm/modules/base/utils/helpers/base.controller.helpers.js +0 -76
- package/dist/esm/modules/base/utils/helpers/base.controller.helpers.js.map +0 -1
- package/dist/esm/modules/swagger/utils/built-in-route-path-object-manager.js +0 -5
- package/dist/esm/modules/swagger/utils/built-in-route-path-object-manager.js.map +0 -1
- package/dist/esm/modules/swagger/utils/get-open-api-login-html.js +0 -273
- package/dist/esm/modules/swagger/utils/get-open-api-login-html.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js +0 -477
- package/dist/esm/modules/swagger/utils/helpers/get-authentication-json-schema-paths.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js +0 -499
- package/dist/esm/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/get-system-json-schema-paths.js +0 -34
- package/dist/esm/modules/swagger/utils/helpers/get-system-json-schema-paths.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-class-validator-json-schemas.js +0 -44
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-class-validator-json-schemas.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-prisma-json-schemas.js +0 -26
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-prisma-json-schemas.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-system-json-schemas.js +0 -46
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-system-json-schemas.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-zod-json-schemas.js +0 -28
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/generate-zod-json-schemas.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js +0 -502
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-parent-routes-paths.js +0 -567
- package/dist/esm/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-parent-routes-paths.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/missing-json-schemas-generator.js +0 -256
- package/dist/esm/modules/swagger/utils/helpers/missing-json-schemas-generator.js.map +0 -1
- package/dist/esm/modules/swagger/utils/helpers/swagger.router.helpers.js +0 -103
- package/dist/esm/modules/swagger/utils/helpers/swagger.router.helpers.js.map +0 -1
- package/dist/esm/paths.js +0 -3
- package/dist/esm/paths.js.map +0 -1
- package/dist/esm/types/arkos-config/utils.js +0 -2
- package/dist/esm/types/arkos-config/utils.js.map +0 -1
- package/dist/esm/types/arkos.js +0 -2
- package/dist/esm/types/arkos.js.map +0 -1
- package/dist/esm/utils/arkos-router/utils/helpers/apply-arkos-router-proxy.js +0 -146
- package/dist/esm/utils/arkos-router/utils/helpers/apply-arkos-router-proxy.js.map +0 -1
- package/dist/esm/utils/cli/utils/template-generator/templates/policy-template.js +0 -47
- package/dist/esm/utils/cli/utils/template-generator/templates/policy-template.js.map +0 -1
- package/dist/esm/utils/helpers/exit-error.js +0 -6
- package/dist/esm/utils/helpers/exit-error.js.map +0 -1
- package/dist/esm/utils/initialize-app.js +0 -50
- package/dist/esm/utils/initialize-app.js.map +0 -1
- package/dist/esm/utils/setup-app.js +0 -113
- package/dist/esm/utils/setup-app.js.map +0 -1
- package/dist/types/components/arkos-policy/index.d.ts +0 -31
- package/dist/types/components/arkos-policy/types.d.ts +0 -21
- package/dist/types/exports/config.d.ts +0 -2
- package/dist/types/modules/base/utils/helpers/base.controller.helpers.d.ts +0 -4
- package/dist/types/modules/swagger/utils/built-in-route-path-object-manager.d.ts +0 -4
- package/dist/types/modules/swagger/utils/get-open-api-login-html.d.ts +0 -1
- package/dist/types/modules/swagger/utils/helpers/get-authentication-json-schema-paths.d.ts +0 -4
- package/dist/types/modules/swagger/utils/helpers/get-file-upload-json-schema-paths.d.ts +0 -3
- package/dist/types/modules/swagger/utils/helpers/get-system-json-schema-paths.d.ts +0 -2
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/generate-class-validator-json-schemas.d.ts +0 -1
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/generate-prisma-json-schemas.d.ts +0 -2
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/generate-system-json-schemas.d.ts +0 -4
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/generate-zod-json-schemas.d.ts +0 -1
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-main-routes-paths.d.ts +0 -3
- package/dist/types/modules/swagger/utils/helpers/json-schema-generators/prisma-models/generate-prisma-model-parent-routes-paths.d.ts +0 -3
- package/dist/types/modules/swagger/utils/helpers/missing-json-schemas-generator.d.ts +0 -77
- package/dist/types/modules/swagger/utils/helpers/swagger.router.helpers.d.ts +0 -20
- package/dist/types/paths.d.ts +0 -1
- package/dist/types/types/arkos-config/utils.d.ts +0 -35
- package/dist/types/types/arkos.d.ts +0 -31
- package/dist/types/utils/arkos-router/utils/helpers/apply-arkos-router-proxy.d.ts +0 -7
- package/dist/types/utils/cli/utils/template-generator/templates/policy-template.d.ts +0 -2
- package/dist/types/utils/helpers/exit-error.d.ts +0 -1
- package/dist/types/utils/initialize-app.d.ts +0 -2
- package/dist/types/utils/setup-app.d.ts +0 -2
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helper type to exclude properties from T that exist in U
|
|
3
|
+
* Used internally by XOR to create mutually exclusive types
|
|
4
|
+
*/
|
|
5
|
+
type Without<T, U> = {
|
|
6
|
+
[P in Exclude<keyof T, keyof U>]?: never;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* XOR (Exclusive OR) type for mutually exclusive union types
|
|
10
|
+
* Ensures that properties from T and U cannot be mixed together
|
|
11
|
+
* @see https://stackoverflow.com/questions/42123407/does-typescript-support-mutually-exclusive-types
|
|
12
|
+
*/
|
|
13
|
+
type XOR<T, U> = T extends object ? U extends object ? (Without<T, U> & U) | (Without<U, T> & T) : U : T;
|
|
14
|
+
/**
|
|
15
|
+
* Extract type from Prisma's Enumerable wrapper
|
|
16
|
+
* Currently acts as identity but can be extended to handle array unwrapping
|
|
17
|
+
*/
|
|
18
|
+
type Unpack<T> = T;
|
|
19
|
+
/**
|
|
20
|
+
* Checks if a field is a Prisma relation field
|
|
21
|
+
* A field is considered a relation if it has any of: create, connect, connectOrCreate, update, delete, disconnect
|
|
22
|
+
* Handles optional fields by excluding undefined before checking
|
|
23
|
+
* @template T - The type to check
|
|
24
|
+
* @returns true if T is a relation field, false otherwise
|
|
25
|
+
*/
|
|
26
|
+
export type IsRelationField<T> = Exclude<T, undefined> extends {
|
|
27
|
+
create?: {
|
|
28
|
+
id?: any;
|
|
29
|
+
} | {
|
|
30
|
+
id?: any;
|
|
31
|
+
}[];
|
|
32
|
+
} | {
|
|
33
|
+
connect?: {
|
|
34
|
+
id?: any;
|
|
35
|
+
} | {
|
|
36
|
+
id?: any;
|
|
37
|
+
}[];
|
|
38
|
+
} | {
|
|
39
|
+
update?: {
|
|
40
|
+
where?: {
|
|
41
|
+
id?: any;
|
|
42
|
+
};
|
|
43
|
+
data?: any;
|
|
44
|
+
};
|
|
45
|
+
} | {
|
|
46
|
+
delete?: {
|
|
47
|
+
where?: {
|
|
48
|
+
id?: any;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
} | {
|
|
52
|
+
disconnect?: {
|
|
53
|
+
where?: {
|
|
54
|
+
id?: any;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
} ? true : false;
|
|
58
|
+
/**
|
|
59
|
+
* Checks if a Prisma relation field is an array/many relation
|
|
60
|
+
* Detects relations that support multiple records (one-to-many or many-to-many)
|
|
61
|
+
* @template T - The relation field type
|
|
62
|
+
* @returns true if it's an array relation, false otherwise
|
|
63
|
+
*/
|
|
64
|
+
export type IsArrayRelation<T> = Exclude<T, undefined> extends {
|
|
65
|
+
createMany?: any;
|
|
66
|
+
} ? true : Exclude<T, undefined> extends {
|
|
67
|
+
deleteMany?: any;
|
|
68
|
+
} ? true : false;
|
|
69
|
+
/**
|
|
70
|
+
* Extracts the create data type from a Prisma relation field
|
|
71
|
+
* @template T - The relation field type
|
|
72
|
+
* @returns The type used in the create operation, or never if not present
|
|
73
|
+
*/
|
|
74
|
+
export type ExtractCreateType<T> = Exclude<T, undefined> extends {
|
|
75
|
+
create?: infer C;
|
|
76
|
+
} ? C extends Array<infer U> ? (U & {
|
|
77
|
+
apiAction?: "create";
|
|
78
|
+
})[] : C & {
|
|
79
|
+
apiAction?: "create";
|
|
80
|
+
} : never;
|
|
81
|
+
type ExtractConnectType<T, action extends "connect" | "delete" | "udpate" | "disconnect" | "deleteMany"> = Exclude<T, undefined> extends {
|
|
82
|
+
[k in action]?: infer C;
|
|
83
|
+
} ? C extends Array<infer U> ? (U & {
|
|
84
|
+
apiAction?: action;
|
|
85
|
+
})[] : C & {
|
|
86
|
+
apiAction?: action;
|
|
87
|
+
} : never;
|
|
88
|
+
/**
|
|
89
|
+
* Extracts and merges the update data type from a Prisma relation field
|
|
90
|
+
* Combines the 'where' clause and 'data' fields into a single type
|
|
91
|
+
* @template T - The relation field type
|
|
92
|
+
* @returns Merged type of where & data fields, or never if not present
|
|
93
|
+
*/
|
|
94
|
+
type ExtractUpdateType<T> = T extends {
|
|
95
|
+
update?: infer U;
|
|
96
|
+
} ? U extends Array<infer Item> ? Item extends {
|
|
97
|
+
where: infer W;
|
|
98
|
+
data: infer D;
|
|
99
|
+
} ? ((W & D) & {
|
|
100
|
+
apiAction?: "update";
|
|
101
|
+
})[] : never : U extends {
|
|
102
|
+
where: infer W;
|
|
103
|
+
data: infer D;
|
|
104
|
+
} ? (W & D) & {
|
|
105
|
+
apiAction?: "update";
|
|
106
|
+
} : never : never;
|
|
107
|
+
/**
|
|
108
|
+
* Creates a flattened union type for a single relation field
|
|
109
|
+
* Combines all possible Prisma operations (create, connect, update, delete, etc.) into a discriminated union
|
|
110
|
+
* Each variant includes an optional apiAction field for explicit operation specification
|
|
111
|
+
* @template T - The Prisma relation field type
|
|
112
|
+
*/
|
|
113
|
+
type FlattenRelationField<T> =
|
|
114
|
+
/**
|
|
115
|
+
* Create Operation - Creates a new related entity
|
|
116
|
+
* Extracts the 'create' data type and recursively flattens nested relations
|
|
117
|
+
* @example { name: "New Item", apiAction?: "create" }
|
|
118
|
+
*/
|
|
119
|
+
(ExtractCreateType<T> extends never ? never : FlattenRelations<ExtractCreateType<T>>)
|
|
120
|
+
/**
|
|
121
|
+
* Connect Operation - Links to an existing entity using unique fields
|
|
122
|
+
* Extracts the 'connect' data type (typically unique identifiers like id, email, etc.)
|
|
123
|
+
* @example { id: 123, apiAction?: "connect" } or { email: "user@example.com", apiAction?: "connect" }
|
|
124
|
+
*/
|
|
125
|
+
| (ExtractConnectType<T, "connect"> extends never ? never : FlattenRelations<ExtractConnectType<T, "connect">>)
|
|
126
|
+
/**
|
|
127
|
+
* Update Operation - Modifies an existing related entity
|
|
128
|
+
* Combines the 'where' clause and 'data' fields into a single flat object
|
|
129
|
+
* @example { id: 123, name: "Updated Name", apiAction?: "update" }
|
|
130
|
+
*/
|
|
131
|
+
| (ExtractUpdateType<T> extends never ? never : FlattenRelations<ExtractUpdateType<T>> & {
|
|
132
|
+
apiAction?: "update";
|
|
133
|
+
})
|
|
134
|
+
/**
|
|
135
|
+
* Delete Operation - Removes a related entity from the database
|
|
136
|
+
* Requires unique identifier(s) and explicit apiAction: "delete"
|
|
137
|
+
* For arrays, automatically uses deleteMany; for singular relations uses delete
|
|
138
|
+
* @example { id: 123, apiAction: "delete" }
|
|
139
|
+
*/
|
|
140
|
+
| (T extends {
|
|
141
|
+
delete?: any;
|
|
142
|
+
} ? {
|
|
143
|
+
apiAction: "delete";
|
|
144
|
+
} & ExtractConnectType<T, "delete"> : never)
|
|
145
|
+
/**
|
|
146
|
+
* Disconnect Operation - Breaks the relationship without deleting the entity
|
|
147
|
+
* Requires unique identifier(s) and explicit apiAction: "disconnect"
|
|
148
|
+
* Only available for optional relations
|
|
149
|
+
* @example { id: 123, apiAction: "disconnect" }
|
|
150
|
+
*/
|
|
151
|
+
| (T extends {
|
|
152
|
+
disconnect?: any;
|
|
153
|
+
} ? {
|
|
154
|
+
apiAction: "disconnect";
|
|
155
|
+
} & ExtractConnectType<T, "disconnect"> : never)
|
|
156
|
+
/**
|
|
157
|
+
* Set Operation - Replaces all related entities with a new set
|
|
158
|
+
* Typically used for many-to-many relations to completely replace the relation set
|
|
159
|
+
* @example { id: 456, apiAction?: "set" }
|
|
160
|
+
*/
|
|
161
|
+
| (T extends {
|
|
162
|
+
set?: infer S;
|
|
163
|
+
} ? Unpack<S> & {
|
|
164
|
+
apiAction?: "set";
|
|
165
|
+
} : never)
|
|
166
|
+
/**
|
|
167
|
+
* Delete Many Operation - Removes multiple related entities matching criteria
|
|
168
|
+
* Requires unique identifier(s) and explicit apiAction: "deleteMany"
|
|
169
|
+
* Used for bulk deletion of related records
|
|
170
|
+
* @example { id: 123, apiAction: "deleteMany" }
|
|
171
|
+
*/
|
|
172
|
+
| (T extends {
|
|
173
|
+
deleteMany?: any;
|
|
174
|
+
} ? {
|
|
175
|
+
apiAction: "deleteMany";
|
|
176
|
+
} & ExtractConnectType<T, "deleteMany"> : never);
|
|
177
|
+
/**
|
|
178
|
+
* Ensures array relations only accept arrays, not single objects
|
|
179
|
+
* For array relations (one-to-many, many-to-many), forces array type
|
|
180
|
+
* For singular relations (one-to-one, many-to-one), keeps XOR behavior
|
|
181
|
+
* @template T - The original Prisma field type
|
|
182
|
+
* @template Flattened - The flattened relation field type
|
|
183
|
+
*/
|
|
184
|
+
type EnforceArrayRelation<T, Flattened> = IsArrayRelation<T> extends true ? Flattened extends Array<any> ? Flattened : never : Exclude<XOR<Flattened, T>, "AND">;
|
|
185
|
+
type FlattenRelations<T> = {
|
|
186
|
+
[K in keyof T]: IsRelationField<T[K]> extends true ? EnforceArrayRelation<T[K], FlattenRelationField<T[K]>> : T[K] extends object ? T[K] extends Date | null | undefined ? T[K] : FlattenRelations<T[K]> : T[K];
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Flattens Prisma relation inputs into a simpler, developer-friendly format
|
|
190
|
+
*
|
|
191
|
+
* Transforms Prisma's nested relation format:
|
|
192
|
+
* ```typescript
|
|
193
|
+
* { posts: { create: [...], connect: [...], update: [...] } }
|
|
194
|
+
* ```
|
|
195
|
+
*
|
|
196
|
+
* Into a flattened format with optional apiAction discriminators:
|
|
197
|
+
* ```typescript
|
|
198
|
+
* { posts: [
|
|
199
|
+
* { title: "New Post" }, // auto-detected as create
|
|
200
|
+
* { id: 1 }, // auto-detected as connect
|
|
201
|
+
* { id: 2, title: "Updated", apiAction: "update" }
|
|
202
|
+
* ]}
|
|
203
|
+
* ```
|
|
204
|
+
*
|
|
205
|
+
* Features:
|
|
206
|
+
* - Preserves non-relation fields as-is
|
|
207
|
+
* - Automatically detects operation type based on field presence
|
|
208
|
+
* - Supports explicit apiAction for disambiguation
|
|
209
|
+
* - Works recursively for deeply nested relations
|
|
210
|
+
* - Enforces array-only types for array relations (one-to-many, many-to-many)
|
|
211
|
+
* - Enforces mutual exclusivity between flattened and Prisma formats for singular relations
|
|
212
|
+
*
|
|
213
|
+
* @see {@link https://wwww.arkosjs.com/docs/api-reference/arkos-prisma-input}
|
|
214
|
+
* @template T - The Prisma input type (e.g., Prisma.UserCreateInput)
|
|
215
|
+
* @returns A flattened version of the input type with simplified relation handling
|
|
216
|
+
*
|
|
217
|
+
* @example
|
|
218
|
+
* ```typescript
|
|
219
|
+
* import { Prisma } from "@prisma/client";
|
|
220
|
+
*
|
|
221
|
+
* type FlatUserInput = ArkosPrismaInput<Prisma.UserCreateInput>;
|
|
222
|
+
*
|
|
223
|
+
* const user: FlatUserInput = {
|
|
224
|
+
* name: "John",
|
|
225
|
+
* email: "john@example.com",
|
|
226
|
+
* posts: [
|
|
227
|
+
* { title: "My First Post" }, // creates new post
|
|
228
|
+
* { id: 1 }, // connects to existing post
|
|
229
|
+
* { id: 2, title: "Updated" }, // updates existing post
|
|
230
|
+
* { id: 3, apiAction: "delete" } // deletes post
|
|
231
|
+
* ],
|
|
232
|
+
* profile: { bio: "Software developer" } // singular relation (can be object or array)
|
|
233
|
+
* };
|
|
234
|
+
* ```
|
|
235
|
+
*/
|
|
236
|
+
export type ArkosPrismaInput<T> = FlattenRelations<T>;
|
|
237
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { NextFunction, Request, Response } from "express";
|
|
2
|
-
export type PrismaOperations = "findMany";
|
|
3
2
|
/**
|
|
4
3
|
* Type definition for authentication-related Prisma query operations
|
|
5
4
|
* @template T - The Prisma model delegate type
|
|
@@ -120,53 +119,6 @@ type BasePrismaQueryOptions<T extends Record<string, any>> = {
|
|
|
120
119
|
* @template ModelName - The model name (defaults to string for standard models)
|
|
121
120
|
*/
|
|
122
121
|
export type PrismaQueryOptions<T extends Record<string, any>, ModelName extends string = string> = ModelName extends "auth" ? AuthPrismaQueryOptions<T> : BasePrismaQueryOptions<T>;
|
|
123
|
-
/**
|
|
124
|
-
* Interface defining the minimum structure required for Prisma model delegates
|
|
125
|
-
* This allows us to constraint TModel without requiring Prisma imports
|
|
126
|
-
*/
|
|
127
|
-
export type PrismaModelDelegate = {
|
|
128
|
-
create: (args: {
|
|
129
|
-
data: never;
|
|
130
|
-
[key: string]: never;
|
|
131
|
-
}) => Promise<any>;
|
|
132
|
-
createMany: (args: {
|
|
133
|
-
data: never;
|
|
134
|
-
[key: string]: never;
|
|
135
|
-
}) => Promise<any>;
|
|
136
|
-
findMany: (args: {
|
|
137
|
-
[key: string]: never;
|
|
138
|
-
}) => Promise<any[]>;
|
|
139
|
-
findFirst: (args: {
|
|
140
|
-
where: never;
|
|
141
|
-
[key: string]: never;
|
|
142
|
-
}) => Promise<any>;
|
|
143
|
-
findUnique: (args: {
|
|
144
|
-
where: never;
|
|
145
|
-
[key: string]: never;
|
|
146
|
-
}) => Promise<any>;
|
|
147
|
-
update: (args: {
|
|
148
|
-
where: never;
|
|
149
|
-
data: never;
|
|
150
|
-
[key: string]: never;
|
|
151
|
-
}) => Promise<any>;
|
|
152
|
-
updateMany: (args: {
|
|
153
|
-
where: never;
|
|
154
|
-
data: never;
|
|
155
|
-
[key: string]: never;
|
|
156
|
-
}) => Promise<any>;
|
|
157
|
-
delete: (args: {
|
|
158
|
-
where: never;
|
|
159
|
-
[key: string]: never;
|
|
160
|
-
}) => Promise<any>;
|
|
161
|
-
deleteMany: (args: {
|
|
162
|
-
where: never;
|
|
163
|
-
[key: string]: never;
|
|
164
|
-
}) => Promise<any>;
|
|
165
|
-
count: (args: {
|
|
166
|
-
where: never;
|
|
167
|
-
[key: string]: never;
|
|
168
|
-
}) => Promise<number>;
|
|
169
|
-
};
|
|
170
122
|
export interface UserRole {
|
|
171
123
|
id: string;
|
|
172
124
|
createdAt: Date;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { OpenAPIV3 } from "openapi-types";
|
|
2
2
|
import { ZodSchema } from "zod";
|
|
3
|
+
import { JsonSchema } from "../../prisma/types";
|
|
3
4
|
/**
|
|
4
5
|
* Represents a schema-like object that can be used for OpenAPI documentation.
|
|
5
6
|
* Accepts Zod schemas, class constructors (DTOs), or plain JSON Schema objects.
|
|
6
7
|
*/
|
|
7
|
-
type SchemaLike = ZodSchema | (new (...args: any[]) => object) | OpenAPIV3.SchemaObject;
|
|
8
|
+
type SchemaLike = ZodSchema | (new (...args: any[]) => object) | OpenAPIV3.SchemaObject | JsonSchema;
|
|
8
9
|
/**
|
|
9
10
|
* Extended media type object that accepts SchemaLike in addition to standard OpenAPI schemas.
|
|
10
11
|
*/
|
|
@@ -131,7 +132,7 @@ type RequestBodyDefinition = SchemaLike | {
|
|
|
131
132
|
* Defining both validation and openapi schemas for the same field will cause
|
|
132
133
|
* a startup error to prevent documentation drift.
|
|
133
134
|
*/
|
|
134
|
-
type ExtendedOperationObject = Omit<OpenAPIV3.OperationObject, "responses" | "requestBody"> & {
|
|
135
|
+
export type ExtendedOperationObject = Omit<OpenAPIV3.OperationObject, "responses" | "requestBody"> & {
|
|
135
136
|
/**
|
|
136
137
|
* Response definitions keyed by HTTP status code.
|
|
137
138
|
* Supports shorthand, medium, and full OpenAPI formats.
|
|
@@ -24,4 +24,4 @@ export declare function getAuthenticationConfig(endpoint: RouterEndpoint | AuthR
|
|
|
24
24
|
* @param validationSchema - Optional validation schema for the endpoint
|
|
25
25
|
* @returns Route configuration object
|
|
26
26
|
*/
|
|
27
|
-
export declare function createRouteConfig(arkosConfig: ArkosConfig, endpoint: RouterEndpoint | AuthRouterEndpoint | FileUploadRouterEndpoint, routeName: string, path: string, routerConfig: RouterConfig<any>, modelNameInKebab: string, authConfigs: any
|
|
27
|
+
export declare function createRouteConfig(arkosConfig: ArkosConfig, endpoint: RouterEndpoint | AuthRouterEndpoint | FileUploadRouterEndpoint, routeName: string, path: string, routerConfig: RouterConfig<any>, modelNameInKebab: string, authConfigs: any): ArkosRouteConfig;
|
|
@@ -1,67 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ValidationFileMappingKey } from "../dynamic-loader";
|
|
3
|
-
import { JsonSchema } from "./types";
|
|
4
|
-
export interface SchemaGenerationConfig {
|
|
5
|
-
modelName: string;
|
|
6
|
-
arkosConfig: ArkosConfig;
|
|
7
|
-
schemasToGenerate?: ValidationFileMappingKey[];
|
|
8
|
-
}
|
|
9
|
-
export interface GeneratedSchemas {
|
|
10
|
-
[key: string]: JsonSchema;
|
|
11
|
-
}
|
|
1
|
+
import { PrismaModel, JsonSchema } from "./types";
|
|
12
2
|
/**
|
|
13
3
|
* Enhanced JSON Schema generator that creates schemas based on Prisma models and query options
|
|
14
4
|
*/
|
|
15
5
|
export declare class PrismaJsonSchemaGenerator {
|
|
16
6
|
schema: import("./types").PrismaSchema;
|
|
17
|
-
|
|
18
|
-
* Main method to generate all schemas for a model
|
|
19
|
-
*/
|
|
20
|
-
generateModelSchemas(config: SchemaGenerationConfig): GeneratedSchemas;
|
|
21
|
-
/**
|
|
22
|
-
* Generate auth-specific schemas
|
|
23
|
-
*/
|
|
24
|
-
private generateAuthSchemas;
|
|
25
|
-
/**
|
|
26
|
-
* Generate standard CRUD schemas
|
|
27
|
-
*/
|
|
28
|
-
private generateCrudSchemas;
|
|
7
|
+
private isCompositeType;
|
|
29
8
|
/**
|
|
30
9
|
* Generate create schema (excludes ID, includes relation IDs only)
|
|
31
10
|
*/
|
|
32
|
-
|
|
11
|
+
generateCreateSchema(model: PrismaModel): JsonSchema;
|
|
33
12
|
/**
|
|
34
13
|
* Generate update schema (all fields optional, includes relation IDs only)
|
|
35
14
|
*/
|
|
36
|
-
|
|
15
|
+
generateUpdateSchema(model: PrismaModel): JsonSchema;
|
|
37
16
|
/**
|
|
38
17
|
* Generate response schema (includes nested relations based on query options)
|
|
39
18
|
*/
|
|
40
|
-
|
|
19
|
+
generateResponseSchema(model: PrismaModel, options: Record<string, any>): JsonSchema;
|
|
41
20
|
/**
|
|
42
21
|
* Generate nested relation schema
|
|
43
22
|
*/
|
|
44
23
|
private generateNestedRelationSchema;
|
|
45
|
-
/**
|
|
46
|
-
* Auth-specific schema generators
|
|
47
|
-
*/
|
|
48
|
-
private generateLoginSchema;
|
|
49
|
-
private generateSignupSchema;
|
|
50
|
-
private generateUpdateMeSchema;
|
|
51
|
-
private generateUpdatePasswordSchema;
|
|
52
|
-
/**
|
|
53
|
-
* Utility methods
|
|
54
|
-
*/
|
|
55
|
-
private resolvePrismaQueryOptions;
|
|
56
|
-
/**
|
|
57
|
-
* Helps in remmaping those prisma query options that combines many operations for example find, save...
|
|
58
|
-
*/
|
|
59
|
-
private getGeneralOptionsForAction;
|
|
60
|
-
private isEndpointDisabled;
|
|
61
24
|
private isModelRelation;
|
|
62
25
|
private convertFieldToJsonSchema;
|
|
63
26
|
private mapPrismaTypeToJsonSchema;
|
|
64
27
|
private isEnum;
|
|
28
|
+
/**
|
|
29
|
+
* Generate OpenAPI query filter parameters from scalar model fields.
|
|
30
|
+
* Mirrors the logic from ZodSchemaGenerator.generateQuerySchema.
|
|
31
|
+
*/
|
|
32
|
+
generateQueryFilterParameters(model: PrismaModel, options?: {
|
|
33
|
+
modelFieldsOnly?: boolean;
|
|
34
|
+
}): any[];
|
|
65
35
|
}
|
|
66
36
|
declare const prismaJsonSchemaGenerator: PrismaJsonSchemaGenerator;
|
|
67
37
|
export default prismaJsonSchemaGenerator;
|
|
@@ -20,6 +20,7 @@ interface SchemaConfig {
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare class PrismaSchemaParser {
|
|
23
|
+
compositeTypes: PrismaModel[];
|
|
23
24
|
/** Collection of parsed enum definitions */
|
|
24
25
|
enums: PrismaEnum[];
|
|
25
26
|
/** Collection of parsed model definitions */
|
|
@@ -37,6 +38,7 @@ export declare class PrismaSchemaParser {
|
|
|
37
38
|
parse({ override }?: {
|
|
38
39
|
override: boolean;
|
|
39
40
|
}): PrismaSchema;
|
|
41
|
+
private extractCompositeTypes;
|
|
40
42
|
/**
|
|
41
43
|
* Extracts all enum definitions from the schema.
|
|
42
44
|
*
|
|
@@ -5,10 +5,11 @@ export interface PrismaField {
|
|
|
5
5
|
isArray: boolean;
|
|
6
6
|
foreignKeyField?: string;
|
|
7
7
|
foreignReferenceField?: string;
|
|
8
|
-
isRelation
|
|
8
|
+
isRelation?: boolean;
|
|
9
9
|
defaultValue?: any;
|
|
10
10
|
isId?: boolean;
|
|
11
11
|
isUnique?: boolean;
|
|
12
|
+
isCompositeType?: boolean;
|
|
12
13
|
attributes: string[];
|
|
13
14
|
}
|
|
14
15
|
export interface PrismaModel {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arkos",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.11-beta",
|
|
4
4
|
"description": "The Express & Prisma RESTful Framework",
|
|
5
5
|
"main": "dist/cjs/exports/index.js",
|
|
6
6
|
"module": "dist/esm/exports/index.js",
|
|
@@ -155,10 +155,12 @@
|
|
|
155
155
|
"esbuild": "^0.25.1",
|
|
156
156
|
"fast-glob": "^3.3.3",
|
|
157
157
|
"jest": "^29.7.0",
|
|
158
|
+
"knip": "^6.0.1",
|
|
158
159
|
"mimetype": "^0.0.8",
|
|
159
160
|
"openapi-types": "^12.1.3",
|
|
160
161
|
"prisma": "^6.19.2",
|
|
161
162
|
"ts-jest": "^29.3.1",
|
|
163
|
+
"ts-prune": "^0.10.3",
|
|
162
164
|
"tsx": "^4.20.3",
|
|
163
165
|
"type-fest": "^4.41.0",
|
|
164
166
|
"typescript": "^5.8.2",
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ArkosPolicy = ArkosPolicy;
|
|
7
|
-
const auth_service_1 = __importDefault(require("../../modules/auth/auth.service.js"));
|
|
8
|
-
function ArkosPolicy(resource) {
|
|
9
|
-
return buildPolicy(resource, {});
|
|
10
|
-
}
|
|
11
|
-
function buildPolicy(resource, store) {
|
|
12
|
-
const rule = (action, config) => {
|
|
13
|
-
const newStore = { ...store, [action]: config };
|
|
14
|
-
return buildPolicy(resource, newStore);
|
|
15
|
-
};
|
|
16
|
-
const actionEntries = Object.fromEntries(Object.entries(store).flatMap(([action, config]) => {
|
|
17
|
-
const authEntry = {
|
|
18
|
-
resource,
|
|
19
|
-
action,
|
|
20
|
-
rule: config,
|
|
21
|
-
};
|
|
22
|
-
const checker = auth_service_1.default.permission(action, resource, {
|
|
23
|
-
[action]: config || {},
|
|
24
|
-
});
|
|
25
|
-
const canKey = `can${action.charAt(0).toUpperCase()}${action.slice(1)}`;
|
|
26
|
-
return [
|
|
27
|
-
[action, authEntry],
|
|
28
|
-
[canKey, checker],
|
|
29
|
-
];
|
|
30
|
-
}));
|
|
31
|
-
return {
|
|
32
|
-
__type: "ArkosPolicy",
|
|
33
|
-
resource,
|
|
34
|
-
rule,
|
|
35
|
-
...actionEntries,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/arkos-policy/index.ts"],"names":[],"mappings":";;;;;AAuCA,kCAIC;AAnCD,mFAA0D;AA+B1D,SAAgB,WAAW,CACzB,QAAmB;IAEnB,OAAO,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,WAAW,CAClB,QAAmB,EACnB,KAAsC;IAEtC,MAAM,IAAI,GAAG,CACX,MAAe,EACf,MAAuB,EAC2B,EAAE;QACpD,MAAM,QAAQ,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;QAChD,OAAO,WAAW,CAAgC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IACxE,CAAC,CAAC;IAEF,MAAM,aAAa,GAAG,MAAM,CAAC,WAAW,CACtC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,EAAE;QACjD,MAAM,SAAS,GAA8C;YAC3D,QAAQ;YACR,MAAM;YACN,IAAI,EAAE,MAAM;SACb,CAAC;QAEF,MAAM,OAAO,GAAkB,sBAAW,CAAC,UAAU,CAAC,MAAM,EAAE,QAAQ,EAAE;YACtE,CAAC,MAAM,CAAC,EAAE,MAAM,IAAI,EAAE;SACvB,CAAC,CAAC;QAEH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;QAExE,OAAO;YACL,CAAC,MAAM,EAAE,SAAS,CAAC;YACnB,CAAC,MAAM,EAAE,OAAO,CAAC;SAClB,CAAC;IACJ,CAAC,CAAC,CACH,CAAC;IAEF,OAAO;QACL,MAAM,EAAE,aAAsB;QAC9B,QAAQ;QACR,IAAI;QACJ,GAAG,aAAa;KACoC,CAAC;AACzD,CAAC","sourcesContent":["import { User } from \"../../types\";\nimport {\n ArkosPolicyRule,\n IArkosPolicy,\n PolicyAuthEntry,\n PolicyChecker,\n PolicyWithActions,\n} from \"./types\";\nimport authService from \"../../modules/auth/auth.service\";\n\n/**\n * Creates a typed policy for a Prisma model resource.\n *\n * Each `.rule()` call registers an action and returns the policy\n * with a typed `can{Action}` permission checker and a typed `{Action}`\n * entry — both passable to the `authentication` field on `ArkosRouteHook`\n * and `ArkosRouter`, and callable for fine-grained permission checks.\n *\n * @param resource - The resource name in kebab-case (e.g. `\"user\"`, `\"blog-post\"`)\n *\n * @example\n * ```ts\n * const userPolicy = ArkosPolicy(\"user\")\n * .rule(\"Create\", [\"Admin\", \"Editor\"])\n * .rule(\"View\", \"*\")\n * .rule(\"Delete\", [\"Admin\"]);\n *\n * // Pass to authentication field\n * userRouter.post({ path: \"/users\", authentication: userPolicy.Create });\n * userRouteHook.deleteOne({ authentication: userPolicy.Delete });\n *\n * // Fine-grained check\n * if (userPolicy.canCreate(req.user)) { ... }\n *\n * export default userPolicy;\n * ```\n *\n * @see {@link https://www.arkosjs.com/docs/api-referency/arkos-policy}\n */\nexport function ArkosPolicy<TResource extends string>(\n resource: TResource\n): IArkosPolicy<TResource, never> {\n return buildPolicy(resource, {});\n}\n\nfunction buildPolicy<TResource extends string, TActions extends string>(\n resource: TResource,\n store: Record<string, ArkosPolicyRule>\n): PolicyWithActions<TResource, TActions> {\n const rule = <TAction extends string>(\n action: TAction,\n config: ArkosPolicyRule\n ): PolicyWithActions<TResource, TActions | TAction> => {\n const newStore = { ...store, [action]: config };\n return buildPolicy<TResource, TActions | TAction>(resource, newStore);\n };\n\n const actionEntries = Object.fromEntries(\n Object.entries(store).flatMap(([action, config]) => {\n const authEntry: PolicyAuthEntry<TResource, typeof action> = {\n resource,\n action,\n rule: config,\n };\n\n const checker: PolicyChecker = authService.permission(action, resource, {\n [action]: config || {},\n });\n\n const canKey = `can${action.charAt(0).toUpperCase()}${action.slice(1)}`;\n\n return [\n [action, authEntry],\n [canKey, checker],\n ];\n })\n );\n\n return {\n __type: \"ArkosPolicy\" as const,\n resource,\n rule,\n ...actionEntries,\n } as unknown as PolicyWithActions<TResource, TActions>;\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/arkos-policy/types.ts"],"names":[],"mappings":"","sourcesContent":["import { User } from \"../../types\";\nimport { DetailedAccessControlRule } from \"../../types/auth\";\n\nexport type ArkosPolicyRule = string[] | DetailedAccessControlRule | \"*\";\n\nexport type PolicyAuthEntry<\n TResource extends string,\n TAction extends string,\n> = {\n readonly resource: TResource;\n readonly action: TAction;\n readonly rule: ArkosPolicyRule;\n};\n\nexport type PolicyChecker = (user?: User) => Promise<boolean>;\n\ntype CanKey<TAction extends string> = `can${Capitalize<TAction>}`;\n\nexport type PolicyWithActions<\n TResource extends string,\n TActions extends string,\n> = IArkosPolicy<TResource, TActions> & {\n [K in TActions]: PolicyAuthEntry<TResource, K>;\n} & {\n [K in CanKey<TActions>]: PolicyChecker;\n};\n\nexport interface IArkosPolicy<\n TResource extends string,\n TActions extends string = never,\n> {\n readonly __type: \"ArkosPolicy\";\n readonly resource: TResource;\n\n rule<TAction extends string>(\n action: TAction,\n config?: ArkosPolicyRule\n ): PolicyWithActions<TResource, TActions | TAction>;\n}\n"]}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defineConfig = void 0;
|
|
4
|
-
const define_config_1 = require("../utils/define-config.js");
|
|
5
|
-
Object.defineProperty(exports, "defineConfig", { enumerable: true, get: function () { return define_config_1.defineConfig; } });
|
|
6
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/exports/config.ts"],"names":[],"mappings":";;;AAAA,0DAAsD;AAE7C,6FAFA,4BAAY,OAEA","sourcesContent":["import { defineConfig } from \"../utils/define-config\";\n\nexport { defineConfig };\n"]}
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getAppRoutes = void 0;
|
|
4
|
-
const server_1 = require("../../../../server.js");
|
|
5
|
-
const getAppRoutes = () => {
|
|
6
|
-
const app = (0, server_1.getExpressApp)();
|
|
7
|
-
const routes = [];
|
|
8
|
-
app._router.stack.forEach((middleware) => {
|
|
9
|
-
if (middleware.route) {
|
|
10
|
-
Object.keys(middleware.route.methods).forEach((method) => {
|
|
11
|
-
routes.push({
|
|
12
|
-
method: method.toUpperCase(),
|
|
13
|
-
path: middleware.route.path,
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
else if (middleware.handle && middleware.handle.stack) {
|
|
18
|
-
let basePath = "";
|
|
19
|
-
if (middleware.regexp) {
|
|
20
|
-
const regexpStr = middleware.regexp.toString();
|
|
21
|
-
if (regexpStr.includes?.("/?(?=")) {
|
|
22
|
-
const match = regexpStr.match(/\/\^(\\\/[^?]+)/);
|
|
23
|
-
if (match) {
|
|
24
|
-
basePath = match[1].replace(/\\\//g, "/");
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
const simpleMatch = regexpStr.match(/\/\^(\\\/[^\\]+)/);
|
|
29
|
-
if (simpleMatch) {
|
|
30
|
-
basePath = simpleMatch[1].replace(/\\\//g, "/");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
middleware.handle.stack.forEach((routerMiddleware) => {
|
|
35
|
-
if (routerMiddleware.route) {
|
|
36
|
-
Object.keys(routerMiddleware.route.methods).forEach((method) => {
|
|
37
|
-
let routePath = routerMiddleware.route.path;
|
|
38
|
-
let fullPath;
|
|
39
|
-
if (routePath.includes?.("/?(?=")) {
|
|
40
|
-
const pathMatch = routePath.match(/\/\^?(\\\/[^?]+|\/[^?]+)/);
|
|
41
|
-
if (pathMatch) {
|
|
42
|
-
const cleanPath = pathMatch[1].replace(/\\\//g, "/");
|
|
43
|
-
fullPath = basePath ? basePath + cleanPath : cleanPath;
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
const fallbackMatch = routePath.match(/\?\(\?=([^)]+)/);
|
|
47
|
-
if (fallbackMatch) {
|
|
48
|
-
fullPath = fallbackMatch[1];
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
fullPath = routePath;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
else {
|
|
56
|
-
fullPath = basePath
|
|
57
|
-
? basePath.replace(/\/$/, "") +
|
|
58
|
-
(routePath.startsWith("/") ? routePath : "/" + routePath)
|
|
59
|
-
: routePath;
|
|
60
|
-
}
|
|
61
|
-
fullPath = fullPath
|
|
62
|
-
.replace(/\\\//g, "/")
|
|
63
|
-
.replace(/\^/g, "")
|
|
64
|
-
.replace(/\$/g, "");
|
|
65
|
-
if (fullPath.includes?.("/?(?=")) {
|
|
66
|
-
fullPath = fullPath.replace(/\/\?\(\?=[^)]*\)/g, "");
|
|
67
|
-
}
|
|
68
|
-
routes.push({
|
|
69
|
-
method: method.toUpperCase(),
|
|
70
|
-
path: fullPath,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
return routes;
|
|
78
|
-
};
|
|
79
|
-
exports.getAppRoutes = getAppRoutes;
|
|
80
|
-
//# sourceMappingURL=base.controller.helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.controller.helpers.js","sourceRoot":"","sources":["../../../../../../src/modules/base/utils/helpers/base.controller.helpers.ts"],"names":[],"mappings":"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","sourcesContent":["import { getExpressApp } from \"../../../../server\";\n\nexport const getAppRoutes = () => {\n const app = getExpressApp();\n const routes: { method: string; path: string }[] = [];\n\n app._router.stack.forEach((middleware: any) => {\n if (middleware.route) {\n // Direct routes on the app\n Object.keys(middleware.route.methods).forEach((method) => {\n routes.push({\n method: method.toUpperCase(),\n path: middleware.route.path,\n });\n });\n } else if (middleware.handle && middleware.handle.stack) {\n // Extract the base path from the middleware's regexp pattern\n let basePath = \"\";\n if (middleware.regexp) {\n // Handle pattern like /^\\/api\\/?(?=\\/|$)/i\n const regexpStr = middleware.regexp.toString();\n\n // More robust pattern matching\n if (regexpStr.includes?.(\"/?(?=\")) {\n // Extract everything between the start and the '/?(?=' pattern\n const match = regexpStr.match(/\\/\\^(\\\\\\/[^?]+)/);\n if (match) {\n // Clean up the extracted path\n basePath = match[1].replace(/\\\\\\//g, \"/\");\n }\n } else {\n // Handle other regexp patterns\n const simpleMatch = regexpStr.match(/\\/\\^(\\\\\\/[^\\\\]+)/);\n if (simpleMatch) {\n basePath = simpleMatch[1].replace(/\\\\\\//g, \"/\");\n }\n }\n }\n\n // Process routes in the middleware's router\n middleware.handle.stack.forEach((routerMiddleware: any) => {\n if (routerMiddleware.route) {\n Object.keys(routerMiddleware.route.methods).forEach((method) => {\n let routePath = routerMiddleware.route.path;\n let fullPath;\n\n // Check if routePath already contains regex artifacts\n if (routePath.includes?.(\"/?(?=\")) {\n // Extract the actual path from the regex pattern\n const pathMatch = routePath.match(/\\/\\^?(\\\\\\/[^?]+|\\/[^?]+)/);\n if (pathMatch) {\n const cleanPath = pathMatch[1].replace(/\\\\\\//g, \"/\");\n fullPath = basePath ? basePath + cleanPath : cleanPath;\n } else {\n // If we can't clean it, at least extract what's after '/?(?='\n const fallbackMatch = routePath.match(/\\?\\(\\?=([^)]+)/);\n if (fallbackMatch) {\n fullPath = fallbackMatch[1];\n } else {\n fullPath = routePath; // Use as is if no pattern matches\n }\n }\n } else {\n // Normal path joining\n fullPath = basePath\n ? basePath.replace(/\\/$/, \"\") +\n (routePath.startsWith(\"/\") ? routePath : \"/\" + routePath)\n : routePath;\n }\n\n // Clean up any remaining regex artifacts\n fullPath = fullPath\n .replace(/\\\\\\//g, \"/\")\n .replace(/\\^/g, \"\")\n .replace(/\\$/g, \"\");\n\n // Remove any \"/?(?=\" patterns that might remain\n if (fullPath.includes?.(\"/?(?=\")) {\n fullPath = fullPath.replace(/\\/\\?\\(\\?=[^)]*\\)/g, \"\");\n }\n\n routes.push({\n method: method.toUpperCase(),\n path: fullPath,\n });\n });\n }\n });\n }\n });\n\n return routes;\n};\n"]}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
class BuiltInRoutePathObjectManager {
|
|
4
|
-
}
|
|
5
|
-
const builtInRoutePathObjectManager = new BuiltInRoutePathObjectManager();
|
|
6
|
-
exports.default = builtInRoutePathObjectManager;
|
|
7
|
-
//# sourceMappingURL=built-in-route-path-object-manager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"built-in-route-path-object-manager.js","sourceRoot":"","sources":["../../../../../src/modules/swagger/utils/built-in-route-path-object-manager.ts"],"names":[],"mappings":";;AAAA,MAAM,6BAA6B;CAAG;AAEtC,MAAM,6BAA6B,GAAG,IAAI,6BAA6B,EAAE,CAAC;AAE1E,kBAAe,6BAA6B,CAAC","sourcesContent":["class BuiltInRoutePathObjectManager {}\n\nconst builtInRoutePathObjectManager = new BuiltInRoutePathObjectManager();\n\nexport default builtInRoutePathObjectManager;\n"]}
|