diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..d0b7e745dd --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,63 @@ +# PM4 package: Laravel is provided by the host app; composer.json is only for this package's own PHP code/deps. +# JS build: Vue 2 + Laravel Mix (manifest: package.json). Built assets under public/js/ are not scanned by Dependabot. +# +# Policy: NO routine version-update PRs (open-pull-requests-limit: 0). +# Security/CVE PRs are handled by Dependabot security updates (org Settings → Code security). +# Security PRs are batched into one PR per ecosystem (patch/minor). +# Major security PRs will still open if no patch/minor fix exists — treat as manual review. +# +# Vue 2 pin: security fixes requiring Vue 3+ will be suppressed — accepted risk, +# migration not planned. Same applies to vue-loader, vue-template-compiler, @vue/cli. +# +# Webpack pin: develop lockfile pins 5.91.0; Dependabot security PRs may bump to 5.107+. +# 5.106.0 is the last release that still ships SizeFormatHelpers (Laravel Mix compat). +# Block webpack >= 5.107 so batched security PRs keep other bumps without breaking the build. +# +# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: weekly + day: monday + open-pull-requests-limit: 0 + ignore: + # If you ever raise `open-pull-requests-limit`, this skips routine major bumps. + # Note: update-types has no effect on security updates. + - dependency-name: "*" + update-types: ["version-update:semver-major"] + - dependency-name: "vue" + versions: [">=3.0.0"] # stay on Vue 2.x — suppresses security PRs requiring v3+ too + - dependency-name: "@vue/cli*" + versions: [">=5.0.0"] # CLI v5+ is Vue 3 era + - dependency-name: "vue-loader" + versions: [">=17.0.0"] # vue-loader v17+ drops Vue 2 support + - dependency-name: "vue-template-compiler" + versions: [">=3.0.0"] # must stay in sync with Vue 2.x + - dependency-name: "webpack" + versions: [">=5.107.0"] # 5.106.0 last with SizeFormatHelpers; block 5.107+ security bumps + groups: + npm-security: + applies-to: security-updates # batches all JS security PRs into one + patterns: # note: update-types has no effect here for security + - "*" + # version suppressions (vue, webpack, etc.) live in top-level `ignore` above — groups do not support `ignore` + + - package-ecosystem: composer + directory: / + schedule: + interval: weekly + day: monday + open-pull-requests-limit: 0 + ignore: + # If you ever raise `open-pull-requests-limit`, this skips routine major bumps. + # Note: update-types has no effect on security updates. + - dependency-name: "*" + update-types: ["version-update:semver-major"] + groups: + composer-security: + applies-to: security-updates # batches all PHP security PRs into one + patterns: + - "*" + \ No newline at end of file diff --git a/ProcessMaker/Managers/TaskSchedulerManager.php b/ProcessMaker/Managers/TaskSchedulerManager.php index cd93db4e6d..10e26e4fd4 100644 --- a/ProcessMaker/Managers/TaskSchedulerManager.php +++ b/ProcessMaker/Managers/TaskSchedulerManager.php @@ -16,10 +16,12 @@ use PDOException; use ProcessMaker\Facades\WorkflowManager; use ProcessMaker\Jobs\StartEventConditional; +use ProcessMaker\Models\EnvironmentVariable; use ProcessMaker\Models\Process; use ProcessMaker\Models\ProcessRequest; use ProcessMaker\Models\ProcessRequestLock; use ProcessMaker\Models\ScheduledTask; +use ProcessMaker\Models\Setting; use ProcessMaker\Models\TimerExpression; use ProcessMaker\Nayra\Bpmn\Models\BoundaryEvent; use ProcessMaker\Nayra\Bpmn\Models\DatePeriod; @@ -398,6 +400,16 @@ public function executeTimerStartEvent(ScheduledTask $task, $config) if (!$definitions->findElementById($config->element_id)) { return; } + + if ($this->shouldSkipHandleRepliesTimerStart($process)) { + Log::info('Skipping Actions By Email Handle Replies timer event because ABE inbound mail configuration is not adequate', [ + 'process_id' => $process->id, + 'process_name' => $process->name, + ]); + + return; + } + $event = $definitions->getEvent($config->element_id); $data = []; @@ -405,6 +417,194 @@ public function executeTimerStartEvent(ScheduledTask $task, $config) $processRequest = WorkflowManager::triggerStartEvent($process, $event, $data); } + /** + * Determine if the timer should be skipped for the Actions By Email handle replies process. + * + * @param Process $process + * @return bool + */ + private function shouldSkipHandleRepliesTimerStart(Process $process): bool + { + if (!$this->isHandleRepliesProcess($process)) { + return false; + } + + return !$this->hasAdequateAbeInboundConfiguration(); + } + + /** + * Whether Actions By Email has enough configuration to poll inbound mail (IMAP or OAuth). + * + * This is a heuristic in core: the connector may add more keys; we avoid starting the + * Handle Replies timer when the mailbox clearly is not set up (FOUR-30587). + * + * @return bool + */ + private function hasAdequateAbeInboundConfiguration(): bool + { + if (!Setting::readyToUseSettingsDatabase()) { + return false; + } + + $authMethodIndex = (int) ($this->getAbeInboundSettingValue(['abe_imap_auth_method']) ?? 0); + $username = $this->getAbeInboundSettingValue(['abe_imap_username', 'email_connector_mail_username']); + + if (!$this->hasValue($username)) { + return false; + } + + if ($authMethodIndex === 1) { + return $this->hasEnvironmentVariables([ + 'ABE_GMAIL_API_CLIENT_ID', + 'ABE_GMAIL_API_SECRET', + 'ABE_GMAIL_API_ACCESS_TOKEN', + 'ABE_GMAIL_API_REFRESH_TOKEN', + ]); + } + + if ($authMethodIndex === 2) { + return $this->hasEnvironmentVariables([ + 'ABE_OFFICE_365_CLIENT_ID', + 'ABE_OFFICE_365_TENANT_ID', + 'ABE_OFFICE_365_SECRET', + 'ABE_OFFICE_365_ACCESS_TOKEN', + 'ABE_OFFICE_365_REFRESH_TOKEN', + 'ABE_OFFICE_365_ACCESS_TOKEN_EXPIRE_DATE', + ]); + } + + return $this->hasStandardAbeInboundConfiguration(); + } + + /** + * IMAP configuration for standard authentication mode. + */ + private function hasStandardAbeInboundConfiguration(): bool + { + $password = $this->getAbeInboundSettingValue(['abe_imap_password', 'email_connector_mail_password']); + if (!$this->hasValue($password)) { + return false; + } + + $inboxUri = $this->getAbeInboundSettingValue(['abe_imap_inbox_uri']); + if ($this->hasValue($inboxUri)) { + return true; + } + + $server = $this->getAbeInboundSettingValue(['abe_imap_server', 'email_connector_mail_host']); + $port = $this->getAbeInboundSettingValue(['abe_imap_port', 'email_connector_mail_port']); + + return $this->hasValue($server) && $this->hasValue($port); + } + + /** + * Reads the first non-empty value from supported Actions By Email / mail settings keys. + * + * @param array $keys + * @return string|null + */ + private function getAbeInboundSettingValue(array $keys): ?string + { + $settings = Setting::query() + ->whereIn('key', $keys) + ->get() + ->keyBy('key'); + + if ($settings->isEmpty()) { + return null; + } + + foreach ($keys as $key) { + $setting = $settings->get($key); + if (!$setting) { + continue; + } + + $value = $this->extractSettingValue($setting->config); + if ($this->hasValue($value)) { + return (string) $value; + } + } + + return null; + } + + /** + * Normalize setting values from different possible setting formats. + * + * @param mixed $value + * @return mixed + */ + private function extractSettingValue($value) + { + if (is_object($value)) { + $value = (array) $value; + } + + if (is_array($value)) { + if (array_key_exists('value', $value)) { + return $value['value']; + } + + return $value; + } + + return $value; + } + + /** + * Check if a setting value is present and not empty. + * + * @param mixed $value + * @return bool + */ + private function hasValue($value): bool + { + if (is_array($value)) { + foreach ($value as $item) { + if ($this->hasValue($item)) { + return true; + } + } + + return false; + } + + return is_scalar($value) && trim((string) $value) !== ''; + } + + /** + * Identify the handle replies process by name. + * + * @param Process $process + * @return bool + */ + private function isHandleRepliesProcess(Process $process): bool + { + if ((string) $process->package_key === 'package-actions-by-email/handle-replies') { + return true; + } + + $name = (string) $process->name; + + return stripos($name, 'actions by email') !== false && stripos($name, 'handle replies') !== false; + } + + private function hasEnvironmentVariables(array $names): bool + { + $values = EnvironmentVariable::query() + ->whereIn('name', $names) + ->pluck('value', 'name'); + + foreach ($names as $name) { + if (!isset($values[$name]) || trim((string) $values[$name]) === '') { + return false; + } + } + + return true; + } + /** * Execute a timer start event * diff --git a/composer.json b/composer.json index 6fc956271e..c477ad816f 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "processmaker/processmaker", - "version": "2026.10.1", + "version": "2026.10.2", "description": "BPM PHP Software", "keywords": [ "php bpm processmaker" @@ -25,7 +25,7 @@ "igaster/laravel-theme": "^2.0", "jenssegers/agent": "^2.6", "laravel/framework": "^13.13", - "laravel/horizon": "^5.45", + "laravel/horizon": "^5.47", "laravel/pail": "^1.2", "laravel/passport": "^13.7", "laravel/scout": "^11.1", @@ -111,7 +111,7 @@ "Gmail" ], "processmaker": { - "build": "444708ef", + "build": "dc7c7e21", "cicd-enabled": true, "custom": { "package-ellucian-ethos": "1.19.10", @@ -153,9 +153,9 @@ "connector-slack": "1.9.6", "docker-executor-node-ssr": "1.7.4", "package-ab-testing": "1.4.2", - "package-actions-by-email": "1.22.14", + "package-actions-by-email": "1.22.15", "package-advanced-user-manager": "1.13.3", - "package-ai": "1.16.19", + "package-ai": "1.16.20", "package-analytics-reporting": "1.11.5", "package-auth": "1.24.15", "package-collections": "2.27.6", @@ -248,4 +248,4 @@ "ignore": [] } } -} +} \ No newline at end of file diff --git a/composer.lock b/composer.lock index fa39abed6c..9e387f61e0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "54f4a889853031d68bde84da08ce9b2f", + "content-hash": "ab0db37d48d57628a69a98a588fced71", "packages": [ { "name": "babenkoivan/elastic-adapter", @@ -2971,16 +2971,16 @@ }, { "name": "laravel/horizon", - "version": "v5.45.5", + "version": "v5.47.2", "source": { "type": "git", "url": "https://github.com/laravel/horizon.git", - "reference": "683b6117ec0d0495a4d18106bc2c44b3461fd92b" + "reference": "a6ac142293ad02db4d7cccb961dd32f56ef1462d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/horizon/zipball/683b6117ec0d0495a4d18106bc2c44b3461fd92b", - "reference": "683b6117ec0d0495a4d18106bc2c44b3461fd92b", + "url": "https://api.github.com/repos/laravel/horizon/zipball/a6ac142293ad02db4d7cccb961dd32f56ef1462d", + "reference": "a6ac142293ad02db4d7cccb961dd32f56ef1462d", "shasum": "" }, "require": { @@ -3045,9 +3045,9 @@ ], "support": { "issues": "https://github.com/laravel/horizon/issues", - "source": "https://github.com/laravel/horizon/tree/v5.45.5" + "source": "https://github.com/laravel/horizon/tree/v5.47.2" }, - "time": "2026-04-01T07:28:03+00:00" + "time": "2026-06-03T15:11:37+00:00" }, { "name": "laravel/pail", diff --git a/config/l5-swagger.php b/config/l5-swagger.php index 2ef80f985e..ee6f509a2e 100644 --- a/config/l5-swagger.php +++ b/config/l5-swagger.php @@ -166,9 +166,9 @@ 'description' => 'Laravel passport oauth2 security.', 'flows' => [ 'authorizationCode' => [ - 'authorizationUrl' => config('app.url') . '/oauth/authorize', - 'tokenUrl' => config('app.url') . '/oauth/token', - 'refreshUrl' => config('app.url') . '/token/refresh', + 'authorizationUrl' => '/oauth/authorize', + 'tokenUrl' => '/oauth/token', + 'refreshUrl' => '/token/refresh', 'scopes' => (object) [], ], ], diff --git a/package-lock.json b/package-lock.json index 1e3beeda40..5ea8a9004a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@processmaker/processmaker", - "version": "2026.10.1", + "version": "2026.10.2", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@processmaker/processmaker", - "version": "2026.10.1", + "version": "2026.10.2", "hasInstallScript": true, "license": "ISC", "dependencies": { diff --git a/package.json b/package.json index c106277d1d..dc2107d80a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@processmaker/processmaker", - "version": "2026.10.1", + "version": "2026.10.2", "description": "ProcessMaker 4", "author": "DevOps ", "license": "ISC", diff --git a/storage/api-docs/api-docs.json b/storage/api-docs/api-docs.json index 3755004f8f..3b01de8d45 100644 --- a/storage/api-docs/api-docs.json +++ b/storage/api-docs/api-docs.json @@ -18,14 +18,92 @@ } ], "paths": { - "/collections": { + "/cases/{case_number}": { + "delete": { + "tags": [ + "Cases" + ], + "summary": "Delete a case and its related requests", + "description": "Delete a case and its related requests.", + "operationId": "deleteCase", + "parameters": [ + { + "name": "case_number", + "in": "path", + "description": "Case number to delete", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "204": { + "description": "success" + }, + "401": { + "description": "Unauthorized" + }, + "404": { + "$ref": "#/components/responses/404" + }, + "409": { + "description": "Conflict" + }, + "500": { + "description": "Internal Server Error" + } + } + } + }, + "/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": { "get": { "tags": [ - "Collections" + "Environment Variables" ], - "summary": "Returns all collections that the user has access to", - "description": "Get a list of Collections.", - "operationId": "getCollections", + "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": [ { "$ref": "#/components/parameters/filter" @@ -45,7 +123,7 @@ ], "responses": { "200": { - "description": "list of collections", + "description": "list of environmentVariables", "content": { "application/json": { "schema": { @@ -53,11 +131,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/EnvironmentVariable" } }, "meta": { - "$ref": "#/components/schemas/metadata" + "type": "object" } }, "type": "object" @@ -69,17 +147,17 @@ }, "post": { "tags": [ - "Collections" + "Environment Variables" ], - "summary": "Save a new collections", - "description": "Create a new Collection.", - "operationId": "createCollection", + "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/collectionsEditable" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } @@ -90,7 +168,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -98,32 +176,32 @@ } } }, - "/collections/{collection_id}": { + "/environment_variables/{environment_variable_id}": { "get": { "tags": [ - "Collections" + "Environment Variables" ], - "summary": "Get single collections by ID", - "description": "Get a single Collection.", - "operationId": "getCollectionById", + "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": "collection_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of collection to return", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "200": { - "description": "Successfully found the collections", + "201": { + "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/EnvironmentVariable" } } } @@ -132,19 +210,19 @@ }, "put": { "tags": [ - "Collections" + "Environment Variables" ], - "summary": "Update a collection", - "description": "Update a Collection.", - "operationId": "updateCollection", + "summary": "Update an environment variable", + "description": "Update an environment variable", + "operationId": "updateEnvironmentVariable", "parameters": [ { - "name": "collection_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of collection to update", + "description": "ID of environment variables to update", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -153,167 +231,57 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collectionsEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - }, - "delete": { - "tags": [ - "Collections" - ], - "summary": "Delete a collection", - "description": "Delete a Collection.", - "operationId": "deleteCollection", - "parameters": [ - { - "name": "collection_id", - "in": "path", - "description": "ID of collection to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/collections/{collection_id}/export": { - "post": { - "tags": [ - "Screens" - ], - "summary": "Trigger export collections job", - "description": "Export the specified collection.", - "operationId": "exportCollection", - "parameters": [ - { - "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" + "$ref": "#/components/schemas/EnvironmentVariableEditable" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/collections" + "$ref": "#/components/schemas/EnvironmentVariable" } } } - }, - "200": { - "description": "success" } } - } - }, - "/collections/{collection_id}/truncate": { + }, "delete": { "tags": [ - "Collections" + "Environment Variables" ], - "summary": "Deletes all records in a collection", - "description": "Truncate a Collection.", - "operationId": "truncateCollection", + "summary": "Delete an environment variable", + "operationId": "deleteEnvironmentVariable", "parameters": [ { - "name": "collection_id", + "name": "environment_variable_id", "in": "path", - "description": "ID of collection to truncate", + "description": "ID of environment_variables to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { - "204": { + "200": { "description": "success" } } } }, - "/collections/{collection_id}/records": { + "/files": { "get": { "tags": [ - "Collections" + "Files" ], - "summary": "Returns all records", - "description": "Get the list of records of a collection.", - "operationId": "getRecords", + "summary": "Returns the list of files", + "description": "Display a listing of the resource.", + "operationId": "getFiles", "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" }, @@ -324,12 +292,12 @@ "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/include" + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "list of records of a collection", + "description": "list of files", "content": { "application/json": { "schema": { @@ -337,7 +305,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/records" + "$ref": "#/components/schemas/media" } }, "meta": { @@ -353,232 +321,208 @@ }, "post": { "tags": [ - "Collections" + "Files" ], - "summary": "Save a new record in a collection", - "description": "Create a new record in a Collection.", - "operationId": "createRecord", + "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": "collection_id", - "in": "path", - "description": "ID of the collection", + "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": { - "$ref": "#/components/schemas/recordsEditable" + "properties": { + "file": { + "description": "save a new media file", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/records" - } + "properties": { + "id": { + "type": "string" + }, + "model_id": { + "type": "string" + }, + "file_name": { + "type": "string" + }, + "mime_type": { + "type": "string" + } + }, + "type": "object" + } } } } } } }, - "/collections/{collection_id}/records/{record_id}": { + "/files/{file_id}": { "get": { "tags": [ - "Collections" + "Files" ], - "summary": "Get single record of a collection", - "description": "Get a single record of a Collection.", - "operationId": "getRecordById", + "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": "collection_id", - "in": "path", - "description": "ID of the collection", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "file_id", "in": "path", - "description": "ID of the record to return", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the record", + "description": "Successfully found the file", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/records" + "$ref": "#/components/schemas/media" } } } - } - } - }, - "put": { - "tags": [ - "Collections" - ], - "summary": "Update a record", - "description": "Update a record in a Collection.", - "operationId": "updateRecord", - "parameters": [ - { - "name": "collection_id", - "in": "path", - "description": "ID of collection", - "required": true, - "schema": { - "type": "string" - } }, - { - "name": "record_id", - "in": "path", - "description": "ID of the record ", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/recordsEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" + "404": { + "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "Collections" + "Files" ], - "summary": "Delete a collection record", - "description": "Delete a record of a Collection.", - "operationId": "deleteRecord", + "summary": "Delete a media file", + "description": "Remove the specified resource from storage.", + "operationId": "deleteFile", "parameters": [ { - "name": "collection_id", - "in": "path", - "description": "ID of collection", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "file_id", "in": "path", - "description": "ID of record in collection", + "description": "ID of the file", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } - }, - "patch": { + } + }, + "/files/{file_id}/contents": { + "get": { "tags": [ - "Collections" + "Files" ], - "summary": "Partial update of a record", - "description": "Implements a partial update of a record in a Collection.", - "operationId": "patchRecord", + "summary": "Get the contents of a file", + "description": "Display the specified resource.", + "operationId": "getFileContentsById", "parameters": [ { - "name": "collection_id", - "in": "path", - "description": "ID of collection ", - "required": true, - "schema": { - "type": "string" - } - }, - { - "name": "record_id", + "name": "file_id", "in": "path", - "description": "ID of the record ", + "description": "ID of the file to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/collectionsEditable" - } - } - } - }, "responses": { "200": { - "description": "success" + "description": "File stream", + "content": { + "application/octet-stream": { + "schema": { + "type": "string", + "format": "binary" + } + } + } + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/saved-searches/{saved_search_id}/charts": { + "/groups": { "get": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Returns all saved search charts that the user has access to", - "description": "Get a list of SavedSearchCharts.", - "operationId": "getSavedSearchCharts", + "summary": "Returns all groups that the user has access to", + "description": "Display a listing of the resource.", + "operationId": "getGroups", "parameters": [ { - "$ref": "#/components/parameters/filter" + "$ref": "#/components/parameters/status" }, { - "name": "type", - "in": "query", - "description": "Only return saved searches by type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] - } + "$ref": "#/components/parameters/filter" }, { "$ref": "#/components/parameters/order_by" @@ -595,7 +539,7 @@ ], "responses": { "200": { - "description": "list of saved search charts", + "description": "list of groups", "content": { "application/json": { "schema": { @@ -603,16 +547,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/groups" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -622,67 +561,19 @@ } } }, - "put": { - "tags": [ - "SavedSearchCharts" - ], - "summary": "Update several saved search charts at once", - "description": "Batch update several SavedSearchCharts.", - "operationId": "batchUpdateSavedSearchCharts", - "parameters": [ - { - "name": "saved_search_id", - "in": "path", - "description": "ID of saved search to which these charts will be saved", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchChart" - } - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - }, "post": { "tags": [ - "SavedSearchCharts" - ], - "summary": "Save a new saved search chart", - "description": "Create a new SavedSearchChart.", - "operationId": "createSavedSearchChart", - "parameters": [ - { - "name": "saved_search_id", - "in": "path", - "description": "ID of saved search to which this chart will be saved", - "required": true, - "schema": { - "type": "string" - } - } + "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/SavedSearchChartEditable" + "$ref": "#/components/schemas/groupsEditable" } } } @@ -693,61 +584,67 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/groups" } } } + }, + "422": { + "$ref": "#/components/responses/422" } } } }, - "/saved-searches/charts/{chart_id}": { + "/groups/{group_id}": { "get": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Get single saved search chart by ID", - "description": "Get a single SavedSearchChart.", - "operationId": "getSavedSearchChartById", + "summary": "Get single group by ID", + "description": "Display the specified resource.", + "operationId": "getGroupById", "parameters": [ { - "name": "chart_id", + "name": "group_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "Successfully found the saved search chart", + "description": "Successfully found the group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChart" + "$ref": "#/components/schemas/groups" } } } + }, + "404": { + "$ref": "#/components/responses/404" } } }, "put": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Update a saved search chart", - "description": "Update a SavedSearchChart.", - "operationId": "updateSavedSearchChart", + "summary": "Update a group", + "description": "Update a user", + "operationId": "updateGroup", "parameters": [ { - "name": "chart_id", + "name": "group_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], @@ -756,106 +653,94 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearchChartEditable" + "$ref": "#/components/schemas/groupsEditable" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchChart" - } - } - } + "204": { + "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } }, "delete": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Delete a saved search chart", - "description": "Delete a SavedSearchChart.", - "operationId": "deleteSavedSearchChart", + "summary": "Delete a group", + "description": "Delete a user", + "operationId": "deleteGroup", "parameters": [ { - "name": "chart_id", + "name": "group_id", "in": "path", - "description": "ID of chart to return", + "description": "ID of group to return", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "204": { "description": "success" + }, + "404": { + "$ref": "#/components/responses/404" } } } }, - "/saved-searches/charts/{chart_id}/fields": { + "/groups/{group_id}/users": { "get": { "tags": [ - "SavedSearchCharts" + "Groups" ], - "summary": "Get available chart fields for a Saved Search by ID", - "description": "Get available chart fields for a Saved Search.", - "operationId": "getSavedSearchFieldsById", + "summary": "Returns all users of a group", + "description": "Display the list of users in a group", + "operationId": "getGroupUsers", "parameters": [ { - "name": "chart_id", + "name": "group_id", "in": "path", - "description": "ID of Saved Search to return", + "description": "ID of group", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "Successfully found the saved search", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearch" - } - } - } - } - } - } - }, - "/saved-searches/reports": { - "post": { - "tags": [ - "Reports" - ], - "summary": "Save a new report", - "operationId": "createReport", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ReportEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", + "description": "list of members of a group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Report" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -863,42 +748,52 @@ } } }, - "/saved-searches/reports/{reportId}": { - "put": { + "/groups/{group_id}/groups": { + "get": { "tags": [ - "SavedSearches" + "Groups" ], - "summary": "Update a saved search", - "description": "Update a Report", - "operationId": "updateReport", + "summary": "Returns all users of a group", + "description": "Display the list of groups in a group", + "operationId": "getGroupGroupss", "parameters": [ { - "name": "reportId", + "name": "group_id", "in": "path", - "description": "ID of report", + "description": "ID of group", "required": true, "schema": { - "type": "string" + "type": "integer" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "list of members of a group", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/groups" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } @@ -906,44 +801,17 @@ } } }, - "/saved-searches": { + "/group_members": { "get": { "tags": [ - "SavedSearches" + "Group Members" ], - "summary": "Returns all saved searches that the user has access to", - "description": "Get a list of SavedSearches.", - "operationId": "getSavedSearches", + "summary": "Returns all groups for a given member", + "description": "Display a listing of the resource.", + "operationId": "getGroupMembers", "parameters": [ { - "$ref": "#/components/parameters/filter" - }, - { - "name": "type", - "in": "query", - "description": "Only return saved searches by type", - "required": false, - "schema": { - "type": "string", - "enum": [ - "request", - "task", - "collection" - ] - } - }, - { - "name": "subset", - "in": "query", - "description": "Only return saved searches that are yours or those that have been shared with you", - "required": false, - "schema": { - "type": "string", - "enum": [ - "mine", - "shared" - ] - } + "$ref": "#/components/parameters/member_id" }, { "$ref": "#/components/parameters/order_by" @@ -953,14 +821,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of saved searches", + "description": "list of group_members", "content": { "application/json": { "schema": { @@ -968,16 +833,11 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/groupMembers" } }, "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -989,17 +849,17 @@ }, "post": { "tags": [ - "SavedSearches" + "Group Members" ], - "summary": "Save a new saved search", - "description": "Create a new SavedSearch.", - "operationId": "createSavedSearch", + "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/SavedSearchEditable" + "$ref": "#/components/schemas/groupMembersEditable" } } } @@ -1010,7 +870,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/createGroupMembers" } } } @@ -1018,19 +878,19 @@ } } }, - "/saved-searches/{savedSearchId}": { + "/group_members/{group_member_id}": { "get": { "tags": [ - "SavedSearches" + "Group Members" ], - "summary": "Get single saved searches by ID", - "description": "Get a single SavedSearch.", - "operationId": "getSavedSearchById", + "summary": "Get single group member by ID", + "description": "Display the specified resource.", + "operationId": "getGroupMemberById", "parameters": [ { - "name": "savedSearchId", + "name": "group_member_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of group members to return", "required": true, "schema": { "type": "string" @@ -1039,126 +899,97 @@ ], "responses": { "200": { - "description": "Successfully found the saved search", + "description": "Successfully found the group members", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/SavedSearch" + "$ref": "#/components/schemas/getGroupMembersById" } } } } } }, - "put": { + "delete": { "tags": [ - "SavedSearches" + "Group Members" ], - "summary": "Update a saved search", - "description": "Update a SavedSearch.", - "operationId": "updateSavedSearch", + "summary": "Delete a group member", + "description": "Delete a group membership", + "operationId": "deleteGroupMember", "parameters": [ { - "name": "savedSearchId", + "name": "group_member_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of group_members to return", "required": true, "schema": { "type": "string" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearchEditable" - } - } - } - }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/SavedSearch" - } - } - } + "204": { + "description": "success" } } } }, - "/saved-searches/{savedSearchId}/columns": { + "/group_members_available": { "get": { "tags": [ - "SavedSearches" + "Group Members" ], - "summary": "Returns all columns associated with a Saved Search", - "description": "Display a listing of columns.", - "operationId": "getSavedSearchColumns", + "summary": "Returns all groups available for a given member", + "description": "Display a listing of groups available", + "operationId": "getGroupMembersAvailable", "parameters": [ { - "name": "savedSearchId", + "name": "member_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of group member to return", "required": true, "schema": { "type": "string" } }, { - "name": "include", - "in": "query", - "description": "Include specific categories. Comma separated list.", + "name": "member_type", + "in": "path", + "description": "type of group member to return", + "required": true, "schema": { - "type": "array", - "items": { - "type": "string", - "enum": [ - "current", - "default", - "available", - "data" - ] - }, - "uniqueItems": false + "type": "string" } + }, + { + "$ref": "#/components/parameters/filter" + }, + { + "$ref": "#/components/parameters/order_by" + }, + { + "$ref": "#/components/parameters/order_direction" + }, + { + "$ref": "#/components/parameters/per_page" } ], "responses": { "200": { - "description": "Categorized list of columns", + "description": "list of groups available to be assigned as member", "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" + "$ref": "#/components/schemas/availableGroupMembers" } + }, + "meta": { + "$ref": "#/components/schemas/metadata" } }, "type": "object" @@ -1169,19 +1000,19 @@ } } }, - "/saved-searches/{savedSearchId}/users": { + "/user_members_available": { "get": { "tags": [ - "Users" + "Group Members" ], - "summary": "Returns all users", - "description": "Display a listing of the resource.", - "operationId": "getSavedSearchUsers", + "summary": "Returns all users available for a given group", + "description": "Display a listing of users available", + "operationId": "getUserMembersAvailable", "parameters": [ { - "name": "savedSearchId", + "name": "group_id", "in": "path", - "description": "ID of saved search to return", + "description": "ID of group to return", "required": true, "schema": { "type": "string" @@ -1190,7 +1021,7 @@ { "name": "filter", "in": "query", - "description": "Filter results by string. Searches First Name, Last Name, Email and Username.", + "description": "Filter results by string. Searches Name. Can be a substring.", "schema": { "type": "string" } @@ -1203,14 +1034,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of users", + "description": "list of users available to be assigned as member", "content": { "application/json": { "schema": { @@ -1233,15 +1061,27 @@ } } }, - "/saved-searches/{savedSearchId}/groups": { + "/notifications": { "get": { "tags": [ - "Groups" + "Notifications" ], - "summary": "Returns all groups that the user has access to", + "summary": "Returns all notifications that the user has access to", "description": "Display a listing of the resource.", - "operationId": "getSavedSearchGroups", + "operationId": "getNotifications", "parameters": [ + { + "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" }, @@ -1257,126 +1097,7 @@ ], "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" - } - } - ], - "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 icons for saved searches", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SavedSearchIcon" - } - }, - "meta": { - "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", + "description": "list of notifications", "content": { "application/json": { "schema": { @@ -1384,17 +1105,10 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Notification" } }, - "meta": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/metadata" - } - ] - } + "meta": {} }, "type": "object" } @@ -1405,17 +1119,17 @@ }, "post": { "tags": [ - "Version History" + "Notifications" ], - "summary": "Save a new Version History", - "description": "Create a new Version History.", - "operationId": "createVersion", + "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/versionHistoryEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } @@ -1426,7 +1140,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Notification" } } } @@ -1434,19 +1148,19 @@ } } }, - "/version_histories/{version_history_id}": { + "/notifications/{notification_id}": { "get": { "tags": [ - "Version History" + "Notifications" ], - "summary": "Get single Version History by ID", - "description": "Get a single Version History.", - "operationId": "getVersionHistoryById", + "summary": "Get single notification by ID", + "description": "Display the specified resource.", + "operationId": "getNotificationById", "parameters": [ { - "name": "version_history_id", + "name": "notification_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -1455,11 +1169,11 @@ ], "responses": { "200": { - "description": "Successfully found the Version History", + "description": "Successfully found the notification", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistory" + "$ref": "#/components/schemas/Notification" } } } @@ -1468,16 +1182,16 @@ }, "put": { "tags": [ - "Version History" + "Notifications" ], - "summary": "Update a Version History", - "description": "Update a Version History.", - "operationId": "updateVersion", + "summary": "Update a notification", + "description": "Update a user", + "operationId": "updateNotification", "parameters": [ { - "name": "version_history_id", + "name": "notification_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -1489,36 +1203,29 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/versionHistoryEditable" + "$ref": "#/components/schemas/NotificationEditable" } } } }, "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } - } - } + "description": "success" } } }, "delete": { "tags": [ - "Version History" + "Notifications" ], - "summary": "Delete a Version History", - "description": "Delete a Version History.", - "operationId": "deleteVersion", + "summary": "Delete a notification", + "description": "Delete a notification", + "operationId": "deleteNotification", "parameters": [ { - "name": "version_history_id", + "name": "notification_id", "in": "path", - "description": "ID of Version History to return", + "description": "ID of notification to return", "required": true, "schema": { "type": "string" @@ -1527,68 +1234,113 @@ ], "responses": { "204": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } - } - } + "description": "success" } } } }, - "/version_histories/clone": { - "post": { + "/read_notifications": { + "put": { "tags": [ - "Version History" + "Notifications" ], - "summary": "Clone a new Version History", - "description": "Clone a new Version History.", - "operationId": "cloneVersion", + "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/versionHistoryEditable" + "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": { "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/versionHistory" - } + "description": "success" + } + } + } + }, + "/unread_notifications": { + "put": { + "tags": [ + "Notifications" + ], + "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" + } + } + }, + "type": "object" } } } + }, + "responses": { + "201": { + "description": "success" + } } } }, - "/customize-ui": { - "post": { + "/read_all_notifications": { + "put": { "tags": [ - "CssSettings" + "Notifications" ], - "summary": "Create or update a new setting", - "description": "Create a new Settings css-override", - "operationId": "updateCssSetting", + "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": { - "variables": { - "type": "string" + "id": { + "description": "Polymorphic relation id", + "type": "integer" }, - "sansSerifFont": { + "type": { + "description": "Polymorphic relation type", "type": "string" } }, @@ -1599,29 +1351,73 @@ }, "responses": { "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/settings" - } - } - } + "description": "success" } } } }, - "/environment_variables": { - "get": { + "/permissions": { + "put": { "tags": [ - "Environment Variables" + "Permissions" ], - "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": "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" + } + } + } + }, + "responses": { + "204": { + "description": "success" + } + } + } + }, + "/process_categories": { + "get": { + "tags": [ + "Process Categories" + ], + "summary": "Returns all processes categories that the user has access to", + "description": "Display a listing of the Process Categories.", + "operationId": "getProcessCategories", "parameters": [ { - "$ref": "#/components/parameters/filter" + "name": "filter", + "in": "query", + "description": "Filter results by string. Searches Name and Status. All fields must match exactly.", + "schema": { + "type": "string" + } }, { "$ref": "#/components/parameters/order_by" @@ -1631,14 +1427,11 @@ }, { "$ref": "#/components/parameters/per_page" - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of environmentVariables", + "description": "list of processes categories", "content": { "application/json": { "schema": { @@ -1646,7 +1439,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessCategory" } }, "meta": { @@ -1662,17 +1455,17 @@ }, "post": { "tags": [ - "Environment Variables" + "Process Categories" ], - "summary": "Create a new environment variable", - "description": "Creates a new global Environment Variable in the system", - "operationId": "createEnvironmentVariable", + "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/EnvironmentVariableEditable" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -1683,7 +1476,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -1691,19 +1484,19 @@ } } }, - "/environment_variables/{environment_variable_id}": { + "/process_categories/{process_category_id}": { "get": { "tags": [ - "Environment Variables" + "Process Categories" ], - "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 process category by ID", + "description": "Display the specified Process category.", + "operationId": "getProcessCategoryById", "parameters": [ { - "name": "environment_variable_id", + "name": "process_category_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of process category to return", "required": true, "schema": { "type": "integer" @@ -1711,12 +1504,12 @@ } ], "responses": { - "201": { - "description": "success", + "200": { + "description": "Successfully found the process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -1725,16 +1518,16 @@ }, "put": { "tags": [ - "Environment Variables" + "Process Categories" ], - "summary": "Update an environment variable", - "description": "Update an environment variable", - "operationId": "updateEnvironmentVariable", + "summary": "Update a process Category", + "description": "Updates the current element", + "operationId": "updateProcessCategory", "parameters": [ { - "name": "environment_variable_id", + "name": "process_category_id", "in": "path", - "description": "ID of environment variables to update", + "description": "ID of process category to return", "required": true, "schema": { "type": "integer" @@ -1746,7 +1539,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariableEditable" + "$ref": "#/components/schemas/ProcessCategoryEditable" } } } @@ -1757,7 +1550,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/EnvironmentVariable" + "$ref": "#/components/schemas/ProcessCategory" } } } @@ -1766,15 +1559,16 @@ }, "delete": { "tags": [ - "Environment Variables" + "Process Categories" ], - "summary": "Delete an environment variable", - "operationId": "deleteEnvironmentVariable", + "summary": "Delete a process category", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcessCategory", "parameters": [ { - "name": "environment_variable_id", + "name": "process_category_id", "in": "path", - "description": "ID of environment_variables to return", + "description": "ID of process category to return", "required": true, "schema": { "type": "integer" @@ -1782,20 +1576,27 @@ } ], "responses": { - "200": { - "description": "success" + "204": { + "description": "success", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } } } } }, - "/files": { + "/processes": { "get": { "tags": [ - "Files" + "Processes" ], - "summary": "Returns the list of files", - "description": "Display a listing of the resource.", - "operationId": "getFiles", + "summary": "Returns all processes that the user has access to", + "description": "Get list Process", + "operationId": "getProcesses", "parameters": [ { "$ref": "#/components/parameters/filter" @@ -1808,11 +1609,26 @@ }, { "$ref": "#/components/parameters/per_page" + }, + { + "$ref": "#/components/parameters/status" + }, + { + "$ref": "#/components/parameters/include" + }, + { + "name": "simplified_data_for_selector", + "in": "query", + "description": "Comma separated list of fields to include in the response", + "schema": { + "type": "string", + "default": "" + } } ], "responses": { "200": { - "description": "list of files", + "description": "list of processes", "content": { "application/json": { "schema": { @@ -1820,7 +1636,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/media" + "$ref": "#/components/schemas/Process" } }, "meta": { @@ -1836,87 +1652,28 @@ }, "post": { "tags": [ - "Files" + "Processes" ], - "summary": "Save a new media file. Note: To upload files to a request, use createRequestFile in the RequestFile API", + "summary": "Save a new process", "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" - } - } - ], + "operationId": "createProcess", "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/ProcessEditable" } } } }, "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/Process" } } } @@ -1924,1041 +1681,48 @@ } } }, - "/files/{file_id}": { + "/processes/{processId}": { "get": { "tags": [ - "Files" + "Processes" ], - "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 process by ID", + "description": "Display the specified resource.", + "operationId": "getProcessById", "parameters": [ { - "name": "file_id", + "name": "processId", "in": "path", - "description": "ID of the file to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } - } - ], - "responses": { - "200": { - "description": "Successfully found the file", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/media" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - }, - "delete": { - "tags": [ - "Files" - ], - "summary": "Delete a media file", - "description": "Remove the specified resource from storage.", - "operationId": "deleteFile", - "parameters": [ - { - "name": "file_id", - "in": "path", - "description": "ID of the file", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/files/{file_id}/contents": { - "get": { - "tags": [ - "Files" - ], - "summary": "Get the contents of a file", - "description": "Display the specified resource.", - "operationId": "getFileContentsById", - "parameters": [ - { - "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" - } - } - } - }, - "/groups": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Returns all groups that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getGroups", - "parameters": [ - { - "$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/groupsEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/groups" - } - } - } - }, - "422": { - "$ref": "#/components/responses/422" - } - } - } - }, - "/groups/{group_id}": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Get single group by ID", - "description": "Display the specified resource.", - "operationId": "getGroupById", - "parameters": [ - { - "name": "group_id", - "in": "path", - "description": "ID of group to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the group", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/groups" - } - } - } - }, - "404": { - "$ref": "#/components/responses/404" - } - } - }, - "put": { - "tags": [ - "Groups" - ], - "summary": "Update a group", - "description": "Update a user", - "operationId": "updateGroup", - "parameters": [ - { - "name": "group_id", - "in": "path", - "description": "ID of group to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/groupsEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - } - } - }, - "delete": { - "tags": [ - "Groups" - ], - "summary": "Delete a group", - "description": "Delete a user", - "operationId": "deleteGroup", - "parameters": [ - { - "name": "group_id", - "in": "path", - "description": "ID of group to return", - "required": true, - "schema": { - "type": "integer" - } - } - ], - "responses": { - "204": { - "description": "success" - }, - "404": { - "$ref": "#/components/responses/404" - } - } - } - }, - "/groups/{group_id}/users": { - "get": { - "tags": [ - "Groups" - ], - "summary": "Returns all users of a group", - "description": "Display the list of users in a group", - "operationId": "getGroupUsers", - "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": "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" - } - } - } - } - } - } - }, - "/groups/{group_id}/groups": { - "get": { - "tags": [ - "Groups" - ], - "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": "list of members of a group", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/groups" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } - } - } - } - }, - "/group_members": { - "get": { - "tags": [ - "Group Members" - ], - "summary": "Returns all groups for a given member", - "description": "Display a listing of the resource.", - "operationId": "getGroupMembers", - "parameters": [ - { - "$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/groupMembersEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/createGroupMembers" - } - } - } - } - } - } - }, - "/group_members/{group_member_id}": { - "get": { - "tags": [ - "Group Members" - ], - "summary": "Get single group member by ID", - "description": "Display the specified resource.", - "operationId": "getGroupMemberById", - "parameters": [ - { - "name": "group_member_id", - "in": "path", - "description": "ID of group members to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the group members", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/getGroupMembersById" - } - } - } - } - } - }, - "delete": { - "tags": [ - "Group Members" - ], - "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": { - "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" - } - }, - { - "$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", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/availableGroupMembers" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" - } - } - } - } - } - } - }, - "/user_members_available": { - "get": { - "tags": [ - "Group Members" - ], - "summary": "Returns all users available for a given group", - "description": "Display a listing of users available", - "operationId": "getUserMembersAvailable", - "parameters": [ - { - "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" - }, - { - "$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" - } - } - } - } - } - } - }, - "/notifications": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Returns all notifications that the user has access to", - "description": "Display a listing of the resource.", - "operationId": "getNotifications", - "parameters": [ - { - "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": "list of notifications", - "content": { - "application/json": { - "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Notification" - } - }, - "meta": {} - }, - "type": "object" - } - } - } - } - } - }, - "post": { - "tags": [ - "Notifications" - ], - "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/NotificationEditable" - } - } - } - }, - "responses": { - "201": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Notification" - } - } - } - } - } - } - }, - "/notifications/{notification_id}": { - "get": { - "tags": [ - "Notifications" - ], - "summary": "Get single notification by ID", - "description": "Display the specified resource.", - "operationId": "getNotificationById", - "parameters": [ - { - "name": "notification_id", - "in": "path", - "description": "ID of notification to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "200": { - "description": "Successfully found the notification", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Notification" - } - } - } - } - } - }, - "put": { - "tags": [ - "Notifications" - ], - "summary": "Update a notification", - "description": "Update a user", - "operationId": "updateNotification", - "parameters": [ - { - "name": "notification_id", - "in": "path", - "description": "ID of notification to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/NotificationEditable" - } - } - } - }, - "responses": { - "204": { - "description": "success" - } - } - }, - "delete": { - "tags": [ - "Notifications" - ], - "summary": "Delete a notification", - "description": "Delete a notification", - "operationId": "deleteNotification", - "parameters": [ - { - "name": "notification_id", - "in": "path", - "description": "ID of notification to return", - "required": true, - "schema": { - "type": "string" - } - } - ], - "responses": { - "204": { - "description": "success" - } - } - } - }, - "/read_notifications": { - "put": { - "tags": [ - "Notifications" - ], - "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" - } - } - } - }, - "responses": { - "201": { - "description": "success" - } - } - } - }, - "/unread_notifications": { - "put": { - "tags": [ - "Notifications" - ], - "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" - } - } - }, - "type": "object" - } - } - } - }, - "responses": { - "201": { - "description": "success" - } - } - } - }, - "/read_all_notifications": { - "put": { - "tags": [ - "Notifications" - ], - "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": { - "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": { - "204": { - "description": "success" - } - } - } - }, - "/process_categories": { - "get": { - "tags": [ - "Process Categories" - ], - "summary": "Returns all processes categories that the user has access to", - "description": "Display a listing of the Process Categories.", - "operationId": "getProcessCategories", - "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/order_by" - }, - { - "$ref": "#/components/parameters/order_direction" }, { - "$ref": "#/components/parameters/per_page" + "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "list of processes categories", + "description": "Successfully found the process", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Process" + } + } + } + }, + "204": { + "description": "Process not found", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessCategory" - } - }, - "meta": { - "type": "object" + "message": { + "type": "string", + "example": "The requested process was not found" } }, "type": "object" @@ -2968,50 +1732,59 @@ } } }, - "post": { + "put": { "tags": [ - "Process Categories" + "Processes" + ], + "summary": "Update a process", + "description": "Updates the current element.", + "operationId": "updateProcess", + "parameters": [ + { + "name": "processId", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } + } ], - "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" + "$ref": "#/components/schemas/ProcessEditable" } } } }, "responses": { - "201": { + "200": { "description": "success", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "$ref": "#/components/schemas/Process" } } } } } - } - }, - "/process_categories/{process_category_id}": { - "get": { + }, + "delete": { "tags": [ - "Process Categories" + "Processes" ], - "summary": "Get single process category by ID", - "description": "Display the specified Process category.", - "operationId": "getProcessCategoryById", + "summary": "Delete a process", + "description": "Remove the specified resource from storage.", + "operationId": "deleteProcess", "parameters": [ { - "name": "process_category_id", + "name": "processId", "in": "path", - "description": "ID of process category to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" @@ -3019,79 +1792,90 @@ } ], "responses": { - "200": { - "description": "Successfully found the process", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessCategory" - } - } - } + "204": { + "description": "success" } } - }, - "put": { + } + }, + "/processes/{processId}/start_events": { + "get": { "tags": [ - "Process Categories" + "Processes" ], - "summary": "Update a process Category", - "description": "Updates the current element", - "operationId": "updateProcessCategory", + "summary": "Get start events of a process by Id", + "description": "Display the specified resource.", + "operationId": "getStartEventsProcessById", "parameters": [ { - "name": "process_category_id", + "name": "processId", "in": "path", - "description": "ID of process category to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } + }, + { + "$ref": "#/components/parameters/include" } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessCategoryEditable" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successfully found the start events process", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessCategory" + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProcessStartEvents" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" } } } } } - }, - "delete": { + } + }, + "/processes/{processId}/draft": { + "put": { "tags": [ - "Process Categories" + "Processes" ], - "summary": "Delete a process category", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcessCategory", + "summary": "Update a draft process", + "description": "Update draft process.", + "operationId": "updateDraftProcess", "parameters": [ { - "name": "process_category_id", + "name": "processId", "in": "path", - "description": "ID of process category to return", + "description": "ID of process to return", "required": true, "schema": { "type": "integer" } } ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ProcessEditable" + } + } + } + }, "responses": { - "204": { + "200": { "description": "success", "content": { "application/json": { @@ -3104,14 +1888,14 @@ } } }, - "/processes": { + "/start_processes": { "get": { "tags": [ "Processes" ], - "summary": "Returns all processes that the user has access to", - "description": "Get list Process", - "operationId": "getProcesses", + "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": [ { "$ref": "#/components/parameters/filter" @@ -3125,25 +1909,22 @@ { "$ref": "#/components/parameters/per_page" }, - { - "$ref": "#/components/parameters/status" - }, { "$ref": "#/components/parameters/include" }, { - "name": "simplified_data_for_selector", - "in": "query", - "description": "Comma separated list of fields to include in the response", + "name": "without_event_definitions", + "in": "path", + "description": "If true return only processes that haven't start event definitions", + "required": false, "schema": { - "type": "string", - "default": "" + "type": "boolean" } } ], "responses": { "200": { - "description": "list of processes", + "description": "list of processes that the user can start", "content": { "application/json": { "schema": { @@ -3151,7 +1932,7 @@ "data": { "type": "array", "items": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/ProcessWithStartEvents" } }, "meta": { @@ -3164,26 +1945,29 @@ } } } - }, - "post": { + } + }, + "/processes/{processId}/restore": { + "put": { "tags": [ "Processes" ], - "summary": "Save a new process", - "description": "Store a newly created resource in storage.", - "operationId": "createProcess", - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessEditable" - } + "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": { - "201": { + "200": { "description": "success", "content": { "application/json": { @@ -3196,65 +1980,104 @@ } } }, - "/processes/{processId}": { - "get": { + "/processes/{processId}/export": { + "post": { "tags": [ "Processes" ], - "summary": "Get single process by ID", - "description": "Display the specified resource.", - "operationId": "getProcessById", + "summary": "Export a single process by ID and return a URL to download it", + "description": "Export the specified process.", + "operationId": "exportProcess", "parameters": [ { "name": "processId", "in": "path", - "description": "ID of process to return", + "description": "ID of process to export", "required": true, "schema": { "type": "integer" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the process", + "description": "Successfully built the process for export", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "properties": { + "url": { + "type": "string" + } + }, + "type": "object" } } } } } - }, - "put": { + } + }, + "/processes/import/validation": { + "post": { "tags": [ "Processes" ], - "summary": "Update a process", - "description": "Updates the current element.", - "operationId": "updateProcess", - "parameters": [ - { - "name": "processId", - "in": "path", - "description": "ID of process to return", - "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": { - "$ref": "#/components/schemas/ProcessEditable" + "properties": { + "file": { + "description": "file to import", + "type": "string", + "format": "binary" + } + }, + "type": "object" } } } @@ -3265,25 +2088,27 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "$ref": "#/components/schemas/ProcessImport" } } } } } - }, - "delete": { + } + }, + "/processes/{processId}/bpmn": { + "get": { "tags": [ "Processes" ], - "summary": "Delete a process", - "description": "Remove the specified resource from storage.", - "operationId": "deleteProcess", + "summary": "Download the BPMN definition of a process", + "description": "Download the BPMN definition of a process", + "operationId": "processBpmn", "parameters": [ { "name": "processId", "in": "path", - "description": "ID of process to return", + "description": "ID of process", "required": true, "schema": { "type": "integer" @@ -3291,49 +2116,52 @@ } ], "responses": { - "204": { - "description": "success" + "200": { + "description": "Successfully built the process for export", + "content": { + "application/json": { + "schema": { + "properties": { + "url": { + "type": "string" + } + }, + "type": "object" + } + } + } } } } }, - "/processes/{processId}/start_events": { - "get": { + "/processes/import/{code}/is_ready": { + "head": { "tags": [ "Processes" ], - "summary": "Get start events of a process by Id", - "description": "Display the specified resource.", - "operationId": "getStartEventsProcessById", + "summary": "Check if the import is ready", + "description": "Check if the import is ready", + "operationId": "6a131993b7c879ddcd3d3a291dd8380f", "parameters": [ { - "name": "processId", + "name": "code", "in": "path", - "description": "ID of process to return", + "description": "Import code", "required": true, "schema": { - "type": "integer" + "type": "string" } - }, - { - "$ref": "#/components/parameters/include" } ], "responses": { "200": { - "description": "Successfully found the start events process", + "description": "check is import is ready", "content": { "application/json": { "schema": { "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessStartEvents" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" + "ready": { + "type": "boolean" } }, "type": "object" @@ -3344,17 +2172,17 @@ } } }, - "/processes/{processId}/draft": { - "put": { + "/processes/{process_id}/import/assignments": { + "post": { "tags": [ "Processes" ], - "summary": "Update a draft process", - "description": "Update draft process.", - "operationId": "updateDraftProcess", + "summary": "Update assignments after import", + "description": "Import Assignments of process.", + "operationId": "assignmentProcess", "parameters": [ { - "name": "processId", + "name": "process_id", "in": "path", "description": "ID of process to return", "required": true, @@ -3368,77 +2196,64 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessEditable" + "$ref": "#/components/schemas/ProcessAssignments" } } } }, "responses": { - "200": { - "description": "success", - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/Process" - } - } - } + "204": { + "description": "success" } } } }, - "/start_processes": { - "get": { + "/process_events/{process_id}": { + "post": { "tags": [ "Processes" ], - "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": "Start a new process", + "description": "Trigger an start event within a process.", + "operationId": "triggerStartEvent", "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": "process_id", + "in": "path", + "description": "ID of process to return", + "required": true, + "schema": { + "type": "integer" + } }, { - "name": "without_event_definitions", - "in": "path", - "description": "If true return only processes that haven't start event definitions", - "required": false, + "name": "event", + "in": "query", + "description": "Node ID of the start event", + "required": true, "schema": { - "type": "boolean" + "type": "string" + } + } + ], + "requestBody": { + "description": "data that will be stored as part of the created request", + "required": false, + "content": { + "application/json": { + "schema": { + "type": "object" + } } } - ], + }, "responses": { "200": { - "description": "list of processes that the user can start", + "description": "success", "content": { "application/json": { "schema": { - "properties": { - "data": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProcessWithStartEvents" - } - }, - "meta": { - "$ref": "#/components/schemas/metadata" - } - }, - "type": "object" + "$ref": "#/components/schemas/processRequest" } } } @@ -3446,67 +2261,110 @@ } } }, - "/processes/{processId}/restore": { - "put": { + "/processes/{process}/stages": { + "get": { "tags": [ "Processes" ], - "summary": "Restore an inactive process", - "description": "Reverses the soft delete of the element.", - "operationId": "restoreProcess", + "summary": "Get the list of stages for a process", + "description": "Get stages of a process", + "operationId": "b40606bf1f4f04479be88823f470626f", "parameters": [ { - "name": "processId", + "name": "process", "in": "path", - "description": "ID of process to return", + "description": "ID of the process", "required": true, "schema": { "type": "integer" } + }, + { + "name": "alternative", + "in": "query", + "description": "Alternative version (A or B)", + "required": false, + "schema": { + "type": "string" + } } ], "responses": { "200": { - "description": "success", + "description": "List of stages", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Process" + "type": "array", + "items": { + "properties": { + "id": { + "type": "integer" + }, + "order": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "selected": { + "type": "boolean" + } + }, + "type": "object" + } } } } } } - } - }, - "/processes/{processId}/export": { + }, "post": { "tags": [ "Processes" ], - "summary": "Export a single process by ID and return a URL to download it", - "description": "Export the specified process.", - "operationId": "exportProcess", + "summary": "Save or update the list of stages for a process", + "description": "Save stages for a process", + "operationId": "eb23a62117463592164d70f29aecdf9b", "parameters": [ { - "name": "processId", + "name": "process", "in": "path", - "description": "ID of process to export", + "description": "ID of the process", "required": true, "schema": { "type": "integer" } + }, + { + "name": "alternative", + "in": "query", + "description": "Alternative version (A or B)", + "required": false, + "schema": { + "type": "string" + } } ], - "responses": { - "200": { - "description": "Successfully built the process for export", - "content": { - "application/json": { - "schema": { + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { "properties": { - "url": { + "id": { + "type": "integer" + }, + "order": { + "type": "integer" + }, + "label": { "type": "string" + }, + "selected": { + "type": "boolean" } }, "type": "object" @@ -3514,41 +2372,31 @@ } } } - } - } - }, - "/processes/import/validation": { - "post": { - "tags": [ - "Processes" - ], - "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", + "description": "Updated stages", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "type": "array", + "items": { + "properties": { + "id": { + "type": "integer" + }, + "order": { + "type": "integer" + }, + "name": { + "type": "string" + }, + "selected": { + "type": "boolean" + } + }, + "type": "object" + } } } } @@ -3556,111 +2404,197 @@ } } }, - "/processes/import": { - "post": { + "/processes/{process}/aggregation": { + "get": { "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" - } + "summary": "Get the aggregation configuration for a process", + "description": "Get aggregation for a process", + "operationId": "ecf07de0e8ce9b5876c72ea0133d83a4", + "parameters": [ + { + "name": "process", + "in": "path", + "description": "ID of the process", + "required": true, + "schema": { + "type": "integer" } } - }, + ], "responses": { "200": { - "description": "success", + "description": "Aggregation configuration", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/ProcessImport" + "properties": { + "aggregation": { + "description": "string containing var aggregation", + "type": "string" + } + }, + "type": "object" } } } } } - } - }, - "/processes/{processId}/bpmn": { - "get": { + }, + "post": { "tags": [ "Processes" ], - "summary": "Download the BPMN definition of a process", - "description": "Download the BPMN definition of a process", - "operationId": "processBpmn", + "summary": "Save or update the aggregation field for a process", + "description": "Updates the aggregation field of a process. If no aggregation is provided, defaults to 'amount'.", + "operationId": "8b6d8704835d8571bc50e31938fd7ded", "parameters": [ { - "name": "processId", + "name": "process", "in": "path", - "description": "ID of process", + "description": "ID of the process", "required": true, "schema": { "type": "integer" } } ], + "requestBody": { + "required": false, + "content": { + "application/json": { + "schema": { + "properties": { + "aggregation": { + "description": "Field name to use for aggregation (defaults to 'amount' if not provided)", + "type": "string", + "example": "amount" + } + }, + "type": "object" + } + } + } + }, "responses": { "200": { - "description": "Successfully built the process for export", + "description": "Updated aggregation field", "content": { "application/json": { "schema": { "properties": { - "url": { - "type": "string" + "data": { + "description": "The saved aggregation field value", + "type": "string", + "example": "amount" } }, "type": "object" } } } + }, + "404": { + "description": "Process not found" } } } }, - "/processes/import/{code}/is_ready": { - "head": { + "/processes/{process}/stage-mapping": { + "get": { "tags": [ "Processes" ], - "summary": "Check if the import is ready", - "description": "Check if the import is ready", - "operationId": "6a131993b7c879ddcd3d3a291dd8380f", + "summary": "Get process stages configuration", + "description": "Retrieves and formats the stages configuration for a specific process, including total counts and individual stages.", + "operationId": "getStageMapping", "parameters": [ { - "name": "code", + "name": "process", "in": "path", - "description": "Import code", + "description": "ID of the process", "required": true, "schema": { - "type": "string" + "type": "integer" } } ], "responses": { "200": { - "description": "check is import is ready", + "description": "Successful operation", "content": { "application/json": { "schema": { "properties": { - "ready": { - "type": "boolean" + "data": { + "properties": { + "total": { + "properties": { + "stage_id": { + "type": "number", + "example": "0" + }, + "stage_name": { + "type": "string", + "example": "Total Cases" + }, + "percentage": { + "type": "number", + "example": 100 + }, + "percentage_format": { + "type": "string", + "example": "100%" + }, + "agregation_sum": { + "type": "number", + "example": 50000 + }, + "agregation_count": { + "type": "number", + "example": 150 + } + }, + "type": "object" + }, + "stages": { + "type": "array", + "items": { + "properties": { + "stage_id": { + "type": "number", + "example": "1" + }, + "stage_name": { + "type": "string", + "example": "In progress" + }, + "percentage": { + "type": "number", + "example": 60, + "nullable": true + }, + "percentage_format": { + "type": "string", + "example": "60%" + }, + "agregation_sum": { + "type": "number", + "example": 28678, + "nullable": true + }, + "agregation_count": { + "type": "number", + "example": 100, + "nullable": true + } + }, + "type": "object" + } + } + }, + "type": "object" } }, "type": "object" @@ -3671,88 +2605,157 @@ } } }, - "/processes/{process_id}/import/assignments": { - "post": { + "/api/processes/{process}/default-stages": { + "get": { "tags": [ "Processes" ], - "summary": "Update assignments after import", - "description": "Import Assignments of process.", - "operationId": "assignmentProcess", + "summary": "Get default process stages configuration", + "description": "Retrieves and formats the default stages configuration for a process.", + "operationId": "getDefaultStagesPerProcess", "parameters": [ { - "name": "process_id", + "name": "process", "in": "path", - "description": "ID of process to return", + "description": "ID of the process", "required": true, "schema": { "type": "integer" } } ], - "requestBody": { - "required": true, - "content": { - "application/json": { - "schema": { - "$ref": "#/components/schemas/ProcessAssignments" + "responses": { + "200": { + "description": "Successful operation", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "properties": { + "stage_id": { + "type": "number", + "example": "1" + }, + "stage_name": { + "type": "string", + "example": "In progress" + }, + "percentage": { + "type": "number", + "example": 60, + "nullable": true + }, + "percentage_format": { + "type": "string", + "example": "60%" + }, + "agregation_sum": { + "type": "number", + "example": 28678, + "nullable": true + }, + "agregation_count": { + "type": "number", + "example": 100, + "nullable": true + } + }, + "type": "object" + } + } } } } - }, - "responses": { - "204": { - "description": "success" - } } } }, - "/process_events/{process_id}": { - "post": { + "/api/processes/{process}/metrics": { + "get": { "tags": [ "Processes" ], - "summary": "Start a new process", - "description": "Trigger an start event within a process.", - "operationId": "triggerStartEvent", + "summary": "Get process metrics configuration", + "description": "Retrieves and formats the metrics configuration for a specific process. Supports different formats like 'student' or default metrics.", + "operationId": "getMetricsPerProcess", "parameters": [ { - "name": "process_id", + "name": "process", "in": "path", - "description": "ID of process to return", + "description": "ID of the process", "required": true, "schema": { "type": "integer" } }, { - "name": "event", + "name": "format", "in": "query", - "description": "Node ID of the start event", - "required": true, + "description": "Format type of the metrics (e.g., 'student')", + "required": false, "schema": { - "type": "string" + "type": "string", + "default": "student", + "enum": [ + "student", + "default" + ] } } ], - "requestBody": { - "description": "data that will be stored as part of the created request", - "required": false, - "content": { - "application/json": { - "schema": { - "type": "object" - } - } - } - }, "responses": { "200": { - "description": "success", + "description": "Successful operation", "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/processRequest" + "type": "array", + "items": { + "properties": { + "id": { + "type": "integer", + "example": 1 + }, + "metric_description": { + "type": "string", + "example": "Max amount available" + }, + "metric_count": { + "type": "integer", + "example": 10, + "nullable": true + }, + "metric_count_description": { + "type": "string", + "example": "Across 10 applicants" + }, + "metric_value": { + "type": "number", + "example": 84000 + }, + "metric_value_unit": { + "type": "string", + "example": "k" + } + }, + "type": "object" + } + } + } + } + }, + "400": { + "description": "Invalid format parameter", + "content": { + "application/json": { + "schema": { + "properties": { + "error": { + "type": "string", + "example": "Invalid format parameter" + } + }, + "type": "object" } } } @@ -5130,6 +4133,9 @@ "items": { "type": "object" } + }, + "sync": { + "type": "boolean" } }, "type": "object" @@ -6441,6 +5447,64 @@ } } } + }, + "post": { + "tags": [ + "Users" + ], + "summary": "Returns all users and their total tasks (POST version for large form_data)", + "operationId": "postUsersTaskCount", + "requestBody": { + "description": "Request body for filtering users", + "content": { + "application/json": { + "schema": { + "properties": { + "filter": { + "description": "Filter results by string. Searches First Name, Last Name, Email, or Username.", + "type": "string" + }, + "include_ids": { + "description": "Comma separated list of user IDs to include in the response. Eg. 1,2,3", + "type": "string" + }, + "assignable_for_task_id": { + "description": "Task ID to get assignable users for", + "type": "integer" + }, + "form_data": { + "description": "Form data used to evaluate rule expressions for task assignment", + "type": "object" + } + }, + "type": "object" + } + } + } + }, + "responses": { + "200": { + "description": "List of users with task counts", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/users" + } + }, + "meta": { + "$ref": "#/components/schemas/metadata" + } + }, + "type": "object" + } + } + } + } + } } }, "/users/{user_id}": { @@ -6922,378 +5986,233 @@ } } } - } - }, - "components": { - "schemas": { - "DateTime": { - "properties": { - "date": { - "type": "string" - } - }, - "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": [ + }, + "/processes/variables": { + "get": { + "tags": [ + "Processes Variables" + ], + "summary": "Get variables for multiple processes with pagination", + "operationId": "660c9459febd17c58400be4b4d49a152", + "parameters": [ { - "$ref": "#/components/schemas/collectionsEditable" + "name": "processIds", + "in": "query", + "description": "Comma-separated list of process IDs", + "required": false, + "schema": { + "type": "string", + "example": "1,2,3", + "nullable": true + } }, { - "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" + "name": "page", + "in": "query", + "description": "Page number", + "required": false, + "schema": { + "type": "integer", + "default": 1 + } }, { - "properties": { - "id": { - "type": "integer" - }, - "collection_id": { - "type": "string", - "format": "id" - } - }, - "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" + "name": "per_page", + "in": "query", + "description": "Items per page", + "required": false, + "schema": { + "type": "integer", + "default": 20 + } } - }, - "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" - }, + ], + "responses": { + "200": { + "description": "Successful response", + "content": { + "application/json": { + "schema": { + "properties": { + "data": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Variable" + } + }, + "meta": { + "$ref": "#/components/schemas/PaginationMeta" + } + }, + "type": "object" + } + } + } + } + }, + "servers": [ { - "$ref": "#/components/schemas/SavedSearchEditable" + "url": "http://landlord.test/api/1.1", + "description": "API v1.1 Server" } ] - }, - "SavedSearchIcon": { + } + } + }, + "components": { + "schemas": { + "DateTime": { "properties": { - "name": { - "type": "string" - }, - "value": { + "date": { "type": "string" } }, "type": "object" }, - "SavedSearchChartEditable": { + "updateUserGroups": { "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" + "groups": { + "type": "array", + "items": { + "type": "integer", + "example": 1 + } } }, "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" + "restoreUser": { + "properties": { + "username": { + "description": "Username to restore", + "type": "string" } - ] + }, + "type": "object" }, - "ReportEditable": { + "Variable": { "properties": { - "type": { + "id": { + "type": "integer", + "example": 1 + }, + "process_id": { + "type": "integer", + "example": 1 + }, + "uuid": { "type": "string", - "enum": [ - "adhoc", - "scheduled" - ] + "format": "uuid", + "example": "550e8400-e29b-41d4-a716-446655440000" }, - "format": { + "field": { "type": "string", + "example": "string", "enum": [ - "csv", - "xlsx" + "string", + "number", + "boolean", + "array" ] }, - "saved_search_id": { - "type": "integer" - }, - "config": { - "type": "object", - "additionalProperties": "true" - }, - "to": { - "type": "array", - "items": { - "type": "string" - } + "label": { + "type": "string", + "example": "Variable 1 for Process 1" }, - "subject": { - "type": "string" + "name": { + "type": "string", + "example": "var_1_1" }, - "body": { - "type": "string" - } - }, - "type": "object" - }, - "Report": { - "allOf": [ - { + "asset": { "properties": { "id": { "type": "string", - "format": "id" + "example": "asset_1_1" }, - "user_id": { + "type": { "type": "string", - "format": "id" + "example": "sensor", + "enum": [ + "sensor", + "actuator", + "controller", + "device" + ] }, - "created_at": { + "name": { "type": "string", - "format": "date-time" + "example": "Asset 1 for Process 1" }, - "updated_at": { + "uuid": { "type": "string", - "format": "date-time" + "format": "uuid", + "example": "550e8400-e29b-41d4-a716-446655440000" } }, "type": "object" }, - { - "$ref": "#/components/schemas/SavedSearchEditable" + "created_at": { + "type": "string", + "format": "date-time" + }, + "updated_at": { + "type": "string", + "format": "date-time" } - ] + }, + "type": "object" }, - "versionHistoryEditable": { + "PaginationMeta": { "properties": { - "versionable_id": { - "description": "Class VersionHistoryCollection", - "type": "integer" + "current_page": { + "type": "integer", + "example": 1 }, - "versionable_type": { - "type": "string" + "from": { + "type": "integer", + "example": 1 }, - "name": { - "type": "string" + "last_page": { + "type": "integer", + "example": 5 }, - "subject": { - "type": "string" + "path": { + "type": "string", + "example": "http://processmaker.com/processes/variables" }, - "description": { - "type": "string" + "per_page": { + "type": "integer", + "example": 20 }, - "status": { - "type": "string", - "enum": [ - "ACTIVE", - "INACTIVE" - ] - } - }, - "type": "object" - }, - "versionHistory": { - "type": "object", - "allOf": [ - { - "$ref": "#/components/schemas/versionHistoryEditable" + "to": { + "type": "integer", + "example": 20 }, - { + "total": { + "type": "integer", + "example": 100 + }, + "links": { "properties": { - "created_at": { + "first": { "type": "string", - "format": "date-time" + "example": "http://processmaker.com/processes/variables?page=1" }, - "updated_at": { + "last": { "type": "string", - "format": "date-time" + "example": "http://processmaker.com/processes/variables?page=5" + }, + "prev": { + "type": "string", + "nullable": true + }, + "next": { + "type": "string", + "example": "http://processmaker.com/processes/variables?page=2" } }, "type": "object" } - ] - }, - "updateUserGroups": { - "properties": { - "groups": { - "type": "array", - "items": { - "type": "integer", - "example": 1 - } - } - }, - "type": "object" - }, - "restoreUser": { - "properties": { - "username": { - "description": "Username to restore", - "type": "string" - } }, "type": "object" }, @@ -7982,8 +6901,11 @@ "type": "object" }, "manager_id": { - "type": "integer", - "format": "id" + "type": "array", + "items": { + "type": "integer", + "format": "id" + } } }, "type": "object" @@ -8632,6 +7554,9 @@ }, "key": { "type": "string" + }, + "output": { + "type": "object" } }, "type": "object" @@ -9002,6 +7927,9 @@ }, "force_change_password": { "type": "boolean" + }, + "email_task_notification": { + "type": "boolean" } }, "type": "object" @@ -9194,9 +8122,9 @@ "description": "Laravel passport oauth2 security.", "flows": { "authorizationCode": { - "authorizationUrl": "http://processmaker.test/oauth/authorize", - "tokenUrl": "http://processmaker.test/oauth/token", - "refreshUrl": "http://processmaker.test/token/refresh", + "authorizationUrl": "/oauth/authorize", + "tokenUrl": "/oauth/token", + "refreshUrl": "/token/refresh", "scopes": {} } } @@ -9208,6 +8136,108 @@ } } }, + "tags": [ + { + "name": "Cases", + "description": "Cases" + }, + { + "name": "CssSettings", + "description": "CssSettings" + }, + { + "name": "Environment Variables", + "description": "Environment Variables" + }, + { + "name": "Files", + "description": "Files" + }, + { + "name": "Groups", + "description": "Groups" + }, + { + "name": "Group Members", + "description": "Group Members" + }, + { + "name": "Notifications", + "description": "Notifications" + }, + { + "name": "Permissions", + "description": "Permissions" + }, + { + "name": "Process Categories", + "description": "Process Categories" + }, + { + "name": "Processes", + "description": "Processes" + }, + { + "name": "Process Requests", + "description": "Process Requests" + }, + { + "name": "Request Files", + "description": "Request Files" + }, + { + "name": "Screen Categories", + "description": "Screen Categories" + }, + { + "name": "Screens", + "description": "Screens" + }, + { + "name": "Script Categories", + "description": "Script Categories" + }, + { + "name": "Scripts", + "description": "Scripts" + }, + { + "name": "Rebuild Script Executors", + "description": "Rebuild Script Executors" + }, + { + "name": "Security Logs", + "description": "Security Logs" + }, + { + "name": "Settings", + "description": "Settings" + }, + { + "name": "Signals", + "description": "Signals" + }, + { + "name": "Task Assignments", + "description": "Task Assignments" + }, + { + "name": "Tasks", + "description": "Tasks" + }, + { + "name": "Users", + "description": "Users" + }, + { + "name": "Personal Tokens", + "description": "Personal Tokens" + }, + { + "name": "Processes Variables", + "description": "Processes Variables" + } + ], "security": [ { "passport": [], diff --git a/tests/Feature/Api/TimerStartEventTest.php b/tests/Feature/Api/TimerStartEventTest.php index 88b483e7be..27635609ab 100644 --- a/tests/Feature/Api/TimerStartEventTest.php +++ b/tests/Feature/Api/TimerStartEventTest.php @@ -228,4 +228,25 @@ public function testScheduleMustNotStartTimerEventWhenProcessInactive() $task->type = 'TIMER_START_EVENT'; $manager->executeTimerStartEvent($task, json_decode($task->configuration)); } + + public function testScheduleMustNotStartHandleRepliesTimerWhenAbeInboundConfigInadequate() + { + // triggerStartEvent must not run when ABE inbound mail settings are missing/inadequate + WorkflowManager::shouldReceive('triggerStartEvent') + ->never() + ->with(\Mockery::any(), \Mockery::any(), \Mockery::any()); + + $data = []; + $data['name'] = 'Actions By Email - Handle Replies'; + $data['bpmn'] = Process::getProcessTemplate('TimerStartEvent.bpmn'); + + $process = Process::factory()->create($data); + + $manager = new TaskSchedulerManager(); + $task = new ScheduledTask(); + $task->process_id = $process->id; + $task->configuration = '{"type":"TimeCycle","interval":"R4\/2019-02-13T13:08:00Z\/PT1M", "element_id" : "_9"}'; + $task->type = 'TIMER_START_EVENT'; + $manager->executeTimerStartEvent($task, json_decode($task->configuration)); + } } diff --git a/tests/unit/ProcessMaker/Managers/TaskSchedulerManagerTest.php b/tests/unit/ProcessMaker/Managers/TaskSchedulerManagerTest.php index 7937ed4211..3e3d1c5adc 100644 --- a/tests/unit/ProcessMaker/Managers/TaskSchedulerManagerTest.php +++ b/tests/unit/ProcessMaker/Managers/TaskSchedulerManagerTest.php @@ -4,6 +4,10 @@ use Carbon\Carbon; use DateTime; +use ProcessMaker\Models\EnvironmentVariable; +use ProcessMaker\Models\Process; +use ProcessMaker\Models\Setting; +use ReflectionMethod; use Tests\TestCase; class TaskSchedulerManagerTest extends TestCase @@ -74,4 +78,64 @@ public function testTruncateDates() $rounded = $this->manager->truncateDateTime($date); $this->assertEquals('00:01:00', $rounded->format('H:i:s')); } + + public function testHasAdequateAbeInboundConfigurationForStandardAuth() + { + Setting::updateOrCreate(['key' => 'abe_imap_auth_method'], ['config' => '0']); + Setting::updateOrCreate(['key' => 'abe_imap_username'], ['config' => 'abe@test.com']); + Setting::updateOrCreate(['key' => 'abe_imap_password'], ['config' => '123Test']); + Setting::updateOrCreate(['key' => 'abe_imap_server'], ['config' => 'imap.example.com']); + Setting::updateOrCreate(['key' => 'abe_imap_port'], ['config' => '993']); + + $this->assertTrue((bool) $this->invokePrivateMethod('hasAdequateAbeInboundConfiguration')); + } + + public function testHasAdequateAbeInboundConfigurationForGoogleOauth() + { + Setting::updateOrCreate(['key' => 'abe_imap_auth_method'], ['config' => '1']); + Setting::updateOrCreate(['key' => 'abe_imap_username'], ['config' => 'abe@test.com']); + + foreach ([ + 'ABE_GMAIL_API_CLIENT_ID', + 'ABE_GMAIL_API_SECRET', + 'ABE_GMAIL_API_ACCESS_TOKEN', + 'ABE_GMAIL_API_REFRESH_TOKEN', + ] as $name) { + EnvironmentVariable::factory()->create([ + 'name' => $name, + 'value' => 'value-' . strtolower($name), + ]); + } + + $this->assertTrue((bool) $this->invokePrivateMethod('hasAdequateAbeInboundConfiguration')); + } + + public function testHasAdequateAbeInboundConfigurationReturnsFalseWhenUsernameIsMissing() + { + Setting::updateOrCreate(['key' => 'abe_imap_auth_method'], ['config' => '0']); + Setting::updateOrCreate(['key' => 'abe_imap_username'], ['config' => '']); + Setting::updateOrCreate(['key' => 'abe_imap_password'], ['config' => '123Test']); + Setting::updateOrCreate(['key' => 'abe_imap_server'], ['config' => 'imap.example.com']); + Setting::updateOrCreate(['key' => 'abe_imap_port'], ['config' => '993']); + + $this->assertFalse((bool) $this->invokePrivateMethod('hasAdequateAbeInboundConfiguration')); + } + + public function testIsHandleRepliesProcessUsesPackageKey() + { + $process = new Process([ + 'package_key' => 'package-actions-by-email/handle-replies', + 'name' => 'Anything', + ]); + + $this->assertTrue((bool) $this->invokePrivateMethod('isHandleRepliesProcess', [$process])); + } + + private function invokePrivateMethod(string $method, array $args = []) + { + $reflection = new ReflectionMethod($this->manager, $method); + $reflection->setAccessible(true); + + return $reflection->invokeArgs($this->manager, $args); + } }