daevin 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- package/Daevin_test/.editorconfig +15 -0
- package/Daevin_test/.env.example +92 -0
- package/Daevin_test/.gitattributes +10 -0
- package/Daevin_test/CODE_OF_CONDUCT.md +3 -0
- package/Daevin_test/CONTRIBUTING.md +3 -0
- package/Daevin_test/LICENSE +21 -0
- package/Daevin_test/README.md +314 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/ApiLoginProxyForWebClientAction.php +52 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/ApiLogoutAction.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/ApiRefreshProxyForWebClientAction.php +47 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/ForgotPasswordAction.php +43 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/GetAuthenticatedUserAction.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/RegisterUserAction.php +39 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/ResetPasswordAction.php +61 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/SendVerificationEmailAction.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/VerifyEmailAction.php +43 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/WebLoginAction.php +46 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Actions/WebLogoutAction.php +17 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Classes/LoginCustomAttribute.php +97 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Configs/appSection-authentication.php +117 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Exceptions/EmailNotVerifiedException.php +12 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Exceptions/InvalidEmailVerificationDataException.php +12 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Exceptions/InvalidResetPasswordTokenException.php +12 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Exceptions/LoginFailedException.php +12 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Exceptions/RefreshTokenMissingException.php +12 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Mails/ForgotPassword.php +32 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Mails/Templates/forgot-password.blade.php +73 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Middlewares/RedirectIfAuthenticated.php +35 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Notifications/EmailVerified.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Notifications/PasswordReset.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Notifications/VerifyEmail.php +49 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Notifications/Welcome.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Providers/AuthServiceProvider.php +76 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Providers/MainServiceProvider.php +32 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Providers/MiddlewareServiceProvider.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/README.md +1 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tasks/CallOAuthServerTask.php +36 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tasks/CreatePasswordResetTokenTask.php +14 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tasks/CreateUserByCredentialsTask.php +34 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tasks/LoginTask.php +14 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tasks/MakeRefreshCookieTask.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tasks/SendVerificationEmailTask.php +16 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Stubs/oauth-private.key +51 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Stubs/oauth-public.key +14 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/TestCase.php +18 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/CreatePasswordResetTokenTaskTest.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/CreateUserByCredentialsTaskTest.php +42 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/ForgotPasswordActionTest.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/LoginCustomAttributeTest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/RedirectIfAuthenticatedMiddlewareTest.php +44 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/RegisterUserActionTest.php +64 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/ResetPasswordActionTest.php +83 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/SendVerificationEmailTaskTest.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Tests/Unit/WebLoginActionTest.php +75 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/Traits/AuthenticationTrait.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/ForgotPasswordController.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/GetAuthenticatedUserController.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/LoginProxyForWebClientController.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/LogoutController.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/RefreshProxyForWebClientController.php +35 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/RegisterUserController.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/ResetPasswordController.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/SendVerificationEmailController.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Controllers/VerifyEmailController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/ForgotPasswordRequest.php +50 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/GetAuthenticatedUserRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/LoginProxyPasswordGrantRequest.php +57 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/LogoutRequest.php +51 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/RefreshProxyRequest.php +51 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/RegisterUserRequest.php +61 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/ResetPasswordRequest.php +55 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/SendVerificationEmailRequest.php +56 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Requests/VerifyEmailRequest.php +51 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/ForgotPassword.v1.public.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/GetAuthenticatedUser.v1.private.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/LoginProxyForWebClient.v1.public.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/LoginUsingCredentialGrant.v1.public.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/LoginUsingPasswordGrant.v1.private.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/Logout.v1.public.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/RefreshProxyForWebClient.v1.public.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/RegisterUser.v1.private.php +38 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/ResetPassword.v1.public.php +37 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/SendVerificationEmail.v1.public.php +32 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Routes/VerifyEmail.v1.public.php +35 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/ApiTestCase.php +74 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/ApiLoginProxyForWebClientTest.php +129 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/ApiLogoutTest.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/ApiRefreshProxyForWebClientTest.php +86 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/ForgotPasswordTest.php +56 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/GetAuthenticatedUserTest.php +76 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/RegisterUserTest.php +208 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/ResetPasswordTest.php +79 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/SendVerificationEmailTest.php +95 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/Stubs/oauth-private.key +51 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/Stubs/oauth-public.key +14 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/API/Tests/Functional/VerifyEmailTest.php +84 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Controllers/LoginController.php +39 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Controllers/LogoutController.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Requests/LoginRequest.php +54 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Requests/LogoutRequest.php +50 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Routes/GetLogin.v1.public.php +8 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Routes/PostLogin.v1.public.php +8 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Routes/PostLogout.php +7 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/UI/WEB/Views/login.blade.php +121 -0
- package/Daevin_test/app/Containers/AppSection/Authentication/composer.json +11 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/AssignRolesToUserAction.php +32 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/AttachPermissionsToRoleAction.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/AttachPermissionsToUserAction.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/CreatePermissionAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/CreateRoleAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/DeleteRoleAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/DetachPermissionsFromRoleAction.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/DetachPermissionsFromUserAction.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/FindPermissionAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/FindRoleAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/GetAllPermissionsAction.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/GetAllRolesAction.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/GetRolePermissionsAction.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/GetUserPermissionsAction.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/GetUserRolesAction.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/RevokeRolesFromUserAction.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/SyncPermissionsOnRoleAction.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Actions/SyncUserRolesAction.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Configs/appSection-authorization.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Configs/permission.php +161 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Factories/PermissionFactory.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Factories/RoleFactory.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Migrations/2016_12_29_201047_create_permission_tables.php +141 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Migrations/2017_04_22_122453_add_extra_fields_to_permissions_tale.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Migrations/2017_04_22_122522_add_extra_fields_to_roles_table.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Repositories/PermissionRepository.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Repositories/RoleRepository.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationDefaultUsersSeeder_4.php +36 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationGivePermissionsToRolesSeeder_3.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationPermissionsSeeder_1.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Data/Seeders/AuthorizationRolesSeeder_2.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Models/Permission.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Models/Role.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Providers/MainServiceProvider.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/README.md +1 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/AssignRolesToUserTask.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/CreatePermissionTask.php +41 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/CreateRoleTask.php +41 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/DeleteRoleTask.php +35 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/DetachPermissionsFromRoleTask.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/DetachPermissionsFromUserTask.php +24 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/FindPermissionTask.php +49 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/FindRoleTask.php +49 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/GetAllPermissionsTask.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/GetAllRolesTask.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tasks/RevokeRoleFromUserTask.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/TestCase.php +18 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/CreatePermissionTaskTest.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/CreateRoleTaskTest.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/DeleteRoleTaskTest.php +36 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/FindPermissionTaskTest.php +44 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/FindRoleTaskTest.php +44 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/PermissionFactoryTest.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/PermissionMigrationTest.php +95 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Tests/Unit/RoleFactoryTest.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Traits/AuthorizationTrait.php +11 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/Traits/IsResourceOwnerTrait.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/AssignRolesToUserController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/AttachPermissionsToRoleController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/AttachPermissionsToUserController.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/CreateRoleController.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/DeleteRoleController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/DetachPermissionsFromRoleController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/DetachPermissionsFromUserController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/FindPermissionController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/FindRoleController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/GetAllPermissionsController.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/GetAllRolesController.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/GetRolePermissionsController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/GetUserPermissionsController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/GetUserRolesController.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/RevokeRolesFromUserController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/SyncPermissionOnRoleController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Controllers/SyncUserRolesController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/AssignRolesToUserRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/AttachPermissionsToRoleRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/AttachPermissionsToUserRequest.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/CreateRoleRequest.php +47 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/DeleteRoleRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/DetachPermissionsFromRoleRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/DetachPermissionsFromUserRequest.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/FindPermissionRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/FindRoleRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/GetAllPermissionsRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/GetAllRolesRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/GetRolePermissionsRequest.php +51 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/GetUserPermissionsRequest.php +51 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/GetUserRolesRequest.php +51 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/RevokeRolesFromUserRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/SyncPermissionsOnRoleRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Requests/SyncUserRolesRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/AssignRolesToUser.v1.private.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/AttachPermissionsToRole.v1.private.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/AttachPermissionsToUser.v1.private.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/CreateRole.v1.private.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/DeleteRole.v1.private.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/DetachPermissionsFromRole.v1.private.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/DetachPermissionsFromUser.v1.private.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/FindPermission.v1.private.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/FindRole.v1.private.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/GetAllPermissions.v1.private.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/GetAllRoles.v1.private.php +21 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/GetRolePermissions.v1.private.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/GetUserPermissions.v1.private.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/GetUserRoles.v1.private.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/RevokeRolesFromUser.v1.private.php +29 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/SyncPermissionOnRole.v1.private.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/SyncUserRoles.v1.private.php +27 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/_permission.v1.public.php +25 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/_role.v1.public.php +43 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Routes/_userPermissions.v1.public.php +48 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/ApiTestCase.php +15 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/AssignRolesToUserTest.php +71 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/AttachPermissionToUserTest.php +114 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/AttachPermissionsToRoleTest.php +115 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/CreateRoleTest.php +65 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/DeleteRoleTest.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/DetachPermissionFromUserTest.php +120 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/DetachPermissionsFromRoleTest.php +115 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/FindPermissionTest.php +42 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/FindRoleTest.php +42 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/GetAllPermissionsTest.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/GetAllRolesTest.php +32 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/GetRolePermissionsTest.php +39 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/GetUserPermissionsTest.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/GetUserRolesTest.php +40 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/RevokeRolesFromUserTest.php +115 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/SyncPermissionsOnRoleTest.php +92 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Tests/Functional/SyncUserRolesTest.php +93 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Transformers/PermissionTransformer.php +28 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/API/Transformers/RoleTransformer.php +34 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/WEB/Controllers/UnauthorizedController.php +19 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/WEB/Requests/UnauthorizedRequest.php +49 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/WEB/Routes/GetUnauthorized.php +7 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/UI/WEB/Views/unauthorized.blade.php +43 -0
- package/Daevin_test/app/Containers/AppSection/Authorization/composer.json +11 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Actions/CreatePostsAction.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Actions/DeletePostsAction.php +18 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Actions/FindPostsByIdAction.php +18 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Actions/GetAllPostsAction.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Actions/UpdatePostsAction.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Configs/appSection-posts.php +14 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Data/Factories/PostsFactory.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Data/Migrations/2023_2_19_55939_create_posts_migration.php +30 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Data/Repositories/PostsRepository.php +17 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Models/Posts.php +42 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Posts.json +7 -0
- package/Daevin_test/app/Containers/AppSection/Posts/README.md +194 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Tasks/CreatePostsTask.php +34 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Tasks/DeletePostsTask.php +35 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Tasks/FindPostsByIdTask.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Tasks/GetAllPostsTask.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Posts/Tasks/UpdatePostsTask.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Controllers/Controller.php +94 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Requests/CreatePostsRequest.php +54 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Requests/DeletePostsRequest.php +54 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Requests/FindPostsByIdRequest.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Requests/GetAllPostsRequest.php +54 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Requests/UpdatePostsRequest.php +56 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Routes/CreatePostsRoute.v1.private.php +52 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Routes/DeletePostsRoute.v1.private.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Routes/FindPostsByIdRoute.v1.private.php +52 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Routes/GetAllPostsRoute.v1.private.php +74 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Routes/UpdatePostsRoute.v1.private.php +52 -0
- package/Daevin_test/app/Containers/AppSection/Posts/UI/API/Transformers/PostsTransformer.php +49 -0
- package/Daevin_test/app/Containers/AppSection/Posts/composer.json +7 -0
- package/Daevin_test/app/Containers/AppSection/User/Actions/CreateAdminAction.php +39 -0
- package/Daevin_test/app/Containers/AppSection/User/Actions/DeleteUserAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/User/Actions/FindUserByIdAction.php +22 -0
- package/Daevin_test/app/Containers/AppSection/User/Actions/GetAllUsersAction.php +21 -0
- package/Daevin_test/app/Containers/AppSection/User/Actions/UpdateUserAction.php +33 -0
- package/Daevin_test/app/Containers/AppSection/User/Actions/UpdateUserPasswordAction.php +35 -0
- package/Daevin_test/app/Containers/AppSection/User/Configs/appSection-user.php +5 -0
- package/Daevin_test/app/Containers/AppSection/User/Data/Factories/UserFactory.php +44 -0
- package/Daevin_test/app/Containers/AppSection/User/Data/Migrations/2000_01_01_000001_create_users_table.php +34 -0
- package/Daevin_test/app/Containers/AppSection/User/Data/Migrations/2000_01_01_000002_create_password_resets_table.php +28 -0
- package/Daevin_test/app/Containers/AppSection/User/Data/Repositories/UserRepository.php +21 -0
- package/Daevin_test/app/Containers/AppSection/User/Data/Seeders/UserPermissionsSeeder_1.php +26 -0
- package/Daevin_test/app/Containers/AppSection/User/Models/User.php +58 -0
- package/Daevin_test/app/Containers/AppSection/User/Notifications/PasswordUpdatedNotification.php +28 -0
- package/Daevin_test/app/Containers/AppSection/User/Providers/MainServiceProvider.php +39 -0
- package/Daevin_test/app/Containers/AppSection/User/README.md +1 -0
- package/Daevin_test/app/Containers/AppSection/User/Tasks/DeleteUserTask.php +35 -0
- package/Daevin_test/app/Containers/AppSection/User/Tasks/FindUserByEmailTask.php +28 -0
- package/Daevin_test/app/Containers/AppSection/User/Tasks/FindUserByIdTask.php +31 -0
- package/Daevin_test/app/Containers/AppSection/User/Tasks/GetAllUsersTask.php +26 -0
- package/Daevin_test/app/Containers/AppSection/User/Tasks/UpdateUserTask.php +42 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/TestCase.php +18 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/CreateAdminActionTest.php +50 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/DeleteUserTaskTest.php +35 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/FindUserByIdTaskTest.php +35 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/PasswordResetsMigrationTest.php +28 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/UpdateUserTaskTest.php +52 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/UserFactoryTest.php +36 -0
- package/Daevin_test/app/Containers/AppSection/User/Tests/Unit/UsersMigrationTest.php +34 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Controllers/DeleteUserController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Controllers/FindUserByIdController.php +26 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Controllers/GetAllUsersController.php +28 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Controllers/UpdateUserController.php +30 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Controllers/UpdateUserPasswordController.php +30 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Requests/DeleteUserRequest.php +48 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Requests/FindUserByIdRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Requests/GetAllUsersRequest.php +45 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Requests/UpdateUserPasswordRequest.php +56 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Requests/UpdateUserRequest.php +50 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Routes/DeleteUser.v1.private.php +26 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Routes/FindUserById.v1.private.php +24 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Routes/GetAllUsers.v1.private.php +23 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Routes/UpdateUser.v1.private.php +27 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Routes/UpdateUserPassword.v1.private.php +36 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Routes/_user.v1.public.php +25 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Tests/ApiTestCase.php +15 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Tests/Functional/DeleteUserTest.php +50 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Tests/Functional/FindUserByIdTest.php +80 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Tests/Functional/GetAllUsersTest.php +88 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Tests/Functional/UpdateUserPasswordTest.php +126 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Tests/Functional/UpdateUserTest.php +80 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/API/Transformers/UserTransformer.php +52 -0
- package/Daevin_test/app/Containers/AppSection/User/UI/CLI/Commands/CreateAdminCommand.php +37 -0
- package/Daevin_test/app/Containers/AppSection/User/composer.json +7 -0
- package/Daevin_test/app/Containers/AppSection/Users/Actions/CreateUsersAction.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Users/Actions/DeleteUsersAction.php +18 -0
- package/Daevin_test/app/Containers/AppSection/Users/Actions/FindUsersByIdAction.php +18 -0
- package/Daevin_test/app/Containers/AppSection/Users/Actions/GetAllUsersAction.php +23 -0
- package/Daevin_test/app/Containers/AppSection/Users/Actions/UpdateUsersAction.php +26 -0
- package/Daevin_test/app/Containers/AppSection/Users/Configs/appSection-users.php +14 -0
- package/Daevin_test/app/Containers/AppSection/Users/Data/Factories/UsersFactory.php +22 -0
- package/Daevin_test/app/Containers/AppSection/Users/Data/Migrations/2023_2_19_55939_create_users_migration.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Users/Data/Repositories/UsersRepository.php +17 -0
- package/Daevin_test/app/Containers/AppSection/Users/Models/Users.php +44 -0
- package/Daevin_test/app/Containers/AppSection/Users/README.md +194 -0
- package/Daevin_test/app/Containers/AppSection/Users/Tasks/CreateUsersTask.php +34 -0
- package/Daevin_test/app/Containers/AppSection/Users/Tasks/DeleteUsersTask.php +35 -0
- package/Daevin_test/app/Containers/AppSection/Users/Tasks/FindUsersByIdTask.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Users/Tasks/GetAllUsersTask.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Users/Tasks/UpdateUsersTask.php +33 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Controllers/Controller.php +94 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Requests/CreateUsersRequest.php +55 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Requests/DeleteUsersRequest.php +54 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Requests/FindUsersByIdRequest.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Requests/GetAllUsersRequest.php +54 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Requests/UpdateUsersRequest.php +57 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Routes/CreateUsersRoute.v1.private.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Routes/DeleteUsersRoute.v1.private.php +31 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Routes/FindUsersByIdRoute.v1.private.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Routes/GetAllUsersRoute.v1.private.php +75 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Routes/UpdateUsersRoute.v1.private.php +53 -0
- package/Daevin_test/app/Containers/AppSection/Users/UI/API/Transformers/UsersTransformer.php +49 -0
- package/Daevin_test/app/Containers/AppSection/Users/Users.json +7 -0
- package/Daevin_test/app/Containers/AppSection/Users/composer.json +7 -0
- package/Daevin_test/app/Ship/Broadcasts/channels.php +16 -0
- package/Daevin_test/app/Ship/Commands/HelloWorldCommand.php +32 -0
- package/Daevin_test/app/Ship/Commands/closures.php +19 -0
- package/Daevin_test/app/Ship/Configs/apiato.php +185 -0
- package/Daevin_test/app/Ship/Configs/debugbar.php +275 -0
- package/Daevin_test/app/Ship/Configs/fractal.php +43 -0
- package/Daevin_test/app/Ship/Configs/hashids.php +54 -0
- package/Daevin_test/app/Ship/Configs/ide-helper.php +319 -0
- package/Daevin_test/app/Ship/Configs/notification.php +16 -0
- package/Daevin_test/app/Ship/Configs/repository.php +250 -0
- package/Daevin_test/app/Ship/Contracts/MustVerifyEmail.php +14 -0
- package/Daevin_test/app/Ship/Criterias/CreatedTodayCriteria.php +15 -0
- package/Daevin_test/app/Ship/Criterias/GroupByCriteria.php +21 -0
- package/Daevin_test/app/Ship/Criterias/IsNullCriteria.php +21 -0
- package/Daevin_test/app/Ship/Criterias/NotNullCriteria.php +21 -0
- package/Daevin_test/app/Ship/Criterias/OrderByCreationDateAscendingCriteria.php +14 -0
- package/Daevin_test/app/Ship/Criterias/OrderByCreationDateDescendingCriteria.php +14 -0
- package/Daevin_test/app/Ship/Criterias/OrderByFieldCriteria.php +37 -0
- package/Daevin_test/app/Ship/Criterias/OrderByNameCriteria.php +14 -0
- package/Daevin_test/app/Ship/Criterias/OrderByUpdateDateAscendingCriteria.php +14 -0
- package/Daevin_test/app/Ship/Criterias/OrderByUpdateDateDescendingCriteria.php +14 -0
- package/Daevin_test/app/Ship/Criterias/ThisBetweenDatesCriteria.php +21 -0
- package/Daevin_test/app/Ship/Criterias/ThisEqualThatCriteria.php +20 -0
- package/Daevin_test/app/Ship/Criterias/ThisLikeThatCriteria.php +35 -0
- package/Daevin_test/app/Ship/Criterias/ThisUserCriteria.php +19 -0
- package/Daevin_test/app/Ship/Events/.gitkeep +0 -0
- package/Daevin_test/app/Ship/Exceptions/CreateResourceFailedException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/DeleteResourceFailedException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/EmailIsMissedException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/Handlers/ExceptionsHandler.php +107 -0
- package/Daevin_test/app/Ship/Exceptions/InternalErrorException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/NotAuthorizedResourceException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/NotFoundException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/NotImplementedException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/UnsupportedFractalSerializerException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/UpdateResourceFailedException.php +12 -0
- package/Daevin_test/app/Ship/Exceptions/ValidationFailedException.php +12 -0
- package/Daevin_test/app/Ship/Generators/CustomStubs/.gitkeep +0 -0
- package/Daevin_test/app/Ship/Helpers/helpers.php +12 -0
- package/Daevin_test/app/Ship/Kernels/ConsoleKernel.php +46 -0
- package/Daevin_test/app/Ship/Kernels/HttpKernel.php +113 -0
- package/Daevin_test/app/Ship/Listeners/.gitkeep +0 -0
- package/Daevin_test/app/Ship/Mails/.gitkeep +0 -0
- package/Daevin_test/app/Ship/Mails/Templates/.gitkeep +0 -0
- package/Daevin_test/app/Ship/Middlewares/Authenticate.php +16 -0
- package/Daevin_test/app/Ship/Middlewares/EncryptCookies.php +17 -0
- package/Daevin_test/app/Ship/Middlewares/PreventRequestsDuringMaintenance.php +17 -0
- package/Daevin_test/app/Ship/Middlewares/TrimStrings.php +19 -0
- package/Daevin_test/app/Ship/Middlewares/TrustHosts.php +20 -0
- package/Daevin_test/app/Ship/Middlewares/TrustProxies.php +28 -0
- package/Daevin_test/app/Ship/Middlewares/VerifyCsrfToken.php +17 -0
- package/Daevin_test/app/Ship/Migrations/2017_09_12_174826_create_notifications_table.php +35 -0
- package/Daevin_test/app/Ship/Migrations/2019_08_19_000000_create_failed_jobs_table.php +36 -0
- package/Daevin_test/app/Ship/Migrations/2021_03_01_150940_create_jobs_table.php +39 -0
- package/Daevin_test/app/Ship/Notifications/.gitkeep +0 -0
- package/Daevin_test/app/Ship/Parents/Actions/Action.php +10 -0
- package/Daevin_test/app/Ship/Parents/Actions/SubAction.php +10 -0
- package/Daevin_test/app/Ship/Parents/Commands/ConsoleCommand.php +10 -0
- package/Daevin_test/app/Ship/Parents/Controllers/ApiController.php +10 -0
- package/Daevin_test/app/Ship/Parents/Controllers/WebController.php +10 -0
- package/Daevin_test/app/Ship/Parents/Criterias/Criteria.php +10 -0
- package/Daevin_test/app/Ship/Parents/Events/Event.php +10 -0
- package/Daevin_test/app/Ship/Parents/Exceptions/Exception.php +10 -0
- package/Daevin_test/app/Ship/Parents/Factories/Factory.php +10 -0
- package/Daevin_test/app/Ship/Parents/Jobs/Job.php +25 -0
- package/Daevin_test/app/Ship/Parents/Listeners/Listener.php +10 -0
- package/Daevin_test/app/Ship/Parents/Mails/Mail.php +10 -0
- package/Daevin_test/app/Ship/Parents/Middlewares/Middleware.php +10 -0
- package/Daevin_test/app/Ship/Parents/Models/Model.php +11 -0
- package/Daevin_test/app/Ship/Parents/Models/UserModel.php +17 -0
- package/Daevin_test/app/Ship/Parents/Notifications/Notification.php +10 -0
- package/Daevin_test/app/Ship/Parents/Policies/Policy.php +26 -0
- package/Daevin_test/app/Ship/Parents/Providers/AuthServiceProvider.php +20 -0
- package/Daevin_test/app/Ship/Parents/Providers/BroadcastServiceProvider.php +26 -0
- package/Daevin_test/app/Ship/Parents/Providers/EventServiceProvider.php +40 -0
- package/Daevin_test/app/Ship/Parents/Providers/MainServiceProvider.php +24 -0
- package/Daevin_test/app/Ship/Parents/Providers/MiddlewareServiceProvider.php +16 -0
- package/Daevin_test/app/Ship/Parents/Providers/RouteServiceProvider.php +24 -0
- package/Daevin_test/app/Ship/Parents/Repositories/Repository.php +10 -0
- package/Daevin_test/app/Ship/Parents/Requests/Request.php +10 -0
- package/Daevin_test/app/Ship/Parents/Seeders/Seeder.php +10 -0
- package/Daevin_test/app/Ship/Parents/Tasks/Task.php +10 -0
- package/Daevin_test/app/Ship/Parents/Tests/PhpUnit/TestCase.php +51 -0
- package/Daevin_test/app/Ship/Parents/Transformers/Transformer.php +25 -0
- package/Daevin_test/app/Ship/Parents/Values/Value.php +9 -0
- package/Daevin_test/app/Ship/Providers/RouteServiceProvider.php +35 -0
- package/Daevin_test/app/Ship/Providers/ShipProvider.php +44 -0
- package/Daevin_test/app/Ship/Seeders/SeedDeploymentData.php +18 -0
- package/Daevin_test/app/Ship/Seeders/SeedTestingData.php +18 -0
- package/Daevin_test/app/Ship/Tests/TestCase.php +10 -0
- package/Daevin_test/app/Ship/composer.json +21 -0
- package/Daevin_test/artisan +53 -0
- package/Daevin_test/bootstrap/app.php +55 -0
- package/Daevin_test/bootstrap/cache/.gitignore +2 -0
- package/Daevin_test/composer.json +112 -0
- package/Daevin_test/composer.lock +12696 -0
- package/Daevin_test/config/app.php +206 -0
- package/Daevin_test/config/auth.php +117 -0
- package/Daevin_test/config/broadcasting.php +67 -0
- package/Daevin_test/config/cache.php +110 -0
- package/Daevin_test/config/cors.php +34 -0
- package/Daevin_test/config/database.php +151 -0
- package/Daevin_test/config/filesystems.php +76 -0
- package/Daevin_test/config/hashing.php +52 -0
- package/Daevin_test/config/logging.php +119 -0
- package/Daevin_test/config/mail.php +117 -0
- package/Daevin_test/config/queue.php +93 -0
- package/Daevin_test/config/services.php +34 -0
- package/Daevin_test/config/session.php +201 -0
- package/Daevin_test/config/view.php +36 -0
- package/Daevin_test/database/factories/ModelFactory.php +4 -0
- package/Daevin_test/database/migrations/.gitkeep +0 -0
- package/Daevin_test/database/seeders/DatabaseSeeder.php +24 -0
- package/Daevin_test/lang/ar/auth.php +19 -0
- package/Daevin_test/lang/ar/pagination.php +19 -0
- package/Daevin_test/lang/ar/passwords.php +22 -0
- package/Daevin_test/lang/ar/validation.php +149 -0
- package/Daevin_test/lang/en/auth.php +20 -0
- package/Daevin_test/lang/en/pagination.php +19 -0
- package/Daevin_test/lang/en/passwords.php +22 -0
- package/Daevin_test/lang/en/validation.php +169 -0
- package/Daevin_test/lang/es/auth.php +19 -0
- package/Daevin_test/lang/es/pagination.php +19 -0
- package/Daevin_test/lang/es/passwords.php +22 -0
- package/Daevin_test/lang/es/validation.php +149 -0
- package/Daevin_test/lang/fa/auth.php +18 -0
- package/Daevin_test/lang/fa/pagination.php +17 -0
- package/Daevin_test/lang/fa/passwords.php +20 -0
- package/Daevin_test/lang/fa/validation.php +182 -0
- package/Daevin_test/lang/fr/auth.php +19 -0
- package/Daevin_test/lang/fr/pagination.php +19 -0
- package/Daevin_test/lang/fr/passwords.php +22 -0
- package/Daevin_test/lang/fr/validation.php +149 -0
- package/Daevin_test/package-lock.json +10031 -0
- package/Daevin_test/package.json +19 -0
- package/Daevin_test/php_cs.dist.php +39 -0
- package/Daevin_test/phpspec.yml +5 -0
- package/Daevin_test/phpunit.xml +38 -0
- package/Daevin_test/psalm.dist.xml +18 -0
- package/Daevin_test/public/.htaccess +21 -0
- package/Daevin_test/public/favicon.ico +0 -0
- package/Daevin_test/public/index.php +55 -0
- package/Daevin_test/public/robots.txt +2 -0
- package/Daevin_test/public/web.config +28 -0
- package/Daevin_test/resources/css/app.css +0 -0
- package/Daevin_test/resources/js/app.js +1 -0
- package/Daevin_test/resources/js/bootstrap.js +28 -0
- package/Daevin_test/resources/views/.gitkeep +0 -0
- package/Daevin_test/server.php +21 -0
- package/Daevin_test/storage/app/.gitignore +3 -0
- package/Daevin_test/storage/app/public/.gitignore +2 -0
- package/Daevin_test/storage/debugbar/.gitignore +2 -0
- package/Daevin_test/storage/framework/cache/.gitignore +2 -0
- package/Daevin_test/storage/framework/sessions/.gitignore +2 -0
- package/Daevin_test/storage/framework/testing/.gitignore +2 -0
- package/Daevin_test/storage/framework/views/.gitignore +2 -0
- package/Daevin_test/storage/logs/.gitignore +2 -0
- package/Daevin_test/webpack.mix.js +17 -0
- package/bin/classes/Apiato/index.js +208 -0
- package/bin/classes/Containers/Action.js +169 -0
- package/bin/classes/Containers/ComposerJSON.js +27 -0
- package/bin/classes/Containers/Config.js +39 -0
- package/bin/classes/Containers/Controller.js +120 -0
- package/bin/classes/Containers/Factory.js +47 -0
- package/bin/classes/Containers/Migration.js +80 -0
- package/bin/classes/Containers/Model.js +126 -0
- package/bin/classes/Containers/ReadMe.js +212 -0
- package/bin/classes/Containers/Repository.js +54 -0
- package/bin/classes/Containers/Request.js +341 -0
- package/bin/classes/Containers/Route.js +336 -0
- package/bin/classes/Containers/Task.js +225 -0
- package/bin/classes/Containers/Transformer.js +94 -0
- package/bin/classes/Helpers.js +150 -0
- package/bin/classes/tes.js +0 -0
- package/bin/constants.js +11 -0
- package/bin/core/output.json +13 -0
- package/bin/core/schemaToSql.js +118 -0
- package/bin/core/sqlToSchema.js +206 -0
- package/bin/index.js +103 -0
- package/dbconfig.json +74 -0
- package/package.json +39 -0
@@ -0,0 +1,336 @@
|
|
1
|
+
import Helpers from "../Helpers.js";
|
2
|
+
import chalk from "chalk";
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
class Route{
|
7
|
+
|
8
|
+
PROJECT_DIR = ''
|
9
|
+
static generateRoutesFolder(table,PROJECT_DIR){
|
10
|
+
console.log(`${chalk.yellow.bold(Helpers.capitalise(table.table_name))} : ${chalk.green.bold('Route ')} : Generating Route Files`)
|
11
|
+
Route.PROJECT_DIR = PROJECT_DIR;
|
12
|
+
|
13
|
+
Helpers.createPath(`${Route.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Routes`);
|
14
|
+
this.generateAllRouteFiles(table);
|
15
|
+
}
|
16
|
+
|
17
|
+
static generateAllRouteFiles(table){
|
18
|
+
|
19
|
+
this.generateCreateRouteFile(table);
|
20
|
+
this.generateUpdateRouteFile(table);
|
21
|
+
this.generateDeleteRouteFile(table);
|
22
|
+
this.generateFindByIdRouteFile(table);
|
23
|
+
this.generateGetAllRouteFile(table);
|
24
|
+
}
|
25
|
+
|
26
|
+
static generateCreateRouteFile(table) {
|
27
|
+
|
28
|
+
let file_data = `<?php
|
29
|
+
|
30
|
+
/**
|
31
|
+
* @apiGroup ${Helpers.capitalise(table.table_name)}
|
32
|
+
* @apiName Create${Helpers.capitalise(table.table_name)}
|
33
|
+
*
|
34
|
+
* @api {POST} /v1/${table.table_name} Create ${Helpers.capitalise(table.table_name)}
|
35
|
+
* @apiDescription Create a new ${Helpers.capitalise(table.table_name)}
|
36
|
+
*
|
37
|
+
* @apiVersion 1.0.0
|
38
|
+
* @apiPermission Authenticated ['permissions' => '', 'roles' => '']
|
39
|
+
*
|
40
|
+
* @apiHeader {String} accept=application/json
|
41
|
+
* @apiHeader {String} authorization=Bearer
|
42
|
+
*
|
43
|
+
${this.getRouteBody(table)}
|
44
|
+
*
|
45
|
+
* @apiSuccessExample {json} Success-Response:
|
46
|
+
* HTTP/1.1 200 OK
|
47
|
+
* {
|
48
|
+
* {
|
49
|
+
* "data": {
|
50
|
+
* "object": "${Helpers.capitalise(table.table_name)}",
|
51
|
+
* "id": "NxOpZowo9GmjKqdR",
|
52
|
+
* "deleted_at": null,
|
53
|
+
* "deleted_by": null,
|
54
|
+
* "updated_by": null,
|
55
|
+
* "created_at": "2021-12-24T11:57:37.000000Z",
|
56
|
+
* "updated_at": "2022-05-03T07:03:00.000000Z",
|
57
|
+
* "readable_created_at": "1 year ago",
|
58
|
+
* "readable_updated_at": "9 months ago",
|
59
|
+
* "real_id": 1
|
60
|
+
* },
|
61
|
+
* "meta": {
|
62
|
+
* "include": [],
|
63
|
+
* "custom": [],
|
64
|
+
* }
|
65
|
+
* }
|
66
|
+
* }
|
67
|
+
*/
|
68
|
+
|
69
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\UI\\API\\Controllers\\Controller;
|
70
|
+
use Illuminate\\Support\\Facades\\Route;
|
71
|
+
|
72
|
+
Route::post('${table.table_name}', [Controller::class, 'create${Helpers.capitalise(table.table_name)}'])
|
73
|
+
->middleware(['auth:api']);
|
74
|
+
|
75
|
+
|
76
|
+
`;
|
77
|
+
|
78
|
+
Helpers.writeToFile(`${Route.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Routes`, `Create${Helpers.capitalise(table.table_name)}Route.v1.private.php`, file_data)
|
79
|
+
|
80
|
+
|
81
|
+
}
|
82
|
+
|
83
|
+
static generateUpdateRouteFile(table) {
|
84
|
+
|
85
|
+
let file_data = `<?php
|
86
|
+
|
87
|
+
/**
|
88
|
+
* @apiGroup ${Helpers.capitalise(table.table_name)}
|
89
|
+
* @apiName Update${Helpers.capitalise(table.table_name)}
|
90
|
+
*
|
91
|
+
* @api {PATCH} /v1/${table.table_name}/:id Update ${Helpers.capitalise(table.table_name)}
|
92
|
+
* @apiDescription Update a ${Helpers.capitalise(table.table_name)} by its id
|
93
|
+
*
|
94
|
+
* @apiVersion 1.0.0
|
95
|
+
* @apiPermission Authenticated ['permissions' => '', 'roles' => '']
|
96
|
+
*
|
97
|
+
* @apiHeader {String} accept=application/json
|
98
|
+
* @apiHeader {String} authorization=Bearer
|
99
|
+
*
|
100
|
+
${this.getRouteBody(table)}
|
101
|
+
*
|
102
|
+
* @apiSuccessExample {json} Success-Response:
|
103
|
+
* HTTP/1.1 200 OK
|
104
|
+
* {
|
105
|
+
* {
|
106
|
+
* "data": {
|
107
|
+
* "object": "${Helpers.capitalise(table.table_name)}",
|
108
|
+
* "id": "NxOpZowo9GmjKqdR",
|
109
|
+
* "deleted_at": null,
|
110
|
+
* "deleted_by": null,
|
111
|
+
* "updated_by": null,
|
112
|
+
* "created_at": "2021-12-24T11:57:37.000000Z",
|
113
|
+
* "updated_at": "2022-05-03T07:03:00.000000Z",
|
114
|
+
* "readable_created_at": "1 year ago",
|
115
|
+
* "readable_updated_at": "9 months ago",
|
116
|
+
* "real_id": 1
|
117
|
+
* },
|
118
|
+
* "meta": {
|
119
|
+
* "include": [],
|
120
|
+
* "custom": [],
|
121
|
+
* }
|
122
|
+
* }
|
123
|
+
* }
|
124
|
+
*/
|
125
|
+
|
126
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\UI\\API\\Controllers\\Controller;
|
127
|
+
use Illuminate\\Support\\Facades\\Route;
|
128
|
+
|
129
|
+
Route::patch('${table.table_name}/{id}', [Controller::class, 'update${Helpers.capitalise(table.table_name)}'])
|
130
|
+
->middleware(['auth:api']);
|
131
|
+
|
132
|
+
|
133
|
+
`;
|
134
|
+
|
135
|
+
Helpers.writeToFile(`${Route.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Routes`, `Update${Helpers.capitalise(table.table_name)}Route.v1.private.php`, file_data)
|
136
|
+
|
137
|
+
|
138
|
+
}
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
static generateDeleteRouteFile(table) {
|
143
|
+
let file_data = `<?php
|
144
|
+
|
145
|
+
/**
|
146
|
+
* @apiGroup ${Helpers.capitalise(table.table_name)}
|
147
|
+
* @apiName Delete${Helpers.capitalise(table.table_name)}
|
148
|
+
*
|
149
|
+
* @api {DELETE} /v1/${table.table_name}/:id Delete ${Helpers.capitalise(table.table_name)}
|
150
|
+
* @apiDescription Delete a ${Helpers.capitalise(table.table_name)} by its id
|
151
|
+
*
|
152
|
+
* @apiVersion 1.0.0
|
153
|
+
* @apiPermission Authenticated ['permissions' => '', 'roles' => '']
|
154
|
+
*
|
155
|
+
* @apiHeader {String} accept=application/json
|
156
|
+
* @apiHeader {String} authorization=Bearer
|
157
|
+
*
|
158
|
+
*
|
159
|
+
* @apiSuccessExample {json} Success-Response:
|
160
|
+
* HTTP/1.1 200 OK
|
161
|
+
* {
|
162
|
+
*
|
163
|
+
* }
|
164
|
+
*/
|
165
|
+
|
166
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\UI\\API\\Controllers\\Controller;
|
167
|
+
use Illuminate\\Support\\Facades\\Route;
|
168
|
+
|
169
|
+
Route::delete('${table.table_name}/{id}', [Controller::class, 'delete${Helpers.capitalise(table.table_name)}'])
|
170
|
+
->middleware(['auth:api']);
|
171
|
+
|
172
|
+
|
173
|
+
`;
|
174
|
+
|
175
|
+
Helpers.writeToFile(`${Route.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Routes`, `Delete${Helpers.capitalise(table.table_name)}Route.v1.private.php`, file_data)
|
176
|
+
|
177
|
+
|
178
|
+
}
|
179
|
+
|
180
|
+
static generateGetAllRouteFile(table) {
|
181
|
+
let file_data = `<?php
|
182
|
+
|
183
|
+
/**
|
184
|
+
* @apiGroup ${Helpers.capitalise(table.table_name)}
|
185
|
+
* @apiName Create${Helpers.capitalise(table.table_name)}
|
186
|
+
*
|
187
|
+
* @api {GET} /v1/${table.table_name} Get ${Helpers.capitalise(table.table_name)}
|
188
|
+
* @apiDescription Get all ${Helpers.capitalise(table.table_name)}
|
189
|
+
*
|
190
|
+
* @apiVersion 1.0.0
|
191
|
+
* @apiPermission Authenticated ['permissions' => '', 'roles' => '']
|
192
|
+
*
|
193
|
+
* @apiHeader {String} accept=application/json
|
194
|
+
* @apiHeader {String} authorization=Bearer
|
195
|
+
*
|
196
|
+
${this.getRouteParams(table)}
|
197
|
+
*
|
198
|
+
* @apiSuccessExample {json} Success-Response:
|
199
|
+
* HTTP/1.1 200 OK
|
200
|
+
* {
|
201
|
+
* {
|
202
|
+
* "data": [
|
203
|
+
* {
|
204
|
+
* "object": "${Helpers.capitalise(table.table_name)}",
|
205
|
+
* "id": "NxOpZowo9GmjKqdR",
|
206
|
+
* "deleted_at": null,
|
207
|
+
* "deleted_by": null,
|
208
|
+
* "updated_by": null,
|
209
|
+
* "created_at": "2021-12-24T11:57:37.000000Z",
|
210
|
+
* "updated_at": "2022-05-03T07:03:00.000000Z",
|
211
|
+
* "readable_created_at": "1 year ago",
|
212
|
+
* "readable_updated_at": "9 months ago",
|
213
|
+
* "real_id": 1
|
214
|
+
* },
|
215
|
+
* {
|
216
|
+
* "object": "${Helpers.capitalise(table.table_name)}",
|
217
|
+
* "id": "NxOpZowo9GmjKqdR",
|
218
|
+
* "deleted_at": null,
|
219
|
+
* "deleted_by": null,
|
220
|
+
* "updated_by": null,
|
221
|
+
* "created_at": "2021-12-24T11:57:37.000000Z",
|
222
|
+
* "updated_at": "2022-05-03T07:03:00.000000Z",
|
223
|
+
* "readable_created_at": "1 year ago",
|
224
|
+
* "readable_updated_at": "9 months ago",
|
225
|
+
* "real_id": 1
|
226
|
+
* },
|
227
|
+
* ],
|
228
|
+
* "meta": {
|
229
|
+
* "include": [],
|
230
|
+
* "custom": [],
|
231
|
+
* "pagination": {
|
232
|
+
* "total": 2,
|
233
|
+
* "count": 2,
|
234
|
+
* "per_page": 10,
|
235
|
+
* "current_page": 1,
|
236
|
+
* "total_pages": 1,
|
237
|
+
* "links": {}
|
238
|
+
* }
|
239
|
+
* }
|
240
|
+
* }
|
241
|
+
* }
|
242
|
+
*/
|
243
|
+
|
244
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\UI\\API\\Controllers\\Controller;
|
245
|
+
use Illuminate\\Support\\Facades\\Route;
|
246
|
+
|
247
|
+
Route::get('${table.table_name}', [Controller::class, 'getAll${Helpers.capitalise(table.table_name)}'])
|
248
|
+
->middleware(['auth:api']);
|
249
|
+
|
250
|
+
|
251
|
+
`;
|
252
|
+
|
253
|
+
Helpers.writeToFile(`${Route.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Routes`, `GetAll${Helpers.capitalise(table.table_name)}Route.v1.private.php`, file_data)
|
254
|
+
|
255
|
+
|
256
|
+
}
|
257
|
+
|
258
|
+
static generateFindByIdRouteFile(table) {
|
259
|
+
|
260
|
+
let file_data = `<?php
|
261
|
+
|
262
|
+
/**
|
263
|
+
* @apiGroup ${Helpers.capitalise(table.table_name)}
|
264
|
+
* @apiName Find${Helpers.capitalise(table.table_name)}Byid
|
265
|
+
*
|
266
|
+
* @api {GET} /v1/${table.table_name}/:id Find ${Helpers.capitalise(table.table_name)}
|
267
|
+
* @apiDescription Find a ${Helpers.capitalise(table.table_name)} by its id
|
268
|
+
*
|
269
|
+
* @apiVersion 1.0.0
|
270
|
+
* @apiPermission Authenticated ['permissions' => '', 'roles' => '']
|
271
|
+
*
|
272
|
+
* @apiHeader {String} accept=application/json
|
273
|
+
* @apiHeader {String} authorization=Bearer
|
274
|
+
*
|
275
|
+
${this.getRouteParams(table)}
|
276
|
+
*
|
277
|
+
* @apiSuccessExample {json} Success-Response:
|
278
|
+
* HTTP/1.1 200 OK
|
279
|
+
* {
|
280
|
+
* {
|
281
|
+
* "data": {
|
282
|
+
* "object": "${Helpers.capitalise(table.table_name)}",
|
283
|
+
* "id": "NxOpZowo9GmjKqdR",
|
284
|
+
* "deleted_at": null,
|
285
|
+
* "deleted_by": null,
|
286
|
+
* "updated_by": null,
|
287
|
+
* "created_at": "2021-12-24T11:57:37.000000Z",
|
288
|
+
* "updated_at": "2022-05-03T07:03:00.000000Z",
|
289
|
+
* "readable_created_at": "1 year ago",
|
290
|
+
* "readable_updated_at": "9 months ago",
|
291
|
+
* "real_id": 1
|
292
|
+
* },
|
293
|
+
* "meta": {
|
294
|
+
* "include": [],
|
295
|
+
* "custom": [],
|
296
|
+
* }
|
297
|
+
* }
|
298
|
+
* }
|
299
|
+
*/
|
300
|
+
|
301
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\UI\\API\\Controllers\\Controller;
|
302
|
+
use Illuminate\\Support\\Facades\\Route;
|
303
|
+
|
304
|
+
Route::get('${table.table_name}/{id}', [Controller::class, 'find${Helpers.capitalise(table.table_name)}ById'])
|
305
|
+
->middleware(['auth:api']);
|
306
|
+
|
307
|
+
|
308
|
+
`;
|
309
|
+
|
310
|
+
Helpers.writeToFile(`${Route.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Routes`, `Find${Helpers.capitalise(table.table_name)}ByIdRoute.v1.private.php`, file_data)
|
311
|
+
|
312
|
+
}
|
313
|
+
|
314
|
+
static getRouteParams(table){
|
315
|
+
let route_params = '';
|
316
|
+
table.columns.forEach(column => {
|
317
|
+
if (column.column_name !== 'id' && column.column_name !== 'created_at' && column.column_name !== 'updated_at' && column.column_name !== 'deleted_at' && column.column_name !== 'deleted_by' && column.column_name !== 'updated_by') {
|
318
|
+
route_params += `* @apiParam {${column.type}} ${column.column_name} ${column.properties ? (column.properties.join('|') + ' ' + column.properties.includes('nullable') ? '(Optional)' : '' ): ''}\n`
|
319
|
+
}
|
320
|
+
});
|
321
|
+
return route_params;
|
322
|
+
}
|
323
|
+
|
324
|
+
static getRouteBody(table){
|
325
|
+
let route_params = '';
|
326
|
+
table.columns.forEach(column => {
|
327
|
+
if (column.column_name !== 'id' && column.column_name !== 'created_at' && column.column_name !== 'updated_at' && column.column_name !== 'deleted_at' && column.column_name !== 'deleted_by' && column.column_name !== 'updated_by') {
|
328
|
+
route_params += `* @apiBody {${column.type}} ${column.column_name} ${column.properties ? (column.properties.join('|') + ' ' + column.properties.includes('nullable') ? '(Optional)' : '' ): ''}\n`
|
329
|
+
}
|
330
|
+
});
|
331
|
+
return route_params;
|
332
|
+
}
|
333
|
+
|
334
|
+
}
|
335
|
+
|
336
|
+
export default Route;
|
@@ -0,0 +1,225 @@
|
|
1
|
+
import Helpers from "../Helpers.js";
|
2
|
+
import chalk from "chalk";
|
3
|
+
|
4
|
+
|
5
|
+
class Task{
|
6
|
+
|
7
|
+
static FileFolder = 'Tasks';
|
8
|
+
PROJECT_DIR = ''
|
9
|
+
static generateTaskFolder(table, PROJECT_DIR){
|
10
|
+
console.log(`${chalk.yellow.bold(Helpers.capitalise(table.table_name))} : ${chalk.green.bold('Tasks ')} : Generating Task Files`)
|
11
|
+
Task.PROJECT_DIR = PROJECT_DIR
|
12
|
+
Helpers.createPath(`${Task.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/${Task.FileFolder}`);
|
13
|
+
Task.generateAllTasks(table)
|
14
|
+
}
|
15
|
+
|
16
|
+
static generateAllTasks(table){
|
17
|
+
Task.generateCreateTaskFile(table)
|
18
|
+
Task.generateUpdateTaskFile(table)
|
19
|
+
Task.generateDeleteTaskFile(table)
|
20
|
+
Task.generateFindTaskFile(table)
|
21
|
+
Task.generateGetAllTaskFile(table)
|
22
|
+
}
|
23
|
+
|
24
|
+
|
25
|
+
static generateCreateTaskFile(table){
|
26
|
+
|
27
|
+
let file_data = `<?php
|
28
|
+
|
29
|
+
namespace App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\${this.FileFolder};
|
30
|
+
|
31
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\Data\\Repositories\\${Helpers.capitalise(table.table_name)}Repository;
|
32
|
+
use App\\Ship\\Exceptions\\CreateResourceFailedException;
|
33
|
+
use App\\Ship\\Parents\\${this.FileFolder}\\Task;
|
34
|
+
use Exception;
|
35
|
+
|
36
|
+
class Create${Helpers.capitalise(table.table_name)}Task extends Task
|
37
|
+
{
|
38
|
+
protected ${Helpers.capitalise(table.table_name)}Repository $repository;
|
39
|
+
|
40
|
+
public function __construct(${Helpers.capitalise(table.table_name)}Repository $repository)
|
41
|
+
{
|
42
|
+
$this->repository = $repository;
|
43
|
+
}
|
44
|
+
|
45
|
+
public function run(array $data)
|
46
|
+
{
|
47
|
+
try {
|
48
|
+
$result = $this->repository->create($data);
|
49
|
+
${Helpers.capitalise(table.table_name)}CreatedEvent::dispatch($result);
|
50
|
+
|
51
|
+
return $result;
|
52
|
+
}
|
53
|
+
catch (Exception $exception) {
|
54
|
+
throw new CreateResourceFailedException();
|
55
|
+
}
|
56
|
+
}
|
57
|
+
}
|
58
|
+
|
59
|
+
|
60
|
+
`;
|
61
|
+
|
62
|
+
|
63
|
+
Helpers.writeToFile(`${Task.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/${Task.FileFolder}`, `Create${Helpers.capitalise(table.table_name)}Task.php`, file_data)
|
64
|
+
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
static generateUpdateTaskFile(table) {
|
69
|
+
|
70
|
+
const file_data = `<?php
|
71
|
+
|
72
|
+
namespace App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\${this.FileFolder};
|
73
|
+
|
74
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\Data\\Repositories\\${Helpers.capitalise(table.table_name)}Repository;
|
75
|
+
use App\\Ship\\Exceptions\\UpdateResourceFailedException;
|
76
|
+
use App\\Ship\\Parents\\Tasks\\Task;
|
77
|
+
use Exception;
|
78
|
+
|
79
|
+
class Update${Helpers.capitalise(table.table_name)}Task extends Task
|
80
|
+
{
|
81
|
+
protected ${Helpers.capitalise(table.table_name)}Repository $repository;
|
82
|
+
|
83
|
+
public function __construct(${Helpers.capitalise(table.table_name)}Repository $repository)
|
84
|
+
{
|
85
|
+
$this->repository = $repository;
|
86
|
+
}
|
87
|
+
|
88
|
+
public function run($id, array $data)
|
89
|
+
{
|
90
|
+
try {
|
91
|
+
$result = $this->repository->update($data, $id);
|
92
|
+
${Helpers.capitalise(table.table_name)}UpdatedEvent::dispatch($result);
|
93
|
+
|
94
|
+
return $result;
|
95
|
+
}
|
96
|
+
catch (Exception $exception) {
|
97
|
+
throw new UpdateResourceFailedException();
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
102
|
+
`;
|
103
|
+
|
104
|
+
Helpers.writeToFile(`${Task.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/${Task.FileFolder}`, `Update${Helpers.capitalise(table.table_name)}Task.php`, file_data)
|
105
|
+
}
|
106
|
+
|
107
|
+
static generateDeleteTaskFile(table) {
|
108
|
+
|
109
|
+
const file_data = `<?php
|
110
|
+
|
111
|
+
namespace App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\${this.FileFolder};
|
112
|
+
|
113
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\Data\\Repositories\\${Helpers.capitalise(table.table_name)}Repository;
|
114
|
+
use App\\Ship\\Exceptions\\DeleteResourceFailedException;
|
115
|
+
use App\\Ship\\Parents\\${this.FileFolder}\\Task;
|
116
|
+
use Exception;
|
117
|
+
use Illuminate\\Support\\Facades\\Auth;
|
118
|
+
|
119
|
+
class Delete${Helpers.capitalise(table.table_name)}Task extends Task
|
120
|
+
{
|
121
|
+
protected ${Helpers.capitalise(table.table_name)}Repository $repository;
|
122
|
+
|
123
|
+
public function __construct(${Helpers.capitalise(table.table_name)}Repository $repository)
|
124
|
+
{
|
125
|
+
$this->repository = $repository;
|
126
|
+
}
|
127
|
+
|
128
|
+
public function run($id)
|
129
|
+
{
|
130
|
+
try {
|
131
|
+
$result = $this->repository->delete($id);
|
132
|
+
${Helpers.capitalise(table.table_name)}DeletedEvent::dispatch($result);
|
133
|
+
|
134
|
+
return $result;
|
135
|
+
}
|
136
|
+
catch (Exception $exception) {
|
137
|
+
throw new DeleteResourceFailedException();
|
138
|
+
}
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
|
143
|
+
`;
|
144
|
+
|
145
|
+
Helpers.writeToFile(`${Task.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/${Task.FileFolder}`, `Delete${Helpers.capitalise(table.table_name)}Task.php`, file_data)
|
146
|
+
}
|
147
|
+
|
148
|
+
static generateFindTaskFile(table) {
|
149
|
+
|
150
|
+
const file_data = `<?php
|
151
|
+
|
152
|
+
namespace App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\${this.FileFolder};
|
153
|
+
|
154
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\Data\\Repositories\\${Helpers.capitalise(table.table_name)}Repository;
|
155
|
+
use App\\Ship\\Exceptions\\FindResourceFailedException;
|
156
|
+
use App\\Ship\\Parents\\${this.FileFolder}\\Task;
|
157
|
+
use Exception;
|
158
|
+
|
159
|
+
class Find${Helpers.capitalise(table.table_name)}ByIdTask extends Task
|
160
|
+
{
|
161
|
+
protected ${Helpers.capitalise(table.table_name)}Repository $repository;
|
162
|
+
|
163
|
+
public function __construct(${Helpers.capitalise(table.table_name)}Repository $repository)
|
164
|
+
{
|
165
|
+
$this->repository = $repository;
|
166
|
+
}
|
167
|
+
|
168
|
+
public function run($id)
|
169
|
+
{
|
170
|
+
try {
|
171
|
+
$result = $this->repository->find($id);
|
172
|
+
${Helpers.capitalise(table.table_name)}FoundByIdEvent::dispatch($result);
|
173
|
+
|
174
|
+
return $result;
|
175
|
+
}
|
176
|
+
catch (Exception $exception) {
|
177
|
+
throw new CreateResourceFailedException();
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
|
182
|
+
`;
|
183
|
+
|
184
|
+
Helpers.writeToFile(`${Task.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/${Task.FileFolder}`, `Find${Helpers.capitalise(table.table_name)}ByIdTask.php`, file_data)
|
185
|
+
}
|
186
|
+
|
187
|
+
static generateGetAllTaskFile(table) {
|
188
|
+
|
189
|
+
const file_data = `<?php
|
190
|
+
|
191
|
+
namespace App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\${this.FileFolder};
|
192
|
+
|
193
|
+
use Apiato\\Core\\Exceptions\\CoreInternalErrorException;
|
194
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\Data\\Repositories\\${Helpers.capitalise(table.table_name)}Repository;
|
195
|
+
use App\\Containers\\AppSection\\AccountType\\Events\\${Helpers.capitalise(table.table_name)}ListedEvent;
|
196
|
+
use App\\Ship\\Parents\\Tasks\\Task as ParentTask;
|
197
|
+
use Prettus\\Repository\\Exceptions\\RepositoryException;
|
198
|
+
|
199
|
+
class GetAll${Helpers.capitalise(table.table_name)}Task extends ParentTask
|
200
|
+
{
|
201
|
+
public function __construct(
|
202
|
+
protected AccountTypeRepository $repository
|
203
|
+
) {
|
204
|
+
}
|
205
|
+
|
206
|
+
/**
|
207
|
+
* @throws CoreInternalErrorException
|
208
|
+
* @throws RepositoryException
|
209
|
+
*/
|
210
|
+
public function run(): mixed
|
211
|
+
{
|
212
|
+
$result = $this->addRequestCriteria()->repository->paginate();
|
213
|
+
${Helpers.capitalise(table.table_name)}ListedEvent::dispatch($result);
|
214
|
+
|
215
|
+
return $result;
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
`;
|
220
|
+
|
221
|
+
Helpers.writeToFile(`${Task.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/${Task.FileFolder}`, `GetAll${Helpers.capitalise(table.table_name)}Task.php`, file_data)
|
222
|
+
}
|
223
|
+
|
224
|
+
}
|
225
|
+
export default Task;
|
@@ -0,0 +1,94 @@
|
|
1
|
+
import Helpers from "../Helpers.js";
|
2
|
+
import chalk from "chalk";
|
3
|
+
|
4
|
+
|
5
|
+
|
6
|
+
class Transformer{
|
7
|
+
|
8
|
+
PROJECT_DIR = ''
|
9
|
+
static generateTransaformerFolder(table, PROJECT_DIR){
|
10
|
+
|
11
|
+
console.log(`${chalk.yellow.bold(Helpers.capitalise(table.table_name))} : ${chalk.green.bold('Transformers ')} : Generating Transformer Files`)
|
12
|
+
Transformer.PROJECT_DIR = PROJECT_DIR
|
13
|
+
|
14
|
+
Helpers.createPath(`${PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Transformers`);
|
15
|
+
this.generateTransaformerFile(table);
|
16
|
+
}
|
17
|
+
|
18
|
+
static generateTransaformerFile(table) {
|
19
|
+
|
20
|
+
let file_data = `<?php
|
21
|
+
|
22
|
+
namespace App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\UI\\API\\Transformers;
|
23
|
+
|
24
|
+
use App\\Containers\\AppSection\\${Helpers.capitalise(table.table_name)}\\Models\\${Helpers.capitalise(table.table_name)};
|
25
|
+
use App\\Ship\\Parents\\Transformers\\Transformer as ParentTransformer;
|
26
|
+
|
27
|
+
class ${Helpers.capitalise(table.table_name)}Transformer extends ParentTransformer
|
28
|
+
{
|
29
|
+
protected array $defaultIncludes = [
|
30
|
+
|
31
|
+
];
|
32
|
+
|
33
|
+
protected array $availableIncludes = [
|
34
|
+
${this.getAvailableIncludes(table)}
|
35
|
+
];
|
36
|
+
|
37
|
+
public function transform(${Helpers.capitalise(table.table_name)} $${table.table_name}): array
|
38
|
+
{
|
39
|
+
$response = [
|
40
|
+
'object' => $${table.table_name}->getResourceKey(),
|
41
|
+
'id' => $${table.table_name}->getHashedKey(),
|
42
|
+
'created_at' => $${table.table_name}->created_at,
|
43
|
+
'updated_at' => $${table.table_name}->updated_at,
|
44
|
+
];
|
45
|
+
|
46
|
+
return $this->ifAdmin([
|
47
|
+
'real_id' => $${table.table_name}->id,
|
48
|
+
'created_at' => $${table.table_name}->created_at,
|
49
|
+
'updated_at' => $${table.table_name}->updated_at,
|
50
|
+
'readable_created_at' => $${table.table_name}->created_at->diffForHumans(),
|
51
|
+
'readable_updated_at' => $${table.table_name}->updated_at->diffForHumans(),
|
52
|
+
'deleted_at' => $${table.table_name}->deleted_at,
|
53
|
+
], $response);
|
54
|
+
}
|
55
|
+
|
56
|
+
${this.getIncludeFunctions(table)}
|
57
|
+
|
58
|
+
}
|
59
|
+
|
60
|
+
`;
|
61
|
+
|
62
|
+
Helpers.writeToFile(`${Transformer.PROJECT_DIR}/Containers/AppSection/${Helpers.capitalise(table.table_name)}/UI/API/Transformers`, `${Helpers.capitalise(table.table_name)}Transformer.php`, file_data)
|
63
|
+
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
static getAvailableIncludes(table){
|
68
|
+
let includes = "";
|
69
|
+
table.relations.forEach(relation => {
|
70
|
+
if(relation.table){
|
71
|
+
includes += ` '${relation.table}',\n`;
|
72
|
+
}
|
73
|
+
});
|
74
|
+
return includes;
|
75
|
+
}
|
76
|
+
|
77
|
+
static getIncludeFunctions(table){
|
78
|
+
let includes = "";
|
79
|
+
table.relations.forEach(relation => {
|
80
|
+
if(relation.table){
|
81
|
+
includes += ` public function include${Helpers.capitalise(relation.table)}(${Helpers.capitalise(table.table_name)} $${table.table_name})\n`;
|
82
|
+
includes += ` {\n`;
|
83
|
+
includes += ` if (is_null($${table.table_name}->${relation.table})) \n`;
|
84
|
+
includes += ` return $this->null();\n`;
|
85
|
+
includes += ` return $this->${relation.relation === 'belongsTo' ? 'item' : 'collection' }($${table.table_name}->${relation.table}, new ${Helpers.capitalise(relation.table)}Transformer());\n`;
|
86
|
+
includes += ` }\n\n`;
|
87
|
+
}
|
88
|
+
});
|
89
|
+
return includes;
|
90
|
+
}
|
91
|
+
|
92
|
+
}
|
93
|
+
|
94
|
+
export default Transformer;
|