Skip to content
Closed
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2c5d963
Apply code style
laravel-shift Aug 23, 2022
1c3290a
Adopt short array syntax
laravel-shift Aug 23, 2022
3386bed
Add laravel/ui dependency
laravel-shift Aug 23, 2022
349fa5d
Convert factory types to states
laravel-shift Aug 23, 2022
532d694
Shift config files
laravel-shift Aug 23, 2022
7672638
Default config files
laravel-shift Aug 23, 2022
2772efa
Bump Laravel dependencies
laravel-shift Aug 23, 2022
ff2b75a
Shift cleanup
laravel-shift Aug 23, 2022
f2c1f28
Shift test config and references
laravel-shift Aug 23, 2022
efd5ac2
Update error handler to use Throwable
nolanpro Aug 1, 2022
c747ac0
Remove unused traits in controllers
nolanpro Aug 1, 2022
0f6256e
Update namespaces for medialibrary
nolanpro Aug 1, 2022
47d568b
Use guzzle 7.4
nolanpro Aug 1, 2022
07713ca
Remove unused package
nolanpro Aug 1, 2022
973516f
Update argument compatibility
nolanpro Aug 1, 2022
2d25ec0
Update additional MediaLibrary namespaces
nolanpro Aug 9, 2022
cb15244
Fix Laravel echo server error
nolanpro Aug 9, 2022
6c84a28
Upgrade Spatie MediaLibrary to v9
nolanpro Aug 9, 2022
f6cb45a
Remove script
nolanpro Aug 10, 2022
f8689bf
Remove .phpunit.result.cache
nolanpro Aug 10, 2022
7308ed3
Add .phpunit.result.cache to git ignore
nolanpro Aug 10, 2022
da50ad1
Change getOriginal to getRawOriginal in test
nolanpro Aug 15, 2022
f8d25ea
Fix custom MediaPathGenerator
nolanpro Aug 15, 2022
e7f7c98
Upgrade php swagger
nolanpro Aug 16, 2022
dc78e37
Add bearer auth to swagger ui
nolanpro Aug 16, 2022
1bd9ab6
Fix phpunit tests
nolanpro Aug 16, 2022
492d58e
Fix additional tests
nolanpro Aug 16, 2022
cb7cd53
Add helper function to register OpenAPI annotations
nolanpro Aug 17, 2022
7b0b6e2
Use original mail settings for now
nolanpro Aug 18, 2022
8b8b3f0
Set pmql to dev-develop until a new release is available
nolanpro Aug 23, 2022
7e0626d
Run composer update
nolanpro Aug 23, 2022
ae645ab
Remove config files from packages
nolanpro Aug 26, 2022
e07b67c
Update horizon assets
nolanpro Aug 26, 2022
5b033bf
Merge branch 'develop' into shift-69390
nolanpro Oct 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,5 @@ coverage
cypress/screenshots
cypress/videos
cypress/downloads
.phpunit.result.cache
.php-cs-fixer.cache
18 changes: 10 additions & 8 deletions ProcessMaker/Exception/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace ProcessMaker\Exception;

use Exception;
use Illuminate\Auth\AuthenticationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
Expand All @@ -12,6 +11,7 @@
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Route as RouteFacade;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;

/**
* Our general exception handler
Expand All @@ -34,10 +34,12 @@ class Handler extends ExceptionHandler

/**
* Report our exception. If in testing with verbosity, it will also dump exception information to the console
* @param Exception $exception
* @throws Exception
*
* @param Throwable $exception
*
* @throws Throwable
*/
public function report(Exception $exception)
public function report(Throwable $exception)
{
if (App::environment() == 'testing' && env('TESTING_VERBOSE')) {
// If we're verbose, we should print ALL Exceptions to the screen
Expand All @@ -52,10 +54,10 @@ public function report(Exception $exception)
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{
$prefix = '';
$route = $request->route();
Expand Down Expand Up @@ -118,10 +120,10 @@ protected function unauthenticated($request, AuthenticationException $exception)
* Convert the given exception to an array.
* @note This is overridding Laravel's default exception handler in order to handle binary data in message
*
* @param \Exception $e
* @param \Throwable $e
* @return array
*/
protected function convertExceptionToArray(Exception $e)
protected function convertExceptionToArray(Throwable $e)
{
return config('app.debug') ? [
'message' => utf8_encode($e->getMessage()),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<?php

namespace ProcessMaker\Http\Controllers\Api;

/**
* @OA\OpenApi(
* @OA\Info(
Expand Down Expand Up @@ -89,10 +92,8 @@
* )
* ),
* ),
* security={
* {"pm_api_auth_code": {}},
* {"pm_api_bearer": {}},
* {"pm_api_key": {}}
* },
* )
*/
class OpenApiSpec
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
use ProcessMaker\Http\Resources\ApiResource;
use ProcessMaker\Models\Media;
use ProcessMaker\Models\ProcessRequest;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;

class ProcessRequestFileController extends Controller
{
Expand All @@ -36,8 +34,6 @@ class ProcessRequestFileController extends Controller
'responsive_images',
];

use HasMediaTrait;

/**
* Display a listing of the resource.
*
Expand Down
5 changes: 1 addition & 4 deletions ProcessMaker/Http/Controllers/RequestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,10 @@
use ProcessMaker\Package\PackageComments\PackageServiceProvider;
use ProcessMaker\Traits\HasControllerAddons;
use ProcessMaker\Traits\SearchAutocompleteTrait;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\Models\Media;
use Spatie\MediaLibrary\MediaCollections\Models\Media;

class RequestController extends Controller
{
use HasMediaTrait;
use SearchAutocompleteTrait;
use HasControllerAddons;

Expand Down
15 changes: 15 additions & 0 deletions ProcessMaker/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,19 @@ class Kernel extends HttpKernel
'external.connection' => \ProcessMaker\Http\Middleware\ValidateExternalConnection::class,
'client' => \Laravel\Passport\Http\Middleware\CheckClientCredentials::class,
];

/**
* The auth:anon middleware must run after a session is set up to
* check if there is a user logged in before implying the user is
* anonymous.
*
* The auth:anon middleware is only used for the laravel echo
* server route: broadcasting/auth
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\AuthenticateSession::class,
\ProcessMaker\Http\Middleware\ProcessMakerAuthenticate::class,
];
}
2 changes: 1 addition & 1 deletion ProcessMaker/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use Illuminate\Support\Facades\Storage;
use Spatie\MediaLibrary\FileManipulator;
use Spatie\MediaLibrary\Filesystem\Filesystem;
use Spatie\MediaLibrary\Models\Media as BaseMedia;
use Spatie\MediaLibrary\MediaCollections\Models\Media as BaseMedia;

class Media extends BaseMedia
{
Expand Down
2 changes: 1 addition & 1 deletion ProcessMaker/Models/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Validation\ValidationException;
use ProcessMaker\Models\ProcessRequest;
use Spatie\MediaLibrary\Models\Media as Model;
use Spatie\MediaLibrary\MediaCollections\Models\Media as Model;

/**
* Represents media files stored in the database
Expand Down
4 changes: 2 additions & 2 deletions ProcessMaker/Models/MediaPathGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

namespace ProcessMaker\Models;

use Spatie\MediaLibrary\Models\Media;
use Spatie\MediaLibrary\PathGenerator\PathGenerator;
use Spatie\MediaLibrary\MediaCollections\Models\Media;
use Spatie\MediaLibrary\Support\PathGenerator\PathGenerator;

class MediaPathGenerator implements PathGenerator
{
Expand Down
6 changes: 3 additions & 3 deletions ProcessMaker/Models/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
use ProcessMaker\Traits\ProcessTimerEventsTrait;
use ProcessMaker\Traits\ProcessTrait;
use ProcessMaker\Traits\SerializeToIso8601;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Throwable;

/**
Expand Down Expand Up @@ -136,7 +136,7 @@
*/
class Process extends Model implements HasMedia, ProcessModelInterface
{
use HasMediaTrait;
use InteractsWithMedia;
use SerializeToIso8601;
use SoftDeletes;
use ProcessTaskAssignmentsTrait;
Expand Down
6 changes: 3 additions & 3 deletions ProcessMaker/Models/ProcessRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
use ProcessMaker\Traits\HideSystemResources;
use ProcessMaker\Traits\SerializeToIso8601;
use ProcessMaker\Traits\SqlsrvSupportTrait;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;
use Throwable;

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ class ProcessRequest extends Model implements ExecutionInstanceInterface, HasMed
{
use ExecutionInstanceTrait;
use SerializeToIso8601;
use HasMediaTrait;
use InteractsWithMedia;
use ExtendedPMQL;
use SqlsrvSupportTrait;
use HideSystemResources;
Expand Down
66 changes: 33 additions & 33 deletions ProcessMaker/Models/SecurityLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,41 +5,41 @@
use Illuminate\Database\Eloquent\Model;
use ProcessMaker\Traits\ExtendedPMQL;

/**
* Class SecurityLog
*
*
* @property Carbon $updated_at
* @property Carbon $created_at
*
* @OA\Schema(
* schema="securityLog",
* @OA\Property(property="id", type="integer"),
* @OA\Property(property="event", type="string"),
* @OA\Property(property="ip", type="string"),
* @OA\Property(property="meta", type="array",
* @OA\Items(type="object",
* @OA\Property(property="os", type="array",
* @OA\Items(type="object",
* @OA\Property(property="name", type="string"),
* @OA\Property(property="version", type="string"),
* ),
* ),
* @OA\Property(property="browser", type="array",
* @OA\Items(type="object",
* @OA\Property(property="name", type="string"),
* @OA\Property(property="version", type="string"),
* ),
* ),
* @OA\Property(property="user_agent", type="string"),
* ),
* ),
* @OA\Property(property="user_id", type="integer"),
* @OA\Property(property="occured_at", type="string"),
* ),
*/
class SecurityLog extends Model
{
/**
* Class SecurityLog
*
*
* @property Carbon $updated_at
* @property Carbon $created_at
*
* @OA\Schema(
* schema="securityLog",
* @OA\Property(property="id", type="integer"),
* @OA\Property(property="event", type="string"),
* @OA\Property(property="ip", type="string"),
* @OA\Property(property="meta", type="array",
* @OA\Items(type="object",
* @OA\Property(property="os", type="array",
* @OA\Items(type="object",
* @OA\Property(property="name", type="string"),
* @OA\Property(property="version", type="string"),
* ),
* ),
* @OA\Property(property="browser", type="array",
* @OA\Items(type="object",
* @OA\Property(property="name", type="string"),
* @OA\Property(property="version", type="string"),
* ),
* ),
* @OA\Property(property="user_agent", type="string"),
* ),
* ),
* @OA\Property(property="user_id", type="integer"),
* @OA\Property(property="occured_at", type="string"),
* ),
*/
use ExtendedPMQL;

const CREATED_AT = 'occurred_at';
Expand Down
6 changes: 3 additions & 3 deletions ProcessMaker/Models/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
use Illuminate\Validation\Rule;
use ProcessMaker\Traits\ExtendedPMQL;
use ProcessMaker\Traits\SerializeToIso8601;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;

/**
* Class Settings
Expand Down Expand Up @@ -50,7 +50,7 @@
class Setting extends Model implements HasMedia
{
use ExtendedPMQL;
use HasMediaTrait;
use InteractsWithMedia;
use SerializeToIso8601;

protected $connection = 'processmaker';
Expand Down
30 changes: 15 additions & 15 deletions ProcessMaker/Models/TokenClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

use Laravel\Passport\Client;

/**
* @OA\Schema(
* schema="TokenClient",
* @OA\Property(property="id", type="integer"),
* @OA\Property(property="user_id", type="integer"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="provider", type="string"),
* @OA\Property(property="redirect", type="string"),
* @OA\Property(property="personal_access_client", type="boolean"),
* @OA\Property(property="password_client", type="boolean"),
* @OA\Property(property="revoked", type="boolean"),
* @OA\Property(property="created_at", type="string", format="date-time"),
* @OA\Property(property="updated_at", type="string", format="date-time"),
* )
*/
class TokenClient extends Client
{
/**
* @OA\Schema(
* schema="TokenClient",
* @OA\Property(property="id", type="integer"),
* @OA\Property(property="user_id", type="integer"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="provider", type="string"),
* @OA\Property(property="redirect", type="string"),
* @OA\Property(property="personal_access_client", type="boolean"),
* @OA\Property(property="password_client", type="boolean"),
* @OA\Property(property="revoked", type="boolean"),
* @OA\Property(property="created_at", type="string", format="date-time"),
* @OA\Property(property="updated_at", type="string", format="date-time"),
* )
*/
}
6 changes: 3 additions & 3 deletions ProcessMaker/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
use ProcessMaker\Traits\HasAuthorization;
use ProcessMaker\Traits\HideSystemResources;
use ProcessMaker\Traits\SerializeToIso8601;
use Spatie\MediaLibrary\HasMedia\HasMedia;
use Spatie\MediaLibrary\HasMedia\HasMediaTrait;
use Spatie\MediaLibrary\HasMedia;
use Spatie\MediaLibrary\InteractsWithMedia;

class User extends Authenticatable implements HasMedia
{
use PMQL;
use HasApiTokens;
use Notifiable;
use HasMediaTrait;
use InteractsWithMedia;
use HasAuthorization;
use SerializeToIso8601;
use SoftDeletes;
Expand Down
30 changes: 15 additions & 15 deletions ProcessMaker/Models/UserToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@

use Laravel\Passport\Token;

/**
* @OA\Schema(
* schema="UserToken",
* @OA\Property(property="id", type="string"),
* @OA\Property(property="user_id", type="integer"),
* @OA\Property(property="client_id", type="integer"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="scopes", type="object"),
* @OA\Property(property="revoked", type="boolean"),
* @OA\Property(property="client", type="object", ref="#/components/schemas/TokenClient"),
* @OA\Property(property="created_at", type="string", format="date-time"),
* @OA\Property(property="updated_at", type="string", format="date-time"),
* @OA\Property(property="expires_at", type="string", format="date-time"),
* )
*/
class UserToken extends Token
{
/**
* @OA\Schema(
* schema="UserToken",
* @OA\Property(property="id", type="string"),
* @OA\Property(property="user_id", type="integer"),
* @OA\Property(property="client_id", type="integer"),
* @OA\Property(property="name", type="string"),
* @OA\Property(property="scopes", type="object"),
* @OA\Property(property="revoked", type="boolean"),
* @OA\Property(property="client", type="object", ref="#/components/schemas/TokenClient"),
* @OA\Property(property="created_at", type="string", format="date-time"),
* @OA\Property(property="updated_at", type="string", format="date-time"),
* @OA\Property(property="expires_at", type="string", format="date-time"),
* )
*/
}
Loading