diff --git a/ProcessMaker/Enums/ExporterMap.php b/ProcessMaker/Enums/ExporterMap.php index 73914f64ca..ae066dfa33 100644 --- a/ProcessMaker/Enums/ExporterMap.php +++ b/ProcessMaker/Enums/ExporterMap.php @@ -2,6 +2,8 @@ namespace ProcessMaker\Enums; +use ProcessMaker\Models\ProcessMakerModel; + enum ExporterMap { const TYPES = [ @@ -30,4 +32,13 @@ public static function getExporterClass(string $type): ?string { return self::TYPES[$type][1] ?? null; } + + public static function getExporterClassForModel(ProcessMakerModel $model): string | null + { + $class = get_class($model); + + return collect(self::TYPES)->first(function ($type) use ($class) { + return $type[0] == $class; + })[1] ?? null; + } } diff --git a/ProcessMaker/Exception/ExporterNotSupported.php b/ProcessMaker/Exception/ExporterNotSupported.php new file mode 100644 index 0000000000..7c80e3c5c6 --- /dev/null +++ b/ProcessMaker/Exception/ExporterNotSupported.php @@ -0,0 +1,9 @@ +storeClientCredentials($request); + + if ($updatedDevLink) { + return redirect($updatedDevLink->getOauthRedirectUrl()); + } + + $updatedDevLink = $this->storeOauthCredentials($request); + if ($updatedDevLink) { + return redirect(route('devlink.index')); + } + + return view('admin.devlink.index'); + } + + public function getOauthClient(Request $request) + { + $request->validate([ + 'devlink_id' => 'required', + 'redirect_uri' => ['required', 'url'], + ]); + + $devLinkId = $request->input('devlink_id'); + $redirectUri = $request->input('redirect_uri'); + + $client = Client::where([ + 'name' => 'devlink', + 'redirect' => $redirectUri, + ])->first(); + + if (!$client) { + $clientRepository = app('Laravel\Passport\ClientRepository'); + $client = $clientRepository->create(null, 'devlink', $redirectUri); + } + + $query = http_build_query([ + 'devlink_id' => $devLinkId, + 'client_id' => $client->id, + 'client_secret' => $client->secret, + ]); + + return redirect($redirectUri . '?' . $query); + } + + private function storeClientCredentials(Request $request) + { + if ( + $request->has('devlink_id') && + $request->has('client_id') && + $request->has('client_secret') + ) { + $devlink = DevLink::findOrFail($request->input('devlink_id')); + $devlink->update([ + 'client_id' => $request->input('client_id'), + 'client_secret' => $request->input('client_secret'), + ]); + + return $devlink; + } + + return false; + } + + private function storeOauthCredentials(Request $request) + { + if ( + $request->has('state') && + $request->has('code') + ) { + $devlink = DevLink::where('state', $request->input('state'))->firstOrFail(); + + $response = Http::asForm()->post($devlink->url . '/oauth/token', [ + 'grant_type' => 'authorization_code', + 'client_id' => $devlink->client_id, + 'client_secret' => $devlink->client_secret, + 'redirect_uri' => route('devlink.index'), + 'code' => $request->input('code'), + ]); + + $response = $response->json(); + $devlink->update([ + 'access_token' => $response['access_token'], + 'refresh_token' => $response['refresh_token'], + 'expires_in' => $response['expires_in'], + ]); + + return $devlink; + } + + return false; + } +} diff --git a/ProcessMaker/Http/Controllers/Api/DevLinkController.php b/ProcessMaker/Http/Controllers/Api/DevLinkController.php new file mode 100644 index 0000000000..eef736e946 --- /dev/null +++ b/ProcessMaker/Http/Controllers/Api/DevLinkController.php @@ -0,0 +1,154 @@ +validate([ + 'name' => ['required', 'unique:dev_links,name'], + 'url' => ['required', 'url', 'unique:dev_links,url'], + ]); + + $devLink = new DevLink(); + $devLink->name = $request->input('name'); + $devLink->url = $request->input('url'); + $devLink->saveOrFail(); + + return [ + ...$devLink->toArray(), + 'redirect_uri' => route('devlink.index'), + ]; + } + + public function update(Request $request, DevLink $devLink) + { + $devLink->name = $request->input('name'); + $devLink->saveOrFail(); + + return $devLink; + } + + public function destroy(DevLink $devLink) + { + $devLink->delete(); + } + + public function ping(DevLink $devLink) + { + return $devLink->client()->get(route('api.devlink.pong', [], false)); + } + + public function pong() + { + return ['status' => 'ok']; + } + + public function localBundles(Request $request) + { + if ($request->has('published')) { + return Bundle::published()->get(); + } + + return Bundle::get(); + } + + public function showBundle(Bundle $bundle) + { + return $bundle->load('assets'); + } + + public function remoteBundles(DevLink $devLink) + { + return $devLink->remoteBundles(); + } + + public function createBundle(Request $request) + { + $bundle = new Bundle(); + $bundle->name = $request->input('name'); + $bundle->published = (bool) $request->input('published', false); + $bundle->locked = (bool) $request->input('locked', false); + $bundle->version = 1; + $bundle->saveOrFail(); + + return $bundle; + } + + public function updateBundle(Request $request, Bundle $bundle) + { + $bundle->name = $request->input('name'); + $bundle->published = (bool) $request->input('published', false); + $bundle->locked = (bool) $request->input('locked', false); + $bundle->version = $bundle->version + 1; + $bundle->saveOrFail(); + + return $bundle; + } + + public function deleteBundle(Bundle $bundle) + { + $bundle->delete(); + } + + public function installRemoteBundle(DevLink $devLink, $remoteBundleId) + { + return $devLink->installRemoteBundle($remoteBundleId); + } + + public function exportLocalBundle(Bundle $bundle) + { + return ['payloads' => $bundle->export()]; + } + + public function exportLocalAsset(Request $request) + { + $asset = $request->input('class')::findOrFail($request->input('id')); + + return $asset->export(); + } + + public function addAsset(Request $request, Bundle $bundle) + { + $request->validate([ + 'type' => ['required', 'string'], + 'id' => Rule::unique('bundle_assets', 'asset_id')->where(function ($query) use ($request) { + $query->where([ + 'asset_id' => $request->input('id'), + 'asset_type' => $request->input('type'), + ]); + }), + ], + [ + 'id.unique' => __('Asset already exists in bundle'), + ]); + + $asset = $request->input('type')::findOrFail($request->input('id')); + $bundle->addAsset($asset); + } + + public function installRemoteAsset(Request $request, DevLink $devLink) + { + return $devLink->installRemoteAsset( + $request->input('class'), + $request->input('id') + ); + } +} diff --git a/ProcessMaker/Http/Kernel.php b/ProcessMaker/Http/Kernel.php index 8e94f09e95..5a996025e9 100644 --- a/ProcessMaker/Http/Kernel.php +++ b/ProcessMaker/Http/Kernel.php @@ -16,10 +16,10 @@ class Kernel extends HttpKernel protected $middleware = [ \Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance::class, \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class, - \ProcessMaker\Http\Middleware\TrimStrings::class, + Middleware\TrimStrings::class, \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class, - \ProcessMaker\Http\Middleware\TrustProxies::class, - \ProcessMaker\Http\Middleware\BrowserCache::class, + Middleware\TrustProxies::class, + Middleware\BrowserCache::class, ]; /** @@ -29,17 +29,17 @@ class Kernel extends HttpKernel */ protected $middlewareGroups = [ 'web' => [ - \ProcessMaker\Http\Middleware\EncryptCookies::class, + Middleware\EncryptCookies::class, \Illuminate\Session\Middleware\StartSession::class, \Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class, - \ProcessMaker\Http\Middleware\SessionStarted::class, - \ProcessMaker\Http\Middleware\AuthenticateSession::class, - \ProcessMaker\Http\Middleware\SessionControlKill::class, + Middleware\SessionStarted::class, + Middleware\AuthenticateSession::class, + Middleware\SessionControlKill::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class, //\ProcessMaker\Http\Middleware\VerifyCsrfToken::class, - \ProcessMaker\Http\Middleware\SetLocale::class, // This is disabled until all routes are handled by our new engine + Middleware\SetLocale::class, // This is disabled until all routes are handled by our new engine \Illuminate\Routing\Middleware\SubstituteBindings::class, - \ProcessMaker\Http\Middleware\GenerateMenus::class, + Middleware\GenerateMenus::class, \Laravel\Passport\Http\Middleware\CreateFreshApiToken::class, ], 'api' => [ @@ -62,25 +62,26 @@ class Kernel extends HttpKernel * @var array */ protected $routeMiddleware = [ - 'auth' => \ProcessMaker\Http\Middleware\ProcessMakerAuthenticate::class, + 'auth' => Middleware\ProcessMakerAuthenticate::class, 'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, - 'can' => \ProcessMaker\Http\Middleware\CustomAuthorize::class, - 'force_change_password' => \ProcessMaker\Http\Middleware\VerifyChangePasswordNeeded::class, - 'guest' => \ProcessMaker\Http\Middleware\RedirectIfAuthenticated::class, - 'permission' => \ProcessMaker\Http\Middleware\PermissionCheck::class, + 'can' => Middleware\CustomAuthorize::class, + 'force_change_password' => Middleware\VerifyChangePasswordNeeded::class, + 'guest' => Middleware\RedirectIfAuthenticated::class, + 'permission' => Middleware\PermissionCheck::class, 'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class, - 'sanitize' => \ProcessMaker\Http\Middleware\SanitizeInput::class, - 'setlocale' => \ProcessMaker\Http\Middleware\SetLocale::class, - 'setskin' => \ProcessMaker\Http\Middleware\SetSkin::class, + 'sanitize' => Middleware\SanitizeInput::class, + 'setlocale' => Middleware\SetLocale::class, + 'setskin' => Middleware\SetSkin::class, 'client' => \Laravel\Passport\Http\Middleware\CheckClientCredentials::class, - 'template-authorization' => \ProcessMaker\Http\Middleware\TemplateAuthorization::class, - 'edit_username_password' => \ProcessMaker\Http\Middleware\ValidateEditUserAndPasswordPermission::class, - '2fa' => \ProcessMaker\Http\Middleware\TwoFactorAuthentication::class, - 'saml_request' => \ProcessMaker\Http\Middleware\SamlRequest::class, - 'session_block' => \ProcessMaker\Http\Middleware\SessionControlBlock::class, - 'session_kill' => \ProcessMaker\Http\Middleware\SessionControlKill::class, - 'no-cache' => \ProcessMaker\Http\Middleware\NoCache::class, + 'template-authorization' => Middleware\TemplateAuthorization::class, + 'edit_username_password' => Middleware\ValidateEditUserAndPasswordPermission::class, + '2fa' => Middleware\TwoFactorAuthentication::class, + 'saml_request' => Middleware\SamlRequest::class, + 'session_block' => Middleware\SessionControlBlock::class, + 'session_kill' => Middleware\SessionControlKill::class, + 'no-cache' => Middleware\NoCache::class, + 'admin' => Middleware\IsAdmin::class, ]; /** @@ -95,6 +96,6 @@ class Kernel extends HttpKernel */ protected $middlewarePriority = [ \Illuminate\Session\Middleware\AuthenticateSession::class, - \ProcessMaker\Http\Middleware\ProcessMakerAuthenticate::class, + Middleware\ProcessMakerAuthenticate::class, ]; } diff --git a/ProcessMaker/Http/Middleware/GenerateMenus.php b/ProcessMaker/Http/Middleware/GenerateMenus.php index 2105da72fb..abf45eb61b 100644 --- a/ProcessMaker/Http/Middleware/GenerateMenus.php +++ b/ProcessMaker/Http/Middleware/GenerateMenus.php @@ -70,51 +70,53 @@ public function handle(Request $request, Closure $next) // Build the menus Menu::make('sidebar_admin', function ($menu) { $submenu = $menu->add(__('admin')); - if (\Auth::check() && \Auth::user()->can('view-users')) { + + if (!\Auth::check()) { + return; + } + + if (\Auth::user()->can('view-users')) { $submenu->add(__('Users'), [ 'route' => 'users.index', 'icon' => 'fa-user', 'id' => 'homeid', ]); } - if (\Auth::check() && \Auth::user()->can('view-groups')) { + if (\Auth::user()->can('view-groups')) { $submenu->add(__('Groups'), [ 'route' => 'groups.index', 'icon' => 'fa-users', 'id' => 'homeid', ]); } - if (\Auth::check() && \Auth::user()->can('view-settings') && Setting::notHidden()->count()) { + if (\Auth::user()->can('view-settings') && Setting::notHidden()->count()) { $submenu->add(__('Settings'), [ 'route' => 'settings.index', 'icon' => 'fa-sliders-h', 'id' => 'homeid', ]); } - if (\Auth::check() && \Auth::user()->can('view-auth_clients')) { + if (\Auth::user()->can('view-auth_clients')) { $submenu->add(__('Auth Clients'), [ 'route' => 'auth-clients.index', 'icon' => 'fa-key', 'id' => 'auth-login', ]); } - if (\Auth::check() && \Auth::user()->is_administrator) { + if (\Auth::user()->is_administrator) { $submenu->add(__('Customize UI'), [ 'route' => 'customize-ui.edit', 'icon' => 'fa-palette', ]); - } - if (\Auth::check() && \Auth::user()->is_administrator) { + $submenu->add(__('Queue Management'), [ 'route' => 'queues.index', 'icon' => 'fa-infinity', ]); - } - if (\Auth::check() && \Auth::user()->is_administrator) { - $submenu->add(__('Script Executors'), [ - 'route' => 'script-executors.index', - 'icon' => 'fa-code', + $submenu->add(__('DevLink'), [ + 'route' => 'devlink.index', + 'icon' => 'fa-link', ]); } }); diff --git a/ProcessMaker/Http/Middleware/IsAdmin.php b/ProcessMaker/Http/Middleware/IsAdmin.php new file mode 100644 index 0000000000..232347f356 --- /dev/null +++ b/ProcessMaker/Http/Middleware/IsAdmin.php @@ -0,0 +1,24 @@ +user()->is_administrator) { + return $next($request); + } + + return abort(403); + } +} diff --git a/ProcessMaker/Models/Bundle.php b/ProcessMaker/Models/Bundle.php new file mode 100644 index 0000000000..037af88413 --- /dev/null +++ b/ProcessMaker/Models/Bundle.php @@ -0,0 +1,101 @@ + 'boolean', + 'published' => 'boolean', + ]; + + public function scopePublished($query) + { + return $query->where('published', true); + } + + public function assets() + { + return $this->hasMany(BundleAsset::class); + } + + public function getAssetCountAttribute() + { + return $this->assets()->count(); + } + + public function export() + { + $exports = []; + + foreach ($this->assets as $bundleAsset) { + $asset = $bundleAsset->asset; + + if (!BundleAsset::canExport($asset)) { + throw new ExporterNotSupported(); + } + + $exports[] = $asset->export(); + } + + return $exports; + } + + public function syncAssets($assets) + { + $assetKeys = []; + foreach ($assets as $asset) { + $assetKeys[BundleAsset::makeKey($asset)] = true; + } + + $existingKeys = []; + foreach ($this->assets as $bundleAsset) { + if (!isset($assetKeys[$bundleAsset->key])) { + // Removing bundleAsset because it is associated but not passed to this method + $bundleAsset->delete(); + continue; + } + + $existingKeys[$bundleAsset->key] = true; + } + + foreach ($assets as $asset) { + if (isset($existingKeys[BundleAsset::makeKey($asset)])) { + // Ignoring because it is already associated + continue; + } + // Creating because it is not associated yet + BundleAsset::create([ + 'bundle_id' => $this->id, + 'asset_type' => $asset::class, + 'asset_id' => $asset->id, + ]); + } + + $this->refresh(); + } + + public function addAsset(ProcessMakerModel $asset) + { + if (!BundleAsset::canExport($asset)) { + throw new ExporterNotSupported(); + } + + BundleAsset::create([ + 'bundle_id' => $this->id, + 'asset_type' => get_class($asset), + 'asset_id' => $asset->id, + ]); + } +} diff --git a/ProcessMaker/Models/BundleAsset.php b/ProcessMaker/Models/BundleAsset.php new file mode 100644 index 0000000000..47e38dab36 --- /dev/null +++ b/ProcessMaker/Models/BundleAsset.php @@ -0,0 +1,38 @@ +belongsTo(Bundle::class); + } + + public function asset() + { + return $this->morphTo(); + } + + public function getKeyAttribute() + { + return $this->asset_type . '-' . $this->asset_id; + } + + public static function makeKey(ProcessMakerModel $asset) + { + return $asset::class . '-' . $asset->id; + } +} diff --git a/ProcessMaker/Models/DevLink.php b/ProcessMaker/Models/DevLink.php new file mode 100644 index 0000000000..dd06ba149d --- /dev/null +++ b/ProcessMaker/Models/DevLink.php @@ -0,0 +1,117 @@ + $this->id, + 'redirect_uri' => route('devlink.index'), + ]; + + return $this->url . route('devlink.oauth-client', $params, false); + } + + public function getOauthRedirectUrl() + { + $params = http_build_query([ + 'client_id' => $this->client_id, + 'redirect_uri' => route('devlink.index'), + 'response_type' => 'code', + 'state' => $this->generateNewState(), + ]); + + return $this->url . '/oauth/authorize?' . $params; + } + + public function client() + { + return Http::withToken($this->access_token)->baseUrl($this->url)->throw(); + } + + private function generateNewState() + { + $uuid = (string) Str::orderedUuid(); + $this->state = $uuid; + $this->saveOrFail(); + + return $uuid; + } + + public function remoteBundles() + { + return $this->client()->get( + route('api.devlink.local-bundles', ['published' => true], false) + ); + } + + public function installRemoteBundle($bundleId) + { + $bundleInfo = $this->client()->get( + route('api.devlink.local-bundle', ['bundle' => $bundleId], false) + )->json(); + + $bundleExport = $this->client()->get( + route('api.devlink.export-local-bundle', ['bundle' => $bundleId], false) + )->json(); + + $bundle = Bundle::updateOrCreate( + [ + 'remote_id' => $bundleId, + 'dev_link_id' => $this->id, + ], + [ + 'name' => $bundleInfo['name'], + 'published' => $bundleInfo['published'], + 'locked' => $bundleInfo['locked'], + 'version' => $bundleInfo['version'], + ] + ); + + $assets = []; + foreach ($bundleExport['payloads'] as $payload) { + $assets[] = $this->import($payload); + } + + $bundle->syncAssets($assets); + } + + private function import(array $payload) + { + $importer = new Importer($payload, new Options([])); + $manifest = $importer->doImport(); + + return $manifest[$payload['root']]->model; + } + + public function installRemoteAsset(string $class, int $id) : ProcessMakerModel + { + $payload = $this->client()->get( + route('api.devlink.export-local-asset', ['class' => $class, 'id' => $id], false) + )->json(); + + return $this->import($payload); + } +} diff --git a/ProcessMaker/Models/Script.php b/ProcessMaker/Models/Script.php index ff952a7ff4..7751cb9215 100644 --- a/ProcessMaker/Models/Script.php +++ b/ProcessMaker/Models/Script.php @@ -6,6 +6,7 @@ use ProcessMaker\Contracts\ScriptInterface; use ProcessMaker\Exception\ConfigurationException; use ProcessMaker\Exception\ScriptLanguageNotSupported; +use ProcessMaker\ImportExport\Exporters\ScriptExporter; use ProcessMaker\Models\ScriptCategory; use ProcessMaker\Models\User; use ProcessMaker\ScriptRunners\ScriptRunner; diff --git a/ProcessMaker/Models/User.php b/ProcessMaker/Models/User.php index f447594869..1577aed56b 100644 --- a/ProcessMaker/Models/User.php +++ b/ProcessMaker/Models/User.php @@ -171,7 +171,7 @@ public static function boot() /** * Validation rules * - * @param \ProcessMaker\Models\User|null $existing + * @param User|null $existing * * @return array */ @@ -197,7 +197,7 @@ public static function rules(self $existing = null) /** * Validation rules specifically for the password * - * @param \ProcessMaker\Models\User|null $existing + * @param User|null $existing * * @return array */ @@ -279,6 +279,10 @@ public function hasPermissionsFor(...$resources) } }); + if ($this->is_administrator) { + $filtered->push('admin'); + } + return $filtered->values(); } diff --git a/ProcessMaker/Traits/Exportable.php b/ProcessMaker/Traits/Exportable.php index aa05a7104f..aa088d5f1c 100644 --- a/ProcessMaker/Traits/Exportable.php +++ b/ProcessMaker/Traits/Exportable.php @@ -2,6 +2,10 @@ namespace ProcessMaker\Traits; +use ProcessMaker\Enums\ExporterMap; +use ProcessMaker\Exception\ExporterNotSupported; +use ProcessMaker\ImportExport\Exporter; + trait Exportable { use HasUuids; @@ -21,4 +25,17 @@ public function preventSavingDiscardedModel() { $this->_preventSavingDiscardedModel = true; } + + public function export() + { + $exporterClass = ExporterMap::getExporterClassForModel($this); + if (!$exporterClass) { + throw new ExporterNotSupported(); + } + + $exporter = new Exporter(); + $exporter->export($this, $exporterClass); + + return $exporter->payload(); + } } diff --git a/database/factories/ProcessMaker/Models/BundleAssetFactory.php b/database/factories/ProcessMaker/Models/BundleAssetFactory.php new file mode 100644 index 0000000000..f52f5763a6 --- /dev/null +++ b/database/factories/ProcessMaker/Models/BundleAssetFactory.php @@ -0,0 +1,31 @@ + + */ +class BundleAssetFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'bundle_id' => function () { + return Bundle::factory()->create()->getKey(); + }, + 'asset_type' => Process::class, + 'asset_id' => function () { + return Process::factory()->create()->getKey(); + }, + ]; + } +} diff --git a/database/factories/ProcessMaker/Models/BundleFactory.php b/database/factories/ProcessMaker/Models/BundleFactory.php new file mode 100644 index 0000000000..448bd65820 --- /dev/null +++ b/database/factories/ProcessMaker/Models/BundleFactory.php @@ -0,0 +1,26 @@ + + */ +class BundleFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->name(), + 'published' => true, + 'locked' => false, + 'version' => 0, + ]; + } +} diff --git a/database/factories/ProcessMaker/Models/DevLinkFactory.php b/database/factories/ProcessMaker/Models/DevLinkFactory.php new file mode 100644 index 0000000000..6bb8390b5f --- /dev/null +++ b/database/factories/ProcessMaker/Models/DevLinkFactory.php @@ -0,0 +1,24 @@ + + */ +class DevLinkFactory extends Factory +{ + /** + * Define the model's default state. + * + * @return array + */ + public function definition(): array + { + return [ + 'name' => $this->faker->name(), + 'url' => $this->faker->url(), + ]; + } +} diff --git a/database/migrations/2024_08_26_183754_create_dev_links_table.php b/database/migrations/2024_08_26_183754_create_dev_links_table.php new file mode 100644 index 0000000000..9b58bff978 --- /dev/null +++ b/database/migrations/2024_08_26_183754_create_dev_links_table.php @@ -0,0 +1,39 @@ +id(); + $table->string('name'); + $table->string('url'); + $table->integer('client_id')->nullable(); + $table->string('client_secret')->nullable(); + $table->text('access_token')->nullable(); + $table->text('refresh_token')->nullable(); + $table->integer('expires_in')->nullable(); + $table->uuid('state')->unique()->nullable(); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('dev_links'); + } +} diff --git a/database/migrations/2024_09_16_171830_create_bundles_table.php b/database/migrations/2024_09_16_171830_create_bundles_table.php new file mode 100644 index 0000000000..8096bae299 --- /dev/null +++ b/database/migrations/2024_09_16_171830_create_bundles_table.php @@ -0,0 +1,32 @@ +id(); + $table->string('name'); + $table->foreignId('dev_link_id')->nullable()->index(); + $table->unsignedBigInteger('remote_id')->nullable(); + $table->boolean('published'); + $table->boolean('locked'); + $table->string('version'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('bundles'); + } +}; diff --git a/database/migrations/2024_09_16_172121_create_bundle_assets_table.php b/database/migrations/2024_09_16_172121_create_bundle_assets_table.php new file mode 100644 index 0000000000..e242eecc17 --- /dev/null +++ b/database/migrations/2024_09_16_172121_create_bundle_assets_table.php @@ -0,0 +1,28 @@ +id(); + $table->foreignId('bundle_id'); + $table->morphs('asset'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::dropIfExists('bundle_assets'); + } +}; diff --git a/package.json b/package.json index 9e92914283..31c064af22 100644 --- a/package.json +++ b/package.json @@ -28,11 +28,11 @@ "babel-plugin-istanbul": "^6.1.1", "chartjs-plugin-colorschemes": "^0.4.0", "cross-env": "^7.0.3", - "eslint": "^8.2.0", + "eslint": "^8.57.0", "eslint-config-airbnb-base": "^15.0.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-jest": "^26.1.5", - "eslint-plugin-vue": "^7.20.0", + "eslint-plugin-vue": "^9.27.0", "expr-eval": "^2.0.2", "js-yaml-loader": "^1.2.2", "laravel-mix": "^6.0.49", @@ -41,7 +41,8 @@ "resolve-url-loader": "^3.1.2", "sass": "^1.77.4", "sass-loader": "^12.6.0", - "vue-loader": "^15.10.0" + "vue-loader": "^15.10.0", + "vue-template-compiler": "^2.7.16" }, "dependencies": { "@babel/runtime": "^7.23.8", @@ -96,7 +97,7 @@ "tinymce": "5.10.0", "tooltip.js": "^1.3.3", "v-tooltip": "^2.0.3", - "vue": "^2.6.14", + "vue": "^2.7.16", "vue-chartjs": "^3.5.0", "vue-color": "^2.7.1", "vue-cookies": "^1.8.2", @@ -107,9 +108,8 @@ "vue-monaco": "^1.2.1", "vue-password": "^1.2.0", "vue-resource": "^1.5.1", - "vue-router": "^3.4.9", + "vue-router": "^3.6.5", "vue-simple-uploader": "^0.7.6", - "vue-template-compiler": "^2.6.12", "vue-uniq-ids": "^1.0.0", "vuedraggable": "^2.24.3", "vuetable-2": "^1.7.5", diff --git a/resources/js/admin/devlink/common.js b/resources/js/admin/devlink/common.js new file mode 100644 index 0000000000..a55720708a --- /dev/null +++ b/resources/js/admin/devlink/common.js @@ -0,0 +1,22 @@ +import { reactive, onMounted } from "vue"; +import { useRouter } from "vue-router/composables"; + +const store = reactive({ + selectedInstance: { + id: null, + name: '', + }, +}); + +const loadInstance = () => { + const router = useRouter(); + const instanceId = router.currentRoute.params.id; + + if (instanceId && (!store.selectedInstance.id || store.selectedInstance.id !== instanceId)) { + window.ProcessMaker.apiClient.get(`/devlink/${instanceId}`).then((response) => { + store.selectedInstance = response.data; + }); + } +}; + +export { store, loadInstance } \ No newline at end of file diff --git a/resources/js/admin/devlink/components/AssetListing.vue b/resources/js/admin/devlink/components/AssetListing.vue new file mode 100644 index 0000000000..c194cc01d1 --- /dev/null +++ b/resources/js/admin/devlink/components/AssetListing.vue @@ -0,0 +1,98 @@ + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/Assets.vue b/resources/js/admin/devlink/components/Assets.vue new file mode 100644 index 0000000000..549fb0a73a --- /dev/null +++ b/resources/js/admin/devlink/components/Assets.vue @@ -0,0 +1,31 @@ + + + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/DevLink.vue b/resources/js/admin/devlink/components/DevLink.vue new file mode 100644 index 0000000000..0207eeee97 --- /dev/null +++ b/resources/js/admin/devlink/components/DevLink.vue @@ -0,0 +1,29 @@ + + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/Index.vue b/resources/js/admin/devlink/components/Index.vue new file mode 100644 index 0000000000..a3ee4d7899 --- /dev/null +++ b/resources/js/admin/devlink/components/Index.vue @@ -0,0 +1,157 @@ + + + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/Instance.vue b/resources/js/admin/devlink/components/Instance.vue new file mode 100644 index 0000000000..d0beba8840 --- /dev/null +++ b/resources/js/admin/devlink/components/Instance.vue @@ -0,0 +1,77 @@ + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/InstanceTabs.vue b/resources/js/admin/devlink/components/InstanceTabs.vue new file mode 100644 index 0000000000..8003ae9c3e --- /dev/null +++ b/resources/js/admin/devlink/components/InstanceTabs.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/LocalBundles.vue b/resources/js/admin/devlink/components/LocalBundles.vue new file mode 100644 index 0000000000..885922cd28 --- /dev/null +++ b/resources/js/admin/devlink/components/LocalBundles.vue @@ -0,0 +1,149 @@ + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/Status.vue b/resources/js/admin/devlink/components/Status.vue new file mode 100644 index 0000000000..ff975c550e --- /dev/null +++ b/resources/js/admin/devlink/components/Status.vue @@ -0,0 +1,29 @@ + + + \ No newline at end of file diff --git a/resources/js/admin/devlink/components/assetTypes.js b/resources/js/admin/devlink/components/assetTypes.js new file mode 100644 index 0000000000..af2b31a2c6 --- /dev/null +++ b/resources/js/admin/devlink/components/assetTypes.js @@ -0,0 +1,20 @@ +export default [ + { + type: 'processes', + name: 'Processes', + url: '/processes', + class: 'ProcessMaker\\Models\\Process', + }, + { + type: 'screens', + name: 'Screens', + url: '/screens', + class: 'ProcessMaker\\Models\\Screen', + }, + { + type: 'scripts', + name: 'Scripts', + url: '/scripts', + class: 'ProcessMaker\\Models\\Script', + }, +]; \ No newline at end of file diff --git a/resources/js/admin/devlink/index.js b/resources/js/admin/devlink/index.js new file mode 100644 index 0000000000..cd77d65669 --- /dev/null +++ b/resources/js/admin/devlink/index.js @@ -0,0 +1,47 @@ +import Vue from "vue"; +import DevLink from "./components/DevLink"; +import Index from "./components/Index"; +import Instance from "./components/Instance"; +import LocalBundles from "./components/LocalBundles"; +import Assets from "./components/Assets"; +import AssetListing from "./components/AssetListing"; + +Vue.use(VueRouter); +const router = new VueRouter({ + mode: "history", + base: "/admin/devlink", + //See https://v3.router.vuejs.org/guide/ + routes: [ + { + name: "index", + path: "/", + component: Index, + }, + { + name: "instance", + path: "/instance/:id", + component: Instance, + }, + { + name: "local-bundles", + path: "/local-bundles", + component: LocalBundles, + }, + { + name: 'assets', + path: '/instance/:id/assets', + component: Assets, + }, + { + name: 'asset-listing', + path: '/instance/:id/assets/:type', + component: AssetListing, + } + ] +}); + +new Vue({ + el: "#devlink", + router, + components: { DevLink }, +}); diff --git a/resources/js/components/shared/AddToBundle.vue b/resources/js/components/shared/AddToBundle.vue new file mode 100644 index 0000000000..6f150c174e --- /dev/null +++ b/resources/js/components/shared/AddToBundle.vue @@ -0,0 +1,57 @@ + + + \ No newline at end of file diff --git a/resources/js/components/shared/BackendSelect.vue b/resources/js/components/shared/BackendSelect.vue new file mode 100644 index 0000000000..8d125dfb5d --- /dev/null +++ b/resources/js/components/shared/BackendSelect.vue @@ -0,0 +1,45 @@ + + + \ No newline at end of file diff --git a/resources/js/components/shared/EllipsisMenu.vue b/resources/js/components/shared/EllipsisMenu.vue index ec4a114209..5b78eb5fab 100644 --- a/resources/js/components/shared/EllipsisMenu.vue +++ b/resources/js/components/shared/EllipsisMenu.vue @@ -167,6 +167,10 @@ export default { }, methods: { onClick(action, data) { + if (action.emit_on_root) { + this.$root.$emit(action.emit_on_root, data); + return; + } this.$emit("navigate", action, data); }, itemLink(action, data) { diff --git a/resources/js/components/shared/ellipsisMenuActions.js b/resources/js/components/shared/ellipsisMenuActions.js index ebf3a52f1d..fad1557134 100644 --- a/resources/js/components/shared/ellipsisMenuActions.js +++ b/resources/js/components/shared/ellipsisMenuActions.js @@ -64,6 +64,13 @@ export default { icon: "fas fa-folder-plus", permission: "create-projects", }, + { + value: "add-to-bundle", + content: "Add to Bundle", + icon: "fas fa-folder-plus", + permission: "admin", + emit_on_root: 'add-to-bundle', + }, { value: "edit-item", content: "Configure", diff --git a/resources/js/processes/components/ProcessesListing.vue b/resources/js/processes/components/ProcessesListing.vue index 4cf693631c..6c99c5e3d4 100644 --- a/resources/js/processes/components/ProcessesListing.vue +++ b/resources/js/processes/components/ProcessesListing.vue @@ -159,6 +159,7 @@ @vuetable-pagination:change-page="onPageChange" /> + @@ -175,6 +176,7 @@ import AddToProjectModal from "../../components/shared/AddToProjectModal.vue"; import processNavigationMixin from "../../components/shared/processNavigation"; import paginationTable from "../../components/shared/PaginationTable.vue"; import FilterTableBodyMixin from "../../components/shared/FilterTableBodyMixin"; +import AddToBundle from "../../components/shared/AddToBundle.vue"; import ProcessMixin from "./ProcessMixin"; const uniqIdsMixin = createUniqIdsMixin(); @@ -187,6 +189,7 @@ export default { CreatePmBlockModal, AddToProjectModal, paginationTable, + AddToBundle, }, mixins: [datatableMixin, dataLoadingMixin, uniqIdsMixin, ellipsisMenuMixin, processNavigationMixin, FilterTableBodyMixin, ProcessMixin], props: ["filter", "id", "status", "permission", "isDocumenterInstalled", "pmql", "processName", "currentUserId"], diff --git a/resources/views/admin/devlink/index.blade.php b/resources/views/admin/devlink/index.blade.php new file mode 100644 index 0000000000..8f428119c3 --- /dev/null +++ b/resources/views/admin/devlink/index.blade.php @@ -0,0 +1,26 @@ +@extends('layouts.layout') + +@section('title') + {{__('DevLink')}} +@endsection + +@section('sidebar') + @include('layouts.sidebar', ['sidebar'=> Menu::get('sidebar_admin')]) +@endsection + +@section('breadcrumbs') + @include('shared.breadcrumbs', ['routes' => [ + __('Admin') => route('admin.index'), + __('DevLink') => null, + ]]) +@endsection +@section('content') + +@endsection + + +@section('js') + +@endsection diff --git a/resources/views/admin/devlink/index.client.php b/resources/views/admin/devlink/index.client.php new file mode 100644 index 0000000000..f807bdb676 --- /dev/null +++ b/resources/views/admin/devlink/index.client.php @@ -0,0 +1,11 @@ + + + + + + + \ No newline at end of file diff --git a/routes/api.php b/routes/api.php index 4e55539bbe..481dc13526 100644 --- a/routes/api.php +++ b/routes/api.php @@ -6,6 +6,7 @@ use ProcessMaker\Http\Controllers\Api\CommentController; use ProcessMaker\Http\Controllers\Api\CssOverrideController; use ProcessMaker\Http\Controllers\Api\DebugController; +use ProcessMaker\Http\Controllers\Api\DevLinkController; use ProcessMaker\Http\Controllers\Api\EnvironmentVariablesController; use ProcessMaker\Http\Controllers\Api\ExportController; use ProcessMaker\Http\Controllers\Api\FileController; @@ -364,4 +365,30 @@ // Recommendations Route::get('recommendations', [RecommendationsController::class, 'index'])->name('recommendations.index'); Route::put('recommendations/{recommendationUser}', [RecommendationsController::class, 'update'])->name('recommendations.update'); + + // DevLink + Route::middleware('admin')->group(function () { + Route::get('devlink', [DevLinkController::class, 'index'])->name('devlink.index'); + Route::post('devlink', [DevLinkController::class, 'store'])->name('devlink.store'); + Route::put('devlink/{devLink}', [DevLinkController::class, 'update'])->name('devlink.update'); + Route::delete('devlink/{devLink}', [DevLinkController::class, 'destroy'])->name('devlink.destroy'); + Route::get('devlink/{devLink}/ping', [DevLinkController::class, 'ping'])->name('devlink.ping'); + Route::get('devlink/pong', [DevLinkController::class, 'pong'])->name('devlink.pong'); + Route::get('devlink/{devLink}/remote-bundles', [DevLinkController::class, 'remoteBundles'])->name('devlink.remote-bundles'); + + Route::get('devlink/local-bundles', [DevLinkController::class, 'localBundles'])->name('devlink.local-bundles'); + Route::get('devlink/local-bundles/{bundle}', [DevLinkController::class, 'showBundle'])->name('devlink.local-bundle'); + Route::post('devlink/local-bundles', [DevLinkController::class, 'createBundle'])->name('devlink.create-bundle'); + Route::put('devlink/local-bundles/{bundle}', [DevLinkController::class, 'updateBundle'])->name('devlink.update-bundle'); + Route::post('devlink/local-bundles/{bundle}/add-assets', [DevLinkController::class, 'addAsset'])->name('devlink.add-asset'); + Route::delete('devlink/local-bundles/{bundle}', [DevLinkController::class, 'deleteBundle'])->name('devlink.delete-bundle'); + Route::get('devlink/export-local-bundle/{bundle}', [DevLinkController::class, 'exportLocalBundle'])->name('devlink.export-local-bundle'); + Route::get('devlink/export-local-asset', [DevLinkController::class, 'exportLocalAsset'])->name('devlink.export-local-asset'); + + Route::post('devlink/{devLink}/remote-bundles/{removeBundleId}/install', [DevLinkController::class, 'installRemoteBundle'])->name('devlink.install-remote-bundle'); + Route::post('devlink/{devLink}/install-remote-asset', [DevLinkController::class, 'installRemoteAsset'])->name('devlink.install-remote-asset'); + + // Put these last to avoid conflicts with the other devlink routes + Route::get('devlink/{devLink}', [DevLinkController::class, 'show'])->name('devlink.show'); + }); }); diff --git a/routes/web.php b/routes/web.php index c3848838a7..73d17e71ee 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,6 +4,7 @@ use ProcessMaker\Http\Controllers\AboutController; use ProcessMaker\Http\Controllers\Admin\AuthClientController; use ProcessMaker\Http\Controllers\Admin\CssOverrideController; +use ProcessMaker\Http\Controllers\Admin\DevLinkController; use ProcessMaker\Http\Controllers\Admin\GroupController; use ProcessMaker\Http\Controllers\Admin\LdapLogsController; use ProcessMaker\Http\Controllers\Admin\QueuesController; @@ -60,6 +61,12 @@ Route::get('script-executors', [ScriptExecutorController::class, 'index'])->name('script-executors.index'); + // DevLink + Route::middleware('admin')->group(function () { + Route::get('devlink/oauth-client', [DevLinkController::class, 'getOauthClient'])->name('devlink.oauth-client'); + Route::get('devlink/{router?}', [DevLinkController::class, 'index'])->where(['router' => '.*'])->name('devlink.index'); + }); + // temporary, should be removed Route::get('security-logs/download/all', [ProcessMaker\Http\Controllers\Api\SecurityLogController::class, 'downloadForAllUsers'])->middleware('can:view-security-logs'); Route::get('security-logs/download/{user}', [ProcessMaker\Http\Controllers\Api\SecurityLogController::class, 'downloadForUser'])->middleware('can:view-security-logs'); diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index 69c5c73edd..424955fc53 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -18,54 +18,14 @@ } ], "paths": { - "/customize-ui": { - "post": { - "tags": [ - "CssSettings" - ], - "summary": "Create or update a new setting", - "description": "Create a new Settings css-override", - "operationId": "updateCssSetting", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "variables": { - "type": "string" - }, - "sansSerifFont": { - "type": "string" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/settings" - } - } - } - } - } - } - }, - "/environment_variables": { + "/analytics-reporting": { "get": { "tags": [ - "Environment Variables" + "AnalyticsReporting" ], - "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", - "description": "Fetch a collection of variables based on paged request and filter if provided", - "operationId": "getEnvironmentVariables", + "summary": "Returns all analytics reporting that the user has access to", + "description": "Get a list of Analytics Reporting.", + "operationId": "getAnalyticsReporting", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -85,7 +45,7 @@ ], "responses": { "200": { - "description": "list of environmentVariables", + "description": "list of analytics reporting", "content": { "application/json": { "schema": { @@ -93,11 +53,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/analyticsReporting" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -109,17 +69,17 @@ }, "post": { "tags": [ - "Environment Variables" + "AnalyticsReporting" ], - "summary": "Create a new environment variable", - "description": "Creates a new global Environment Variable in the system", - "operationId": "createEnvironmentVariable", + "summary": "Save a new Analytics Reporting", + "description": "Create a new Analytics Reporting.", + "operationId": "createAnalyticsReporting", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/analyticsReportingEditable" } } } @@ -130,7 +90,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/analyticsReporting" } } } @@ -138,32 +98,32 @@ } } }, - "/environment_variables/{environment_variable_id}": { + "/analytics-reporting/{analytic_reporting_id}": { "get": { "tags": [ - "Environment Variables" + "AnalyticsReporting" ], - "summary": "Get an environment variable by id. For security, the value is not included.", - "description": "Return an environment variable instance\nUsing implicit model binding, will automatically return 404 if variable now found", - "operationId": "getEnvironmentVariableById", + "summary": "Get single analytic reporting by ID", + "description": "Get a single Analytic Reporting.", + "operationId": "getAnalyticReportingById", "parameters": [ { - "name": "environment_variable_id", + "name": "analytic_reporting_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of analytic reporting to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the analytics reporting", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/analyticsReporting" } } } @@ -172,19 +132,19 @@ }, "put": { "tags": [ - "Environment Variables" + "AnalyticsReporting" ], - "summary": "Update an environment variable", - "description": "Update an environment variable", - "operationId": "updateEnvironmentVariable", + "summary": "Update a analytic reporting", + "description": "Update a Analytics Reporting.", + "operationId": "updateAnalyticReporting", "parameters": [ { - "name": "environment_variable_id", + "name": "analytic_reporting_id", "in": "path", - "description": "ID of environment variables to update", + "description": "ID of analytic reporting to update", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -193,56 +153,50 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/analyticsReportingEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" - } - } - } + "204": { + "description": "success" } } }, "delete": { "tags": [ - "Environment Variables" + "AnalyticsReporting" ], - "summary": "Delete an environment variable", - "operationId": "deleteEnvironmentVariable", + "summary": "Delete an analytic reporting", + "description": "Delete a Analytics Reporting.", + "operationId": "deleteAnalyticReporting", "parameters": [ { - "name": "environment_variable_id", + "name": "analytic_reporting_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of analytic reporting to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "200": { + "204": { "description": "success" } } } }, - "/files": { + "/collections": { "get": { "tags": [ - "Files" + "Collections" ], - "summary": "Returns the list of files", - "description": "Display a listing of the resource.", - "operationId": "getFiles", + "summary": "Returns all collections that the user has access to", + "description": "Get a list of Collections.", + "operationId": "getCollections", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -255,11 +209,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of files", + "description": "list of collections", "content": { "application/json": { "schema": { @@ -267,7 +224,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/collections" } }, "meta": { @@ -283,87 +240,28 @@ }, "post": { "tags": [ - "Files" - ], - "summary": "Save a new media file. Note: To upload files to a request, use createRequestFile in the RequestFile API", - "description": "Store a newly created resource in storage.", - "operationId": "createFile", - "parameters": [ - { - "name": "model_id", - "in": "query", - "description": "ID of the model to which the file will be associated", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "model", - "in": "query", - "description": "Full namespaced class of the model to associate", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "data_name", - "in": "query", - "description": "Name of the variable used in a request", - "required": false, - "schema": { - "type": "string" - } - }, - { - "name": "collection", - "in": "query", - "description": "Media collection name. For requests, use 'default'", - "required": false, - "schema": { - "type": "string" - } - } + "Collections" ], + "summary": "Save a new collections", + "description": "Create a new Collection.", + "operationId": "createCollection", "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "save a new media file", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/collectionsEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "id": { - "type": "string" - }, - "model_id": { - "type": "string" - }, - "file_name": { - "type": "string" - }, - "mime_type": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/collections" } } } @@ -371,137 +269,238 @@ } } }, - "/files/{file_id}": { + "/collections/{collection_id}": { "get": { "tags": [ - "Files" + "Collections" ], - "summary": "Get the metadata of a file. To actually fetch the file see Get File Contents", - "description": "Get a single media file.", - "operationId": "getFileById", + "summary": "Get single collections by ID", + "description": "Get a single Collection.", + "operationId": "getCollectionById", "parameters": [ { - "name": "file_id", + "name": "collection_id", "in": "path", - "description": "ID of the file to return", + "description": "ID of collection to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the file", + "description": "Successfully found the collections", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/collections" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, - "delete": { + "put": { "tags": [ - "Files" + "Collections" ], - "summary": "Delete a media file", - "description": "Remove the specified resource from storage.", - "operationId": "deleteFile", + "summary": "Update a collection", + "description": "Update a Collection.", + "operationId": "updateCollection", "parameters": [ { - "name": "file_id", + "name": "collection_id", "in": "path", - "description": "ID of the file", + "description": "ID of collection to update", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collectionsEditable" + } + } + } + }, "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } - } - }, - "/files/{file_id}/contents": { - "get": { + }, + "delete": { "tags": [ - "Files" + "Collections" ], - "summary": "Get the contents of a file", - "description": "Display the specified resource.", - "operationId": "getFileContentsById", + "summary": "Delete a collection", + "description": "Delete a Collection.", + "operationId": "deleteCollection", "parameters": [ { - "name": "file_id", + "name": "collection_id", "in": "path", - "description": "ID of the file to return", + "description": "ID of collection to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "200": { - "description": "File stream", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" + "204": { + "description": "success" } } } }, - "/groups": { - "get": { + "/collections/{collection_id}/export": { + "post": { "tags": [ - "Groups" + "Screens" ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getGroups", + "summary": "Trigger export collections job", + "description": "Export the specified collection.", + "operationId": "exportCollection", "parameters": [ { - "$ref": "#/components/parameters/status" - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" + "name": "collection_id", + "in": "path", + "description": "ID of the collection to export", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "202": { + "description": "success" + } + } + } + }, + "/collections/import": { + "post": { + "tags": [ + "Collections" + ], + "summary": "Import a new collection", + "description": "Import the specified collection.", + "operationId": "importCollection", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "required": [ + "file" + ], + "properties": { + "file": { + "description": "file to upload", + "type": "file", + "format": "file" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collections" + } + } + } }, + "200": { + "description": "success" + } + } + } + }, + "/collections/{collection_id}/truncate": { + "delete": { + "tags": [ + "Collections" + ], + "summary": "Deletes all records in a collection", + "description": "Truncate a Collection.", + "operationId": "truncateCollection", + "parameters": [ { - "$ref": "#/components/parameters/order_direction" + "name": "collection_id", + "in": "path", + "description": "ID of collection to truncate", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/collections/{collection_id}/records": { + "get": { + "tags": [ + "Collections" + ], + "summary": "Returns all records", + "description": "Get the list of records of a collection.", + "operationId": "getRecords", + "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of collection to get records for", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "pmql", + "in": "query", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/per_page" }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, { "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of groups", + "description": "list of records of a collection", "content": { "application/json": { "schema": { @@ -509,7 +508,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/records" } }, "meta": { @@ -525,17 +524,28 @@ }, "post": { "tags": [ - "Groups" + "Collections" + ], + "summary": "Save a new record in a collection", + "description": "Create a new record in a Collection.", + "operationId": "createRecord", + "parameters": [ + { + "name": "collection_id", + "in": "path", + "description": "ID of the collection", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Save a new group", - "description": "Store a newly created resource in storage.", - "operationId": "createGroup", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/recordsEditable" } } } @@ -546,67 +556,79 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/records" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/groups/{group_id}": { + "/collections/{collection_id}/records/{record_id}": { "get": { "tags": [ - "Groups" + "Collections" ], - "summary": "Get single group by ID", - "description": "Display the specified resource.", - "operationId": "getGroupById", + "summary": "Get single record of a collection", + "description": "Get a single record of a Collection.", + "operationId": "getRecordById", "parameters": [ { - "name": "group_id", + "name": "collection_id", "in": "path", - "description": "ID of group to return", + "description": "ID of the collection", "required": true, "schema": { - "type": "integer" + "type": "string" + } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of the record to return", + "required": true, + "schema": { + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the group", + "description": "Successfully found the record", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/records" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Groups" + "Collections" ], - "summary": "Update a group", - "description": "Update a user", - "operationId": "updateGroup", + "summary": "Update a record", + "description": "Update a record in a Collection.", + "operationId": "updateRecord", "parameters": [ { - "name": "group_id", + "name": "collection_id", "in": "path", - "description": "ID of group to return", + "description": "ID of collection", "required": true, "schema": { - "type": "integer" + "type": "string" + } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of the record ", + "required": true, + "schema": { + "type": "string" } } ], @@ -615,7 +637,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupsEditable" + "$ref": "#/components/schemas/recordsEditable" } } } @@ -623,107 +645,100 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "Groups" + "Collections" ], - "summary": "Delete a group", - "description": "Delete a user", - "operationId": "deleteGroup", + "summary": "Delete a collection record", + "description": "Delete a record of a Collection.", + "operationId": "deleteRecord", "parameters": [ { - "name": "group_id", + "name": "collection_id", "in": "path", - "description": "ID of group to return", + "description": "ID of collection", "required": true, "schema": { - "type": "integer" + "type": "string" + } + }, + { + "name": "record_id", + "in": "path", + "description": "ID of record in collection", + "required": true, + "schema": { + "type": "string" } } ], "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } - } - }, - "/groups/{group_id}/users": { - "get": { + }, + "patch": { "tags": [ - "Groups" + "Collections" ], - "summary": "Returns all users of a group", - "description": "Display the list of users in a group", - "operationId": "getGroupUsers", + "summary": "Partial update of a record", + "description": "Implements a partial update of a record in a Collection.", + "operationId": "patchRecord", "parameters": [ { - "name": "group_id", + "name": "collection_id", "in": "path", - "description": "ID of group", + "description": "ID of collection ", "required": true, "schema": { - "type": "integer" + "type": "string" } }, { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" + "name": "record_id", + "in": "path", + "description": "ID of the record ", + "required": true, + "schema": { + "type": "string" + } } ], - "responses": { - "200": { - "description": "list of members of a group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/collectionsEditable" } } } + }, + "responses": { + "200": { + "description": "success" + } } } }, - "/groups/{group_id}/groups": { + "/comments/tasks": { "get": { "tags": [ - "Groups" + "Comments" ], - "summary": "Returns all users of a group", - "description": "Display the list of groups in a group", - "operationId": "getGroupGroupss", + "summary": "Returns all the tasks that are active.", + "description": "Display a listing of the resource.", + "operationId": "getCommentTasks", "parameters": [ { - "name": "group_id", - "in": "path", - "description": "ID of group", - "required": true, + "name": "process_request_id", + "in": "query", + "description": "Process request id", + "required": false, "schema": { "type": "integer" } @@ -732,15 +747,15 @@ "$ref": "#/components/parameters/filter" }, { - "$ref": "#/components/parameters/order_direction" + "$ref": "#/components/parameters/order_by" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/order_direction" } ], "responses": { "200": { - "description": "list of members of a group", + "description": "list all tasks taht are active", "content": { "application/json": { "schema": { @@ -748,7 +763,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groups" + "$ref": "#/components/schemas/processRequestToken" } }, "meta": { @@ -763,17 +778,17 @@ } } }, - "/group_members": { + "/data_source_categories": { "get": { "tags": [ - "Group Members" + "DataSourcesCategories" ], - "summary": "Returns all groups for a given member", - "description": "Display a listing of the resource.", - "operationId": "getGroupMembers", + "summary": "Returns all Data Connectors categories that the user has access to", + "description": "Display a listing of the Data Connector Categories.", + "operationId": "getDataSourceCategories", "parameters": [ { - "$ref": "#/components/parameters/member_id" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -787,7 +802,7 @@ ], "responses": { "200": { - "description": "list of group_members", + "description": "list of Data Connectors categories", "content": { "application/json": { "schema": { @@ -795,13 +810,18 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/groupMembers" + "$ref": "#/components/schemas/DataSourceCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" - } - }, + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, "type": "object" } } @@ -811,17 +831,17 @@ }, "post": { "tags": [ - "Group Members" + "DataSourcesCategories" ], - "summary": "Save a new group member", - "description": "Store a newly created resource in storage.", - "operationId": "createGroupMember", + "summary": "Save a new Data Connector Category", + "description": "Store a newly created Data Connector Category in storage", + "operationId": "createDataSourceCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/groupMembersEditable" + "$ref": "#/components/schemas/dataSourceCategoryEditable" } } } @@ -832,7 +852,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/createGroupMembers" + "$ref": "#/components/schemas/DataSourceCategory" } } } @@ -840,19 +860,19 @@ } } }, - "/group_members/{group_member_id}": { + "/data_source_categories/{data_source_category_id}": { "get": { "tags": [ - "Group Members" + "DataSourcesCategories" ], - "summary": "Get single group member by ID", - "description": "Display the specified resource.", - "operationId": "getGroupMemberById", + "summary": "Get single Data Connector category by ID", + "description": "Display the specified data Source category.", + "operationId": "getDatasourceCategoryById", "parameters": [ { - "name": "group_member_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of group members to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" @@ -861,186 +881,92 @@ ], "responses": { "200": { - "description": "Successfully found the group members", + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/getGroupMembersById" + "$ref": "#/components/schemas/DataSourceCategory" } } } } } }, - "delete": { + "put": { "tags": [ - "Group Members" + "DataSourcesCategories" ], - "summary": "Delete a group member", - "description": "Delete a group membership", - "operationId": "deleteGroupMember", + "summary": "Update a Data Connector Category", + "description": "Updates the current element", + "operationId": "updateDatasourceCategory", "parameters": [ { - "name": "group_member_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of group_members to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" } } ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/group_members_available": { - "get": { - "tags": [ - "Group Members" - ], - "summary": "Returns all groups available for a given member", - "description": "Display a listing of groups available", - "operationId": "getGroupMembersAvailable", - "parameters": [ - { - "name": "member_id", - "in": "path", - "description": "ID of group member to return", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "member_type", - "in": "path", - "description": "type of group member to return", - "required": true, - "schema": { - "type": "string" + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dataSourceCategoryEditable" + } } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } - ], + }, "responses": { "200": { - "description": "list of groups available to be assigned as member", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/availableGroupMembers" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/DataSourceCategory" } } } } } - } - }, - "/user_members_available": { - "get": { + }, + "delete": { "tags": [ - "Group Members" + "DataSourcesCategories" ], - "summary": "Returns all users available for a given group", - "description": "Display a listing of users available", - "operationId": "getUserMembersAvailable", + "summary": "Delete a Data Connector category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteDataSourceCategory", "parameters": [ { - "name": "group_id", + "name": "data_source_category_id", "in": "path", - "description": "ID of group to return", + "description": "ID of Data Connector category to return", "required": true, "schema": { "type": "string" } - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name. Can be a substring.", - "schema": { - "type": "string" - } - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { - "200": { - "description": "list of users available to be assigned as member", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/users" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/notifications": { + "/data_sources": { "get": { "tags": [ - "Notifications" + "DataSources" ], - "summary": "Returns all notifications that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getNotifications", + "summary": "Returns all Data Connectors that the user has access to", + "description": "Get the list of records of a Data Connector", + "operationId": "getDataSources", "parameters": [ - { - "name": "status", - "in": "query", - "description": "Only return notifications by status (unread, all, etc.)", - "required": false, - "schema": { - "type": "string" - } - }, { "$ref": "#/components/parameters/filter" }, @@ -1059,7 +985,7 @@ ], "responses": { "200": { - "description": "list of notifications", + "description": "list of Data Connectors", "content": { "application/json": { "schema": { @@ -1067,10 +993,17 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/dataSource" } }, - "meta": {} + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } }, "type": "object" } @@ -1081,17 +1014,17 @@ }, "post": { "tags": [ - "Notifications" + "DataSources" ], - "summary": "Save a new notifications", - "description": "Store a newly created resource in storage.", - "operationId": "createNotification", + "summary": "Save a new Data Connector", + "description": "Create a new Data Connector.", + "operationId": "createDataSource", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } @@ -1102,7 +1035,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/dataSource" } } } @@ -1110,19 +1043,19 @@ } } }, - "/notifications/{notification_id}": { + "/data_sources/{data_source_id}": { "get": { "tags": [ - "Notifications" + "DataSources" ], - "summary": "Get single notification by ID", - "description": "Display the specified resource.", - "operationId": "getNotificationById", + "summary": "Get single Data Connector by ID", + "description": "Get a single Data Connector.", + "operationId": "getDataSourceById", "parameters": [ { - "name": "notification_id", + "name": "data_source_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1131,11 +1064,11 @@ ], "responses": { "200": { - "description": "Successfully found the notification", + "description": "Successfully found the Data Connector", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Notification" + "$ref": "#/components/schemas/dataSource" } } } @@ -1144,16 +1077,16 @@ }, "put": { "tags": [ - "Notifications" + "DataSources" ], - "summary": "Update a notification", - "description": "Update a user", - "operationId": "updateNotification", + "summary": "Update a Data Connector", + "description": "Update a Data Connector.", + "operationId": "updateDataSource", "parameters": [ { - "name": "notification_id", + "name": "data_source_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1165,29 +1098,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NotificationEditable" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dataSource" + } + } + } } } }, "delete": { "tags": [ - "Notifications" + "DataSources" ], - "summary": "Delete a notification", - "description": "Delete a notification", - "operationId": "deleteNotification", + "summary": "Delete a Data Connector", + "description": "Delete a Data Connector.", + "operationId": "deleteDataSource", "parameters": [ { - "name": "notification_id", + "name": "data_source_id", "in": "path", - "description": "ID of notification to return", + "description": "ID of Data Connector to return", "required": true, "schema": { "type": "string" @@ -1196,79 +1136,97 @@ ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dataSource" + } + } + } } } } }, - "/read_notifications": { - "put": { + "/data_sources/{data_source_id}/test": { + "post": { "tags": [ - "Notifications" + "DataSources" + ], + "summary": "Send a Data Connector request", + "description": "Send a Data Connector request.", + "operationId": "sendDataSource", + "parameters": [ + { + "name": "data_source_id", + "in": "path", + "description": "ID of Data Connector to return", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Mark notifications as read by the user", - "description": "Update notification as read", - "operationId": "markNotificationAsRead", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "properties": { - "message_ids": { - "description": "list of message ids that will be marked as read", - "type": "array", - "items": { - "type": "string" - } - }, - "routes": { - "description": "all messages that has an url that is in this list will be marked as read", - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" + "$ref": "#/components/schemas/dataSourceEditable" } } } }, "responses": { - "201": { - "description": "success" - } - } + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/dataSource" + } + } + } + } + } } }, - "/unread_notifications": { - "put": { + "/requests/{request_id}/data_sources/{data_source_id}": { + "post": { "tags": [ - "Notifications" + "DataSources" + ], + "summary": "execute Data Source", + "description": "Execute a data Source endpoint", + "operationId": "executeDataSourceForRequest", + "parameters": [ + { + "name": "request_id", + "in": "path", + "description": "ID of the request in whose context the datasource will be executed", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Mark notifications as unread by the user", - "description": "Update notifications as unread", - "operationId": "markNotificationAsUnread", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "message_ids": { - "description": "list of message ids that will be marked as read", - "type": "array", - "items": { - "type": "string" - } - }, - "routes": { - "description": "all messages that has an url that is in this list will be marked as read", - "type": "array", - "items": { - "type": "string" - } + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" } }, "type": "object" @@ -1277,33 +1235,48 @@ } }, "responses": { - "201": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceResponse" + } + } + } } } } }, - "/read_all_notifications": { - "put": { + "/requests/data_sources/{data_source_id}": { + "post": { "tags": [ - "Notifications" + "DataSources" + ], + "summary": "execute Data Source", + "operationId": "executeDataSource", + "parameters": [ + { + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, + "schema": { + "type": "string" + } + } ], - "summary": "Mark notifications as read by id and type", - "description": "Update all notification as read.", - "operationId": "markAllAsRead", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "id": { - "description": "Polymorphic relation id", - "type": "integer" + "config": { + "$ref": "#/components/schemas/DataSourceCallParameters" }, - "type": { - "description": "Polymorphic relation type", - "type": "string" + "data": { + "type": "object" } }, "type": "object" @@ -1312,74 +1285,71 @@ } }, "responses": { - "201": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceResponse" + } + } + } } } } }, - "/permissions": { - "put": { + "/requests/data_sources/{data_source_id}/resources/{endpoint}/data": { + "post": { "tags": [ - "Permissions" + "DataSources" ], - "summary": "Update the permissions of a user", - "description": "Update permissions", - "operationId": "51b3555fb753f44324bf5c3880e01454", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "user_id": { - "description": "ID of the user whose permissions are configured", - "type": "integer" - }, - "group_id": { - "description": "ID of the group whose permissions are configured", - "type": "integer" - }, - "is_administrator": { - "description": "Whether the user should have Super Admin privileges", - "type": "boolean", - "default": false - }, - "permission_names": { - "type": "array", - "items": { - "type": "string" - } - } - }, - "type": "object" - } + "summary": "Get Data from Data Source", + "operationId": "getDataFromDataSource", + "parameters": [ + { + "name": "data_source_id", + "in": "path", + "description": "ID of DataSource to be run", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "endpoint", + "in": "path", + "description": "Endpoint of the data source", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { - "204": { - "description": "success" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DataSourceResponse" + } + } + } } } } }, - "/process_categories": { + "/decision_table_categories": { "get": { "tags": [ - "Process Categories" + "DecisionTableCategories" ], - "summary": "Returns all processes categories that the user has access to", - "description": "Display a listing of the Process Categories.", - "operationId": "getProcessCategories", + "summary": "Returns all Decision Tables categories that the user has access to", + "description": "Display a listing of the Decision Tables Categories.", + "operationId": "getDecisionTableCategories", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -1393,7 +1363,7 @@ ], "responses": { "200": { - "description": "list of processes categories", + "description": "list of Decision Tables categories", "content": { "application/json": { "schema": { @@ -1401,11 +1371,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/DecisionTableCategory" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -1417,17 +1392,17 @@ }, "post": { "tags": [ - "Process Categories" + "DecisionTableCategories" ], - "summary": "Save a new process Category", - "description": "Store a newly created Process Category in storage", - "operationId": "createProcessCategory", + "summary": "Save a new Decision Table Category", + "description": "Store a newly created Decision Tables Category in storage", + "operationId": "createDecisionTableCategory", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } @@ -1438,7 +1413,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1446,32 +1421,32 @@ } } }, - "/process_categories/{process_category_id}": { + "/decision_table_categories/{decision_table_categories_id}": { "get": { "tags": [ - "Process Categories" + "DecisionTableCategories" ], - "summary": "Get single process category by ID", - "description": "Display the specified Process category.", - "operationId": "getProcessCategoryById", + "summary": "Get single Decision Table category by ID", + "description": "Display the specified decision Tables category.", + "operationId": "getDecisionTableCategoryById", "parameters": [ { - "name": "process_category_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1480,19 +1455,19 @@ }, "put": { "tags": [ - "Process Categories" + "DecisionTableCategories" ], - "summary": "Update a process Category", + "summary": "Update a Decision Table Category", "description": "Updates the current element", - "operationId": "updateProcessCategory", + "operationId": "updateDecisionTableCategory", "parameters": [ { - "name": "process_category_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -1501,7 +1476,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" + "$ref": "#/components/schemas/decisionTableCategoryEditable" } } } @@ -1512,7 +1487,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/DecisionTableCategory" } } } @@ -1521,44 +1496,37 @@ }, "delete": { "tags": [ - "Process Categories" + "DecisionTableCategories" ], - "summary": "Delete a process category", + "summary": "Delete a Decision Table category", "description": "Remove the specified resource from storage.", - "operationId": "deleteProcessCategory", + "operationId": "deleteDecisionTableCategory", "parameters": [ { - "name": "process_category_id", + "name": "decision_table_categories_id", "in": "path", - "description": "ID of process category to return", + "description": "ID of Decision Table category to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "description": "success" } } } }, - "/processes": { + "/decision_tables": { "get": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Returns all processes that the user has access to", - "description": "Get list Process", - "operationId": "getProcesses", + "summary": "Returns all Decision tables that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getDecisionTables", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1572,16 +1540,13 @@ { "$ref": "#/components/parameters/per_page" }, - { - "$ref": "#/components/parameters/status" - }, { "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes", + "description": "list of Decision Tables", "content": { "application/json": { "schema": { @@ -1589,11 +1554,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/decisionTable" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -1605,17 +1575,17 @@ }, "post": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Save a new process", + "summary": "Save a new Decision Table", "description": "Store a newly created resource in storage.", - "operationId": "createProcess", + "operationId": "createDecisionTable", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } @@ -1626,7 +1596,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1634,35 +1604,32 @@ } } }, - "/processes/{processId}": { + "/decision_tables/{decision_table_id}": { "get": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Get single process by ID", + "summary": "Get single Decision Table by ID", "description": "Display the specified resource.", - "operationId": "getProcessById", + "operationId": "getDecisionTableById", "parameters": [ { - "name": "processId", + "name": "decision_table_id", "in": "path", - "description": "ID of process to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully found the Decision Table", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1671,19 +1638,19 @@ }, "put": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Update a process", - "description": "Updates the current element.", - "operationId": "updateProcess", + "summary": "Update a Decision Table", + "description": "Update a Decision table", + "operationId": "updateDecisionTable", "parameters": [ { - "name": "processId", + "name": "decision_table_id", "in": "path", - "description": "ID of process to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -1692,18 +1659,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } }, "responses": { - "200": { + "204": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1712,69 +1679,29 @@ }, "delete": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Delete a process", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcess", + "summary": "Delete a Decision Table", + "description": "Delete a Decision tables", + "operationId": "deleteDecisionTable", "parameters": [ { - "name": "processId", + "name": "decision_table_id", "in": "path", - "description": "ID of process to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "204": { - "description": "success" - } - } - } - }, - "/processes/{processId}/start_events": { - "get": { - "tags": [ - "Processes" - ], - "summary": "Get start events of a process by Id", - "description": "Display the specified resource.", - "operationId": "getStartEventsProcessById", - "parameters": [ - { - "name": "processId", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "$ref": "#/components/parameters/include" - } - ], - "responses": { - "200": { - "description": "Successfully found the start events process", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessStartEvents" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1782,22 +1709,22 @@ } } }, - "/processes/{processId}/draft": { + "/decision_tables/{decision_table_id}/duplicate": { "put": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Update a draft process", - "description": "Update draft process.", - "operationId": "updateDraftProcess", + "summary": "duplicate a Decision Table", + "description": "duplicate a Decision table.", + "operationId": "duplicateDecisionTable", "parameters": [ { - "name": "processId", + "name": "decision_table_id", "in": "path", - "description": "ID of process to return", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -1806,18 +1733,18 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/decisionTableEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/decisionTable" } } } @@ -1825,91 +1752,54 @@ } } }, - "/start_processes": { - "get": { + "/decision_tables/{decision_table_id}/excel-import": { + "post": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Returns the list of processes that the user can start", - "description": "Returns the list of processes that the user can start.", - "operationId": "startProcesses", + "summary": "Import a new decision table", + "description": "Import a Decision table from excel", + "operationId": "importExcel", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - }, - { - "name": "without_event_definitions", + "name": "decision_table_id", "in": "path", - "description": "If true return only processes that haven't start event definitions", - "required": false, + "description": "ID of Decision Table to return", + "required": true, "schema": { - "type": "boolean" + "type": "string" } } ], - "responses": { - "200": { - "description": "list of processes that the user can start", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessWithStartEvents" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } - } - } - }, - "/processes/{processId}/restore": { - "put": { - "tags": [ - "Processes" - ], - "summary": "Restore an inactive process", - "description": "Reverses the soft delete of the element.", - "operationId": "restoreProcess", - "parameters": [ - { - "name": "processId", - "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], + }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" } } } @@ -1917,37 +1807,32 @@ } } }, - "/processes/{processId}/export": { + "/decision_tables/{decision_table_id}/export": { "post": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Export a single process by ID and return a URL to download it", - "description": "Export the specified process.", - "operationId": "exportProcess", + "summary": "Export a single Decision Table by ID", + "description": "Export the specified screen.", + "operationId": "exportDecisionTable", "parameters": [ { - "name": "processId", + "name": "decision_table_id", "in": "path", - "description": "ID of process to export", + "description": "ID of Decision Table to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully built the process for export", + "description": "Successfully exported the decision table", "content": { "application/json": { "schema": { - "properties": { - "url": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/DecisionTableExported" } } } @@ -1955,14 +1840,14 @@ } } }, - "/processes/import/validation": { + "/decision_tables/import": { "post": { "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Validate a import", - "description": "Validate the specified process before importing.", - "operationId": "validateImport", + "summary": "Import a new Decision Table", + "description": "Import the specified Decision Table.", + "operationId": "importDecisionTable", "requestBody": { "required": true, "content": { @@ -1981,12 +1866,17 @@ } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" } } } @@ -1994,111 +1884,96 @@ } } }, - "/processes/import": { + "/decision_tables/{decision_table_id}/execute": { "post": { "tags": [ - "Processes" - ], - "summary": "Import a new process", - "description": "Import the specified process.", - "operationId": "importProcess", - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" - } - } - } - }, - "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessImport" - } - } - } - } - } - } - }, - "/processes/{processId}/bpmn": { - "get": { - "tags": [ - "Processes" + "DecisionTables" ], - "summary": "Download the BPMN definition of a process", - "description": "Download the BPMN definition of a process", - "operationId": "processBpmn", + "summary": "Execute a Decision Table definition", + "description": "Execute a Decision Table definition", + "operationId": "previewDecisionTable", "parameters": [ { - "name": "processId", + "name": "decision_table_id", "in": "path", - "description": "ID of process", + "description": "Decision Table unique Identifier", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { "200": { - "description": "Successfully built the process for export", + "description": "Successfully executed", "content": { "application/json": { - "schema": { - "properties": { - "url": { - "type": "string" - } - }, - "type": "object" - } + "schema": {} } } } } } }, - "/processes/import/{code}/is_ready": { - "head": { + "/saved-searches/{saved_search_id}/charts": { + "get": { "tags": [ - "Processes" + "SavedSearchCharts" ], - "summary": "Check if the import is ready", - "description": "Check if the import is ready", - "operationId": "6a131993b7c879ddcd3d3a291dd8380f", + "summary": "Returns all saved search charts that the user has access to", + "description": "Get a list of SavedSearchCharts.", + "operationId": "getSavedSearchCharts", "parameters": [ { - "name": "code", - "in": "path", - "description": "Import code", - "required": true, + "$ref": "#/components/parameters/filter" + }, + { + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "check is import is ready", + "description": "list of saved search charts", "content": { "application/json": { "schema": { "properties": { - "ready": { - "type": "boolean" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchChart" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2107,24 +1982,22 @@ } } } - } - }, - "/processes/{process_id}/import/assignments": { - "post": { + }, + "put": { "tags": [ - "Processes" + "SavedSearchCharts" ], - "summary": "Update assignments after import", - "description": "Import Assignments of process.", - "operationId": "assignmentProcess", + "summary": "Update several saved search charts at once", + "description": "Batch update several SavedSearchCharts.", + "operationId": "batchUpdateSavedSearchCharts", "parameters": [ { - "name": "process_id", + "name": "saved_search_id", "in": "path", - "description": "ID of process to return", + "description": "ID of saved search to which these charts will be saved", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], @@ -2133,7 +2006,10 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessAssignments" + "type": "array", + "items": { + "$ref": "#/components/schemas/SavedSearchChart" + } } } } @@ -2143,30 +2019,19 @@ "description": "success" } } - } - }, - "/process_events/{process_id}": { + }, "post": { "tags": [ - "Processes" + "SavedSearchCharts" ], - "summary": "Start a new process", - "description": "Trigger an start event within a process.", - "operationId": "triggerStartEvent", + "summary": "Save a new saved search chart", + "description": "Create a new SavedSearchChart.", + "operationId": "createSavedSearchChart", "parameters": [ { - "name": "process_id", + "name": "saved_search_id", "in": "path", - "description": "ID of process to return", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "event", - "in": "query", - "description": "Node ID of the start event", + "description": "ID of saved search to which this chart will be saved", "required": true, "schema": { "type": "string" @@ -2174,23 +2039,22 @@ } ], "requestBody": { - "description": "data that will be stored as part of the created request", - "required": false, + "required": true, "content": { "application/json": { "schema": { - "type": "object" + "$ref": "#/components/schemas/SavedSearchChartEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/SavedSearchChart" } } } @@ -2198,298 +2062,182 @@ } } }, - "/requests": { + "/saved-searches/charts/{chart_id}": { "get": { "tags": [ - "Process Requests" + "SavedSearchCharts" ], - "summary": "Returns all process Requests that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getProcessesRequests", + "summary": "Get single saved search chart by ID", + "description": "Get a single SavedSearchChart.", + "operationId": "getSavedSearchChartById", "parameters": [ { - "name": "type", - "in": "query", - "description": "Only return requests by type (all|in_progress|completed)", - "required": false, + "name": "chart_id", + "in": "path", + "description": "ID of chart to return", + "required": true, "schema": { - "type": "string", - "enum": [ - "all", - "in_progress", - "completed", - "started_me" - ] + "type": "string" } - }, - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes", + "description": "Successfully found the saved search chart", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/processRequest" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearchChart" } } } } } - } - }, - "/requests/{process_request_id}": { - "get": { + }, + "put": { "tags": [ - "Process Requests" + "SavedSearchCharts" ], - "summary": "Get single process request by ID", - "description": "Display the specified resource.", - "operationId": "getProcessRequestById", + "summary": "Update a saved search chart", + "description": "Update a SavedSearchChart.", + "operationId": "updateSavedSearchChart", "parameters": [ { - "name": "process_request_id", + "name": "chart_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SavedSearchChartEditable" + } + } + } + }, "responses": { "200": { - "description": "Successfully found the process", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/SavedSearchChart" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, - "put": { + "delete": { "tags": [ - "Process Requests" + "SavedSearchCharts" ], - "summary": "Update a process request", - "description": "Update a request", - "operationId": "updateProcessRequest", + "summary": "Delete a saved search chart", + "description": "Delete a SavedSearchChart.", + "operationId": "deleteSavedSearchChart", "parameters": [ { - "name": "process_request_id", + "name": "chart_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of chart to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/processRequestEditable" - } - } - } - }, "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } - }, - "delete": { + } + }, + "/saved-searches/charts/{chart_id}/fields": { + "get": { "tags": [ - "Process Requests" + "SavedSearchCharts" ], - "summary": "Delete a process request", - "description": "Delete a request", - "operationId": "deleteProcessRequest", + "summary": "Get available chart fields for a Saved Search by ID", + "description": "Get available chart fields for a Saved Search.", + "operationId": "getSavedSearchFieldsById", "parameters": [ { - "name": "process_request_id", + "name": "chart_id", "in": "path", - "description": "ID of process request to return", + "description": "ID of Saved Search to return", "required": true, "schema": { - "type": "integer" + "type": "string" } } ], "responses": { - "204": { - "description": "success", + "200": { + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "$ref": "#/components/schemas/SavedSearch" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/requests/{process_request_id}/events/{event_id}": { + "/saved-searches/reports": { "post": { "tags": [ - "Process Requests" + "Reports" ], - "summary": "Update a process request event", - "description": "Trigger a intermediate catch event", - "operationId": "updateProcessRequestEvent", - "parameters": [ - { - "name": "process_request_id", - "in": "path", - "description": "ID of process request to return", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "event_id", - "in": "path", - "description": "ID of process event to return", - "required": true, - "schema": { - "type": "string" + "summary": "Save a new report", + "operationId": "createReport", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ReportEditable" + } } } - ], + }, "responses": { - "204": { - "description": "success" + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Report" + } + } + } } } } }, - "/requests/{request_id}/files": { - "get": { + "/saved-searches/reports/{reportId}": { + "put": { "tags": [ - "Request Files" + "SavedSearches" ], - "summary": "Returns the list of files associated with a request", - "description": "Display a listing of the resource.", - "operationId": "getRequestFiles", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "list of files", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/media" - } - }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } - }, - "type": "object" - } - } - } - } - } - }, - "post": { - "tags": [ - "Request Files" - ], - "summary": "Save a new media file to a request", - "description": "Store a newly created resource in storage.", - "operationId": "createRequestFile", + "summary": "Update a saved search", + "description": "Update a Report", + "operationId": "updateReport", "parameters": [ { - "name": "request_id", + "name": "reportId", "in": "path", - "description": "ID of the request", + "description": "ID of report", "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "data_name", - "in": "query", - "description": "Variable name in the request data to use for the file name", - "required": false, "schema": { "type": "string" } @@ -2498,16 +2246,9 @@ "requestBody": { "required": true, "content": { - "multipart/form-data": { + "application/json": { "schema": { - "properties": { - "file": { - "description": "save a new media file", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -2518,15 +2259,7 @@ "content": { "application/json": { "schema": { - "properties": { - "message": { - "type": "string" - }, - "fileUploadId": { - "type": "integer" - } - }, - "type": "object" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2534,103 +2267,43 @@ } } }, - "/requests/{request_id}/files/{file_id}": { + "/saved-searches": { "get": { "tags": [ - "Request Files" - ], - "summary": "Get a file uploaded to a request", - "description": "Display the specified resource.", - "operationId": "getRequestFilesById", - "parameters": [ - { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, - "schema": { - "type": "integer" - } - }, - { - "name": "file_id", - "in": "path", - "description": "ID of the file to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "File stream", - "content": { - "application/octet-stream": { - "schema": { - "type": "string", - "format": "binary" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - }, - "delete": { - "tags": [ - "Request Files" + "SavedSearches" ], - "summary": "Delete all media associated with a request", - "description": "Remove the specified resource from storage.", - "operationId": "deleteRequestFile", + "summary": "Returns all saved searches that the user has access to", + "description": "Get a list of SavedSearches.", + "operationId": "getSavedSearches", "parameters": [ { - "name": "file_id", - "in": "path", - "description": "ID of the file", - "required": true, - "schema": { - "type": "integer" - } + "$ref": "#/components/parameters/filter" }, { - "name": "request_id", - "in": "path", - "description": "ID of the request", - "required": true, + "name": "type", + "in": "query", + "description": "Only return saved searches by type", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "request", + "task", + "collection" + ] } - } - ], - "responses": { - "204": { - "description": "success" }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/screen_categories": { - "get": { - "tags": [ - "Screen Categories" - ], - "summary": "Returns all screens categories that the user has access to", - "description": "Display a listing of the Screen Categories.", - "operationId": "getScreenCategories", - "parameters": [ { - "name": "filter", + "name": "subset", "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "description": "Only return saved searches that are yours or those that have been shared with you", + "required": false, "schema": { - "type": "string" + "type": "string", + "enum": [ + "mine", + "shared" + ] } }, { @@ -2641,11 +2314,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of screens categories", + "description": "list of saved searches", "content": { "application/json": { "schema": { @@ -2653,11 +2329,16 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/SavedSearch" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2669,17 +2350,17 @@ }, "post": { "tags": [ - "Screen Categories" + "SavedSearches" ], - "summary": "Save a new Screen Category", - "description": "Store a newly created Screen Category in storage", - "operationId": "createScreenCategory", + "summary": "Save a new saved search", + "description": "Create a new SavedSearch.", + "operationId": "createSavedSearch", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -2690,7 +2371,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2698,19 +2379,19 @@ } } }, - "/screen_categories/{screen_category_id}": { + "/saved-searches/{savedSearchId}": { "get": { "tags": [ - "Screen Categories" + "SavedSearches" ], - "summary": "Get single screen category by ID", - "description": "Display the specified screen category.", - "operationId": "getScreenCategoryById", + "summary": "Get single saved searches by ID", + "description": "Get a single SavedSearch.", + "operationId": "getSavedSearchById", "parameters": [ { - "name": "screen_category_id", + "name": "savedSearchId", "in": "path", - "description": "ID of screen category to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -2719,11 +2400,11 @@ ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the saved search", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/SavedSearch" } } } @@ -2732,16 +2413,16 @@ }, "put": { "tags": [ - "Screen Categories" + "SavedSearches" ], - "summary": "Update a screen Category", - "description": "Updates the current element", - "operationId": "updateScreenCategory", + "summary": "Update a saved search", + "description": "Update a SavedSearch.", + "operationId": "updateSavedSearch", "parameters": [ { - "name": "screen_category_id", + "name": "savedSearchId", "in": "path", - "description": "ID of screen category to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" @@ -2753,7 +2434,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategoryEditable" + "$ref": "#/components/schemas/SavedSearchEditable" } } } @@ -2764,49 +2445,116 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScreenCategory" + "$ref": "#/components/schemas/SavedSearch" } } } } } - }, - "delete": { + } + }, + "/saved-searches/{savedSearchId}/columns": { + "get": { "tags": [ - "Screen Categories" + "SavedSearches" ], - "summary": "Delete a screen category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScreenCategory", + "summary": "Returns all columns associated with a Saved Search", + "description": "Display a listing of columns.", + "operationId": "getSavedSearchColumns", "parameters": [ { - "name": "screen_category_id", + "name": "savedSearchId", "in": "path", - "description": "ID of screen category to return", + "description": "ID of saved search to return", "required": true, "schema": { "type": "string" } + }, + { + "name": "include", + "in": "query", + "description": "Include specific categories. Comma separated list.", + "schema": { + "type": "array", + "items": { + "type": "string", + "enum": [ + "current", + "default", + "available", + "data" + ] + }, + "uniqueItems": false + } } ], "responses": { - "204": { - "description": "success" - } - } - } - }, - "/screens": { - "get": { - "tags": [ - "Screens" - ], - "summary": "Returns all screens that the user has access to", - "description": "Get a list of Screens.", - "operationId": "getScreens", + "200": { + "description": "Categorized list of columns", + "content": { + "application/json": { + "schema": { + "properties": { + "current": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "default": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "available": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + }, + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/columns" + } + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/saved-searches/{savedSearchId}/users": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "savedSearchId", + "in": "path", + "description": "ID of saved search to return", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -2819,20 +2567,122 @@ }, { "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/saved-searches/{savedSearchId}/groups": { + "get": { + "tags": [ + "Groups" + ], + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getSavedSearchGroups", + "parameters": [ + { + "$ref": "#/components/parameters/order_by" }, { - "name": "exclude", - "in": "query", - "description": "Comma separated list of fields to exclude from the response", + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of groups", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/saved-searches/{saved_search_id}": { + "delete": { + "tags": [ + "SavedSearches" + ], + "summary": "Delete a saved search", + "description": "Delete a SavedSearch.", + "operationId": "deleteSavedSearch", + "parameters": [ + { + "name": "saved_search_id", + "in": "path", + "description": "ID of saved search to return", + "required": true, "schema": { - "type": "string", - "default": "" + "type": "string" } } ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/saved-searches/icons": { + "get": { + "tags": [ + "SavedSearches" + ], + "summary": "Returns all icons for saved searches", + "description": "Get a list of icons available for SavedSearches.", + "operationId": "getSavedSearchesIcons", + "parameters": [ + { + "$ref": "#/components/parameters/per_page" + } + ], "responses": { "200": { - "description": "list of screens", + "description": "list of icons for saved searches", "content": { "application/json": { "schema": { @@ -2840,11 +2690,71 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/SavedSearchIcon" } }, "meta": { - "type": "object" + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/version_histories": { + "get": { + "tags": [ + "Version History" + ], + "summary": "Return all version History according to the model", + "description": "Get the list of records of Version History", + "operationId": "getVersionHistories", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of Version History", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/versionHistory" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] } }, "type": "object" @@ -2856,17 +2766,17 @@ }, "post": { "tags": [ - "Screens" + "Version History" ], - "summary": "Save a new screens", - "description": "Create a new Screen.", - "operationId": "createScreen", + "summary": "Save a new Version History", + "description": "Create a new Version History.", + "operationId": "createVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } @@ -2877,7 +2787,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/versionHistory" } } } @@ -2885,19 +2795,19 @@ } } }, - "/screens/{screens_id}": { + "/version_histories/{version_history_id}": { "get": { "tags": [ - "Screens" + "Version History" ], - "summary": "Get single screens by ID", - "description": "Get a single Screen.", - "operationId": "getScreensById", + "summary": "Get single Version History by ID", + "description": "Get a single Version History.", + "operationId": "getVersionHistoryById", "parameters": [ { - "name": "screens_id", + "name": "version_history_id", "in": "path", - "description": "ID of screens to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2906,11 +2816,11 @@ ], "responses": { "200": { - "description": "Successfully found the screen", + "description": "Successfully found the Version History", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/versionHistory" } } } @@ -2919,16 +2829,16 @@ }, "put": { "tags": [ - "Screens" + "Version History" ], - "summary": "Update a screen", - "description": "Update a Screen.", - "operationId": "updateScreen", + "summary": "Update a Version History", + "description": "Update a Version History.", + "operationId": "updateVersion", "parameters": [ { - "name": "screens_id", + "name": "version_history_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2940,29 +2850,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" + "$ref": "#/components/schemas/versionHistoryEditable" } } } }, "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } } } }, "delete": { "tags": [ - "Screens" + "Version History" ], - "summary": "Delete a screen", - "description": "Delete a Screen.", - "operationId": "deleteScreen", + "summary": "Delete a Version History", + "description": "Delete a Version History.", + "operationId": "deleteVersion", "parameters": [ { - "name": "screens_id", + "name": "version_history_id", "in": "path", - "description": "ID of screen to return", + "description": "ID of Version History to return", "required": true, "schema": { "type": "string" @@ -2971,144 +2888,32 @@ ], "responses": { "204": { - "description": "success" + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/versionHistory" + } + } + } } } } }, - "/screens/{screens_id}/draft": { - "put": { + "/version_histories/clone": { + "post": { "tags": [ - "Screens" - ], - "summary": "Update a draft screen", - "description": "Update a draft Screen.", - "operationId": "updateDraftScreen", - "parameters": [ - { - "name": "screens_id", - "in": "path", - "description": "ID of screen to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screensEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/screens/{screens_id}/duplicate": { - "put": { - "tags": [ - "Screens" - ], - "summary": "duplicate a screen", - "description": "duplicate a Screen.", - "operationId": "duplicateScreen", - "parameters": [ - { - "name": "screens_id", - "in": "path", - "description": "ID of screen to return", - "required": true, - "schema": { - "type": "string" - } - } + "Version History" ], + "summary": "Clone a new Version History", + "description": "Clone a new Version History.", + "operationId": "cloneVersion", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screensEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screens" - } - } - } - } - } - } - }, - "/screens/{screensId}/export": { - "post": { - "tags": [ - "Screens" - ], - "summary": "Export a single screen by ID", - "description": "Export the specified screen.", - "operationId": "exportScreen", - "parameters": [ - { - "name": "screensId", - "in": "path", - "description": "ID of screen to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully exported the screen", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/screenExported" - } - } - } - } - } - } - }, - "/screens/import": { - "post": { - "tags": [ - "Screens" - ], - "summary": "Import a new screen", - "description": "Import the specified screen.", - "operationId": "importScreen", - "requestBody": { - "required": true, - "content": { - "multipart/form-data": { - "schema": { - "properties": { - "file": { - "description": "file to import", - "type": "string", - "format": "binary" - } - }, - "type": "object" + "$ref": "#/components/schemas/versionHistoryEditable" } } } @@ -3119,12 +2924,7 @@ "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/versionHistory" } } } @@ -3132,30 +2932,24 @@ } } }, - "/screens/preview": { + "/customize-ui": { "post": { "tags": [ - "Screens" + "CssSettings" ], - "summary": "Preview a screen", - "description": "Get preview a screen", - "operationId": "preview", + "summary": "Create or update a new setting", + "description": "Create a new Settings css-override", + "operationId": "updateCssSetting", "requestBody": { "required": true, "content": { "application/json": { "schema": { "properties": { - "config": { - "type": "object" - }, - "watchers": { - "type": "object" - }, - "computed": { - "type": "object" + "variables": { + "type": "string" }, - "custom_css": { + "sansSerifFont": { "type": "string" } }, @@ -3165,12 +2959,12 @@ } }, "responses": { - "200": { - "description": "Successfully found the screen", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/screens" + "$ref": "#/components/schemas/settings" } } } @@ -3178,22 +2972,17 @@ } } }, - "/script_categories": { + "/environment_variables": { "get": { "tags": [ - "Script Categories" + "Environment Variables" ], - "summary": "Returns all scripts categories that the user has access to", - "description": "Display a listing of the Script Categories.", - "operationId": "getScriptCategories", + "summary": "Returns all environmentVariables that the user has access to. For security, values are not included.", + "description": "Fetch a collection of variables based on paged request and filter if provided", + "operationId": "getEnvironmentVariables", "parameters": [ { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -3203,11 +2992,14 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of scripts categories", + "description": "list of environmentVariables", "content": { "application/json": { "schema": { @@ -3215,7 +3007,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } }, "meta": { @@ -3231,17 +3023,17 @@ }, "post": { "tags": [ - "Script Categories" + "Environment Variables" ], - "summary": "Save a new Script Category", - "description": "Store a newly created Script Category in storage", - "operationId": "createScriptCategory", + "summary": "Create a new environment variable", + "description": "Creates a new global Environment Variable in the system", + "operationId": "createEnvironmentVariable", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -3252,7 +3044,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3260,32 +3052,32 @@ } } }, - "/script_categories/{script_category_id}": { + "/environment_variables/{environment_variable_id}": { "get": { "tags": [ - "Script Categories" + "Environment Variables" ], - "summary": "Get single script category by ID", - "description": "Display the specified script category.", - "operationId": "getScriptCategoryById", + "summary": "Get an environment variable by id. For security, the value is not included.", + "description": "Return an environment variable instance\nUsing implicit model binding, will automatically return 404 if variable now found", + "operationId": "getEnvironmentVariableById", "parameters": [ { - "name": "script_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "Successfully found the script", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3294,19 +3086,19 @@ }, "put": { "tags": [ - "Script Categories" + "Environment Variables" ], - "summary": "Update a script Category", - "description": "Updates the current element", - "operationId": "updateScriptCategory", + "summary": "Update an environment variable", + "description": "Update an environment variable", + "operationId": "updateEnvironmentVariable", "parameters": [ { - "name": "script_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of environment variables to update", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -3315,7 +3107,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategoryEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -3326,7 +3118,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ScriptCategory" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -3335,39 +3127,38 @@ }, "delete": { "tags": [ - "Script Categories" + "Environment Variables" ], - "summary": "Delete a script category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteScriptCategory", + "summary": "Delete an environment variable", + "operationId": "deleteEnvironmentVariable", "parameters": [ { - "name": "script_category_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of script category to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { + "200": { "description": "success" } } } }, - "/scripts": { + "/files": { "get": { "tags": [ - "Scripts" + "Files" ], - "summary": "Returns all scripts that the user has access to", - "description": "Get a list of scripts in a process.", - "operationId": "getScripts", - "parameters": [ - { + "summary": "Returns the list of files", + "description": "Display a listing of the resource.", + "operationId": "getFiles", + "parameters": [ + { "$ref": "#/components/parameters/filter" }, { @@ -3378,14 +3169,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of scripts", + "description": "list of files", "content": { "application/json": { "schema": { @@ -3393,11 +3181,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scripts" + "$ref": "#/components/schemas/media" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3409,75 +3197,59 @@ }, "post": { "tags": [ - "Scripts" - ], - "summary": "Save a new script", - "description": "Create a new script in a process.", - "operationId": "createScript", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scripts" - } - } - } - } - } - } - }, - "/scripts/{script_id}/preview": { - "post": { - "tags": [ - "Scripts" + "Files" ], - "summary": "Test script code without saving it", - "description": "Previews executing a script, with sample data/config data", - "operationId": "previewScript", + "summary": "Save a new media file. Note: To upload files to a request, use createRequestFile in the RequestFile API", + "description": "Store a newly created resource in storage.", + "operationId": "createFile", "parameters": [ { - "name": "script_id", - "in": "path", + "name": "model_id", + "in": "query", + "description": "ID of the model to which the file will be associated", "required": true, "schema": { "type": "integer" } + }, + { + "name": "model", + "in": "query", + "description": "Full namespaced class of the model to associate", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "data_name", + "in": "query", + "description": "Name of the variable used in a request", + "required": false, + "schema": { + "type": "string" + } + }, + { + "name": "collection", + "in": "query", + "description": "Media collection name. For requests, use 'default'", + "required": false, + "schema": { + "type": "string" + } } ], "requestBody": { + "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - }, - "code": { - "type": "string" - }, - "nonce": { - "type": "string" + "file": { + "description": "save a new media file", + "type": "string", + "format": "binary" } }, "type": "object" @@ -3487,203 +3259,268 @@ }, "responses": { "200": { - "description": "success if the script was queued" + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "type": "string" + }, + "model_id": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "mime_type": { + "type": "string" + } + }, + "type": "object" + } + } + } } } } }, - "/scripts/execute/{script_id}": { - "post": { + "/files/{file_id}": { + "get": { "tags": [ - "Scripts" + "Files" ], - "summary": "Execute script", - "description": "Executes a script, with sample data/config data", - "operationId": "executeScript", + "summary": "Get the metadata of a file. To actually fetch the file see Get File Contents", + "description": "Get a single media file.", + "operationId": "getFileById", "parameters": [ { - "name": "script_id", + "name": "file_id", "in": "path", + "description": "ID of the file to return", "required": true, "schema": { "type": "integer" } } ], - "requestBody": { - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "type": "object" - } - }, - "config": { - "type": "array", - "items": { - "type": "object" - } - } - }, - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success if the script was queued", + "description": "Successfully found the file", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsPreview" + "$ref": "#/components/schemas/media" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/execution/{key}": { - "get": { + }, + "delete": { "tags": [ - "Scripts" + "Files" ], - "summary": "Get the response of a script execution by execution key", - "description": "Get the response of a script execution", - "operationId": "getScriptExecutionResponse", + "summary": "Delete a media file", + "description": "Remove the specified resource from storage.", + "operationId": "deleteFile", "parameters": [ { - "name": "key", + "name": "file_id", "in": "path", + "description": "ID of the file", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "response of a script execution", - "content": { - "application/json": { - "schema": {} - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/scripts/{script_id}": { + "/files/{file_id}/contents": { "get": { "tags": [ - "Scripts" + "Files" ], - "summary": "Get single script by ID", - "description": "Get a single script in a process.", - "operationId": "getScriptsById", + "summary": "Get the contents of a file", + "description": "Display the specified resource.", + "operationId": "getFileContentsById", "parameters": [ { - "name": "script_id", + "name": "file_id", "in": "path", - "description": "ID of script to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the script", + "description": "File stream", "content": { - "application/json": { + "application/octet-stream": { "schema": { - "$ref": "#/components/schemas/scripts" + "type": "string", + "format": "binary" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } - }, - "put": { + } + }, + "/groups": { + "get": { "tags": [ - "Scripts" + "Groups" ], - "summary": "Update a script", - "description": "Update a script in a process.", - "operationId": "updateScript", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getGroups", "parameters": [ { - "name": "script_id", - "in": "path", - "description": "ID of script to return", - "required": true, - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of groups", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } } + } + }, + "post": { + "tags": [ + "Groups" ], + "summary": "Save a new group", + "description": "Store a newly created resource in storage.", + "operationId": "createGroup", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "$ref": "#/components/schemas/groupsEditable" } } } }, "responses": { - "204": { - "description": "success" + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/groups" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" } } - }, - "delete": { + } + }, + "/groups/{group_id}": { + "get": { "tags": [ - "Scripts" + "Groups" ], - "summary": "Delete a script", - "description": "Delete a script in a process.", - "operationId": "deleteScript", + "summary": "Get single group by ID", + "description": "Display the specified resource.", + "operationId": "getGroupById", "parameters": [ { - "name": "script_id", + "name": "group_id", "in": "path", - "description": "ID of script to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully found the group", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/groups" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/{script_id}/draft": { + }, "put": { "tags": [ - "Scripts" + "Groups" ], - "summary": "Update a draft script", - "description": "Update a draft script.", - "operationId": "updateDraftScript", + "summary": "Update a group", + "description": "Update a user", + "operationId": "updateGroup", "parameters": [ { - "name": "script_id", + "name": "group_id", "in": "path", - "description": "ID of script to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -3692,7 +3529,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptsEditable" + "$ref": "#/components/schemas/groupsEditable" } } } @@ -3700,67 +3537,60 @@ "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - } - }, - "/scripts/{scripts_id}/duplicate": { - "put": { + }, + "delete": { "tags": [ - "Scripts" + "Groups" ], - "summary": "duplicate a script", - "description": "Duplicate a Script.", - "operationId": "duplicateScript", + "summary": "Delete a group", + "description": "Delete a user", + "operationId": "deleteGroup", "parameters": [ { - "name": "scripts_id", + "name": "group_id", "in": "path", - "description": "ID of script to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptsEditable" - } - } - } - }, "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scripts" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/script-executors": { + "/groups/{group_id}/users": { "get": { "tags": [ - "Rebuild Script Executors" + "Groups" ], - "summary": "Returns all script executors that the user has access to", - "description": "Get a list of script executors.", - "operationId": "getScriptExecutors", + "summary": "Returns all users of a group", + "description": "Display the list of users in a group", + "operationId": "getGroupUsers", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "group_id", + "in": "path", + "description": "ID of group", + "required": true, + "schema": { + "type": "integer" + } }, { - "$ref": "#/components/parameters/order_by" + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_direction" @@ -3771,7 +3601,7 @@ ], "responses": { "200": { - "description": "list of script executors", + "description": "list of members of a group", "content": { "application/json": { "schema": { @@ -3779,11 +3609,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/scriptExecutors" + "$ref": "#/components/schemas/users" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3792,36 +3622,51 @@ } } } - }, - "post": { + } + }, + "/groups/{group_id}/groups": { + "get": { "tags": [ - "Rebuild Script Executors" + "Groups" ], - "summary": "Create a script executor", - "description": "Create a script executor", - "operationId": "createScriptExecutor", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" - } + "summary": "Returns all users of a group", + "description": "Display the list of groups in a group", + "operationId": "getGroupGroupss", + "parameters": [ + { + "name": "group_id", + "in": "path", + "description": "ID of group", + "required": true, + "schema": { + "type": "integer" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } - }, + ], "responses": { "200": { - "description": "success", + "description": "list of members of a group", "content": { "application/json": { "schema": { "properties": { - "status": { - "type": "string" + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } }, - "id": { - "type": "string" + "meta": { + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -3832,65 +3677,96 @@ } } }, - "/script-executors/{script_executor}": { - "put": { + "/group_members": { + "get": { "tags": [ - "Rebuild Script Executors" + "Group Members" ], - "summary": "Update script executor", - "description": "Update and rebuild the script executor", - "operationId": "updateScriptExecutor", + "summary": "Returns all groups for a given member", + "description": "Display a listing of the resource.", + "operationId": "getGroupMembers", "parameters": [ { - "name": "script_executor", - "in": "path", - "description": "ID of script executor to return", - "required": true, - "schema": { - "type": "string" + "$ref": "#/components/parameters/member_id" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of group_members", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groupMembers" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } } } + } + }, + "post": { + "tags": [ + "Group Members" ], + "summary": "Save a new group member", + "description": "Store a newly created resource in storage.", + "operationId": "createGroupMember", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/scriptExecutorsEditable" + "$ref": "#/components/schemas/groupMembersEditable" } } } }, "responses": { - "200": { + "201": { "description": "success", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/createGroupMembers" } } } } } - }, - "delete": { + } + }, + "/group_members/{group_member_id}": { + "get": { "tags": [ - "Rebuild Script Executors" + "Group Members" ], - "summary": "Delete a script executor", - "description": "Delete a script executor", - "operationId": "deleteScriptExecutor", + "summary": "Get single group member by ID", + "description": "Display the specified resource.", + "operationId": "getGroupMemberById", "parameters": [ { - "name": "script_executor", + "name": "group_member_id", "in": "path", - "description": "ID of script executor to return", + "description": "ID of group members to return", "required": true, "schema": { "type": "string" @@ -3899,77 +3775,69 @@ ], "responses": { "200": { - "description": "success", + "description": "Successfully found the group members", "content": { "application/json": { "schema": { - "properties": { - "status": { - "type": "string" - } - }, - "type": "object" + "$ref": "#/components/schemas/getGroupMembersById" } } } } } - } - }, - "/script-executors/cancel": { - "post": { + }, + "delete": { "tags": [ - "Rebuild Script Executors" + "Group Members" ], - "summary": "Cancel a script executor", - "description": "Cancel a script executor", - "operationId": "cancelScriptExecutor", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "properties": { - "pidFile": { - "type": "string" - } - }, - "type": "object" - } + "summary": "Delete a group member", + "description": "Delete a group membership", + "operationId": "deleteGroupMember", + "parameters": [ + { + "name": "group_member_id", + "in": "path", + "description": "ID of group_members to return", + "required": true, + "schema": { + "type": "string" } } - }, + ], "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "properties": { - "status": { - "type": "string" - }, - "id": { - "type": "string" - } - }, - "type": "object" - } - } - } + "204": { + "description": "success" } } } }, - "/script-executors/available-languages": { + "/group_members_available": { "get": { "tags": [ - "Rebuild Script Executors" + "Group Members" ], - "summary": "Returns all available languages", - "description": "Get a list of available languages.", - "operationId": "getAvailableLanguages", + "summary": "Returns all groups available for a given member", + "description": "Display a listing of groups available", + "operationId": "getGroupMembersAvailable", "parameters": [ + { + "name": "member_id", + "in": "path", + "description": "ID of group member to return", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "member_type", + "in": "path", + "description": "type of group member to return", + "required": true, + "schema": { + "type": "string" + } + }, { "$ref": "#/components/parameters/filter" }, @@ -3985,7 +3853,7 @@ ], "responses": { "200": { - "description": "list of available languages", + "description": "list of groups available to be assigned as member", "content": { "application/json": { "schema": { @@ -3993,11 +3861,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/availableLanguages" + "$ref": "#/components/schemas/availableGroupMembers" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -4008,17 +3876,31 @@ } } }, - "/security-logs": { + "/user_members_available": { "get": { "tags": [ - "Security Logs" + "Group Members" ], - "summary": "Returns all security logs", - "description": "Get a list of Security Logs.", - "operationId": "getSecurityLogs", + "summary": "Returns all users available for a given group", + "description": "Display a listing of users available", + "operationId": "getUserMembersAvailable", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "group_id", + "in": "path", + "description": "ID of group to return", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name. Can be a substring.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -4032,7 +3914,7 @@ ], "responses": { "200": { - "description": "list of security logs", + "description": "list of users available to be assigned as member", "content": { "application/json": { "schema": { @@ -4040,11 +3922,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/securityLog" + "$ref": "#/components/schemas/users" } }, "meta": { - "type": "object" + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -4055,28 +3937,43 @@ } } }, - "/security-logs/{securityLog}": { + "/notifications": { "get": { "tags": [ - "Security Logs" + "Notifications" ], - "summary": "Get single security log by ID", - "description": "Display the specified resource.", - "operationId": "getSecurityLog", + "summary": "Returns all notifications that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getNotifications", "parameters": [ { - "name": "securityLog", - "in": "path", - "description": "ID of security log to return", - "required": true, + "name": "status", + "in": "query", + "description": "Only return notifications by status (unread, all, etc.)", + "required": false, "schema": { "type": "string" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the security log", + "description": "list of notifications", "content": { "application/json": { "schema": { @@ -4084,9 +3981,10 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/securityLog" + "$ref": "#/components/schemas/Notification" } - } + }, + "meta": {} }, "type": "object" } @@ -4094,159 +3992,20 @@ } } } - } - }, - "/settings": { - "get": { + }, + "post": { "tags": [ - "Settings" + "Notifications" ], - "summary": "Returns all settings", - "description": "Display a listing of the resource.", - "operationId": "getSettings", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" - } - ], - "responses": { - "200": { - "description": "list of settings", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/settings" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } - } - } - } - }, - "/settings/{setting_id}": { - "put": { - "tags": [ - "Settings" - ], - "summary": "Update a setting", - "description": "Update a setting", - "operationId": "updateSetting", - "parameters": [ - { - "name": "setting_id", - "in": "path", - "description": "ID of setting to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/settingsEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" - } - } - } - }, - "/signals": { - "get": { - "tags": [ - "Signals" - ], - "summary": "Returns all signals", - "description": "Display a listing of the resource.", - "operationId": "getSignals", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "list of signals", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/signals" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } - } - } - } - }, - "post": { - "tags": [ - "Signals" - ], - "summary": "Creates a new Global Signal", - "description": "Creates a new global signal", - "operationId": "createSignal", + "summary": "Save a new notifications", + "description": "Store a newly created resource in storage.", + "operationId": "createNotification", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } @@ -4257,7 +4016,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/Notification" } } } @@ -4265,19 +4024,19 @@ } } }, - "/signals/{signal_id}": { + "/notifications/{notification_id}": { "get": { "tags": [ - "Signals" + "Notifications" ], - "summary": "Get a single signal by ID", + "summary": "Get single notification by ID", "description": "Display the specified resource.", - "operationId": "getSignalsById", + "operationId": "getNotificationById", "parameters": [ { - "name": "signal_id", + "name": "notification_id", "in": "path", - "description": "signal id", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -4286,11 +4045,11 @@ ], "responses": { "200": { - "description": "success", + "description": "Successfully found the notification", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signals" + "$ref": "#/components/schemas/Notification" } } } @@ -4299,15 +4058,16 @@ }, "put": { "tags": [ - "Signals" + "Notifications" ], - "summary": "Update a signal", - "operationId": "updateSignal", + "summary": "Update a notification", + "description": "Update a user", + "operationId": "updateNotification", "parameters": [ { - "name": "signal_id", + "name": "notification_id", "in": "path", - "description": "ID of signal to update", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -4319,35 +4079,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/signalsEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/signals" - } - } - } + "204": { + "description": "success" } } }, "delete": { "tags": [ - "Signals" + "Notifications" ], - "summary": "Delete a signal", - "operationId": "deleteSignal", + "summary": "Delete a notification", + "description": "Delete a notification", + "operationId": "deleteNotification", "parameters": [ { - "name": "signal_id", + "name": "notification_id", "in": "path", - "description": "ID of signal to delete", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -4361,183 +4115,186 @@ } } }, - "/task_assignments": { - "get": { - "tags": [ - "Task Assignments" - ], - "summary": "Returns all task assignments", - "description": "Display a listing of the resource.", - "operationId": "getTaskAssignments", - "parameters": [ - { - "$ref": "#/components/parameters/filter" - }, - { - "$ref": "#/components/parameters/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" - }, - { - "$ref": "#/components/parameters/per_page" - } - ], - "responses": { - "200": { - "description": "list of task assignments", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/taskAssignments" - } - }, - "meta": { - "type": "object" - } - }, - "type": "object" - } - } - } - } - } - }, - "post": { + "/read_notifications": { + "put": { "tags": [ - "Task Assignments" + "Notifications" ], - "summary": "Save a new Task Assignment", - "description": "Store a newly created task assignment in storage.", - "operationId": "createTaskAssignments", + "summary": "Mark notifications as read by the user", + "description": "Update notification as read", + "operationId": "markNotificationAsRead", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/taskAssignments" - } + "properties": { + "message_ids": { + "description": "list of message ids that will be marked as read", + "type": "array", + "items": { + "type": "string" + } + }, + "routes": { + "description": "all messages that has an url that is in this list will be marked as read", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" } } - }, - "422": { - "$ref": "#/components/responses/422" + } + }, + "responses": { + "201": { + "description": "success" } } } }, - "/task_assignments/{task_assignment}": { + "/unread_notifications": { "put": { "tags": [ - "Task Assignments" - ], - "summary": "Update a Task Assignment", - "description": "Update a task assignment", - "operationId": "updateTaskAssignments", - "parameters": [ - { - "name": "task_assignment", - "in": "path", - "description": "ID of task assignment to update", - "required": true, - "schema": { - "type": "integer" - } - } + "Notifications" ], + "summary": "Mark notifications as unread by the user", + "description": "Update notifications as unread", + "operationId": "markNotificationAsUnread", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "properties": { + "message_ids": { + "description": "list of message ids that will be marked as read", + "type": "array", + "items": { + "type": "string" + } + }, + "routes": { + "description": "all messages that has an url that is in this list will be marked as read", + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" } } } }, "responses": { - "204": { + "201": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } - }, - "delete": { + } + }, + "/read_all_notifications": { + "put": { "tags": [ - "Task Assignments" + "Notifications" ], - "summary": "Delete a Task Assignment", - "description": "Remove an assignment", - "operationId": "deleteTaskAssignments", - "parameters": [ - { - "name": "task_assignment", - "in": "path", - "description": "ID of task assignment to delete", - "required": true, - "schema": { - "type": "integer" + "summary": "Mark notifications as read by id and type", + "description": "Update all notification as read.", + "operationId": "markAllAsRead", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "id": { + "description": "Polymorphic relation id", + "type": "integer" + }, + "type": { + "description": "Polymorphic relation type", + "type": "string" + } + }, + "type": "object" + } } } + }, + "responses": { + "201": { + "description": "success" + } + } + } + }, + "/permissions": { + "put": { + "tags": [ + "Permissions" ], + "summary": "Update the permissions of a user", + "description": "Update permissions", + "operationId": "51b3555fb753f44324bf5c3880e01454", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/taskAssignmentsEditable" + "properties": { + "user_id": { + "description": "ID of the user whose permissions are configured", + "type": "integer" + }, + "group_id": { + "description": "ID of the group whose permissions are configured", + "type": "integer" + }, + "is_administrator": { + "description": "Whether the user should have Super Admin privileges", + "type": "boolean", + "default": false + }, + "permission_names": { + "type": "array", + "items": { + "type": "string" + } + } + }, + "type": "object" } } } }, "responses": { - "200": { + "204": { "description": "success" } } } }, - "/tasks": { + "/process_categories": { "get": { "tags": [ - "Tasks" + "Process Categories" ], - "summary": "Returns all tasks that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getTasks", + "summary": "Returns all processes categories that the user has access to", + "description": "Display a listing of the Process Categories.", + "operationId": "getProcessCategories", "parameters": [ { - "name": "process_request_id", + "name": "filter", "in": "query", - "description": "Process request id", - "required": false, + "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", "schema": { - "type": "integer" + "type": "string" } }, - { - "$ref": "#/components/parameters/filter" - }, { "$ref": "#/components/parameters/order_by" }, @@ -4545,12 +4302,12 @@ "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/include" + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of tasks", + "description": "list of processes categories", "content": { "application/json": { "schema": { @@ -4558,11 +4315,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/ProcessCategory" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -4571,64 +4328,82 @@ } } } + }, + "post": { + "tags": [ + "Process Categories" + ], + "summary": "Save a new process Category", + "description": "Store a newly created Process Category in storage", + "operationId": "createProcessCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessCategory" + } + } + } + } + } } }, - "/tasks/{task_id}": { + "/process_categories/{process_category_id}": { "get": { "tags": [ - "Tasks" + "Process Categories" ], - "summary": "Get a single task by ID", - "description": "Display the specified resource.", - "operationId": "getTasksById", + "summary": "Get single process category by ID", + "description": "Display the specified Process category.", + "operationId": "getProcessCategoryById", "parameters": [ { - "name": "task_id", + "name": "process_category_id", "in": "path", - "description": "task id", + "description": "ID of process category to return", "required": true, "schema": { "type": "integer" } - }, - { - "name": "include", - "in": "query", - "description": "include", - "required": false, - "schema": { - "type": "string" - } } ], "responses": { "200": { - "description": "success", + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/ProcessCategory" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Tasks" + "Process Categories" ], - "summary": "Update a task", + "summary": "Update a process Category", "description": "Updates the current element", - "operationId": "updateTask", + "operationId": "updateProcessCategory", "parameters": [ { - "name": "task_id", + "name": "process_category_id", "in": "path", - "description": "ID of task to update", + "description": "ID of process category to return", "required": true, "schema": { "type": "integer" @@ -4640,20 +4415,7 @@ "content": { "application/json": { "schema": { - "required": [ - "status", - "data" - ], - "properties": { - "status": { - "type": "string", - "example": "COMPLETED" - }, - "data": { - "type": "object" - } - }, - "type": "object" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -4664,39 +4426,56 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequestToken" + "$ref": "#/components/schemas/ProcessCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Process Categories" + ], + "summary": "Delete a process category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcessCategory", + "parameters": [ + { + "name": "process_category_id", + "in": "path", + "description": "ID of process category to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" } } } - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users": { + "/processes": { "get": { "tags": [ - "Users" + "Processes" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getUsers", + "summary": "Returns all processes that the user has access to", + "description": "Get list Process", + "operationId": "getProcesses", "parameters": [ { - "$ref": "#/components/parameters/status" - }, - { - "name": "filter", - "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", - "schema": { - "type": "string" - } + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -4708,21 +4487,15 @@ "$ref": "#/components/parameters/per_page" }, { - "$ref": "#/components/parameters/include" + "$ref": "#/components/parameters/status" }, { - "name": "exclude_ids", - "in": "query", - "description": "Comma separated list of IDs to exclude from the response", - "schema": { - "type": "string", - "default": "" - } + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of users", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -4730,7 +4503,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/Process" } }, "meta": { @@ -4746,17 +4519,17 @@ }, "post": { "tags": [ - "Users" + "Processes" ], - "summary": "Save a new users", + "summary": "Save a new process", "description": "Store a newly created resource in storage.", - "operationId": "createUser", + "operationId": "createProcess", "requestBody": { "required": true, "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } @@ -4767,34 +4540,34 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/Process" } } } - }, - "422": { - "$ref": "#/components/responses/422" } } } }, - "/users/{user_id}": { + "/processes/{processId}": { "get": { "tags": [ - "Users" + "Processes" ], - "summary": "Get single user by ID", + "summary": "Get single process by ID", "description": "Display the specified resource.", - "operationId": "getUserById", + "operationId": "getProcessById", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "ID of user to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { @@ -4803,28 +4576,25 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/Process" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "Users" + "Processes" ], - "summary": "Update a user", - "description": "Update a user", - "operationId": "updateUser", + "summary": "Update a process", + "description": "Updates the current element.", + "operationId": "updateProcess", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "ID of user to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" @@ -4836,35 +4606,36 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } }, "delete": { "tags": [ - "Users" + "Processes" ], - "summary": "Delete a user", - "description": "Delete a user", - "operationId": "deleteUser", + "summary": "Delete a process", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcess", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "ID of user to delete", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" @@ -4874,62 +4645,70 @@ "responses": { "204": { "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/{user_id}/get_pinned_controls": { + "/processes/{processId}/start_events": { "get": { "tags": [ - "Users" + "Processes" ], - "summary": "Get the pinned BPMN elements of a specific user", - "description": "Return the user's pinned nodes.", - "operationId": "getPinnnedControls", + "summary": "Get start events of a process by Id", + "description": "Display the specified resource.", + "operationId": "getStartEventsProcessById", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "ID of user to return the pinned nodes of", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Pinned nodes returned succesfully", + "description": "Successfully found the start events process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/{user_id}/update_pinned_controls": { + "/processes/{processId}/draft": { "put": { "tags": [ - "Users" + "Processes" ], - "summary": "Update a user's pinned BPMN elements on Modeler", - "description": "Update a user's pinned BPMN elements on Modeler", - "operationId": "updatePinnedControls", + "summary": "Update a draft process", + "description": "Update draft process.", + "operationId": "updateDraftProcess", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "ID of user to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" @@ -4941,192 +4720,145 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/usersEditable" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - }, - "422": { - "$ref": "#/components/responses/422" + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } } }, - "/users/{user_id}/groups": { - "put": { + "/start_processes": { + "get": { "tags": [ - "Users" + "Processes" ], - "summary": "Set the groups a users belongs to", - "description": "Update a user's groups", - "operationId": "updateUserGroups", + "summary": "Returns the list of processes that the user can start", + "description": "Returns the list of processes that the user can start.", + "operationId": "startProcesses", "parameters": [ { - "name": "user_id", - "in": "path", - "description": "ID of user", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/updateUserGroups" - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/users/restore": { - "put": { - "tags": [ - "Users" - ], - "summary": "Restore a soft deleted user", - "description": "Reverses the soft delete of a user", - "operationId": "restoreUser", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/restoreUser" - } - } - } - }, - "responses": { - "200": { - "description": "success" - } - } - } - }, - "/users/get_filter_configuration/{name}": { - "get": { - "tags": [ - "Users" - ], - "summary": "Get filter configuration by name", - "description": "Get filter configuration.", - "operationId": "getFilterConfiguration", - "parameters": [ + "$ref": "#/components/parameters/filter" + }, { - "name": "name", + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "without_event_definitions", "in": "path", - "required": true, + "description": "If true return only processes that haven't start event definitions", + "required": false, "schema": { - "type": "string" + "type": "boolean" } } ], "responses": { "200": { - "description": "Success", + "description": "list of processes that the user can start", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessWithStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/store_filter_configuration/{name}": { - "get": { + "/processes/{processId}/restore": { + "put": { "tags": [ - "Users" + "Processes" ], - "summary": "Store filter configuration by name", - "description": "Store filter configuration.", - "operationId": "storeFilterConfiguration", + "summary": "Restore an inactive process", + "description": "Reverses the soft delete of the element.", + "operationId": "restoreProcess", "parameters": [ { - "name": "name", + "name": "processId", "in": "path", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Success", + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/users" + "$ref": "#/components/schemas/Process" } } } - }, - "404": { - "$ref": "#/components/responses/404" } } } }, - "/users/{user_id}/tokens": { - "get": { + "/processes/{processId}/export": { + "post": { "tags": [ - "Personal Tokens" + "Processes" ], - "summary": "Display listing of access tokens for the specified user.", - "description": "Display listing of access tokens for the specified user.", - "operationId": "getTokens", + "summary": "Export a single process by ID and return a URL to download it", + "description": "Export the specified process.", + "operationId": "exportProcess", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "User id", + "description": "ID of process to export", "required": true, "schema": { "type": "integer" } - }, - { - "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "List of tokens.", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/UserToken" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" + "url": { + "type": "string" } }, "type": "object" @@ -5135,33 +4867,65 @@ } } } - }, + } + }, + "/processes/import/validation": { "post": { "tags": [ - "Personal Tokens" + "Processes" ], - "summary": "Create new token for a specific user", - "description": "Create a new personal access token for the user.", - "operationId": "createTokens", - "parameters": [ - { - "name": "user_id", - "in": "path", - "description": "User id", - "required": true, - "schema": { - "type": "integer" + "summary": "Validate a import", + "description": "Validate the specified process before importing.", + "operationId": "validateImport", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessImport" + } + } } } + } + } + }, + "/processes/import": { + "post": { + "tags": [ + "Processes" ], + "summary": "Import a new process", + "description": "Import the specified process.", + "operationId": "importProcess", "requestBody": { "required": true, "content": { - "application/json": { + "multipart/form-data": { "schema": { "properties": { - "name": { - "type": "string" + "file": { + "description": "file to import", + "type": "string", + "format": "binary" } }, "type": "object" @@ -5170,12 +4934,12 @@ } }, "responses": { - "201": { - "description": "New token instance", + "200": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserToken" + "$ref": "#/components/schemas/ProcessImport" } } } @@ -5183,91 +4947,3863 @@ } } }, - "/users/{user_id}/tokens/{token_id}": { + "/processes/{processId}/bpmn": { "get": { "tags": [ - "Personal Tokens" + "Processes" ], - "summary": "Get single token by ID", - "description": "Show a personal access token for the user", - "operationId": "getTokenById", + "summary": "Download the BPMN definition of a process", + "description": "Download the BPMN definition of a process", + "operationId": "processBpmn", "parameters": [ { - "name": "user_id", + "name": "processId", "in": "path", - "description": "ID of user", + "description": "ID of process", "required": true, "schema": { "type": "integer" } - }, - { - "name": "token_id", - "in": "path", - "description": "ID of token to return", - "required": true, - "schema": { - "type": "string" - } } ], "responses": { "200": { - "description": "Successfully found the token", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/UserToken" + "properties": { + "url": { + "type": "string" + } + }, + "type": "object" } } } } } - }, - "delete": { + } + }, + "/processes/import/{code}/is_ready": { + "head": { "tags": [ - "Personal Tokens" + "Processes" ], - "summary": "Delete a token", - "description": "Delete the given token for a user", - "operationId": "deleteToken", + "summary": "Check if the import is ready", + "description": "Check if the import is ready", + "operationId": "6a131993b7c879ddcd3d3a291dd8380f", "parameters": [ { - "name": "user_id", + "name": "code", "in": "path", - "description": "User ID", + "description": "Import code", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, + } + ], + "responses": { + "200": { + "description": "check is import is ready", + "content": { + "application/json": { + "schema": { + "properties": { + "ready": { + "type": "boolean" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/processes/{process_id}/import/assignments": { + "post": { + "tags": [ + "Processes" + ], + "summary": "Update assignments after import", + "description": "Import Assignments of process.", + "operationId": "assignmentProcess", + "parameters": [ { - "name": "token_id", + "name": "process_id", "in": "path", - "description": "Token ID", + "description": "ID of process to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessAssignments" + } + } + } + }, "responses": { "204": { "description": "success" } } } - } - }, - "components": { - "schemas": { - "DateTime": { - "properties": { - "date": { - "type": "string" + }, + "/process_events/{process_id}": { + "post": { + "tags": [ + "Processes" + ], + "summary": "Start a new process", + "description": "Trigger an start event within a process.", + "operationId": "triggerStartEvent", + "parameters": [ + { + "name": "process_id", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "event", + "in": "query", + "description": "Node ID of the start event", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "description": "data that will be stored as part of the created request", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } + } } }, - "type": "object" + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } + } + } + } + }, + "/requests": { + "get": { + "tags": [ + "Process Requests" + ], + "summary": "Returns all process Requests that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getProcessesRequests", + "parameters": [ + { + "name": "type", + "in": "query", + "description": "Only return requests by type (all|in_progress|completed)", + "required": false, + "schema": { + "type": "string", + "enum": [ + "all", + "in_progress", + "completed", + "started_me" + ] + } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of processes", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/processRequest" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/requests/{process_request_id}": { + "get": { + "tags": [ + "Process Requests" + ], + "summary": "Get single process request by ID", + "description": "Display the specified resource.", + "operationId": "getProcessRequestById", + "parameters": [ + { + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Process Requests" + ], + "summary": "Update a process request", + "description": "Update a request", + "operationId": "updateProcessRequest", + "parameters": [ + { + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "delete": { + "tags": [ + "Process Requests" + ], + "summary": "Delete a process request", + "description": "Delete a request", + "operationId": "deleteProcessRequest", + "parameters": [ + { + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequest" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/requests/{process_request_id}/events/{event_id}": { + "post": { + "tags": [ + "Process Requests" + ], + "summary": "Update a process request event", + "description": "Trigger a intermediate catch event", + "operationId": "updateProcessRequestEvent", + "parameters": [ + { + "name": "process_request_id", + "in": "path", + "description": "ID of process request to return", + "required": true, + "schema": { + "type": "string" + } + }, + { + "name": "event_id", + "in": "path", + "description": "ID of process event to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/requests/{request_id}/files": { + "get": { + "tags": [ + "Request Files" + ], + "summary": "Returns the list of files associated with a request", + "description": "Display a listing of the resource.", + "operationId": "getRequestFiles", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "list of files", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/media" + } + }, + "meta": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/metadata" + } + ] + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Request Files" + ], + "summary": "Save a new media file to a request", + "description": "Store a newly created resource in storage.", + "operationId": "createRequestFile", + "parameters": [ + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "data_name", + "in": "query", + "description": "Variable name in the request data to use for the file name", + "required": false, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "save a new media file", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "message": { + "type": "string" + }, + "fileUploadId": { + "type": "integer" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/requests/{request_id}/files/{file_id}": { + "get": { + "tags": [ + "Request Files" + ], + "summary": "Get a file uploaded to a request", + "description": "Display the specified resource.", + "operationId": "getRequestFilesById", + "parameters": [ + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "file_id", + "in": "path", + "description": "ID of the file to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "File stream", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "delete": { + "tags": [ + "Request Files" + ], + "summary": "Delete all media associated with a request", + "description": "Remove the specified resource from storage.", + "operationId": "deleteRequestFile", + "parameters": [ + { + "name": "file_id", + "in": "path", + "description": "ID of the file", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "request_id", + "in": "path", + "description": "ID of the request", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/screen_categories": { + "get": { + "tags": [ + "Screen Categories" + ], + "summary": "Returns all screens categories that the user has access to", + "description": "Display a listing of the Screen Categories.", + "operationId": "getScreenCategories", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of screens categories", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScreenCategory" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Screen Categories" + ], + "summary": "Save a new Screen Category", + "description": "Store a newly created Screen Category in storage", + "operationId": "createScreenCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } + } + }, + "/screen_categories/{screen_category_id}": { + "get": { + "tags": [ + "Screen Categories" + ], + "summary": "Get single screen category by ID", + "description": "Display the specified screen category.", + "operationId": "getScreenCategoryById", + "parameters": [ + { + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } + }, + "put": { + "tags": [ + "Screen Categories" + ], + "summary": "Update a screen Category", + "description": "Updates the current element", + "operationId": "updateScreenCategory", + "parameters": [ + { + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategoryEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScreenCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Screen Categories" + ], + "summary": "Delete a screen category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScreenCategory", + "parameters": [ + { + "name": "screen_category_id", + "in": "path", + "description": "ID of screen category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/screens": { + "get": { + "tags": [ + "Screens" + ], + "summary": "Returns all screens that the user has access to", + "description": "Get a list of Screens.", + "operationId": "getScreens", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "exclude", + "in": "query", + "description": "Comma separated list of fields to exclude from the response", + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "list of screens", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/screens" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Screens" + ], + "summary": "Save a new screens", + "description": "Create a new Screen.", + "operationId": "createScreen", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } + } + } + } + }, + "/screens/{screens_id}": { + "get": { + "tags": [ + "Screens" + ], + "summary": "Get single screens by ID", + "description": "Get a single Screen.", + "operationId": "getScreensById", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screens to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } + } + } + }, + "put": { + "tags": [ + "Screens" + ], + "summary": "Update a screen", + "description": "Update a Screen.", + "operationId": "updateScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "Screens" + ], + "summary": "Delete a screen", + "description": "Delete a Screen.", + "operationId": "deleteScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/screens/{screens_id}/draft": { + "put": { + "tags": [ + "Screens" + ], + "summary": "Update a draft screen", + "description": "Update a draft Screen.", + "operationId": "updateDraftScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/screens/{screens_id}/duplicate": { + "put": { + "tags": [ + "Screens" + ], + "summary": "duplicate a screen", + "description": "duplicate a Screen.", + "operationId": "duplicateScreen", + "parameters": [ + { + "name": "screens_id", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screensEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } + } + } + } + }, + "/screens/{screensId}/export": { + "post": { + "tags": [ + "Screens" + ], + "summary": "Export a single screen by ID", + "description": "Export the specified screen.", + "operationId": "exportScreen", + "parameters": [ + { + "name": "screensId", + "in": "path", + "description": "ID of screen to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully exported the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screenExported" + } + } + } + } + } + } + }, + "/screens/import": { + "post": { + "tags": [ + "Screens" + ], + "summary": "Import a new screen", + "description": "Import the specified screen.", + "operationId": "importScreen", + "requestBody": { + "required": true, + "content": { + "multipart/form-data": { + "schema": { + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/screens/preview": { + "post": { + "tags": [ + "Screens" + ], + "summary": "Preview a screen", + "description": "Get preview a screen", + "operationId": "preview", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "config": { + "type": "object" + }, + "watchers": { + "type": "object" + }, + "computed": { + "type": "object" + }, + "custom_css": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "Successfully found the screen", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/screens" + } + } + } + } + } + } + }, + "/script_categories": { + "get": { + "tags": [ + "Script Categories" + ], + "summary": "Returns all scripts categories that the user has access to", + "description": "Display a listing of the Script Categories.", + "operationId": "getScriptCategories", + "parameters": [ + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name, Description, and Status. All fields must match exactly.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of scripts categories", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ScriptCategory" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Script Categories" + ], + "summary": "Save a new Script Category", + "description": "Store a newly created Script Category in storage", + "operationId": "createScriptCategory", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategoryEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } + } + } + } + } + } + }, + "/script_categories/{script_category_id}": { + "get": { + "tags": [ + "Script Categories" + ], + "summary": "Get single script category by ID", + "description": "Display the specified script category.", + "operationId": "getScriptCategoryById", + "parameters": [ + { + "name": "script_category_id", + "in": "path", + "description": "ID of script category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the script", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } + } + } + } + } + }, + "put": { + "tags": [ + "Script Categories" + ], + "summary": "Update a script Category", + "description": "Updates the current element", + "operationId": "updateScriptCategory", + "parameters": [ + { + "name": "script_category_id", + "in": "path", + "description": "ID of script category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategoryEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ScriptCategory" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Script Categories" + ], + "summary": "Delete a script category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteScriptCategory", + "parameters": [ + { + "name": "script_category_id", + "in": "path", + "description": "ID of script category to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/scripts": { + "get": { + "tags": [ + "Scripts" + ], + "summary": "Returns all scripts that the user has access to", + "description": "Get a list of scripts in a process.", + "operationId": "getScripts", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of scripts", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/scripts" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Scripts" + ], + "summary": "Save a new script", + "description": "Create a new script in a process.", + "operationId": "createScript", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scripts" + } + } + } + } + } + } + }, + "/scripts/{script_id}/preview": { + "post": { + "tags": [ + "Scripts" + ], + "summary": "Test script code without saving it", + "description": "Previews executing a script, with sample data/config data", + "operationId": "previewScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + }, + "code": { + "type": "string" + }, + "nonce": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success if the script was queued" + } + } + } + }, + "/scripts/execute/{script_id}": { + "post": { + "tags": [ + "Scripts" + ], + "summary": "Execute script", + "description": "Executes a script, with sample data/config data", + "operationId": "executeScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "type": "object" + } + }, + "config": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success if the script was queued", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsPreview" + } + } + } + } + } + } + }, + "/scripts/execution/{key}": { + "get": { + "tags": [ + "Scripts" + ], + "summary": "Get the response of a script execution by execution key", + "description": "Get the response of a script execution", + "operationId": "getScriptExecutionResponse", + "parameters": [ + { + "name": "key", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "response of a script execution", + "content": { + "application/json": { + "schema": {} + } + } + } + } + } + }, + "/scripts/{script_id}": { + "get": { + "tags": [ + "Scripts" + ], + "summary": "Get single script by ID", + "description": "Get a single script in a process.", + "operationId": "getScriptsById", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the script", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scripts" + } + } + } + } + } + }, + "put": { + "tags": [ + "Scripts" + ], + "summary": "Update a script", + "description": "Update a script in a process.", + "operationId": "updateScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + }, + "delete": { + "tags": [ + "Scripts" + ], + "summary": "Delete a script", + "description": "Delete a script in a process.", + "operationId": "deleteScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/scripts/{script_id}/draft": { + "put": { + "tags": [ + "Scripts" + ], + "summary": "Update a draft script", + "description": "Update a draft script.", + "operationId": "updateDraftScript", + "parameters": [ + { + "name": "script_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/scripts/{scripts_id}/duplicate": { + "put": { + "tags": [ + "Scripts" + ], + "summary": "duplicate a script", + "description": "Duplicate a Script.", + "operationId": "duplicateScript", + "parameters": [ + { + "name": "scripts_id", + "in": "path", + "description": "ID of script to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scripts" + } + } + } + } + } + } + }, + "/script-executors": { + "get": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Returns all script executors that the user has access to", + "description": "Get a list of script executors.", + "operationId": "getScriptExecutors", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of script executors", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/scriptExecutors" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Create a script executor", + "description": "Create a script executor", + "operationId": "createScriptExecutor", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/script-executors/{script_executor}": { + "put": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Update script executor", + "description": "Update and rebuild the script executor", + "operationId": "updateScriptExecutor", + "parameters": [ + { + "name": "script_executor", + "in": "path", + "description": "ID of script executor to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/scriptExecutorsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Delete a script executor", + "description": "Delete a script executor", + "operationId": "deleteScriptExecutor", + "parameters": [ + { + "name": "script_executor", + "in": "path", + "description": "ID of script executor to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/script-executors/cancel": { + "post": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Cancel a script executor", + "description": "Cancel a script executor", + "operationId": "cancelScriptExecutor", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "pidFile": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "properties": { + "status": { + "type": "string" + }, + "id": { + "type": "string" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/script-executors/available-languages": { + "get": { + "tags": [ + "Rebuild Script Executors" + ], + "summary": "Returns all available languages", + "description": "Get a list of available languages.", + "operationId": "getAvailableLanguages", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of available languages", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/availableLanguages" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/security-logs": { + "get": { + "tags": [ + "Security Logs" + ], + "summary": "Returns all security logs", + "description": "Get a list of Security Logs.", + "operationId": "getSecurityLogs", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of security logs", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/security-logs/{securityLog}": { + "get": { + "tags": [ + "Security Logs" + ], + "summary": "Get single security log by ID", + "description": "Display the specified resource.", + "operationId": "getSecurityLog", + "parameters": [ + { + "name": "securityLog", + "in": "path", + "description": "ID of security log to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the security log", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/securityLog" + } + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/settings": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Returns all settings", + "description": "Display a listing of the resource.", + "operationId": "getSettings", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of settings", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/settings" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/settings/{setting_id}": { + "put": { + "tags": [ + "Settings" + ], + "summary": "Update a setting", + "description": "Update a setting", + "operationId": "updateSetting", + "parameters": [ + { + "name": "setting_id", + "in": "path", + "description": "ID of setting to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/settingsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/signals": { + "get": { + "tags": [ + "Signals" + ], + "summary": "Returns all signals", + "description": "Display a listing of the resource.", + "operationId": "getSignals", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of signals", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/signals" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Signals" + ], + "summary": "Creates a new Global Signal", + "description": "Creates a new global signal", + "operationId": "createSignal", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + } + }, + "/signals/{signal_id}": { + "get": { + "tags": [ + "Signals" + ], + "summary": "Get a single signal by ID", + "description": "Display the specified resource.", + "operationId": "getSignalsById", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "signal id", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + }, + "put": { + "tags": [ + "Signals" + ], + "summary": "Update a signal", + "operationId": "updateSignal", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "ID of signal to update", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signalsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/signals" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Signals" + ], + "summary": "Delete a signal", + "operationId": "deleteSignal", + "parameters": [ + { + "name": "signal_id", + "in": "path", + "description": "ID of signal to delete", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/task_assignments": { + "get": { + "tags": [ + "Task Assignments" + ], + "summary": "Returns all task assignments", + "description": "Display a listing of the resource.", + "operationId": "getTaskAssignments", + "parameters": [ + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "list of task assignments", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/taskAssignments" + } + }, + "meta": { + "type": "object" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Task Assignments" + ], + "summary": "Save a new Task Assignment", + "description": "Store a newly created task assignment in storage.", + "operationId": "createTaskAssignments", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignments" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/task_assignments/{task_assignment}": { + "put": { + "tags": [ + "Task Assignments" + ], + "summary": "Update a Task Assignment", + "description": "Update a task assignment", + "operationId": "updateTaskAssignments", + "parameters": [ + { + "name": "task_assignment", + "in": "path", + "description": "ID of task assignment to update", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + }, + "delete": { + "tags": [ + "Task Assignments" + ], + "summary": "Delete a Task Assignment", + "description": "Remove an assignment", + "operationId": "deleteTaskAssignments", + "parameters": [ + { + "name": "task_assignment", + "in": "path", + "description": "ID of task assignment to delete", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/taskAssignmentsEditable" + } + } + } + }, + "responses": { + "200": { + "description": "success" + } + } + } + }, + "/tasks": { + "get": { + "tags": [ + "Tasks" + ], + "summary": "Returns all tasks that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getTasks", + "parameters": [ + { + "name": "process_request_id", + "in": "query", + "description": "Process request id", + "required": false, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/include" + } + ], + "responses": { + "200": { + "description": "list of tasks", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/processRequestToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + } + }, + "/tasks/{task_id}": { + "get": { + "tags": [ + "Tasks" + ], + "summary": "Get a single task by ID", + "description": "Display the specified resource.", + "operationId": "getTasksById", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "task id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "include", + "in": "query", + "description": "include", + "required": false, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestToken" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Tasks" + ], + "summary": "Update a task", + "description": "Updates the current element", + "operationId": "updateTask", + "parameters": [ + { + "name": "task_id", + "in": "path", + "description": "ID of task to update", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "required": [ + "status", + "data" + ], + "properties": { + "status": { + "type": "string", + "example": "COMPLETED" + }, + "data": { + "type": "object" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/processRequestToken" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users": { + "get": { + "tags": [ + "Users" + ], + "summary": "Returns all users", + "description": "Display a listing of the resource.", + "operationId": "getUsers", + "parameters": [ + { + "$ref": "#/components/parameters/status" + }, + { + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "schema": { + "type": "string" + } + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "exclude_ids", + "in": "query", + "description": "Comma separated list of IDs to exclude from the response", + "schema": { + "type": "string", + "default": "" + } + } + ], + "responses": { + "200": { + "description": "list of users", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Users" + ], + "summary": "Save a new users", + "description": "Store a newly created resource in storage.", + "operationId": "createUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "201": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users/{user_id}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get single user by ID", + "description": "Display the specified resource.", + "operationId": "getUserById", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + }, + "put": { + "tags": [ + "Users" + ], + "summary": "Update a user", + "description": "Update a user", + "operationId": "updateUser", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + }, + "delete": { + "tags": [ + "Users" + ], + "summary": "Delete a user", + "description": "Delete a user", + "operationId": "deleteUser", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to delete", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/get_pinned_controls": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get the pinned BPMN elements of a specific user", + "description": "Return the user's pinned nodes.", + "operationId": "getPinnnedControls", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return the pinned nodes of", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "description": "Pinned nodes returned succesfully", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/update_pinned_controls": { + "put": { + "tags": [ + "Users" + ], + "summary": "Update a user's pinned BPMN elements on Modeler", + "description": "Update a user's pinned BPMN elements on Modeler", + "operationId": "updatePinnedControls", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user to return", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/usersEditable" + } + } + } + }, + "responses": { + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "422": { + "$ref": "#/components/responses/422" + } + } + } + }, + "/users/{user_id}/groups": { + "put": { + "tags": [ + "Users" + ], + "summary": "Set the groups a users belongs to", + "description": "Update a user's groups", + "operationId": "updateUserGroups", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/updateUserGroups" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/users/restore": { + "put": { + "tags": [ + "Users" + ], + "summary": "Restore a soft deleted user", + "description": "Reverses the soft delete of a user", + "operationId": "restoreUser", + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/restoreUser" + } + } + } + }, + "responses": { + "200": { + "description": "success" + } + } + } + }, + "/users/get_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Get filter configuration by name", + "description": "Get filter configuration.", + "operationId": "getFilterConfiguration", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/store_filter_configuration/{name}": { + "get": { + "tags": [ + "Users" + ], + "summary": "Store filter configuration by name", + "description": "Store filter configuration.", + "operationId": "storeFilterConfiguration", + "parameters": [ + { + "name": "name", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/users" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" + } + } + } + }, + "/users/{user_id}/tokens": { + "get": { + "tags": [ + "Personal Tokens" + ], + "summary": "Display listing of access tokens for the specified user.", + "description": "Display listing of access tokens for the specified user.", + "operationId": "getTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "$ref": "#/components/parameters/per_page" + } + ], + "responses": { + "200": { + "description": "List of tokens.", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/UserToken" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } + }, + "post": { + "tags": [ + "Personal Tokens" + ], + "summary": "Create new token for a specific user", + "description": "Create a new personal access token for the user.", + "operationId": "createTokens", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "properties": { + "name": { + "type": "string" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "201": { + "description": "New token instance", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserToken" + } + } + } + } + } + } + }, + "/users/{user_id}/tokens/{token_id}": { + "get": { + "tags": [ + "Personal Tokens" + ], + "summary": "Get single token by ID", + "description": "Show a personal access token for the user", + "operationId": "getTokenById", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "ID of user", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "ID of token to return", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "Successfully found the token", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/UserToken" + } + } + } + } + } + }, + "delete": { + "tags": [ + "Personal Tokens" + ], + "summary": "Delete a token", + "description": "Delete the given token for a user", + "operationId": "deleteToken", + "parameters": [ + { + "name": "user_id", + "in": "path", + "description": "User ID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "name": "token_id", + "in": "path", + "description": "Token ID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + } + } + } + } + }, + "components": { + "schemas": { + "DateTime": { + "properties": { + "date": { + "type": "string" + } + }, + "type": "object" + }, + "analyticsReportingEditable": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "link": { + "type": "string" + } + }, + "type": "object" + }, + "analyticsReporting": { + "allOf": [ + { + "$ref": "#/components/schemas/analyticsReportingEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "collectionsEditable": { + "properties": { + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "custom_title": { + "type": "string" + }, + "create_screen_id": { + "type": "string", + "format": "id" + }, + "read_screen_id": { + "type": "string", + "format": "id" + }, + "update_screen_id": { + "type": "string", + "format": "id" + }, + "signal_create": { + "type": "boolean" + }, + "signal_update": { + "type": "boolean" + }, + "signal_delete": { + "type": "boolean" + } + }, + "type": "object" + }, + "collections": { + "allOf": [ + { + "$ref": "#/components/schemas/collectionsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "created_by_id": { + "type": "string", + "format": "id" + }, + "updated_by_id": { + "type": "string", + "format": "id" + }, + "columns": { + "type": "array", + "items": { + "type": "object" + } + } + }, + "type": "object" + } + ] + }, + "recordsEditable": { + "properties": { + "data": { + "type": "object" + } + }, + "type": "object" + }, + "records": { + "allOf": [ + { + "$ref": "#/components/schemas/recordsEditable" + }, + { + "properties": { + "id": { + "type": "integer" + }, + "collection_id": { + "type": "string", + "format": "id" + } + }, + "type": "object" + } + ] + }, + "DataSourceCallParameters": { + "properties": { + "endpoint": { + "type": "string" + }, + "dataMapping": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + }, + "outboundConfig": { + "type": "array", + "items": { + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + } + } + }, + "type": "object" + }, + "DataSourceResponse": { + "properties": { + "status": { + "type": "integer" + }, + "response": { + "type": "object" + } + }, + "type": "object" + }, + "dataSourceEditable": { + "properties": { + "id": { + "description": "Class DataSource", + "type": "string", + "format": "id" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "endpoints": { + "type": "string" + }, + "mappings": { + "type": "string" + }, + "authtype": { + "type": "string" + }, + "credentials": { + "type": "string" + }, + "status": { + "type": "string" + }, + "data_source_category_id": { + "type": "string" + } + }, + "type": "object" + }, + "dataSource": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "dataSourceCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business data Source category definition.", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "DataSourceCategory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/dataSourceCategoryEditable" + }, + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "decisionTableEditable": { + "properties": { + "id": { + "description": "Class Screen", + "type": "string", + "format": "id" + }, + "name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "definition": { + "type": "string" + }, + "decision_table_categories_id": { + "type": "string" + } + }, + "type": "object" + }, + "decisionTable": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/decisionTableEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "DecisionTableExported": { + "properties": { + "url": { + "type": "string" + } + }, + "type": "object" + }, + "decisionTableCategoryEditable": { + "properties": { + "name": { + "description": "Represents a business decision Table category definition.", + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "DecisionTableCategory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/decisionTableCategoryEditable" + }, + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] + }, + "SavedSearchEditable": { + "properties": { + "meta": { + "description": "Represents an Eloquent model of a Saved Search.", + "type": "object", + "additionalProperties": "true" + }, + "pmql": { + "type": "string" + }, + "title": { + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "task", + "request" + ] + }, + "advanced_filter": { + "type": "object", + "additionalProperties": "true" + } + }, + "type": "object" + }, + "SavedSearch": { + "allOf": [ + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "user_id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/SavedSearchEditable" + } + ] + }, + "SavedSearchIcon": { + "properties": { + "name": { + "type": "string" + }, + "value": { + "type": "string" + } + }, + "type": "object" + }, + "SavedSearchChartEditable": { + "properties": { + "title": { + "description": "Represents an Eloquent model of a Saved Search Chart.", + "type": "string" + }, + "type": { + "type": "string", + "enum": [ + "bar", + "bar-vertical", + "line", + "pie", + "doughnut" + ] + }, + "config": { + "type": "object", + "additionalProperties": "true" + }, + "sort": { + "type": "integer" + } + }, + "type": "object" + }, + "SavedSearchChart": { + "allOf": [ + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "saved_search_id": { + "type": "string", + "format": "id" + }, + "user_id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + }, + "deleted_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/SavedSearchChartEditable" + } + ] + }, + "ReportEditable": { + "properties": { + "type": { + "type": "string", + "enum": [ + "adhoc", + "scheduled" + ] + }, + "format": { + "type": "string", + "enum": [ + "csv", + "xlsx" + ] + }, + "saved_search_id": { + "type": "integer" + }, + "config": { + "type": "object", + "additionalProperties": "true" + }, + "to": { + "type": "array", + "items": { + "type": "string" + } + }, + "subject": { + "type": "string" + }, + "body": { + "type": "string" + } + }, + "type": "object" + }, + "Report": { + "allOf": [ + { + "properties": { + "id": { + "type": "string", + "format": "id" + }, + "user_id": { + "type": "string", + "format": "id" + }, + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + }, + { + "$ref": "#/components/schemas/SavedSearchEditable" + } + ] + }, + "versionHistoryEditable": { + "properties": { + "versionable_id": { + "description": "Class VersionHistoryCollection", + "type": "integer" + }, + "versionable_type": { + "type": "string" + }, + "name": { + "type": "string" + }, + "subject": { + "type": "string" + }, + "description": { + "type": "string" + }, + "status": { + "type": "string", + "enum": [ + "ACTIVE", + "INACTIVE" + ] + } + }, + "type": "object" + }, + "versionHistory": { + "type": "object", + "allOf": [ + { + "$ref": "#/components/schemas/versionHistoryEditable" + }, + { + "properties": { + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" + } + }, + "type": "object" + } + ] }, "updateUserGroups": { "properties": { @@ -7187,9 +10723,9 @@ "description": "Laravel passport oauth2 security.", "flows": { "authorizationCode": { - "authorizationUrl": "http://localhost/oauth/authorize", - "tokenUrl": "http://localhost/oauth/token", - "refreshUrl": "http://localhost/token/refresh", + "authorizationUrl": "http://processmaker-a.test/oauth/authorize", + "tokenUrl": "http://processmaker-a.test/oauth/token", + "refreshUrl": "http://processmaker-a.test/token/refresh", "scopes": {} } } diff --git a/tests/Feature/Admin/DevLinkTest.php b/tests/Feature/Admin/DevLinkTest.php new file mode 100644 index 0000000000..d1d41b0fbc --- /dev/null +++ b/tests/Feature/Admin/DevLinkTest.php @@ -0,0 +1,95 @@ +create(); + + $params = [ + 'devlink_id' => $devLink->id, + 'client_id' => 123, + 'client_secret' => 'abc123', + ]; + + $response = $this->webCall('GET', route('devlink.index', $params)); + + $devLink->refresh(); + + $expectedRedirectParams = [ + 'client_id' => 123, + 'redirect_uri' => route('devlink.index'), + 'response_type' => 'code', + 'state' => $devLink->state, + ]; + $expectedRedirectUrl = $devLink->url . '/oauth/authorize?' . http_build_query($expectedRedirectParams); + $response->assertRedirect($expectedRedirectUrl); + + $this->assertEquals($devLink->client_id, $params['client_id']); + $this->assertEquals($devLink->client_secret, $params['client_secret']); + } + + public function testIndexStoreOauthCredentials() + { + $devLink = DevLink::factory()->create([ + 'url' => 'http://remote-instance.test', + ]); + + // Generate state uuid + $devLink->getOauthRedirectUrl(); + + $getTokenUrl = $devLink->url . '/oauth/token'; + Http::fake([ + $getTokenUrl => Http::response([ + 'access_token' => '123abc', + 'refresh_token' => '456def', + 'expires_in' => 3600, + ]), + ]); + + $params = [ + 'state' => $devLink->state, + 'code' => '12345', + ]; + $response = $this->webCall('GET', route('devlink.index', $params)); + + // Redirects to devlink index without query string params + $response->assertRedirect(route('devlink.index', [])); + + $devLink->refresh(); + $this->assertEquals($devLink->access_token, '123abc'); + $this->assertEquals($devLink->refresh_token, '456def'); + $this->assertEquals($devLink->expires_in, 3600); + } + + public function testGetOauthClient() + { + $devLink = DevLink::factory()->create([ + 'url' => 'http://placeholder.test', + ]); + $url = $devLink->getClientUrl(); + $url = str_replace('http://placeholder.test', '', $url); + + $response = $this->webCall('GET', $url); + + $response->assertStatus(302); + + $lastCreatedClient = Client::orderBy('id', 'desc')->first(); + $expectedParams = [ + 'devlink_id' => $devLink->id, + 'client_id' => $lastCreatedClient->id, + 'client_secret' => $lastCreatedClient->secret, + ]; + $response->assertRedirect(route('devlink.index', $expectedParams)); + } +} diff --git a/tests/Feature/Api/DevLinkTest.php b/tests/Feature/Api/DevLinkTest.php new file mode 100644 index 0000000000..386c52097e --- /dev/null +++ b/tests/Feature/Api/DevLinkTest.php @@ -0,0 +1,75 @@ +create(); + $response = $this->apiCall('GET', route('api.devlink.local-bundle', ['bundle' => $bundle->id])); + + $response->assertStatus(200); + $this->assertEquals($bundle->id, $response->json()['id']); + } + + public function testAddAssets() + { + $screen1 = Screen::factory()->create(); + $screen2 = Screen::factory()->create(); + + $bundle = Bundle::factory()->create(); + + $bundle->addAsset($screen1); + $bundle->addAsset($screen2); + + $response = $this->apiCall('POST', route('api.devlink.add-asset', ['bundle' => $bundle->id]), [ + 'id' => $screen2->id, + 'type' => $screen2::class, + ]); + + // assert an error is returned about screen2 already being in the bundle + $response->assertStatus(422); + $this->assertEquals('Asset already exists in bundle', $response->json()['message']); + } + + public function testInstallRemoteAsset() + { + $screen = Screen::factory()->create(); + $devLink = DevLink::factory()->create([ + 'url' => 'https://remote-instance.test', + ]); + + Http::fake([ + 'remote-instance.test/*' => function ($request) { + $httpRequest = new \Illuminate\Http\Request(); + $httpRequest->replace($request->data()); + + $response = (new DevLinkController)->exportLocalAsset($httpRequest); + + return Http::response($response, 200); + }, + ]); + + $response = $this->apiCall( + 'POST', + route( + 'api.devlink.install-remote-asset', + ['devLink' => $devLink->id], + ), + ['id' => $screen->id, 'class' => $screen::class] + ); + + $this->assertEquals($screen->uuid, $response->json()['uuid']); + } +} diff --git a/tests/Model/BundleAssetTest.php b/tests/Model/BundleAssetTest.php new file mode 100644 index 0000000000..88aa6b0184 --- /dev/null +++ b/tests/Model/BundleAssetTest.php @@ -0,0 +1,29 @@ +create(); + + $this->assertTrue(BundleAsset::canExport($screen)); + } + + public function testExporterNotSupported() + { + $group = Group::factory()->create(); + $bundle = Bundle::factory()->create(); + + $this->expectException(ExporterNotSupported::class); + $bundle->addAsset($group); + } +} diff --git a/tests/Model/BundleTest.php b/tests/Model/BundleTest.php new file mode 100644 index 0000000000..8d6c1cf7f3 --- /dev/null +++ b/tests/Model/BundleTest.php @@ -0,0 +1,62 @@ +addGlobalSignalProcess(); + + $process = Process::factory()->create(); + $screen = Screen::factory()->create(); + $bundle = Bundle::factory()->create(); + + BundleAsset::factory()->create([ + 'bundle_id' => $bundle->id, + 'asset_type' => Process::class, + 'asset_id' => $process->id, + ]); + + BundleAsset::factory()->create([ + 'bundle_id' => $bundle->id, + 'asset_type' => Screen::class, + 'asset_id' => $screen->id, + ]); + + $payload = $bundle->export(); + + $this->assertEquals(2, count($payload)); + $this->assertEquals($process->name, $payload[0]['name']); + $this->assertEquals($screen->title, $payload[1]['name']); + } + + public function testSyncAssets() + { + $screen1 = Screen::factory()->create(['title' => 'Screen 1']); + $screen2 = Screen::factory()->create(['title' => 'Screen 2']); + $screen3 = Screen::factory()->create(['title' => 'Screen 3']); + $bundle = Bundle::factory()->create(); + + $bundle->syncAssets([$screen1, $screen2]); + + $this->assertCount(2, $bundle->assets); + $this->assertEquals($screen1->id, $bundle->assets[0]->asset_id); + $this->assertEquals($screen2->id, $bundle->assets[1]->asset_id); + + $bundle->syncAssets([$screen1, $screen3]); + + $this->assertCount(2, $bundle->assets); + $this->assertEquals($screen1->id, $bundle->assets[0]->asset_id); + $this->assertEquals($screen3->id, $bundle->assets[1]->asset_id); + } +} diff --git a/tests/Model/DevLinkTest.php b/tests/Model/DevLinkTest.php new file mode 100644 index 0000000000..e85486d50b --- /dev/null +++ b/tests/Model/DevLinkTest.php @@ -0,0 +1,95 @@ +create([ + 'url' => 'https://remote-instance.test', + ]); + + $expectedQueryString = http_build_query([ + 'devlink_id' => $devLink->id, + 'redirect_uri' => route('devlink.index'), + ]); + + $this->assertEquals( + 'https://remote-instance.test/admin/devlink/oauth-client?' . $expectedQueryString, + $devLink->getClientUrl() + ); + } + + public function testGetOauthRedirectUrl() + { + $devLink = DevLink::factory()->create([ + 'url' => 'https://remote-instance.test', + 'client_id' => 123, + ]); + + $actualUrl = $devLink->getOauthRedirectUrl(); + + // Refresh devlink to get state created by getOauthRedirectUrl + $devLink->refresh(); + $state = $devLink->state; + + $expectedQueryString = http_build_query([ + 'client_id' => 123, + 'redirect_uri' => route('devlink.index'), + 'response_type' => 'code', + 'state' => $state, + ]); + + $this->assertEquals( + $devLink->url . '/oauth/authorize?' . $expectedQueryString, + $actualUrl, + ); + } + + public function testInstallRemoteBundle() + { + $screen1 = Screen::factory()->create(['title' => 'Screen 1']); + $screen2 = Screen::factory()->create(['title' => 'Screen 2']); + $bundle = Bundle::factory()->create([]); + $bundle->syncAssets([$screen1, $screen2]); + + $exports = $bundle->export(); + + $screen1->delete(); + $screen2->delete(); + $bundle->delete(); + + Http::fake([ + 'http://remote-instance.test/api/1.0/devlink/local-bundles/123' => Http::response([ + 'id' => 123, + 'name' => 'Test Bundle', + 'published' => true, + 'locked' => false, + 'version' => '5', + ]), + 'http://remote-instance.test/api/1.0/devlink/export-local-bundle/123' => Http::response([ + 'payloads' => $exports, + ]), + ]); + + $devLink = DevLink::factory()->create([ + 'url' => 'http://remote-instance.test', + ]); + $devLink->installRemoteBundle(123); + + $bundle = Bundle::where('remote_id', 123)->first(); + $this->assertEquals('Test Bundle', $bundle->name); + $this->assertEquals('5', $bundle->version); + + $this->assertCount(2, $bundle->assets); + $this->assertEquals('Screen 1', $bundle->assets[0]->asset->title); + $this->assertEquals('Screen 2', $bundle->assets[1]->asset->title); + } +} diff --git a/webpack.mix.js b/webpack.mix.js index 66f88e3053..4ac6a80953 100644 --- a/webpack.mix.js +++ b/webpack.mix.js @@ -133,6 +133,7 @@ mix .js("resources/js/notifications/index.js", "public/js/notifications/index.js") .js('resources/js/inbox-rules/index.js', 'public/js/inbox-rules') .js('resources/js/inbox-rules/show.js', 'public/js/inbox-rules') + .js("resources/js/admin/devlink/index.js", "public/js/admin/devlink") // Note, that this should go last for the extract to properly put the manifest and vendor in the right location // See: https://github.com/JeffreyWay/laravel-mix/issues/1118